{-# 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.ReplicationGroupUpdate where
import qualified Amazonka.Core as Core
import Amazonka.DynamoDB.Types.CreateReplicationGroupMemberAction
import Amazonka.DynamoDB.Types.DeleteReplicationGroupMemberAction
import Amazonka.DynamoDB.Types.UpdateReplicationGroupMemberAction
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ReplicationGroupUpdate = ReplicationGroupUpdate'
{
ReplicationGroupUpdate -> Maybe CreateReplicationGroupMemberAction
create :: Prelude.Maybe CreateReplicationGroupMemberAction,
ReplicationGroupUpdate -> Maybe DeleteReplicationGroupMemberAction
delete' :: Prelude.Maybe DeleteReplicationGroupMemberAction,
ReplicationGroupUpdate -> Maybe UpdateReplicationGroupMemberAction
update :: Prelude.Maybe UpdateReplicationGroupMemberAction
}
deriving (ReplicationGroupUpdate -> ReplicationGroupUpdate -> Bool
(ReplicationGroupUpdate -> ReplicationGroupUpdate -> Bool)
-> (ReplicationGroupUpdate -> ReplicationGroupUpdate -> Bool)
-> Eq ReplicationGroupUpdate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ReplicationGroupUpdate -> ReplicationGroupUpdate -> Bool
$c/= :: ReplicationGroupUpdate -> ReplicationGroupUpdate -> Bool
== :: ReplicationGroupUpdate -> ReplicationGroupUpdate -> Bool
$c== :: ReplicationGroupUpdate -> ReplicationGroupUpdate -> Bool
Prelude.Eq, ReadPrec [ReplicationGroupUpdate]
ReadPrec ReplicationGroupUpdate
Int -> ReadS ReplicationGroupUpdate
ReadS [ReplicationGroupUpdate]
(Int -> ReadS ReplicationGroupUpdate)
-> ReadS [ReplicationGroupUpdate]
-> ReadPrec ReplicationGroupUpdate
-> ReadPrec [ReplicationGroupUpdate]
-> Read ReplicationGroupUpdate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ReplicationGroupUpdate]
$creadListPrec :: ReadPrec [ReplicationGroupUpdate]
readPrec :: ReadPrec ReplicationGroupUpdate
$creadPrec :: ReadPrec ReplicationGroupUpdate
readList :: ReadS [ReplicationGroupUpdate]
$creadList :: ReadS [ReplicationGroupUpdate]
readsPrec :: Int -> ReadS ReplicationGroupUpdate
$creadsPrec :: Int -> ReadS ReplicationGroupUpdate
Prelude.Read, Int -> ReplicationGroupUpdate -> ShowS
[ReplicationGroupUpdate] -> ShowS
ReplicationGroupUpdate -> String
(Int -> ReplicationGroupUpdate -> ShowS)
-> (ReplicationGroupUpdate -> String)
-> ([ReplicationGroupUpdate] -> ShowS)
-> Show ReplicationGroupUpdate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReplicationGroupUpdate] -> ShowS
$cshowList :: [ReplicationGroupUpdate] -> ShowS
show :: ReplicationGroupUpdate -> String
$cshow :: ReplicationGroupUpdate -> String
showsPrec :: Int -> ReplicationGroupUpdate -> ShowS
$cshowsPrec :: Int -> ReplicationGroupUpdate -> ShowS
Prelude.Show, (forall x. ReplicationGroupUpdate -> Rep ReplicationGroupUpdate x)
-> (forall x.
Rep ReplicationGroupUpdate x -> ReplicationGroupUpdate)
-> Generic ReplicationGroupUpdate
forall x. Rep ReplicationGroupUpdate x -> ReplicationGroupUpdate
forall x. ReplicationGroupUpdate -> Rep ReplicationGroupUpdate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ReplicationGroupUpdate x -> ReplicationGroupUpdate
$cfrom :: forall x. ReplicationGroupUpdate -> Rep ReplicationGroupUpdate x
Prelude.Generic)
newReplicationGroupUpdate ::
ReplicationGroupUpdate
newReplicationGroupUpdate :: ReplicationGroupUpdate
newReplicationGroupUpdate =
ReplicationGroupUpdate' :: Maybe CreateReplicationGroupMemberAction
-> Maybe DeleteReplicationGroupMemberAction
-> Maybe UpdateReplicationGroupMemberAction
-> ReplicationGroupUpdate
ReplicationGroupUpdate'
{ $sel:create:ReplicationGroupUpdate' :: Maybe CreateReplicationGroupMemberAction
create = Maybe CreateReplicationGroupMemberAction
forall a. Maybe a
Prelude.Nothing,
$sel:delete':ReplicationGroupUpdate' :: Maybe DeleteReplicationGroupMemberAction
delete' = Maybe DeleteReplicationGroupMemberAction
forall a. Maybe a
Prelude.Nothing,
$sel:update:ReplicationGroupUpdate' :: Maybe UpdateReplicationGroupMemberAction
update = Maybe UpdateReplicationGroupMemberAction
forall a. Maybe a
Prelude.Nothing
}
replicationGroupUpdate_create :: Lens.Lens' ReplicationGroupUpdate (Prelude.Maybe CreateReplicationGroupMemberAction)
replicationGroupUpdate_create :: (Maybe CreateReplicationGroupMemberAction
-> f (Maybe CreateReplicationGroupMemberAction))
-> ReplicationGroupUpdate -> f ReplicationGroupUpdate
replicationGroupUpdate_create = (ReplicationGroupUpdate
-> Maybe CreateReplicationGroupMemberAction)
-> (ReplicationGroupUpdate
-> Maybe CreateReplicationGroupMemberAction
-> ReplicationGroupUpdate)
-> Lens
ReplicationGroupUpdate
ReplicationGroupUpdate
(Maybe CreateReplicationGroupMemberAction)
(Maybe CreateReplicationGroupMemberAction)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReplicationGroupUpdate' {Maybe CreateReplicationGroupMemberAction
create :: Maybe CreateReplicationGroupMemberAction
$sel:create:ReplicationGroupUpdate' :: ReplicationGroupUpdate -> Maybe CreateReplicationGroupMemberAction
create} -> Maybe CreateReplicationGroupMemberAction
create) (\s :: ReplicationGroupUpdate
s@ReplicationGroupUpdate' {} Maybe CreateReplicationGroupMemberAction
a -> ReplicationGroupUpdate
s {$sel:create:ReplicationGroupUpdate' :: Maybe CreateReplicationGroupMemberAction
create = Maybe CreateReplicationGroupMemberAction
a} :: ReplicationGroupUpdate)
replicationGroupUpdate_delete :: Lens.Lens' ReplicationGroupUpdate (Prelude.Maybe DeleteReplicationGroupMemberAction)
replicationGroupUpdate_delete :: (Maybe DeleteReplicationGroupMemberAction
-> f (Maybe DeleteReplicationGroupMemberAction))
-> ReplicationGroupUpdate -> f ReplicationGroupUpdate
replicationGroupUpdate_delete = (ReplicationGroupUpdate
-> Maybe DeleteReplicationGroupMemberAction)
-> (ReplicationGroupUpdate
-> Maybe DeleteReplicationGroupMemberAction
-> ReplicationGroupUpdate)
-> Lens
ReplicationGroupUpdate
ReplicationGroupUpdate
(Maybe DeleteReplicationGroupMemberAction)
(Maybe DeleteReplicationGroupMemberAction)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReplicationGroupUpdate' {Maybe DeleteReplicationGroupMemberAction
delete' :: Maybe DeleteReplicationGroupMemberAction
$sel:delete':ReplicationGroupUpdate' :: ReplicationGroupUpdate -> Maybe DeleteReplicationGroupMemberAction
delete'} -> Maybe DeleteReplicationGroupMemberAction
delete') (\s :: ReplicationGroupUpdate
s@ReplicationGroupUpdate' {} Maybe DeleteReplicationGroupMemberAction
a -> ReplicationGroupUpdate
s {$sel:delete':ReplicationGroupUpdate' :: Maybe DeleteReplicationGroupMemberAction
delete' = Maybe DeleteReplicationGroupMemberAction
a} :: ReplicationGroupUpdate)
replicationGroupUpdate_update :: Lens.Lens' ReplicationGroupUpdate (Prelude.Maybe UpdateReplicationGroupMemberAction)
replicationGroupUpdate_update :: (Maybe UpdateReplicationGroupMemberAction
-> f (Maybe UpdateReplicationGroupMemberAction))
-> ReplicationGroupUpdate -> f ReplicationGroupUpdate
replicationGroupUpdate_update = (ReplicationGroupUpdate
-> Maybe UpdateReplicationGroupMemberAction)
-> (ReplicationGroupUpdate
-> Maybe UpdateReplicationGroupMemberAction
-> ReplicationGroupUpdate)
-> Lens
ReplicationGroupUpdate
ReplicationGroupUpdate
(Maybe UpdateReplicationGroupMemberAction)
(Maybe UpdateReplicationGroupMemberAction)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReplicationGroupUpdate' {Maybe UpdateReplicationGroupMemberAction
update :: Maybe UpdateReplicationGroupMemberAction
$sel:update:ReplicationGroupUpdate' :: ReplicationGroupUpdate -> Maybe UpdateReplicationGroupMemberAction
update} -> Maybe UpdateReplicationGroupMemberAction
update) (\s :: ReplicationGroupUpdate
s@ReplicationGroupUpdate' {} Maybe UpdateReplicationGroupMemberAction
a -> ReplicationGroupUpdate
s {$sel:update:ReplicationGroupUpdate' :: Maybe UpdateReplicationGroupMemberAction
update = Maybe UpdateReplicationGroupMemberAction
a} :: ReplicationGroupUpdate)
instance Prelude.Hashable ReplicationGroupUpdate
instance Prelude.NFData ReplicationGroupUpdate
instance Core.ToJSON ReplicationGroupUpdate where
toJSON :: ReplicationGroupUpdate -> Value
toJSON ReplicationGroupUpdate' {Maybe DeleteReplicationGroupMemberAction
Maybe CreateReplicationGroupMemberAction
Maybe UpdateReplicationGroupMemberAction
update :: Maybe UpdateReplicationGroupMemberAction
delete' :: Maybe DeleteReplicationGroupMemberAction
create :: Maybe CreateReplicationGroupMemberAction
$sel:update:ReplicationGroupUpdate' :: ReplicationGroupUpdate -> Maybe UpdateReplicationGroupMemberAction
$sel:delete':ReplicationGroupUpdate' :: ReplicationGroupUpdate -> Maybe DeleteReplicationGroupMemberAction
$sel:create:ReplicationGroupUpdate' :: ReplicationGroupUpdate -> Maybe CreateReplicationGroupMemberAction
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Create" Text -> CreateReplicationGroupMemberAction -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (CreateReplicationGroupMemberAction -> Pair)
-> Maybe CreateReplicationGroupMemberAction -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CreateReplicationGroupMemberAction
create,
(Text
"Delete" Text -> DeleteReplicationGroupMemberAction -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (DeleteReplicationGroupMemberAction -> Pair)
-> Maybe DeleteReplicationGroupMemberAction -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DeleteReplicationGroupMemberAction
delete',
(Text
"Update" Text -> UpdateReplicationGroupMemberAction -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (UpdateReplicationGroupMemberAction -> Pair)
-> Maybe UpdateReplicationGroupMemberAction -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe UpdateReplicationGroupMemberAction
update
]
)