{-# 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.StreamingDistributionConfig where
import Amazonka.CloudFront.Types.Aliases
import Amazonka.CloudFront.Types.PriceClass
import Amazonka.CloudFront.Types.S3Origin
import Amazonka.CloudFront.Types.StreamingLoggingConfig
import Amazonka.CloudFront.Types.TrustedSigners
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data StreamingDistributionConfig = StreamingDistributionConfig'
{
StreamingDistributionConfig -> Maybe Aliases
aliases :: Prelude.Maybe Aliases,
StreamingDistributionConfig -> Maybe PriceClass
priceClass :: Prelude.Maybe PriceClass,
StreamingDistributionConfig -> Maybe StreamingLoggingConfig
logging :: Prelude.Maybe StreamingLoggingConfig,
StreamingDistributionConfig -> Text
callerReference :: Prelude.Text,
StreamingDistributionConfig -> S3Origin
s3Origin :: S3Origin,
:: Prelude.Text,
StreamingDistributionConfig -> TrustedSigners
trustedSigners :: TrustedSigners,
StreamingDistributionConfig -> Bool
enabled :: Prelude.Bool
}
deriving (StreamingDistributionConfig -> StreamingDistributionConfig -> Bool
(StreamingDistributionConfig
-> StreamingDistributionConfig -> Bool)
-> (StreamingDistributionConfig
-> StreamingDistributionConfig -> Bool)
-> Eq StreamingDistributionConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StreamingDistributionConfig -> StreamingDistributionConfig -> Bool
$c/= :: StreamingDistributionConfig -> StreamingDistributionConfig -> Bool
== :: StreamingDistributionConfig -> StreamingDistributionConfig -> Bool
$c== :: StreamingDistributionConfig -> StreamingDistributionConfig -> Bool
Prelude.Eq, ReadPrec [StreamingDistributionConfig]
ReadPrec StreamingDistributionConfig
Int -> ReadS StreamingDistributionConfig
ReadS [StreamingDistributionConfig]
(Int -> ReadS StreamingDistributionConfig)
-> ReadS [StreamingDistributionConfig]
-> ReadPrec StreamingDistributionConfig
-> ReadPrec [StreamingDistributionConfig]
-> Read StreamingDistributionConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StreamingDistributionConfig]
$creadListPrec :: ReadPrec [StreamingDistributionConfig]
readPrec :: ReadPrec StreamingDistributionConfig
$creadPrec :: ReadPrec StreamingDistributionConfig
readList :: ReadS [StreamingDistributionConfig]
$creadList :: ReadS [StreamingDistributionConfig]
readsPrec :: Int -> ReadS StreamingDistributionConfig
$creadsPrec :: Int -> ReadS StreamingDistributionConfig
Prelude.Read, Int -> StreamingDistributionConfig -> ShowS
[StreamingDistributionConfig] -> ShowS
StreamingDistributionConfig -> String
(Int -> StreamingDistributionConfig -> ShowS)
-> (StreamingDistributionConfig -> String)
-> ([StreamingDistributionConfig] -> ShowS)
-> Show StreamingDistributionConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StreamingDistributionConfig] -> ShowS
$cshowList :: [StreamingDistributionConfig] -> ShowS
show :: StreamingDistributionConfig -> String
$cshow :: StreamingDistributionConfig -> String
showsPrec :: Int -> StreamingDistributionConfig -> ShowS
$cshowsPrec :: Int -> StreamingDistributionConfig -> ShowS
Prelude.Show, (forall x.
StreamingDistributionConfig -> Rep StreamingDistributionConfig x)
-> (forall x.
Rep StreamingDistributionConfig x -> StreamingDistributionConfig)
-> Generic StreamingDistributionConfig
forall x.
Rep StreamingDistributionConfig x -> StreamingDistributionConfig
forall x.
StreamingDistributionConfig -> Rep StreamingDistributionConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StreamingDistributionConfig x -> StreamingDistributionConfig
$cfrom :: forall x.
StreamingDistributionConfig -> Rep StreamingDistributionConfig x
Prelude.Generic)
newStreamingDistributionConfig ::
Prelude.Text ->
S3Origin ->
Prelude.Text ->
TrustedSigners ->
Prelude.Bool ->
StreamingDistributionConfig
newStreamingDistributionConfig :: Text
-> S3Origin
-> Text
-> TrustedSigners
-> Bool
-> StreamingDistributionConfig
newStreamingDistributionConfig
Text
pCallerReference_
S3Origin
pS3Origin_
Text
pComment_
TrustedSigners
pTrustedSigners_
Bool
pEnabled_ =
StreamingDistributionConfig' :: Maybe Aliases
-> Maybe PriceClass
-> Maybe StreamingLoggingConfig
-> Text
-> S3Origin
-> Text
-> TrustedSigners
-> Bool
-> StreamingDistributionConfig
StreamingDistributionConfig'
{ $sel:aliases:StreamingDistributionConfig' :: Maybe Aliases
aliases =
Maybe Aliases
forall a. Maybe a
Prelude.Nothing,
$sel:priceClass:StreamingDistributionConfig' :: Maybe PriceClass
priceClass = Maybe PriceClass
forall a. Maybe a
Prelude.Nothing,
$sel:logging:StreamingDistributionConfig' :: Maybe StreamingLoggingConfig
logging = Maybe StreamingLoggingConfig
forall a. Maybe a
Prelude.Nothing,
$sel:callerReference:StreamingDistributionConfig' :: Text
callerReference = Text
pCallerReference_,
$sel:s3Origin:StreamingDistributionConfig' :: S3Origin
s3Origin = S3Origin
pS3Origin_,
$sel:comment:StreamingDistributionConfig' :: Text
comment = Text
pComment_,
$sel:trustedSigners:StreamingDistributionConfig' :: TrustedSigners
trustedSigners = TrustedSigners
pTrustedSigners_,
$sel:enabled:StreamingDistributionConfig' :: Bool
enabled = Bool
pEnabled_
}
streamingDistributionConfig_aliases :: Lens.Lens' StreamingDistributionConfig (Prelude.Maybe Aliases)
streamingDistributionConfig_aliases :: (Maybe Aliases -> f (Maybe Aliases))
-> StreamingDistributionConfig -> f StreamingDistributionConfig
streamingDistributionConfig_aliases = (StreamingDistributionConfig -> Maybe Aliases)
-> (StreamingDistributionConfig
-> Maybe Aliases -> StreamingDistributionConfig)
-> Lens
StreamingDistributionConfig
StreamingDistributionConfig
(Maybe Aliases)
(Maybe Aliases)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamingDistributionConfig' {Maybe Aliases
aliases :: Maybe Aliases
$sel:aliases:StreamingDistributionConfig' :: StreamingDistributionConfig -> Maybe Aliases
aliases} -> Maybe Aliases
aliases) (\s :: StreamingDistributionConfig
s@StreamingDistributionConfig' {} Maybe Aliases
a -> StreamingDistributionConfig
s {$sel:aliases:StreamingDistributionConfig' :: Maybe Aliases
aliases = Maybe Aliases
a} :: StreamingDistributionConfig)
streamingDistributionConfig_priceClass :: Lens.Lens' StreamingDistributionConfig (Prelude.Maybe PriceClass)
streamingDistributionConfig_priceClass :: (Maybe PriceClass -> f (Maybe PriceClass))
-> StreamingDistributionConfig -> f StreamingDistributionConfig
streamingDistributionConfig_priceClass = (StreamingDistributionConfig -> Maybe PriceClass)
-> (StreamingDistributionConfig
-> Maybe PriceClass -> StreamingDistributionConfig)
-> Lens
StreamingDistributionConfig
StreamingDistributionConfig
(Maybe PriceClass)
(Maybe PriceClass)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamingDistributionConfig' {Maybe PriceClass
priceClass :: Maybe PriceClass
$sel:priceClass:StreamingDistributionConfig' :: StreamingDistributionConfig -> Maybe PriceClass
priceClass} -> Maybe PriceClass
priceClass) (\s :: StreamingDistributionConfig
s@StreamingDistributionConfig' {} Maybe PriceClass
a -> StreamingDistributionConfig
s {$sel:priceClass:StreamingDistributionConfig' :: Maybe PriceClass
priceClass = Maybe PriceClass
a} :: StreamingDistributionConfig)
streamingDistributionConfig_logging :: Lens.Lens' StreamingDistributionConfig (Prelude.Maybe StreamingLoggingConfig)
streamingDistributionConfig_logging :: (Maybe StreamingLoggingConfig -> f (Maybe StreamingLoggingConfig))
-> StreamingDistributionConfig -> f StreamingDistributionConfig
streamingDistributionConfig_logging = (StreamingDistributionConfig -> Maybe StreamingLoggingConfig)
-> (StreamingDistributionConfig
-> Maybe StreamingLoggingConfig -> StreamingDistributionConfig)
-> Lens
StreamingDistributionConfig
StreamingDistributionConfig
(Maybe StreamingLoggingConfig)
(Maybe StreamingLoggingConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamingDistributionConfig' {Maybe StreamingLoggingConfig
logging :: Maybe StreamingLoggingConfig
$sel:logging:StreamingDistributionConfig' :: StreamingDistributionConfig -> Maybe StreamingLoggingConfig
logging} -> Maybe StreamingLoggingConfig
logging) (\s :: StreamingDistributionConfig
s@StreamingDistributionConfig' {} Maybe StreamingLoggingConfig
a -> StreamingDistributionConfig
s {$sel:logging:StreamingDistributionConfig' :: Maybe StreamingLoggingConfig
logging = Maybe StreamingLoggingConfig
a} :: StreamingDistributionConfig)
streamingDistributionConfig_callerReference :: Lens.Lens' StreamingDistributionConfig Prelude.Text
streamingDistributionConfig_callerReference :: (Text -> f Text)
-> StreamingDistributionConfig -> f StreamingDistributionConfig
streamingDistributionConfig_callerReference = (StreamingDistributionConfig -> Text)
-> (StreamingDistributionConfig
-> Text -> StreamingDistributionConfig)
-> Lens
StreamingDistributionConfig StreamingDistributionConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamingDistributionConfig' {Text
callerReference :: Text
$sel:callerReference:StreamingDistributionConfig' :: StreamingDistributionConfig -> Text
callerReference} -> Text
callerReference) (\s :: StreamingDistributionConfig
s@StreamingDistributionConfig' {} Text
a -> StreamingDistributionConfig
s {$sel:callerReference:StreamingDistributionConfig' :: Text
callerReference = Text
a} :: StreamingDistributionConfig)
streamingDistributionConfig_s3Origin :: Lens.Lens' StreamingDistributionConfig S3Origin
streamingDistributionConfig_s3Origin :: (S3Origin -> f S3Origin)
-> StreamingDistributionConfig -> f StreamingDistributionConfig
streamingDistributionConfig_s3Origin = (StreamingDistributionConfig -> S3Origin)
-> (StreamingDistributionConfig
-> S3Origin -> StreamingDistributionConfig)
-> Lens
StreamingDistributionConfig
StreamingDistributionConfig
S3Origin
S3Origin
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamingDistributionConfig' {S3Origin
s3Origin :: S3Origin
$sel:s3Origin:StreamingDistributionConfig' :: StreamingDistributionConfig -> S3Origin
s3Origin} -> S3Origin
s3Origin) (\s :: StreamingDistributionConfig
s@StreamingDistributionConfig' {} S3Origin
a -> StreamingDistributionConfig
s {$sel:s3Origin:StreamingDistributionConfig' :: S3Origin
s3Origin = S3Origin
a} :: StreamingDistributionConfig)
streamingDistributionConfig_comment :: Lens.Lens' StreamingDistributionConfig Prelude.Text
= (StreamingDistributionConfig -> Text)
-> (StreamingDistributionConfig
-> Text -> StreamingDistributionConfig)
-> Lens
StreamingDistributionConfig StreamingDistributionConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamingDistributionConfig' {Text
comment :: Text
$sel:comment:StreamingDistributionConfig' :: StreamingDistributionConfig -> Text
comment} -> Text
comment) (\s :: StreamingDistributionConfig
s@StreamingDistributionConfig' {} Text
a -> StreamingDistributionConfig
s {$sel:comment:StreamingDistributionConfig' :: Text
comment = Text
a} :: StreamingDistributionConfig)
streamingDistributionConfig_trustedSigners :: Lens.Lens' StreamingDistributionConfig TrustedSigners
streamingDistributionConfig_trustedSigners :: (TrustedSigners -> f TrustedSigners)
-> StreamingDistributionConfig -> f StreamingDistributionConfig
streamingDistributionConfig_trustedSigners = (StreamingDistributionConfig -> TrustedSigners)
-> (StreamingDistributionConfig
-> TrustedSigners -> StreamingDistributionConfig)
-> Lens
StreamingDistributionConfig
StreamingDistributionConfig
TrustedSigners
TrustedSigners
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamingDistributionConfig' {TrustedSigners
trustedSigners :: TrustedSigners
$sel:trustedSigners:StreamingDistributionConfig' :: StreamingDistributionConfig -> TrustedSigners
trustedSigners} -> TrustedSigners
trustedSigners) (\s :: StreamingDistributionConfig
s@StreamingDistributionConfig' {} TrustedSigners
a -> StreamingDistributionConfig
s {$sel:trustedSigners:StreamingDistributionConfig' :: TrustedSigners
trustedSigners = TrustedSigners
a} :: StreamingDistributionConfig)
streamingDistributionConfig_enabled :: Lens.Lens' StreamingDistributionConfig Prelude.Bool
streamingDistributionConfig_enabled :: (Bool -> f Bool)
-> StreamingDistributionConfig -> f StreamingDistributionConfig
streamingDistributionConfig_enabled = (StreamingDistributionConfig -> Bool)
-> (StreamingDistributionConfig
-> Bool -> StreamingDistributionConfig)
-> Lens
StreamingDistributionConfig StreamingDistributionConfig Bool Bool
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamingDistributionConfig' {Bool
enabled :: Bool
$sel:enabled:StreamingDistributionConfig' :: StreamingDistributionConfig -> Bool
enabled} -> Bool
enabled) (\s :: StreamingDistributionConfig
s@StreamingDistributionConfig' {} Bool
a -> StreamingDistributionConfig
s {$sel:enabled:StreamingDistributionConfig' :: Bool
enabled = Bool
a} :: StreamingDistributionConfig)
instance Core.FromXML StreamingDistributionConfig where
parseXML :: [Node] -> Either String StreamingDistributionConfig
parseXML [Node]
x =
Maybe Aliases
-> Maybe PriceClass
-> Maybe StreamingLoggingConfig
-> Text
-> S3Origin
-> Text
-> TrustedSigners
-> Bool
-> StreamingDistributionConfig
StreamingDistributionConfig'
(Maybe Aliases
-> Maybe PriceClass
-> Maybe StreamingLoggingConfig
-> Text
-> S3Origin
-> Text
-> TrustedSigners
-> Bool
-> StreamingDistributionConfig)
-> Either String (Maybe Aliases)
-> Either
String
(Maybe PriceClass
-> Maybe StreamingLoggingConfig
-> Text
-> S3Origin
-> Text
-> TrustedSigners
-> Bool
-> StreamingDistributionConfig)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Aliases)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Aliases")
Either
String
(Maybe PriceClass
-> Maybe StreamingLoggingConfig
-> Text
-> S3Origin
-> Text
-> TrustedSigners
-> Bool
-> StreamingDistributionConfig)
-> Either String (Maybe PriceClass)
-> Either
String
(Maybe StreamingLoggingConfig
-> Text
-> S3Origin
-> Text
-> TrustedSigners
-> Bool
-> StreamingDistributionConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe PriceClass)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"PriceClass")
Either
String
(Maybe StreamingLoggingConfig
-> Text
-> S3Origin
-> Text
-> TrustedSigners
-> Bool
-> StreamingDistributionConfig)
-> Either String (Maybe StreamingLoggingConfig)
-> Either
String
(Text
-> S3Origin
-> Text
-> TrustedSigners
-> Bool
-> StreamingDistributionConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe StreamingLoggingConfig)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Logging")
Either
String
(Text
-> S3Origin
-> Text
-> TrustedSigners
-> Bool
-> StreamingDistributionConfig)
-> Either String Text
-> Either
String
(S3Origin
-> Text -> TrustedSigners -> Bool -> StreamingDistributionConfig)
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
"CallerReference")
Either
String
(S3Origin
-> Text -> TrustedSigners -> Bool -> StreamingDistributionConfig)
-> Either String S3Origin
-> Either
String
(Text -> TrustedSigners -> Bool -> StreamingDistributionConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String S3Origin
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"S3Origin")
Either
String
(Text -> TrustedSigners -> Bool -> StreamingDistributionConfig)
-> Either String Text
-> Either
String (TrustedSigners -> Bool -> StreamingDistributionConfig)
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")
Either
String (TrustedSigners -> Bool -> StreamingDistributionConfig)
-> Either String TrustedSigners
-> Either String (Bool -> StreamingDistributionConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String TrustedSigners
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"TrustedSigners")
Either String (Bool -> StreamingDistributionConfig)
-> Either String Bool -> Either String StreamingDistributionConfig
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String Bool
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"Enabled")
instance Prelude.Hashable StreamingDistributionConfig
instance Prelude.NFData StreamingDistributionConfig
instance Core.ToXML StreamingDistributionConfig where
toXML :: StreamingDistributionConfig -> XML
toXML StreamingDistributionConfig' {Bool
Maybe Aliases
Maybe PriceClass
Maybe StreamingLoggingConfig
Text
S3Origin
TrustedSigners
enabled :: Bool
trustedSigners :: TrustedSigners
comment :: Text
s3Origin :: S3Origin
callerReference :: Text
logging :: Maybe StreamingLoggingConfig
priceClass :: Maybe PriceClass
aliases :: Maybe Aliases
$sel:enabled:StreamingDistributionConfig' :: StreamingDistributionConfig -> Bool
$sel:trustedSigners:StreamingDistributionConfig' :: StreamingDistributionConfig -> TrustedSigners
$sel:comment:StreamingDistributionConfig' :: StreamingDistributionConfig -> Text
$sel:s3Origin:StreamingDistributionConfig' :: StreamingDistributionConfig -> S3Origin
$sel:callerReference:StreamingDistributionConfig' :: StreamingDistributionConfig -> Text
$sel:logging:StreamingDistributionConfig' :: StreamingDistributionConfig -> Maybe StreamingLoggingConfig
$sel:priceClass:StreamingDistributionConfig' :: StreamingDistributionConfig -> Maybe PriceClass
$sel:aliases:StreamingDistributionConfig' :: StreamingDistributionConfig -> Maybe Aliases
..} =
[XML] -> XML
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ Name
"Aliases" Name -> Maybe Aliases -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Maybe Aliases
aliases,
Name
"PriceClass" Name -> Maybe PriceClass -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Maybe PriceClass
priceClass,
Name
"Logging" Name -> Maybe StreamingLoggingConfig -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Maybe StreamingLoggingConfig
logging,
Name
"CallerReference" Name -> Text -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Text
callerReference,
Name
"S3Origin" Name -> S3Origin -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= S3Origin
s3Origin,
Name
"Comment" Name -> Text -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Text
comment,
Name
"TrustedSigners" Name -> TrustedSigners -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= TrustedSigners
trustedSigners,
Name
"Enabled" Name -> Bool -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Bool
enabled
]