{-# 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-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)
--
-- 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 Amazonka.DocumentDB.Types
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 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
(DeleteDBClusterParameterGroup
 -> DeleteDBClusterParameterGroup -> Bool)
-> (DeleteDBClusterParameterGroup
    -> DeleteDBClusterParameterGroup -> Bool)
-> Eq DeleteDBClusterParameterGroup
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]
(Int -> ReadS DeleteDBClusterParameterGroup)
-> ReadS [DeleteDBClusterParameterGroup]
-> ReadPrec DeleteDBClusterParameterGroup
-> ReadPrec [DeleteDBClusterParameterGroup]
-> Read 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
(Int -> DeleteDBClusterParameterGroup -> ShowS)
-> (DeleteDBClusterParameterGroup -> String)
-> ([DeleteDBClusterParameterGroup] -> ShowS)
-> Show DeleteDBClusterParameterGroup
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.
 DeleteDBClusterParameterGroup
 -> Rep DeleteDBClusterParameterGroup x)
-> (forall x.
    Rep DeleteDBClusterParameterGroup x
    -> DeleteDBClusterParameterGroup)
-> Generic DeleteDBClusterParameterGroup
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' :: Text -> DeleteDBClusterParameterGroup
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 :: (Text -> f Text)
-> DeleteDBClusterParameterGroup -> f DeleteDBClusterParameterGroup
deleteDBClusterParameterGroup_dbClusterParameterGroupName = (DeleteDBClusterParameterGroup -> Text)
-> (DeleteDBClusterParameterGroup
    -> Text -> DeleteDBClusterParameterGroup)
-> Lens
     DeleteDBClusterParameterGroup
     DeleteDBClusterParameterGroup
     Text
     Text
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 :: DeleteDBClusterParameterGroup
-> Request DeleteDBClusterParameterGroup
request = Service
-> DeleteDBClusterParameterGroup
-> Request DeleteDBClusterParameterGroup
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy DeleteDBClusterParameterGroup
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteDBClusterParameterGroup)))
response =
    AWSResponse DeleteDBClusterParameterGroup
-> Logger
-> Service
-> Proxy DeleteDBClusterParameterGroup
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteDBClusterParameterGroup)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
      AWSResponse DeleteDBClusterParameterGroup
DeleteDBClusterParameterGroupResponse
DeleteDBClusterParameterGroupResponse'

instance
  Prelude.Hashable
    DeleteDBClusterParameterGroup

instance Prelude.NFData DeleteDBClusterParameterGroup

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

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

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

-- | /See:/ 'newDeleteDBClusterParameterGroupResponse' smart constructor.
data DeleteDBClusterParameterGroupResponse = DeleteDBClusterParameterGroupResponse'
  {
  }
  deriving (DeleteDBClusterParameterGroupResponse
-> DeleteDBClusterParameterGroupResponse -> Bool
(DeleteDBClusterParameterGroupResponse
 -> DeleteDBClusterParameterGroupResponse -> Bool)
-> (DeleteDBClusterParameterGroupResponse
    -> DeleteDBClusterParameterGroupResponse -> Bool)
-> Eq DeleteDBClusterParameterGroupResponse
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]
(Int -> ReadS DeleteDBClusterParameterGroupResponse)
-> ReadS [DeleteDBClusterParameterGroupResponse]
-> ReadPrec DeleteDBClusterParameterGroupResponse
-> ReadPrec [DeleteDBClusterParameterGroupResponse]
-> Read 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
(Int -> DeleteDBClusterParameterGroupResponse -> ShowS)
-> (DeleteDBClusterParameterGroupResponse -> String)
-> ([DeleteDBClusterParameterGroupResponse] -> ShowS)
-> Show DeleteDBClusterParameterGroupResponse
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.
 DeleteDBClusterParameterGroupResponse
 -> Rep DeleteDBClusterParameterGroupResponse x)
-> (forall x.
    Rep DeleteDBClusterParameterGroupResponse x
    -> DeleteDBClusterParameterGroupResponse)
-> Generic DeleteDBClusterParameterGroupResponse
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