{-# 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.ElastiCache.DeleteCacheParameterGroup
-- 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 the specified cache parameter group. You cannot delete a cache
-- parameter group if it is associated with any cache clusters. You cannot
-- delete the default cache parameter groups in your account.
module Amazonka.ElastiCache.DeleteCacheParameterGroup
  ( -- * Creating a Request
    DeleteCacheParameterGroup (..),
    newDeleteCacheParameterGroup,

    -- * Request Lenses
    deleteCacheParameterGroup_cacheParameterGroupName,

    -- * Destructuring the Response
    DeleteCacheParameterGroupResponse (..),
    newDeleteCacheParameterGroupResponse,
  )
where

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

-- | Represents the input of a @DeleteCacheParameterGroup@ operation.
--
-- /See:/ 'newDeleteCacheParameterGroup' smart constructor.
data DeleteCacheParameterGroup = DeleteCacheParameterGroup'
  { -- | The name of the cache parameter group to delete.
    --
    -- The specified cache security group must not be associated with any
    -- clusters.
    DeleteCacheParameterGroup -> Text
cacheParameterGroupName :: Prelude.Text
  }
  deriving (DeleteCacheParameterGroup -> DeleteCacheParameterGroup -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteCacheParameterGroup -> DeleteCacheParameterGroup -> Bool
$c/= :: DeleteCacheParameterGroup -> DeleteCacheParameterGroup -> Bool
== :: DeleteCacheParameterGroup -> DeleteCacheParameterGroup -> Bool
$c== :: DeleteCacheParameterGroup -> DeleteCacheParameterGroup -> Bool
Prelude.Eq, ReadPrec [DeleteCacheParameterGroup]
ReadPrec DeleteCacheParameterGroup
Int -> ReadS DeleteCacheParameterGroup
ReadS [DeleteCacheParameterGroup]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteCacheParameterGroup]
$creadListPrec :: ReadPrec [DeleteCacheParameterGroup]
readPrec :: ReadPrec DeleteCacheParameterGroup
$creadPrec :: ReadPrec DeleteCacheParameterGroup
readList :: ReadS [DeleteCacheParameterGroup]
$creadList :: ReadS [DeleteCacheParameterGroup]
readsPrec :: Int -> ReadS DeleteCacheParameterGroup
$creadsPrec :: Int -> ReadS DeleteCacheParameterGroup
Prelude.Read, Int -> DeleteCacheParameterGroup -> ShowS
[DeleteCacheParameterGroup] -> ShowS
DeleteCacheParameterGroup -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteCacheParameterGroup] -> ShowS
$cshowList :: [DeleteCacheParameterGroup] -> ShowS
show :: DeleteCacheParameterGroup -> String
$cshow :: DeleteCacheParameterGroup -> String
showsPrec :: Int -> DeleteCacheParameterGroup -> ShowS
$cshowsPrec :: Int -> DeleteCacheParameterGroup -> ShowS
Prelude.Show, forall x.
Rep DeleteCacheParameterGroup x -> DeleteCacheParameterGroup
forall x.
DeleteCacheParameterGroup -> Rep DeleteCacheParameterGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteCacheParameterGroup x -> DeleteCacheParameterGroup
$cfrom :: forall x.
DeleteCacheParameterGroup -> Rep DeleteCacheParameterGroup x
Prelude.Generic)

-- |
-- Create a value of 'DeleteCacheParameterGroup' 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:
--
-- 'cacheParameterGroupName', 'deleteCacheParameterGroup_cacheParameterGroupName' - The name of the cache parameter group to delete.
--
-- The specified cache security group must not be associated with any
-- clusters.
newDeleteCacheParameterGroup ::
  -- | 'cacheParameterGroupName'
  Prelude.Text ->
  DeleteCacheParameterGroup
newDeleteCacheParameterGroup :: Text -> DeleteCacheParameterGroup
newDeleteCacheParameterGroup
  Text
pCacheParameterGroupName_ =
    DeleteCacheParameterGroup'
      { $sel:cacheParameterGroupName:DeleteCacheParameterGroup' :: Text
cacheParameterGroupName =
          Text
pCacheParameterGroupName_
      }

-- | The name of the cache parameter group to delete.
--
-- The specified cache security group must not be associated with any
-- clusters.
deleteCacheParameterGroup_cacheParameterGroupName :: Lens.Lens' DeleteCacheParameterGroup Prelude.Text
deleteCacheParameterGroup_cacheParameterGroupName :: Lens' DeleteCacheParameterGroup Text
deleteCacheParameterGroup_cacheParameterGroupName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteCacheParameterGroup' {Text
cacheParameterGroupName :: Text
$sel:cacheParameterGroupName:DeleteCacheParameterGroup' :: DeleteCacheParameterGroup -> Text
cacheParameterGroupName} -> Text
cacheParameterGroupName) (\s :: DeleteCacheParameterGroup
s@DeleteCacheParameterGroup' {} Text
a -> DeleteCacheParameterGroup
s {$sel:cacheParameterGroupName:DeleteCacheParameterGroup' :: Text
cacheParameterGroupName = Text
a} :: DeleteCacheParameterGroup)

instance Core.AWSRequest DeleteCacheParameterGroup where
  type
    AWSResponse DeleteCacheParameterGroup =
      DeleteCacheParameterGroupResponse
  request :: (Service -> Service)
-> DeleteCacheParameterGroup -> Request DeleteCacheParameterGroup
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 DeleteCacheParameterGroup
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteCacheParameterGroup)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
      DeleteCacheParameterGroupResponse
DeleteCacheParameterGroupResponse'

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

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

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

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

instance Data.ToQuery DeleteCacheParameterGroup where
  toQuery :: DeleteCacheParameterGroup -> QueryString
toQuery DeleteCacheParameterGroup' {Text
cacheParameterGroupName :: Text
$sel:cacheParameterGroupName:DeleteCacheParameterGroup' :: DeleteCacheParameterGroup -> Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"DeleteCacheParameterGroup" :: Prelude.ByteString),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2015-02-02" :: Prelude.ByteString),
        ByteString
"CacheParameterGroupName"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
cacheParameterGroupName
      ]

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

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

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