{-# 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.SMS.StartAppReplication
(
StartAppReplication (..),
newStartAppReplication,
startAppReplication_appId,
StartAppReplicationResponse (..),
newStartAppReplicationResponse,
startAppReplicationResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SMS.Types
data StartAppReplication = StartAppReplication'
{
StartAppReplication -> Maybe Text
appId :: Prelude.Maybe Prelude.Text
}
deriving (StartAppReplication -> StartAppReplication -> Bool
(StartAppReplication -> StartAppReplication -> Bool)
-> (StartAppReplication -> StartAppReplication -> Bool)
-> Eq StartAppReplication
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartAppReplication -> StartAppReplication -> Bool
$c/= :: StartAppReplication -> StartAppReplication -> Bool
== :: StartAppReplication -> StartAppReplication -> Bool
$c== :: StartAppReplication -> StartAppReplication -> Bool
Prelude.Eq, ReadPrec [StartAppReplication]
ReadPrec StartAppReplication
Int -> ReadS StartAppReplication
ReadS [StartAppReplication]
(Int -> ReadS StartAppReplication)
-> ReadS [StartAppReplication]
-> ReadPrec StartAppReplication
-> ReadPrec [StartAppReplication]
-> Read StartAppReplication
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartAppReplication]
$creadListPrec :: ReadPrec [StartAppReplication]
readPrec :: ReadPrec StartAppReplication
$creadPrec :: ReadPrec StartAppReplication
readList :: ReadS [StartAppReplication]
$creadList :: ReadS [StartAppReplication]
readsPrec :: Int -> ReadS StartAppReplication
$creadsPrec :: Int -> ReadS StartAppReplication
Prelude.Read, Int -> StartAppReplication -> ShowS
[StartAppReplication] -> ShowS
StartAppReplication -> String
(Int -> StartAppReplication -> ShowS)
-> (StartAppReplication -> String)
-> ([StartAppReplication] -> ShowS)
-> Show StartAppReplication
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartAppReplication] -> ShowS
$cshowList :: [StartAppReplication] -> ShowS
show :: StartAppReplication -> String
$cshow :: StartAppReplication -> String
showsPrec :: Int -> StartAppReplication -> ShowS
$cshowsPrec :: Int -> StartAppReplication -> ShowS
Prelude.Show, (forall x. StartAppReplication -> Rep StartAppReplication x)
-> (forall x. Rep StartAppReplication x -> StartAppReplication)
-> Generic StartAppReplication
forall x. Rep StartAppReplication x -> StartAppReplication
forall x. StartAppReplication -> Rep StartAppReplication x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StartAppReplication x -> StartAppReplication
$cfrom :: forall x. StartAppReplication -> Rep StartAppReplication x
Prelude.Generic)
newStartAppReplication ::
StartAppReplication
newStartAppReplication :: StartAppReplication
newStartAppReplication =
StartAppReplication' :: Maybe Text -> StartAppReplication
StartAppReplication' {$sel:appId:StartAppReplication' :: Maybe Text
appId = Maybe Text
forall a. Maybe a
Prelude.Nothing}
startAppReplication_appId :: Lens.Lens' StartAppReplication (Prelude.Maybe Prelude.Text)
startAppReplication_appId :: (Maybe Text -> f (Maybe Text))
-> StartAppReplication -> f StartAppReplication
startAppReplication_appId = (StartAppReplication -> Maybe Text)
-> (StartAppReplication -> Maybe Text -> StartAppReplication)
-> Lens
StartAppReplication StartAppReplication (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartAppReplication' {Maybe Text
appId :: Maybe Text
$sel:appId:StartAppReplication' :: StartAppReplication -> Maybe Text
appId} -> Maybe Text
appId) (\s :: StartAppReplication
s@StartAppReplication' {} Maybe Text
a -> StartAppReplication
s {$sel:appId:StartAppReplication' :: Maybe Text
appId = Maybe Text
a} :: StartAppReplication)
instance Core.AWSRequest StartAppReplication where
type
AWSResponse StartAppReplication =
StartAppReplicationResponse
request :: StartAppReplication -> Request StartAppReplication
request = Service -> StartAppReplication -> Request StartAppReplication
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy StartAppReplication
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse StartAppReplication)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse StartAppReplication))
-> Logger
-> Service
-> Proxy StartAppReplication
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse StartAppReplication)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> StartAppReplicationResponse
StartAppReplicationResponse'
(Int -> StartAppReplicationResponse)
-> Either String Int -> Either String StartAppReplicationResponse
forall (f :: * -> *) a b. Functor 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 StartAppReplication
instance Prelude.NFData StartAppReplication
instance Core.ToHeaders StartAppReplication where
toHeaders :: StartAppReplication -> ResponseHeaders
toHeaders =
ResponseHeaders -> StartAppReplication -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AWSServerMigrationService_V2016_10_24.StartAppReplication" ::
Prelude.ByteString
),
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 StartAppReplication where
toJSON :: StartAppReplication -> Value
toJSON StartAppReplication' {Maybe Text
appId :: Maybe Text
$sel:appId:StartAppReplication' :: StartAppReplication -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(Text
"appId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
appId]
)
instance Core.ToPath StartAppReplication where
toPath :: StartAppReplication -> ByteString
toPath = ByteString -> StartAppReplication -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery StartAppReplication where
toQuery :: StartAppReplication -> QueryString
toQuery = QueryString -> StartAppReplication -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data StartAppReplicationResponse = StartAppReplicationResponse'
{
StartAppReplicationResponse -> Int
httpStatus :: Prelude.Int
}
deriving (StartAppReplicationResponse -> StartAppReplicationResponse -> Bool
(StartAppReplicationResponse
-> StartAppReplicationResponse -> Bool)
-> (StartAppReplicationResponse
-> StartAppReplicationResponse -> Bool)
-> Eq StartAppReplicationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartAppReplicationResponse -> StartAppReplicationResponse -> Bool
$c/= :: StartAppReplicationResponse -> StartAppReplicationResponse -> Bool
== :: StartAppReplicationResponse -> StartAppReplicationResponse -> Bool
$c== :: StartAppReplicationResponse -> StartAppReplicationResponse -> Bool
Prelude.Eq, ReadPrec [StartAppReplicationResponse]
ReadPrec StartAppReplicationResponse
Int -> ReadS StartAppReplicationResponse
ReadS [StartAppReplicationResponse]
(Int -> ReadS StartAppReplicationResponse)
-> ReadS [StartAppReplicationResponse]
-> ReadPrec StartAppReplicationResponse
-> ReadPrec [StartAppReplicationResponse]
-> Read StartAppReplicationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartAppReplicationResponse]
$creadListPrec :: ReadPrec [StartAppReplicationResponse]
readPrec :: ReadPrec StartAppReplicationResponse
$creadPrec :: ReadPrec StartAppReplicationResponse
readList :: ReadS [StartAppReplicationResponse]
$creadList :: ReadS [StartAppReplicationResponse]
readsPrec :: Int -> ReadS StartAppReplicationResponse
$creadsPrec :: Int -> ReadS StartAppReplicationResponse
Prelude.Read, Int -> StartAppReplicationResponse -> ShowS
[StartAppReplicationResponse] -> ShowS
StartAppReplicationResponse -> String
(Int -> StartAppReplicationResponse -> ShowS)
-> (StartAppReplicationResponse -> String)
-> ([StartAppReplicationResponse] -> ShowS)
-> Show StartAppReplicationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartAppReplicationResponse] -> ShowS
$cshowList :: [StartAppReplicationResponse] -> ShowS
show :: StartAppReplicationResponse -> String
$cshow :: StartAppReplicationResponse -> String
showsPrec :: Int -> StartAppReplicationResponse -> ShowS
$cshowsPrec :: Int -> StartAppReplicationResponse -> ShowS
Prelude.Show, (forall x.
StartAppReplicationResponse -> Rep StartAppReplicationResponse x)
-> (forall x.
Rep StartAppReplicationResponse x -> StartAppReplicationResponse)
-> Generic StartAppReplicationResponse
forall x.
Rep StartAppReplicationResponse x -> StartAppReplicationResponse
forall x.
StartAppReplicationResponse -> Rep StartAppReplicationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StartAppReplicationResponse x -> StartAppReplicationResponse
$cfrom :: forall x.
StartAppReplicationResponse -> Rep StartAppReplicationResponse x
Prelude.Generic)
newStartAppReplicationResponse ::
Prelude.Int ->
StartAppReplicationResponse
newStartAppReplicationResponse :: Int -> StartAppReplicationResponse
newStartAppReplicationResponse Int
pHttpStatus_ =
StartAppReplicationResponse' :: Int -> StartAppReplicationResponse
StartAppReplicationResponse'
{ $sel:httpStatus:StartAppReplicationResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
startAppReplicationResponse_httpStatus :: Lens.Lens' StartAppReplicationResponse Prelude.Int
startAppReplicationResponse_httpStatus :: (Int -> f Int)
-> StartAppReplicationResponse -> f StartAppReplicationResponse
startAppReplicationResponse_httpStatus = (StartAppReplicationResponse -> Int)
-> (StartAppReplicationResponse
-> Int -> StartAppReplicationResponse)
-> Lens
StartAppReplicationResponse StartAppReplicationResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartAppReplicationResponse' {Int
httpStatus :: Int
$sel:httpStatus:StartAppReplicationResponse' :: StartAppReplicationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: StartAppReplicationResponse
s@StartAppReplicationResponse' {} Int
a -> StartAppReplicationResponse
s {$sel:httpStatus:StartAppReplicationResponse' :: Int
httpStatus = Int
a} :: StartAppReplicationResponse)
instance Prelude.NFData StartAppReplicationResponse