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