{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.AMP.DeleteRuleGroupsNamespace
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Delete a rule groups namespace.
module Amazonka.AMP.DeleteRuleGroupsNamespace
  ( -- * Creating a Request
    DeleteRuleGroupsNamespace (..),
    newDeleteRuleGroupsNamespace,

    -- * Request Lenses
    deleteRuleGroupsNamespace_clientToken,
    deleteRuleGroupsNamespace_name,
    deleteRuleGroupsNamespace_workspaceId,

    -- * Destructuring the Response
    DeleteRuleGroupsNamespaceResponse (..),
    newDeleteRuleGroupsNamespaceResponse,
  )
where

import Amazonka.AMP.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | Represents the input of a DeleteRuleGroupsNamespace operation.
--
-- /See:/ 'newDeleteRuleGroupsNamespace' smart constructor.
data DeleteRuleGroupsNamespace = DeleteRuleGroupsNamespace'
  { -- | Optional, unique, case-sensitive, user-provided identifier to ensure the
    -- idempotency of the request.
    DeleteRuleGroupsNamespace -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
    -- | The rule groups namespace name.
    DeleteRuleGroupsNamespace -> Text
name :: Prelude.Text,
    -- | The ID of the workspace to delete rule group definition.
    DeleteRuleGroupsNamespace -> Text
workspaceId :: Prelude.Text
  }
  deriving (DeleteRuleGroupsNamespace -> DeleteRuleGroupsNamespace -> Bool
(DeleteRuleGroupsNamespace -> DeleteRuleGroupsNamespace -> Bool)
-> (DeleteRuleGroupsNamespace -> DeleteRuleGroupsNamespace -> Bool)
-> Eq DeleteRuleGroupsNamespace
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteRuleGroupsNamespace -> DeleteRuleGroupsNamespace -> Bool
$c/= :: DeleteRuleGroupsNamespace -> DeleteRuleGroupsNamespace -> Bool
== :: DeleteRuleGroupsNamespace -> DeleteRuleGroupsNamespace -> Bool
$c== :: DeleteRuleGroupsNamespace -> DeleteRuleGroupsNamespace -> Bool
Prelude.Eq, ReadPrec [DeleteRuleGroupsNamespace]
ReadPrec DeleteRuleGroupsNamespace
Int -> ReadS DeleteRuleGroupsNamespace
ReadS [DeleteRuleGroupsNamespace]
(Int -> ReadS DeleteRuleGroupsNamespace)
-> ReadS [DeleteRuleGroupsNamespace]
-> ReadPrec DeleteRuleGroupsNamespace
-> ReadPrec [DeleteRuleGroupsNamespace]
-> Read DeleteRuleGroupsNamespace
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteRuleGroupsNamespace]
$creadListPrec :: ReadPrec [DeleteRuleGroupsNamespace]
readPrec :: ReadPrec DeleteRuleGroupsNamespace
$creadPrec :: ReadPrec DeleteRuleGroupsNamespace
readList :: ReadS [DeleteRuleGroupsNamespace]
$creadList :: ReadS [DeleteRuleGroupsNamespace]
readsPrec :: Int -> ReadS DeleteRuleGroupsNamespace
$creadsPrec :: Int -> ReadS DeleteRuleGroupsNamespace
Prelude.Read, Int -> DeleteRuleGroupsNamespace -> ShowS
[DeleteRuleGroupsNamespace] -> ShowS
DeleteRuleGroupsNamespace -> String
(Int -> DeleteRuleGroupsNamespace -> ShowS)
-> (DeleteRuleGroupsNamespace -> String)
-> ([DeleteRuleGroupsNamespace] -> ShowS)
-> Show DeleteRuleGroupsNamespace
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteRuleGroupsNamespace] -> ShowS
$cshowList :: [DeleteRuleGroupsNamespace] -> ShowS
show :: DeleteRuleGroupsNamespace -> String
$cshow :: DeleteRuleGroupsNamespace -> String
showsPrec :: Int -> DeleteRuleGroupsNamespace -> ShowS
$cshowsPrec :: Int -> DeleteRuleGroupsNamespace -> ShowS
Prelude.Show, (forall x.
 DeleteRuleGroupsNamespace -> Rep DeleteRuleGroupsNamespace x)
-> (forall x.
    Rep DeleteRuleGroupsNamespace x -> DeleteRuleGroupsNamespace)
-> Generic DeleteRuleGroupsNamespace
forall x.
Rep DeleteRuleGroupsNamespace x -> DeleteRuleGroupsNamespace
forall x.
DeleteRuleGroupsNamespace -> Rep DeleteRuleGroupsNamespace x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteRuleGroupsNamespace x -> DeleteRuleGroupsNamespace
$cfrom :: forall x.
DeleteRuleGroupsNamespace -> Rep DeleteRuleGroupsNamespace x
Prelude.Generic)

-- |
-- Create a value of 'DeleteRuleGroupsNamespace' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'clientToken', 'deleteRuleGroupsNamespace_clientToken' - Optional, unique, case-sensitive, user-provided identifier to ensure the
-- idempotency of the request.
--
-- 'name', 'deleteRuleGroupsNamespace_name' - The rule groups namespace name.
--
-- 'workspaceId', 'deleteRuleGroupsNamespace_workspaceId' - The ID of the workspace to delete rule group definition.
newDeleteRuleGroupsNamespace ::
  -- | 'name'
  Prelude.Text ->
  -- | 'workspaceId'
  Prelude.Text ->
  DeleteRuleGroupsNamespace
newDeleteRuleGroupsNamespace :: Text -> Text -> DeleteRuleGroupsNamespace
newDeleteRuleGroupsNamespace Text
pName_ Text
pWorkspaceId_ =
  DeleteRuleGroupsNamespace' :: Maybe Text -> Text -> Text -> DeleteRuleGroupsNamespace
DeleteRuleGroupsNamespace'
    { $sel:clientToken:DeleteRuleGroupsNamespace' :: Maybe Text
clientToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:DeleteRuleGroupsNamespace' :: Text
name = Text
pName_,
      $sel:workspaceId:DeleteRuleGroupsNamespace' :: Text
workspaceId = Text
pWorkspaceId_
    }

-- | Optional, unique, case-sensitive, user-provided identifier to ensure the
-- idempotency of the request.
deleteRuleGroupsNamespace_clientToken :: Lens.Lens' DeleteRuleGroupsNamespace (Prelude.Maybe Prelude.Text)
deleteRuleGroupsNamespace_clientToken :: (Maybe Text -> f (Maybe Text))
-> DeleteRuleGroupsNamespace -> f DeleteRuleGroupsNamespace
deleteRuleGroupsNamespace_clientToken = (DeleteRuleGroupsNamespace -> Maybe Text)
-> (DeleteRuleGroupsNamespace
    -> Maybe Text -> DeleteRuleGroupsNamespace)
-> Lens
     DeleteRuleGroupsNamespace
     DeleteRuleGroupsNamespace
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteRuleGroupsNamespace' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:DeleteRuleGroupsNamespace' :: DeleteRuleGroupsNamespace -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: DeleteRuleGroupsNamespace
s@DeleteRuleGroupsNamespace' {} Maybe Text
a -> DeleteRuleGroupsNamespace
s {$sel:clientToken:DeleteRuleGroupsNamespace' :: Maybe Text
clientToken = Maybe Text
a} :: DeleteRuleGroupsNamespace)

-- | The rule groups namespace name.
deleteRuleGroupsNamespace_name :: Lens.Lens' DeleteRuleGroupsNamespace Prelude.Text
deleteRuleGroupsNamespace_name :: (Text -> f Text)
-> DeleteRuleGroupsNamespace -> f DeleteRuleGroupsNamespace
deleteRuleGroupsNamespace_name = (DeleteRuleGroupsNamespace -> Text)
-> (DeleteRuleGroupsNamespace -> Text -> DeleteRuleGroupsNamespace)
-> Lens
     DeleteRuleGroupsNamespace DeleteRuleGroupsNamespace Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteRuleGroupsNamespace' {Text
name :: Text
$sel:name:DeleteRuleGroupsNamespace' :: DeleteRuleGroupsNamespace -> Text
name} -> Text
name) (\s :: DeleteRuleGroupsNamespace
s@DeleteRuleGroupsNamespace' {} Text
a -> DeleteRuleGroupsNamespace
s {$sel:name:DeleteRuleGroupsNamespace' :: Text
name = Text
a} :: DeleteRuleGroupsNamespace)

-- | The ID of the workspace to delete rule group definition.
deleteRuleGroupsNamespace_workspaceId :: Lens.Lens' DeleteRuleGroupsNamespace Prelude.Text
deleteRuleGroupsNamespace_workspaceId :: (Text -> f Text)
-> DeleteRuleGroupsNamespace -> f DeleteRuleGroupsNamespace
deleteRuleGroupsNamespace_workspaceId = (DeleteRuleGroupsNamespace -> Text)
-> (DeleteRuleGroupsNamespace -> Text -> DeleteRuleGroupsNamespace)
-> Lens
     DeleteRuleGroupsNamespace DeleteRuleGroupsNamespace Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteRuleGroupsNamespace' {Text
workspaceId :: Text
$sel:workspaceId:DeleteRuleGroupsNamespace' :: DeleteRuleGroupsNamespace -> Text
workspaceId} -> Text
workspaceId) (\s :: DeleteRuleGroupsNamespace
s@DeleteRuleGroupsNamespace' {} Text
a -> DeleteRuleGroupsNamespace
s {$sel:workspaceId:DeleteRuleGroupsNamespace' :: Text
workspaceId = Text
a} :: DeleteRuleGroupsNamespace)

instance Core.AWSRequest DeleteRuleGroupsNamespace where
  type
    AWSResponse DeleteRuleGroupsNamespace =
      DeleteRuleGroupsNamespaceResponse
  request :: DeleteRuleGroupsNamespace -> Request DeleteRuleGroupsNamespace
request = Service
-> DeleteRuleGroupsNamespace -> Request DeleteRuleGroupsNamespace
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
  response :: Logger
-> Service
-> Proxy DeleteRuleGroupsNamespace
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteRuleGroupsNamespace)))
response =
    AWSResponse DeleteRuleGroupsNamespace
-> Logger
-> Service
-> Proxy DeleteRuleGroupsNamespace
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteRuleGroupsNamespace)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
      AWSResponse DeleteRuleGroupsNamespace
DeleteRuleGroupsNamespaceResponse
DeleteRuleGroupsNamespaceResponse'

instance Prelude.Hashable DeleteRuleGroupsNamespace

instance Prelude.NFData DeleteRuleGroupsNamespace

instance Core.ToHeaders DeleteRuleGroupsNamespace where
  toHeaders :: DeleteRuleGroupsNamespace -> [Header]
toHeaders =
    [Header] -> DeleteRuleGroupsNamespace -> [Header]
forall a b. a -> b -> a
Prelude.const
      ( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToPath DeleteRuleGroupsNamespace where
  toPath :: DeleteRuleGroupsNamespace -> ByteString
toPath DeleteRuleGroupsNamespace' {Maybe Text
Text
workspaceId :: Text
name :: Text
clientToken :: Maybe Text
$sel:workspaceId:DeleteRuleGroupsNamespace' :: DeleteRuleGroupsNamespace -> Text
$sel:name:DeleteRuleGroupsNamespace' :: DeleteRuleGroupsNamespace -> Text
$sel:clientToken:DeleteRuleGroupsNamespace' :: DeleteRuleGroupsNamespace -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/workspaces/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
workspaceId,
        ByteString
"/rulegroupsnamespaces/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
name
      ]

instance Core.ToQuery DeleteRuleGroupsNamespace where
  toQuery :: DeleteRuleGroupsNamespace -> QueryString
toQuery DeleteRuleGroupsNamespace' {Maybe Text
Text
workspaceId :: Text
name :: Text
clientToken :: Maybe Text
$sel:workspaceId:DeleteRuleGroupsNamespace' :: DeleteRuleGroupsNamespace -> Text
$sel:name:DeleteRuleGroupsNamespace' :: DeleteRuleGroupsNamespace -> Text
$sel:clientToken:DeleteRuleGroupsNamespace' :: DeleteRuleGroupsNamespace -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"clientToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
clientToken]

-- | /See:/ 'newDeleteRuleGroupsNamespaceResponse' smart constructor.
data DeleteRuleGroupsNamespaceResponse = DeleteRuleGroupsNamespaceResponse'
  {
  }
  deriving (DeleteRuleGroupsNamespaceResponse
-> DeleteRuleGroupsNamespaceResponse -> Bool
(DeleteRuleGroupsNamespaceResponse
 -> DeleteRuleGroupsNamespaceResponse -> Bool)
-> (DeleteRuleGroupsNamespaceResponse
    -> DeleteRuleGroupsNamespaceResponse -> Bool)
-> Eq DeleteRuleGroupsNamespaceResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteRuleGroupsNamespaceResponse
-> DeleteRuleGroupsNamespaceResponse -> Bool
$c/= :: DeleteRuleGroupsNamespaceResponse
-> DeleteRuleGroupsNamespaceResponse -> Bool
== :: DeleteRuleGroupsNamespaceResponse
-> DeleteRuleGroupsNamespaceResponse -> Bool
$c== :: DeleteRuleGroupsNamespaceResponse
-> DeleteRuleGroupsNamespaceResponse -> Bool
Prelude.Eq, ReadPrec [DeleteRuleGroupsNamespaceResponse]
ReadPrec DeleteRuleGroupsNamespaceResponse
Int -> ReadS DeleteRuleGroupsNamespaceResponse
ReadS [DeleteRuleGroupsNamespaceResponse]
(Int -> ReadS DeleteRuleGroupsNamespaceResponse)
-> ReadS [DeleteRuleGroupsNamespaceResponse]
-> ReadPrec DeleteRuleGroupsNamespaceResponse
-> ReadPrec [DeleteRuleGroupsNamespaceResponse]
-> Read DeleteRuleGroupsNamespaceResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteRuleGroupsNamespaceResponse]
$creadListPrec :: ReadPrec [DeleteRuleGroupsNamespaceResponse]
readPrec :: ReadPrec DeleteRuleGroupsNamespaceResponse
$creadPrec :: ReadPrec DeleteRuleGroupsNamespaceResponse
readList :: ReadS [DeleteRuleGroupsNamespaceResponse]
$creadList :: ReadS [DeleteRuleGroupsNamespaceResponse]
readsPrec :: Int -> ReadS DeleteRuleGroupsNamespaceResponse
$creadsPrec :: Int -> ReadS DeleteRuleGroupsNamespaceResponse
Prelude.Read, Int -> DeleteRuleGroupsNamespaceResponse -> ShowS
[DeleteRuleGroupsNamespaceResponse] -> ShowS
DeleteRuleGroupsNamespaceResponse -> String
(Int -> DeleteRuleGroupsNamespaceResponse -> ShowS)
-> (DeleteRuleGroupsNamespaceResponse -> String)
-> ([DeleteRuleGroupsNamespaceResponse] -> ShowS)
-> Show DeleteRuleGroupsNamespaceResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteRuleGroupsNamespaceResponse] -> ShowS
$cshowList :: [DeleteRuleGroupsNamespaceResponse] -> ShowS
show :: DeleteRuleGroupsNamespaceResponse -> String
$cshow :: DeleteRuleGroupsNamespaceResponse -> String
showsPrec :: Int -> DeleteRuleGroupsNamespaceResponse -> ShowS
$cshowsPrec :: Int -> DeleteRuleGroupsNamespaceResponse -> ShowS
Prelude.Show, (forall x.
 DeleteRuleGroupsNamespaceResponse
 -> Rep DeleteRuleGroupsNamespaceResponse x)
-> (forall x.
    Rep DeleteRuleGroupsNamespaceResponse x
    -> DeleteRuleGroupsNamespaceResponse)
-> Generic DeleteRuleGroupsNamespaceResponse
forall x.
Rep DeleteRuleGroupsNamespaceResponse x
-> DeleteRuleGroupsNamespaceResponse
forall x.
DeleteRuleGroupsNamespaceResponse
-> Rep DeleteRuleGroupsNamespaceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteRuleGroupsNamespaceResponse x
-> DeleteRuleGroupsNamespaceResponse
$cfrom :: forall x.
DeleteRuleGroupsNamespaceResponse
-> Rep DeleteRuleGroupsNamespaceResponse x
Prelude.Generic)

-- |
-- Create a value of 'DeleteRuleGroupsNamespaceResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
newDeleteRuleGroupsNamespaceResponse ::
  DeleteRuleGroupsNamespaceResponse
newDeleteRuleGroupsNamespaceResponse :: DeleteRuleGroupsNamespaceResponse
newDeleteRuleGroupsNamespaceResponse =
  DeleteRuleGroupsNamespaceResponse
DeleteRuleGroupsNamespaceResponse'

instance
  Prelude.NFData
    DeleteRuleGroupsNamespaceResponse