{-# 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.DescribeTableReplicaAutoScaling
(
DescribeTableReplicaAutoScaling (..),
newDescribeTableReplicaAutoScaling,
describeTableReplicaAutoScaling_tableName,
DescribeTableReplicaAutoScalingResponse (..),
newDescribeTableReplicaAutoScalingResponse,
describeTableReplicaAutoScalingResponse_tableAutoScalingDescription,
describeTableReplicaAutoScalingResponse_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 DescribeTableReplicaAutoScaling = DescribeTableReplicaAutoScaling'
{
DescribeTableReplicaAutoScaling -> Text
tableName :: Prelude.Text
}
deriving (DescribeTableReplicaAutoScaling
-> DescribeTableReplicaAutoScaling -> Bool
(DescribeTableReplicaAutoScaling
-> DescribeTableReplicaAutoScaling -> Bool)
-> (DescribeTableReplicaAutoScaling
-> DescribeTableReplicaAutoScaling -> Bool)
-> Eq DescribeTableReplicaAutoScaling
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeTableReplicaAutoScaling
-> DescribeTableReplicaAutoScaling -> Bool
$c/= :: DescribeTableReplicaAutoScaling
-> DescribeTableReplicaAutoScaling -> Bool
== :: DescribeTableReplicaAutoScaling
-> DescribeTableReplicaAutoScaling -> Bool
$c== :: DescribeTableReplicaAutoScaling
-> DescribeTableReplicaAutoScaling -> Bool
Prelude.Eq, ReadPrec [DescribeTableReplicaAutoScaling]
ReadPrec DescribeTableReplicaAutoScaling
Int -> ReadS DescribeTableReplicaAutoScaling
ReadS [DescribeTableReplicaAutoScaling]
(Int -> ReadS DescribeTableReplicaAutoScaling)
-> ReadS [DescribeTableReplicaAutoScaling]
-> ReadPrec DescribeTableReplicaAutoScaling
-> ReadPrec [DescribeTableReplicaAutoScaling]
-> Read DescribeTableReplicaAutoScaling
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeTableReplicaAutoScaling]
$creadListPrec :: ReadPrec [DescribeTableReplicaAutoScaling]
readPrec :: ReadPrec DescribeTableReplicaAutoScaling
$creadPrec :: ReadPrec DescribeTableReplicaAutoScaling
readList :: ReadS [DescribeTableReplicaAutoScaling]
$creadList :: ReadS [DescribeTableReplicaAutoScaling]
readsPrec :: Int -> ReadS DescribeTableReplicaAutoScaling
$creadsPrec :: Int -> ReadS DescribeTableReplicaAutoScaling
Prelude.Read, Int -> DescribeTableReplicaAutoScaling -> ShowS
[DescribeTableReplicaAutoScaling] -> ShowS
DescribeTableReplicaAutoScaling -> String
(Int -> DescribeTableReplicaAutoScaling -> ShowS)
-> (DescribeTableReplicaAutoScaling -> String)
-> ([DescribeTableReplicaAutoScaling] -> ShowS)
-> Show DescribeTableReplicaAutoScaling
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeTableReplicaAutoScaling] -> ShowS
$cshowList :: [DescribeTableReplicaAutoScaling] -> ShowS
show :: DescribeTableReplicaAutoScaling -> String
$cshow :: DescribeTableReplicaAutoScaling -> String
showsPrec :: Int -> DescribeTableReplicaAutoScaling -> ShowS
$cshowsPrec :: Int -> DescribeTableReplicaAutoScaling -> ShowS
Prelude.Show, (forall x.
DescribeTableReplicaAutoScaling
-> Rep DescribeTableReplicaAutoScaling x)
-> (forall x.
Rep DescribeTableReplicaAutoScaling x
-> DescribeTableReplicaAutoScaling)
-> Generic DescribeTableReplicaAutoScaling
forall x.
Rep DescribeTableReplicaAutoScaling x
-> DescribeTableReplicaAutoScaling
forall x.
DescribeTableReplicaAutoScaling
-> Rep DescribeTableReplicaAutoScaling x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeTableReplicaAutoScaling x
-> DescribeTableReplicaAutoScaling
$cfrom :: forall x.
DescribeTableReplicaAutoScaling
-> Rep DescribeTableReplicaAutoScaling x
Prelude.Generic)
newDescribeTableReplicaAutoScaling ::
Prelude.Text ->
DescribeTableReplicaAutoScaling
newDescribeTableReplicaAutoScaling :: Text -> DescribeTableReplicaAutoScaling
newDescribeTableReplicaAutoScaling Text
pTableName_ =
DescribeTableReplicaAutoScaling' :: Text -> DescribeTableReplicaAutoScaling
DescribeTableReplicaAutoScaling'
{ $sel:tableName:DescribeTableReplicaAutoScaling' :: Text
tableName =
Text
pTableName_
}
describeTableReplicaAutoScaling_tableName :: Lens.Lens' DescribeTableReplicaAutoScaling Prelude.Text
describeTableReplicaAutoScaling_tableName :: (Text -> f Text)
-> DescribeTableReplicaAutoScaling
-> f DescribeTableReplicaAutoScaling
describeTableReplicaAutoScaling_tableName = (DescribeTableReplicaAutoScaling -> Text)
-> (DescribeTableReplicaAutoScaling
-> Text -> DescribeTableReplicaAutoScaling)
-> Lens
DescribeTableReplicaAutoScaling
DescribeTableReplicaAutoScaling
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTableReplicaAutoScaling' {Text
tableName :: Text
$sel:tableName:DescribeTableReplicaAutoScaling' :: DescribeTableReplicaAutoScaling -> Text
tableName} -> Text
tableName) (\s :: DescribeTableReplicaAutoScaling
s@DescribeTableReplicaAutoScaling' {} Text
a -> DescribeTableReplicaAutoScaling
s {$sel:tableName:DescribeTableReplicaAutoScaling' :: Text
tableName = Text
a} :: DescribeTableReplicaAutoScaling)
instance
Core.AWSRequest
DescribeTableReplicaAutoScaling
where
type
AWSResponse DescribeTableReplicaAutoScaling =
DescribeTableReplicaAutoScalingResponse
request :: DescribeTableReplicaAutoScaling
-> Request DescribeTableReplicaAutoScaling
request = Service
-> DescribeTableReplicaAutoScaling
-> Request DescribeTableReplicaAutoScaling
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeTableReplicaAutoScaling
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse DescribeTableReplicaAutoScaling)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeTableReplicaAutoScaling))
-> Logger
-> Service
-> Proxy DescribeTableReplicaAutoScaling
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse DescribeTableReplicaAutoScaling)))
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 TableAutoScalingDescription
-> Int -> DescribeTableReplicaAutoScalingResponse
DescribeTableReplicaAutoScalingResponse'
(Maybe TableAutoScalingDescription
-> Int -> DescribeTableReplicaAutoScalingResponse)
-> Either String (Maybe TableAutoScalingDescription)
-> Either String (Int -> DescribeTableReplicaAutoScalingResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe TableAutoScalingDescription)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"TableAutoScalingDescription")
Either String (Int -> DescribeTableReplicaAutoScalingResponse)
-> Either String Int
-> Either String DescribeTableReplicaAutoScalingResponse
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
DescribeTableReplicaAutoScaling
instance
Prelude.NFData
DescribeTableReplicaAutoScaling
instance
Core.ToHeaders
DescribeTableReplicaAutoScaling
where
toHeaders :: DescribeTableReplicaAutoScaling -> ResponseHeaders
toHeaders =
ResponseHeaders
-> DescribeTableReplicaAutoScaling -> 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.DescribeTableReplicaAutoScaling" ::
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 DescribeTableReplicaAutoScaling where
toJSON :: DescribeTableReplicaAutoScaling -> Value
toJSON DescribeTableReplicaAutoScaling' {Text
tableName :: Text
$sel:tableName:DescribeTableReplicaAutoScaling' :: DescribeTableReplicaAutoScaling -> 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
"TableName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
tableName)]
)
instance Core.ToPath DescribeTableReplicaAutoScaling where
toPath :: DescribeTableReplicaAutoScaling -> ByteString
toPath = ByteString -> DescribeTableReplicaAutoScaling -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DescribeTableReplicaAutoScaling where
toQuery :: DescribeTableReplicaAutoScaling -> QueryString
toQuery = QueryString -> DescribeTableReplicaAutoScaling -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeTableReplicaAutoScalingResponse = DescribeTableReplicaAutoScalingResponse'
{
DescribeTableReplicaAutoScalingResponse
-> Maybe TableAutoScalingDescription
tableAutoScalingDescription :: Prelude.Maybe TableAutoScalingDescription,
DescribeTableReplicaAutoScalingResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeTableReplicaAutoScalingResponse
-> DescribeTableReplicaAutoScalingResponse -> Bool
(DescribeTableReplicaAutoScalingResponse
-> DescribeTableReplicaAutoScalingResponse -> Bool)
-> (DescribeTableReplicaAutoScalingResponse
-> DescribeTableReplicaAutoScalingResponse -> Bool)
-> Eq DescribeTableReplicaAutoScalingResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeTableReplicaAutoScalingResponse
-> DescribeTableReplicaAutoScalingResponse -> Bool
$c/= :: DescribeTableReplicaAutoScalingResponse
-> DescribeTableReplicaAutoScalingResponse -> Bool
== :: DescribeTableReplicaAutoScalingResponse
-> DescribeTableReplicaAutoScalingResponse -> Bool
$c== :: DescribeTableReplicaAutoScalingResponse
-> DescribeTableReplicaAutoScalingResponse -> Bool
Prelude.Eq, ReadPrec [DescribeTableReplicaAutoScalingResponse]
ReadPrec DescribeTableReplicaAutoScalingResponse
Int -> ReadS DescribeTableReplicaAutoScalingResponse
ReadS [DescribeTableReplicaAutoScalingResponse]
(Int -> ReadS DescribeTableReplicaAutoScalingResponse)
-> ReadS [DescribeTableReplicaAutoScalingResponse]
-> ReadPrec DescribeTableReplicaAutoScalingResponse
-> ReadPrec [DescribeTableReplicaAutoScalingResponse]
-> Read DescribeTableReplicaAutoScalingResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeTableReplicaAutoScalingResponse]
$creadListPrec :: ReadPrec [DescribeTableReplicaAutoScalingResponse]
readPrec :: ReadPrec DescribeTableReplicaAutoScalingResponse
$creadPrec :: ReadPrec DescribeTableReplicaAutoScalingResponse
readList :: ReadS [DescribeTableReplicaAutoScalingResponse]
$creadList :: ReadS [DescribeTableReplicaAutoScalingResponse]
readsPrec :: Int -> ReadS DescribeTableReplicaAutoScalingResponse
$creadsPrec :: Int -> ReadS DescribeTableReplicaAutoScalingResponse
Prelude.Read, Int -> DescribeTableReplicaAutoScalingResponse -> ShowS
[DescribeTableReplicaAutoScalingResponse] -> ShowS
DescribeTableReplicaAutoScalingResponse -> String
(Int -> DescribeTableReplicaAutoScalingResponse -> ShowS)
-> (DescribeTableReplicaAutoScalingResponse -> String)
-> ([DescribeTableReplicaAutoScalingResponse] -> ShowS)
-> Show DescribeTableReplicaAutoScalingResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeTableReplicaAutoScalingResponse] -> ShowS
$cshowList :: [DescribeTableReplicaAutoScalingResponse] -> ShowS
show :: DescribeTableReplicaAutoScalingResponse -> String
$cshow :: DescribeTableReplicaAutoScalingResponse -> String
showsPrec :: Int -> DescribeTableReplicaAutoScalingResponse -> ShowS
$cshowsPrec :: Int -> DescribeTableReplicaAutoScalingResponse -> ShowS
Prelude.Show, (forall x.
DescribeTableReplicaAutoScalingResponse
-> Rep DescribeTableReplicaAutoScalingResponse x)
-> (forall x.
Rep DescribeTableReplicaAutoScalingResponse x
-> DescribeTableReplicaAutoScalingResponse)
-> Generic DescribeTableReplicaAutoScalingResponse
forall x.
Rep DescribeTableReplicaAutoScalingResponse x
-> DescribeTableReplicaAutoScalingResponse
forall x.
DescribeTableReplicaAutoScalingResponse
-> Rep DescribeTableReplicaAutoScalingResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeTableReplicaAutoScalingResponse x
-> DescribeTableReplicaAutoScalingResponse
$cfrom :: forall x.
DescribeTableReplicaAutoScalingResponse
-> Rep DescribeTableReplicaAutoScalingResponse x
Prelude.Generic)
newDescribeTableReplicaAutoScalingResponse ::
Prelude.Int ->
DescribeTableReplicaAutoScalingResponse
newDescribeTableReplicaAutoScalingResponse :: Int -> DescribeTableReplicaAutoScalingResponse
newDescribeTableReplicaAutoScalingResponse
Int
pHttpStatus_ =
DescribeTableReplicaAutoScalingResponse' :: Maybe TableAutoScalingDescription
-> Int -> DescribeTableReplicaAutoScalingResponse
DescribeTableReplicaAutoScalingResponse'
{ $sel:tableAutoScalingDescription:DescribeTableReplicaAutoScalingResponse' :: Maybe TableAutoScalingDescription
tableAutoScalingDescription =
Maybe TableAutoScalingDescription
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeTableReplicaAutoScalingResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeTableReplicaAutoScalingResponse_tableAutoScalingDescription :: Lens.Lens' DescribeTableReplicaAutoScalingResponse (Prelude.Maybe TableAutoScalingDescription)
describeTableReplicaAutoScalingResponse_tableAutoScalingDescription :: (Maybe TableAutoScalingDescription
-> f (Maybe TableAutoScalingDescription))
-> DescribeTableReplicaAutoScalingResponse
-> f DescribeTableReplicaAutoScalingResponse
describeTableReplicaAutoScalingResponse_tableAutoScalingDescription = (DescribeTableReplicaAutoScalingResponse
-> Maybe TableAutoScalingDescription)
-> (DescribeTableReplicaAutoScalingResponse
-> Maybe TableAutoScalingDescription
-> DescribeTableReplicaAutoScalingResponse)
-> Lens
DescribeTableReplicaAutoScalingResponse
DescribeTableReplicaAutoScalingResponse
(Maybe TableAutoScalingDescription)
(Maybe TableAutoScalingDescription)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTableReplicaAutoScalingResponse' {Maybe TableAutoScalingDescription
tableAutoScalingDescription :: Maybe TableAutoScalingDescription
$sel:tableAutoScalingDescription:DescribeTableReplicaAutoScalingResponse' :: DescribeTableReplicaAutoScalingResponse
-> Maybe TableAutoScalingDescription
tableAutoScalingDescription} -> Maybe TableAutoScalingDescription
tableAutoScalingDescription) (\s :: DescribeTableReplicaAutoScalingResponse
s@DescribeTableReplicaAutoScalingResponse' {} Maybe TableAutoScalingDescription
a -> DescribeTableReplicaAutoScalingResponse
s {$sel:tableAutoScalingDescription:DescribeTableReplicaAutoScalingResponse' :: Maybe TableAutoScalingDescription
tableAutoScalingDescription = Maybe TableAutoScalingDescription
a} :: DescribeTableReplicaAutoScalingResponse)
describeTableReplicaAutoScalingResponse_httpStatus :: Lens.Lens' DescribeTableReplicaAutoScalingResponse Prelude.Int
describeTableReplicaAutoScalingResponse_httpStatus :: (Int -> f Int)
-> DescribeTableReplicaAutoScalingResponse
-> f DescribeTableReplicaAutoScalingResponse
describeTableReplicaAutoScalingResponse_httpStatus = (DescribeTableReplicaAutoScalingResponse -> Int)
-> (DescribeTableReplicaAutoScalingResponse
-> Int -> DescribeTableReplicaAutoScalingResponse)
-> Lens
DescribeTableReplicaAutoScalingResponse
DescribeTableReplicaAutoScalingResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTableReplicaAutoScalingResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeTableReplicaAutoScalingResponse' :: DescribeTableReplicaAutoScalingResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeTableReplicaAutoScalingResponse
s@DescribeTableReplicaAutoScalingResponse' {} Int
a -> DescribeTableReplicaAutoScalingResponse
s {$sel:httpStatus:DescribeTableReplicaAutoScalingResponse' :: Int
httpStatus = Int
a} :: DescribeTableReplicaAutoScalingResponse)
instance
Prelude.NFData
DescribeTableReplicaAutoScalingResponse