{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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' {$sel:appId:StartAppReplication' :: Maybe Text
appId = forall a. Maybe a
Prelude.Nothing}
startAppReplication_appId :: Lens.Lens' StartAppReplication (Prelude.Maybe Prelude.Text)
startAppReplication_appId :: Lens' StartAppReplication (Maybe Text)
startAppReplication_appId = 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 :: (Service -> Service)
-> StartAppReplication -> Request StartAppReplication
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 StartAppReplication
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse StartAppReplication)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> StartAppReplicationResponse
StartAppReplicationResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable StartAppReplication where
hashWithSalt :: Int -> StartAppReplication -> Int
hashWithSalt Int
_salt StartAppReplication' {Maybe Text
appId :: Maybe Text
$sel:appId:StartAppReplication' :: StartAppReplication -> Maybe Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
appId
instance Prelude.NFData StartAppReplication where
rnf :: StartAppReplication -> ()
rnf StartAppReplication' {Maybe Text
appId :: Maybe Text
$sel:appId:StartAppReplication' :: StartAppReplication -> Maybe Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
appId
instance Data.ToHeaders StartAppReplication where
toHeaders :: StartAppReplication -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AWSServerMigrationService_V2016_10_24.StartAppReplication" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON StartAppReplication where
toJSON :: StartAppReplication -> Value
toJSON StartAppReplication' {Maybe Text
appId :: Maybe Text
$sel:appId:StartAppReplication' :: StartAppReplication -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(Key
"appId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
appId]
)
instance Data.ToPath StartAppReplication where
toPath :: StartAppReplication -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery StartAppReplication where
toQuery :: StartAppReplication -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data StartAppReplicationResponse = StartAppReplicationResponse'
{
StartAppReplicationResponse -> Int
httpStatus :: Prelude.Int
}
deriving (StartAppReplicationResponse -> StartAppReplicationResponse -> Bool
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]
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
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.
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'
{ $sel:httpStatus:StartAppReplicationResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
startAppReplicationResponse_httpStatus :: Lens.Lens' StartAppReplicationResponse Prelude.Int
startAppReplicationResponse_httpStatus :: Lens' StartAppReplicationResponse Int
startAppReplicationResponse_httpStatus = 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 where
rnf :: StartAppReplicationResponse -> ()
rnf StartAppReplicationResponse' {Int
httpStatus :: Int
$sel:httpStatus:StartAppReplicationResponse' :: StartAppReplicationResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus