{-# 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.MGN.RetryDataReplication
(
RetryDataReplication (..),
newRetryDataReplication,
retryDataReplication_sourceServerID,
SourceServer (..),
newSourceServer,
sourceServer_sourceProperties,
sourceServer_arn,
sourceServer_launchedInstance,
sourceServer_lifeCycle,
sourceServer_isArchived,
sourceServer_dataReplicationInfo,
sourceServer_sourceServerID,
sourceServer_tags,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MGN.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data RetryDataReplication = RetryDataReplication'
{
RetryDataReplication -> Text
sourceServerID :: Prelude.Text
}
deriving (RetryDataReplication -> RetryDataReplication -> Bool
(RetryDataReplication -> RetryDataReplication -> Bool)
-> (RetryDataReplication -> RetryDataReplication -> Bool)
-> Eq RetryDataReplication
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RetryDataReplication -> RetryDataReplication -> Bool
$c/= :: RetryDataReplication -> RetryDataReplication -> Bool
== :: RetryDataReplication -> RetryDataReplication -> Bool
$c== :: RetryDataReplication -> RetryDataReplication -> Bool
Prelude.Eq, ReadPrec [RetryDataReplication]
ReadPrec RetryDataReplication
Int -> ReadS RetryDataReplication
ReadS [RetryDataReplication]
(Int -> ReadS RetryDataReplication)
-> ReadS [RetryDataReplication]
-> ReadPrec RetryDataReplication
-> ReadPrec [RetryDataReplication]
-> Read RetryDataReplication
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RetryDataReplication]
$creadListPrec :: ReadPrec [RetryDataReplication]
readPrec :: ReadPrec RetryDataReplication
$creadPrec :: ReadPrec RetryDataReplication
readList :: ReadS [RetryDataReplication]
$creadList :: ReadS [RetryDataReplication]
readsPrec :: Int -> ReadS RetryDataReplication
$creadsPrec :: Int -> ReadS RetryDataReplication
Prelude.Read, Int -> RetryDataReplication -> ShowS
[RetryDataReplication] -> ShowS
RetryDataReplication -> String
(Int -> RetryDataReplication -> ShowS)
-> (RetryDataReplication -> String)
-> ([RetryDataReplication] -> ShowS)
-> Show RetryDataReplication
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RetryDataReplication] -> ShowS
$cshowList :: [RetryDataReplication] -> ShowS
show :: RetryDataReplication -> String
$cshow :: RetryDataReplication -> String
showsPrec :: Int -> RetryDataReplication -> ShowS
$cshowsPrec :: Int -> RetryDataReplication -> ShowS
Prelude.Show, (forall x. RetryDataReplication -> Rep RetryDataReplication x)
-> (forall x. Rep RetryDataReplication x -> RetryDataReplication)
-> Generic RetryDataReplication
forall x. Rep RetryDataReplication x -> RetryDataReplication
forall x. RetryDataReplication -> Rep RetryDataReplication x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RetryDataReplication x -> RetryDataReplication
$cfrom :: forall x. RetryDataReplication -> Rep RetryDataReplication x
Prelude.Generic)
newRetryDataReplication ::
Prelude.Text ->
RetryDataReplication
newRetryDataReplication :: Text -> RetryDataReplication
newRetryDataReplication Text
pSourceServerID_ =
RetryDataReplication' :: Text -> RetryDataReplication
RetryDataReplication'
{ $sel:sourceServerID:RetryDataReplication' :: Text
sourceServerID =
Text
pSourceServerID_
}
retryDataReplication_sourceServerID :: Lens.Lens' RetryDataReplication Prelude.Text
retryDataReplication_sourceServerID :: (Text -> f Text) -> RetryDataReplication -> f RetryDataReplication
retryDataReplication_sourceServerID = (RetryDataReplication -> Text)
-> (RetryDataReplication -> Text -> RetryDataReplication)
-> Lens RetryDataReplication RetryDataReplication Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RetryDataReplication' {Text
sourceServerID :: Text
$sel:sourceServerID:RetryDataReplication' :: RetryDataReplication -> Text
sourceServerID} -> Text
sourceServerID) (\s :: RetryDataReplication
s@RetryDataReplication' {} Text
a -> RetryDataReplication
s {$sel:sourceServerID:RetryDataReplication' :: Text
sourceServerID = Text
a} :: RetryDataReplication)
instance Core.AWSRequest RetryDataReplication where
type AWSResponse RetryDataReplication = SourceServer
request :: RetryDataReplication -> Request RetryDataReplication
request = Service -> RetryDataReplication -> Request RetryDataReplication
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy RetryDataReplication
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse RetryDataReplication)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse RetryDataReplication))
-> Logger
-> Service
-> Proxy RetryDataReplication
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse RetryDataReplication)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
(\Int
s ResponseHeaders
h Object
x -> Object -> Either String SourceServer
forall a. FromJSON a => Object -> Either String a
Core.eitherParseJSON Object
x)
instance Prelude.Hashable RetryDataReplication
instance Prelude.NFData RetryDataReplication
instance Core.ToHeaders RetryDataReplication where
toHeaders :: RetryDataReplication -> ResponseHeaders
toHeaders =
ResponseHeaders -> RetryDataReplication -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON RetryDataReplication where
toJSON :: RetryDataReplication -> Value
toJSON RetryDataReplication' {Text
sourceServerID :: Text
$sel:sourceServerID:RetryDataReplication' :: RetryDataReplication -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"sourceServerID" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
sourceServerID)
]
)
instance Core.ToPath RetryDataReplication where
toPath :: RetryDataReplication -> ByteString
toPath = ByteString -> RetryDataReplication -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/RetryDataReplication"
instance Core.ToQuery RetryDataReplication where
toQuery :: RetryDataReplication -> QueryString
toQuery = QueryString -> RetryDataReplication -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty