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