{-# 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.Distribution where
import Amazonka.CloudFront.Types.ActiveTrustedKeyGroups
import Amazonka.CloudFront.Types.ActiveTrustedSigners
import Amazonka.CloudFront.Types.AliasICPRecordal
import Amazonka.CloudFront.Types.DistributionConfig
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Distribution = Distribution'
{
Distribution -> Maybe ActiveTrustedKeyGroups
activeTrustedKeyGroups :: Prelude.Maybe ActiveTrustedKeyGroups,
Distribution -> Maybe [AliasICPRecordal]
aliasICPRecordals :: Prelude.Maybe [AliasICPRecordal],
Distribution -> Maybe ActiveTrustedSigners
activeTrustedSigners :: Prelude.Maybe ActiveTrustedSigners,
Distribution -> Text
id :: Prelude.Text,
Distribution -> Text
arn :: Prelude.Text,
Distribution -> Text
status :: Prelude.Text,
Distribution -> ISO8601
lastModifiedTime :: Core.ISO8601,
Distribution -> Int
inProgressInvalidationBatches :: Prelude.Int,
Distribution -> Text
domainName :: Prelude.Text,
Distribution -> DistributionConfig
distributionConfig :: DistributionConfig
}
deriving (Distribution -> Distribution -> Bool
(Distribution -> Distribution -> Bool)
-> (Distribution -> Distribution -> Bool) -> Eq Distribution
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Distribution -> Distribution -> Bool
$c/= :: Distribution -> Distribution -> Bool
== :: Distribution -> Distribution -> Bool
$c== :: Distribution -> Distribution -> Bool
Prelude.Eq, Int -> Distribution -> ShowS
[Distribution] -> ShowS
Distribution -> String
(Int -> Distribution -> ShowS)
-> (Distribution -> String)
-> ([Distribution] -> ShowS)
-> Show Distribution
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Distribution] -> ShowS
$cshowList :: [Distribution] -> ShowS
show :: Distribution -> String
$cshow :: Distribution -> String
showsPrec :: Int -> Distribution -> ShowS
$cshowsPrec :: Int -> Distribution -> ShowS
Prelude.Show, (forall x. Distribution -> Rep Distribution x)
-> (forall x. Rep Distribution x -> Distribution)
-> Generic Distribution
forall x. Rep Distribution x -> Distribution
forall x. Distribution -> Rep Distribution x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Distribution x -> Distribution
$cfrom :: forall x. Distribution -> Rep Distribution x
Prelude.Generic)
newDistribution ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.UTCTime ->
Prelude.Int ->
Prelude.Text ->
DistributionConfig ->
Distribution
newDistribution :: Text
-> Text
-> Text
-> UTCTime
-> Int
-> Text
-> DistributionConfig
-> Distribution
newDistribution
Text
pId_
Text
pARN_
Text
pStatus_
UTCTime
pLastModifiedTime_
Int
pInProgressInvalidationBatches_
Text
pDomainName_
DistributionConfig
pDistributionConfig_ =
Distribution' :: Maybe ActiveTrustedKeyGroups
-> Maybe [AliasICPRecordal]
-> Maybe ActiveTrustedSigners
-> Text
-> Text
-> Text
-> ISO8601
-> Int
-> Text
-> DistributionConfig
-> Distribution
Distribution'
{ $sel:activeTrustedKeyGroups:Distribution' :: Maybe ActiveTrustedKeyGroups
activeTrustedKeyGroups =
Maybe ActiveTrustedKeyGroups
forall a. Maybe a
Prelude.Nothing,
$sel:aliasICPRecordals:Distribution' :: Maybe [AliasICPRecordal]
aliasICPRecordals = Maybe [AliasICPRecordal]
forall a. Maybe a
Prelude.Nothing,
$sel:activeTrustedSigners:Distribution' :: Maybe ActiveTrustedSigners
activeTrustedSigners = Maybe ActiveTrustedSigners
forall a. Maybe a
Prelude.Nothing,
$sel:id:Distribution' :: Text
id = Text
pId_,
$sel:arn:Distribution' :: Text
arn = Text
pARN_,
$sel:status:Distribution' :: Text
status = Text
pStatus_,
$sel:lastModifiedTime:Distribution' :: ISO8601
lastModifiedTime =
Tagged UTCTime (Identity UTCTime)
-> Tagged ISO8601 (Identity ISO8601)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
-> Tagged ISO8601 (Identity ISO8601))
-> UTCTime -> ISO8601
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pLastModifiedTime_,
$sel:inProgressInvalidationBatches:Distribution' :: Int
inProgressInvalidationBatches =
Int
pInProgressInvalidationBatches_,
$sel:domainName:Distribution' :: Text
domainName = Text
pDomainName_,
$sel:distributionConfig:Distribution' :: DistributionConfig
distributionConfig = DistributionConfig
pDistributionConfig_
}
distribution_activeTrustedKeyGroups :: Lens.Lens' Distribution (Prelude.Maybe ActiveTrustedKeyGroups)
distribution_activeTrustedKeyGroups :: (Maybe ActiveTrustedKeyGroups -> f (Maybe ActiveTrustedKeyGroups))
-> Distribution -> f Distribution
distribution_activeTrustedKeyGroups = (Distribution -> Maybe ActiveTrustedKeyGroups)
-> (Distribution -> Maybe ActiveTrustedKeyGroups -> Distribution)
-> Lens
Distribution
Distribution
(Maybe ActiveTrustedKeyGroups)
(Maybe ActiveTrustedKeyGroups)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Distribution' {Maybe ActiveTrustedKeyGroups
activeTrustedKeyGroups :: Maybe ActiveTrustedKeyGroups
$sel:activeTrustedKeyGroups:Distribution' :: Distribution -> Maybe ActiveTrustedKeyGroups
activeTrustedKeyGroups} -> Maybe ActiveTrustedKeyGroups
activeTrustedKeyGroups) (\s :: Distribution
s@Distribution' {} Maybe ActiveTrustedKeyGroups
a -> Distribution
s {$sel:activeTrustedKeyGroups:Distribution' :: Maybe ActiveTrustedKeyGroups
activeTrustedKeyGroups = Maybe ActiveTrustedKeyGroups
a} :: Distribution)
distribution_aliasICPRecordals :: Lens.Lens' Distribution (Prelude.Maybe [AliasICPRecordal])
distribution_aliasICPRecordals :: (Maybe [AliasICPRecordal] -> f (Maybe [AliasICPRecordal]))
-> Distribution -> f Distribution
distribution_aliasICPRecordals = (Distribution -> Maybe [AliasICPRecordal])
-> (Distribution -> Maybe [AliasICPRecordal] -> Distribution)
-> Lens
Distribution
Distribution
(Maybe [AliasICPRecordal])
(Maybe [AliasICPRecordal])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Distribution' {Maybe [AliasICPRecordal]
aliasICPRecordals :: Maybe [AliasICPRecordal]
$sel:aliasICPRecordals:Distribution' :: Distribution -> Maybe [AliasICPRecordal]
aliasICPRecordals} -> Maybe [AliasICPRecordal]
aliasICPRecordals) (\s :: Distribution
s@Distribution' {} Maybe [AliasICPRecordal]
a -> Distribution
s {$sel:aliasICPRecordals:Distribution' :: Maybe [AliasICPRecordal]
aliasICPRecordals = Maybe [AliasICPRecordal]
a} :: Distribution) ((Maybe [AliasICPRecordal] -> f (Maybe [AliasICPRecordal]))
-> Distribution -> f Distribution)
-> ((Maybe [AliasICPRecordal] -> f (Maybe [AliasICPRecordal]))
-> Maybe [AliasICPRecordal] -> f (Maybe [AliasICPRecordal]))
-> (Maybe [AliasICPRecordal] -> f (Maybe [AliasICPRecordal]))
-> Distribution
-> f Distribution
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[AliasICPRecordal]
[AliasICPRecordal]
[AliasICPRecordal]
[AliasICPRecordal]
-> Iso
(Maybe [AliasICPRecordal])
(Maybe [AliasICPRecordal])
(Maybe [AliasICPRecordal])
(Maybe [AliasICPRecordal])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
[AliasICPRecordal]
[AliasICPRecordal]
[AliasICPRecordal]
[AliasICPRecordal]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
distribution_activeTrustedSigners :: Lens.Lens' Distribution (Prelude.Maybe ActiveTrustedSigners)
distribution_activeTrustedSigners :: (Maybe ActiveTrustedSigners -> f (Maybe ActiveTrustedSigners))
-> Distribution -> f Distribution
distribution_activeTrustedSigners = (Distribution -> Maybe ActiveTrustedSigners)
-> (Distribution -> Maybe ActiveTrustedSigners -> Distribution)
-> Lens
Distribution
Distribution
(Maybe ActiveTrustedSigners)
(Maybe ActiveTrustedSigners)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Distribution' {Maybe ActiveTrustedSigners
activeTrustedSigners :: Maybe ActiveTrustedSigners
$sel:activeTrustedSigners:Distribution' :: Distribution -> Maybe ActiveTrustedSigners
activeTrustedSigners} -> Maybe ActiveTrustedSigners
activeTrustedSigners) (\s :: Distribution
s@Distribution' {} Maybe ActiveTrustedSigners
a -> Distribution
s {$sel:activeTrustedSigners:Distribution' :: Maybe ActiveTrustedSigners
activeTrustedSigners = Maybe ActiveTrustedSigners
a} :: Distribution)
distribution_id :: Lens.Lens' Distribution Prelude.Text
distribution_id :: (Text -> f Text) -> Distribution -> f Distribution
distribution_id = (Distribution -> Text)
-> (Distribution -> Text -> Distribution)
-> Lens Distribution Distribution Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Distribution' {Text
id :: Text
$sel:id:Distribution' :: Distribution -> Text
id} -> Text
id) (\s :: Distribution
s@Distribution' {} Text
a -> Distribution
s {$sel:id:Distribution' :: Text
id = Text
a} :: Distribution)
distribution_arn :: Lens.Lens' Distribution Prelude.Text
distribution_arn :: (Text -> f Text) -> Distribution -> f Distribution
distribution_arn = (Distribution -> Text)
-> (Distribution -> Text -> Distribution)
-> Lens Distribution Distribution Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Distribution' {Text
arn :: Text
$sel:arn:Distribution' :: Distribution -> Text
arn} -> Text
arn) (\s :: Distribution
s@Distribution' {} Text
a -> Distribution
s {$sel:arn:Distribution' :: Text
arn = Text
a} :: Distribution)
distribution_status :: Lens.Lens' Distribution Prelude.Text
distribution_status :: (Text -> f Text) -> Distribution -> f Distribution
distribution_status = (Distribution -> Text)
-> (Distribution -> Text -> Distribution)
-> Lens Distribution Distribution Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Distribution' {Text
status :: Text
$sel:status:Distribution' :: Distribution -> Text
status} -> Text
status) (\s :: Distribution
s@Distribution' {} Text
a -> Distribution
s {$sel:status:Distribution' :: Text
status = Text
a} :: Distribution)
distribution_lastModifiedTime :: Lens.Lens' Distribution Prelude.UTCTime
distribution_lastModifiedTime :: (UTCTime -> f UTCTime) -> Distribution -> f Distribution
distribution_lastModifiedTime = (Distribution -> ISO8601)
-> (Distribution -> ISO8601 -> Distribution)
-> Lens Distribution Distribution ISO8601 ISO8601
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Distribution' {ISO8601
lastModifiedTime :: ISO8601
$sel:lastModifiedTime:Distribution' :: Distribution -> ISO8601
lastModifiedTime} -> ISO8601
lastModifiedTime) (\s :: Distribution
s@Distribution' {} ISO8601
a -> Distribution
s {$sel:lastModifiedTime:Distribution' :: ISO8601
lastModifiedTime = ISO8601
a} :: Distribution) ((ISO8601 -> f ISO8601) -> Distribution -> f Distribution)
-> ((UTCTime -> f UTCTime) -> ISO8601 -> f ISO8601)
-> (UTCTime -> f UTCTime)
-> Distribution
-> f Distribution
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> ISO8601 -> f ISO8601
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
distribution_inProgressInvalidationBatches :: Lens.Lens' Distribution Prelude.Int
distribution_inProgressInvalidationBatches :: (Int -> f Int) -> Distribution -> f Distribution
distribution_inProgressInvalidationBatches = (Distribution -> Int)
-> (Distribution -> Int -> Distribution)
-> Lens Distribution Distribution Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Distribution' {Int
inProgressInvalidationBatches :: Int
$sel:inProgressInvalidationBatches:Distribution' :: Distribution -> Int
inProgressInvalidationBatches} -> Int
inProgressInvalidationBatches) (\s :: Distribution
s@Distribution' {} Int
a -> Distribution
s {$sel:inProgressInvalidationBatches:Distribution' :: Int
inProgressInvalidationBatches = Int
a} :: Distribution)
distribution_domainName :: Lens.Lens' Distribution Prelude.Text
distribution_domainName :: (Text -> f Text) -> Distribution -> f Distribution
distribution_domainName = (Distribution -> Text)
-> (Distribution -> Text -> Distribution)
-> Lens Distribution Distribution Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Distribution' {Text
domainName :: Text
$sel:domainName:Distribution' :: Distribution -> Text
domainName} -> Text
domainName) (\s :: Distribution
s@Distribution' {} Text
a -> Distribution
s {$sel:domainName:Distribution' :: Text
domainName = Text
a} :: Distribution)
distribution_distributionConfig :: Lens.Lens' Distribution DistributionConfig
distribution_distributionConfig :: (DistributionConfig -> f DistributionConfig)
-> Distribution -> f Distribution
distribution_distributionConfig = (Distribution -> DistributionConfig)
-> (Distribution -> DistributionConfig -> Distribution)
-> Lens
Distribution Distribution DistributionConfig DistributionConfig
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Distribution' {DistributionConfig
distributionConfig :: DistributionConfig
$sel:distributionConfig:Distribution' :: Distribution -> DistributionConfig
distributionConfig} -> DistributionConfig
distributionConfig) (\s :: Distribution
s@Distribution' {} DistributionConfig
a -> Distribution
s {$sel:distributionConfig:Distribution' :: DistributionConfig
distributionConfig = DistributionConfig
a} :: Distribution)
instance Core.FromXML Distribution where
parseXML :: [Node] -> Either String Distribution
parseXML [Node]
x =
Maybe ActiveTrustedKeyGroups
-> Maybe [AliasICPRecordal]
-> Maybe ActiveTrustedSigners
-> Text
-> Text
-> Text
-> ISO8601
-> Int
-> Text
-> DistributionConfig
-> Distribution
Distribution'
(Maybe ActiveTrustedKeyGroups
-> Maybe [AliasICPRecordal]
-> Maybe ActiveTrustedSigners
-> Text
-> Text
-> Text
-> ISO8601
-> Int
-> Text
-> DistributionConfig
-> Distribution)
-> Either String (Maybe ActiveTrustedKeyGroups)
-> Either
String
(Maybe [AliasICPRecordal]
-> Maybe ActiveTrustedSigners
-> Text
-> Text
-> Text
-> ISO8601
-> Int
-> Text
-> DistributionConfig
-> Distribution)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe ActiveTrustedKeyGroups)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ActiveTrustedKeyGroups")
Either
String
(Maybe [AliasICPRecordal]
-> Maybe ActiveTrustedSigners
-> Text
-> Text
-> Text
-> ISO8601
-> Int
-> Text
-> DistributionConfig
-> Distribution)
-> Either String (Maybe [AliasICPRecordal])
-> Either
String
(Maybe ActiveTrustedSigners
-> Text
-> Text
-> Text
-> ISO8601
-> Int
-> Text
-> DistributionConfig
-> Distribution)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"AliasICPRecordals"
Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
Either String [Node]
-> ([Node] -> Either String (Maybe [AliasICPRecordal]))
-> Either String (Maybe [AliasICPRecordal])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [AliasICPRecordal])
-> [Node] -> Either String (Maybe [AliasICPRecordal])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [AliasICPRecordal]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"AliasICPRecordal")
)
Either
String
(Maybe ActiveTrustedSigners
-> Text
-> Text
-> Text
-> ISO8601
-> Int
-> Text
-> DistributionConfig
-> Distribution)
-> Either String (Maybe ActiveTrustedSigners)
-> Either
String
(Text
-> Text
-> Text
-> ISO8601
-> Int
-> Text
-> DistributionConfig
-> Distribution)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe ActiveTrustedSigners)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ActiveTrustedSigners")
Either
String
(Text
-> Text
-> Text
-> ISO8601
-> Int
-> Text
-> DistributionConfig
-> Distribution)
-> Either String Text
-> Either
String
(Text
-> Text
-> ISO8601
-> Int
-> Text
-> DistributionConfig
-> Distribution)
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
-> Text
-> ISO8601
-> Int
-> Text
-> DistributionConfig
-> Distribution)
-> Either String Text
-> Either
String
(Text
-> ISO8601 -> Int -> Text -> DistributionConfig -> Distribution)
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
"ARN")
Either
String
(Text
-> ISO8601 -> Int -> Text -> DistributionConfig -> Distribution)
-> Either String Text
-> Either
String
(ISO8601 -> Int -> Text -> DistributionConfig -> Distribution)
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
"Status")
Either
String
(ISO8601 -> Int -> Text -> DistributionConfig -> Distribution)
-> Either String ISO8601
-> Either
String (Int -> Text -> DistributionConfig -> Distribution)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String ISO8601
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"LastModifiedTime")
Either String (Int -> Text -> DistributionConfig -> Distribution)
-> Either String Int
-> Either String (Text -> DistributionConfig -> Distribution)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String Int
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"InProgressInvalidationBatches")
Either String (Text -> DistributionConfig -> Distribution)
-> Either String Text
-> Either String (DistributionConfig -> Distribution)
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
"DomainName")
Either String (DistributionConfig -> Distribution)
-> Either String DistributionConfig -> Either String Distribution
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String DistributionConfig
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"DistributionConfig")
instance Prelude.Hashable Distribution
instance Prelude.NFData Distribution