{-# 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.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 PutAppReplicationConfiguration = PutAppReplicationConfiguration'
{
PutAppReplicationConfiguration -> Maybe Text
appId :: Prelude.Maybe Prelude.Text,
PutAppReplicationConfiguration
-> Maybe [ServerGroupReplicationConfiguration]
serverGroupReplicationConfigurations :: Prelude.Maybe [ServerGroupReplicationConfiguration]
}
deriving (PutAppReplicationConfiguration
-> PutAppReplicationConfiguration -> Bool
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]
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
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.
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'
{ $sel:appId:PutAppReplicationConfiguration' :: Maybe Text
appId =
forall a. Maybe a
Prelude.Nothing,
$sel:serverGroupReplicationConfigurations:PutAppReplicationConfiguration' :: Maybe [ServerGroupReplicationConfiguration]
serverGroupReplicationConfigurations =
forall a. Maybe a
Prelude.Nothing
}
putAppReplicationConfiguration_appId :: Lens.Lens' PutAppReplicationConfiguration (Prelude.Maybe Prelude.Text)
putAppReplicationConfiguration_appId :: Lens' PutAppReplicationConfiguration (Maybe Text)
putAppReplicationConfiguration_appId = 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 :: Lens'
PutAppReplicationConfiguration
(Maybe [ServerGroupReplicationConfiguration])
putAppReplicationConfiguration_serverGroupReplicationConfigurations = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 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 :: (Service -> Service)
-> PutAppReplicationConfiguration
-> Request PutAppReplicationConfiguration
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 PutAppReplicationConfiguration
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse PutAppReplicationConfiguration)))
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 -> PutAppReplicationConfigurationResponse
PutAppReplicationConfigurationResponse'
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
PutAppReplicationConfiguration
where
hashWithSalt :: Int -> PutAppReplicationConfiguration -> Int
hashWithSalt
Int
_salt
PutAppReplicationConfiguration' {Maybe [ServerGroupReplicationConfiguration]
Maybe Text
serverGroupReplicationConfigurations :: Maybe [ServerGroupReplicationConfiguration]
appId :: Maybe Text
$sel:serverGroupReplicationConfigurations:PutAppReplicationConfiguration' :: PutAppReplicationConfiguration
-> Maybe [ServerGroupReplicationConfiguration]
$sel:appId:PutAppReplicationConfiguration' :: PutAppReplicationConfiguration -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
appId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [ServerGroupReplicationConfiguration]
serverGroupReplicationConfigurations
instance
Prelude.NFData
PutAppReplicationConfiguration
where
rnf :: PutAppReplicationConfiguration -> ()
rnf PutAppReplicationConfiguration' {Maybe [ServerGroupReplicationConfiguration]
Maybe Text
serverGroupReplicationConfigurations :: Maybe [ServerGroupReplicationConfiguration]
appId :: Maybe Text
$sel:serverGroupReplicationConfigurations:PutAppReplicationConfiguration' :: PutAppReplicationConfiguration
-> Maybe [ServerGroupReplicationConfiguration]
$sel:appId:PutAppReplicationConfiguration' :: PutAppReplicationConfiguration -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
appId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [ServerGroupReplicationConfiguration]
serverGroupReplicationConfigurations
instance
Data.ToHeaders
PutAppReplicationConfiguration
where
toHeaders :: PutAppReplicationConfiguration -> 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.PutAppReplicationConfiguration" ::
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 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
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,
(Key
"serverGroupReplicationConfigurations" 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 [ServerGroupReplicationConfiguration]
serverGroupReplicationConfigurations
]
)
instance Data.ToPath PutAppReplicationConfiguration where
toPath :: PutAppReplicationConfiguration -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery PutAppReplicationConfiguration where
toQuery :: PutAppReplicationConfiguration -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data PutAppReplicationConfigurationResponse = PutAppReplicationConfigurationResponse'
{
PutAppReplicationConfigurationResponse -> Int
httpStatus :: Prelude.Int
}
deriving (PutAppReplicationConfigurationResponse
-> PutAppReplicationConfigurationResponse -> Bool
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]
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
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.
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'
{ $sel:httpStatus:PutAppReplicationConfigurationResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
putAppReplicationConfigurationResponse_httpStatus :: Lens.Lens' PutAppReplicationConfigurationResponse Prelude.Int
putAppReplicationConfigurationResponse_httpStatus :: Lens' PutAppReplicationConfigurationResponse Int
putAppReplicationConfigurationResponse_httpStatus = 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
where
rnf :: PutAppReplicationConfigurationResponse -> ()
rnf PutAppReplicationConfigurationResponse' {Int
httpStatus :: Int
$sel:httpStatus:PutAppReplicationConfigurationResponse' :: PutAppReplicationConfigurationResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus