{-# 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-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SSMIncidents.Types.RegionMapInputValue where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The mapping between a 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
(RegionMapInputValue -> RegionMapInputValue -> Bool)
-> (RegionMapInputValue -> RegionMapInputValue -> Bool)
-> Eq RegionMapInputValue
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]
(Int -> ReadS RegionMapInputValue)
-> ReadS [RegionMapInputValue]
-> ReadPrec RegionMapInputValue
-> ReadPrec [RegionMapInputValue]
-> Read 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
(Int -> RegionMapInputValue -> ShowS)
-> (RegionMapInputValue -> String)
-> ([RegionMapInputValue] -> ShowS)
-> Show RegionMapInputValue
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. RegionMapInputValue -> Rep RegionMapInputValue x)
-> (forall x. Rep RegionMapInputValue x -> RegionMapInputValue)
-> Generic RegionMapInputValue
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' :: Maybe Text -> RegionMapInputValue
RegionMapInputValue' {$sel:sseKmsKeyId:RegionMapInputValue' :: Maybe Text
sseKmsKeyId = Maybe Text
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 :: (Maybe Text -> f (Maybe Text))
-> RegionMapInputValue -> f RegionMapInputValue
regionMapInputValue_sseKmsKeyId = (RegionMapInputValue -> Maybe Text)
-> (RegionMapInputValue -> Maybe Text -> RegionMapInputValue)
-> Lens
     RegionMapInputValue RegionMapInputValue (Maybe Text) (Maybe Text)
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

instance Prelude.NFData RegionMapInputValue

instance Core.ToJSON RegionMapInputValue where
  toJSON :: RegionMapInputValue -> Value
toJSON RegionMapInputValue' {Maybe Text
sseKmsKeyId :: Maybe Text
$sel:sseKmsKeyId:RegionMapInputValue' :: RegionMapInputValue -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [(Text
"sseKmsKeyId" 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
sseKmsKeyId]
      )