{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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.
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'
    { $sel:clientToken:DeleteRuleGroupsNamespace' :: Maybe Text
clientToken =
        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 :: Lens' DeleteRuleGroupsNamespace (Maybe Text)
deleteRuleGroupsNamespace_clientToken = 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 :: Lens' DeleteRuleGroupsNamespace Text
deleteRuleGroupsNamespace_name = 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 :: Lens' DeleteRuleGroupsNamespace Text
deleteRuleGroupsNamespace_workspaceId = 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 :: (Service -> Service)
-> DeleteRuleGroupsNamespace -> Request DeleteRuleGroupsNamespace
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.delete (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DeleteRuleGroupsNamespace
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteRuleGroupsNamespace)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
      DeleteRuleGroupsNamespaceResponse
DeleteRuleGroupsNamespaceResponse'

instance Prelude.Hashable DeleteRuleGroupsNamespace where
  hashWithSalt :: Int -> DeleteRuleGroupsNamespace -> Int
hashWithSalt Int
_salt 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
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
clientToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
workspaceId

instance Prelude.NFData DeleteRuleGroupsNamespace where
  rnf :: DeleteRuleGroupsNamespace -> ()
rnf 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
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
clientToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
workspaceId

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

instance Data.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
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/workspaces/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
workspaceId,
        ByteString
"/rulegroupsnamespaces/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
name
      ]

instance Data.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
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"clientToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
clientToken]

-- | /See:/ 'newDeleteRuleGroupsNamespaceResponse' smart constructor.
data DeleteRuleGroupsNamespaceResponse = DeleteRuleGroupsNamespaceResponse'
  {
  }
  deriving (DeleteRuleGroupsNamespaceResponse
-> DeleteRuleGroupsNamespaceResponse -> Bool
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]
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
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.
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
  where
  rnf :: DeleteRuleGroupsNamespaceResponse -> ()
rnf DeleteRuleGroupsNamespaceResponse
_ = ()