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