{-# 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.DocumentDB.DeleteDBClusterParameterGroup
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Deletes a specified cluster parameter group. The cluster parameter group
-- to be deleted can\'t be associated with any clusters.
module Amazonka.DocumentDB.DeleteDBClusterParameterGroup
  ( -- * Creating a Request
    DeleteDBClusterParameterGroup (..),
    newDeleteDBClusterParameterGroup,

    -- * Request Lenses
    deleteDBClusterParameterGroup_dbClusterParameterGroupName,

    -- * Destructuring the Response
    DeleteDBClusterParameterGroupResponse (..),
    newDeleteDBClusterParameterGroupResponse,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.DocumentDB.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | Represents the input to DeleteDBClusterParameterGroup.
--
-- /See:/ 'newDeleteDBClusterParameterGroup' smart constructor.
data DeleteDBClusterParameterGroup = DeleteDBClusterParameterGroup'
  { -- | The name of the cluster parameter group.
    --
    -- Constraints:
    --
    -- -   Must be the name of an existing cluster parameter group.
    --
    -- -   You can\'t delete a default cluster parameter group.
    --
    -- -   Cannot be associated with any clusters.
    DeleteDBClusterParameterGroup -> Text
dbClusterParameterGroupName :: Prelude.Text
  }
  deriving (DeleteDBClusterParameterGroup
-> DeleteDBClusterParameterGroup -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteDBClusterParameterGroup
-> DeleteDBClusterParameterGroup -> Bool
$c/= :: DeleteDBClusterParameterGroup
-> DeleteDBClusterParameterGroup -> Bool
== :: DeleteDBClusterParameterGroup
-> DeleteDBClusterParameterGroup -> Bool
$c== :: DeleteDBClusterParameterGroup
-> DeleteDBClusterParameterGroup -> Bool
Prelude.Eq, ReadPrec [DeleteDBClusterParameterGroup]
ReadPrec DeleteDBClusterParameterGroup
Int -> ReadS DeleteDBClusterParameterGroup
ReadS [DeleteDBClusterParameterGroup]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteDBClusterParameterGroup]
$creadListPrec :: ReadPrec [DeleteDBClusterParameterGroup]
readPrec :: ReadPrec DeleteDBClusterParameterGroup
$creadPrec :: ReadPrec DeleteDBClusterParameterGroup
readList :: ReadS [DeleteDBClusterParameterGroup]
$creadList :: ReadS [DeleteDBClusterParameterGroup]
readsPrec :: Int -> ReadS DeleteDBClusterParameterGroup
$creadsPrec :: Int -> ReadS DeleteDBClusterParameterGroup
Prelude.Read, Int -> DeleteDBClusterParameterGroup -> ShowS
[DeleteDBClusterParameterGroup] -> ShowS
DeleteDBClusterParameterGroup -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteDBClusterParameterGroup] -> ShowS
$cshowList :: [DeleteDBClusterParameterGroup] -> ShowS
show :: DeleteDBClusterParameterGroup -> String
$cshow :: DeleteDBClusterParameterGroup -> String
showsPrec :: Int -> DeleteDBClusterParameterGroup -> ShowS
$cshowsPrec :: Int -> DeleteDBClusterParameterGroup -> ShowS
Prelude.Show, forall x.
Rep DeleteDBClusterParameterGroup x
-> DeleteDBClusterParameterGroup
forall x.
DeleteDBClusterParameterGroup
-> Rep DeleteDBClusterParameterGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteDBClusterParameterGroup x
-> DeleteDBClusterParameterGroup
$cfrom :: forall x.
DeleteDBClusterParameterGroup
-> Rep DeleteDBClusterParameterGroup x
Prelude.Generic)

-- |
-- Create a value of 'DeleteDBClusterParameterGroup' 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:
--
-- 'dbClusterParameterGroupName', 'deleteDBClusterParameterGroup_dbClusterParameterGroupName' - The name of the cluster parameter group.
--
-- Constraints:
--
-- -   Must be the name of an existing cluster parameter group.
--
-- -   You can\'t delete a default cluster parameter group.
--
-- -   Cannot be associated with any clusters.
newDeleteDBClusterParameterGroup ::
  -- | 'dbClusterParameterGroupName'
  Prelude.Text ->
  DeleteDBClusterParameterGroup
newDeleteDBClusterParameterGroup :: Text -> DeleteDBClusterParameterGroup
newDeleteDBClusterParameterGroup
  Text
pDBClusterParameterGroupName_ =
    DeleteDBClusterParameterGroup'
      { $sel:dbClusterParameterGroupName:DeleteDBClusterParameterGroup' :: Text
dbClusterParameterGroupName =
          Text
pDBClusterParameterGroupName_
      }

-- | The name of the cluster parameter group.
--
-- Constraints:
--
-- -   Must be the name of an existing cluster parameter group.
--
-- -   You can\'t delete a default cluster parameter group.
--
-- -   Cannot be associated with any clusters.
deleteDBClusterParameterGroup_dbClusterParameterGroupName :: Lens.Lens' DeleteDBClusterParameterGroup Prelude.Text
deleteDBClusterParameterGroup_dbClusterParameterGroupName :: Lens' DeleteDBClusterParameterGroup Text
deleteDBClusterParameterGroup_dbClusterParameterGroupName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDBClusterParameterGroup' {Text
dbClusterParameterGroupName :: Text
$sel:dbClusterParameterGroupName:DeleteDBClusterParameterGroup' :: DeleteDBClusterParameterGroup -> Text
dbClusterParameterGroupName} -> Text
dbClusterParameterGroupName) (\s :: DeleteDBClusterParameterGroup
s@DeleteDBClusterParameterGroup' {} Text
a -> DeleteDBClusterParameterGroup
s {$sel:dbClusterParameterGroupName:DeleteDBClusterParameterGroup' :: Text
dbClusterParameterGroupName = Text
a} :: DeleteDBClusterParameterGroup)

instance
  Core.AWSRequest
    DeleteDBClusterParameterGroup
  where
  type
    AWSResponse DeleteDBClusterParameterGroup =
      DeleteDBClusterParameterGroupResponse
  request :: (Service -> Service)
-> DeleteDBClusterParameterGroup
-> Request DeleteDBClusterParameterGroup
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DeleteDBClusterParameterGroup
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteDBClusterParameterGroup)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
      DeleteDBClusterParameterGroupResponse
DeleteDBClusterParameterGroupResponse'

instance
  Prelude.Hashable
    DeleteDBClusterParameterGroup
  where
  hashWithSalt :: Int -> DeleteDBClusterParameterGroup -> Int
hashWithSalt Int
_salt DeleteDBClusterParameterGroup' {Text
dbClusterParameterGroupName :: Text
$sel:dbClusterParameterGroupName:DeleteDBClusterParameterGroup' :: DeleteDBClusterParameterGroup -> Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
dbClusterParameterGroupName

instance Prelude.NFData DeleteDBClusterParameterGroup where
  rnf :: DeleteDBClusterParameterGroup -> ()
rnf DeleteDBClusterParameterGroup' {Text
dbClusterParameterGroupName :: Text
$sel:dbClusterParameterGroupName:DeleteDBClusterParameterGroup' :: DeleteDBClusterParameterGroup -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
dbClusterParameterGroupName

instance Data.ToHeaders DeleteDBClusterParameterGroup where
  toHeaders :: DeleteDBClusterParameterGroup -> [Header]
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

instance Data.ToPath DeleteDBClusterParameterGroup where
  toPath :: DeleteDBClusterParameterGroup -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Data.ToQuery DeleteDBClusterParameterGroup where
  toQuery :: DeleteDBClusterParameterGroup -> QueryString
toQuery DeleteDBClusterParameterGroup' {Text
dbClusterParameterGroupName :: Text
$sel:dbClusterParameterGroupName:DeleteDBClusterParameterGroup' :: DeleteDBClusterParameterGroup -> Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: ( ByteString
"DeleteDBClusterParameterGroup" ::
                      Prelude.ByteString
                  ),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2014-10-31" :: Prelude.ByteString),
        ByteString
"DBClusterParameterGroupName"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
dbClusterParameterGroupName
      ]

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

-- |
-- Create a value of 'DeleteDBClusterParameterGroupResponse' 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.
newDeleteDBClusterParameterGroupResponse ::
  DeleteDBClusterParameterGroupResponse
newDeleteDBClusterParameterGroupResponse :: DeleteDBClusterParameterGroupResponse
newDeleteDBClusterParameterGroupResponse =
  DeleteDBClusterParameterGroupResponse
DeleteDBClusterParameterGroupResponse'

instance
  Prelude.NFData
    DeleteDBClusterParameterGroupResponse
  where
  rnf :: DeleteDBClusterParameterGroupResponse -> ()
rnf DeleteDBClusterParameterGroupResponse
_ = ()