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