{-# 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.ReplicaSettingsUpdate where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.DynamoDB.Types.AttributeValue
import Amazonka.DynamoDB.Types.AutoScalingSettingsUpdate
import Amazonka.DynamoDB.Types.ReplicaGlobalSecondaryIndexSettingsUpdate
import Amazonka.DynamoDB.Types.TableClass
import Amazonka.DynamoDB.Types.WriteRequest
import qualified Amazonka.Prelude as Prelude
data ReplicaSettingsUpdate = ReplicaSettingsUpdate'
{
ReplicaSettingsUpdate
-> Maybe (NonEmpty ReplicaGlobalSecondaryIndexSettingsUpdate)
replicaGlobalSecondaryIndexSettingsUpdate :: Prelude.Maybe (Prelude.NonEmpty ReplicaGlobalSecondaryIndexSettingsUpdate),
ReplicaSettingsUpdate -> Maybe AutoScalingSettingsUpdate
replicaProvisionedReadCapacityAutoScalingSettingsUpdate :: Prelude.Maybe AutoScalingSettingsUpdate,
ReplicaSettingsUpdate -> Maybe Natural
replicaProvisionedReadCapacityUnits :: Prelude.Maybe Prelude.Natural,
ReplicaSettingsUpdate -> Maybe TableClass
replicaTableClass :: Prelude.Maybe TableClass,
ReplicaSettingsUpdate -> Text
regionName :: Prelude.Text
}
deriving (ReplicaSettingsUpdate -> ReplicaSettingsUpdate -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ReplicaSettingsUpdate -> ReplicaSettingsUpdate -> Bool
$c/= :: ReplicaSettingsUpdate -> ReplicaSettingsUpdate -> Bool
== :: ReplicaSettingsUpdate -> ReplicaSettingsUpdate -> Bool
$c== :: ReplicaSettingsUpdate -> ReplicaSettingsUpdate -> Bool
Prelude.Eq, ReadPrec [ReplicaSettingsUpdate]
ReadPrec ReplicaSettingsUpdate
Int -> ReadS ReplicaSettingsUpdate
ReadS [ReplicaSettingsUpdate]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ReplicaSettingsUpdate]
$creadListPrec :: ReadPrec [ReplicaSettingsUpdate]
readPrec :: ReadPrec ReplicaSettingsUpdate
$creadPrec :: ReadPrec ReplicaSettingsUpdate
readList :: ReadS [ReplicaSettingsUpdate]
$creadList :: ReadS [ReplicaSettingsUpdate]
readsPrec :: Int -> ReadS ReplicaSettingsUpdate
$creadsPrec :: Int -> ReadS ReplicaSettingsUpdate
Prelude.Read, Int -> ReplicaSettingsUpdate -> ShowS
[ReplicaSettingsUpdate] -> ShowS
ReplicaSettingsUpdate -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReplicaSettingsUpdate] -> ShowS
$cshowList :: [ReplicaSettingsUpdate] -> ShowS
show :: ReplicaSettingsUpdate -> String
$cshow :: ReplicaSettingsUpdate -> String
showsPrec :: Int -> ReplicaSettingsUpdate -> ShowS
$cshowsPrec :: Int -> ReplicaSettingsUpdate -> ShowS
Prelude.Show, forall x. Rep ReplicaSettingsUpdate x -> ReplicaSettingsUpdate
forall x. ReplicaSettingsUpdate -> Rep ReplicaSettingsUpdate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ReplicaSettingsUpdate x -> ReplicaSettingsUpdate
$cfrom :: forall x. ReplicaSettingsUpdate -> Rep ReplicaSettingsUpdate x
Prelude.Generic)
newReplicaSettingsUpdate ::
Prelude.Text ->
ReplicaSettingsUpdate
newReplicaSettingsUpdate :: Text -> ReplicaSettingsUpdate
newReplicaSettingsUpdate Text
pRegionName_ =
ReplicaSettingsUpdate'
{ $sel:replicaGlobalSecondaryIndexSettingsUpdate:ReplicaSettingsUpdate' :: Maybe (NonEmpty ReplicaGlobalSecondaryIndexSettingsUpdate)
replicaGlobalSecondaryIndexSettingsUpdate =
forall a. Maybe a
Prelude.Nothing,
$sel:replicaProvisionedReadCapacityAutoScalingSettingsUpdate:ReplicaSettingsUpdate' :: Maybe AutoScalingSettingsUpdate
replicaProvisionedReadCapacityAutoScalingSettingsUpdate =
forall a. Maybe a
Prelude.Nothing,
$sel:replicaProvisionedReadCapacityUnits:ReplicaSettingsUpdate' :: Maybe Natural
replicaProvisionedReadCapacityUnits =
forall a. Maybe a
Prelude.Nothing,
$sel:replicaTableClass:ReplicaSettingsUpdate' :: Maybe TableClass
replicaTableClass = forall a. Maybe a
Prelude.Nothing,
$sel:regionName:ReplicaSettingsUpdate' :: Text
regionName = Text
pRegionName_
}
replicaSettingsUpdate_replicaGlobalSecondaryIndexSettingsUpdate :: Lens.Lens' ReplicaSettingsUpdate (Prelude.Maybe (Prelude.NonEmpty ReplicaGlobalSecondaryIndexSettingsUpdate))
replicaSettingsUpdate_replicaGlobalSecondaryIndexSettingsUpdate :: Lens'
ReplicaSettingsUpdate
(Maybe (NonEmpty ReplicaGlobalSecondaryIndexSettingsUpdate))
replicaSettingsUpdate_replicaGlobalSecondaryIndexSettingsUpdate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReplicaSettingsUpdate' {Maybe (NonEmpty ReplicaGlobalSecondaryIndexSettingsUpdate)
replicaGlobalSecondaryIndexSettingsUpdate :: Maybe (NonEmpty ReplicaGlobalSecondaryIndexSettingsUpdate)
$sel:replicaGlobalSecondaryIndexSettingsUpdate:ReplicaSettingsUpdate' :: ReplicaSettingsUpdate
-> Maybe (NonEmpty ReplicaGlobalSecondaryIndexSettingsUpdate)
replicaGlobalSecondaryIndexSettingsUpdate} -> Maybe (NonEmpty ReplicaGlobalSecondaryIndexSettingsUpdate)
replicaGlobalSecondaryIndexSettingsUpdate) (\s :: ReplicaSettingsUpdate
s@ReplicaSettingsUpdate' {} Maybe (NonEmpty ReplicaGlobalSecondaryIndexSettingsUpdate)
a -> ReplicaSettingsUpdate
s {$sel:replicaGlobalSecondaryIndexSettingsUpdate:ReplicaSettingsUpdate' :: Maybe (NonEmpty ReplicaGlobalSecondaryIndexSettingsUpdate)
replicaGlobalSecondaryIndexSettingsUpdate = Maybe (NonEmpty ReplicaGlobalSecondaryIndexSettingsUpdate)
a} :: ReplicaSettingsUpdate) 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
replicaSettingsUpdate_replicaProvisionedReadCapacityAutoScalingSettingsUpdate :: Lens.Lens' ReplicaSettingsUpdate (Prelude.Maybe AutoScalingSettingsUpdate)
replicaSettingsUpdate_replicaProvisionedReadCapacityAutoScalingSettingsUpdate :: Lens' ReplicaSettingsUpdate (Maybe AutoScalingSettingsUpdate)
replicaSettingsUpdate_replicaProvisionedReadCapacityAutoScalingSettingsUpdate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReplicaSettingsUpdate' {Maybe AutoScalingSettingsUpdate
replicaProvisionedReadCapacityAutoScalingSettingsUpdate :: Maybe AutoScalingSettingsUpdate
$sel:replicaProvisionedReadCapacityAutoScalingSettingsUpdate:ReplicaSettingsUpdate' :: ReplicaSettingsUpdate -> Maybe AutoScalingSettingsUpdate
replicaProvisionedReadCapacityAutoScalingSettingsUpdate} -> Maybe AutoScalingSettingsUpdate
replicaProvisionedReadCapacityAutoScalingSettingsUpdate) (\s :: ReplicaSettingsUpdate
s@ReplicaSettingsUpdate' {} Maybe AutoScalingSettingsUpdate
a -> ReplicaSettingsUpdate
s {$sel:replicaProvisionedReadCapacityAutoScalingSettingsUpdate:ReplicaSettingsUpdate' :: Maybe AutoScalingSettingsUpdate
replicaProvisionedReadCapacityAutoScalingSettingsUpdate = Maybe AutoScalingSettingsUpdate
a} :: ReplicaSettingsUpdate)
replicaSettingsUpdate_replicaProvisionedReadCapacityUnits :: Lens.Lens' ReplicaSettingsUpdate (Prelude.Maybe Prelude.Natural)
replicaSettingsUpdate_replicaProvisionedReadCapacityUnits :: Lens' ReplicaSettingsUpdate (Maybe Natural)
replicaSettingsUpdate_replicaProvisionedReadCapacityUnits = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReplicaSettingsUpdate' {Maybe Natural
replicaProvisionedReadCapacityUnits :: Maybe Natural
$sel:replicaProvisionedReadCapacityUnits:ReplicaSettingsUpdate' :: ReplicaSettingsUpdate -> Maybe Natural
replicaProvisionedReadCapacityUnits} -> Maybe Natural
replicaProvisionedReadCapacityUnits) (\s :: ReplicaSettingsUpdate
s@ReplicaSettingsUpdate' {} Maybe Natural
a -> ReplicaSettingsUpdate
s {$sel:replicaProvisionedReadCapacityUnits:ReplicaSettingsUpdate' :: Maybe Natural
replicaProvisionedReadCapacityUnits = Maybe Natural
a} :: ReplicaSettingsUpdate)
replicaSettingsUpdate_replicaTableClass :: Lens.Lens' ReplicaSettingsUpdate (Prelude.Maybe TableClass)
replicaSettingsUpdate_replicaTableClass :: Lens' ReplicaSettingsUpdate (Maybe TableClass)
replicaSettingsUpdate_replicaTableClass = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReplicaSettingsUpdate' {Maybe TableClass
replicaTableClass :: Maybe TableClass
$sel:replicaTableClass:ReplicaSettingsUpdate' :: ReplicaSettingsUpdate -> Maybe TableClass
replicaTableClass} -> Maybe TableClass
replicaTableClass) (\s :: ReplicaSettingsUpdate
s@ReplicaSettingsUpdate' {} Maybe TableClass
a -> ReplicaSettingsUpdate
s {$sel:replicaTableClass:ReplicaSettingsUpdate' :: Maybe TableClass
replicaTableClass = Maybe TableClass
a} :: ReplicaSettingsUpdate)
replicaSettingsUpdate_regionName :: Lens.Lens' ReplicaSettingsUpdate Prelude.Text
replicaSettingsUpdate_regionName :: Lens' ReplicaSettingsUpdate Text
replicaSettingsUpdate_regionName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReplicaSettingsUpdate' {Text
regionName :: Text
$sel:regionName:ReplicaSettingsUpdate' :: ReplicaSettingsUpdate -> Text
regionName} -> Text
regionName) (\s :: ReplicaSettingsUpdate
s@ReplicaSettingsUpdate' {} Text
a -> ReplicaSettingsUpdate
s {$sel:regionName:ReplicaSettingsUpdate' :: Text
regionName = Text
a} :: ReplicaSettingsUpdate)
instance Prelude.Hashable ReplicaSettingsUpdate where
hashWithSalt :: Int -> ReplicaSettingsUpdate -> Int
hashWithSalt Int
_salt ReplicaSettingsUpdate' {Maybe Natural
Maybe (NonEmpty ReplicaGlobalSecondaryIndexSettingsUpdate)
Maybe TableClass
Maybe AutoScalingSettingsUpdate
Text
regionName :: Text
replicaTableClass :: Maybe TableClass
replicaProvisionedReadCapacityUnits :: Maybe Natural
replicaProvisionedReadCapacityAutoScalingSettingsUpdate :: Maybe AutoScalingSettingsUpdate
replicaGlobalSecondaryIndexSettingsUpdate :: Maybe (NonEmpty ReplicaGlobalSecondaryIndexSettingsUpdate)
$sel:regionName:ReplicaSettingsUpdate' :: ReplicaSettingsUpdate -> Text
$sel:replicaTableClass:ReplicaSettingsUpdate' :: ReplicaSettingsUpdate -> Maybe TableClass
$sel:replicaProvisionedReadCapacityUnits:ReplicaSettingsUpdate' :: ReplicaSettingsUpdate -> Maybe Natural
$sel:replicaProvisionedReadCapacityAutoScalingSettingsUpdate:ReplicaSettingsUpdate' :: ReplicaSettingsUpdate -> Maybe AutoScalingSettingsUpdate
$sel:replicaGlobalSecondaryIndexSettingsUpdate:ReplicaSettingsUpdate' :: ReplicaSettingsUpdate
-> Maybe (NonEmpty ReplicaGlobalSecondaryIndexSettingsUpdate)
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty ReplicaGlobalSecondaryIndexSettingsUpdate)
replicaGlobalSecondaryIndexSettingsUpdate
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AutoScalingSettingsUpdate
replicaProvisionedReadCapacityAutoScalingSettingsUpdate
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
replicaProvisionedReadCapacityUnits
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe TableClass
replicaTableClass
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
regionName
instance Prelude.NFData ReplicaSettingsUpdate where
rnf :: ReplicaSettingsUpdate -> ()
rnf ReplicaSettingsUpdate' {Maybe Natural
Maybe (NonEmpty ReplicaGlobalSecondaryIndexSettingsUpdate)
Maybe TableClass
Maybe AutoScalingSettingsUpdate
Text
regionName :: Text
replicaTableClass :: Maybe TableClass
replicaProvisionedReadCapacityUnits :: Maybe Natural
replicaProvisionedReadCapacityAutoScalingSettingsUpdate :: Maybe AutoScalingSettingsUpdate
replicaGlobalSecondaryIndexSettingsUpdate :: Maybe (NonEmpty ReplicaGlobalSecondaryIndexSettingsUpdate)
$sel:regionName:ReplicaSettingsUpdate' :: ReplicaSettingsUpdate -> Text
$sel:replicaTableClass:ReplicaSettingsUpdate' :: ReplicaSettingsUpdate -> Maybe TableClass
$sel:replicaProvisionedReadCapacityUnits:ReplicaSettingsUpdate' :: ReplicaSettingsUpdate -> Maybe Natural
$sel:replicaProvisionedReadCapacityAutoScalingSettingsUpdate:ReplicaSettingsUpdate' :: ReplicaSettingsUpdate -> Maybe AutoScalingSettingsUpdate
$sel:replicaGlobalSecondaryIndexSettingsUpdate:ReplicaSettingsUpdate' :: ReplicaSettingsUpdate
-> Maybe (NonEmpty ReplicaGlobalSecondaryIndexSettingsUpdate)
..} =
forall a. NFData a => a -> ()
Prelude.rnf
Maybe (NonEmpty ReplicaGlobalSecondaryIndexSettingsUpdate)
replicaGlobalSecondaryIndexSettingsUpdate
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf
Maybe AutoScalingSettingsUpdate
replicaProvisionedReadCapacityAutoScalingSettingsUpdate
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
replicaProvisionedReadCapacityUnits
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe TableClass
replicaTableClass
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
regionName
instance Data.ToJSON ReplicaSettingsUpdate where
toJSON :: ReplicaSettingsUpdate -> Value
toJSON ReplicaSettingsUpdate' {Maybe Natural
Maybe (NonEmpty ReplicaGlobalSecondaryIndexSettingsUpdate)
Maybe TableClass
Maybe AutoScalingSettingsUpdate
Text
regionName :: Text
replicaTableClass :: Maybe TableClass
replicaProvisionedReadCapacityUnits :: Maybe Natural
replicaProvisionedReadCapacityAutoScalingSettingsUpdate :: Maybe AutoScalingSettingsUpdate
replicaGlobalSecondaryIndexSettingsUpdate :: Maybe (NonEmpty ReplicaGlobalSecondaryIndexSettingsUpdate)
$sel:regionName:ReplicaSettingsUpdate' :: ReplicaSettingsUpdate -> Text
$sel:replicaTableClass:ReplicaSettingsUpdate' :: ReplicaSettingsUpdate -> Maybe TableClass
$sel:replicaProvisionedReadCapacityUnits:ReplicaSettingsUpdate' :: ReplicaSettingsUpdate -> Maybe Natural
$sel:replicaProvisionedReadCapacityAutoScalingSettingsUpdate:ReplicaSettingsUpdate' :: ReplicaSettingsUpdate -> Maybe AutoScalingSettingsUpdate
$sel:replicaGlobalSecondaryIndexSettingsUpdate:ReplicaSettingsUpdate' :: ReplicaSettingsUpdate
-> Maybe (NonEmpty ReplicaGlobalSecondaryIndexSettingsUpdate)
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ ( Key
"ReplicaGlobalSecondaryIndexSettingsUpdate"
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 (NonEmpty ReplicaGlobalSecondaryIndexSettingsUpdate)
replicaGlobalSecondaryIndexSettingsUpdate,
( Key
"ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate"
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 AutoScalingSettingsUpdate
replicaProvisionedReadCapacityAutoScalingSettingsUpdate,
(Key
"ReplicaProvisionedReadCapacityUnits" 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 Natural
replicaProvisionedReadCapacityUnits,
(Key
"ReplicaTableClass" 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 TableClass
replicaTableClass,
forall a. a -> Maybe a
Prelude.Just (Key
"RegionName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
regionName)
]
)