{-# 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 Amazonka.DynamoDB.Types.CreateGlobalSecondaryIndexAction
import Amazonka.DynamoDB.Types.DeleteGlobalSecondaryIndexAction
import Amazonka.DynamoDB.Types.UpdateGlobalSecondaryIndexAction
import qualified Amazonka.Lens as Lens
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
(GlobalSecondaryIndexUpdate -> GlobalSecondaryIndexUpdate -> Bool)
-> (GlobalSecondaryIndexUpdate
-> GlobalSecondaryIndexUpdate -> Bool)
-> Eq GlobalSecondaryIndexUpdate
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]
(Int -> ReadS GlobalSecondaryIndexUpdate)
-> ReadS [GlobalSecondaryIndexUpdate]
-> ReadPrec GlobalSecondaryIndexUpdate
-> ReadPrec [GlobalSecondaryIndexUpdate]
-> Read 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
(Int -> GlobalSecondaryIndexUpdate -> ShowS)
-> (GlobalSecondaryIndexUpdate -> String)
-> ([GlobalSecondaryIndexUpdate] -> ShowS)
-> Show GlobalSecondaryIndexUpdate
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.
GlobalSecondaryIndexUpdate -> Rep GlobalSecondaryIndexUpdate x)
-> (forall x.
Rep GlobalSecondaryIndexUpdate x -> GlobalSecondaryIndexUpdate)
-> Generic GlobalSecondaryIndexUpdate
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' :: Maybe CreateGlobalSecondaryIndexAction
-> Maybe DeleteGlobalSecondaryIndexAction
-> Maybe UpdateGlobalSecondaryIndexAction
-> GlobalSecondaryIndexUpdate
GlobalSecondaryIndexUpdate'
{ $sel:create:GlobalSecondaryIndexUpdate' :: Maybe CreateGlobalSecondaryIndexAction
create =
Maybe CreateGlobalSecondaryIndexAction
forall a. Maybe a
Prelude.Nothing,
$sel:delete':GlobalSecondaryIndexUpdate' :: Maybe DeleteGlobalSecondaryIndexAction
delete' = Maybe DeleteGlobalSecondaryIndexAction
forall a. Maybe a
Prelude.Nothing,
$sel:update:GlobalSecondaryIndexUpdate' :: Maybe UpdateGlobalSecondaryIndexAction
update = Maybe UpdateGlobalSecondaryIndexAction
forall a. Maybe a
Prelude.Nothing
}
globalSecondaryIndexUpdate_create :: Lens.Lens' GlobalSecondaryIndexUpdate (Prelude.Maybe CreateGlobalSecondaryIndexAction)
globalSecondaryIndexUpdate_create :: (Maybe CreateGlobalSecondaryIndexAction
-> f (Maybe CreateGlobalSecondaryIndexAction))
-> GlobalSecondaryIndexUpdate -> f GlobalSecondaryIndexUpdate
globalSecondaryIndexUpdate_create = (GlobalSecondaryIndexUpdate
-> Maybe CreateGlobalSecondaryIndexAction)
-> (GlobalSecondaryIndexUpdate
-> Maybe CreateGlobalSecondaryIndexAction
-> GlobalSecondaryIndexUpdate)
-> Lens
GlobalSecondaryIndexUpdate
GlobalSecondaryIndexUpdate
(Maybe CreateGlobalSecondaryIndexAction)
(Maybe CreateGlobalSecondaryIndexAction)
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 :: (Maybe DeleteGlobalSecondaryIndexAction
-> f (Maybe DeleteGlobalSecondaryIndexAction))
-> GlobalSecondaryIndexUpdate -> f GlobalSecondaryIndexUpdate
globalSecondaryIndexUpdate_delete = (GlobalSecondaryIndexUpdate
-> Maybe DeleteGlobalSecondaryIndexAction)
-> (GlobalSecondaryIndexUpdate
-> Maybe DeleteGlobalSecondaryIndexAction
-> GlobalSecondaryIndexUpdate)
-> Lens
GlobalSecondaryIndexUpdate
GlobalSecondaryIndexUpdate
(Maybe DeleteGlobalSecondaryIndexAction)
(Maybe DeleteGlobalSecondaryIndexAction)
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 :: (Maybe UpdateGlobalSecondaryIndexAction
-> f (Maybe UpdateGlobalSecondaryIndexAction))
-> GlobalSecondaryIndexUpdate -> f GlobalSecondaryIndexUpdate
globalSecondaryIndexUpdate_update = (GlobalSecondaryIndexUpdate
-> Maybe UpdateGlobalSecondaryIndexAction)
-> (GlobalSecondaryIndexUpdate
-> Maybe UpdateGlobalSecondaryIndexAction
-> GlobalSecondaryIndexUpdate)
-> Lens
GlobalSecondaryIndexUpdate
GlobalSecondaryIndexUpdate
(Maybe UpdateGlobalSecondaryIndexAction)
(Maybe UpdateGlobalSecondaryIndexAction)
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
instance Prelude.NFData GlobalSecondaryIndexUpdate
instance Core.ToJSON GlobalSecondaryIndexUpdate where
toJSON :: GlobalSecondaryIndexUpdate -> Value
toJSON GlobalSecondaryIndexUpdate' {Maybe DeleteGlobalSecondaryIndexAction
Maybe CreateGlobalSecondaryIndexAction
Maybe UpdateGlobalSecondaryIndexAction
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
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Create" Text -> CreateGlobalSecondaryIndexAction -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (CreateGlobalSecondaryIndexAction -> Pair)
-> Maybe CreateGlobalSecondaryIndexAction -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CreateGlobalSecondaryIndexAction
create,
(Text
"Delete" Text -> DeleteGlobalSecondaryIndexAction -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (DeleteGlobalSecondaryIndexAction -> Pair)
-> Maybe DeleteGlobalSecondaryIndexAction -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DeleteGlobalSecondaryIndexAction
delete',
(Text
"Update" Text -> UpdateGlobalSecondaryIndexAction -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (UpdateGlobalSecondaryIndexAction -> Pair)
-> Maybe UpdateGlobalSecondaryIndexAction -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe UpdateGlobalSecondaryIndexAction
update
]
)