{-# 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.StreamingDistributionConfigWithTags
-- 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.StreamingDistributionConfigWithTags where

import Amazonka.CloudFront.Types.StreamingDistributionConfig
import Amazonka.CloudFront.Types.Tags
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | A streaming distribution Configuration and a list of tags to be
-- associated with the streaming distribution.
--
-- /See:/ 'newStreamingDistributionConfigWithTags' smart constructor.
data StreamingDistributionConfigWithTags = StreamingDistributionConfigWithTags'
  { -- | A streaming distribution Configuration.
    StreamingDistributionConfigWithTags -> StreamingDistributionConfig
streamingDistributionConfig :: StreamingDistributionConfig,
    -- | A complex type that contains zero or more @Tag@ elements.
    StreamingDistributionConfigWithTags -> Tags
tags :: Tags
  }
  deriving (StreamingDistributionConfigWithTags
-> StreamingDistributionConfigWithTags -> Bool
(StreamingDistributionConfigWithTags
 -> StreamingDistributionConfigWithTags -> Bool)
-> (StreamingDistributionConfigWithTags
    -> StreamingDistributionConfigWithTags -> Bool)
-> Eq StreamingDistributionConfigWithTags
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StreamingDistributionConfigWithTags
-> StreamingDistributionConfigWithTags -> Bool
$c/= :: StreamingDistributionConfigWithTags
-> StreamingDistributionConfigWithTags -> Bool
== :: StreamingDistributionConfigWithTags
-> StreamingDistributionConfigWithTags -> Bool
$c== :: StreamingDistributionConfigWithTags
-> StreamingDistributionConfigWithTags -> Bool
Prelude.Eq, ReadPrec [StreamingDistributionConfigWithTags]
ReadPrec StreamingDistributionConfigWithTags
Int -> ReadS StreamingDistributionConfigWithTags
ReadS [StreamingDistributionConfigWithTags]
(Int -> ReadS StreamingDistributionConfigWithTags)
-> ReadS [StreamingDistributionConfigWithTags]
-> ReadPrec StreamingDistributionConfigWithTags
-> ReadPrec [StreamingDistributionConfigWithTags]
-> Read StreamingDistributionConfigWithTags
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StreamingDistributionConfigWithTags]
$creadListPrec :: ReadPrec [StreamingDistributionConfigWithTags]
readPrec :: ReadPrec StreamingDistributionConfigWithTags
$creadPrec :: ReadPrec StreamingDistributionConfigWithTags
readList :: ReadS [StreamingDistributionConfigWithTags]
$creadList :: ReadS [StreamingDistributionConfigWithTags]
readsPrec :: Int -> ReadS StreamingDistributionConfigWithTags
$creadsPrec :: Int -> ReadS StreamingDistributionConfigWithTags
Prelude.Read, Int -> StreamingDistributionConfigWithTags -> ShowS
[StreamingDistributionConfigWithTags] -> ShowS
StreamingDistributionConfigWithTags -> String
(Int -> StreamingDistributionConfigWithTags -> ShowS)
-> (StreamingDistributionConfigWithTags -> String)
-> ([StreamingDistributionConfigWithTags] -> ShowS)
-> Show StreamingDistributionConfigWithTags
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StreamingDistributionConfigWithTags] -> ShowS
$cshowList :: [StreamingDistributionConfigWithTags] -> ShowS
show :: StreamingDistributionConfigWithTags -> String
$cshow :: StreamingDistributionConfigWithTags -> String
showsPrec :: Int -> StreamingDistributionConfigWithTags -> ShowS
$cshowsPrec :: Int -> StreamingDistributionConfigWithTags -> ShowS
Prelude.Show, (forall x.
 StreamingDistributionConfigWithTags
 -> Rep StreamingDistributionConfigWithTags x)
-> (forall x.
    Rep StreamingDistributionConfigWithTags x
    -> StreamingDistributionConfigWithTags)
-> Generic StreamingDistributionConfigWithTags
forall x.
Rep StreamingDistributionConfigWithTags x
-> StreamingDistributionConfigWithTags
forall x.
StreamingDistributionConfigWithTags
-> Rep StreamingDistributionConfigWithTags x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StreamingDistributionConfigWithTags x
-> StreamingDistributionConfigWithTags
$cfrom :: forall x.
StreamingDistributionConfigWithTags
-> Rep StreamingDistributionConfigWithTags x
Prelude.Generic)

-- |
-- Create a value of 'StreamingDistributionConfigWithTags' 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:
--
-- 'streamingDistributionConfig', 'streamingDistributionConfigWithTags_streamingDistributionConfig' - A streaming distribution Configuration.
--
-- 'tags', 'streamingDistributionConfigWithTags_tags' - A complex type that contains zero or more @Tag@ elements.
newStreamingDistributionConfigWithTags ::
  -- | 'streamingDistributionConfig'
  StreamingDistributionConfig ->
  -- | 'tags'
  Tags ->
  StreamingDistributionConfigWithTags
newStreamingDistributionConfigWithTags :: StreamingDistributionConfig
-> Tags -> StreamingDistributionConfigWithTags
newStreamingDistributionConfigWithTags
  StreamingDistributionConfig
pStreamingDistributionConfig_
  Tags
pTags_ =
    StreamingDistributionConfigWithTags' :: StreamingDistributionConfig
-> Tags -> StreamingDistributionConfigWithTags
StreamingDistributionConfigWithTags'
      { $sel:streamingDistributionConfig:StreamingDistributionConfigWithTags' :: StreamingDistributionConfig
streamingDistributionConfig =
          StreamingDistributionConfig
pStreamingDistributionConfig_,
        $sel:tags:StreamingDistributionConfigWithTags' :: Tags
tags = Tags
pTags_
      }

-- | A streaming distribution Configuration.
streamingDistributionConfigWithTags_streamingDistributionConfig :: Lens.Lens' StreamingDistributionConfigWithTags StreamingDistributionConfig
streamingDistributionConfigWithTags_streamingDistributionConfig :: (StreamingDistributionConfig -> f StreamingDistributionConfig)
-> StreamingDistributionConfigWithTags
-> f StreamingDistributionConfigWithTags
streamingDistributionConfigWithTags_streamingDistributionConfig = (StreamingDistributionConfigWithTags
 -> StreamingDistributionConfig)
-> (StreamingDistributionConfigWithTags
    -> StreamingDistributionConfig
    -> StreamingDistributionConfigWithTags)
-> Lens
     StreamingDistributionConfigWithTags
     StreamingDistributionConfigWithTags
     StreamingDistributionConfig
     StreamingDistributionConfig
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamingDistributionConfigWithTags' {StreamingDistributionConfig
streamingDistributionConfig :: StreamingDistributionConfig
$sel:streamingDistributionConfig:StreamingDistributionConfigWithTags' :: StreamingDistributionConfigWithTags -> StreamingDistributionConfig
streamingDistributionConfig} -> StreamingDistributionConfig
streamingDistributionConfig) (\s :: StreamingDistributionConfigWithTags
s@StreamingDistributionConfigWithTags' {} StreamingDistributionConfig
a -> StreamingDistributionConfigWithTags
s {$sel:streamingDistributionConfig:StreamingDistributionConfigWithTags' :: StreamingDistributionConfig
streamingDistributionConfig = StreamingDistributionConfig
a} :: StreamingDistributionConfigWithTags)

-- | A complex type that contains zero or more @Tag@ elements.
streamingDistributionConfigWithTags_tags :: Lens.Lens' StreamingDistributionConfigWithTags Tags
streamingDistributionConfigWithTags_tags :: (Tags -> f Tags)
-> StreamingDistributionConfigWithTags
-> f StreamingDistributionConfigWithTags
streamingDistributionConfigWithTags_tags = (StreamingDistributionConfigWithTags -> Tags)
-> (StreamingDistributionConfigWithTags
    -> Tags -> StreamingDistributionConfigWithTags)
-> Lens
     StreamingDistributionConfigWithTags
     StreamingDistributionConfigWithTags
     Tags
     Tags
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamingDistributionConfigWithTags' {Tags
tags :: Tags
$sel:tags:StreamingDistributionConfigWithTags' :: StreamingDistributionConfigWithTags -> Tags
tags} -> Tags
tags) (\s :: StreamingDistributionConfigWithTags
s@StreamingDistributionConfigWithTags' {} Tags
a -> StreamingDistributionConfigWithTags
s {$sel:tags:StreamingDistributionConfigWithTags' :: Tags
tags = Tags
a} :: StreamingDistributionConfigWithTags)

instance
  Prelude.Hashable
    StreamingDistributionConfigWithTags

instance
  Prelude.NFData
    StreamingDistributionConfigWithTags

instance
  Core.ToXML
    StreamingDistributionConfigWithTags
  where
  toXML :: StreamingDistributionConfigWithTags -> XML
toXML StreamingDistributionConfigWithTags' {Tags
StreamingDistributionConfig
tags :: Tags
streamingDistributionConfig :: StreamingDistributionConfig
$sel:tags:StreamingDistributionConfigWithTags' :: StreamingDistributionConfigWithTags -> Tags
$sel:streamingDistributionConfig:StreamingDistributionConfigWithTags' :: StreamingDistributionConfigWithTags -> StreamingDistributionConfig
..} =
    [XML] -> XML
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ Name
"StreamingDistributionConfig"
          Name -> StreamingDistributionConfig -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= StreamingDistributionConfig
streamingDistributionConfig,
        Name
"Tags" Name -> Tags -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Tags
tags
      ]