{-# 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.CloudFront.Types.FieldLevelEncryptionProfileConfig where
import Amazonka.CloudFront.Types.EncryptionEntities
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data FieldLevelEncryptionProfileConfig = FieldLevelEncryptionProfileConfig'
{
:: Prelude.Maybe Prelude.Text,
FieldLevelEncryptionProfileConfig -> Text
name :: Prelude.Text,
FieldLevelEncryptionProfileConfig -> Text
callerReference :: Prelude.Text,
FieldLevelEncryptionProfileConfig -> EncryptionEntities
encryptionEntities :: EncryptionEntities
}
deriving (FieldLevelEncryptionProfileConfig
-> FieldLevelEncryptionProfileConfig -> Bool
(FieldLevelEncryptionProfileConfig
-> FieldLevelEncryptionProfileConfig -> Bool)
-> (FieldLevelEncryptionProfileConfig
-> FieldLevelEncryptionProfileConfig -> Bool)
-> Eq FieldLevelEncryptionProfileConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FieldLevelEncryptionProfileConfig
-> FieldLevelEncryptionProfileConfig -> Bool
$c/= :: FieldLevelEncryptionProfileConfig
-> FieldLevelEncryptionProfileConfig -> Bool
== :: FieldLevelEncryptionProfileConfig
-> FieldLevelEncryptionProfileConfig -> Bool
$c== :: FieldLevelEncryptionProfileConfig
-> FieldLevelEncryptionProfileConfig -> Bool
Prelude.Eq, ReadPrec [FieldLevelEncryptionProfileConfig]
ReadPrec FieldLevelEncryptionProfileConfig
Int -> ReadS FieldLevelEncryptionProfileConfig
ReadS [FieldLevelEncryptionProfileConfig]
(Int -> ReadS FieldLevelEncryptionProfileConfig)
-> ReadS [FieldLevelEncryptionProfileConfig]
-> ReadPrec FieldLevelEncryptionProfileConfig
-> ReadPrec [FieldLevelEncryptionProfileConfig]
-> Read FieldLevelEncryptionProfileConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FieldLevelEncryptionProfileConfig]
$creadListPrec :: ReadPrec [FieldLevelEncryptionProfileConfig]
readPrec :: ReadPrec FieldLevelEncryptionProfileConfig
$creadPrec :: ReadPrec FieldLevelEncryptionProfileConfig
readList :: ReadS [FieldLevelEncryptionProfileConfig]
$creadList :: ReadS [FieldLevelEncryptionProfileConfig]
readsPrec :: Int -> ReadS FieldLevelEncryptionProfileConfig
$creadsPrec :: Int -> ReadS FieldLevelEncryptionProfileConfig
Prelude.Read, Int -> FieldLevelEncryptionProfileConfig -> ShowS
[FieldLevelEncryptionProfileConfig] -> ShowS
FieldLevelEncryptionProfileConfig -> String
(Int -> FieldLevelEncryptionProfileConfig -> ShowS)
-> (FieldLevelEncryptionProfileConfig -> String)
-> ([FieldLevelEncryptionProfileConfig] -> ShowS)
-> Show FieldLevelEncryptionProfileConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FieldLevelEncryptionProfileConfig] -> ShowS
$cshowList :: [FieldLevelEncryptionProfileConfig] -> ShowS
show :: FieldLevelEncryptionProfileConfig -> String
$cshow :: FieldLevelEncryptionProfileConfig -> String
showsPrec :: Int -> FieldLevelEncryptionProfileConfig -> ShowS
$cshowsPrec :: Int -> FieldLevelEncryptionProfileConfig -> ShowS
Prelude.Show, (forall x.
FieldLevelEncryptionProfileConfig
-> Rep FieldLevelEncryptionProfileConfig x)
-> (forall x.
Rep FieldLevelEncryptionProfileConfig x
-> FieldLevelEncryptionProfileConfig)
-> Generic FieldLevelEncryptionProfileConfig
forall x.
Rep FieldLevelEncryptionProfileConfig x
-> FieldLevelEncryptionProfileConfig
forall x.
FieldLevelEncryptionProfileConfig
-> Rep FieldLevelEncryptionProfileConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep FieldLevelEncryptionProfileConfig x
-> FieldLevelEncryptionProfileConfig
$cfrom :: forall x.
FieldLevelEncryptionProfileConfig
-> Rep FieldLevelEncryptionProfileConfig x
Prelude.Generic)
newFieldLevelEncryptionProfileConfig ::
Prelude.Text ->
Prelude.Text ->
EncryptionEntities ->
FieldLevelEncryptionProfileConfig
newFieldLevelEncryptionProfileConfig :: Text
-> Text -> EncryptionEntities -> FieldLevelEncryptionProfileConfig
newFieldLevelEncryptionProfileConfig
Text
pName_
Text
pCallerReference_
EncryptionEntities
pEncryptionEntities_ =
FieldLevelEncryptionProfileConfig' :: Maybe Text
-> Text
-> Text
-> EncryptionEntities
-> FieldLevelEncryptionProfileConfig
FieldLevelEncryptionProfileConfig'
{ $sel:comment:FieldLevelEncryptionProfileConfig' :: Maybe Text
comment =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:FieldLevelEncryptionProfileConfig' :: Text
name = Text
pName_,
$sel:callerReference:FieldLevelEncryptionProfileConfig' :: Text
callerReference = Text
pCallerReference_,
$sel:encryptionEntities:FieldLevelEncryptionProfileConfig' :: EncryptionEntities
encryptionEntities =
EncryptionEntities
pEncryptionEntities_
}
fieldLevelEncryptionProfileConfig_comment :: Lens.Lens' FieldLevelEncryptionProfileConfig (Prelude.Maybe Prelude.Text)
= (FieldLevelEncryptionProfileConfig -> Maybe Text)
-> (FieldLevelEncryptionProfileConfig
-> Maybe Text -> FieldLevelEncryptionProfileConfig)
-> Lens
FieldLevelEncryptionProfileConfig
FieldLevelEncryptionProfileConfig
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FieldLevelEncryptionProfileConfig' {Maybe Text
comment :: Maybe Text
$sel:comment:FieldLevelEncryptionProfileConfig' :: FieldLevelEncryptionProfileConfig -> Maybe Text
comment} -> Maybe Text
comment) (\s :: FieldLevelEncryptionProfileConfig
s@FieldLevelEncryptionProfileConfig' {} Maybe Text
a -> FieldLevelEncryptionProfileConfig
s {$sel:comment:FieldLevelEncryptionProfileConfig' :: Maybe Text
comment = Maybe Text
a} :: FieldLevelEncryptionProfileConfig)
fieldLevelEncryptionProfileConfig_name :: Lens.Lens' FieldLevelEncryptionProfileConfig Prelude.Text
fieldLevelEncryptionProfileConfig_name :: (Text -> f Text)
-> FieldLevelEncryptionProfileConfig
-> f FieldLevelEncryptionProfileConfig
fieldLevelEncryptionProfileConfig_name = (FieldLevelEncryptionProfileConfig -> Text)
-> (FieldLevelEncryptionProfileConfig
-> Text -> FieldLevelEncryptionProfileConfig)
-> Lens
FieldLevelEncryptionProfileConfig
FieldLevelEncryptionProfileConfig
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FieldLevelEncryptionProfileConfig' {Text
name :: Text
$sel:name:FieldLevelEncryptionProfileConfig' :: FieldLevelEncryptionProfileConfig -> Text
name} -> Text
name) (\s :: FieldLevelEncryptionProfileConfig
s@FieldLevelEncryptionProfileConfig' {} Text
a -> FieldLevelEncryptionProfileConfig
s {$sel:name:FieldLevelEncryptionProfileConfig' :: Text
name = Text
a} :: FieldLevelEncryptionProfileConfig)
fieldLevelEncryptionProfileConfig_callerReference :: Lens.Lens' FieldLevelEncryptionProfileConfig Prelude.Text
fieldLevelEncryptionProfileConfig_callerReference :: (Text -> f Text)
-> FieldLevelEncryptionProfileConfig
-> f FieldLevelEncryptionProfileConfig
fieldLevelEncryptionProfileConfig_callerReference = (FieldLevelEncryptionProfileConfig -> Text)
-> (FieldLevelEncryptionProfileConfig
-> Text -> FieldLevelEncryptionProfileConfig)
-> Lens
FieldLevelEncryptionProfileConfig
FieldLevelEncryptionProfileConfig
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FieldLevelEncryptionProfileConfig' {Text
callerReference :: Text
$sel:callerReference:FieldLevelEncryptionProfileConfig' :: FieldLevelEncryptionProfileConfig -> Text
callerReference} -> Text
callerReference) (\s :: FieldLevelEncryptionProfileConfig
s@FieldLevelEncryptionProfileConfig' {} Text
a -> FieldLevelEncryptionProfileConfig
s {$sel:callerReference:FieldLevelEncryptionProfileConfig' :: Text
callerReference = Text
a} :: FieldLevelEncryptionProfileConfig)
fieldLevelEncryptionProfileConfig_encryptionEntities :: Lens.Lens' FieldLevelEncryptionProfileConfig EncryptionEntities
fieldLevelEncryptionProfileConfig_encryptionEntities :: (EncryptionEntities -> f EncryptionEntities)
-> FieldLevelEncryptionProfileConfig
-> f FieldLevelEncryptionProfileConfig
fieldLevelEncryptionProfileConfig_encryptionEntities = (FieldLevelEncryptionProfileConfig -> EncryptionEntities)
-> (FieldLevelEncryptionProfileConfig
-> EncryptionEntities -> FieldLevelEncryptionProfileConfig)
-> Lens
FieldLevelEncryptionProfileConfig
FieldLevelEncryptionProfileConfig
EncryptionEntities
EncryptionEntities
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FieldLevelEncryptionProfileConfig' {EncryptionEntities
encryptionEntities :: EncryptionEntities
$sel:encryptionEntities:FieldLevelEncryptionProfileConfig' :: FieldLevelEncryptionProfileConfig -> EncryptionEntities
encryptionEntities} -> EncryptionEntities
encryptionEntities) (\s :: FieldLevelEncryptionProfileConfig
s@FieldLevelEncryptionProfileConfig' {} EncryptionEntities
a -> FieldLevelEncryptionProfileConfig
s {$sel:encryptionEntities:FieldLevelEncryptionProfileConfig' :: EncryptionEntities
encryptionEntities = EncryptionEntities
a} :: FieldLevelEncryptionProfileConfig)
instance
Core.FromXML
FieldLevelEncryptionProfileConfig
where
parseXML :: [Node] -> Either String FieldLevelEncryptionProfileConfig
parseXML [Node]
x =
Maybe Text
-> Text
-> Text
-> EncryptionEntities
-> FieldLevelEncryptionProfileConfig
FieldLevelEncryptionProfileConfig'
(Maybe Text
-> Text
-> Text
-> EncryptionEntities
-> FieldLevelEncryptionProfileConfig)
-> Either String (Maybe Text)
-> Either
String
(Text
-> Text -> EncryptionEntities -> FieldLevelEncryptionProfileConfig)
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
"Comment")
Either
String
(Text
-> Text -> EncryptionEntities -> FieldLevelEncryptionProfileConfig)
-> Either String Text
-> Either
String
(Text -> EncryptionEntities -> FieldLevelEncryptionProfileConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String Text
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"Name")
Either
String
(Text -> EncryptionEntities -> FieldLevelEncryptionProfileConfig)
-> Either String Text
-> Either
String (EncryptionEntities -> FieldLevelEncryptionProfileConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String Text
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"CallerReference")
Either
String (EncryptionEntities -> FieldLevelEncryptionProfileConfig)
-> Either String EncryptionEntities
-> Either String FieldLevelEncryptionProfileConfig
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String EncryptionEntities
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"EncryptionEntities")
instance
Prelude.Hashable
FieldLevelEncryptionProfileConfig
instance
Prelude.NFData
FieldLevelEncryptionProfileConfig
instance Core.ToXML FieldLevelEncryptionProfileConfig where
toXML :: FieldLevelEncryptionProfileConfig -> XML
toXML FieldLevelEncryptionProfileConfig' {Maybe Text
Text
EncryptionEntities
encryptionEntities :: EncryptionEntities
callerReference :: Text
name :: Text
comment :: Maybe Text
$sel:encryptionEntities:FieldLevelEncryptionProfileConfig' :: FieldLevelEncryptionProfileConfig -> EncryptionEntities
$sel:callerReference:FieldLevelEncryptionProfileConfig' :: FieldLevelEncryptionProfileConfig -> Text
$sel:name:FieldLevelEncryptionProfileConfig' :: FieldLevelEncryptionProfileConfig -> Text
$sel:comment:FieldLevelEncryptionProfileConfig' :: FieldLevelEncryptionProfileConfig -> Maybe Text
..} =
[XML] -> XML
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ Name
"Comment" Name -> Maybe Text -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Maybe Text
comment,
Name
"Name" Name -> Text -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Text
name,
Name
"CallerReference" Name -> Text -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Text
callerReference,
Name
"EncryptionEntities" Name -> EncryptionEntities -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= EncryptionEntities
encryptionEntities
]