{-# 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.FinalizeCutover
(
FinalizeCutover (..),
newFinalizeCutover,
finalizeCutover_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 FinalizeCutover = FinalizeCutover'
{
FinalizeCutover -> Text
sourceServerID :: Prelude.Text
}
deriving (FinalizeCutover -> FinalizeCutover -> Bool
(FinalizeCutover -> FinalizeCutover -> Bool)
-> (FinalizeCutover -> FinalizeCutover -> Bool)
-> Eq FinalizeCutover
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FinalizeCutover -> FinalizeCutover -> Bool
$c/= :: FinalizeCutover -> FinalizeCutover -> Bool
== :: FinalizeCutover -> FinalizeCutover -> Bool
$c== :: FinalizeCutover -> FinalizeCutover -> Bool
Prelude.Eq, ReadPrec [FinalizeCutover]
ReadPrec FinalizeCutover
Int -> ReadS FinalizeCutover
ReadS [FinalizeCutover]
(Int -> ReadS FinalizeCutover)
-> ReadS [FinalizeCutover]
-> ReadPrec FinalizeCutover
-> ReadPrec [FinalizeCutover]
-> Read FinalizeCutover
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FinalizeCutover]
$creadListPrec :: ReadPrec [FinalizeCutover]
readPrec :: ReadPrec FinalizeCutover
$creadPrec :: ReadPrec FinalizeCutover
readList :: ReadS [FinalizeCutover]
$creadList :: ReadS [FinalizeCutover]
readsPrec :: Int -> ReadS FinalizeCutover
$creadsPrec :: Int -> ReadS FinalizeCutover
Prelude.Read, Int -> FinalizeCutover -> ShowS
[FinalizeCutover] -> ShowS
FinalizeCutover -> String
(Int -> FinalizeCutover -> ShowS)
-> (FinalizeCutover -> String)
-> ([FinalizeCutover] -> ShowS)
-> Show FinalizeCutover
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FinalizeCutover] -> ShowS
$cshowList :: [FinalizeCutover] -> ShowS
show :: FinalizeCutover -> String
$cshow :: FinalizeCutover -> String
showsPrec :: Int -> FinalizeCutover -> ShowS
$cshowsPrec :: Int -> FinalizeCutover -> ShowS
Prelude.Show, (forall x. FinalizeCutover -> Rep FinalizeCutover x)
-> (forall x. Rep FinalizeCutover x -> FinalizeCutover)
-> Generic FinalizeCutover
forall x. Rep FinalizeCutover x -> FinalizeCutover
forall x. FinalizeCutover -> Rep FinalizeCutover x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FinalizeCutover x -> FinalizeCutover
$cfrom :: forall x. FinalizeCutover -> Rep FinalizeCutover x
Prelude.Generic)
newFinalizeCutover ::
Prelude.Text ->
FinalizeCutover
newFinalizeCutover :: Text -> FinalizeCutover
newFinalizeCutover Text
pSourceServerID_ =
FinalizeCutover' :: Text -> FinalizeCutover
FinalizeCutover' {$sel:sourceServerID:FinalizeCutover' :: Text
sourceServerID = Text
pSourceServerID_}
finalizeCutover_sourceServerID :: Lens.Lens' FinalizeCutover Prelude.Text
finalizeCutover_sourceServerID :: (Text -> f Text) -> FinalizeCutover -> f FinalizeCutover
finalizeCutover_sourceServerID = (FinalizeCutover -> Text)
-> (FinalizeCutover -> Text -> FinalizeCutover)
-> Lens FinalizeCutover FinalizeCutover Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FinalizeCutover' {Text
sourceServerID :: Text
$sel:sourceServerID:FinalizeCutover' :: FinalizeCutover -> Text
sourceServerID} -> Text
sourceServerID) (\s :: FinalizeCutover
s@FinalizeCutover' {} Text
a -> FinalizeCutover
s {$sel:sourceServerID:FinalizeCutover' :: Text
sourceServerID = Text
a} :: FinalizeCutover)
instance Core.AWSRequest FinalizeCutover where
type AWSResponse FinalizeCutover = SourceServer
request :: FinalizeCutover -> Request FinalizeCutover
request = Service -> FinalizeCutover -> Request FinalizeCutover
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy FinalizeCutover
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse FinalizeCutover)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse FinalizeCutover))
-> Logger
-> Service
-> Proxy FinalizeCutover
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse FinalizeCutover)))
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 FinalizeCutover
instance Prelude.NFData FinalizeCutover
instance Core.ToHeaders FinalizeCutover where
toHeaders :: FinalizeCutover -> ResponseHeaders
toHeaders =
ResponseHeaders -> FinalizeCutover -> 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 FinalizeCutover where
toJSON :: FinalizeCutover -> Value
toJSON FinalizeCutover' {Text
sourceServerID :: Text
$sel:sourceServerID:FinalizeCutover' :: FinalizeCutover -> 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 FinalizeCutover where
toPath :: FinalizeCutover -> ByteString
toPath = ByteString -> FinalizeCutover -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/FinalizeCutover"
instance Core.ToQuery FinalizeCutover where
toQuery :: FinalizeCutover -> QueryString
toQuery = QueryString -> FinalizeCutover -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty