{-# 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.CompleteMigration
(
CompleteMigration (..),
newCompleteMigration,
completeMigration_force,
completeMigration_replicationGroupId,
CompleteMigrationResponse (..),
newCompleteMigrationResponse,
completeMigrationResponse_replicationGroup,
completeMigrationResponse_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 CompleteMigration = CompleteMigration'
{
CompleteMigration -> Maybe Bool
force :: Prelude.Maybe Prelude.Bool,
CompleteMigration -> Text
replicationGroupId :: Prelude.Text
}
deriving (CompleteMigration -> CompleteMigration -> Bool
(CompleteMigration -> CompleteMigration -> Bool)
-> (CompleteMigration -> CompleteMigration -> Bool)
-> Eq CompleteMigration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CompleteMigration -> CompleteMigration -> Bool
$c/= :: CompleteMigration -> CompleteMigration -> Bool
== :: CompleteMigration -> CompleteMigration -> Bool
$c== :: CompleteMigration -> CompleteMigration -> Bool
Prelude.Eq, ReadPrec [CompleteMigration]
ReadPrec CompleteMigration
Int -> ReadS CompleteMigration
ReadS [CompleteMigration]
(Int -> ReadS CompleteMigration)
-> ReadS [CompleteMigration]
-> ReadPrec CompleteMigration
-> ReadPrec [CompleteMigration]
-> Read CompleteMigration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CompleteMigration]
$creadListPrec :: ReadPrec [CompleteMigration]
readPrec :: ReadPrec CompleteMigration
$creadPrec :: ReadPrec CompleteMigration
readList :: ReadS [CompleteMigration]
$creadList :: ReadS [CompleteMigration]
readsPrec :: Int -> ReadS CompleteMigration
$creadsPrec :: Int -> ReadS CompleteMigration
Prelude.Read, Int -> CompleteMigration -> ShowS
[CompleteMigration] -> ShowS
CompleteMigration -> String
(Int -> CompleteMigration -> ShowS)
-> (CompleteMigration -> String)
-> ([CompleteMigration] -> ShowS)
-> Show CompleteMigration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CompleteMigration] -> ShowS
$cshowList :: [CompleteMigration] -> ShowS
show :: CompleteMigration -> String
$cshow :: CompleteMigration -> String
showsPrec :: Int -> CompleteMigration -> ShowS
$cshowsPrec :: Int -> CompleteMigration -> ShowS
Prelude.Show, (forall x. CompleteMigration -> Rep CompleteMigration x)
-> (forall x. Rep CompleteMigration x -> CompleteMigration)
-> Generic CompleteMigration
forall x. Rep CompleteMigration x -> CompleteMigration
forall x. CompleteMigration -> Rep CompleteMigration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CompleteMigration x -> CompleteMigration
$cfrom :: forall x. CompleteMigration -> Rep CompleteMigration x
Prelude.Generic)
newCompleteMigration ::
Prelude.Text ->
CompleteMigration
newCompleteMigration :: Text -> CompleteMigration
newCompleteMigration Text
pReplicationGroupId_ =
CompleteMigration' :: Maybe Bool -> Text -> CompleteMigration
CompleteMigration'
{ $sel:force:CompleteMigration' :: Maybe Bool
force = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:replicationGroupId:CompleteMigration' :: Text
replicationGroupId = Text
pReplicationGroupId_
}
completeMigration_force :: Lens.Lens' CompleteMigration (Prelude.Maybe Prelude.Bool)
completeMigration_force :: (Maybe Bool -> f (Maybe Bool))
-> CompleteMigration -> f CompleteMigration
completeMigration_force = (CompleteMigration -> Maybe Bool)
-> (CompleteMigration -> Maybe Bool -> CompleteMigration)
-> Lens
CompleteMigration CompleteMigration (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CompleteMigration' {Maybe Bool
force :: Maybe Bool
$sel:force:CompleteMigration' :: CompleteMigration -> Maybe Bool
force} -> Maybe Bool
force) (\s :: CompleteMigration
s@CompleteMigration' {} Maybe Bool
a -> CompleteMigration
s {$sel:force:CompleteMigration' :: Maybe Bool
force = Maybe Bool
a} :: CompleteMigration)
completeMigration_replicationGroupId :: Lens.Lens' CompleteMigration Prelude.Text
completeMigration_replicationGroupId :: (Text -> f Text) -> CompleteMigration -> f CompleteMigration
completeMigration_replicationGroupId = (CompleteMigration -> Text)
-> (CompleteMigration -> Text -> CompleteMigration)
-> Lens CompleteMigration CompleteMigration Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CompleteMigration' {Text
replicationGroupId :: Text
$sel:replicationGroupId:CompleteMigration' :: CompleteMigration -> Text
replicationGroupId} -> Text
replicationGroupId) (\s :: CompleteMigration
s@CompleteMigration' {} Text
a -> CompleteMigration
s {$sel:replicationGroupId:CompleteMigration' :: Text
replicationGroupId = Text
a} :: CompleteMigration)
instance Core.AWSRequest CompleteMigration where
type
AWSResponse CompleteMigration =
CompleteMigrationResponse
request :: CompleteMigration -> Request CompleteMigration
request = Service -> CompleteMigration -> Request CompleteMigration
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy CompleteMigration
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CompleteMigration)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse CompleteMigration))
-> Logger
-> Service
-> Proxy CompleteMigration
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CompleteMigration)))
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
"CompleteMigrationResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe ReplicationGroup -> Int -> CompleteMigrationResponse
CompleteMigrationResponse'
(Maybe ReplicationGroup -> Int -> CompleteMigrationResponse)
-> Either String (Maybe ReplicationGroup)
-> Either String (Int -> CompleteMigrationResponse)
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 -> CompleteMigrationResponse)
-> Either String Int -> Either String CompleteMigrationResponse
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 CompleteMigration
instance Prelude.NFData CompleteMigration
instance Core.ToHeaders CompleteMigration where
toHeaders :: CompleteMigration -> ResponseHeaders
toHeaders = ResponseHeaders -> CompleteMigration -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath CompleteMigration where
toPath :: CompleteMigration -> ByteString
toPath = ByteString -> CompleteMigration -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery CompleteMigration where
toQuery :: CompleteMigration -> QueryString
toQuery CompleteMigration' {Maybe Bool
Text
replicationGroupId :: Text
force :: Maybe Bool
$sel:replicationGroupId:CompleteMigration' :: CompleteMigration -> Text
$sel:force:CompleteMigration' :: CompleteMigration -> Maybe Bool
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"CompleteMigration" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2015-02-02" :: Prelude.ByteString),
ByteString
"Force" ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
force,
ByteString
"ReplicationGroupId" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
replicationGroupId
]
data CompleteMigrationResponse = CompleteMigrationResponse'
{ CompleteMigrationResponse -> Maybe ReplicationGroup
replicationGroup :: Prelude.Maybe ReplicationGroup,
CompleteMigrationResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CompleteMigrationResponse -> CompleteMigrationResponse -> Bool
(CompleteMigrationResponse -> CompleteMigrationResponse -> Bool)
-> (CompleteMigrationResponse -> CompleteMigrationResponse -> Bool)
-> Eq CompleteMigrationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CompleteMigrationResponse -> CompleteMigrationResponse -> Bool
$c/= :: CompleteMigrationResponse -> CompleteMigrationResponse -> Bool
== :: CompleteMigrationResponse -> CompleteMigrationResponse -> Bool
$c== :: CompleteMigrationResponse -> CompleteMigrationResponse -> Bool
Prelude.Eq, ReadPrec [CompleteMigrationResponse]
ReadPrec CompleteMigrationResponse
Int -> ReadS CompleteMigrationResponse
ReadS [CompleteMigrationResponse]
(Int -> ReadS CompleteMigrationResponse)
-> ReadS [CompleteMigrationResponse]
-> ReadPrec CompleteMigrationResponse
-> ReadPrec [CompleteMigrationResponse]
-> Read CompleteMigrationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CompleteMigrationResponse]
$creadListPrec :: ReadPrec [CompleteMigrationResponse]
readPrec :: ReadPrec CompleteMigrationResponse
$creadPrec :: ReadPrec CompleteMigrationResponse
readList :: ReadS [CompleteMigrationResponse]
$creadList :: ReadS [CompleteMigrationResponse]
readsPrec :: Int -> ReadS CompleteMigrationResponse
$creadsPrec :: Int -> ReadS CompleteMigrationResponse
Prelude.Read, Int -> CompleteMigrationResponse -> ShowS
[CompleteMigrationResponse] -> ShowS
CompleteMigrationResponse -> String
(Int -> CompleteMigrationResponse -> ShowS)
-> (CompleteMigrationResponse -> String)
-> ([CompleteMigrationResponse] -> ShowS)
-> Show CompleteMigrationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CompleteMigrationResponse] -> ShowS
$cshowList :: [CompleteMigrationResponse] -> ShowS
show :: CompleteMigrationResponse -> String
$cshow :: CompleteMigrationResponse -> String
showsPrec :: Int -> CompleteMigrationResponse -> ShowS
$cshowsPrec :: Int -> CompleteMigrationResponse -> ShowS
Prelude.Show, (forall x.
CompleteMigrationResponse -> Rep CompleteMigrationResponse x)
-> (forall x.
Rep CompleteMigrationResponse x -> CompleteMigrationResponse)
-> Generic CompleteMigrationResponse
forall x.
Rep CompleteMigrationResponse x -> CompleteMigrationResponse
forall x.
CompleteMigrationResponse -> Rep CompleteMigrationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CompleteMigrationResponse x -> CompleteMigrationResponse
$cfrom :: forall x.
CompleteMigrationResponse -> Rep CompleteMigrationResponse x
Prelude.Generic)
newCompleteMigrationResponse ::
Prelude.Int ->
CompleteMigrationResponse
newCompleteMigrationResponse :: Int -> CompleteMigrationResponse
newCompleteMigrationResponse Int
pHttpStatus_ =
CompleteMigrationResponse' :: Maybe ReplicationGroup -> Int -> CompleteMigrationResponse
CompleteMigrationResponse'
{ $sel:replicationGroup:CompleteMigrationResponse' :: Maybe ReplicationGroup
replicationGroup =
Maybe ReplicationGroup
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CompleteMigrationResponse' :: Int
httpStatus = Int
pHttpStatus_
}
completeMigrationResponse_replicationGroup :: Lens.Lens' CompleteMigrationResponse (Prelude.Maybe ReplicationGroup)
completeMigrationResponse_replicationGroup :: (Maybe ReplicationGroup -> f (Maybe ReplicationGroup))
-> CompleteMigrationResponse -> f CompleteMigrationResponse
completeMigrationResponse_replicationGroup = (CompleteMigrationResponse -> Maybe ReplicationGroup)
-> (CompleteMigrationResponse
-> Maybe ReplicationGroup -> CompleteMigrationResponse)
-> Lens
CompleteMigrationResponse
CompleteMigrationResponse
(Maybe ReplicationGroup)
(Maybe ReplicationGroup)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CompleteMigrationResponse' {Maybe ReplicationGroup
replicationGroup :: Maybe ReplicationGroup
$sel:replicationGroup:CompleteMigrationResponse' :: CompleteMigrationResponse -> Maybe ReplicationGroup
replicationGroup} -> Maybe ReplicationGroup
replicationGroup) (\s :: CompleteMigrationResponse
s@CompleteMigrationResponse' {} Maybe ReplicationGroup
a -> CompleteMigrationResponse
s {$sel:replicationGroup:CompleteMigrationResponse' :: Maybe ReplicationGroup
replicationGroup = Maybe ReplicationGroup
a} :: CompleteMigrationResponse)
completeMigrationResponse_httpStatus :: Lens.Lens' CompleteMigrationResponse Prelude.Int
completeMigrationResponse_httpStatus :: (Int -> f Int)
-> CompleteMigrationResponse -> f CompleteMigrationResponse
completeMigrationResponse_httpStatus = (CompleteMigrationResponse -> Int)
-> (CompleteMigrationResponse -> Int -> CompleteMigrationResponse)
-> Lens CompleteMigrationResponse CompleteMigrationResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CompleteMigrationResponse' {Int
httpStatus :: Int
$sel:httpStatus:CompleteMigrationResponse' :: CompleteMigrationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CompleteMigrationResponse
s@CompleteMigrationResponse' {} Int
a -> CompleteMigrationResponse
s {$sel:httpStatus:CompleteMigrationResponse' :: Int
httpStatus = Int
a} :: CompleteMigrationResponse)
instance Prelude.NFData CompleteMigrationResponse