{-# 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.MultiRegionKey where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data MultiRegionKey = MultiRegionKey'
{
MultiRegionKey -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
MultiRegionKey -> Maybe Text
region :: Prelude.Maybe Prelude.Text
}
deriving (MultiRegionKey -> MultiRegionKey -> Bool
(MultiRegionKey -> MultiRegionKey -> Bool)
-> (MultiRegionKey -> MultiRegionKey -> Bool) -> Eq MultiRegionKey
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MultiRegionKey -> MultiRegionKey -> Bool
$c/= :: MultiRegionKey -> MultiRegionKey -> Bool
== :: MultiRegionKey -> MultiRegionKey -> Bool
$c== :: MultiRegionKey -> MultiRegionKey -> Bool
Prelude.Eq, ReadPrec [MultiRegionKey]
ReadPrec MultiRegionKey
Int -> ReadS MultiRegionKey
ReadS [MultiRegionKey]
(Int -> ReadS MultiRegionKey)
-> ReadS [MultiRegionKey]
-> ReadPrec MultiRegionKey
-> ReadPrec [MultiRegionKey]
-> Read MultiRegionKey
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MultiRegionKey]
$creadListPrec :: ReadPrec [MultiRegionKey]
readPrec :: ReadPrec MultiRegionKey
$creadPrec :: ReadPrec MultiRegionKey
readList :: ReadS [MultiRegionKey]
$creadList :: ReadS [MultiRegionKey]
readsPrec :: Int -> ReadS MultiRegionKey
$creadsPrec :: Int -> ReadS MultiRegionKey
Prelude.Read, Int -> MultiRegionKey -> ShowS
[MultiRegionKey] -> ShowS
MultiRegionKey -> String
(Int -> MultiRegionKey -> ShowS)
-> (MultiRegionKey -> String)
-> ([MultiRegionKey] -> ShowS)
-> Show MultiRegionKey
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MultiRegionKey] -> ShowS
$cshowList :: [MultiRegionKey] -> ShowS
show :: MultiRegionKey -> String
$cshow :: MultiRegionKey -> String
showsPrec :: Int -> MultiRegionKey -> ShowS
$cshowsPrec :: Int -> MultiRegionKey -> ShowS
Prelude.Show, (forall x. MultiRegionKey -> Rep MultiRegionKey x)
-> (forall x. Rep MultiRegionKey x -> MultiRegionKey)
-> Generic MultiRegionKey
forall x. Rep MultiRegionKey x -> MultiRegionKey
forall x. MultiRegionKey -> Rep MultiRegionKey x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MultiRegionKey x -> MultiRegionKey
$cfrom :: forall x. MultiRegionKey -> Rep MultiRegionKey x
Prelude.Generic)
newMultiRegionKey ::
MultiRegionKey
newMultiRegionKey :: MultiRegionKey
newMultiRegionKey =
MultiRegionKey' :: Maybe Text -> Maybe Text -> MultiRegionKey
MultiRegionKey'
{ $sel:arn:MultiRegionKey' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:region:MultiRegionKey' :: Maybe Text
region = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
multiRegionKey_arn :: Lens.Lens' MultiRegionKey (Prelude.Maybe Prelude.Text)
multiRegionKey_arn :: (Maybe Text -> f (Maybe Text))
-> MultiRegionKey -> f MultiRegionKey
multiRegionKey_arn = (MultiRegionKey -> Maybe Text)
-> (MultiRegionKey -> Maybe Text -> MultiRegionKey)
-> Lens MultiRegionKey MultiRegionKey (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MultiRegionKey' {Maybe Text
arn :: Maybe Text
$sel:arn:MultiRegionKey' :: MultiRegionKey -> Maybe Text
arn} -> Maybe Text
arn) (\s :: MultiRegionKey
s@MultiRegionKey' {} Maybe Text
a -> MultiRegionKey
s {$sel:arn:MultiRegionKey' :: Maybe Text
arn = Maybe Text
a} :: MultiRegionKey)
multiRegionKey_region :: Lens.Lens' MultiRegionKey (Prelude.Maybe Prelude.Text)
multiRegionKey_region :: (Maybe Text -> f (Maybe Text))
-> MultiRegionKey -> f MultiRegionKey
multiRegionKey_region = (MultiRegionKey -> Maybe Text)
-> (MultiRegionKey -> Maybe Text -> MultiRegionKey)
-> Lens MultiRegionKey MultiRegionKey (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MultiRegionKey' {Maybe Text
region :: Maybe Text
$sel:region:MultiRegionKey' :: MultiRegionKey -> Maybe Text
region} -> Maybe Text
region) (\s :: MultiRegionKey
s@MultiRegionKey' {} Maybe Text
a -> MultiRegionKey
s {$sel:region:MultiRegionKey' :: Maybe Text
region = Maybe Text
a} :: MultiRegionKey)
instance Core.FromJSON MultiRegionKey where
parseJSON :: Value -> Parser MultiRegionKey
parseJSON =
String
-> (Object -> Parser MultiRegionKey)
-> Value
-> Parser MultiRegionKey
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"MultiRegionKey"
( \Object
x ->
Maybe Text -> Maybe Text -> MultiRegionKey
MultiRegionKey'
(Maybe Text -> Maybe Text -> MultiRegionKey)
-> Parser (Maybe Text) -> Parser (Maybe Text -> MultiRegionKey)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Arn") Parser (Maybe Text -> MultiRegionKey)
-> Parser (Maybe Text) -> Parser MultiRegionKey
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Region")
)
instance Prelude.Hashable MultiRegionKey
instance Prelude.NFData MultiRegionKey