{-# 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.S3.Types.SSEKMS
-- 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.S3.Types.SSEKMS 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
import Amazonka.S3.Internal

-- | Specifies the use of SSE-KMS to encrypt delivered inventory reports.
--
-- /See:/ 'newSSEKMS' smart constructor.
data SSEKMS = SSEKMS'
  { -- | Specifies the ID of the Amazon Web Services Key Management Service
    -- (Amazon Web Services KMS) symmetric customer managed key to use for
    -- encrypting inventory reports.
    SSEKMS -> Sensitive Text
keyId :: Data.Sensitive Prelude.Text
  }
  deriving (SSEKMS -> SSEKMS -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SSEKMS -> SSEKMS -> Bool
$c/= :: SSEKMS -> SSEKMS -> Bool
== :: SSEKMS -> SSEKMS -> Bool
$c== :: SSEKMS -> SSEKMS -> Bool
Prelude.Eq, Int -> SSEKMS -> ShowS
[SSEKMS] -> ShowS
SSEKMS -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SSEKMS] -> ShowS
$cshowList :: [SSEKMS] -> ShowS
show :: SSEKMS -> String
$cshow :: SSEKMS -> String
showsPrec :: Int -> SSEKMS -> ShowS
$cshowsPrec :: Int -> SSEKMS -> ShowS
Prelude.Show, forall x. Rep SSEKMS x -> SSEKMS
forall x. SSEKMS -> Rep SSEKMS x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SSEKMS x -> SSEKMS
$cfrom :: forall x. SSEKMS -> Rep SSEKMS x
Prelude.Generic)

-- |
-- Create a value of 'SSEKMS' 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:
--
-- 'keyId', 'ssekms_keyId' - Specifies the ID of the Amazon Web Services Key Management Service
-- (Amazon Web Services KMS) symmetric customer managed key to use for
-- encrypting inventory reports.
newSSEKMS ::
  -- | 'keyId'
  Prelude.Text ->
  SSEKMS
newSSEKMS :: Text -> SSEKMS
newSSEKMS Text
pKeyId_ =
  SSEKMS' {$sel:keyId:SSEKMS' :: Sensitive Text
keyId = forall a. Iso' (Sensitive a) a
Data._Sensitive forall t b. AReview t b -> b -> t
Lens.# Text
pKeyId_}

-- | Specifies the ID of the Amazon Web Services Key Management Service
-- (Amazon Web Services KMS) symmetric customer managed key to use for
-- encrypting inventory reports.
ssekms_keyId :: Lens.Lens' SSEKMS Prelude.Text
ssekms_keyId :: Lens' SSEKMS Text
ssekms_keyId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SSEKMS' {Sensitive Text
keyId :: Sensitive Text
$sel:keyId:SSEKMS' :: SSEKMS -> Sensitive Text
keyId} -> Sensitive Text
keyId) (\s :: SSEKMS
s@SSEKMS' {} Sensitive Text
a -> SSEKMS
s {$sel:keyId:SSEKMS' :: Sensitive Text
keyId = Sensitive Text
a} :: SSEKMS) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a. Iso' (Sensitive a) a
Data._Sensitive

instance Data.FromXML SSEKMS where
  parseXML :: [Node] -> Either String SSEKMS
parseXML [Node]
x = Sensitive Text -> SSEKMS
SSEKMS' forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"KeyId")

instance Prelude.Hashable SSEKMS where
  hashWithSalt :: Int -> SSEKMS -> Int
hashWithSalt Int
_salt SSEKMS' {Sensitive Text
keyId :: Sensitive Text
$sel:keyId:SSEKMS' :: SSEKMS -> Sensitive Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Sensitive Text
keyId

instance Prelude.NFData SSEKMS where
  rnf :: SSEKMS -> ()
rnf SSEKMS' {Sensitive Text
keyId :: Sensitive Text
$sel:keyId:SSEKMS' :: SSEKMS -> Sensitive Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Sensitive Text
keyId

instance Data.ToXML SSEKMS where
  toXML :: SSEKMS -> XML
toXML SSEKMS' {Sensitive Text
keyId :: Sensitive Text
$sel:keyId:SSEKMS' :: SSEKMS -> Sensitive Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat [Name
"KeyId" forall a. ToXML a => Name -> a -> XML
Data.@= Sensitive Text
keyId]