{-# 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.DynamoDB.DescribeGlobalTableSettings
(
DescribeGlobalTableSettings (..),
newDescribeGlobalTableSettings,
describeGlobalTableSettings_globalTableName,
DescribeGlobalTableSettingsResponse (..),
newDescribeGlobalTableSettingsResponse,
describeGlobalTableSettingsResponse_replicaSettings,
describeGlobalTableSettingsResponse_globalTableName,
describeGlobalTableSettingsResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.DynamoDB.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DescribeGlobalTableSettings = DescribeGlobalTableSettings'
{
DescribeGlobalTableSettings -> Text
globalTableName :: Prelude.Text
}
deriving (DescribeGlobalTableSettings -> DescribeGlobalTableSettings -> Bool
(DescribeGlobalTableSettings
-> DescribeGlobalTableSettings -> Bool)
-> (DescribeGlobalTableSettings
-> DescribeGlobalTableSettings -> Bool)
-> Eq DescribeGlobalTableSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeGlobalTableSettings -> DescribeGlobalTableSettings -> Bool
$c/= :: DescribeGlobalTableSettings -> DescribeGlobalTableSettings -> Bool
== :: DescribeGlobalTableSettings -> DescribeGlobalTableSettings -> Bool
$c== :: DescribeGlobalTableSettings -> DescribeGlobalTableSettings -> Bool
Prelude.Eq, ReadPrec [DescribeGlobalTableSettings]
ReadPrec DescribeGlobalTableSettings
Int -> ReadS DescribeGlobalTableSettings
ReadS [DescribeGlobalTableSettings]
(Int -> ReadS DescribeGlobalTableSettings)
-> ReadS [DescribeGlobalTableSettings]
-> ReadPrec DescribeGlobalTableSettings
-> ReadPrec [DescribeGlobalTableSettings]
-> Read DescribeGlobalTableSettings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeGlobalTableSettings]
$creadListPrec :: ReadPrec [DescribeGlobalTableSettings]
readPrec :: ReadPrec DescribeGlobalTableSettings
$creadPrec :: ReadPrec DescribeGlobalTableSettings
readList :: ReadS [DescribeGlobalTableSettings]
$creadList :: ReadS [DescribeGlobalTableSettings]
readsPrec :: Int -> ReadS DescribeGlobalTableSettings
$creadsPrec :: Int -> ReadS DescribeGlobalTableSettings
Prelude.Read, Int -> DescribeGlobalTableSettings -> ShowS
[DescribeGlobalTableSettings] -> ShowS
DescribeGlobalTableSettings -> String
(Int -> DescribeGlobalTableSettings -> ShowS)
-> (DescribeGlobalTableSettings -> String)
-> ([DescribeGlobalTableSettings] -> ShowS)
-> Show DescribeGlobalTableSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeGlobalTableSettings] -> ShowS
$cshowList :: [DescribeGlobalTableSettings] -> ShowS
show :: DescribeGlobalTableSettings -> String
$cshow :: DescribeGlobalTableSettings -> String
showsPrec :: Int -> DescribeGlobalTableSettings -> ShowS
$cshowsPrec :: Int -> DescribeGlobalTableSettings -> ShowS
Prelude.Show, (forall x.
DescribeGlobalTableSettings -> Rep DescribeGlobalTableSettings x)
-> (forall x.
Rep DescribeGlobalTableSettings x -> DescribeGlobalTableSettings)
-> Generic DescribeGlobalTableSettings
forall x.
Rep DescribeGlobalTableSettings x -> DescribeGlobalTableSettings
forall x.
DescribeGlobalTableSettings -> Rep DescribeGlobalTableSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeGlobalTableSettings x -> DescribeGlobalTableSettings
$cfrom :: forall x.
DescribeGlobalTableSettings -> Rep DescribeGlobalTableSettings x
Prelude.Generic)
newDescribeGlobalTableSettings ::
Prelude.Text ->
DescribeGlobalTableSettings
newDescribeGlobalTableSettings :: Text -> DescribeGlobalTableSettings
newDescribeGlobalTableSettings Text
pGlobalTableName_ =
DescribeGlobalTableSettings' :: Text -> DescribeGlobalTableSettings
DescribeGlobalTableSettings'
{ $sel:globalTableName:DescribeGlobalTableSettings' :: Text
globalTableName =
Text
pGlobalTableName_
}
describeGlobalTableSettings_globalTableName :: Lens.Lens' DescribeGlobalTableSettings Prelude.Text
describeGlobalTableSettings_globalTableName :: (Text -> f Text)
-> DescribeGlobalTableSettings -> f DescribeGlobalTableSettings
describeGlobalTableSettings_globalTableName = (DescribeGlobalTableSettings -> Text)
-> (DescribeGlobalTableSettings
-> Text -> DescribeGlobalTableSettings)
-> Lens
DescribeGlobalTableSettings DescribeGlobalTableSettings Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeGlobalTableSettings' {Text
globalTableName :: Text
$sel:globalTableName:DescribeGlobalTableSettings' :: DescribeGlobalTableSettings -> Text
globalTableName} -> Text
globalTableName) (\s :: DescribeGlobalTableSettings
s@DescribeGlobalTableSettings' {} Text
a -> DescribeGlobalTableSettings
s {$sel:globalTableName:DescribeGlobalTableSettings' :: Text
globalTableName = Text
a} :: DescribeGlobalTableSettings)
instance Core.AWSRequest DescribeGlobalTableSettings where
type
AWSResponse DescribeGlobalTableSettings =
DescribeGlobalTableSettingsResponse
request :: DescribeGlobalTableSettings -> Request DescribeGlobalTableSettings
request = Service
-> DescribeGlobalTableSettings
-> Request DescribeGlobalTableSettings
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeGlobalTableSettings
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeGlobalTableSettings)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeGlobalTableSettings))
-> Logger
-> Service
-> Proxy DescribeGlobalTableSettings
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeGlobalTableSettings)))
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 [ReplicaSettingsDescription]
-> Maybe Text -> Int -> DescribeGlobalTableSettingsResponse
DescribeGlobalTableSettingsResponse'
(Maybe [ReplicaSettingsDescription]
-> Maybe Text -> Int -> DescribeGlobalTableSettingsResponse)
-> Either String (Maybe [ReplicaSettingsDescription])
-> Either
String (Maybe Text -> Int -> DescribeGlobalTableSettingsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object
-> Text
-> Either String (Maybe (Maybe [ReplicaSettingsDescription]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ReplicaSettings"
Either String (Maybe (Maybe [ReplicaSettingsDescription]))
-> Maybe [ReplicaSettingsDescription]
-> Either String (Maybe [ReplicaSettingsDescription])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ReplicaSettingsDescription]
forall a. Monoid a => a
Prelude.mempty
)
Either
String (Maybe Text -> Int -> DescribeGlobalTableSettingsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DescribeGlobalTableSettingsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"GlobalTableName")
Either String (Int -> DescribeGlobalTableSettingsResponse)
-> Either String Int
-> Either String DescribeGlobalTableSettingsResponse
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 DescribeGlobalTableSettings
instance Prelude.NFData DescribeGlobalTableSettings
instance Core.ToHeaders DescribeGlobalTableSettings where
toHeaders :: DescribeGlobalTableSettings -> ResponseHeaders
toHeaders =
ResponseHeaders -> DescribeGlobalTableSettings -> 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
"DynamoDB_20120810.DescribeGlobalTableSettings" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.0" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON DescribeGlobalTableSettings where
toJSON :: DescribeGlobalTableSettings -> Value
toJSON DescribeGlobalTableSettings' {Text
globalTableName :: Text
$sel:globalTableName:DescribeGlobalTableSettings' :: DescribeGlobalTableSettings -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"GlobalTableName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
globalTableName)
]
)
instance Core.ToPath DescribeGlobalTableSettings where
toPath :: DescribeGlobalTableSettings -> ByteString
toPath = ByteString -> DescribeGlobalTableSettings -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DescribeGlobalTableSettings where
toQuery :: DescribeGlobalTableSettings -> QueryString
toQuery = QueryString -> DescribeGlobalTableSettings -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeGlobalTableSettingsResponse = DescribeGlobalTableSettingsResponse'
{
DescribeGlobalTableSettingsResponse
-> Maybe [ReplicaSettingsDescription]
replicaSettings :: Prelude.Maybe [ReplicaSettingsDescription],
DescribeGlobalTableSettingsResponse -> Maybe Text
globalTableName :: Prelude.Maybe Prelude.Text,
DescribeGlobalTableSettingsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeGlobalTableSettingsResponse
-> DescribeGlobalTableSettingsResponse -> Bool
(DescribeGlobalTableSettingsResponse
-> DescribeGlobalTableSettingsResponse -> Bool)
-> (DescribeGlobalTableSettingsResponse
-> DescribeGlobalTableSettingsResponse -> Bool)
-> Eq DescribeGlobalTableSettingsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeGlobalTableSettingsResponse
-> DescribeGlobalTableSettingsResponse -> Bool
$c/= :: DescribeGlobalTableSettingsResponse
-> DescribeGlobalTableSettingsResponse -> Bool
== :: DescribeGlobalTableSettingsResponse
-> DescribeGlobalTableSettingsResponse -> Bool
$c== :: DescribeGlobalTableSettingsResponse
-> DescribeGlobalTableSettingsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeGlobalTableSettingsResponse]
ReadPrec DescribeGlobalTableSettingsResponse
Int -> ReadS DescribeGlobalTableSettingsResponse
ReadS [DescribeGlobalTableSettingsResponse]
(Int -> ReadS DescribeGlobalTableSettingsResponse)
-> ReadS [DescribeGlobalTableSettingsResponse]
-> ReadPrec DescribeGlobalTableSettingsResponse
-> ReadPrec [DescribeGlobalTableSettingsResponse]
-> Read DescribeGlobalTableSettingsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeGlobalTableSettingsResponse]
$creadListPrec :: ReadPrec [DescribeGlobalTableSettingsResponse]
readPrec :: ReadPrec DescribeGlobalTableSettingsResponse
$creadPrec :: ReadPrec DescribeGlobalTableSettingsResponse
readList :: ReadS [DescribeGlobalTableSettingsResponse]
$creadList :: ReadS [DescribeGlobalTableSettingsResponse]
readsPrec :: Int -> ReadS DescribeGlobalTableSettingsResponse
$creadsPrec :: Int -> ReadS DescribeGlobalTableSettingsResponse
Prelude.Read, Int -> DescribeGlobalTableSettingsResponse -> ShowS
[DescribeGlobalTableSettingsResponse] -> ShowS
DescribeGlobalTableSettingsResponse -> String
(Int -> DescribeGlobalTableSettingsResponse -> ShowS)
-> (DescribeGlobalTableSettingsResponse -> String)
-> ([DescribeGlobalTableSettingsResponse] -> ShowS)
-> Show DescribeGlobalTableSettingsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeGlobalTableSettingsResponse] -> ShowS
$cshowList :: [DescribeGlobalTableSettingsResponse] -> ShowS
show :: DescribeGlobalTableSettingsResponse -> String
$cshow :: DescribeGlobalTableSettingsResponse -> String
showsPrec :: Int -> DescribeGlobalTableSettingsResponse -> ShowS
$cshowsPrec :: Int -> DescribeGlobalTableSettingsResponse -> ShowS
Prelude.Show, (forall x.
DescribeGlobalTableSettingsResponse
-> Rep DescribeGlobalTableSettingsResponse x)
-> (forall x.
Rep DescribeGlobalTableSettingsResponse x
-> DescribeGlobalTableSettingsResponse)
-> Generic DescribeGlobalTableSettingsResponse
forall x.
Rep DescribeGlobalTableSettingsResponse x
-> DescribeGlobalTableSettingsResponse
forall x.
DescribeGlobalTableSettingsResponse
-> Rep DescribeGlobalTableSettingsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeGlobalTableSettingsResponse x
-> DescribeGlobalTableSettingsResponse
$cfrom :: forall x.
DescribeGlobalTableSettingsResponse
-> Rep DescribeGlobalTableSettingsResponse x
Prelude.Generic)
newDescribeGlobalTableSettingsResponse ::
Prelude.Int ->
DescribeGlobalTableSettingsResponse
newDescribeGlobalTableSettingsResponse :: Int -> DescribeGlobalTableSettingsResponse
newDescribeGlobalTableSettingsResponse Int
pHttpStatus_ =
DescribeGlobalTableSettingsResponse' :: Maybe [ReplicaSettingsDescription]
-> Maybe Text -> Int -> DescribeGlobalTableSettingsResponse
DescribeGlobalTableSettingsResponse'
{ $sel:replicaSettings:DescribeGlobalTableSettingsResponse' :: Maybe [ReplicaSettingsDescription]
replicaSettings =
Maybe [ReplicaSettingsDescription]
forall a. Maybe a
Prelude.Nothing,
$sel:globalTableName:DescribeGlobalTableSettingsResponse' :: Maybe Text
globalTableName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeGlobalTableSettingsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeGlobalTableSettingsResponse_replicaSettings :: Lens.Lens' DescribeGlobalTableSettingsResponse (Prelude.Maybe [ReplicaSettingsDescription])
describeGlobalTableSettingsResponse_replicaSettings :: (Maybe [ReplicaSettingsDescription]
-> f (Maybe [ReplicaSettingsDescription]))
-> DescribeGlobalTableSettingsResponse
-> f DescribeGlobalTableSettingsResponse
describeGlobalTableSettingsResponse_replicaSettings = (DescribeGlobalTableSettingsResponse
-> Maybe [ReplicaSettingsDescription])
-> (DescribeGlobalTableSettingsResponse
-> Maybe [ReplicaSettingsDescription]
-> DescribeGlobalTableSettingsResponse)
-> Lens
DescribeGlobalTableSettingsResponse
DescribeGlobalTableSettingsResponse
(Maybe [ReplicaSettingsDescription])
(Maybe [ReplicaSettingsDescription])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeGlobalTableSettingsResponse' {Maybe [ReplicaSettingsDescription]
replicaSettings :: Maybe [ReplicaSettingsDescription]
$sel:replicaSettings:DescribeGlobalTableSettingsResponse' :: DescribeGlobalTableSettingsResponse
-> Maybe [ReplicaSettingsDescription]
replicaSettings} -> Maybe [ReplicaSettingsDescription]
replicaSettings) (\s :: DescribeGlobalTableSettingsResponse
s@DescribeGlobalTableSettingsResponse' {} Maybe [ReplicaSettingsDescription]
a -> DescribeGlobalTableSettingsResponse
s {$sel:replicaSettings:DescribeGlobalTableSettingsResponse' :: Maybe [ReplicaSettingsDescription]
replicaSettings = Maybe [ReplicaSettingsDescription]
a} :: DescribeGlobalTableSettingsResponse) ((Maybe [ReplicaSettingsDescription]
-> f (Maybe [ReplicaSettingsDescription]))
-> DescribeGlobalTableSettingsResponse
-> f DescribeGlobalTableSettingsResponse)
-> ((Maybe [ReplicaSettingsDescription]
-> f (Maybe [ReplicaSettingsDescription]))
-> Maybe [ReplicaSettingsDescription]
-> f (Maybe [ReplicaSettingsDescription]))
-> (Maybe [ReplicaSettingsDescription]
-> f (Maybe [ReplicaSettingsDescription]))
-> DescribeGlobalTableSettingsResponse
-> f DescribeGlobalTableSettingsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[ReplicaSettingsDescription]
[ReplicaSettingsDescription]
[ReplicaSettingsDescription]
[ReplicaSettingsDescription]
-> Iso
(Maybe [ReplicaSettingsDescription])
(Maybe [ReplicaSettingsDescription])
(Maybe [ReplicaSettingsDescription])
(Maybe [ReplicaSettingsDescription])
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
[ReplicaSettingsDescription]
[ReplicaSettingsDescription]
[ReplicaSettingsDescription]
[ReplicaSettingsDescription]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
describeGlobalTableSettingsResponse_globalTableName :: Lens.Lens' DescribeGlobalTableSettingsResponse (Prelude.Maybe Prelude.Text)
describeGlobalTableSettingsResponse_globalTableName :: (Maybe Text -> f (Maybe Text))
-> DescribeGlobalTableSettingsResponse
-> f DescribeGlobalTableSettingsResponse
describeGlobalTableSettingsResponse_globalTableName = (DescribeGlobalTableSettingsResponse -> Maybe Text)
-> (DescribeGlobalTableSettingsResponse
-> Maybe Text -> DescribeGlobalTableSettingsResponse)
-> Lens
DescribeGlobalTableSettingsResponse
DescribeGlobalTableSettingsResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeGlobalTableSettingsResponse' {Maybe Text
globalTableName :: Maybe Text
$sel:globalTableName:DescribeGlobalTableSettingsResponse' :: DescribeGlobalTableSettingsResponse -> Maybe Text
globalTableName} -> Maybe Text
globalTableName) (\s :: DescribeGlobalTableSettingsResponse
s@DescribeGlobalTableSettingsResponse' {} Maybe Text
a -> DescribeGlobalTableSettingsResponse
s {$sel:globalTableName:DescribeGlobalTableSettingsResponse' :: Maybe Text
globalTableName = Maybe Text
a} :: DescribeGlobalTableSettingsResponse)
describeGlobalTableSettingsResponse_httpStatus :: Lens.Lens' DescribeGlobalTableSettingsResponse Prelude.Int
describeGlobalTableSettingsResponse_httpStatus :: (Int -> f Int)
-> DescribeGlobalTableSettingsResponse
-> f DescribeGlobalTableSettingsResponse
describeGlobalTableSettingsResponse_httpStatus = (DescribeGlobalTableSettingsResponse -> Int)
-> (DescribeGlobalTableSettingsResponse
-> Int -> DescribeGlobalTableSettingsResponse)
-> Lens
DescribeGlobalTableSettingsResponse
DescribeGlobalTableSettingsResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeGlobalTableSettingsResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeGlobalTableSettingsResponse' :: DescribeGlobalTableSettingsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeGlobalTableSettingsResponse
s@DescribeGlobalTableSettingsResponse' {} Int
a -> DescribeGlobalTableSettingsResponse
s {$sel:httpStatus:DescribeGlobalTableSettingsResponse' :: Int
httpStatus = Int
a} :: DescribeGlobalTableSettingsResponse)
instance
Prelude.NFData
DescribeGlobalTableSettingsResponse