{-# 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.UpdateGlobalSecondaryIndexAction 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.ProvisionedThroughput
import Amazonka.DynamoDB.Types.WriteRequest
import qualified Amazonka.Prelude as Prelude
data UpdateGlobalSecondaryIndexAction = UpdateGlobalSecondaryIndexAction'
{
UpdateGlobalSecondaryIndexAction -> Text
indexName :: Prelude.Text,
UpdateGlobalSecondaryIndexAction -> ProvisionedThroughput
provisionedThroughput :: ProvisionedThroughput
}
deriving (UpdateGlobalSecondaryIndexAction
-> UpdateGlobalSecondaryIndexAction -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateGlobalSecondaryIndexAction
-> UpdateGlobalSecondaryIndexAction -> Bool
$c/= :: UpdateGlobalSecondaryIndexAction
-> UpdateGlobalSecondaryIndexAction -> Bool
== :: UpdateGlobalSecondaryIndexAction
-> UpdateGlobalSecondaryIndexAction -> Bool
$c== :: UpdateGlobalSecondaryIndexAction
-> UpdateGlobalSecondaryIndexAction -> Bool
Prelude.Eq, ReadPrec [UpdateGlobalSecondaryIndexAction]
ReadPrec UpdateGlobalSecondaryIndexAction
Int -> ReadS UpdateGlobalSecondaryIndexAction
ReadS [UpdateGlobalSecondaryIndexAction]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateGlobalSecondaryIndexAction]
$creadListPrec :: ReadPrec [UpdateGlobalSecondaryIndexAction]
readPrec :: ReadPrec UpdateGlobalSecondaryIndexAction
$creadPrec :: ReadPrec UpdateGlobalSecondaryIndexAction
readList :: ReadS [UpdateGlobalSecondaryIndexAction]
$creadList :: ReadS [UpdateGlobalSecondaryIndexAction]
readsPrec :: Int -> ReadS UpdateGlobalSecondaryIndexAction
$creadsPrec :: Int -> ReadS UpdateGlobalSecondaryIndexAction
Prelude.Read, Int -> UpdateGlobalSecondaryIndexAction -> ShowS
[UpdateGlobalSecondaryIndexAction] -> ShowS
UpdateGlobalSecondaryIndexAction -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateGlobalSecondaryIndexAction] -> ShowS
$cshowList :: [UpdateGlobalSecondaryIndexAction] -> ShowS
show :: UpdateGlobalSecondaryIndexAction -> String
$cshow :: UpdateGlobalSecondaryIndexAction -> String
showsPrec :: Int -> UpdateGlobalSecondaryIndexAction -> ShowS
$cshowsPrec :: Int -> UpdateGlobalSecondaryIndexAction -> ShowS
Prelude.Show, forall x.
Rep UpdateGlobalSecondaryIndexAction x
-> UpdateGlobalSecondaryIndexAction
forall x.
UpdateGlobalSecondaryIndexAction
-> Rep UpdateGlobalSecondaryIndexAction x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateGlobalSecondaryIndexAction x
-> UpdateGlobalSecondaryIndexAction
$cfrom :: forall x.
UpdateGlobalSecondaryIndexAction
-> Rep UpdateGlobalSecondaryIndexAction x
Prelude.Generic)
newUpdateGlobalSecondaryIndexAction ::
Prelude.Text ->
ProvisionedThroughput ->
UpdateGlobalSecondaryIndexAction
newUpdateGlobalSecondaryIndexAction :: Text -> ProvisionedThroughput -> UpdateGlobalSecondaryIndexAction
newUpdateGlobalSecondaryIndexAction
Text
pIndexName_
ProvisionedThroughput
pProvisionedThroughput_ =
UpdateGlobalSecondaryIndexAction'
{ $sel:indexName:UpdateGlobalSecondaryIndexAction' :: Text
indexName =
Text
pIndexName_,
$sel:provisionedThroughput:UpdateGlobalSecondaryIndexAction' :: ProvisionedThroughput
provisionedThroughput =
ProvisionedThroughput
pProvisionedThroughput_
}
updateGlobalSecondaryIndexAction_indexName :: Lens.Lens' UpdateGlobalSecondaryIndexAction Prelude.Text
updateGlobalSecondaryIndexAction_indexName :: Lens' UpdateGlobalSecondaryIndexAction Text
updateGlobalSecondaryIndexAction_indexName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateGlobalSecondaryIndexAction' {Text
indexName :: Text
$sel:indexName:UpdateGlobalSecondaryIndexAction' :: UpdateGlobalSecondaryIndexAction -> Text
indexName} -> Text
indexName) (\s :: UpdateGlobalSecondaryIndexAction
s@UpdateGlobalSecondaryIndexAction' {} Text
a -> UpdateGlobalSecondaryIndexAction
s {$sel:indexName:UpdateGlobalSecondaryIndexAction' :: Text
indexName = Text
a} :: UpdateGlobalSecondaryIndexAction)
updateGlobalSecondaryIndexAction_provisionedThroughput :: Lens.Lens' UpdateGlobalSecondaryIndexAction ProvisionedThroughput
updateGlobalSecondaryIndexAction_provisionedThroughput :: Lens' UpdateGlobalSecondaryIndexAction ProvisionedThroughput
updateGlobalSecondaryIndexAction_provisionedThroughput = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateGlobalSecondaryIndexAction' {ProvisionedThroughput
provisionedThroughput :: ProvisionedThroughput
$sel:provisionedThroughput:UpdateGlobalSecondaryIndexAction' :: UpdateGlobalSecondaryIndexAction -> ProvisionedThroughput
provisionedThroughput} -> ProvisionedThroughput
provisionedThroughput) (\s :: UpdateGlobalSecondaryIndexAction
s@UpdateGlobalSecondaryIndexAction' {} ProvisionedThroughput
a -> UpdateGlobalSecondaryIndexAction
s {$sel:provisionedThroughput:UpdateGlobalSecondaryIndexAction' :: ProvisionedThroughput
provisionedThroughput = ProvisionedThroughput
a} :: UpdateGlobalSecondaryIndexAction)
instance
Prelude.Hashable
UpdateGlobalSecondaryIndexAction
where
hashWithSalt :: Int -> UpdateGlobalSecondaryIndexAction -> Int
hashWithSalt
Int
_salt
UpdateGlobalSecondaryIndexAction' {Text
ProvisionedThroughput
provisionedThroughput :: ProvisionedThroughput
indexName :: Text
$sel:provisionedThroughput:UpdateGlobalSecondaryIndexAction' :: UpdateGlobalSecondaryIndexAction -> ProvisionedThroughput
$sel:indexName:UpdateGlobalSecondaryIndexAction' :: UpdateGlobalSecondaryIndexAction -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
indexName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ProvisionedThroughput
provisionedThroughput
instance
Prelude.NFData
UpdateGlobalSecondaryIndexAction
where
rnf :: UpdateGlobalSecondaryIndexAction -> ()
rnf UpdateGlobalSecondaryIndexAction' {Text
ProvisionedThroughput
provisionedThroughput :: ProvisionedThroughput
indexName :: Text
$sel:provisionedThroughput:UpdateGlobalSecondaryIndexAction' :: UpdateGlobalSecondaryIndexAction -> ProvisionedThroughput
$sel:indexName:UpdateGlobalSecondaryIndexAction' :: UpdateGlobalSecondaryIndexAction -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
indexName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ProvisionedThroughput
provisionedThroughput
instance Data.ToJSON UpdateGlobalSecondaryIndexAction where
toJSON :: UpdateGlobalSecondaryIndexAction -> Value
toJSON UpdateGlobalSecondaryIndexAction' {Text
ProvisionedThroughput
provisionedThroughput :: ProvisionedThroughput
indexName :: Text
$sel:provisionedThroughput:UpdateGlobalSecondaryIndexAction' :: UpdateGlobalSecondaryIndexAction -> ProvisionedThroughput
$sel:indexName:UpdateGlobalSecondaryIndexAction' :: UpdateGlobalSecondaryIndexAction -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"IndexName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
indexName),
forall a. a -> Maybe a
Prelude.Just
( Key
"ProvisionedThroughput"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ProvisionedThroughput
provisionedThroughput
)
]
)