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