{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data FieldLevelEncryptionConfig = FieldLevelEncryptionConfig'
{
:: Prelude.Maybe Prelude.Text,
FieldLevelEncryptionConfig -> Maybe ContentTypeProfileConfig
contentTypeProfileConfig :: Prelude.Maybe ContentTypeProfileConfig,
FieldLevelEncryptionConfig -> Maybe QueryArgProfileConfig
queryArgProfileConfig :: Prelude.Maybe QueryArgProfileConfig,
FieldLevelEncryptionConfig -> Text
callerReference :: Prelude.Text
}
deriving (FieldLevelEncryptionConfig -> FieldLevelEncryptionConfig -> Bool
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]
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
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.
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'
{ $sel:comment:FieldLevelEncryptionConfig' :: Maybe Text
comment =
forall a. Maybe a
Prelude.Nothing,
$sel:contentTypeProfileConfig:FieldLevelEncryptionConfig' :: Maybe ContentTypeProfileConfig
contentTypeProfileConfig = forall a. Maybe a
Prelude.Nothing,
$sel:queryArgProfileConfig:FieldLevelEncryptionConfig' :: Maybe QueryArgProfileConfig
queryArgProfileConfig = forall a. Maybe a
Prelude.Nothing,
$sel:callerReference:FieldLevelEncryptionConfig' :: Text
callerReference = Text
pCallerReference_
}
fieldLevelEncryptionConfig_comment :: Lens.Lens' FieldLevelEncryptionConfig (Prelude.Maybe Prelude.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_contentTypeProfileConfig :: Lens.Lens' FieldLevelEncryptionConfig (Prelude.Maybe ContentTypeProfileConfig)
fieldLevelEncryptionConfig_contentTypeProfileConfig :: Lens' FieldLevelEncryptionConfig (Maybe ContentTypeProfileConfig)
fieldLevelEncryptionConfig_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_queryArgProfileConfig :: Lens.Lens' FieldLevelEncryptionConfig (Prelude.Maybe QueryArgProfileConfig)
fieldLevelEncryptionConfig_queryArgProfileConfig :: Lens' FieldLevelEncryptionConfig (Maybe QueryArgProfileConfig)
fieldLevelEncryptionConfig_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_callerReference :: Lens.Lens' FieldLevelEncryptionConfig Prelude.Text
fieldLevelEncryptionConfig_callerReference :: Lens' FieldLevelEncryptionConfig Text
fieldLevelEncryptionConfig_callerReference = 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 Data.FromXML FieldLevelEncryptionConfig where
parseXML :: [Node] -> Either String FieldLevelEncryptionConfig
parseXML [Node]
x =
Maybe Text
-> Maybe ContentTypeProfileConfig
-> Maybe QueryArgProfileConfig
-> Text
-> FieldLevelEncryptionConfig
FieldLevelEncryptionConfig'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Comment")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"ContentTypeProfileConfig")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"QueryArgProfileConfig")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"CallerReference")
instance Prelude.Hashable FieldLevelEncryptionConfig where
hashWithSalt :: Int -> FieldLevelEncryptionConfig -> Int
hashWithSalt Int
_salt FieldLevelEncryptionConfig' {Maybe Text
Maybe ContentTypeProfileConfig
Maybe QueryArgProfileConfig
Text
callerReference :: Text
queryArgProfileConfig :: Maybe QueryArgProfileConfig
contentTypeProfileConfig :: Maybe ContentTypeProfileConfig
comment :: Maybe Text
$sel:callerReference:FieldLevelEncryptionConfig' :: FieldLevelEncryptionConfig -> Text
$sel:queryArgProfileConfig:FieldLevelEncryptionConfig' :: FieldLevelEncryptionConfig -> Maybe QueryArgProfileConfig
$sel:contentTypeProfileConfig:FieldLevelEncryptionConfig' :: FieldLevelEncryptionConfig -> Maybe ContentTypeProfileConfig
$sel:comment:FieldLevelEncryptionConfig' :: FieldLevelEncryptionConfig -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
comment
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ContentTypeProfileConfig
contentTypeProfileConfig
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe QueryArgProfileConfig
queryArgProfileConfig
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
callerReference
instance Prelude.NFData FieldLevelEncryptionConfig where
rnf :: FieldLevelEncryptionConfig -> ()
rnf FieldLevelEncryptionConfig' {Maybe Text
Maybe ContentTypeProfileConfig
Maybe QueryArgProfileConfig
Text
callerReference :: Text
queryArgProfileConfig :: Maybe QueryArgProfileConfig
contentTypeProfileConfig :: Maybe ContentTypeProfileConfig
comment :: Maybe Text
$sel:callerReference:FieldLevelEncryptionConfig' :: FieldLevelEncryptionConfig -> Text
$sel:queryArgProfileConfig:FieldLevelEncryptionConfig' :: FieldLevelEncryptionConfig -> Maybe QueryArgProfileConfig
$sel:contentTypeProfileConfig:FieldLevelEncryptionConfig' :: FieldLevelEncryptionConfig -> Maybe ContentTypeProfileConfig
$sel:comment:FieldLevelEncryptionConfig' :: FieldLevelEncryptionConfig -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
comment
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ContentTypeProfileConfig
contentTypeProfileConfig
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe QueryArgProfileConfig
queryArgProfileConfig
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
callerReference
instance Data.ToXML FieldLevelEncryptionConfig where
toXML :: FieldLevelEncryptionConfig -> XML
toXML FieldLevelEncryptionConfig' {Maybe Text
Maybe ContentTypeProfileConfig
Maybe QueryArgProfileConfig
Text
callerReference :: Text
queryArgProfileConfig :: Maybe QueryArgProfileConfig
contentTypeProfileConfig :: Maybe ContentTypeProfileConfig
comment :: Maybe Text
$sel:callerReference:FieldLevelEncryptionConfig' :: FieldLevelEncryptionConfig -> Text
$sel:queryArgProfileConfig:FieldLevelEncryptionConfig' :: FieldLevelEncryptionConfig -> Maybe QueryArgProfileConfig
$sel:contentTypeProfileConfig:FieldLevelEncryptionConfig' :: FieldLevelEncryptionConfig -> Maybe ContentTypeProfileConfig
$sel:comment:FieldLevelEncryptionConfig' :: FieldLevelEncryptionConfig -> Maybe Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ Name
"Comment" forall a. ToXML a => Name -> a -> XML
Data.@= Maybe Text
comment,
Name
"ContentTypeProfileConfig"
forall a. ToXML a => Name -> a -> XML
Data.@= Maybe ContentTypeProfileConfig
contentTypeProfileConfig,
Name
"QueryArgProfileConfig"
forall a. ToXML a => Name -> a -> XML
Data.@= Maybe QueryArgProfileConfig
queryArgProfileConfig,
Name
"CallerReference" forall a. ToXML a => Name -> a -> XML
Data.@= Text
callerReference
]