{-# 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.EncryptionEntity where
import Amazonka.CloudFront.Types.FieldPatterns
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data EncryptionEntity = EncryptionEntity'
{
EncryptionEntity -> Text
publicKeyId :: Prelude.Text,
EncryptionEntity -> Text
providerId :: Prelude.Text,
EncryptionEntity -> FieldPatterns
fieldPatterns :: FieldPatterns
}
deriving (EncryptionEntity -> EncryptionEntity -> Bool
(EncryptionEntity -> EncryptionEntity -> Bool)
-> (EncryptionEntity -> EncryptionEntity -> Bool)
-> Eq EncryptionEntity
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EncryptionEntity -> EncryptionEntity -> Bool
$c/= :: EncryptionEntity -> EncryptionEntity -> Bool
== :: EncryptionEntity -> EncryptionEntity -> Bool
$c== :: EncryptionEntity -> EncryptionEntity -> Bool
Prelude.Eq, ReadPrec [EncryptionEntity]
ReadPrec EncryptionEntity
Int -> ReadS EncryptionEntity
ReadS [EncryptionEntity]
(Int -> ReadS EncryptionEntity)
-> ReadS [EncryptionEntity]
-> ReadPrec EncryptionEntity
-> ReadPrec [EncryptionEntity]
-> Read EncryptionEntity
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EncryptionEntity]
$creadListPrec :: ReadPrec [EncryptionEntity]
readPrec :: ReadPrec EncryptionEntity
$creadPrec :: ReadPrec EncryptionEntity
readList :: ReadS [EncryptionEntity]
$creadList :: ReadS [EncryptionEntity]
readsPrec :: Int -> ReadS EncryptionEntity
$creadsPrec :: Int -> ReadS EncryptionEntity
Prelude.Read, Int -> EncryptionEntity -> ShowS
[EncryptionEntity] -> ShowS
EncryptionEntity -> String
(Int -> EncryptionEntity -> ShowS)
-> (EncryptionEntity -> String)
-> ([EncryptionEntity] -> ShowS)
-> Show EncryptionEntity
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EncryptionEntity] -> ShowS
$cshowList :: [EncryptionEntity] -> ShowS
show :: EncryptionEntity -> String
$cshow :: EncryptionEntity -> String
showsPrec :: Int -> EncryptionEntity -> ShowS
$cshowsPrec :: Int -> EncryptionEntity -> ShowS
Prelude.Show, (forall x. EncryptionEntity -> Rep EncryptionEntity x)
-> (forall x. Rep EncryptionEntity x -> EncryptionEntity)
-> Generic EncryptionEntity
forall x. Rep EncryptionEntity x -> EncryptionEntity
forall x. EncryptionEntity -> Rep EncryptionEntity x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EncryptionEntity x -> EncryptionEntity
$cfrom :: forall x. EncryptionEntity -> Rep EncryptionEntity x
Prelude.Generic)
newEncryptionEntity ::
Prelude.Text ->
Prelude.Text ->
FieldPatterns ->
EncryptionEntity
newEncryptionEntity :: Text -> Text -> FieldPatterns -> EncryptionEntity
newEncryptionEntity
Text
pPublicKeyId_
Text
pProviderId_
FieldPatterns
pFieldPatterns_ =
EncryptionEntity' :: Text -> Text -> FieldPatterns -> EncryptionEntity
EncryptionEntity'
{ $sel:publicKeyId:EncryptionEntity' :: Text
publicKeyId = Text
pPublicKeyId_,
$sel:providerId:EncryptionEntity' :: Text
providerId = Text
pProviderId_,
$sel:fieldPatterns:EncryptionEntity' :: FieldPatterns
fieldPatterns = FieldPatterns
pFieldPatterns_
}
encryptionEntity_publicKeyId :: Lens.Lens' EncryptionEntity Prelude.Text
encryptionEntity_publicKeyId :: (Text -> f Text) -> EncryptionEntity -> f EncryptionEntity
encryptionEntity_publicKeyId = (EncryptionEntity -> Text)
-> (EncryptionEntity -> Text -> EncryptionEntity)
-> Lens EncryptionEntity EncryptionEntity Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EncryptionEntity' {Text
publicKeyId :: Text
$sel:publicKeyId:EncryptionEntity' :: EncryptionEntity -> Text
publicKeyId} -> Text
publicKeyId) (\s :: EncryptionEntity
s@EncryptionEntity' {} Text
a -> EncryptionEntity
s {$sel:publicKeyId:EncryptionEntity' :: Text
publicKeyId = Text
a} :: EncryptionEntity)
encryptionEntity_providerId :: Lens.Lens' EncryptionEntity Prelude.Text
encryptionEntity_providerId :: (Text -> f Text) -> EncryptionEntity -> f EncryptionEntity
encryptionEntity_providerId = (EncryptionEntity -> Text)
-> (EncryptionEntity -> Text -> EncryptionEntity)
-> Lens EncryptionEntity EncryptionEntity Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EncryptionEntity' {Text
providerId :: Text
$sel:providerId:EncryptionEntity' :: EncryptionEntity -> Text
providerId} -> Text
providerId) (\s :: EncryptionEntity
s@EncryptionEntity' {} Text
a -> EncryptionEntity
s {$sel:providerId:EncryptionEntity' :: Text
providerId = Text
a} :: EncryptionEntity)
encryptionEntity_fieldPatterns :: Lens.Lens' EncryptionEntity FieldPatterns
encryptionEntity_fieldPatterns :: (FieldPatterns -> f FieldPatterns)
-> EncryptionEntity -> f EncryptionEntity
encryptionEntity_fieldPatterns = (EncryptionEntity -> FieldPatterns)
-> (EncryptionEntity -> FieldPatterns -> EncryptionEntity)
-> Lens
EncryptionEntity EncryptionEntity FieldPatterns FieldPatterns
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EncryptionEntity' {FieldPatterns
fieldPatterns :: FieldPatterns
$sel:fieldPatterns:EncryptionEntity' :: EncryptionEntity -> FieldPatterns
fieldPatterns} -> FieldPatterns
fieldPatterns) (\s :: EncryptionEntity
s@EncryptionEntity' {} FieldPatterns
a -> EncryptionEntity
s {$sel:fieldPatterns:EncryptionEntity' :: FieldPatterns
fieldPatterns = FieldPatterns
a} :: EncryptionEntity)
instance Core.FromXML EncryptionEntity where
parseXML :: [Node] -> Either String EncryptionEntity
parseXML [Node]
x =
Text -> Text -> FieldPatterns -> EncryptionEntity
EncryptionEntity'
(Text -> Text -> FieldPatterns -> EncryptionEntity)
-> Either String Text
-> Either String (Text -> FieldPatterns -> EncryptionEntity)
forall (f :: * -> *) a b. Functor 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
"PublicKeyId")
Either String (Text -> FieldPatterns -> EncryptionEntity)
-> Either String Text
-> Either String (FieldPatterns -> EncryptionEntity)
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
"ProviderId")
Either String (FieldPatterns -> EncryptionEntity)
-> Either String FieldPatterns -> Either String EncryptionEntity
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String FieldPatterns
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"FieldPatterns")
instance Prelude.Hashable EncryptionEntity
instance Prelude.NFData EncryptionEntity
instance Core.ToXML EncryptionEntity where
toXML :: EncryptionEntity -> XML
toXML EncryptionEntity' {Text
FieldPatterns
fieldPatterns :: FieldPatterns
providerId :: Text
publicKeyId :: Text
$sel:fieldPatterns:EncryptionEntity' :: EncryptionEntity -> FieldPatterns
$sel:providerId:EncryptionEntity' :: EncryptionEntity -> Text
$sel:publicKeyId:EncryptionEntity' :: EncryptionEntity -> Text
..} =
[XML] -> XML
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ Name
"PublicKeyId" Name -> Text -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Text
publicKeyId,
Name
"ProviderId" Name -> Text -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Text
providerId,
Name
"FieldPatterns" Name -> FieldPatterns -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= FieldPatterns
fieldPatterns
]