{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.DynamoDB.Types.TableAutoScalingDescription where
import qualified Amazonka.Core as Core
import Amazonka.DynamoDB.Types.ReplicaAutoScalingDescription
import Amazonka.DynamoDB.Types.TableStatus
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data TableAutoScalingDescription = TableAutoScalingDescription'
{
TableAutoScalingDescription -> Maybe TableStatus
tableStatus :: Prelude.Maybe TableStatus,
TableAutoScalingDescription
-> Maybe [ReplicaAutoScalingDescription]
replicas :: Prelude.Maybe [ReplicaAutoScalingDescription],
TableAutoScalingDescription -> Maybe Text
tableName :: Prelude.Maybe Prelude.Text
}
deriving (TableAutoScalingDescription -> TableAutoScalingDescription -> Bool
(TableAutoScalingDescription
-> TableAutoScalingDescription -> Bool)
-> (TableAutoScalingDescription
-> TableAutoScalingDescription -> Bool)
-> Eq TableAutoScalingDescription
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TableAutoScalingDescription -> TableAutoScalingDescription -> Bool
$c/= :: TableAutoScalingDescription -> TableAutoScalingDescription -> Bool
== :: TableAutoScalingDescription -> TableAutoScalingDescription -> Bool
$c== :: TableAutoScalingDescription -> TableAutoScalingDescription -> Bool
Prelude.Eq, ReadPrec [TableAutoScalingDescription]
ReadPrec TableAutoScalingDescription
Int -> ReadS TableAutoScalingDescription
ReadS [TableAutoScalingDescription]
(Int -> ReadS TableAutoScalingDescription)
-> ReadS [TableAutoScalingDescription]
-> ReadPrec TableAutoScalingDescription
-> ReadPrec [TableAutoScalingDescription]
-> Read TableAutoScalingDescription
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TableAutoScalingDescription]
$creadListPrec :: ReadPrec [TableAutoScalingDescription]
readPrec :: ReadPrec TableAutoScalingDescription
$creadPrec :: ReadPrec TableAutoScalingDescription
readList :: ReadS [TableAutoScalingDescription]
$creadList :: ReadS [TableAutoScalingDescription]
readsPrec :: Int -> ReadS TableAutoScalingDescription
$creadsPrec :: Int -> ReadS TableAutoScalingDescription
Prelude.Read, Int -> TableAutoScalingDescription -> ShowS
[TableAutoScalingDescription] -> ShowS
TableAutoScalingDescription -> String
(Int -> TableAutoScalingDescription -> ShowS)
-> (TableAutoScalingDescription -> String)
-> ([TableAutoScalingDescription] -> ShowS)
-> Show TableAutoScalingDescription
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TableAutoScalingDescription] -> ShowS
$cshowList :: [TableAutoScalingDescription] -> ShowS
show :: TableAutoScalingDescription -> String
$cshow :: TableAutoScalingDescription -> String
showsPrec :: Int -> TableAutoScalingDescription -> ShowS
$cshowsPrec :: Int -> TableAutoScalingDescription -> ShowS
Prelude.Show, (forall x.
TableAutoScalingDescription -> Rep TableAutoScalingDescription x)
-> (forall x.
Rep TableAutoScalingDescription x -> TableAutoScalingDescription)
-> Generic TableAutoScalingDescription
forall x.
Rep TableAutoScalingDescription x -> TableAutoScalingDescription
forall x.
TableAutoScalingDescription -> Rep TableAutoScalingDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep TableAutoScalingDescription x -> TableAutoScalingDescription
$cfrom :: forall x.
TableAutoScalingDescription -> Rep TableAutoScalingDescription x
Prelude.Generic)
newTableAutoScalingDescription ::
TableAutoScalingDescription
newTableAutoScalingDescription :: TableAutoScalingDescription
newTableAutoScalingDescription =
TableAutoScalingDescription' :: Maybe TableStatus
-> Maybe [ReplicaAutoScalingDescription]
-> Maybe Text
-> TableAutoScalingDescription
TableAutoScalingDescription'
{ $sel:tableStatus:TableAutoScalingDescription' :: Maybe TableStatus
tableStatus =
Maybe TableStatus
forall a. Maybe a
Prelude.Nothing,
$sel:replicas:TableAutoScalingDescription' :: Maybe [ReplicaAutoScalingDescription]
replicas = Maybe [ReplicaAutoScalingDescription]
forall a. Maybe a
Prelude.Nothing,
$sel:tableName:TableAutoScalingDescription' :: Maybe Text
tableName = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
tableAutoScalingDescription_tableStatus :: Lens.Lens' TableAutoScalingDescription (Prelude.Maybe TableStatus)
tableAutoScalingDescription_tableStatus :: (Maybe TableStatus -> f (Maybe TableStatus))
-> TableAutoScalingDescription -> f TableAutoScalingDescription
tableAutoScalingDescription_tableStatus = (TableAutoScalingDescription -> Maybe TableStatus)
-> (TableAutoScalingDescription
-> Maybe TableStatus -> TableAutoScalingDescription)
-> Lens
TableAutoScalingDescription
TableAutoScalingDescription
(Maybe TableStatus)
(Maybe TableStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TableAutoScalingDescription' {Maybe TableStatus
tableStatus :: Maybe TableStatus
$sel:tableStatus:TableAutoScalingDescription' :: TableAutoScalingDescription -> Maybe TableStatus
tableStatus} -> Maybe TableStatus
tableStatus) (\s :: TableAutoScalingDescription
s@TableAutoScalingDescription' {} Maybe TableStatus
a -> TableAutoScalingDescription
s {$sel:tableStatus:TableAutoScalingDescription' :: Maybe TableStatus
tableStatus = Maybe TableStatus
a} :: TableAutoScalingDescription)
tableAutoScalingDescription_replicas :: Lens.Lens' TableAutoScalingDescription (Prelude.Maybe [ReplicaAutoScalingDescription])
tableAutoScalingDescription_replicas :: (Maybe [ReplicaAutoScalingDescription]
-> f (Maybe [ReplicaAutoScalingDescription]))
-> TableAutoScalingDescription -> f TableAutoScalingDescription
tableAutoScalingDescription_replicas = (TableAutoScalingDescription
-> Maybe [ReplicaAutoScalingDescription])
-> (TableAutoScalingDescription
-> Maybe [ReplicaAutoScalingDescription]
-> TableAutoScalingDescription)
-> Lens
TableAutoScalingDescription
TableAutoScalingDescription
(Maybe [ReplicaAutoScalingDescription])
(Maybe [ReplicaAutoScalingDescription])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TableAutoScalingDescription' {Maybe [ReplicaAutoScalingDescription]
replicas :: Maybe [ReplicaAutoScalingDescription]
$sel:replicas:TableAutoScalingDescription' :: TableAutoScalingDescription
-> Maybe [ReplicaAutoScalingDescription]
replicas} -> Maybe [ReplicaAutoScalingDescription]
replicas) (\s :: TableAutoScalingDescription
s@TableAutoScalingDescription' {} Maybe [ReplicaAutoScalingDescription]
a -> TableAutoScalingDescription
s {$sel:replicas:TableAutoScalingDescription' :: Maybe [ReplicaAutoScalingDescription]
replicas = Maybe [ReplicaAutoScalingDescription]
a} :: TableAutoScalingDescription) ((Maybe [ReplicaAutoScalingDescription]
-> f (Maybe [ReplicaAutoScalingDescription]))
-> TableAutoScalingDescription -> f TableAutoScalingDescription)
-> ((Maybe [ReplicaAutoScalingDescription]
-> f (Maybe [ReplicaAutoScalingDescription]))
-> Maybe [ReplicaAutoScalingDescription]
-> f (Maybe [ReplicaAutoScalingDescription]))
-> (Maybe [ReplicaAutoScalingDescription]
-> f (Maybe [ReplicaAutoScalingDescription]))
-> TableAutoScalingDescription
-> f TableAutoScalingDescription
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[ReplicaAutoScalingDescription]
[ReplicaAutoScalingDescription]
[ReplicaAutoScalingDescription]
[ReplicaAutoScalingDescription]
-> Iso
(Maybe [ReplicaAutoScalingDescription])
(Maybe [ReplicaAutoScalingDescription])
(Maybe [ReplicaAutoScalingDescription])
(Maybe [ReplicaAutoScalingDescription])
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
[ReplicaAutoScalingDescription]
[ReplicaAutoScalingDescription]
[ReplicaAutoScalingDescription]
[ReplicaAutoScalingDescription]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
tableAutoScalingDescription_tableName :: Lens.Lens' TableAutoScalingDescription (Prelude.Maybe Prelude.Text)
tableAutoScalingDescription_tableName :: (Maybe Text -> f (Maybe Text))
-> TableAutoScalingDescription -> f TableAutoScalingDescription
tableAutoScalingDescription_tableName = (TableAutoScalingDescription -> Maybe Text)
-> (TableAutoScalingDescription
-> Maybe Text -> TableAutoScalingDescription)
-> Lens
TableAutoScalingDescription
TableAutoScalingDescription
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TableAutoScalingDescription' {Maybe Text
tableName :: Maybe Text
$sel:tableName:TableAutoScalingDescription' :: TableAutoScalingDescription -> Maybe Text
tableName} -> Maybe Text
tableName) (\s :: TableAutoScalingDescription
s@TableAutoScalingDescription' {} Maybe Text
a -> TableAutoScalingDescription
s {$sel:tableName:TableAutoScalingDescription' :: Maybe Text
tableName = Maybe Text
a} :: TableAutoScalingDescription)
instance Core.FromJSON TableAutoScalingDescription where
parseJSON :: Value -> Parser TableAutoScalingDescription
parseJSON =
String
-> (Object -> Parser TableAutoScalingDescription)
-> Value
-> Parser TableAutoScalingDescription
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"TableAutoScalingDescription"
( \Object
x ->
Maybe TableStatus
-> Maybe [ReplicaAutoScalingDescription]
-> Maybe Text
-> TableAutoScalingDescription
TableAutoScalingDescription'
(Maybe TableStatus
-> Maybe [ReplicaAutoScalingDescription]
-> Maybe Text
-> TableAutoScalingDescription)
-> Parser (Maybe TableStatus)
-> Parser
(Maybe [ReplicaAutoScalingDescription]
-> Maybe Text -> TableAutoScalingDescription)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe TableStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TableStatus")
Parser
(Maybe [ReplicaAutoScalingDescription]
-> Maybe Text -> TableAutoScalingDescription)
-> Parser (Maybe [ReplicaAutoScalingDescription])
-> Parser (Maybe Text -> TableAutoScalingDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Parser (Maybe (Maybe [ReplicaAutoScalingDescription]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Replicas" Parser (Maybe (Maybe [ReplicaAutoScalingDescription]))
-> Maybe [ReplicaAutoScalingDescription]
-> Parser (Maybe [ReplicaAutoScalingDescription])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [ReplicaAutoScalingDescription]
forall a. Monoid a => a
Prelude.mempty)
Parser (Maybe Text -> TableAutoScalingDescription)
-> Parser (Maybe Text) -> Parser TableAutoScalingDescription
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TableName")
)
instance Prelude.Hashable TableAutoScalingDescription
instance Prelude.NFData TableAutoScalingDescription