{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.SSMIncidents.Types.RegionMapInputValue
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SSMIncidents.Types.RegionMapInputValue 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

-- | The mapping between a Amazon Web Services Region and the key that\'s
-- used to encrypt the data.
--
-- /See:/ 'newRegionMapInputValue' smart constructor.
data RegionMapInputValue = RegionMapInputValue'
  { -- | The KMS key used to encrypt the data in your replication set.
    RegionMapInputValue -> Maybe Text
sseKmsKeyId :: Prelude.Maybe Prelude.Text
  }
  deriving (RegionMapInputValue -> RegionMapInputValue -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RegionMapInputValue -> RegionMapInputValue -> Bool
$c/= :: RegionMapInputValue -> RegionMapInputValue -> Bool
== :: RegionMapInputValue -> RegionMapInputValue -> Bool
$c== :: RegionMapInputValue -> RegionMapInputValue -> Bool
Prelude.Eq, ReadPrec [RegionMapInputValue]
ReadPrec RegionMapInputValue
Int -> ReadS RegionMapInputValue
ReadS [RegionMapInputValue]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RegionMapInputValue]
$creadListPrec :: ReadPrec [RegionMapInputValue]
readPrec :: ReadPrec RegionMapInputValue
$creadPrec :: ReadPrec RegionMapInputValue
readList :: ReadS [RegionMapInputValue]
$creadList :: ReadS [RegionMapInputValue]
readsPrec :: Int -> ReadS RegionMapInputValue
$creadsPrec :: Int -> ReadS RegionMapInputValue
Prelude.Read, Int -> RegionMapInputValue -> ShowS
[RegionMapInputValue] -> ShowS
RegionMapInputValue -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RegionMapInputValue] -> ShowS
$cshowList :: [RegionMapInputValue] -> ShowS
show :: RegionMapInputValue -> String
$cshow :: RegionMapInputValue -> String
showsPrec :: Int -> RegionMapInputValue -> ShowS
$cshowsPrec :: Int -> RegionMapInputValue -> ShowS
Prelude.Show, forall x. Rep RegionMapInputValue x -> RegionMapInputValue
forall x. RegionMapInputValue -> Rep RegionMapInputValue x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RegionMapInputValue x -> RegionMapInputValue
$cfrom :: forall x. RegionMapInputValue -> Rep RegionMapInputValue x
Prelude.Generic)

-- |
-- Create a value of 'RegionMapInputValue' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'sseKmsKeyId', 'regionMapInputValue_sseKmsKeyId' - The KMS key used to encrypt the data in your replication set.
newRegionMapInputValue ::
  RegionMapInputValue
newRegionMapInputValue :: RegionMapInputValue
newRegionMapInputValue =
  RegionMapInputValue' {$sel:sseKmsKeyId:RegionMapInputValue' :: Maybe Text
sseKmsKeyId = forall a. Maybe a
Prelude.Nothing}

-- | The KMS key used to encrypt the data in your replication set.
regionMapInputValue_sseKmsKeyId :: Lens.Lens' RegionMapInputValue (Prelude.Maybe Prelude.Text)
regionMapInputValue_sseKmsKeyId :: Lens' RegionMapInputValue (Maybe Text)
regionMapInputValue_sseKmsKeyId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegionMapInputValue' {Maybe Text
sseKmsKeyId :: Maybe Text
$sel:sseKmsKeyId:RegionMapInputValue' :: RegionMapInputValue -> Maybe Text
sseKmsKeyId} -> Maybe Text
sseKmsKeyId) (\s :: RegionMapInputValue
s@RegionMapInputValue' {} Maybe Text
a -> RegionMapInputValue
s {$sel:sseKmsKeyId:RegionMapInputValue' :: Maybe Text
sseKmsKeyId = Maybe Text
a} :: RegionMapInputValue)

instance Prelude.Hashable RegionMapInputValue where
  hashWithSalt :: Int -> RegionMapInputValue -> Int
hashWithSalt Int
_salt RegionMapInputValue' {Maybe Text
sseKmsKeyId :: Maybe Text
$sel:sseKmsKeyId:RegionMapInputValue' :: RegionMapInputValue -> Maybe Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
sseKmsKeyId

instance Prelude.NFData RegionMapInputValue where
  rnf :: RegionMapInputValue -> ()
rnf RegionMapInputValue' {Maybe Text
sseKmsKeyId :: Maybe Text
$sel:sseKmsKeyId:RegionMapInputValue' :: RegionMapInputValue -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
sseKmsKeyId

instance Data.ToJSON RegionMapInputValue where
  toJSON :: RegionMapInputValue -> Value
toJSON RegionMapInputValue' {Maybe Text
sseKmsKeyId :: Maybe Text
$sel:sseKmsKeyId:RegionMapInputValue' :: RegionMapInputValue -> 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]
      )