{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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.
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'
      { $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 :: Lens'
  StreamingDistributionConfigWithTags StreamingDistributionConfig
streamingDistributionConfigWithTags_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 :: Lens' StreamingDistributionConfigWithTags Tags
streamingDistributionConfigWithTags_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
  where
  hashWithSalt :: Int -> StreamingDistributionConfigWithTags -> Int
hashWithSalt
    Int
_salt
    StreamingDistributionConfigWithTags' {Tags
StreamingDistributionConfig
tags :: Tags
streamingDistributionConfig :: StreamingDistributionConfig
$sel:tags:StreamingDistributionConfigWithTags' :: StreamingDistributionConfigWithTags -> Tags
$sel:streamingDistributionConfig:StreamingDistributionConfigWithTags' :: StreamingDistributionConfigWithTags -> StreamingDistributionConfig
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` StreamingDistributionConfig
streamingDistributionConfig
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Tags
tags

instance
  Prelude.NFData
    StreamingDistributionConfigWithTags
  where
  rnf :: StreamingDistributionConfigWithTags -> ()
rnf StreamingDistributionConfigWithTags' {Tags
StreamingDistributionConfig
tags :: Tags
streamingDistributionConfig :: StreamingDistributionConfig
$sel:tags:StreamingDistributionConfigWithTags' :: StreamingDistributionConfigWithTags -> Tags
$sel:streamingDistributionConfig:StreamingDistributionConfigWithTags' :: StreamingDistributionConfigWithTags -> StreamingDistributionConfig
..} =
    forall a. NFData a => a -> ()
Prelude.rnf StreamingDistributionConfig
streamingDistributionConfig
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Tags
tags

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