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