{-# 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.GetAppReplicationConfiguration
(
GetAppReplicationConfiguration (..),
newGetAppReplicationConfiguration,
getAppReplicationConfiguration_appId,
GetAppReplicationConfigurationResponse (..),
newGetAppReplicationConfigurationResponse,
getAppReplicationConfigurationResponse_serverGroupReplicationConfigurations,
getAppReplicationConfigurationResponse_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 GetAppReplicationConfiguration = GetAppReplicationConfiguration'
{
GetAppReplicationConfiguration -> Maybe Text
appId :: Prelude.Maybe Prelude.Text
}
deriving (GetAppReplicationConfiguration
-> GetAppReplicationConfiguration -> Bool
(GetAppReplicationConfiguration
-> GetAppReplicationConfiguration -> Bool)
-> (GetAppReplicationConfiguration
-> GetAppReplicationConfiguration -> Bool)
-> Eq GetAppReplicationConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetAppReplicationConfiguration
-> GetAppReplicationConfiguration -> Bool
$c/= :: GetAppReplicationConfiguration
-> GetAppReplicationConfiguration -> Bool
== :: GetAppReplicationConfiguration
-> GetAppReplicationConfiguration -> Bool
$c== :: GetAppReplicationConfiguration
-> GetAppReplicationConfiguration -> Bool
Prelude.Eq, ReadPrec [GetAppReplicationConfiguration]
ReadPrec GetAppReplicationConfiguration
Int -> ReadS GetAppReplicationConfiguration
ReadS [GetAppReplicationConfiguration]
(Int -> ReadS GetAppReplicationConfiguration)
-> ReadS [GetAppReplicationConfiguration]
-> ReadPrec GetAppReplicationConfiguration
-> ReadPrec [GetAppReplicationConfiguration]
-> Read GetAppReplicationConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetAppReplicationConfiguration]
$creadListPrec :: ReadPrec [GetAppReplicationConfiguration]
readPrec :: ReadPrec GetAppReplicationConfiguration
$creadPrec :: ReadPrec GetAppReplicationConfiguration
readList :: ReadS [GetAppReplicationConfiguration]
$creadList :: ReadS [GetAppReplicationConfiguration]
readsPrec :: Int -> ReadS GetAppReplicationConfiguration
$creadsPrec :: Int -> ReadS GetAppReplicationConfiguration
Prelude.Read, Int -> GetAppReplicationConfiguration -> ShowS
[GetAppReplicationConfiguration] -> ShowS
GetAppReplicationConfiguration -> String
(Int -> GetAppReplicationConfiguration -> ShowS)
-> (GetAppReplicationConfiguration -> String)
-> ([GetAppReplicationConfiguration] -> ShowS)
-> Show GetAppReplicationConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetAppReplicationConfiguration] -> ShowS
$cshowList :: [GetAppReplicationConfiguration] -> ShowS
show :: GetAppReplicationConfiguration -> String
$cshow :: GetAppReplicationConfiguration -> String
showsPrec :: Int -> GetAppReplicationConfiguration -> ShowS
$cshowsPrec :: Int -> GetAppReplicationConfiguration -> ShowS
Prelude.Show, (forall x.
GetAppReplicationConfiguration
-> Rep GetAppReplicationConfiguration x)
-> (forall x.
Rep GetAppReplicationConfiguration x
-> GetAppReplicationConfiguration)
-> Generic GetAppReplicationConfiguration
forall x.
Rep GetAppReplicationConfiguration x
-> GetAppReplicationConfiguration
forall x.
GetAppReplicationConfiguration
-> Rep GetAppReplicationConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetAppReplicationConfiguration x
-> GetAppReplicationConfiguration
$cfrom :: forall x.
GetAppReplicationConfiguration
-> Rep GetAppReplicationConfiguration x
Prelude.Generic)
newGetAppReplicationConfiguration ::
GetAppReplicationConfiguration
newGetAppReplicationConfiguration :: GetAppReplicationConfiguration
newGetAppReplicationConfiguration =
GetAppReplicationConfiguration' :: Maybe Text -> GetAppReplicationConfiguration
GetAppReplicationConfiguration'
{ $sel:appId:GetAppReplicationConfiguration' :: Maybe Text
appId =
Maybe Text
forall a. Maybe a
Prelude.Nothing
}
getAppReplicationConfiguration_appId :: Lens.Lens' GetAppReplicationConfiguration (Prelude.Maybe Prelude.Text)
getAppReplicationConfiguration_appId :: (Maybe Text -> f (Maybe Text))
-> GetAppReplicationConfiguration
-> f GetAppReplicationConfiguration
getAppReplicationConfiguration_appId = (GetAppReplicationConfiguration -> Maybe Text)
-> (GetAppReplicationConfiguration
-> Maybe Text -> GetAppReplicationConfiguration)
-> Lens
GetAppReplicationConfiguration
GetAppReplicationConfiguration
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAppReplicationConfiguration' {Maybe Text
appId :: Maybe Text
$sel:appId:GetAppReplicationConfiguration' :: GetAppReplicationConfiguration -> Maybe Text
appId} -> Maybe Text
appId) (\s :: GetAppReplicationConfiguration
s@GetAppReplicationConfiguration' {} Maybe Text
a -> GetAppReplicationConfiguration
s {$sel:appId:GetAppReplicationConfiguration' :: Maybe Text
appId = Maybe Text
a} :: GetAppReplicationConfiguration)
instance
Core.AWSRequest
GetAppReplicationConfiguration
where
type
AWSResponse GetAppReplicationConfiguration =
GetAppReplicationConfigurationResponse
request :: GetAppReplicationConfiguration
-> Request GetAppReplicationConfiguration
request = Service
-> GetAppReplicationConfiguration
-> Request GetAppReplicationConfiguration
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy GetAppReplicationConfiguration
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse GetAppReplicationConfiguration)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetAppReplicationConfiguration))
-> Logger
-> Service
-> Proxy GetAppReplicationConfiguration
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse GetAppReplicationConfiguration)))
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 ->
Maybe [ServerGroupReplicationConfiguration]
-> Int -> GetAppReplicationConfigurationResponse
GetAppReplicationConfigurationResponse'
(Maybe [ServerGroupReplicationConfiguration]
-> Int -> GetAppReplicationConfigurationResponse)
-> Either String (Maybe [ServerGroupReplicationConfiguration])
-> Either String (Int -> GetAppReplicationConfigurationResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object
-> Text
-> Either
String (Maybe (Maybe [ServerGroupReplicationConfiguration]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"serverGroupReplicationConfigurations"
Either String (Maybe (Maybe [ServerGroupReplicationConfiguration]))
-> Maybe [ServerGroupReplicationConfiguration]
-> Either String (Maybe [ServerGroupReplicationConfiguration])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ServerGroupReplicationConfiguration]
forall a. Monoid a => a
Prelude.mempty
)
Either String (Int -> GetAppReplicationConfigurationResponse)
-> Either String Int
-> Either String GetAppReplicationConfigurationResponse
forall (f :: * -> *) a b. Applicative f => 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
GetAppReplicationConfiguration
instance
Prelude.NFData
GetAppReplicationConfiguration
instance
Core.ToHeaders
GetAppReplicationConfiguration
where
toHeaders :: GetAppReplicationConfiguration -> ResponseHeaders
toHeaders =
ResponseHeaders
-> GetAppReplicationConfiguration -> 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.GetAppReplicationConfiguration" ::
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 GetAppReplicationConfiguration where
toJSON :: GetAppReplicationConfiguration -> Value
toJSON GetAppReplicationConfiguration' {Maybe Text
appId :: Maybe Text
$sel:appId:GetAppReplicationConfiguration' :: GetAppReplicationConfiguration -> 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 GetAppReplicationConfiguration where
toPath :: GetAppReplicationConfiguration -> ByteString
toPath = ByteString -> GetAppReplicationConfiguration -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery GetAppReplicationConfiguration where
toQuery :: GetAppReplicationConfiguration -> QueryString
toQuery = QueryString -> GetAppReplicationConfiguration -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetAppReplicationConfigurationResponse = GetAppReplicationConfigurationResponse'
{
GetAppReplicationConfigurationResponse
-> Maybe [ServerGroupReplicationConfiguration]
serverGroupReplicationConfigurations :: Prelude.Maybe [ServerGroupReplicationConfiguration],
GetAppReplicationConfigurationResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetAppReplicationConfigurationResponse
-> GetAppReplicationConfigurationResponse -> Bool
(GetAppReplicationConfigurationResponse
-> GetAppReplicationConfigurationResponse -> Bool)
-> (GetAppReplicationConfigurationResponse
-> GetAppReplicationConfigurationResponse -> Bool)
-> Eq GetAppReplicationConfigurationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetAppReplicationConfigurationResponse
-> GetAppReplicationConfigurationResponse -> Bool
$c/= :: GetAppReplicationConfigurationResponse
-> GetAppReplicationConfigurationResponse -> Bool
== :: GetAppReplicationConfigurationResponse
-> GetAppReplicationConfigurationResponse -> Bool
$c== :: GetAppReplicationConfigurationResponse
-> GetAppReplicationConfigurationResponse -> Bool
Prelude.Eq, ReadPrec [GetAppReplicationConfigurationResponse]
ReadPrec GetAppReplicationConfigurationResponse
Int -> ReadS GetAppReplicationConfigurationResponse
ReadS [GetAppReplicationConfigurationResponse]
(Int -> ReadS GetAppReplicationConfigurationResponse)
-> ReadS [GetAppReplicationConfigurationResponse]
-> ReadPrec GetAppReplicationConfigurationResponse
-> ReadPrec [GetAppReplicationConfigurationResponse]
-> Read GetAppReplicationConfigurationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetAppReplicationConfigurationResponse]
$creadListPrec :: ReadPrec [GetAppReplicationConfigurationResponse]
readPrec :: ReadPrec GetAppReplicationConfigurationResponse
$creadPrec :: ReadPrec GetAppReplicationConfigurationResponse
readList :: ReadS [GetAppReplicationConfigurationResponse]
$creadList :: ReadS [GetAppReplicationConfigurationResponse]
readsPrec :: Int -> ReadS GetAppReplicationConfigurationResponse
$creadsPrec :: Int -> ReadS GetAppReplicationConfigurationResponse
Prelude.Read, Int -> GetAppReplicationConfigurationResponse -> ShowS
[GetAppReplicationConfigurationResponse] -> ShowS
GetAppReplicationConfigurationResponse -> String
(Int -> GetAppReplicationConfigurationResponse -> ShowS)
-> (GetAppReplicationConfigurationResponse -> String)
-> ([GetAppReplicationConfigurationResponse] -> ShowS)
-> Show GetAppReplicationConfigurationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetAppReplicationConfigurationResponse] -> ShowS
$cshowList :: [GetAppReplicationConfigurationResponse] -> ShowS
show :: GetAppReplicationConfigurationResponse -> String
$cshow :: GetAppReplicationConfigurationResponse -> String
showsPrec :: Int -> GetAppReplicationConfigurationResponse -> ShowS
$cshowsPrec :: Int -> GetAppReplicationConfigurationResponse -> ShowS
Prelude.Show, (forall x.
GetAppReplicationConfigurationResponse
-> Rep GetAppReplicationConfigurationResponse x)
-> (forall x.
Rep GetAppReplicationConfigurationResponse x
-> GetAppReplicationConfigurationResponse)
-> Generic GetAppReplicationConfigurationResponse
forall x.
Rep GetAppReplicationConfigurationResponse x
-> GetAppReplicationConfigurationResponse
forall x.
GetAppReplicationConfigurationResponse
-> Rep GetAppReplicationConfigurationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetAppReplicationConfigurationResponse x
-> GetAppReplicationConfigurationResponse
$cfrom :: forall x.
GetAppReplicationConfigurationResponse
-> Rep GetAppReplicationConfigurationResponse x
Prelude.Generic)
newGetAppReplicationConfigurationResponse ::
Prelude.Int ->
GetAppReplicationConfigurationResponse
newGetAppReplicationConfigurationResponse :: Int -> GetAppReplicationConfigurationResponse
newGetAppReplicationConfigurationResponse
Int
pHttpStatus_ =
GetAppReplicationConfigurationResponse' :: Maybe [ServerGroupReplicationConfiguration]
-> Int -> GetAppReplicationConfigurationResponse
GetAppReplicationConfigurationResponse'
{ $sel:serverGroupReplicationConfigurations:GetAppReplicationConfigurationResponse' :: Maybe [ServerGroupReplicationConfiguration]
serverGroupReplicationConfigurations =
Maybe [ServerGroupReplicationConfiguration]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetAppReplicationConfigurationResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getAppReplicationConfigurationResponse_serverGroupReplicationConfigurations :: Lens.Lens' GetAppReplicationConfigurationResponse (Prelude.Maybe [ServerGroupReplicationConfiguration])
getAppReplicationConfigurationResponse_serverGroupReplicationConfigurations :: (Maybe [ServerGroupReplicationConfiguration]
-> f (Maybe [ServerGroupReplicationConfiguration]))
-> GetAppReplicationConfigurationResponse
-> f GetAppReplicationConfigurationResponse
getAppReplicationConfigurationResponse_serverGroupReplicationConfigurations = (GetAppReplicationConfigurationResponse
-> Maybe [ServerGroupReplicationConfiguration])
-> (GetAppReplicationConfigurationResponse
-> Maybe [ServerGroupReplicationConfiguration]
-> GetAppReplicationConfigurationResponse)
-> Lens
GetAppReplicationConfigurationResponse
GetAppReplicationConfigurationResponse
(Maybe [ServerGroupReplicationConfiguration])
(Maybe [ServerGroupReplicationConfiguration])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAppReplicationConfigurationResponse' {Maybe [ServerGroupReplicationConfiguration]
serverGroupReplicationConfigurations :: Maybe [ServerGroupReplicationConfiguration]
$sel:serverGroupReplicationConfigurations:GetAppReplicationConfigurationResponse' :: GetAppReplicationConfigurationResponse
-> Maybe [ServerGroupReplicationConfiguration]
serverGroupReplicationConfigurations} -> Maybe [ServerGroupReplicationConfiguration]
serverGroupReplicationConfigurations) (\s :: GetAppReplicationConfigurationResponse
s@GetAppReplicationConfigurationResponse' {} Maybe [ServerGroupReplicationConfiguration]
a -> GetAppReplicationConfigurationResponse
s {$sel:serverGroupReplicationConfigurations:GetAppReplicationConfigurationResponse' :: Maybe [ServerGroupReplicationConfiguration]
serverGroupReplicationConfigurations = Maybe [ServerGroupReplicationConfiguration]
a} :: GetAppReplicationConfigurationResponse) ((Maybe [ServerGroupReplicationConfiguration]
-> f (Maybe [ServerGroupReplicationConfiguration]))
-> GetAppReplicationConfigurationResponse
-> f GetAppReplicationConfigurationResponse)
-> ((Maybe [ServerGroupReplicationConfiguration]
-> f (Maybe [ServerGroupReplicationConfiguration]))
-> Maybe [ServerGroupReplicationConfiguration]
-> f (Maybe [ServerGroupReplicationConfiguration]))
-> (Maybe [ServerGroupReplicationConfiguration]
-> f (Maybe [ServerGroupReplicationConfiguration]))
-> GetAppReplicationConfigurationResponse
-> f GetAppReplicationConfigurationResponse
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
getAppReplicationConfigurationResponse_httpStatus :: Lens.Lens' GetAppReplicationConfigurationResponse Prelude.Int
getAppReplicationConfigurationResponse_httpStatus :: (Int -> f Int)
-> GetAppReplicationConfigurationResponse
-> f GetAppReplicationConfigurationResponse
getAppReplicationConfigurationResponse_httpStatus = (GetAppReplicationConfigurationResponse -> Int)
-> (GetAppReplicationConfigurationResponse
-> Int -> GetAppReplicationConfigurationResponse)
-> Lens
GetAppReplicationConfigurationResponse
GetAppReplicationConfigurationResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAppReplicationConfigurationResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetAppReplicationConfigurationResponse' :: GetAppReplicationConfigurationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetAppReplicationConfigurationResponse
s@GetAppReplicationConfigurationResponse' {} Int
a -> GetAppReplicationConfigurationResponse
s {$sel:httpStatus:GetAppReplicationConfigurationResponse' :: Int
httpStatus = Int
a} :: GetAppReplicationConfigurationResponse)
instance
Prelude.NFData
GetAppReplicationConfigurationResponse