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

instance Prelude.Hashable DeleteCacheParameterGroup

instance Prelude.NFData DeleteCacheParameterGroup

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

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

instance Core.ToQuery DeleteCacheParameterGroup where
  toQuery :: DeleteCacheParameterGroup -> QueryString
toQuery DeleteCacheParameterGroup' {Text
cacheParameterGroupName :: Text
$sel:cacheParameterGroupName:DeleteCacheParameterGroup' :: DeleteCacheParameterGroup -> 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
"DeleteCacheParameterGroup" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2015-02-02" :: Prelude.ByteString),
        ByteString
"CacheParameterGroupName"
          ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
cacheParameterGroupName
      ]

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