{-# 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.PutAppReplicationConfiguration
(
PutAppReplicationConfiguration (..),
newPutAppReplicationConfiguration,
putAppReplicationConfiguration_appId,
putAppReplicationConfiguration_serverGroupReplicationConfigurations,
PutAppReplicationConfigurationResponse (..),
newPutAppReplicationConfigurationResponse,
putAppReplicationConfigurationResponse_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 PutAppReplicationConfiguration = PutAppReplicationConfiguration'
{
PutAppReplicationConfiguration -> Maybe Text
appId :: Prelude.Maybe Prelude.Text,
PutAppReplicationConfiguration
-> Maybe [ServerGroupReplicationConfiguration]
serverGroupReplicationConfigurations :: Prelude.Maybe [ServerGroupReplicationConfiguration]
}
deriving (PutAppReplicationConfiguration
-> PutAppReplicationConfiguration -> Bool
(PutAppReplicationConfiguration
-> PutAppReplicationConfiguration -> Bool)
-> (PutAppReplicationConfiguration
-> PutAppReplicationConfiguration -> Bool)
-> Eq PutAppReplicationConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutAppReplicationConfiguration
-> PutAppReplicationConfiguration -> Bool
$c/= :: PutAppReplicationConfiguration
-> PutAppReplicationConfiguration -> Bool
== :: PutAppReplicationConfiguration
-> PutAppReplicationConfiguration -> Bool
$c== :: PutAppReplicationConfiguration
-> PutAppReplicationConfiguration -> Bool
Prelude.Eq, ReadPrec [PutAppReplicationConfiguration]
ReadPrec PutAppReplicationConfiguration
Int -> ReadS PutAppReplicationConfiguration
ReadS [PutAppReplicationConfiguration]
(Int -> ReadS PutAppReplicationConfiguration)
-> ReadS [PutAppReplicationConfiguration]
-> ReadPrec PutAppReplicationConfiguration
-> ReadPrec [PutAppReplicationConfiguration]
-> Read PutAppReplicationConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutAppReplicationConfiguration]
$creadListPrec :: ReadPrec [PutAppReplicationConfiguration]
readPrec :: ReadPrec PutAppReplicationConfiguration
$creadPrec :: ReadPrec PutAppReplicationConfiguration
readList :: ReadS [PutAppReplicationConfiguration]
$creadList :: ReadS [PutAppReplicationConfiguration]
readsPrec :: Int -> ReadS PutAppReplicationConfiguration
$creadsPrec :: Int -> ReadS PutAppReplicationConfiguration
Prelude.Read, Int -> PutAppReplicationConfiguration -> ShowS
[PutAppReplicationConfiguration] -> ShowS
PutAppReplicationConfiguration -> String
(Int -> PutAppReplicationConfiguration -> ShowS)
-> (PutAppReplicationConfiguration -> String)
-> ([PutAppReplicationConfiguration] -> ShowS)
-> Show PutAppReplicationConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutAppReplicationConfiguration] -> ShowS
$cshowList :: [PutAppReplicationConfiguration] -> ShowS
show :: PutAppReplicationConfiguration -> String
$cshow :: PutAppReplicationConfiguration -> String
showsPrec :: Int -> PutAppReplicationConfiguration -> ShowS
$cshowsPrec :: Int -> PutAppReplicationConfiguration -> ShowS
Prelude.Show, (forall x.
PutAppReplicationConfiguration
-> Rep PutAppReplicationConfiguration x)
-> (forall x.
Rep PutAppReplicationConfiguration x
-> PutAppReplicationConfiguration)
-> Generic PutAppReplicationConfiguration
forall x.
Rep PutAppReplicationConfiguration x
-> PutAppReplicationConfiguration
forall x.
PutAppReplicationConfiguration
-> Rep PutAppReplicationConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutAppReplicationConfiguration x
-> PutAppReplicationConfiguration
$cfrom :: forall x.
PutAppReplicationConfiguration
-> Rep PutAppReplicationConfiguration x
Prelude.Generic)
newPutAppReplicationConfiguration ::
PutAppReplicationConfiguration
newPutAppReplicationConfiguration :: PutAppReplicationConfiguration
newPutAppReplicationConfiguration =
PutAppReplicationConfiguration' :: Maybe Text
-> Maybe [ServerGroupReplicationConfiguration]
-> PutAppReplicationConfiguration
PutAppReplicationConfiguration'
{ $sel:appId:PutAppReplicationConfiguration' :: Maybe Text
appId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:serverGroupReplicationConfigurations:PutAppReplicationConfiguration' :: Maybe [ServerGroupReplicationConfiguration]
serverGroupReplicationConfigurations =
Maybe [ServerGroupReplicationConfiguration]
forall a. Maybe a
Prelude.Nothing
}
putAppReplicationConfiguration_appId :: Lens.Lens' PutAppReplicationConfiguration (Prelude.Maybe Prelude.Text)
putAppReplicationConfiguration_appId :: (Maybe Text -> f (Maybe Text))
-> PutAppReplicationConfiguration
-> f PutAppReplicationConfiguration
putAppReplicationConfiguration_appId = (PutAppReplicationConfiguration -> Maybe Text)
-> (PutAppReplicationConfiguration
-> Maybe Text -> PutAppReplicationConfiguration)
-> Lens
PutAppReplicationConfiguration
PutAppReplicationConfiguration
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutAppReplicationConfiguration' {Maybe Text
appId :: Maybe Text
$sel:appId:PutAppReplicationConfiguration' :: PutAppReplicationConfiguration -> Maybe Text
appId} -> Maybe Text
appId) (\s :: PutAppReplicationConfiguration
s@PutAppReplicationConfiguration' {} Maybe Text
a -> PutAppReplicationConfiguration
s {$sel:appId:PutAppReplicationConfiguration' :: Maybe Text
appId = Maybe Text
a} :: PutAppReplicationConfiguration)
putAppReplicationConfiguration_serverGroupReplicationConfigurations :: Lens.Lens' PutAppReplicationConfiguration (Prelude.Maybe [ServerGroupReplicationConfiguration])
putAppReplicationConfiguration_serverGroupReplicationConfigurations :: (Maybe [ServerGroupReplicationConfiguration]
-> f (Maybe [ServerGroupReplicationConfiguration]))
-> PutAppReplicationConfiguration
-> f PutAppReplicationConfiguration
putAppReplicationConfiguration_serverGroupReplicationConfigurations = (PutAppReplicationConfiguration
-> Maybe [ServerGroupReplicationConfiguration])
-> (PutAppReplicationConfiguration
-> Maybe [ServerGroupReplicationConfiguration]
-> PutAppReplicationConfiguration)
-> Lens
PutAppReplicationConfiguration
PutAppReplicationConfiguration
(Maybe [ServerGroupReplicationConfiguration])
(Maybe [ServerGroupReplicationConfiguration])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutAppReplicationConfiguration' {Maybe [ServerGroupReplicationConfiguration]
serverGroupReplicationConfigurations :: Maybe [ServerGroupReplicationConfiguration]
$sel:serverGroupReplicationConfigurations:PutAppReplicationConfiguration' :: PutAppReplicationConfiguration
-> Maybe [ServerGroupReplicationConfiguration]
serverGroupReplicationConfigurations} -> Maybe [ServerGroupReplicationConfiguration]
serverGroupReplicationConfigurations) (\s :: PutAppReplicationConfiguration
s@PutAppReplicationConfiguration' {} Maybe [ServerGroupReplicationConfiguration]
a -> PutAppReplicationConfiguration
s {$sel:serverGroupReplicationConfigurations:PutAppReplicationConfiguration' :: Maybe [ServerGroupReplicationConfiguration]
serverGroupReplicationConfigurations = Maybe [ServerGroupReplicationConfiguration]
a} :: PutAppReplicationConfiguration) ((Maybe [ServerGroupReplicationConfiguration]
-> f (Maybe [ServerGroupReplicationConfiguration]))
-> PutAppReplicationConfiguration
-> f PutAppReplicationConfiguration)
-> ((Maybe [ServerGroupReplicationConfiguration]
-> f (Maybe [ServerGroupReplicationConfiguration]))
-> Maybe [ServerGroupReplicationConfiguration]
-> f (Maybe [ServerGroupReplicationConfiguration]))
-> (Maybe [ServerGroupReplicationConfiguration]
-> f (Maybe [ServerGroupReplicationConfiguration]))
-> PutAppReplicationConfiguration
-> f PutAppReplicationConfiguration
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[ServerGroupReplicationConfiguration]
[ServerGroupReplicationConfiguration]
[ServerGroupReplicationConfiguration]
[ServerGroupReplicationConfiguration]
-> Iso
(Maybe [ServerGroupReplicationConfiguration])
(Maybe [ServerGroupReplicationConfiguration])
(Maybe [ServerGroupReplicationConfiguration])
(Maybe [ServerGroupReplicationConfiguration])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
[ServerGroupReplicationConfiguration]
[ServerGroupReplicationConfiguration]
[ServerGroupReplicationConfiguration]
[ServerGroupReplicationConfiguration]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance
Core.AWSRequest
PutAppReplicationConfiguration
where
type
AWSResponse PutAppReplicationConfiguration =
PutAppReplicationConfigurationResponse
request :: PutAppReplicationConfiguration
-> Request PutAppReplicationConfiguration
request = Service
-> PutAppReplicationConfiguration
-> Request PutAppReplicationConfiguration
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy PutAppReplicationConfiguration
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse PutAppReplicationConfiguration)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse PutAppReplicationConfiguration))
-> Logger
-> Service
-> Proxy PutAppReplicationConfiguration
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse PutAppReplicationConfiguration)))
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 -> PutAppReplicationConfigurationResponse
PutAppReplicationConfigurationResponse'
(Int -> PutAppReplicationConfigurationResponse)
-> Either String Int
-> Either String PutAppReplicationConfigurationResponse
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
PutAppReplicationConfiguration
instance
Prelude.NFData
PutAppReplicationConfiguration
instance
Core.ToHeaders
PutAppReplicationConfiguration
where
toHeaders :: PutAppReplicationConfiguration -> ResponseHeaders
toHeaders =
ResponseHeaders
-> PutAppReplicationConfiguration -> 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.PutAppReplicationConfiguration" ::
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 PutAppReplicationConfiguration where
toJSON :: PutAppReplicationConfiguration -> Value
toJSON PutAppReplicationConfiguration' {Maybe [ServerGroupReplicationConfiguration]
Maybe Text
serverGroupReplicationConfigurations :: Maybe [ServerGroupReplicationConfiguration]
appId :: Maybe Text
$sel:serverGroupReplicationConfigurations:PutAppReplicationConfiguration' :: PutAppReplicationConfiguration
-> Maybe [ServerGroupReplicationConfiguration]
$sel:appId:PutAppReplicationConfiguration' :: PutAppReplicationConfiguration -> 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,
(Text
"serverGroupReplicationConfigurations" Text -> [ServerGroupReplicationConfiguration] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
([ServerGroupReplicationConfiguration] -> Pair)
-> Maybe [ServerGroupReplicationConfiguration] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [ServerGroupReplicationConfiguration]
serverGroupReplicationConfigurations
]
)
instance Core.ToPath PutAppReplicationConfiguration where
toPath :: PutAppReplicationConfiguration -> ByteString
toPath = ByteString -> PutAppReplicationConfiguration -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery PutAppReplicationConfiguration where
toQuery :: PutAppReplicationConfiguration -> QueryString
toQuery = QueryString -> PutAppReplicationConfiguration -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data PutAppReplicationConfigurationResponse = PutAppReplicationConfigurationResponse'
{
PutAppReplicationConfigurationResponse -> Int
httpStatus :: Prelude.Int
}
deriving (PutAppReplicationConfigurationResponse
-> PutAppReplicationConfigurationResponse -> Bool
(PutAppReplicationConfigurationResponse
-> PutAppReplicationConfigurationResponse -> Bool)
-> (PutAppReplicationConfigurationResponse
-> PutAppReplicationConfigurationResponse -> Bool)
-> Eq PutAppReplicationConfigurationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutAppReplicationConfigurationResponse
-> PutAppReplicationConfigurationResponse -> Bool
$c/= :: PutAppReplicationConfigurationResponse
-> PutAppReplicationConfigurationResponse -> Bool
== :: PutAppReplicationConfigurationResponse
-> PutAppReplicationConfigurationResponse -> Bool
$c== :: PutAppReplicationConfigurationResponse
-> PutAppReplicationConfigurationResponse -> Bool
Prelude.Eq, ReadPrec [PutAppReplicationConfigurationResponse]
ReadPrec PutAppReplicationConfigurationResponse
Int -> ReadS PutAppReplicationConfigurationResponse
ReadS [PutAppReplicationConfigurationResponse]
(Int -> ReadS PutAppReplicationConfigurationResponse)
-> ReadS [PutAppReplicationConfigurationResponse]
-> ReadPrec PutAppReplicationConfigurationResponse
-> ReadPrec [PutAppReplicationConfigurationResponse]
-> Read PutAppReplicationConfigurationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutAppReplicationConfigurationResponse]
$creadListPrec :: ReadPrec [PutAppReplicationConfigurationResponse]
readPrec :: ReadPrec PutAppReplicationConfigurationResponse
$creadPrec :: ReadPrec PutAppReplicationConfigurationResponse
readList :: ReadS [PutAppReplicationConfigurationResponse]
$creadList :: ReadS [PutAppReplicationConfigurationResponse]
readsPrec :: Int -> ReadS PutAppReplicationConfigurationResponse
$creadsPrec :: Int -> ReadS PutAppReplicationConfigurationResponse
Prelude.Read, Int -> PutAppReplicationConfigurationResponse -> ShowS
[PutAppReplicationConfigurationResponse] -> ShowS
PutAppReplicationConfigurationResponse -> String
(Int -> PutAppReplicationConfigurationResponse -> ShowS)
-> (PutAppReplicationConfigurationResponse -> String)
-> ([PutAppReplicationConfigurationResponse] -> ShowS)
-> Show PutAppReplicationConfigurationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutAppReplicationConfigurationResponse] -> ShowS
$cshowList :: [PutAppReplicationConfigurationResponse] -> ShowS
show :: PutAppReplicationConfigurationResponse -> String
$cshow :: PutAppReplicationConfigurationResponse -> String
showsPrec :: Int -> PutAppReplicationConfigurationResponse -> ShowS
$cshowsPrec :: Int -> PutAppReplicationConfigurationResponse -> ShowS
Prelude.Show, (forall x.
PutAppReplicationConfigurationResponse
-> Rep PutAppReplicationConfigurationResponse x)
-> (forall x.
Rep PutAppReplicationConfigurationResponse x
-> PutAppReplicationConfigurationResponse)
-> Generic PutAppReplicationConfigurationResponse
forall x.
Rep PutAppReplicationConfigurationResponse x
-> PutAppReplicationConfigurationResponse
forall x.
PutAppReplicationConfigurationResponse
-> Rep PutAppReplicationConfigurationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutAppReplicationConfigurationResponse x
-> PutAppReplicationConfigurationResponse
$cfrom :: forall x.
PutAppReplicationConfigurationResponse
-> Rep PutAppReplicationConfigurationResponse x
Prelude.Generic)
newPutAppReplicationConfigurationResponse ::
Prelude.Int ->
PutAppReplicationConfigurationResponse
newPutAppReplicationConfigurationResponse :: Int -> PutAppReplicationConfigurationResponse
newPutAppReplicationConfigurationResponse
Int
pHttpStatus_ =
PutAppReplicationConfigurationResponse' :: Int -> PutAppReplicationConfigurationResponse
PutAppReplicationConfigurationResponse'
{ $sel:httpStatus:PutAppReplicationConfigurationResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
putAppReplicationConfigurationResponse_httpStatus :: Lens.Lens' PutAppReplicationConfigurationResponse Prelude.Int
putAppReplicationConfigurationResponse_httpStatus :: (Int -> f Int)
-> PutAppReplicationConfigurationResponse
-> f PutAppReplicationConfigurationResponse
putAppReplicationConfigurationResponse_httpStatus = (PutAppReplicationConfigurationResponse -> Int)
-> (PutAppReplicationConfigurationResponse
-> Int -> PutAppReplicationConfigurationResponse)
-> Lens
PutAppReplicationConfigurationResponse
PutAppReplicationConfigurationResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutAppReplicationConfigurationResponse' {Int
httpStatus :: Int
$sel:httpStatus:PutAppReplicationConfigurationResponse' :: PutAppReplicationConfigurationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: PutAppReplicationConfigurationResponse
s@PutAppReplicationConfigurationResponse' {} Int
a -> PutAppReplicationConfigurationResponse
s {$sel:httpStatus:PutAppReplicationConfigurationResponse' :: Int
httpStatus = Int
a} :: PutAppReplicationConfigurationResponse)
instance
Prelude.NFData
PutAppReplicationConfigurationResponse