{-# 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 #-}
module Amazonka.ElastiCache.DeleteCacheCluster
(
DeleteCacheCluster (..),
newDeleteCacheCluster,
deleteCacheCluster_finalSnapshotIdentifier,
deleteCacheCluster_cacheClusterId,
DeleteCacheClusterResponse (..),
newDeleteCacheClusterResponse,
deleteCacheClusterResponse_cacheCluster,
deleteCacheClusterResponse_httpStatus,
)
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
data DeleteCacheCluster = DeleteCacheCluster'
{
DeleteCacheCluster -> Maybe Text
finalSnapshotIdentifier :: Prelude.Maybe Prelude.Text,
DeleteCacheCluster -> Text
cacheClusterId :: Prelude.Text
}
deriving (DeleteCacheCluster -> DeleteCacheCluster -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteCacheCluster -> DeleteCacheCluster -> Bool
$c/= :: DeleteCacheCluster -> DeleteCacheCluster -> Bool
== :: DeleteCacheCluster -> DeleteCacheCluster -> Bool
$c== :: DeleteCacheCluster -> DeleteCacheCluster -> Bool
Prelude.Eq, ReadPrec [DeleteCacheCluster]
ReadPrec DeleteCacheCluster
Int -> ReadS DeleteCacheCluster
ReadS [DeleteCacheCluster]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteCacheCluster]
$creadListPrec :: ReadPrec [DeleteCacheCluster]
readPrec :: ReadPrec DeleteCacheCluster
$creadPrec :: ReadPrec DeleteCacheCluster
readList :: ReadS [DeleteCacheCluster]
$creadList :: ReadS [DeleteCacheCluster]
readsPrec :: Int -> ReadS DeleteCacheCluster
$creadsPrec :: Int -> ReadS DeleteCacheCluster
Prelude.Read, Int -> DeleteCacheCluster -> ShowS
[DeleteCacheCluster] -> ShowS
DeleteCacheCluster -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteCacheCluster] -> ShowS
$cshowList :: [DeleteCacheCluster] -> ShowS
show :: DeleteCacheCluster -> String
$cshow :: DeleteCacheCluster -> String
showsPrec :: Int -> DeleteCacheCluster -> ShowS
$cshowsPrec :: Int -> DeleteCacheCluster -> ShowS
Prelude.Show, forall x. Rep DeleteCacheCluster x -> DeleteCacheCluster
forall x. DeleteCacheCluster -> Rep DeleteCacheCluster x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteCacheCluster x -> DeleteCacheCluster
$cfrom :: forall x. DeleteCacheCluster -> Rep DeleteCacheCluster x
Prelude.Generic)
newDeleteCacheCluster ::
Prelude.Text ->
DeleteCacheCluster
newDeleteCacheCluster :: Text -> DeleteCacheCluster
newDeleteCacheCluster Text
pCacheClusterId_ =
DeleteCacheCluster'
{ $sel:finalSnapshotIdentifier:DeleteCacheCluster' :: Maybe Text
finalSnapshotIdentifier =
forall a. Maybe a
Prelude.Nothing,
$sel:cacheClusterId:DeleteCacheCluster' :: Text
cacheClusterId = Text
pCacheClusterId_
}
deleteCacheCluster_finalSnapshotIdentifier :: Lens.Lens' DeleteCacheCluster (Prelude.Maybe Prelude.Text)
deleteCacheCluster_finalSnapshotIdentifier :: Lens' DeleteCacheCluster (Maybe Text)
deleteCacheCluster_finalSnapshotIdentifier = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteCacheCluster' {Maybe Text
finalSnapshotIdentifier :: Maybe Text
$sel:finalSnapshotIdentifier:DeleteCacheCluster' :: DeleteCacheCluster -> Maybe Text
finalSnapshotIdentifier} -> Maybe Text
finalSnapshotIdentifier) (\s :: DeleteCacheCluster
s@DeleteCacheCluster' {} Maybe Text
a -> DeleteCacheCluster
s {$sel:finalSnapshotIdentifier:DeleteCacheCluster' :: Maybe Text
finalSnapshotIdentifier = Maybe Text
a} :: DeleteCacheCluster)
deleteCacheCluster_cacheClusterId :: Lens.Lens' DeleteCacheCluster Prelude.Text
deleteCacheCluster_cacheClusterId :: Lens' DeleteCacheCluster Text
deleteCacheCluster_cacheClusterId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteCacheCluster' {Text
cacheClusterId :: Text
$sel:cacheClusterId:DeleteCacheCluster' :: DeleteCacheCluster -> Text
cacheClusterId} -> Text
cacheClusterId) (\s :: DeleteCacheCluster
s@DeleteCacheCluster' {} Text
a -> DeleteCacheCluster
s {$sel:cacheClusterId:DeleteCacheCluster' :: Text
cacheClusterId = Text
a} :: DeleteCacheCluster)
instance Core.AWSRequest DeleteCacheCluster where
type
AWSResponse DeleteCacheCluster =
DeleteCacheClusterResponse
request :: (Service -> Service)
-> DeleteCacheCluster -> Request DeleteCacheCluster
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 DeleteCacheCluster
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteCacheCluster)))
response =
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"DeleteCacheClusterResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe CacheCluster -> Int -> DeleteCacheClusterResponse
DeleteCacheClusterResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"CacheCluster")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable DeleteCacheCluster where
hashWithSalt :: Int -> DeleteCacheCluster -> Int
hashWithSalt Int
_salt DeleteCacheCluster' {Maybe Text
Text
cacheClusterId :: Text
finalSnapshotIdentifier :: Maybe Text
$sel:cacheClusterId:DeleteCacheCluster' :: DeleteCacheCluster -> Text
$sel:finalSnapshotIdentifier:DeleteCacheCluster' :: DeleteCacheCluster -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
finalSnapshotIdentifier
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
cacheClusterId
instance Prelude.NFData DeleteCacheCluster where
rnf :: DeleteCacheCluster -> ()
rnf DeleteCacheCluster' {Maybe Text
Text
cacheClusterId :: Text
finalSnapshotIdentifier :: Maybe Text
$sel:cacheClusterId:DeleteCacheCluster' :: DeleteCacheCluster -> Text
$sel:finalSnapshotIdentifier:DeleteCacheCluster' :: DeleteCacheCluster -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
finalSnapshotIdentifier
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
cacheClusterId
instance Data.ToHeaders DeleteCacheCluster where
toHeaders :: DeleteCacheCluster -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath DeleteCacheCluster where
toPath :: DeleteCacheCluster -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery DeleteCacheCluster where
toQuery :: DeleteCacheCluster -> QueryString
toQuery DeleteCacheCluster' {Maybe Text
Text
cacheClusterId :: Text
finalSnapshotIdentifier :: Maybe Text
$sel:cacheClusterId:DeleteCacheCluster' :: DeleteCacheCluster -> Text
$sel:finalSnapshotIdentifier:DeleteCacheCluster' :: DeleteCacheCluster -> Maybe Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"DeleteCacheCluster" :: Prelude.ByteString),
ByteString
"Version"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2015-02-02" :: Prelude.ByteString),
ByteString
"FinalSnapshotIdentifier"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
finalSnapshotIdentifier,
ByteString
"CacheClusterId" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
cacheClusterId
]
data DeleteCacheClusterResponse = DeleteCacheClusterResponse'
{ DeleteCacheClusterResponse -> Maybe CacheCluster
cacheCluster :: Prelude.Maybe CacheCluster,
DeleteCacheClusterResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteCacheClusterResponse -> DeleteCacheClusterResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteCacheClusterResponse -> DeleteCacheClusterResponse -> Bool
$c/= :: DeleteCacheClusterResponse -> DeleteCacheClusterResponse -> Bool
== :: DeleteCacheClusterResponse -> DeleteCacheClusterResponse -> Bool
$c== :: DeleteCacheClusterResponse -> DeleteCacheClusterResponse -> Bool
Prelude.Eq, ReadPrec [DeleteCacheClusterResponse]
ReadPrec DeleteCacheClusterResponse
Int -> ReadS DeleteCacheClusterResponse
ReadS [DeleteCacheClusterResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteCacheClusterResponse]
$creadListPrec :: ReadPrec [DeleteCacheClusterResponse]
readPrec :: ReadPrec DeleteCacheClusterResponse
$creadPrec :: ReadPrec DeleteCacheClusterResponse
readList :: ReadS [DeleteCacheClusterResponse]
$creadList :: ReadS [DeleteCacheClusterResponse]
readsPrec :: Int -> ReadS DeleteCacheClusterResponse
$creadsPrec :: Int -> ReadS DeleteCacheClusterResponse
Prelude.Read, Int -> DeleteCacheClusterResponse -> ShowS
[DeleteCacheClusterResponse] -> ShowS
DeleteCacheClusterResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteCacheClusterResponse] -> ShowS
$cshowList :: [DeleteCacheClusterResponse] -> ShowS
show :: DeleteCacheClusterResponse -> String
$cshow :: DeleteCacheClusterResponse -> String
showsPrec :: Int -> DeleteCacheClusterResponse -> ShowS
$cshowsPrec :: Int -> DeleteCacheClusterResponse -> ShowS
Prelude.Show, forall x.
Rep DeleteCacheClusterResponse x -> DeleteCacheClusterResponse
forall x.
DeleteCacheClusterResponse -> Rep DeleteCacheClusterResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteCacheClusterResponse x -> DeleteCacheClusterResponse
$cfrom :: forall x.
DeleteCacheClusterResponse -> Rep DeleteCacheClusterResponse x
Prelude.Generic)
newDeleteCacheClusterResponse ::
Prelude.Int ->
DeleteCacheClusterResponse
newDeleteCacheClusterResponse :: Int -> DeleteCacheClusterResponse
newDeleteCacheClusterResponse Int
pHttpStatus_ =
DeleteCacheClusterResponse'
{ $sel:cacheCluster:DeleteCacheClusterResponse' :: Maybe CacheCluster
cacheCluster =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteCacheClusterResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteCacheClusterResponse_cacheCluster :: Lens.Lens' DeleteCacheClusterResponse (Prelude.Maybe CacheCluster)
deleteCacheClusterResponse_cacheCluster :: Lens' DeleteCacheClusterResponse (Maybe CacheCluster)
deleteCacheClusterResponse_cacheCluster = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteCacheClusterResponse' {Maybe CacheCluster
cacheCluster :: Maybe CacheCluster
$sel:cacheCluster:DeleteCacheClusterResponse' :: DeleteCacheClusterResponse -> Maybe CacheCluster
cacheCluster} -> Maybe CacheCluster
cacheCluster) (\s :: DeleteCacheClusterResponse
s@DeleteCacheClusterResponse' {} Maybe CacheCluster
a -> DeleteCacheClusterResponse
s {$sel:cacheCluster:DeleteCacheClusterResponse' :: Maybe CacheCluster
cacheCluster = Maybe CacheCluster
a} :: DeleteCacheClusterResponse)
deleteCacheClusterResponse_httpStatus :: Lens.Lens' DeleteCacheClusterResponse Prelude.Int
deleteCacheClusterResponse_httpStatus :: Lens' DeleteCacheClusterResponse Int
deleteCacheClusterResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteCacheClusterResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteCacheClusterResponse' :: DeleteCacheClusterResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteCacheClusterResponse
s@DeleteCacheClusterResponse' {} Int
a -> DeleteCacheClusterResponse
s {$sel:httpStatus:DeleteCacheClusterResponse' :: Int
httpStatus = Int
a} :: DeleteCacheClusterResponse)
instance Prelude.NFData DeleteCacheClusterResponse where
rnf :: DeleteCacheClusterResponse -> ()
rnf DeleteCacheClusterResponse' {Int
Maybe CacheCluster
httpStatus :: Int
cacheCluster :: Maybe CacheCluster
$sel:httpStatus:DeleteCacheClusterResponse' :: DeleteCacheClusterResponse -> Int
$sel:cacheCluster:DeleteCacheClusterResponse' :: DeleteCacheClusterResponse -> Maybe CacheCluster
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe CacheCluster
cacheCluster
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus