{-# 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.GlobalSecondaryIndexUpdate 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.CreateGlobalSecondaryIndexAction
import Amazonka.DynamoDB.Types.DeleteGlobalSecondaryIndexAction
import Amazonka.DynamoDB.Types.UpdateGlobalSecondaryIndexAction
import Amazonka.DynamoDB.Types.WriteRequest
import qualified Amazonka.Prelude as Prelude
data GlobalSecondaryIndexUpdate = GlobalSecondaryIndexUpdate'
{
GlobalSecondaryIndexUpdate
-> Maybe CreateGlobalSecondaryIndexAction
create :: Prelude.Maybe CreateGlobalSecondaryIndexAction,
GlobalSecondaryIndexUpdate
-> Maybe DeleteGlobalSecondaryIndexAction
delete' :: Prelude.Maybe DeleteGlobalSecondaryIndexAction,
GlobalSecondaryIndexUpdate
-> Maybe UpdateGlobalSecondaryIndexAction
update :: Prelude.Maybe UpdateGlobalSecondaryIndexAction
}
deriving (GlobalSecondaryIndexUpdate -> GlobalSecondaryIndexUpdate -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GlobalSecondaryIndexUpdate -> GlobalSecondaryIndexUpdate -> Bool
$c/= :: GlobalSecondaryIndexUpdate -> GlobalSecondaryIndexUpdate -> Bool
== :: GlobalSecondaryIndexUpdate -> GlobalSecondaryIndexUpdate -> Bool
$c== :: GlobalSecondaryIndexUpdate -> GlobalSecondaryIndexUpdate -> Bool
Prelude.Eq, ReadPrec [GlobalSecondaryIndexUpdate]
ReadPrec GlobalSecondaryIndexUpdate
Int -> ReadS GlobalSecondaryIndexUpdate
ReadS [GlobalSecondaryIndexUpdate]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GlobalSecondaryIndexUpdate]
$creadListPrec :: ReadPrec [GlobalSecondaryIndexUpdate]
readPrec :: ReadPrec GlobalSecondaryIndexUpdate
$creadPrec :: ReadPrec GlobalSecondaryIndexUpdate
readList :: ReadS [GlobalSecondaryIndexUpdate]
$creadList :: ReadS [GlobalSecondaryIndexUpdate]
readsPrec :: Int -> ReadS GlobalSecondaryIndexUpdate
$creadsPrec :: Int -> ReadS GlobalSecondaryIndexUpdate
Prelude.Read, Int -> GlobalSecondaryIndexUpdate -> ShowS
[GlobalSecondaryIndexUpdate] -> ShowS
GlobalSecondaryIndexUpdate -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GlobalSecondaryIndexUpdate] -> ShowS
$cshowList :: [GlobalSecondaryIndexUpdate] -> ShowS
show :: GlobalSecondaryIndexUpdate -> String
$cshow :: GlobalSecondaryIndexUpdate -> String
showsPrec :: Int -> GlobalSecondaryIndexUpdate -> ShowS
$cshowsPrec :: Int -> GlobalSecondaryIndexUpdate -> ShowS
Prelude.Show, forall x.
Rep GlobalSecondaryIndexUpdate x -> GlobalSecondaryIndexUpdate
forall x.
GlobalSecondaryIndexUpdate -> Rep GlobalSecondaryIndexUpdate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GlobalSecondaryIndexUpdate x -> GlobalSecondaryIndexUpdate
$cfrom :: forall x.
GlobalSecondaryIndexUpdate -> Rep GlobalSecondaryIndexUpdate x
Prelude.Generic)
newGlobalSecondaryIndexUpdate ::
GlobalSecondaryIndexUpdate
newGlobalSecondaryIndexUpdate :: GlobalSecondaryIndexUpdate
newGlobalSecondaryIndexUpdate =
GlobalSecondaryIndexUpdate'
{ $sel:create:GlobalSecondaryIndexUpdate' :: Maybe CreateGlobalSecondaryIndexAction
create =
forall a. Maybe a
Prelude.Nothing,
$sel:delete':GlobalSecondaryIndexUpdate' :: Maybe DeleteGlobalSecondaryIndexAction
delete' = forall a. Maybe a
Prelude.Nothing,
$sel:update:GlobalSecondaryIndexUpdate' :: Maybe UpdateGlobalSecondaryIndexAction
update = forall a. Maybe a
Prelude.Nothing
}
globalSecondaryIndexUpdate_create :: Lens.Lens' GlobalSecondaryIndexUpdate (Prelude.Maybe CreateGlobalSecondaryIndexAction)
globalSecondaryIndexUpdate_create :: Lens'
GlobalSecondaryIndexUpdate (Maybe CreateGlobalSecondaryIndexAction)
globalSecondaryIndexUpdate_create = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GlobalSecondaryIndexUpdate' {Maybe CreateGlobalSecondaryIndexAction
create :: Maybe CreateGlobalSecondaryIndexAction
$sel:create:GlobalSecondaryIndexUpdate' :: GlobalSecondaryIndexUpdate
-> Maybe CreateGlobalSecondaryIndexAction
create} -> Maybe CreateGlobalSecondaryIndexAction
create) (\s :: GlobalSecondaryIndexUpdate
s@GlobalSecondaryIndexUpdate' {} Maybe CreateGlobalSecondaryIndexAction
a -> GlobalSecondaryIndexUpdate
s {$sel:create:GlobalSecondaryIndexUpdate' :: Maybe CreateGlobalSecondaryIndexAction
create = Maybe CreateGlobalSecondaryIndexAction
a} :: GlobalSecondaryIndexUpdate)
globalSecondaryIndexUpdate_delete :: Lens.Lens' GlobalSecondaryIndexUpdate (Prelude.Maybe DeleteGlobalSecondaryIndexAction)
globalSecondaryIndexUpdate_delete :: Lens'
GlobalSecondaryIndexUpdate (Maybe DeleteGlobalSecondaryIndexAction)
globalSecondaryIndexUpdate_delete = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GlobalSecondaryIndexUpdate' {Maybe DeleteGlobalSecondaryIndexAction
delete' :: Maybe DeleteGlobalSecondaryIndexAction
$sel:delete':GlobalSecondaryIndexUpdate' :: GlobalSecondaryIndexUpdate
-> Maybe DeleteGlobalSecondaryIndexAction
delete'} -> Maybe DeleteGlobalSecondaryIndexAction
delete') (\s :: GlobalSecondaryIndexUpdate
s@GlobalSecondaryIndexUpdate' {} Maybe DeleteGlobalSecondaryIndexAction
a -> GlobalSecondaryIndexUpdate
s {$sel:delete':GlobalSecondaryIndexUpdate' :: Maybe DeleteGlobalSecondaryIndexAction
delete' = Maybe DeleteGlobalSecondaryIndexAction
a} :: GlobalSecondaryIndexUpdate)
globalSecondaryIndexUpdate_update :: Lens.Lens' GlobalSecondaryIndexUpdate (Prelude.Maybe UpdateGlobalSecondaryIndexAction)
globalSecondaryIndexUpdate_update :: Lens'
GlobalSecondaryIndexUpdate (Maybe UpdateGlobalSecondaryIndexAction)
globalSecondaryIndexUpdate_update = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GlobalSecondaryIndexUpdate' {Maybe UpdateGlobalSecondaryIndexAction
update :: Maybe UpdateGlobalSecondaryIndexAction
$sel:update:GlobalSecondaryIndexUpdate' :: GlobalSecondaryIndexUpdate
-> Maybe UpdateGlobalSecondaryIndexAction
update} -> Maybe UpdateGlobalSecondaryIndexAction
update) (\s :: GlobalSecondaryIndexUpdate
s@GlobalSecondaryIndexUpdate' {} Maybe UpdateGlobalSecondaryIndexAction
a -> GlobalSecondaryIndexUpdate
s {$sel:update:GlobalSecondaryIndexUpdate' :: Maybe UpdateGlobalSecondaryIndexAction
update = Maybe UpdateGlobalSecondaryIndexAction
a} :: GlobalSecondaryIndexUpdate)
instance Prelude.Hashable GlobalSecondaryIndexUpdate where
hashWithSalt :: Int -> GlobalSecondaryIndexUpdate -> Int
hashWithSalt Int
_salt GlobalSecondaryIndexUpdate' {Maybe UpdateGlobalSecondaryIndexAction
Maybe DeleteGlobalSecondaryIndexAction
Maybe CreateGlobalSecondaryIndexAction
update :: Maybe UpdateGlobalSecondaryIndexAction
delete' :: Maybe DeleteGlobalSecondaryIndexAction
create :: Maybe CreateGlobalSecondaryIndexAction
$sel:update:GlobalSecondaryIndexUpdate' :: GlobalSecondaryIndexUpdate
-> Maybe UpdateGlobalSecondaryIndexAction
$sel:delete':GlobalSecondaryIndexUpdate' :: GlobalSecondaryIndexUpdate
-> Maybe DeleteGlobalSecondaryIndexAction
$sel:create:GlobalSecondaryIndexUpdate' :: GlobalSecondaryIndexUpdate
-> Maybe CreateGlobalSecondaryIndexAction
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CreateGlobalSecondaryIndexAction
create
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DeleteGlobalSecondaryIndexAction
delete'
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe UpdateGlobalSecondaryIndexAction
update
instance Prelude.NFData GlobalSecondaryIndexUpdate where
rnf :: GlobalSecondaryIndexUpdate -> ()
rnf GlobalSecondaryIndexUpdate' {Maybe UpdateGlobalSecondaryIndexAction
Maybe DeleteGlobalSecondaryIndexAction
Maybe CreateGlobalSecondaryIndexAction
update :: Maybe UpdateGlobalSecondaryIndexAction
delete' :: Maybe DeleteGlobalSecondaryIndexAction
create :: Maybe CreateGlobalSecondaryIndexAction
$sel:update:GlobalSecondaryIndexUpdate' :: GlobalSecondaryIndexUpdate
-> Maybe UpdateGlobalSecondaryIndexAction
$sel:delete':GlobalSecondaryIndexUpdate' :: GlobalSecondaryIndexUpdate
-> Maybe DeleteGlobalSecondaryIndexAction
$sel:create:GlobalSecondaryIndexUpdate' :: GlobalSecondaryIndexUpdate
-> Maybe CreateGlobalSecondaryIndexAction
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe CreateGlobalSecondaryIndexAction
create
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DeleteGlobalSecondaryIndexAction
delete'
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe UpdateGlobalSecondaryIndexAction
update
instance Data.ToJSON GlobalSecondaryIndexUpdate where
toJSON :: GlobalSecondaryIndexUpdate -> Value
toJSON GlobalSecondaryIndexUpdate' {Maybe UpdateGlobalSecondaryIndexAction
Maybe DeleteGlobalSecondaryIndexAction
Maybe CreateGlobalSecondaryIndexAction
update :: Maybe UpdateGlobalSecondaryIndexAction
delete' :: Maybe DeleteGlobalSecondaryIndexAction
create :: Maybe CreateGlobalSecondaryIndexAction
$sel:update:GlobalSecondaryIndexUpdate' :: GlobalSecondaryIndexUpdate
-> Maybe UpdateGlobalSecondaryIndexAction
$sel:delete':GlobalSecondaryIndexUpdate' :: GlobalSecondaryIndexUpdate
-> Maybe DeleteGlobalSecondaryIndexAction
$sel:create:GlobalSecondaryIndexUpdate' :: GlobalSecondaryIndexUpdate
-> Maybe CreateGlobalSecondaryIndexAction
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"Create" 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 CreateGlobalSecondaryIndexAction
create,
(Key
"Delete" 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 DeleteGlobalSecondaryIndexAction
delete',
(Key
"Update" 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 UpdateGlobalSecondaryIndexAction
update
]
)