{-# 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.S3.Types.SSEKMS where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.S3.Internal
data SSEKMS = SSEKMS'
{
SSEKMS -> Sensitive Text
keyId :: Core.Sensitive Prelude.Text
}
deriving (SSEKMS -> SSEKMS -> Bool
(SSEKMS -> SSEKMS -> Bool)
-> (SSEKMS -> SSEKMS -> Bool) -> Eq SSEKMS
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
(Int -> SSEKMS -> ShowS)
-> (SSEKMS -> String) -> ([SSEKMS] -> ShowS) -> Show SSEKMS
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. SSEKMS -> Rep SSEKMS x)
-> (forall x. Rep SSEKMS x -> SSEKMS) -> Generic SSEKMS
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)
newSSEKMS ::
Prelude.Text ->
SSEKMS
newSSEKMS :: Text -> SSEKMS
newSSEKMS Text
pKeyId_ =
SSEKMS' :: Sensitive Text -> SSEKMS
SSEKMS' {$sel:keyId:SSEKMS' :: Sensitive Text
keyId = Tagged Text (Identity Text)
-> Tagged (Sensitive Text) (Identity (Sensitive Text))
forall a. Iso' (Sensitive a) a
Core._Sensitive (Tagged Text (Identity Text)
-> Tagged (Sensitive Text) (Identity (Sensitive Text)))
-> Text -> Sensitive Text
forall t b. AReview t b -> b -> t
Lens.# Text
pKeyId_}
ssekms_keyId :: Lens.Lens' SSEKMS Prelude.Text
ssekms_keyId :: (Text -> f Text) -> SSEKMS -> f SSEKMS
ssekms_keyId = (SSEKMS -> Sensitive Text)
-> (SSEKMS -> Sensitive Text -> SSEKMS)
-> Lens SSEKMS SSEKMS (Sensitive Text) (Sensitive Text)
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) ((Sensitive Text -> f (Sensitive Text)) -> SSEKMS -> f SSEKMS)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> SSEKMS
-> f SSEKMS
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> f Text) -> Sensitive Text -> f (Sensitive Text)
forall a. Iso' (Sensitive a) a
Core._Sensitive
instance Core.FromXML SSEKMS where
parseXML :: [Node] -> Either String SSEKMS
parseXML [Node]
x = Sensitive Text -> SSEKMS
SSEKMS' (Sensitive Text -> SSEKMS)
-> Either String (Sensitive Text) -> Either String SSEKMS
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Sensitive Text)
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"KeyId")
instance Prelude.Hashable SSEKMS
instance Prelude.NFData SSEKMS
instance Core.ToXML SSEKMS where
toXML :: SSEKMS -> XML
toXML SSEKMS' {Sensitive Text
keyId :: Sensitive Text
$sel:keyId:SSEKMS' :: SSEKMS -> Sensitive Text
..} =
[XML] -> XML
forall a. Monoid a => [a] -> a
Prelude.mconcat [Name
"KeyId" Name -> Sensitive Text -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Sensitive Text
keyId]