{-# 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.ReplicaGlobalSecondaryIndex where
import qualified Amazonka.Core as Core
import Amazonka.DynamoDB.Types.ProvisionedThroughputOverride
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ReplicaGlobalSecondaryIndex = ReplicaGlobalSecondaryIndex'
{
ReplicaGlobalSecondaryIndex -> Maybe ProvisionedThroughputOverride
provisionedThroughputOverride :: Prelude.Maybe ProvisionedThroughputOverride,
ReplicaGlobalSecondaryIndex -> Text
indexName :: Prelude.Text
}
deriving (ReplicaGlobalSecondaryIndex -> ReplicaGlobalSecondaryIndex -> Bool
(ReplicaGlobalSecondaryIndex
-> ReplicaGlobalSecondaryIndex -> Bool)
-> (ReplicaGlobalSecondaryIndex
-> ReplicaGlobalSecondaryIndex -> Bool)
-> Eq ReplicaGlobalSecondaryIndex
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ReplicaGlobalSecondaryIndex -> ReplicaGlobalSecondaryIndex -> Bool
$c/= :: ReplicaGlobalSecondaryIndex -> ReplicaGlobalSecondaryIndex -> Bool
== :: ReplicaGlobalSecondaryIndex -> ReplicaGlobalSecondaryIndex -> Bool
$c== :: ReplicaGlobalSecondaryIndex -> ReplicaGlobalSecondaryIndex -> Bool
Prelude.Eq, ReadPrec [ReplicaGlobalSecondaryIndex]
ReadPrec ReplicaGlobalSecondaryIndex
Int -> ReadS ReplicaGlobalSecondaryIndex
ReadS [ReplicaGlobalSecondaryIndex]
(Int -> ReadS ReplicaGlobalSecondaryIndex)
-> ReadS [ReplicaGlobalSecondaryIndex]
-> ReadPrec ReplicaGlobalSecondaryIndex
-> ReadPrec [ReplicaGlobalSecondaryIndex]
-> Read ReplicaGlobalSecondaryIndex
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ReplicaGlobalSecondaryIndex]
$creadListPrec :: ReadPrec [ReplicaGlobalSecondaryIndex]
readPrec :: ReadPrec ReplicaGlobalSecondaryIndex
$creadPrec :: ReadPrec ReplicaGlobalSecondaryIndex
readList :: ReadS [ReplicaGlobalSecondaryIndex]
$creadList :: ReadS [ReplicaGlobalSecondaryIndex]
readsPrec :: Int -> ReadS ReplicaGlobalSecondaryIndex
$creadsPrec :: Int -> ReadS ReplicaGlobalSecondaryIndex
Prelude.Read, Int -> ReplicaGlobalSecondaryIndex -> ShowS
[ReplicaGlobalSecondaryIndex] -> ShowS
ReplicaGlobalSecondaryIndex -> String
(Int -> ReplicaGlobalSecondaryIndex -> ShowS)
-> (ReplicaGlobalSecondaryIndex -> String)
-> ([ReplicaGlobalSecondaryIndex] -> ShowS)
-> Show ReplicaGlobalSecondaryIndex
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReplicaGlobalSecondaryIndex] -> ShowS
$cshowList :: [ReplicaGlobalSecondaryIndex] -> ShowS
show :: ReplicaGlobalSecondaryIndex -> String
$cshow :: ReplicaGlobalSecondaryIndex -> String
showsPrec :: Int -> ReplicaGlobalSecondaryIndex -> ShowS
$cshowsPrec :: Int -> ReplicaGlobalSecondaryIndex -> ShowS
Prelude.Show, (forall x.
ReplicaGlobalSecondaryIndex -> Rep ReplicaGlobalSecondaryIndex x)
-> (forall x.
Rep ReplicaGlobalSecondaryIndex x -> ReplicaGlobalSecondaryIndex)
-> Generic ReplicaGlobalSecondaryIndex
forall x.
Rep ReplicaGlobalSecondaryIndex x -> ReplicaGlobalSecondaryIndex
forall x.
ReplicaGlobalSecondaryIndex -> Rep ReplicaGlobalSecondaryIndex x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ReplicaGlobalSecondaryIndex x -> ReplicaGlobalSecondaryIndex
$cfrom :: forall x.
ReplicaGlobalSecondaryIndex -> Rep ReplicaGlobalSecondaryIndex x
Prelude.Generic)
newReplicaGlobalSecondaryIndex ::
Prelude.Text ->
ReplicaGlobalSecondaryIndex
newReplicaGlobalSecondaryIndex :: Text -> ReplicaGlobalSecondaryIndex
newReplicaGlobalSecondaryIndex Text
pIndexName_ =
ReplicaGlobalSecondaryIndex' :: Maybe ProvisionedThroughputOverride
-> Text -> ReplicaGlobalSecondaryIndex
ReplicaGlobalSecondaryIndex'
{ $sel:provisionedThroughputOverride:ReplicaGlobalSecondaryIndex' :: Maybe ProvisionedThroughputOverride
provisionedThroughputOverride =
Maybe ProvisionedThroughputOverride
forall a. Maybe a
Prelude.Nothing,
$sel:indexName:ReplicaGlobalSecondaryIndex' :: Text
indexName = Text
pIndexName_
}
replicaGlobalSecondaryIndex_provisionedThroughputOverride :: Lens.Lens' ReplicaGlobalSecondaryIndex (Prelude.Maybe ProvisionedThroughputOverride)
replicaGlobalSecondaryIndex_provisionedThroughputOverride :: (Maybe ProvisionedThroughputOverride
-> f (Maybe ProvisionedThroughputOverride))
-> ReplicaGlobalSecondaryIndex -> f ReplicaGlobalSecondaryIndex
replicaGlobalSecondaryIndex_provisionedThroughputOverride = (ReplicaGlobalSecondaryIndex
-> Maybe ProvisionedThroughputOverride)
-> (ReplicaGlobalSecondaryIndex
-> Maybe ProvisionedThroughputOverride
-> ReplicaGlobalSecondaryIndex)
-> Lens
ReplicaGlobalSecondaryIndex
ReplicaGlobalSecondaryIndex
(Maybe ProvisionedThroughputOverride)
(Maybe ProvisionedThroughputOverride)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReplicaGlobalSecondaryIndex' {Maybe ProvisionedThroughputOverride
provisionedThroughputOverride :: Maybe ProvisionedThroughputOverride
$sel:provisionedThroughputOverride:ReplicaGlobalSecondaryIndex' :: ReplicaGlobalSecondaryIndex -> Maybe ProvisionedThroughputOverride
provisionedThroughputOverride} -> Maybe ProvisionedThroughputOverride
provisionedThroughputOverride) (\s :: ReplicaGlobalSecondaryIndex
s@ReplicaGlobalSecondaryIndex' {} Maybe ProvisionedThroughputOverride
a -> ReplicaGlobalSecondaryIndex
s {$sel:provisionedThroughputOverride:ReplicaGlobalSecondaryIndex' :: Maybe ProvisionedThroughputOverride
provisionedThroughputOverride = Maybe ProvisionedThroughputOverride
a} :: ReplicaGlobalSecondaryIndex)
replicaGlobalSecondaryIndex_indexName :: Lens.Lens' ReplicaGlobalSecondaryIndex Prelude.Text
replicaGlobalSecondaryIndex_indexName :: (Text -> f Text)
-> ReplicaGlobalSecondaryIndex -> f ReplicaGlobalSecondaryIndex
replicaGlobalSecondaryIndex_indexName = (ReplicaGlobalSecondaryIndex -> Text)
-> (ReplicaGlobalSecondaryIndex
-> Text -> ReplicaGlobalSecondaryIndex)
-> Lens
ReplicaGlobalSecondaryIndex ReplicaGlobalSecondaryIndex Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReplicaGlobalSecondaryIndex' {Text
indexName :: Text
$sel:indexName:ReplicaGlobalSecondaryIndex' :: ReplicaGlobalSecondaryIndex -> Text
indexName} -> Text
indexName) (\s :: ReplicaGlobalSecondaryIndex
s@ReplicaGlobalSecondaryIndex' {} Text
a -> ReplicaGlobalSecondaryIndex
s {$sel:indexName:ReplicaGlobalSecondaryIndex' :: Text
indexName = Text
a} :: ReplicaGlobalSecondaryIndex)
instance Prelude.Hashable ReplicaGlobalSecondaryIndex
instance Prelude.NFData ReplicaGlobalSecondaryIndex
instance Core.ToJSON ReplicaGlobalSecondaryIndex where
toJSON :: ReplicaGlobalSecondaryIndex -> Value
toJSON ReplicaGlobalSecondaryIndex' {Maybe ProvisionedThroughputOverride
Text
indexName :: Text
provisionedThroughputOverride :: Maybe ProvisionedThroughputOverride
$sel:indexName:ReplicaGlobalSecondaryIndex' :: ReplicaGlobalSecondaryIndex -> Text
$sel:provisionedThroughputOverride:ReplicaGlobalSecondaryIndex' :: ReplicaGlobalSecondaryIndex -> Maybe ProvisionedThroughputOverride
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"ProvisionedThroughputOverride" Text -> ProvisionedThroughputOverride -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(ProvisionedThroughputOverride -> Pair)
-> Maybe ProvisionedThroughputOverride -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ProvisionedThroughputOverride
provisionedThroughputOverride,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"IndexName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
indexName)
]
)