{-# 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.EncryptionConfiguration where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.S3.Internal
data EncryptionConfiguration = EncryptionConfiguration'
{
EncryptionConfiguration -> Maybe Text
replicaKmsKeyID :: Prelude.Maybe Prelude.Text
}
deriving (EncryptionConfiguration -> EncryptionConfiguration -> Bool
(EncryptionConfiguration -> EncryptionConfiguration -> Bool)
-> (EncryptionConfiguration -> EncryptionConfiguration -> Bool)
-> Eq EncryptionConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EncryptionConfiguration -> EncryptionConfiguration -> Bool
$c/= :: EncryptionConfiguration -> EncryptionConfiguration -> Bool
== :: EncryptionConfiguration -> EncryptionConfiguration -> Bool
$c== :: EncryptionConfiguration -> EncryptionConfiguration -> Bool
Prelude.Eq, ReadPrec [EncryptionConfiguration]
ReadPrec EncryptionConfiguration
Int -> ReadS EncryptionConfiguration
ReadS [EncryptionConfiguration]
(Int -> ReadS EncryptionConfiguration)
-> ReadS [EncryptionConfiguration]
-> ReadPrec EncryptionConfiguration
-> ReadPrec [EncryptionConfiguration]
-> Read EncryptionConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EncryptionConfiguration]
$creadListPrec :: ReadPrec [EncryptionConfiguration]
readPrec :: ReadPrec EncryptionConfiguration
$creadPrec :: ReadPrec EncryptionConfiguration
readList :: ReadS [EncryptionConfiguration]
$creadList :: ReadS [EncryptionConfiguration]
readsPrec :: Int -> ReadS EncryptionConfiguration
$creadsPrec :: Int -> ReadS EncryptionConfiguration
Prelude.Read, Int -> EncryptionConfiguration -> ShowS
[EncryptionConfiguration] -> ShowS
EncryptionConfiguration -> String
(Int -> EncryptionConfiguration -> ShowS)
-> (EncryptionConfiguration -> String)
-> ([EncryptionConfiguration] -> ShowS)
-> Show EncryptionConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EncryptionConfiguration] -> ShowS
$cshowList :: [EncryptionConfiguration] -> ShowS
show :: EncryptionConfiguration -> String
$cshow :: EncryptionConfiguration -> String
showsPrec :: Int -> EncryptionConfiguration -> ShowS
$cshowsPrec :: Int -> EncryptionConfiguration -> ShowS
Prelude.Show, (forall x.
EncryptionConfiguration -> Rep EncryptionConfiguration x)
-> (forall x.
Rep EncryptionConfiguration x -> EncryptionConfiguration)
-> Generic EncryptionConfiguration
forall x. Rep EncryptionConfiguration x -> EncryptionConfiguration
forall x. EncryptionConfiguration -> Rep EncryptionConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EncryptionConfiguration x -> EncryptionConfiguration
$cfrom :: forall x. EncryptionConfiguration -> Rep EncryptionConfiguration x
Prelude.Generic)
newEncryptionConfiguration ::
EncryptionConfiguration
newEncryptionConfiguration :: EncryptionConfiguration
newEncryptionConfiguration =
EncryptionConfiguration' :: Maybe Text -> EncryptionConfiguration
EncryptionConfiguration'
{ $sel:replicaKmsKeyID:EncryptionConfiguration' :: Maybe Text
replicaKmsKeyID =
Maybe Text
forall a. Maybe a
Prelude.Nothing
}
encryptionConfiguration_replicaKmsKeyID :: Lens.Lens' EncryptionConfiguration (Prelude.Maybe Prelude.Text)
encryptionConfiguration_replicaKmsKeyID :: (Maybe Text -> f (Maybe Text))
-> EncryptionConfiguration -> f EncryptionConfiguration
encryptionConfiguration_replicaKmsKeyID = (EncryptionConfiguration -> Maybe Text)
-> (EncryptionConfiguration
-> Maybe Text -> EncryptionConfiguration)
-> Lens
EncryptionConfiguration
EncryptionConfiguration
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EncryptionConfiguration' {Maybe Text
replicaKmsKeyID :: Maybe Text
$sel:replicaKmsKeyID:EncryptionConfiguration' :: EncryptionConfiguration -> Maybe Text
replicaKmsKeyID} -> Maybe Text
replicaKmsKeyID) (\s :: EncryptionConfiguration
s@EncryptionConfiguration' {} Maybe Text
a -> EncryptionConfiguration
s {$sel:replicaKmsKeyID:EncryptionConfiguration' :: Maybe Text
replicaKmsKeyID = Maybe Text
a} :: EncryptionConfiguration)
instance Core.FromXML EncryptionConfiguration where
parseXML :: [Node] -> Either String EncryptionConfiguration
parseXML [Node]
x =
Maybe Text -> EncryptionConfiguration
EncryptionConfiguration'
(Maybe Text -> EncryptionConfiguration)
-> Either String (Maybe Text)
-> Either String EncryptionConfiguration
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ReplicaKmsKeyID")
instance Prelude.Hashable EncryptionConfiguration
instance Prelude.NFData EncryptionConfiguration
instance Core.ToXML EncryptionConfiguration where
toXML :: EncryptionConfiguration -> XML
toXML EncryptionConfiguration' {Maybe Text
replicaKmsKeyID :: Maybe Text
$sel:replicaKmsKeyID:EncryptionConfiguration' :: EncryptionConfiguration -> Maybe Text
..} =
[XML] -> XML
forall a. Monoid a => [a] -> a
Prelude.mconcat
[Name
"ReplicaKmsKeyID" Name -> Maybe Text -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Maybe Text
replicaKmsKeyID]