{-# 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.DeleteGlobalReplicationGroup
(
DeleteGlobalReplicationGroup (..),
newDeleteGlobalReplicationGroup,
deleteGlobalReplicationGroup_globalReplicationGroupId,
deleteGlobalReplicationGroup_retainPrimaryReplicationGroup,
DeleteGlobalReplicationGroupResponse (..),
newDeleteGlobalReplicationGroupResponse,
deleteGlobalReplicationGroupResponse_globalReplicationGroup,
deleteGlobalReplicationGroupResponse_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 DeleteGlobalReplicationGroup = DeleteGlobalReplicationGroup'
{
DeleteGlobalReplicationGroup -> Text
globalReplicationGroupId :: Prelude.Text,
DeleteGlobalReplicationGroup -> Bool
retainPrimaryReplicationGroup :: Prelude.Bool
}
deriving (DeleteGlobalReplicationGroup
-> DeleteGlobalReplicationGroup -> Bool
(DeleteGlobalReplicationGroup
-> DeleteGlobalReplicationGroup -> Bool)
-> (DeleteGlobalReplicationGroup
-> DeleteGlobalReplicationGroup -> Bool)
-> Eq DeleteGlobalReplicationGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteGlobalReplicationGroup
-> DeleteGlobalReplicationGroup -> Bool
$c/= :: DeleteGlobalReplicationGroup
-> DeleteGlobalReplicationGroup -> Bool
== :: DeleteGlobalReplicationGroup
-> DeleteGlobalReplicationGroup -> Bool
$c== :: DeleteGlobalReplicationGroup
-> DeleteGlobalReplicationGroup -> Bool
Prelude.Eq, ReadPrec [DeleteGlobalReplicationGroup]
ReadPrec DeleteGlobalReplicationGroup
Int -> ReadS DeleteGlobalReplicationGroup
ReadS [DeleteGlobalReplicationGroup]
(Int -> ReadS DeleteGlobalReplicationGroup)
-> ReadS [DeleteGlobalReplicationGroup]
-> ReadPrec DeleteGlobalReplicationGroup
-> ReadPrec [DeleteGlobalReplicationGroup]
-> Read DeleteGlobalReplicationGroup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteGlobalReplicationGroup]
$creadListPrec :: ReadPrec [DeleteGlobalReplicationGroup]
readPrec :: ReadPrec DeleteGlobalReplicationGroup
$creadPrec :: ReadPrec DeleteGlobalReplicationGroup
readList :: ReadS [DeleteGlobalReplicationGroup]
$creadList :: ReadS [DeleteGlobalReplicationGroup]
readsPrec :: Int -> ReadS DeleteGlobalReplicationGroup
$creadsPrec :: Int -> ReadS DeleteGlobalReplicationGroup
Prelude.Read, Int -> DeleteGlobalReplicationGroup -> ShowS
[DeleteGlobalReplicationGroup] -> ShowS
DeleteGlobalReplicationGroup -> String
(Int -> DeleteGlobalReplicationGroup -> ShowS)
-> (DeleteGlobalReplicationGroup -> String)
-> ([DeleteGlobalReplicationGroup] -> ShowS)
-> Show DeleteGlobalReplicationGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteGlobalReplicationGroup] -> ShowS
$cshowList :: [DeleteGlobalReplicationGroup] -> ShowS
show :: DeleteGlobalReplicationGroup -> String
$cshow :: DeleteGlobalReplicationGroup -> String
showsPrec :: Int -> DeleteGlobalReplicationGroup -> ShowS
$cshowsPrec :: Int -> DeleteGlobalReplicationGroup -> ShowS
Prelude.Show, (forall x.
DeleteGlobalReplicationGroup -> Rep DeleteGlobalReplicationGroup x)
-> (forall x.
Rep DeleteGlobalReplicationGroup x -> DeleteGlobalReplicationGroup)
-> Generic DeleteGlobalReplicationGroup
forall x.
Rep DeleteGlobalReplicationGroup x -> DeleteGlobalReplicationGroup
forall x.
DeleteGlobalReplicationGroup -> Rep DeleteGlobalReplicationGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteGlobalReplicationGroup x -> DeleteGlobalReplicationGroup
$cfrom :: forall x.
DeleteGlobalReplicationGroup -> Rep DeleteGlobalReplicationGroup x
Prelude.Generic)
newDeleteGlobalReplicationGroup ::
Prelude.Text ->
Prelude.Bool ->
DeleteGlobalReplicationGroup
newDeleteGlobalReplicationGroup :: Text -> Bool -> DeleteGlobalReplicationGroup
newDeleteGlobalReplicationGroup
Text
pGlobalReplicationGroupId_
Bool
pRetainPrimaryReplicationGroup_ =
DeleteGlobalReplicationGroup' :: Text -> Bool -> DeleteGlobalReplicationGroup
DeleteGlobalReplicationGroup'
{ $sel:globalReplicationGroupId:DeleteGlobalReplicationGroup' :: Text
globalReplicationGroupId =
Text
pGlobalReplicationGroupId_,
$sel:retainPrimaryReplicationGroup:DeleteGlobalReplicationGroup' :: Bool
retainPrimaryReplicationGroup =
Bool
pRetainPrimaryReplicationGroup_
}
deleteGlobalReplicationGroup_globalReplicationGroupId :: Lens.Lens' DeleteGlobalReplicationGroup Prelude.Text
deleteGlobalReplicationGroup_globalReplicationGroupId :: (Text -> f Text)
-> DeleteGlobalReplicationGroup -> f DeleteGlobalReplicationGroup
deleteGlobalReplicationGroup_globalReplicationGroupId = (DeleteGlobalReplicationGroup -> Text)
-> (DeleteGlobalReplicationGroup
-> Text -> DeleteGlobalReplicationGroup)
-> Lens
DeleteGlobalReplicationGroup DeleteGlobalReplicationGroup Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteGlobalReplicationGroup' {Text
globalReplicationGroupId :: Text
$sel:globalReplicationGroupId:DeleteGlobalReplicationGroup' :: DeleteGlobalReplicationGroup -> Text
globalReplicationGroupId} -> Text
globalReplicationGroupId) (\s :: DeleteGlobalReplicationGroup
s@DeleteGlobalReplicationGroup' {} Text
a -> DeleteGlobalReplicationGroup
s {$sel:globalReplicationGroupId:DeleteGlobalReplicationGroup' :: Text
globalReplicationGroupId = Text
a} :: DeleteGlobalReplicationGroup)
deleteGlobalReplicationGroup_retainPrimaryReplicationGroup :: Lens.Lens' DeleteGlobalReplicationGroup Prelude.Bool
deleteGlobalReplicationGroup_retainPrimaryReplicationGroup :: (Bool -> f Bool)
-> DeleteGlobalReplicationGroup -> f DeleteGlobalReplicationGroup
deleteGlobalReplicationGroup_retainPrimaryReplicationGroup = (DeleteGlobalReplicationGroup -> Bool)
-> (DeleteGlobalReplicationGroup
-> Bool -> DeleteGlobalReplicationGroup)
-> Lens
DeleteGlobalReplicationGroup DeleteGlobalReplicationGroup Bool Bool
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteGlobalReplicationGroup' {Bool
retainPrimaryReplicationGroup :: Bool
$sel:retainPrimaryReplicationGroup:DeleteGlobalReplicationGroup' :: DeleteGlobalReplicationGroup -> Bool
retainPrimaryReplicationGroup} -> Bool
retainPrimaryReplicationGroup) (\s :: DeleteGlobalReplicationGroup
s@DeleteGlobalReplicationGroup' {} Bool
a -> DeleteGlobalReplicationGroup
s {$sel:retainPrimaryReplicationGroup:DeleteGlobalReplicationGroup' :: Bool
retainPrimaryReplicationGroup = Bool
a} :: DeleteGlobalReplicationGroup)
instance Core.AWSRequest DeleteGlobalReplicationGroup where
type
AWSResponse DeleteGlobalReplicationGroup =
DeleteGlobalReplicationGroupResponse
request :: DeleteGlobalReplicationGroup
-> Request DeleteGlobalReplicationGroup
request = Service
-> DeleteGlobalReplicationGroup
-> Request DeleteGlobalReplicationGroup
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteGlobalReplicationGroup
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteGlobalReplicationGroup)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse DeleteGlobalReplicationGroup))
-> Logger
-> Service
-> Proxy DeleteGlobalReplicationGroup
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteGlobalReplicationGroup)))
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
"DeleteGlobalReplicationGroupResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe GlobalReplicationGroup
-> Int -> DeleteGlobalReplicationGroupResponse
DeleteGlobalReplicationGroupResponse'
(Maybe GlobalReplicationGroup
-> Int -> DeleteGlobalReplicationGroupResponse)
-> Either String (Maybe GlobalReplicationGroup)
-> Either String (Int -> DeleteGlobalReplicationGroupResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe GlobalReplicationGroup)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"GlobalReplicationGroup")
Either String (Int -> DeleteGlobalReplicationGroupResponse)
-> Either String Int
-> Either String DeleteGlobalReplicationGroupResponse
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
DeleteGlobalReplicationGroup
instance Prelude.NFData DeleteGlobalReplicationGroup
instance Core.ToHeaders DeleteGlobalReplicationGroup where
toHeaders :: DeleteGlobalReplicationGroup -> ResponseHeaders
toHeaders = ResponseHeaders -> DeleteGlobalReplicationGroup -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath DeleteGlobalReplicationGroup where
toPath :: DeleteGlobalReplicationGroup -> ByteString
toPath = ByteString -> DeleteGlobalReplicationGroup -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteGlobalReplicationGroup where
toQuery :: DeleteGlobalReplicationGroup -> QueryString
toQuery DeleteGlobalReplicationGroup' {Bool
Text
retainPrimaryReplicationGroup :: Bool
globalReplicationGroupId :: Text
$sel:retainPrimaryReplicationGroup:DeleteGlobalReplicationGroup' :: DeleteGlobalReplicationGroup -> Bool
$sel:globalReplicationGroupId:DeleteGlobalReplicationGroup' :: DeleteGlobalReplicationGroup -> 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
"DeleteGlobalReplicationGroup" ::
Prelude.ByteString
),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2015-02-02" :: Prelude.ByteString),
ByteString
"GlobalReplicationGroupId"
ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
globalReplicationGroupId,
ByteString
"RetainPrimaryReplicationGroup"
ByteString -> Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Bool
retainPrimaryReplicationGroup
]
data DeleteGlobalReplicationGroupResponse = DeleteGlobalReplicationGroupResponse'
{ DeleteGlobalReplicationGroupResponse
-> Maybe GlobalReplicationGroup
globalReplicationGroup :: Prelude.Maybe GlobalReplicationGroup,
DeleteGlobalReplicationGroupResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteGlobalReplicationGroupResponse
-> DeleteGlobalReplicationGroupResponse -> Bool
(DeleteGlobalReplicationGroupResponse
-> DeleteGlobalReplicationGroupResponse -> Bool)
-> (DeleteGlobalReplicationGroupResponse
-> DeleteGlobalReplicationGroupResponse -> Bool)
-> Eq DeleteGlobalReplicationGroupResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteGlobalReplicationGroupResponse
-> DeleteGlobalReplicationGroupResponse -> Bool
$c/= :: DeleteGlobalReplicationGroupResponse
-> DeleteGlobalReplicationGroupResponse -> Bool
== :: DeleteGlobalReplicationGroupResponse
-> DeleteGlobalReplicationGroupResponse -> Bool
$c== :: DeleteGlobalReplicationGroupResponse
-> DeleteGlobalReplicationGroupResponse -> Bool
Prelude.Eq, ReadPrec [DeleteGlobalReplicationGroupResponse]
ReadPrec DeleteGlobalReplicationGroupResponse
Int -> ReadS DeleteGlobalReplicationGroupResponse
ReadS [DeleteGlobalReplicationGroupResponse]
(Int -> ReadS DeleteGlobalReplicationGroupResponse)
-> ReadS [DeleteGlobalReplicationGroupResponse]
-> ReadPrec DeleteGlobalReplicationGroupResponse
-> ReadPrec [DeleteGlobalReplicationGroupResponse]
-> Read DeleteGlobalReplicationGroupResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteGlobalReplicationGroupResponse]
$creadListPrec :: ReadPrec [DeleteGlobalReplicationGroupResponse]
readPrec :: ReadPrec DeleteGlobalReplicationGroupResponse
$creadPrec :: ReadPrec DeleteGlobalReplicationGroupResponse
readList :: ReadS [DeleteGlobalReplicationGroupResponse]
$creadList :: ReadS [DeleteGlobalReplicationGroupResponse]
readsPrec :: Int -> ReadS DeleteGlobalReplicationGroupResponse
$creadsPrec :: Int -> ReadS DeleteGlobalReplicationGroupResponse
Prelude.Read, Int -> DeleteGlobalReplicationGroupResponse -> ShowS
[DeleteGlobalReplicationGroupResponse] -> ShowS
DeleteGlobalReplicationGroupResponse -> String
(Int -> DeleteGlobalReplicationGroupResponse -> ShowS)
-> (DeleteGlobalReplicationGroupResponse -> String)
-> ([DeleteGlobalReplicationGroupResponse] -> ShowS)
-> Show DeleteGlobalReplicationGroupResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteGlobalReplicationGroupResponse] -> ShowS
$cshowList :: [DeleteGlobalReplicationGroupResponse] -> ShowS
show :: DeleteGlobalReplicationGroupResponse -> String
$cshow :: DeleteGlobalReplicationGroupResponse -> String
showsPrec :: Int -> DeleteGlobalReplicationGroupResponse -> ShowS
$cshowsPrec :: Int -> DeleteGlobalReplicationGroupResponse -> ShowS
Prelude.Show, (forall x.
DeleteGlobalReplicationGroupResponse
-> Rep DeleteGlobalReplicationGroupResponse x)
-> (forall x.
Rep DeleteGlobalReplicationGroupResponse x
-> DeleteGlobalReplicationGroupResponse)
-> Generic DeleteGlobalReplicationGroupResponse
forall x.
Rep DeleteGlobalReplicationGroupResponse x
-> DeleteGlobalReplicationGroupResponse
forall x.
DeleteGlobalReplicationGroupResponse
-> Rep DeleteGlobalReplicationGroupResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteGlobalReplicationGroupResponse x
-> DeleteGlobalReplicationGroupResponse
$cfrom :: forall x.
DeleteGlobalReplicationGroupResponse
-> Rep DeleteGlobalReplicationGroupResponse x
Prelude.Generic)
newDeleteGlobalReplicationGroupResponse ::
Prelude.Int ->
DeleteGlobalReplicationGroupResponse
newDeleteGlobalReplicationGroupResponse :: Int -> DeleteGlobalReplicationGroupResponse
newDeleteGlobalReplicationGroupResponse Int
pHttpStatus_ =
DeleteGlobalReplicationGroupResponse' :: Maybe GlobalReplicationGroup
-> Int -> DeleteGlobalReplicationGroupResponse
DeleteGlobalReplicationGroupResponse'
{ $sel:globalReplicationGroup:DeleteGlobalReplicationGroupResponse' :: Maybe GlobalReplicationGroup
globalReplicationGroup =
Maybe GlobalReplicationGroup
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteGlobalReplicationGroupResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteGlobalReplicationGroupResponse_globalReplicationGroup :: Lens.Lens' DeleteGlobalReplicationGroupResponse (Prelude.Maybe GlobalReplicationGroup)
deleteGlobalReplicationGroupResponse_globalReplicationGroup :: (Maybe GlobalReplicationGroup -> f (Maybe GlobalReplicationGroup))
-> DeleteGlobalReplicationGroupResponse
-> f DeleteGlobalReplicationGroupResponse
deleteGlobalReplicationGroupResponse_globalReplicationGroup = (DeleteGlobalReplicationGroupResponse
-> Maybe GlobalReplicationGroup)
-> (DeleteGlobalReplicationGroupResponse
-> Maybe GlobalReplicationGroup
-> DeleteGlobalReplicationGroupResponse)
-> Lens
DeleteGlobalReplicationGroupResponse
DeleteGlobalReplicationGroupResponse
(Maybe GlobalReplicationGroup)
(Maybe GlobalReplicationGroup)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteGlobalReplicationGroupResponse' {Maybe GlobalReplicationGroup
globalReplicationGroup :: Maybe GlobalReplicationGroup
$sel:globalReplicationGroup:DeleteGlobalReplicationGroupResponse' :: DeleteGlobalReplicationGroupResponse
-> Maybe GlobalReplicationGroup
globalReplicationGroup} -> Maybe GlobalReplicationGroup
globalReplicationGroup) (\s :: DeleteGlobalReplicationGroupResponse
s@DeleteGlobalReplicationGroupResponse' {} Maybe GlobalReplicationGroup
a -> DeleteGlobalReplicationGroupResponse
s {$sel:globalReplicationGroup:DeleteGlobalReplicationGroupResponse' :: Maybe GlobalReplicationGroup
globalReplicationGroup = Maybe GlobalReplicationGroup
a} :: DeleteGlobalReplicationGroupResponse)
deleteGlobalReplicationGroupResponse_httpStatus :: Lens.Lens' DeleteGlobalReplicationGroupResponse Prelude.Int
deleteGlobalReplicationGroupResponse_httpStatus :: (Int -> f Int)
-> DeleteGlobalReplicationGroupResponse
-> f DeleteGlobalReplicationGroupResponse
deleteGlobalReplicationGroupResponse_httpStatus = (DeleteGlobalReplicationGroupResponse -> Int)
-> (DeleteGlobalReplicationGroupResponse
-> Int -> DeleteGlobalReplicationGroupResponse)
-> Lens
DeleteGlobalReplicationGroupResponse
DeleteGlobalReplicationGroupResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteGlobalReplicationGroupResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteGlobalReplicationGroupResponse' :: DeleteGlobalReplicationGroupResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteGlobalReplicationGroupResponse
s@DeleteGlobalReplicationGroupResponse' {} Int
a -> DeleteGlobalReplicationGroupResponse
s {$sel:httpStatus:DeleteGlobalReplicationGroupResponse' :: Int
httpStatus = Int
a} :: DeleteGlobalReplicationGroupResponse)
instance
Prelude.NFData
DeleteGlobalReplicationGroupResponse