{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.CloudFront.Types.StreamingDistributionConfig
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
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

-- | The RTMP distribution\'s configuration information.
--
-- /See:/ 'newStreamingDistributionConfig' smart constructor.
data StreamingDistributionConfig = StreamingDistributionConfig'
  { -- | A complex type that contains information about CNAMEs (alternate domain
    -- names), if any, for this streaming distribution.
    StreamingDistributionConfig -> Maybe Aliases
aliases :: Prelude.Maybe Aliases,
    -- | A complex type that contains information about price class for this
    -- streaming distribution.
    StreamingDistributionConfig -> Maybe PriceClass
priceClass :: Prelude.Maybe PriceClass,
    -- | A complex type that controls whether access logs are written for the
    -- streaming distribution.
    StreamingDistributionConfig -> Maybe StreamingLoggingConfig
logging :: Prelude.Maybe StreamingLoggingConfig,
    -- | A unique value (for example, a date-time stamp) that ensures that the
    -- request can\'t be replayed.
    --
    -- If the value of @CallerReference@ is new (regardless of the content of
    -- the @StreamingDistributionConfig@ object), CloudFront creates a new
    -- distribution.
    --
    -- If @CallerReference@ is a value that you already sent in a previous
    -- request to create a distribution, CloudFront returns a
    -- @DistributionAlreadyExists@ error.
    StreamingDistributionConfig -> Text
callerReference :: Prelude.Text,
    -- | A complex type that contains information about the Amazon S3 bucket from
    -- which you want CloudFront to get your media files for distribution.
    StreamingDistributionConfig -> S3Origin
s3Origin :: S3Origin,
    -- | Any comments you want to include about the streaming distribution.
    StreamingDistributionConfig -> Text
comment :: Prelude.Text,
    -- | A complex type that specifies any accounts that you want to permit to
    -- create signed URLs for private content. If you want the distribution to
    -- use signed URLs, include this element; if you want the distribution to
    -- use public URLs, remove this element. For more information, see
    -- <https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html Serving Private Content through CloudFront>
    -- in the /Amazon CloudFront Developer Guide/.
    StreamingDistributionConfig -> TrustedSigners
trustedSigners :: TrustedSigners,
    -- | Whether the streaming distribution is enabled to accept user requests
    -- for content.
    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)

-- |
-- Create a value of 'StreamingDistributionConfig' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'aliases', 'streamingDistributionConfig_aliases' - A complex type that contains information about CNAMEs (alternate domain
-- names), if any, for this streaming distribution.
--
-- 'priceClass', 'streamingDistributionConfig_priceClass' - A complex type that contains information about price class for this
-- streaming distribution.
--
-- 'logging', 'streamingDistributionConfig_logging' - A complex type that controls whether access logs are written for the
-- streaming distribution.
--
-- 'callerReference', 'streamingDistributionConfig_callerReference' - A unique value (for example, a date-time stamp) that ensures that the
-- request can\'t be replayed.
--
-- If the value of @CallerReference@ is new (regardless of the content of
-- the @StreamingDistributionConfig@ object), CloudFront creates a new
-- distribution.
--
-- If @CallerReference@ is a value that you already sent in a previous
-- request to create a distribution, CloudFront returns a
-- @DistributionAlreadyExists@ error.
--
-- 's3Origin', 'streamingDistributionConfig_s3Origin' - A complex type that contains information about the Amazon S3 bucket from
-- which you want CloudFront to get your media files for distribution.
--
-- 'comment', 'streamingDistributionConfig_comment' - Any comments you want to include about the streaming distribution.
--
-- 'trustedSigners', 'streamingDistributionConfig_trustedSigners' - A complex type that specifies any accounts that you want to permit to
-- create signed URLs for private content. If you want the distribution to
-- use signed URLs, include this element; if you want the distribution to
-- use public URLs, remove this element. For more information, see
-- <https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html Serving Private Content through CloudFront>
-- in the /Amazon CloudFront Developer Guide/.
--
-- 'enabled', 'streamingDistributionConfig_enabled' - Whether the streaming distribution is enabled to accept user requests
-- for content.
newStreamingDistributionConfig ::
  -- | 'callerReference'
  Prelude.Text ->
  -- | 's3Origin'
  S3Origin ->
  -- | 'comment'
  Prelude.Text ->
  -- | 'trustedSigners'
  TrustedSigners ->
  -- | 'enabled'
  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_
      }

-- | A complex type that contains information about CNAMEs (alternate domain
-- names), if any, for this streaming distribution.
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)

-- | A complex type that contains information about price class for this
-- streaming distribution.
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)

-- | A complex type that controls whether access logs are written for the
-- streaming distribution.
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)

-- | A unique value (for example, a date-time stamp) that ensures that the
-- request can\'t be replayed.
--
-- If the value of @CallerReference@ is new (regardless of the content of
-- the @StreamingDistributionConfig@ object), CloudFront creates a new
-- distribution.
--
-- If @CallerReference@ is a value that you already sent in a previous
-- request to create a distribution, CloudFront returns a
-- @DistributionAlreadyExists@ error.
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)

-- | A complex type that contains information about the Amazon S3 bucket from
-- which you want CloudFront to get your media files for distribution.
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)

-- | Any comments you want to include about the streaming distribution.
streamingDistributionConfig_comment :: Lens.Lens' StreamingDistributionConfig Prelude.Text
streamingDistributionConfig_comment :: (Text -> f Text)
-> StreamingDistributionConfig -> f StreamingDistributionConfig
streamingDistributionConfig_comment = (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)

-- | A complex type that specifies any accounts that you want to permit to
-- create signed URLs for private content. If you want the distribution to
-- use signed URLs, include this element; if you want the distribution to
-- use public URLs, remove this element. For more information, see
-- <https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html Serving Private Content through CloudFront>
-- in the /Amazon CloudFront Developer Guide/.
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)

-- | Whether the streaming distribution is enabled to accept user requests
-- for content.
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
      ]