{-# 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.CloudFrontOriginAccessIdentity where
import Amazonka.CloudFront.Types.CloudFrontOriginAccessIdentityConfig
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data CloudFrontOriginAccessIdentity = CloudFrontOriginAccessIdentity'
{
CloudFrontOriginAccessIdentity
-> Maybe CloudFrontOriginAccessIdentityConfig
cloudFrontOriginAccessIdentityConfig :: Prelude.Maybe CloudFrontOriginAccessIdentityConfig,
CloudFrontOriginAccessIdentity -> Text
id :: Prelude.Text,
CloudFrontOriginAccessIdentity -> Text
s3CanonicalUserId :: Prelude.Text
}
deriving (CloudFrontOriginAccessIdentity
-> CloudFrontOriginAccessIdentity -> Bool
(CloudFrontOriginAccessIdentity
-> CloudFrontOriginAccessIdentity -> Bool)
-> (CloudFrontOriginAccessIdentity
-> CloudFrontOriginAccessIdentity -> Bool)
-> Eq CloudFrontOriginAccessIdentity
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CloudFrontOriginAccessIdentity
-> CloudFrontOriginAccessIdentity -> Bool
$c/= :: CloudFrontOriginAccessIdentity
-> CloudFrontOriginAccessIdentity -> Bool
== :: CloudFrontOriginAccessIdentity
-> CloudFrontOriginAccessIdentity -> Bool
$c== :: CloudFrontOriginAccessIdentity
-> CloudFrontOriginAccessIdentity -> Bool
Prelude.Eq, ReadPrec [CloudFrontOriginAccessIdentity]
ReadPrec CloudFrontOriginAccessIdentity
Int -> ReadS CloudFrontOriginAccessIdentity
ReadS [CloudFrontOriginAccessIdentity]
(Int -> ReadS CloudFrontOriginAccessIdentity)
-> ReadS [CloudFrontOriginAccessIdentity]
-> ReadPrec CloudFrontOriginAccessIdentity
-> ReadPrec [CloudFrontOriginAccessIdentity]
-> Read CloudFrontOriginAccessIdentity
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CloudFrontOriginAccessIdentity]
$creadListPrec :: ReadPrec [CloudFrontOriginAccessIdentity]
readPrec :: ReadPrec CloudFrontOriginAccessIdentity
$creadPrec :: ReadPrec CloudFrontOriginAccessIdentity
readList :: ReadS [CloudFrontOriginAccessIdentity]
$creadList :: ReadS [CloudFrontOriginAccessIdentity]
readsPrec :: Int -> ReadS CloudFrontOriginAccessIdentity
$creadsPrec :: Int -> ReadS CloudFrontOriginAccessIdentity
Prelude.Read, Int -> CloudFrontOriginAccessIdentity -> ShowS
[CloudFrontOriginAccessIdentity] -> ShowS
CloudFrontOriginAccessIdentity -> String
(Int -> CloudFrontOriginAccessIdentity -> ShowS)
-> (CloudFrontOriginAccessIdentity -> String)
-> ([CloudFrontOriginAccessIdentity] -> ShowS)
-> Show CloudFrontOriginAccessIdentity
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CloudFrontOriginAccessIdentity] -> ShowS
$cshowList :: [CloudFrontOriginAccessIdentity] -> ShowS
show :: CloudFrontOriginAccessIdentity -> String
$cshow :: CloudFrontOriginAccessIdentity -> String
showsPrec :: Int -> CloudFrontOriginAccessIdentity -> ShowS
$cshowsPrec :: Int -> CloudFrontOriginAccessIdentity -> ShowS
Prelude.Show, (forall x.
CloudFrontOriginAccessIdentity
-> Rep CloudFrontOriginAccessIdentity x)
-> (forall x.
Rep CloudFrontOriginAccessIdentity x
-> CloudFrontOriginAccessIdentity)
-> Generic CloudFrontOriginAccessIdentity
forall x.
Rep CloudFrontOriginAccessIdentity x
-> CloudFrontOriginAccessIdentity
forall x.
CloudFrontOriginAccessIdentity
-> Rep CloudFrontOriginAccessIdentity x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CloudFrontOriginAccessIdentity x
-> CloudFrontOriginAccessIdentity
$cfrom :: forall x.
CloudFrontOriginAccessIdentity
-> Rep CloudFrontOriginAccessIdentity x
Prelude.Generic)
newCloudFrontOriginAccessIdentity ::
Prelude.Text ->
Prelude.Text ->
CloudFrontOriginAccessIdentity
newCloudFrontOriginAccessIdentity :: Text -> Text -> CloudFrontOriginAccessIdentity
newCloudFrontOriginAccessIdentity
Text
pId_
Text
pS3CanonicalUserId_ =
CloudFrontOriginAccessIdentity' :: Maybe CloudFrontOriginAccessIdentityConfig
-> Text -> Text -> CloudFrontOriginAccessIdentity
CloudFrontOriginAccessIdentity'
{ $sel:cloudFrontOriginAccessIdentityConfig:CloudFrontOriginAccessIdentity' :: Maybe CloudFrontOriginAccessIdentityConfig
cloudFrontOriginAccessIdentityConfig =
Maybe CloudFrontOriginAccessIdentityConfig
forall a. Maybe a
Prelude.Nothing,
$sel:id:CloudFrontOriginAccessIdentity' :: Text
id = Text
pId_,
$sel:s3CanonicalUserId:CloudFrontOriginAccessIdentity' :: Text
s3CanonicalUserId = Text
pS3CanonicalUserId_
}
cloudFrontOriginAccessIdentity_cloudFrontOriginAccessIdentityConfig :: Lens.Lens' CloudFrontOriginAccessIdentity (Prelude.Maybe CloudFrontOriginAccessIdentityConfig)
cloudFrontOriginAccessIdentity_cloudFrontOriginAccessIdentityConfig :: (Maybe CloudFrontOriginAccessIdentityConfig
-> f (Maybe CloudFrontOriginAccessIdentityConfig))
-> CloudFrontOriginAccessIdentity
-> f CloudFrontOriginAccessIdentity
cloudFrontOriginAccessIdentity_cloudFrontOriginAccessIdentityConfig = (CloudFrontOriginAccessIdentity
-> Maybe CloudFrontOriginAccessIdentityConfig)
-> (CloudFrontOriginAccessIdentity
-> Maybe CloudFrontOriginAccessIdentityConfig
-> CloudFrontOriginAccessIdentity)
-> Lens
CloudFrontOriginAccessIdentity
CloudFrontOriginAccessIdentity
(Maybe CloudFrontOriginAccessIdentityConfig)
(Maybe CloudFrontOriginAccessIdentityConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloudFrontOriginAccessIdentity' {Maybe CloudFrontOriginAccessIdentityConfig
cloudFrontOriginAccessIdentityConfig :: Maybe CloudFrontOriginAccessIdentityConfig
$sel:cloudFrontOriginAccessIdentityConfig:CloudFrontOriginAccessIdentity' :: CloudFrontOriginAccessIdentity
-> Maybe CloudFrontOriginAccessIdentityConfig
cloudFrontOriginAccessIdentityConfig} -> Maybe CloudFrontOriginAccessIdentityConfig
cloudFrontOriginAccessIdentityConfig) (\s :: CloudFrontOriginAccessIdentity
s@CloudFrontOriginAccessIdentity' {} Maybe CloudFrontOriginAccessIdentityConfig
a -> CloudFrontOriginAccessIdentity
s {$sel:cloudFrontOriginAccessIdentityConfig:CloudFrontOriginAccessIdentity' :: Maybe CloudFrontOriginAccessIdentityConfig
cloudFrontOriginAccessIdentityConfig = Maybe CloudFrontOriginAccessIdentityConfig
a} :: CloudFrontOriginAccessIdentity)
cloudFrontOriginAccessIdentity_id :: Lens.Lens' CloudFrontOriginAccessIdentity Prelude.Text
cloudFrontOriginAccessIdentity_id :: (Text -> f Text)
-> CloudFrontOriginAccessIdentity
-> f CloudFrontOriginAccessIdentity
cloudFrontOriginAccessIdentity_id = (CloudFrontOriginAccessIdentity -> Text)
-> (CloudFrontOriginAccessIdentity
-> Text -> CloudFrontOriginAccessIdentity)
-> Lens
CloudFrontOriginAccessIdentity
CloudFrontOriginAccessIdentity
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloudFrontOriginAccessIdentity' {Text
id :: Text
$sel:id:CloudFrontOriginAccessIdentity' :: CloudFrontOriginAccessIdentity -> Text
id} -> Text
id) (\s :: CloudFrontOriginAccessIdentity
s@CloudFrontOriginAccessIdentity' {} Text
a -> CloudFrontOriginAccessIdentity
s {$sel:id:CloudFrontOriginAccessIdentity' :: Text
id = Text
a} :: CloudFrontOriginAccessIdentity)
cloudFrontOriginAccessIdentity_s3CanonicalUserId :: Lens.Lens' CloudFrontOriginAccessIdentity Prelude.Text
cloudFrontOriginAccessIdentity_s3CanonicalUserId :: (Text -> f Text)
-> CloudFrontOriginAccessIdentity
-> f CloudFrontOriginAccessIdentity
cloudFrontOriginAccessIdentity_s3CanonicalUserId = (CloudFrontOriginAccessIdentity -> Text)
-> (CloudFrontOriginAccessIdentity
-> Text -> CloudFrontOriginAccessIdentity)
-> Lens
CloudFrontOriginAccessIdentity
CloudFrontOriginAccessIdentity
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloudFrontOriginAccessIdentity' {Text
s3CanonicalUserId :: Text
$sel:s3CanonicalUserId:CloudFrontOriginAccessIdentity' :: CloudFrontOriginAccessIdentity -> Text
s3CanonicalUserId} -> Text
s3CanonicalUserId) (\s :: CloudFrontOriginAccessIdentity
s@CloudFrontOriginAccessIdentity' {} Text
a -> CloudFrontOriginAccessIdentity
s {$sel:s3CanonicalUserId:CloudFrontOriginAccessIdentity' :: Text
s3CanonicalUserId = Text
a} :: CloudFrontOriginAccessIdentity)
instance Core.FromXML CloudFrontOriginAccessIdentity where
parseXML :: [Node] -> Either String CloudFrontOriginAccessIdentity
parseXML [Node]
x =
Maybe CloudFrontOriginAccessIdentityConfig
-> Text -> Text -> CloudFrontOriginAccessIdentity
CloudFrontOriginAccessIdentity'
(Maybe CloudFrontOriginAccessIdentityConfig
-> Text -> Text -> CloudFrontOriginAccessIdentity)
-> Either String (Maybe CloudFrontOriginAccessIdentityConfig)
-> Either String (Text -> Text -> CloudFrontOriginAccessIdentity)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node]
-> Text
-> Either String (Maybe CloudFrontOriginAccessIdentityConfig)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"CloudFrontOriginAccessIdentityConfig")
Either String (Text -> Text -> CloudFrontOriginAccessIdentity)
-> Either String Text
-> Either String (Text -> CloudFrontOriginAccessIdentity)
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
"Id")
Either String (Text -> CloudFrontOriginAccessIdentity)
-> Either String Text
-> Either String CloudFrontOriginAccessIdentity
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
"S3CanonicalUserId")
instance
Prelude.Hashable
CloudFrontOriginAccessIdentity
instance
Prelude.NFData
CloudFrontOriginAccessIdentity