{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.DynamoDB.Types.AttributeValue
import Amazonka.DynamoDB.Types.WriteRequest
import qualified Amazonka.Prelude as Prelude
data CreateReplicaAction = CreateReplicaAction'
{
CreateReplicaAction -> Text
regionName :: Prelude.Text
}
deriving (CreateReplicaAction -> CreateReplicaAction -> Bool
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]
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
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. 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' {$sel:regionName:CreateReplicaAction' :: Text
regionName = Text
pRegionName_}
createReplicaAction_regionName :: Lens.Lens' CreateReplicaAction Prelude.Text
createReplicaAction_regionName :: Lens' CreateReplicaAction Text
createReplicaAction_regionName = 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 where
hashWithSalt :: Int -> CreateReplicaAction -> Int
hashWithSalt Int
_salt CreateReplicaAction' {Text
regionName :: Text
$sel:regionName:CreateReplicaAction' :: CreateReplicaAction -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
regionName
instance Prelude.NFData CreateReplicaAction where
rnf :: CreateReplicaAction -> ()
rnf CreateReplicaAction' {Text
regionName :: Text
$sel:regionName:CreateReplicaAction' :: CreateReplicaAction -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
regionName
instance Data.ToJSON CreateReplicaAction where
toJSON :: CreateReplicaAction -> Value
toJSON CreateReplicaAction' {Text
regionName :: Text
$sel:regionName:CreateReplicaAction' :: CreateReplicaAction -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[forall a. a -> Maybe a
Prelude.Just (Key
"RegionName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
regionName)]
)