{-# 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.KMS.Types.MultiRegionConfiguration where
import qualified Amazonka.Core as Core
import Amazonka.KMS.Types.MultiRegionKey
import Amazonka.KMS.Types.MultiRegionKeyType
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data MultiRegionConfiguration = MultiRegionConfiguration'
{
MultiRegionConfiguration -> Maybe MultiRegionKey
primaryKey :: Prelude.Maybe MultiRegionKey,
MultiRegionConfiguration -> Maybe [MultiRegionKey]
replicaKeys :: Prelude.Maybe [MultiRegionKey],
MultiRegionConfiguration -> Maybe MultiRegionKeyType
multiRegionKeyType :: Prelude.Maybe MultiRegionKeyType
}
deriving (MultiRegionConfiguration -> MultiRegionConfiguration -> Bool
(MultiRegionConfiguration -> MultiRegionConfiguration -> Bool)
-> (MultiRegionConfiguration -> MultiRegionConfiguration -> Bool)
-> Eq MultiRegionConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MultiRegionConfiguration -> MultiRegionConfiguration -> Bool
$c/= :: MultiRegionConfiguration -> MultiRegionConfiguration -> Bool
== :: MultiRegionConfiguration -> MultiRegionConfiguration -> Bool
$c== :: MultiRegionConfiguration -> MultiRegionConfiguration -> Bool
Prelude.Eq, ReadPrec [MultiRegionConfiguration]
ReadPrec MultiRegionConfiguration
Int -> ReadS MultiRegionConfiguration
ReadS [MultiRegionConfiguration]
(Int -> ReadS MultiRegionConfiguration)
-> ReadS [MultiRegionConfiguration]
-> ReadPrec MultiRegionConfiguration
-> ReadPrec [MultiRegionConfiguration]
-> Read MultiRegionConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MultiRegionConfiguration]
$creadListPrec :: ReadPrec [MultiRegionConfiguration]
readPrec :: ReadPrec MultiRegionConfiguration
$creadPrec :: ReadPrec MultiRegionConfiguration
readList :: ReadS [MultiRegionConfiguration]
$creadList :: ReadS [MultiRegionConfiguration]
readsPrec :: Int -> ReadS MultiRegionConfiguration
$creadsPrec :: Int -> ReadS MultiRegionConfiguration
Prelude.Read, Int -> MultiRegionConfiguration -> ShowS
[MultiRegionConfiguration] -> ShowS
MultiRegionConfiguration -> String
(Int -> MultiRegionConfiguration -> ShowS)
-> (MultiRegionConfiguration -> String)
-> ([MultiRegionConfiguration] -> ShowS)
-> Show MultiRegionConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MultiRegionConfiguration] -> ShowS
$cshowList :: [MultiRegionConfiguration] -> ShowS
show :: MultiRegionConfiguration -> String
$cshow :: MultiRegionConfiguration -> String
showsPrec :: Int -> MultiRegionConfiguration -> ShowS
$cshowsPrec :: Int -> MultiRegionConfiguration -> ShowS
Prelude.Show, (forall x.
MultiRegionConfiguration -> Rep MultiRegionConfiguration x)
-> (forall x.
Rep MultiRegionConfiguration x -> MultiRegionConfiguration)
-> Generic MultiRegionConfiguration
forall x.
Rep MultiRegionConfiguration x -> MultiRegionConfiguration
forall x.
MultiRegionConfiguration -> Rep MultiRegionConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep MultiRegionConfiguration x -> MultiRegionConfiguration
$cfrom :: forall x.
MultiRegionConfiguration -> Rep MultiRegionConfiguration x
Prelude.Generic)
newMultiRegionConfiguration ::
MultiRegionConfiguration
newMultiRegionConfiguration :: MultiRegionConfiguration
newMultiRegionConfiguration =
MultiRegionConfiguration' :: Maybe MultiRegionKey
-> Maybe [MultiRegionKey]
-> Maybe MultiRegionKeyType
-> MultiRegionConfiguration
MultiRegionConfiguration'
{ $sel:primaryKey:MultiRegionConfiguration' :: Maybe MultiRegionKey
primaryKey =
Maybe MultiRegionKey
forall a. Maybe a
Prelude.Nothing,
$sel:replicaKeys:MultiRegionConfiguration' :: Maybe [MultiRegionKey]
replicaKeys = Maybe [MultiRegionKey]
forall a. Maybe a
Prelude.Nothing,
$sel:multiRegionKeyType:MultiRegionConfiguration' :: Maybe MultiRegionKeyType
multiRegionKeyType = Maybe MultiRegionKeyType
forall a. Maybe a
Prelude.Nothing
}
multiRegionConfiguration_primaryKey :: Lens.Lens' MultiRegionConfiguration (Prelude.Maybe MultiRegionKey)
multiRegionConfiguration_primaryKey :: (Maybe MultiRegionKey -> f (Maybe MultiRegionKey))
-> MultiRegionConfiguration -> f MultiRegionConfiguration
multiRegionConfiguration_primaryKey = (MultiRegionConfiguration -> Maybe MultiRegionKey)
-> (MultiRegionConfiguration
-> Maybe MultiRegionKey -> MultiRegionConfiguration)
-> Lens
MultiRegionConfiguration
MultiRegionConfiguration
(Maybe MultiRegionKey)
(Maybe MultiRegionKey)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MultiRegionConfiguration' {Maybe MultiRegionKey
primaryKey :: Maybe MultiRegionKey
$sel:primaryKey:MultiRegionConfiguration' :: MultiRegionConfiguration -> Maybe MultiRegionKey
primaryKey} -> Maybe MultiRegionKey
primaryKey) (\s :: MultiRegionConfiguration
s@MultiRegionConfiguration' {} Maybe MultiRegionKey
a -> MultiRegionConfiguration
s {$sel:primaryKey:MultiRegionConfiguration' :: Maybe MultiRegionKey
primaryKey = Maybe MultiRegionKey
a} :: MultiRegionConfiguration)
multiRegionConfiguration_replicaKeys :: Lens.Lens' MultiRegionConfiguration (Prelude.Maybe [MultiRegionKey])
multiRegionConfiguration_replicaKeys :: (Maybe [MultiRegionKey] -> f (Maybe [MultiRegionKey]))
-> MultiRegionConfiguration -> f MultiRegionConfiguration
multiRegionConfiguration_replicaKeys = (MultiRegionConfiguration -> Maybe [MultiRegionKey])
-> (MultiRegionConfiguration
-> Maybe [MultiRegionKey] -> MultiRegionConfiguration)
-> Lens
MultiRegionConfiguration
MultiRegionConfiguration
(Maybe [MultiRegionKey])
(Maybe [MultiRegionKey])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MultiRegionConfiguration' {Maybe [MultiRegionKey]
replicaKeys :: Maybe [MultiRegionKey]
$sel:replicaKeys:MultiRegionConfiguration' :: MultiRegionConfiguration -> Maybe [MultiRegionKey]
replicaKeys} -> Maybe [MultiRegionKey]
replicaKeys) (\s :: MultiRegionConfiguration
s@MultiRegionConfiguration' {} Maybe [MultiRegionKey]
a -> MultiRegionConfiguration
s {$sel:replicaKeys:MultiRegionConfiguration' :: Maybe [MultiRegionKey]
replicaKeys = Maybe [MultiRegionKey]
a} :: MultiRegionConfiguration) ((Maybe [MultiRegionKey] -> f (Maybe [MultiRegionKey]))
-> MultiRegionConfiguration -> f MultiRegionConfiguration)
-> ((Maybe [MultiRegionKey] -> f (Maybe [MultiRegionKey]))
-> Maybe [MultiRegionKey] -> f (Maybe [MultiRegionKey]))
-> (Maybe [MultiRegionKey] -> f (Maybe [MultiRegionKey]))
-> MultiRegionConfiguration
-> f MultiRegionConfiguration
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[MultiRegionKey] [MultiRegionKey] [MultiRegionKey] [MultiRegionKey]
-> Iso
(Maybe [MultiRegionKey])
(Maybe [MultiRegionKey])
(Maybe [MultiRegionKey])
(Maybe [MultiRegionKey])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
[MultiRegionKey] [MultiRegionKey] [MultiRegionKey] [MultiRegionKey]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
multiRegionConfiguration_multiRegionKeyType :: Lens.Lens' MultiRegionConfiguration (Prelude.Maybe MultiRegionKeyType)
multiRegionConfiguration_multiRegionKeyType :: (Maybe MultiRegionKeyType -> f (Maybe MultiRegionKeyType))
-> MultiRegionConfiguration -> f MultiRegionConfiguration
multiRegionConfiguration_multiRegionKeyType = (MultiRegionConfiguration -> Maybe MultiRegionKeyType)
-> (MultiRegionConfiguration
-> Maybe MultiRegionKeyType -> MultiRegionConfiguration)
-> Lens
MultiRegionConfiguration
MultiRegionConfiguration
(Maybe MultiRegionKeyType)
(Maybe MultiRegionKeyType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MultiRegionConfiguration' {Maybe MultiRegionKeyType
multiRegionKeyType :: Maybe MultiRegionKeyType
$sel:multiRegionKeyType:MultiRegionConfiguration' :: MultiRegionConfiguration -> Maybe MultiRegionKeyType
multiRegionKeyType} -> Maybe MultiRegionKeyType
multiRegionKeyType) (\s :: MultiRegionConfiguration
s@MultiRegionConfiguration' {} Maybe MultiRegionKeyType
a -> MultiRegionConfiguration
s {$sel:multiRegionKeyType:MultiRegionConfiguration' :: Maybe MultiRegionKeyType
multiRegionKeyType = Maybe MultiRegionKeyType
a} :: MultiRegionConfiguration)
instance Core.FromJSON MultiRegionConfiguration where
parseJSON :: Value -> Parser MultiRegionConfiguration
parseJSON =
String
-> (Object -> Parser MultiRegionConfiguration)
-> Value
-> Parser MultiRegionConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"MultiRegionConfiguration"
( \Object
x ->
Maybe MultiRegionKey
-> Maybe [MultiRegionKey]
-> Maybe MultiRegionKeyType
-> MultiRegionConfiguration
MultiRegionConfiguration'
(Maybe MultiRegionKey
-> Maybe [MultiRegionKey]
-> Maybe MultiRegionKeyType
-> MultiRegionConfiguration)
-> Parser (Maybe MultiRegionKey)
-> Parser
(Maybe [MultiRegionKey]
-> Maybe MultiRegionKeyType -> MultiRegionConfiguration)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe MultiRegionKey)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PrimaryKey")
Parser
(Maybe [MultiRegionKey]
-> Maybe MultiRegionKeyType -> MultiRegionConfiguration)
-> Parser (Maybe [MultiRegionKey])
-> Parser (Maybe MultiRegionKeyType -> MultiRegionConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [MultiRegionKey]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ReplicaKeys" Parser (Maybe (Maybe [MultiRegionKey]))
-> Maybe [MultiRegionKey] -> Parser (Maybe [MultiRegionKey])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [MultiRegionKey]
forall a. Monoid a => a
Prelude.mempty)
Parser (Maybe MultiRegionKeyType -> MultiRegionConfiguration)
-> Parser (Maybe MultiRegionKeyType)
-> Parser MultiRegionConfiguration
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe MultiRegionKeyType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"MultiRegionKeyType")
)
instance Prelude.Hashable MultiRegionConfiguration
instance Prelude.NFData MultiRegionConfiguration