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