{-# 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.DeleteReplicationGroup
(
DeleteReplicationGroup (..),
newDeleteReplicationGroup,
deleteReplicationGroup_finalSnapshotIdentifier,
deleteReplicationGroup_retainPrimaryCluster,
deleteReplicationGroup_replicationGroupId,
DeleteReplicationGroupResponse (..),
newDeleteReplicationGroupResponse,
deleteReplicationGroupResponse_replicationGroup,
deleteReplicationGroupResponse_httpStatus,
)
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
data DeleteReplicationGroup = DeleteReplicationGroup'
{
DeleteReplicationGroup -> Maybe Text
finalSnapshotIdentifier :: Prelude.Maybe Prelude.Text,
DeleteReplicationGroup -> Maybe Bool
retainPrimaryCluster :: Prelude.Maybe Prelude.Bool,
DeleteReplicationGroup -> Text
replicationGroupId :: Prelude.Text
}
deriving (DeleteReplicationGroup -> DeleteReplicationGroup -> Bool
(DeleteReplicationGroup -> DeleteReplicationGroup -> Bool)
-> (DeleteReplicationGroup -> DeleteReplicationGroup -> Bool)
-> Eq DeleteReplicationGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteReplicationGroup -> DeleteReplicationGroup -> Bool
$c/= :: DeleteReplicationGroup -> DeleteReplicationGroup -> Bool
== :: DeleteReplicationGroup -> DeleteReplicationGroup -> Bool
$c== :: DeleteReplicationGroup -> DeleteReplicationGroup -> Bool
Prelude.Eq, ReadPrec [DeleteReplicationGroup]
ReadPrec DeleteReplicationGroup
Int -> ReadS DeleteReplicationGroup
ReadS [DeleteReplicationGroup]
(Int -> ReadS DeleteReplicationGroup)
-> ReadS [DeleteReplicationGroup]
-> ReadPrec DeleteReplicationGroup
-> ReadPrec [DeleteReplicationGroup]
-> Read DeleteReplicationGroup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteReplicationGroup]
$creadListPrec :: ReadPrec [DeleteReplicationGroup]
readPrec :: ReadPrec DeleteReplicationGroup
$creadPrec :: ReadPrec DeleteReplicationGroup
readList :: ReadS [DeleteReplicationGroup]
$creadList :: ReadS [DeleteReplicationGroup]
readsPrec :: Int -> ReadS DeleteReplicationGroup
$creadsPrec :: Int -> ReadS DeleteReplicationGroup
Prelude.Read, Int -> DeleteReplicationGroup -> ShowS
[DeleteReplicationGroup] -> ShowS
DeleteReplicationGroup -> String
(Int -> DeleteReplicationGroup -> ShowS)
-> (DeleteReplicationGroup -> String)
-> ([DeleteReplicationGroup] -> ShowS)
-> Show DeleteReplicationGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteReplicationGroup] -> ShowS
$cshowList :: [DeleteReplicationGroup] -> ShowS
show :: DeleteReplicationGroup -> String
$cshow :: DeleteReplicationGroup -> String
showsPrec :: Int -> DeleteReplicationGroup -> ShowS
$cshowsPrec :: Int -> DeleteReplicationGroup -> ShowS
Prelude.Show, (forall x. DeleteReplicationGroup -> Rep DeleteReplicationGroup x)
-> (forall x.
Rep DeleteReplicationGroup x -> DeleteReplicationGroup)
-> Generic DeleteReplicationGroup
forall x. Rep DeleteReplicationGroup x -> DeleteReplicationGroup
forall x. DeleteReplicationGroup -> Rep DeleteReplicationGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteReplicationGroup x -> DeleteReplicationGroup
$cfrom :: forall x. DeleteReplicationGroup -> Rep DeleteReplicationGroup x
Prelude.Generic)
newDeleteReplicationGroup ::
Prelude.Text ->
DeleteReplicationGroup
newDeleteReplicationGroup :: Text -> DeleteReplicationGroup
newDeleteReplicationGroup Text
pReplicationGroupId_ =
DeleteReplicationGroup' :: Maybe Text -> Maybe Bool -> Text -> DeleteReplicationGroup
DeleteReplicationGroup'
{ $sel:finalSnapshotIdentifier:DeleteReplicationGroup' :: Maybe Text
finalSnapshotIdentifier =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:retainPrimaryCluster:DeleteReplicationGroup' :: Maybe Bool
retainPrimaryCluster = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:replicationGroupId:DeleteReplicationGroup' :: Text
replicationGroupId = Text
pReplicationGroupId_
}
deleteReplicationGroup_finalSnapshotIdentifier :: Lens.Lens' DeleteReplicationGroup (Prelude.Maybe Prelude.Text)
deleteReplicationGroup_finalSnapshotIdentifier :: (Maybe Text -> f (Maybe Text))
-> DeleteReplicationGroup -> f DeleteReplicationGroup
deleteReplicationGroup_finalSnapshotIdentifier = (DeleteReplicationGroup -> Maybe Text)
-> (DeleteReplicationGroup -> Maybe Text -> DeleteReplicationGroup)
-> Lens
DeleteReplicationGroup
DeleteReplicationGroup
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteReplicationGroup' {Maybe Text
finalSnapshotIdentifier :: Maybe Text
$sel:finalSnapshotIdentifier:DeleteReplicationGroup' :: DeleteReplicationGroup -> Maybe Text
finalSnapshotIdentifier} -> Maybe Text
finalSnapshotIdentifier) (\s :: DeleteReplicationGroup
s@DeleteReplicationGroup' {} Maybe Text
a -> DeleteReplicationGroup
s {$sel:finalSnapshotIdentifier:DeleteReplicationGroup' :: Maybe Text
finalSnapshotIdentifier = Maybe Text
a} :: DeleteReplicationGroup)
deleteReplicationGroup_retainPrimaryCluster :: Lens.Lens' DeleteReplicationGroup (Prelude.Maybe Prelude.Bool)
deleteReplicationGroup_retainPrimaryCluster :: (Maybe Bool -> f (Maybe Bool))
-> DeleteReplicationGroup -> f DeleteReplicationGroup
deleteReplicationGroup_retainPrimaryCluster = (DeleteReplicationGroup -> Maybe Bool)
-> (DeleteReplicationGroup -> Maybe Bool -> DeleteReplicationGroup)
-> Lens
DeleteReplicationGroup
DeleteReplicationGroup
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteReplicationGroup' {Maybe Bool
retainPrimaryCluster :: Maybe Bool
$sel:retainPrimaryCluster:DeleteReplicationGroup' :: DeleteReplicationGroup -> Maybe Bool
retainPrimaryCluster} -> Maybe Bool
retainPrimaryCluster) (\s :: DeleteReplicationGroup
s@DeleteReplicationGroup' {} Maybe Bool
a -> DeleteReplicationGroup
s {$sel:retainPrimaryCluster:DeleteReplicationGroup' :: Maybe Bool
retainPrimaryCluster = Maybe Bool
a} :: DeleteReplicationGroup)
deleteReplicationGroup_replicationGroupId :: Lens.Lens' DeleteReplicationGroup Prelude.Text
deleteReplicationGroup_replicationGroupId :: (Text -> f Text)
-> DeleteReplicationGroup -> f DeleteReplicationGroup
deleteReplicationGroup_replicationGroupId = (DeleteReplicationGroup -> Text)
-> (DeleteReplicationGroup -> Text -> DeleteReplicationGroup)
-> Lens DeleteReplicationGroup DeleteReplicationGroup Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteReplicationGroup' {Text
replicationGroupId :: Text
$sel:replicationGroupId:DeleteReplicationGroup' :: DeleteReplicationGroup -> Text
replicationGroupId} -> Text
replicationGroupId) (\s :: DeleteReplicationGroup
s@DeleteReplicationGroup' {} Text
a -> DeleteReplicationGroup
s {$sel:replicationGroupId:DeleteReplicationGroup' :: Text
replicationGroupId = Text
a} :: DeleteReplicationGroup)
instance Core.AWSRequest DeleteReplicationGroup where
type
AWSResponse DeleteReplicationGroup =
DeleteReplicationGroupResponse
request :: DeleteReplicationGroup -> Request DeleteReplicationGroup
request = Service -> DeleteReplicationGroup -> Request DeleteReplicationGroup
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteReplicationGroup
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteReplicationGroup)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse DeleteReplicationGroup))
-> Logger
-> Service
-> Proxy DeleteReplicationGroup
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteReplicationGroup)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"DeleteReplicationGroupResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe ReplicationGroup -> Int -> DeleteReplicationGroupResponse
DeleteReplicationGroupResponse'
(Maybe ReplicationGroup -> Int -> DeleteReplicationGroupResponse)
-> Either String (Maybe ReplicationGroup)
-> Either String (Int -> DeleteReplicationGroupResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe ReplicationGroup)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ReplicationGroup")
Either String (Int -> DeleteReplicationGroupResponse)
-> Either String Int
-> Either String DeleteReplicationGroupResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable DeleteReplicationGroup
instance Prelude.NFData DeleteReplicationGroup
instance Core.ToHeaders DeleteReplicationGroup where
toHeaders :: DeleteReplicationGroup -> ResponseHeaders
toHeaders = ResponseHeaders -> DeleteReplicationGroup -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath DeleteReplicationGroup where
toPath :: DeleteReplicationGroup -> ByteString
toPath = ByteString -> DeleteReplicationGroup -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteReplicationGroup where
toQuery :: DeleteReplicationGroup -> QueryString
toQuery DeleteReplicationGroup' {Maybe Bool
Maybe Text
Text
replicationGroupId :: Text
retainPrimaryCluster :: Maybe Bool
finalSnapshotIdentifier :: Maybe Text
$sel:replicationGroupId:DeleteReplicationGroup' :: DeleteReplicationGroup -> Text
$sel:retainPrimaryCluster:DeleteReplicationGroup' :: DeleteReplicationGroup -> Maybe Bool
$sel:finalSnapshotIdentifier:DeleteReplicationGroup' :: DeleteReplicationGroup -> Maybe 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
"DeleteReplicationGroup" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2015-02-02" :: Prelude.ByteString),
ByteString
"FinalSnapshotIdentifier"
ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
finalSnapshotIdentifier,
ByteString
"RetainPrimaryCluster" ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
retainPrimaryCluster,
ByteString
"ReplicationGroupId" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
replicationGroupId
]
data DeleteReplicationGroupResponse = DeleteReplicationGroupResponse'
{ DeleteReplicationGroupResponse -> Maybe ReplicationGroup
replicationGroup :: Prelude.Maybe ReplicationGroup,
DeleteReplicationGroupResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteReplicationGroupResponse
-> DeleteReplicationGroupResponse -> Bool
(DeleteReplicationGroupResponse
-> DeleteReplicationGroupResponse -> Bool)
-> (DeleteReplicationGroupResponse
-> DeleteReplicationGroupResponse -> Bool)
-> Eq DeleteReplicationGroupResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteReplicationGroupResponse
-> DeleteReplicationGroupResponse -> Bool
$c/= :: DeleteReplicationGroupResponse
-> DeleteReplicationGroupResponse -> Bool
== :: DeleteReplicationGroupResponse
-> DeleteReplicationGroupResponse -> Bool
$c== :: DeleteReplicationGroupResponse
-> DeleteReplicationGroupResponse -> Bool
Prelude.Eq, ReadPrec [DeleteReplicationGroupResponse]
ReadPrec DeleteReplicationGroupResponse
Int -> ReadS DeleteReplicationGroupResponse
ReadS [DeleteReplicationGroupResponse]
(Int -> ReadS DeleteReplicationGroupResponse)
-> ReadS [DeleteReplicationGroupResponse]
-> ReadPrec DeleteReplicationGroupResponse
-> ReadPrec [DeleteReplicationGroupResponse]
-> Read DeleteReplicationGroupResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteReplicationGroupResponse]
$creadListPrec :: ReadPrec [DeleteReplicationGroupResponse]
readPrec :: ReadPrec DeleteReplicationGroupResponse
$creadPrec :: ReadPrec DeleteReplicationGroupResponse
readList :: ReadS [DeleteReplicationGroupResponse]
$creadList :: ReadS [DeleteReplicationGroupResponse]
readsPrec :: Int -> ReadS DeleteReplicationGroupResponse
$creadsPrec :: Int -> ReadS DeleteReplicationGroupResponse
Prelude.Read, Int -> DeleteReplicationGroupResponse -> ShowS
[DeleteReplicationGroupResponse] -> ShowS
DeleteReplicationGroupResponse -> String
(Int -> DeleteReplicationGroupResponse -> ShowS)
-> (DeleteReplicationGroupResponse -> String)
-> ([DeleteReplicationGroupResponse] -> ShowS)
-> Show DeleteReplicationGroupResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteReplicationGroupResponse] -> ShowS
$cshowList :: [DeleteReplicationGroupResponse] -> ShowS
show :: DeleteReplicationGroupResponse -> String
$cshow :: DeleteReplicationGroupResponse -> String
showsPrec :: Int -> DeleteReplicationGroupResponse -> ShowS
$cshowsPrec :: Int -> DeleteReplicationGroupResponse -> ShowS
Prelude.Show, (forall x.
DeleteReplicationGroupResponse
-> Rep DeleteReplicationGroupResponse x)
-> (forall x.
Rep DeleteReplicationGroupResponse x
-> DeleteReplicationGroupResponse)
-> Generic DeleteReplicationGroupResponse
forall x.
Rep DeleteReplicationGroupResponse x
-> DeleteReplicationGroupResponse
forall x.
DeleteReplicationGroupResponse
-> Rep DeleteReplicationGroupResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteReplicationGroupResponse x
-> DeleteReplicationGroupResponse
$cfrom :: forall x.
DeleteReplicationGroupResponse
-> Rep DeleteReplicationGroupResponse x
Prelude.Generic)
newDeleteReplicationGroupResponse ::
Prelude.Int ->
DeleteReplicationGroupResponse
newDeleteReplicationGroupResponse :: Int -> DeleteReplicationGroupResponse
newDeleteReplicationGroupResponse Int
pHttpStatus_ =
DeleteReplicationGroupResponse' :: Maybe ReplicationGroup -> Int -> DeleteReplicationGroupResponse
DeleteReplicationGroupResponse'
{ $sel:replicationGroup:DeleteReplicationGroupResponse' :: Maybe ReplicationGroup
replicationGroup =
Maybe ReplicationGroup
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteReplicationGroupResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteReplicationGroupResponse_replicationGroup :: Lens.Lens' DeleteReplicationGroupResponse (Prelude.Maybe ReplicationGroup)
deleteReplicationGroupResponse_replicationGroup :: (Maybe ReplicationGroup -> f (Maybe ReplicationGroup))
-> DeleteReplicationGroupResponse
-> f DeleteReplicationGroupResponse
deleteReplicationGroupResponse_replicationGroup = (DeleteReplicationGroupResponse -> Maybe ReplicationGroup)
-> (DeleteReplicationGroupResponse
-> Maybe ReplicationGroup -> DeleteReplicationGroupResponse)
-> Lens
DeleteReplicationGroupResponse
DeleteReplicationGroupResponse
(Maybe ReplicationGroup)
(Maybe ReplicationGroup)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteReplicationGroupResponse' {Maybe ReplicationGroup
replicationGroup :: Maybe ReplicationGroup
$sel:replicationGroup:DeleteReplicationGroupResponse' :: DeleteReplicationGroupResponse -> Maybe ReplicationGroup
replicationGroup} -> Maybe ReplicationGroup
replicationGroup) (\s :: DeleteReplicationGroupResponse
s@DeleteReplicationGroupResponse' {} Maybe ReplicationGroup
a -> DeleteReplicationGroupResponse
s {$sel:replicationGroup:DeleteReplicationGroupResponse' :: Maybe ReplicationGroup
replicationGroup = Maybe ReplicationGroup
a} :: DeleteReplicationGroupResponse)
deleteReplicationGroupResponse_httpStatus :: Lens.Lens' DeleteReplicationGroupResponse Prelude.Int
deleteReplicationGroupResponse_httpStatus :: (Int -> f Int)
-> DeleteReplicationGroupResponse
-> f DeleteReplicationGroupResponse
deleteReplicationGroupResponse_httpStatus = (DeleteReplicationGroupResponse -> Int)
-> (DeleteReplicationGroupResponse
-> Int -> DeleteReplicationGroupResponse)
-> Lens
DeleteReplicationGroupResponse
DeleteReplicationGroupResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteReplicationGroupResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteReplicationGroupResponse' :: DeleteReplicationGroupResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteReplicationGroupResponse
s@DeleteReplicationGroupResponse' {} Int
a -> DeleteReplicationGroupResponse
s {$sel:httpStatus:DeleteReplicationGroupResponse' :: Int
httpStatus = Int
a} :: DeleteReplicationGroupResponse)
instance
Prelude.NFData
DeleteReplicationGroupResponse