{-# 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.DeleteCacheSubnetGroup
-- 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 cache subnet group.
--
-- You cannot delete a default cache subnet group or one that is associated
-- with any clusters.
module Amazonka.ElastiCache.DeleteCacheSubnetGroup
  ( -- * Creating a Request
    DeleteCacheSubnetGroup (..),
    newDeleteCacheSubnetGroup,

    -- * Request Lenses
    deleteCacheSubnetGroup_cacheSubnetGroupName,

    -- * Destructuring the Response
    DeleteCacheSubnetGroupResponse (..),
    newDeleteCacheSubnetGroupResponse,
  )
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 @DeleteCacheSubnetGroup@ operation.
--
-- /See:/ 'newDeleteCacheSubnetGroup' smart constructor.
data DeleteCacheSubnetGroup = DeleteCacheSubnetGroup'
  { -- | The name of the cache subnet group to delete.
    --
    -- Constraints: Must contain no more than 255 alphanumeric characters or
    -- hyphens.
    DeleteCacheSubnetGroup -> Text
cacheSubnetGroupName :: Prelude.Text
  }
  deriving (DeleteCacheSubnetGroup -> DeleteCacheSubnetGroup -> Bool
(DeleteCacheSubnetGroup -> DeleteCacheSubnetGroup -> Bool)
-> (DeleteCacheSubnetGroup -> DeleteCacheSubnetGroup -> Bool)
-> Eq DeleteCacheSubnetGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteCacheSubnetGroup -> DeleteCacheSubnetGroup -> Bool
$c/= :: DeleteCacheSubnetGroup -> DeleteCacheSubnetGroup -> Bool
== :: DeleteCacheSubnetGroup -> DeleteCacheSubnetGroup -> Bool
$c== :: DeleteCacheSubnetGroup -> DeleteCacheSubnetGroup -> Bool
Prelude.Eq, ReadPrec [DeleteCacheSubnetGroup]
ReadPrec DeleteCacheSubnetGroup
Int -> ReadS DeleteCacheSubnetGroup
ReadS [DeleteCacheSubnetGroup]
(Int -> ReadS DeleteCacheSubnetGroup)
-> ReadS [DeleteCacheSubnetGroup]
-> ReadPrec DeleteCacheSubnetGroup
-> ReadPrec [DeleteCacheSubnetGroup]
-> Read DeleteCacheSubnetGroup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteCacheSubnetGroup]
$creadListPrec :: ReadPrec [DeleteCacheSubnetGroup]
readPrec :: ReadPrec DeleteCacheSubnetGroup
$creadPrec :: ReadPrec DeleteCacheSubnetGroup
readList :: ReadS [DeleteCacheSubnetGroup]
$creadList :: ReadS [DeleteCacheSubnetGroup]
readsPrec :: Int -> ReadS DeleteCacheSubnetGroup
$creadsPrec :: Int -> ReadS DeleteCacheSubnetGroup
Prelude.Read, Int -> DeleteCacheSubnetGroup -> ShowS
[DeleteCacheSubnetGroup] -> ShowS
DeleteCacheSubnetGroup -> String
(Int -> DeleteCacheSubnetGroup -> ShowS)
-> (DeleteCacheSubnetGroup -> String)
-> ([DeleteCacheSubnetGroup] -> ShowS)
-> Show DeleteCacheSubnetGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteCacheSubnetGroup] -> ShowS
$cshowList :: [DeleteCacheSubnetGroup] -> ShowS
show :: DeleteCacheSubnetGroup -> String
$cshow :: DeleteCacheSubnetGroup -> String
showsPrec :: Int -> DeleteCacheSubnetGroup -> ShowS
$cshowsPrec :: Int -> DeleteCacheSubnetGroup -> ShowS
Prelude.Show, (forall x. DeleteCacheSubnetGroup -> Rep DeleteCacheSubnetGroup x)
-> (forall x.
    Rep DeleteCacheSubnetGroup x -> DeleteCacheSubnetGroup)
-> Generic DeleteCacheSubnetGroup
forall x. Rep DeleteCacheSubnetGroup x -> DeleteCacheSubnetGroup
forall x. DeleteCacheSubnetGroup -> Rep DeleteCacheSubnetGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteCacheSubnetGroup x -> DeleteCacheSubnetGroup
$cfrom :: forall x. DeleteCacheSubnetGroup -> Rep DeleteCacheSubnetGroup x
Prelude.Generic)

-- |
-- Create a value of 'DeleteCacheSubnetGroup' 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:
--
-- 'cacheSubnetGroupName', 'deleteCacheSubnetGroup_cacheSubnetGroupName' - The name of the cache subnet group to delete.
--
-- Constraints: Must contain no more than 255 alphanumeric characters or
-- hyphens.
newDeleteCacheSubnetGroup ::
  -- | 'cacheSubnetGroupName'
  Prelude.Text ->
  DeleteCacheSubnetGroup
newDeleteCacheSubnetGroup :: Text -> DeleteCacheSubnetGroup
newDeleteCacheSubnetGroup Text
pCacheSubnetGroupName_ =
  DeleteCacheSubnetGroup' :: Text -> DeleteCacheSubnetGroup
DeleteCacheSubnetGroup'
    { $sel:cacheSubnetGroupName:DeleteCacheSubnetGroup' :: Text
cacheSubnetGroupName =
        Text
pCacheSubnetGroupName_
    }

-- | The name of the cache subnet group to delete.
--
-- Constraints: Must contain no more than 255 alphanumeric characters or
-- hyphens.
deleteCacheSubnetGroup_cacheSubnetGroupName :: Lens.Lens' DeleteCacheSubnetGroup Prelude.Text
deleteCacheSubnetGroup_cacheSubnetGroupName :: (Text -> f Text)
-> DeleteCacheSubnetGroup -> f DeleteCacheSubnetGroup
deleteCacheSubnetGroup_cacheSubnetGroupName = (DeleteCacheSubnetGroup -> Text)
-> (DeleteCacheSubnetGroup -> Text -> DeleteCacheSubnetGroup)
-> Lens DeleteCacheSubnetGroup DeleteCacheSubnetGroup Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteCacheSubnetGroup' {Text
cacheSubnetGroupName :: Text
$sel:cacheSubnetGroupName:DeleteCacheSubnetGroup' :: DeleteCacheSubnetGroup -> Text
cacheSubnetGroupName} -> Text
cacheSubnetGroupName) (\s :: DeleteCacheSubnetGroup
s@DeleteCacheSubnetGroup' {} Text
a -> DeleteCacheSubnetGroup
s {$sel:cacheSubnetGroupName:DeleteCacheSubnetGroup' :: Text
cacheSubnetGroupName = Text
a} :: DeleteCacheSubnetGroup)

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

instance Prelude.Hashable DeleteCacheSubnetGroup

instance Prelude.NFData DeleteCacheSubnetGroup

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

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

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

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

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

instance
  Prelude.NFData
    DeleteCacheSubnetGroupResponse