{-# 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.MediaLive.Types.AudioDescription
-- 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.MediaLive.Types.AudioDescription where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaLive.Types.AudioCodecSettings
import Amazonka.MediaLive.Types.AudioDescriptionAudioTypeControl
import Amazonka.MediaLive.Types.AudioDescriptionLanguageCodeControl
import Amazonka.MediaLive.Types.AudioNormalizationSettings
import Amazonka.MediaLive.Types.AudioType
import Amazonka.MediaLive.Types.AudioWatermarkSettings
import Amazonka.MediaLive.Types.RemixSettings
import qualified Amazonka.Prelude as Prelude

-- | Audio Description
--
-- /See:/ 'newAudioDescription' smart constructor.
data AudioDescription = AudioDescription'
  { -- | RFC 5646 language code representing the language of the audio output
    -- track. Only used if languageControlMode is useConfigured, or there is no
    -- ISO 639 language code specified in the input.
    AudioDescription -> Maybe Text
languageCode :: Prelude.Maybe Prelude.Text,
    -- | Applies only if audioTypeControl is useConfigured. The values for
    -- audioType are defined in ISO-IEC 13818-1.
    AudioDescription -> Maybe AudioType
audioType :: Prelude.Maybe AudioType,
    -- | Advanced audio normalization settings.
    AudioDescription -> Maybe AudioNormalizationSettings
audioNormalizationSettings :: Prelude.Maybe AudioNormalizationSettings,
    -- | Choosing followInput will cause the ISO 639 language code of the output
    -- to follow the ISO 639 language code of the input. The languageCode will
    -- be used when useConfigured is set, or when followInput is selected but
    -- there is no ISO 639 language code specified by the input.
    AudioDescription -> Maybe AudioDescriptionLanguageCodeControl
languageCodeControl :: Prelude.Maybe AudioDescriptionLanguageCodeControl,
    -- | Audio codec settings.
    AudioDescription -> Maybe AudioCodecSettings
codecSettings :: Prelude.Maybe AudioCodecSettings,
    -- | Settings to configure one or more solutions that insert audio watermarks
    -- in the audio encode
    AudioDescription -> Maybe AudioWatermarkSettings
audioWatermarkingSettings :: Prelude.Maybe AudioWatermarkSettings,
    -- | Used for MS Smooth and Apple HLS outputs. Indicates the name displayed
    -- by the player (eg. English, or Director Commentary).
    AudioDescription -> Maybe Text
streamName :: Prelude.Maybe Prelude.Text,
    -- | Settings that control how input audio channels are remixed into the
    -- output audio channels.
    AudioDescription -> Maybe RemixSettings
remixSettings :: Prelude.Maybe RemixSettings,
    -- | Determines how audio type is determined. followInput: If the input
    -- contains an ISO 639 audioType, then that value is passed through to the
    -- output. If the input contains no ISO 639 audioType, the value in Audio
    -- Type is included in the output. useConfigured: The value in Audio Type
    -- is included in the output. Note that this field and audioType are both
    -- ignored if inputType is broadcasterMixedAd.
    AudioDescription -> Maybe AudioDescriptionAudioTypeControl
audioTypeControl :: Prelude.Maybe AudioDescriptionAudioTypeControl,
    -- | The name of the AudioSelector used as the source for this
    -- AudioDescription.
    AudioDescription -> Text
audioSelectorName :: Prelude.Text,
    -- | The name of this AudioDescription. Outputs will use this name to
    -- uniquely identify this AudioDescription. Description names should be
    -- unique within this Live Event.
    AudioDescription -> Text
name :: Prelude.Text
  }
  deriving (AudioDescription -> AudioDescription -> Bool
(AudioDescription -> AudioDescription -> Bool)
-> (AudioDescription -> AudioDescription -> Bool)
-> Eq AudioDescription
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AudioDescription -> AudioDescription -> Bool
$c/= :: AudioDescription -> AudioDescription -> Bool
== :: AudioDescription -> AudioDescription -> Bool
$c== :: AudioDescription -> AudioDescription -> Bool
Prelude.Eq, ReadPrec [AudioDescription]
ReadPrec AudioDescription
Int -> ReadS AudioDescription
ReadS [AudioDescription]
(Int -> ReadS AudioDescription)
-> ReadS [AudioDescription]
-> ReadPrec AudioDescription
-> ReadPrec [AudioDescription]
-> Read AudioDescription
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AudioDescription]
$creadListPrec :: ReadPrec [AudioDescription]
readPrec :: ReadPrec AudioDescription
$creadPrec :: ReadPrec AudioDescription
readList :: ReadS [AudioDescription]
$creadList :: ReadS [AudioDescription]
readsPrec :: Int -> ReadS AudioDescription
$creadsPrec :: Int -> ReadS AudioDescription
Prelude.Read, Int -> AudioDescription -> ShowS
[AudioDescription] -> ShowS
AudioDescription -> String
(Int -> AudioDescription -> ShowS)
-> (AudioDescription -> String)
-> ([AudioDescription] -> ShowS)
-> Show AudioDescription
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AudioDescription] -> ShowS
$cshowList :: [AudioDescription] -> ShowS
show :: AudioDescription -> String
$cshow :: AudioDescription -> String
showsPrec :: Int -> AudioDescription -> ShowS
$cshowsPrec :: Int -> AudioDescription -> ShowS
Prelude.Show, (forall x. AudioDescription -> Rep AudioDescription x)
-> (forall x. Rep AudioDescription x -> AudioDescription)
-> Generic AudioDescription
forall x. Rep AudioDescription x -> AudioDescription
forall x. AudioDescription -> Rep AudioDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AudioDescription x -> AudioDescription
$cfrom :: forall x. AudioDescription -> Rep AudioDescription x
Prelude.Generic)

-- |
-- Create a value of 'AudioDescription' 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:
--
-- 'languageCode', 'audioDescription_languageCode' - RFC 5646 language code representing the language of the audio output
-- track. Only used if languageControlMode is useConfigured, or there is no
-- ISO 639 language code specified in the input.
--
-- 'audioType', 'audioDescription_audioType' - Applies only if audioTypeControl is useConfigured. The values for
-- audioType are defined in ISO-IEC 13818-1.
--
-- 'audioNormalizationSettings', 'audioDescription_audioNormalizationSettings' - Advanced audio normalization settings.
--
-- 'languageCodeControl', 'audioDescription_languageCodeControl' - Choosing followInput will cause the ISO 639 language code of the output
-- to follow the ISO 639 language code of the input. The languageCode will
-- be used when useConfigured is set, or when followInput is selected but
-- there is no ISO 639 language code specified by the input.
--
-- 'codecSettings', 'audioDescription_codecSettings' - Audio codec settings.
--
-- 'audioWatermarkingSettings', 'audioDescription_audioWatermarkingSettings' - Settings to configure one or more solutions that insert audio watermarks
-- in the audio encode
--
-- 'streamName', 'audioDescription_streamName' - Used for MS Smooth and Apple HLS outputs. Indicates the name displayed
-- by the player (eg. English, or Director Commentary).
--
-- 'remixSettings', 'audioDescription_remixSettings' - Settings that control how input audio channels are remixed into the
-- output audio channels.
--
-- 'audioTypeControl', 'audioDescription_audioTypeControl' - Determines how audio type is determined. followInput: If the input
-- contains an ISO 639 audioType, then that value is passed through to the
-- output. If the input contains no ISO 639 audioType, the value in Audio
-- Type is included in the output. useConfigured: The value in Audio Type
-- is included in the output. Note that this field and audioType are both
-- ignored if inputType is broadcasterMixedAd.
--
-- 'audioSelectorName', 'audioDescription_audioSelectorName' - The name of the AudioSelector used as the source for this
-- AudioDescription.
--
-- 'name', 'audioDescription_name' - The name of this AudioDescription. Outputs will use this name to
-- uniquely identify this AudioDescription. Description names should be
-- unique within this Live Event.
newAudioDescription ::
  -- | 'audioSelectorName'
  Prelude.Text ->
  -- | 'name'
  Prelude.Text ->
  AudioDescription
newAudioDescription :: Text -> Text -> AudioDescription
newAudioDescription Text
pAudioSelectorName_ Text
pName_ =
  AudioDescription' :: Maybe Text
-> Maybe AudioType
-> Maybe AudioNormalizationSettings
-> Maybe AudioDescriptionLanguageCodeControl
-> Maybe AudioCodecSettings
-> Maybe AudioWatermarkSettings
-> Maybe Text
-> Maybe RemixSettings
-> Maybe AudioDescriptionAudioTypeControl
-> Text
-> Text
-> AudioDescription
AudioDescription'
    { $sel:languageCode:AudioDescription' :: Maybe Text
languageCode = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:audioType:AudioDescription' :: Maybe AudioType
audioType = Maybe AudioType
forall a. Maybe a
Prelude.Nothing,
      $sel:audioNormalizationSettings:AudioDescription' :: Maybe AudioNormalizationSettings
audioNormalizationSettings = Maybe AudioNormalizationSettings
forall a. Maybe a
Prelude.Nothing,
      $sel:languageCodeControl:AudioDescription' :: Maybe AudioDescriptionLanguageCodeControl
languageCodeControl = Maybe AudioDescriptionLanguageCodeControl
forall a. Maybe a
Prelude.Nothing,
      $sel:codecSettings:AudioDescription' :: Maybe AudioCodecSettings
codecSettings = Maybe AudioCodecSettings
forall a. Maybe a
Prelude.Nothing,
      $sel:audioWatermarkingSettings:AudioDescription' :: Maybe AudioWatermarkSettings
audioWatermarkingSettings = Maybe AudioWatermarkSettings
forall a. Maybe a
Prelude.Nothing,
      $sel:streamName:AudioDescription' :: Maybe Text
streamName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:remixSettings:AudioDescription' :: Maybe RemixSettings
remixSettings = Maybe RemixSettings
forall a. Maybe a
Prelude.Nothing,
      $sel:audioTypeControl:AudioDescription' :: Maybe AudioDescriptionAudioTypeControl
audioTypeControl = Maybe AudioDescriptionAudioTypeControl
forall a. Maybe a
Prelude.Nothing,
      $sel:audioSelectorName:AudioDescription' :: Text
audioSelectorName = Text
pAudioSelectorName_,
      $sel:name:AudioDescription' :: Text
name = Text
pName_
    }

-- | RFC 5646 language code representing the language of the audio output
-- track. Only used if languageControlMode is useConfigured, or there is no
-- ISO 639 language code specified in the input.
audioDescription_languageCode :: Lens.Lens' AudioDescription (Prelude.Maybe Prelude.Text)
audioDescription_languageCode :: (Maybe Text -> f (Maybe Text))
-> AudioDescription -> f AudioDescription
audioDescription_languageCode = (AudioDescription -> Maybe Text)
-> (AudioDescription -> Maybe Text -> AudioDescription)
-> Lens AudioDescription AudioDescription (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AudioDescription' {Maybe Text
languageCode :: Maybe Text
$sel:languageCode:AudioDescription' :: AudioDescription -> Maybe Text
languageCode} -> Maybe Text
languageCode) (\s :: AudioDescription
s@AudioDescription' {} Maybe Text
a -> AudioDescription
s {$sel:languageCode:AudioDescription' :: Maybe Text
languageCode = Maybe Text
a} :: AudioDescription)

-- | Applies only if audioTypeControl is useConfigured. The values for
-- audioType are defined in ISO-IEC 13818-1.
audioDescription_audioType :: Lens.Lens' AudioDescription (Prelude.Maybe AudioType)
audioDescription_audioType :: (Maybe AudioType -> f (Maybe AudioType))
-> AudioDescription -> f AudioDescription
audioDescription_audioType = (AudioDescription -> Maybe AudioType)
-> (AudioDescription -> Maybe AudioType -> AudioDescription)
-> Lens
     AudioDescription
     AudioDescription
     (Maybe AudioType)
     (Maybe AudioType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AudioDescription' {Maybe AudioType
audioType :: Maybe AudioType
$sel:audioType:AudioDescription' :: AudioDescription -> Maybe AudioType
audioType} -> Maybe AudioType
audioType) (\s :: AudioDescription
s@AudioDescription' {} Maybe AudioType
a -> AudioDescription
s {$sel:audioType:AudioDescription' :: Maybe AudioType
audioType = Maybe AudioType
a} :: AudioDescription)

-- | Advanced audio normalization settings.
audioDescription_audioNormalizationSettings :: Lens.Lens' AudioDescription (Prelude.Maybe AudioNormalizationSettings)
audioDescription_audioNormalizationSettings :: (Maybe AudioNormalizationSettings
 -> f (Maybe AudioNormalizationSettings))
-> AudioDescription -> f AudioDescription
audioDescription_audioNormalizationSettings = (AudioDescription -> Maybe AudioNormalizationSettings)
-> (AudioDescription
    -> Maybe AudioNormalizationSettings -> AudioDescription)
-> Lens
     AudioDescription
     AudioDescription
     (Maybe AudioNormalizationSettings)
     (Maybe AudioNormalizationSettings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AudioDescription' {Maybe AudioNormalizationSettings
audioNormalizationSettings :: Maybe AudioNormalizationSettings
$sel:audioNormalizationSettings:AudioDescription' :: AudioDescription -> Maybe AudioNormalizationSettings
audioNormalizationSettings} -> Maybe AudioNormalizationSettings
audioNormalizationSettings) (\s :: AudioDescription
s@AudioDescription' {} Maybe AudioNormalizationSettings
a -> AudioDescription
s {$sel:audioNormalizationSettings:AudioDescription' :: Maybe AudioNormalizationSettings
audioNormalizationSettings = Maybe AudioNormalizationSettings
a} :: AudioDescription)

-- | Choosing followInput will cause the ISO 639 language code of the output
-- to follow the ISO 639 language code of the input. The languageCode will
-- be used when useConfigured is set, or when followInput is selected but
-- there is no ISO 639 language code specified by the input.
audioDescription_languageCodeControl :: Lens.Lens' AudioDescription (Prelude.Maybe AudioDescriptionLanguageCodeControl)
audioDescription_languageCodeControl :: (Maybe AudioDescriptionLanguageCodeControl
 -> f (Maybe AudioDescriptionLanguageCodeControl))
-> AudioDescription -> f AudioDescription
audioDescription_languageCodeControl = (AudioDescription -> Maybe AudioDescriptionLanguageCodeControl)
-> (AudioDescription
    -> Maybe AudioDescriptionLanguageCodeControl -> AudioDescription)
-> Lens
     AudioDescription
     AudioDescription
     (Maybe AudioDescriptionLanguageCodeControl)
     (Maybe AudioDescriptionLanguageCodeControl)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AudioDescription' {Maybe AudioDescriptionLanguageCodeControl
languageCodeControl :: Maybe AudioDescriptionLanguageCodeControl
$sel:languageCodeControl:AudioDescription' :: AudioDescription -> Maybe AudioDescriptionLanguageCodeControl
languageCodeControl} -> Maybe AudioDescriptionLanguageCodeControl
languageCodeControl) (\s :: AudioDescription
s@AudioDescription' {} Maybe AudioDescriptionLanguageCodeControl
a -> AudioDescription
s {$sel:languageCodeControl:AudioDescription' :: Maybe AudioDescriptionLanguageCodeControl
languageCodeControl = Maybe AudioDescriptionLanguageCodeControl
a} :: AudioDescription)

-- | Audio codec settings.
audioDescription_codecSettings :: Lens.Lens' AudioDescription (Prelude.Maybe AudioCodecSettings)
audioDescription_codecSettings :: (Maybe AudioCodecSettings -> f (Maybe AudioCodecSettings))
-> AudioDescription -> f AudioDescription
audioDescription_codecSettings = (AudioDescription -> Maybe AudioCodecSettings)
-> (AudioDescription
    -> Maybe AudioCodecSettings -> AudioDescription)
-> Lens
     AudioDescription
     AudioDescription
     (Maybe AudioCodecSettings)
     (Maybe AudioCodecSettings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AudioDescription' {Maybe AudioCodecSettings
codecSettings :: Maybe AudioCodecSettings
$sel:codecSettings:AudioDescription' :: AudioDescription -> Maybe AudioCodecSettings
codecSettings} -> Maybe AudioCodecSettings
codecSettings) (\s :: AudioDescription
s@AudioDescription' {} Maybe AudioCodecSettings
a -> AudioDescription
s {$sel:codecSettings:AudioDescription' :: Maybe AudioCodecSettings
codecSettings = Maybe AudioCodecSettings
a} :: AudioDescription)

-- | Settings to configure one or more solutions that insert audio watermarks
-- in the audio encode
audioDescription_audioWatermarkingSettings :: Lens.Lens' AudioDescription (Prelude.Maybe AudioWatermarkSettings)
audioDescription_audioWatermarkingSettings :: (Maybe AudioWatermarkSettings -> f (Maybe AudioWatermarkSettings))
-> AudioDescription -> f AudioDescription
audioDescription_audioWatermarkingSettings = (AudioDescription -> Maybe AudioWatermarkSettings)
-> (AudioDescription
    -> Maybe AudioWatermarkSettings -> AudioDescription)
-> Lens
     AudioDescription
     AudioDescription
     (Maybe AudioWatermarkSettings)
     (Maybe AudioWatermarkSettings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AudioDescription' {Maybe AudioWatermarkSettings
audioWatermarkingSettings :: Maybe AudioWatermarkSettings
$sel:audioWatermarkingSettings:AudioDescription' :: AudioDescription -> Maybe AudioWatermarkSettings
audioWatermarkingSettings} -> Maybe AudioWatermarkSettings
audioWatermarkingSettings) (\s :: AudioDescription
s@AudioDescription' {} Maybe AudioWatermarkSettings
a -> AudioDescription
s {$sel:audioWatermarkingSettings:AudioDescription' :: Maybe AudioWatermarkSettings
audioWatermarkingSettings = Maybe AudioWatermarkSettings
a} :: AudioDescription)

-- | Used for MS Smooth and Apple HLS outputs. Indicates the name displayed
-- by the player (eg. English, or Director Commentary).
audioDescription_streamName :: Lens.Lens' AudioDescription (Prelude.Maybe Prelude.Text)
audioDescription_streamName :: (Maybe Text -> f (Maybe Text))
-> AudioDescription -> f AudioDescription
audioDescription_streamName = (AudioDescription -> Maybe Text)
-> (AudioDescription -> Maybe Text -> AudioDescription)
-> Lens AudioDescription AudioDescription (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AudioDescription' {Maybe Text
streamName :: Maybe Text
$sel:streamName:AudioDescription' :: AudioDescription -> Maybe Text
streamName} -> Maybe Text
streamName) (\s :: AudioDescription
s@AudioDescription' {} Maybe Text
a -> AudioDescription
s {$sel:streamName:AudioDescription' :: Maybe Text
streamName = Maybe Text
a} :: AudioDescription)

-- | Settings that control how input audio channels are remixed into the
-- output audio channels.
audioDescription_remixSettings :: Lens.Lens' AudioDescription (Prelude.Maybe RemixSettings)
audioDescription_remixSettings :: (Maybe RemixSettings -> f (Maybe RemixSettings))
-> AudioDescription -> f AudioDescription
audioDescription_remixSettings = (AudioDescription -> Maybe RemixSettings)
-> (AudioDescription -> Maybe RemixSettings -> AudioDescription)
-> Lens
     AudioDescription
     AudioDescription
     (Maybe RemixSettings)
     (Maybe RemixSettings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AudioDescription' {Maybe RemixSettings
remixSettings :: Maybe RemixSettings
$sel:remixSettings:AudioDescription' :: AudioDescription -> Maybe RemixSettings
remixSettings} -> Maybe RemixSettings
remixSettings) (\s :: AudioDescription
s@AudioDescription' {} Maybe RemixSettings
a -> AudioDescription
s {$sel:remixSettings:AudioDescription' :: Maybe RemixSettings
remixSettings = Maybe RemixSettings
a} :: AudioDescription)

-- | Determines how audio type is determined. followInput: If the input
-- contains an ISO 639 audioType, then that value is passed through to the
-- output. If the input contains no ISO 639 audioType, the value in Audio
-- Type is included in the output. useConfigured: The value in Audio Type
-- is included in the output. Note that this field and audioType are both
-- ignored if inputType is broadcasterMixedAd.
audioDescription_audioTypeControl :: Lens.Lens' AudioDescription (Prelude.Maybe AudioDescriptionAudioTypeControl)
audioDescription_audioTypeControl :: (Maybe AudioDescriptionAudioTypeControl
 -> f (Maybe AudioDescriptionAudioTypeControl))
-> AudioDescription -> f AudioDescription
audioDescription_audioTypeControl = (AudioDescription -> Maybe AudioDescriptionAudioTypeControl)
-> (AudioDescription
    -> Maybe AudioDescriptionAudioTypeControl -> AudioDescription)
-> Lens
     AudioDescription
     AudioDescription
     (Maybe AudioDescriptionAudioTypeControl)
     (Maybe AudioDescriptionAudioTypeControl)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AudioDescription' {Maybe AudioDescriptionAudioTypeControl
audioTypeControl :: Maybe AudioDescriptionAudioTypeControl
$sel:audioTypeControl:AudioDescription' :: AudioDescription -> Maybe AudioDescriptionAudioTypeControl
audioTypeControl} -> Maybe AudioDescriptionAudioTypeControl
audioTypeControl) (\s :: AudioDescription
s@AudioDescription' {} Maybe AudioDescriptionAudioTypeControl
a -> AudioDescription
s {$sel:audioTypeControl:AudioDescription' :: Maybe AudioDescriptionAudioTypeControl
audioTypeControl = Maybe AudioDescriptionAudioTypeControl
a} :: AudioDescription)

-- | The name of the AudioSelector used as the source for this
-- AudioDescription.
audioDescription_audioSelectorName :: Lens.Lens' AudioDescription Prelude.Text
audioDescription_audioSelectorName :: (Text -> f Text) -> AudioDescription -> f AudioDescription
audioDescription_audioSelectorName = (AudioDescription -> Text)
-> (AudioDescription -> Text -> AudioDescription)
-> Lens AudioDescription AudioDescription Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AudioDescription' {Text
audioSelectorName :: Text
$sel:audioSelectorName:AudioDescription' :: AudioDescription -> Text
audioSelectorName} -> Text
audioSelectorName) (\s :: AudioDescription
s@AudioDescription' {} Text
a -> AudioDescription
s {$sel:audioSelectorName:AudioDescription' :: Text
audioSelectorName = Text
a} :: AudioDescription)

-- | The name of this AudioDescription. Outputs will use this name to
-- uniquely identify this AudioDescription. Description names should be
-- unique within this Live Event.
audioDescription_name :: Lens.Lens' AudioDescription Prelude.Text
audioDescription_name :: (Text -> f Text) -> AudioDescription -> f AudioDescription
audioDescription_name = (AudioDescription -> Text)
-> (AudioDescription -> Text -> AudioDescription)
-> Lens AudioDescription AudioDescription Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AudioDescription' {Text
name :: Text
$sel:name:AudioDescription' :: AudioDescription -> Text
name} -> Text
name) (\s :: AudioDescription
s@AudioDescription' {} Text
a -> AudioDescription
s {$sel:name:AudioDescription' :: Text
name = Text
a} :: AudioDescription)

instance Core.FromJSON AudioDescription where
  parseJSON :: Value -> Parser AudioDescription
parseJSON =
    String
-> (Object -> Parser AudioDescription)
-> Value
-> Parser AudioDescription
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AudioDescription"
      ( \Object
x ->
          Maybe Text
-> Maybe AudioType
-> Maybe AudioNormalizationSettings
-> Maybe AudioDescriptionLanguageCodeControl
-> Maybe AudioCodecSettings
-> Maybe AudioWatermarkSettings
-> Maybe Text
-> Maybe RemixSettings
-> Maybe AudioDescriptionAudioTypeControl
-> Text
-> Text
-> AudioDescription
AudioDescription'
            (Maybe Text
 -> Maybe AudioType
 -> Maybe AudioNormalizationSettings
 -> Maybe AudioDescriptionLanguageCodeControl
 -> Maybe AudioCodecSettings
 -> Maybe AudioWatermarkSettings
 -> Maybe Text
 -> Maybe RemixSettings
 -> Maybe AudioDescriptionAudioTypeControl
 -> Text
 -> Text
 -> AudioDescription)
-> Parser (Maybe Text)
-> Parser
     (Maybe AudioType
      -> Maybe AudioNormalizationSettings
      -> Maybe AudioDescriptionLanguageCodeControl
      -> Maybe AudioCodecSettings
      -> Maybe AudioWatermarkSettings
      -> Maybe Text
      -> Maybe RemixSettings
      -> Maybe AudioDescriptionAudioTypeControl
      -> Text
      -> Text
      -> AudioDescription)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"languageCode")
            Parser
  (Maybe AudioType
   -> Maybe AudioNormalizationSettings
   -> Maybe AudioDescriptionLanguageCodeControl
   -> Maybe AudioCodecSettings
   -> Maybe AudioWatermarkSettings
   -> Maybe Text
   -> Maybe RemixSettings
   -> Maybe AudioDescriptionAudioTypeControl
   -> Text
   -> Text
   -> AudioDescription)
-> Parser (Maybe AudioType)
-> Parser
     (Maybe AudioNormalizationSettings
      -> Maybe AudioDescriptionLanguageCodeControl
      -> Maybe AudioCodecSettings
      -> Maybe AudioWatermarkSettings
      -> Maybe Text
      -> Maybe RemixSettings
      -> Maybe AudioDescriptionAudioTypeControl
      -> Text
      -> Text
      -> AudioDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AudioType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"audioType")
            Parser
  (Maybe AudioNormalizationSettings
   -> Maybe AudioDescriptionLanguageCodeControl
   -> Maybe AudioCodecSettings
   -> Maybe AudioWatermarkSettings
   -> Maybe Text
   -> Maybe RemixSettings
   -> Maybe AudioDescriptionAudioTypeControl
   -> Text
   -> Text
   -> AudioDescription)
-> Parser (Maybe AudioNormalizationSettings)
-> Parser
     (Maybe AudioDescriptionLanguageCodeControl
      -> Maybe AudioCodecSettings
      -> Maybe AudioWatermarkSettings
      -> Maybe Text
      -> Maybe RemixSettings
      -> Maybe AudioDescriptionAudioTypeControl
      -> Text
      -> Text
      -> AudioDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AudioNormalizationSettings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"audioNormalizationSettings")
            Parser
  (Maybe AudioDescriptionLanguageCodeControl
   -> Maybe AudioCodecSettings
   -> Maybe AudioWatermarkSettings
   -> Maybe Text
   -> Maybe RemixSettings
   -> Maybe AudioDescriptionAudioTypeControl
   -> Text
   -> Text
   -> AudioDescription)
-> Parser (Maybe AudioDescriptionLanguageCodeControl)
-> Parser
     (Maybe AudioCodecSettings
      -> Maybe AudioWatermarkSettings
      -> Maybe Text
      -> Maybe RemixSettings
      -> Maybe AudioDescriptionAudioTypeControl
      -> Text
      -> Text
      -> AudioDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Parser (Maybe AudioDescriptionLanguageCodeControl)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"languageCodeControl")
            Parser
  (Maybe AudioCodecSettings
   -> Maybe AudioWatermarkSettings
   -> Maybe Text
   -> Maybe RemixSettings
   -> Maybe AudioDescriptionAudioTypeControl
   -> Text
   -> Text
   -> AudioDescription)
-> Parser (Maybe AudioCodecSettings)
-> Parser
     (Maybe AudioWatermarkSettings
      -> Maybe Text
      -> Maybe RemixSettings
      -> Maybe AudioDescriptionAudioTypeControl
      -> Text
      -> Text
      -> AudioDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AudioCodecSettings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"codecSettings")
            Parser
  (Maybe AudioWatermarkSettings
   -> Maybe Text
   -> Maybe RemixSettings
   -> Maybe AudioDescriptionAudioTypeControl
   -> Text
   -> Text
   -> AudioDescription)
-> Parser (Maybe AudioWatermarkSettings)
-> Parser
     (Maybe Text
      -> Maybe RemixSettings
      -> Maybe AudioDescriptionAudioTypeControl
      -> Text
      -> Text
      -> AudioDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AudioWatermarkSettings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"audioWatermarkingSettings")
            Parser
  (Maybe Text
   -> Maybe RemixSettings
   -> Maybe AudioDescriptionAudioTypeControl
   -> Text
   -> Text
   -> AudioDescription)
-> Parser (Maybe Text)
-> Parser
     (Maybe RemixSettings
      -> Maybe AudioDescriptionAudioTypeControl
      -> Text
      -> Text
      -> AudioDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"streamName")
            Parser
  (Maybe RemixSettings
   -> Maybe AudioDescriptionAudioTypeControl
   -> Text
   -> Text
   -> AudioDescription)
-> Parser (Maybe RemixSettings)
-> Parser
     (Maybe AudioDescriptionAudioTypeControl
      -> Text -> Text -> AudioDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe RemixSettings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"remixSettings")
            Parser
  (Maybe AudioDescriptionAudioTypeControl
   -> Text -> Text -> AudioDescription)
-> Parser (Maybe AudioDescriptionAudioTypeControl)
-> Parser (Text -> Text -> AudioDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AudioDescriptionAudioTypeControl)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"audioTypeControl")
            Parser (Text -> Text -> AudioDescription)
-> Parser Text -> Parser (Text -> AudioDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"audioSelectorName")
            Parser (Text -> AudioDescription)
-> Parser Text -> Parser AudioDescription
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"name")
      )

instance Prelude.Hashable AudioDescription

instance Prelude.NFData AudioDescription

instance Core.ToJSON AudioDescription where
  toJSON :: AudioDescription -> Value
toJSON AudioDescription' {Maybe Text
Maybe AudioDescriptionAudioTypeControl
Maybe AudioDescriptionLanguageCodeControl
Maybe AudioNormalizationSettings
Maybe AudioType
Maybe AudioWatermarkSettings
Maybe RemixSettings
Maybe AudioCodecSettings
Text
name :: Text
audioSelectorName :: Text
audioTypeControl :: Maybe AudioDescriptionAudioTypeControl
remixSettings :: Maybe RemixSettings
streamName :: Maybe Text
audioWatermarkingSettings :: Maybe AudioWatermarkSettings
codecSettings :: Maybe AudioCodecSettings
languageCodeControl :: Maybe AudioDescriptionLanguageCodeControl
audioNormalizationSettings :: Maybe AudioNormalizationSettings
audioType :: Maybe AudioType
languageCode :: Maybe Text
$sel:name:AudioDescription' :: AudioDescription -> Text
$sel:audioSelectorName:AudioDescription' :: AudioDescription -> Text
$sel:audioTypeControl:AudioDescription' :: AudioDescription -> Maybe AudioDescriptionAudioTypeControl
$sel:remixSettings:AudioDescription' :: AudioDescription -> Maybe RemixSettings
$sel:streamName:AudioDescription' :: AudioDescription -> Maybe Text
$sel:audioWatermarkingSettings:AudioDescription' :: AudioDescription -> Maybe AudioWatermarkSettings
$sel:codecSettings:AudioDescription' :: AudioDescription -> Maybe AudioCodecSettings
$sel:languageCodeControl:AudioDescription' :: AudioDescription -> Maybe AudioDescriptionLanguageCodeControl
$sel:audioNormalizationSettings:AudioDescription' :: AudioDescription -> Maybe AudioNormalizationSettings
$sel:audioType:AudioDescription' :: AudioDescription -> Maybe AudioType
$sel:languageCode:AudioDescription' :: AudioDescription -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"languageCode" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
languageCode,
            (Text
"audioType" Text -> AudioType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (AudioType -> Pair) -> Maybe AudioType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AudioType
audioType,
            (Text
"audioNormalizationSettings" Text -> AudioNormalizationSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (AudioNormalizationSettings -> Pair)
-> Maybe AudioNormalizationSettings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AudioNormalizationSettings
audioNormalizationSettings,
            (Text
"languageCodeControl" Text -> AudioDescriptionLanguageCodeControl -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (AudioDescriptionLanguageCodeControl -> Pair)
-> Maybe AudioDescriptionLanguageCodeControl -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AudioDescriptionLanguageCodeControl
languageCodeControl,
            (Text
"codecSettings" Text -> AudioCodecSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (AudioCodecSettings -> Pair)
-> Maybe AudioCodecSettings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AudioCodecSettings
codecSettings,
            (Text
"audioWatermarkingSettings" Text -> AudioWatermarkSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (AudioWatermarkSettings -> Pair)
-> Maybe AudioWatermarkSettings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AudioWatermarkSettings
audioWatermarkingSettings,
            (Text
"streamName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
streamName,
            (Text
"remixSettings" Text -> RemixSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (RemixSettings -> Pair) -> Maybe RemixSettings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RemixSettings
remixSettings,
            (Text
"audioTypeControl" Text -> AudioDescriptionAudioTypeControl -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (AudioDescriptionAudioTypeControl -> Pair)
-> Maybe AudioDescriptionAudioTypeControl -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AudioDescriptionAudioTypeControl
audioTypeControl,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"audioSelectorName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
audioSelectorName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name)
          ]
      )