{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.MediaLive.Types.AudioDescription where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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'
  { -- | Advanced audio normalization settings.
    AudioDescription -> Maybe AudioNormalizationSettings
audioNormalizationSettings :: Prelude.Maybe AudioNormalizationSettings,
    -- | Applies only if audioTypeControl is useConfigured. The values for
    -- audioType are defined in ISO-IEC 13818-1.
    AudioDescription -> Maybe AudioType
audioType :: Prelude.Maybe AudioType,
    -- | 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,
    -- | Settings to configure one or more solutions that insert audio watermarks
    -- in the audio encode
    AudioDescription -> Maybe AudioWatermarkSettings
audioWatermarkingSettings :: Prelude.Maybe AudioWatermarkSettings,
    -- | Audio codec settings.
    AudioDescription -> Maybe AudioCodecSettings
codecSettings :: Prelude.Maybe AudioCodecSettings,
    -- | 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,
    -- | 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,
    -- | Settings that control how input audio channels are remixed into the
    -- output audio channels.
    AudioDescription -> Maybe RemixSettings
remixSettings :: Prelude.Maybe RemixSettings,
    -- | 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,
    -- | 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
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]
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
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. 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:
--
-- 'audioNormalizationSettings', 'audioDescription_audioNormalizationSettings' - Advanced audio normalization settings.
--
-- 'audioType', 'audioDescription_audioType' - Applies only if audioTypeControl is useConfigured. The values for
-- audioType are defined in ISO-IEC 13818-1.
--
-- '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.
--
-- 'audioWatermarkingSettings', 'audioDescription_audioWatermarkingSettings' - Settings to configure one or more solutions that insert audio watermarks
-- in the audio encode
--
-- 'codecSettings', 'audioDescription_codecSettings' - Audio codec settings.
--
-- '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.
--
-- '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.
--
-- 'remixSettings', 'audioDescription_remixSettings' - Settings that control how input audio channels are remixed into the
-- output audio channels.
--
-- 'streamName', 'audioDescription_streamName' - Used for MS Smooth and Apple HLS outputs. Indicates the name displayed
-- by the player (eg. English, or Director Commentary).
--
-- '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'
    { $sel:audioNormalizationSettings:AudioDescription' :: Maybe AudioNormalizationSettings
audioNormalizationSettings =
        forall a. Maybe a
Prelude.Nothing,
      $sel:audioType:AudioDescription' :: Maybe AudioType
audioType = forall a. Maybe a
Prelude.Nothing,
      $sel:audioTypeControl:AudioDescription' :: Maybe AudioDescriptionAudioTypeControl
audioTypeControl = forall a. Maybe a
Prelude.Nothing,
      $sel:audioWatermarkingSettings:AudioDescription' :: Maybe AudioWatermarkSettings
audioWatermarkingSettings = forall a. Maybe a
Prelude.Nothing,
      $sel:codecSettings:AudioDescription' :: Maybe AudioCodecSettings
codecSettings = forall a. Maybe a
Prelude.Nothing,
      $sel:languageCode:AudioDescription' :: Maybe Text
languageCode = forall a. Maybe a
Prelude.Nothing,
      $sel:languageCodeControl:AudioDescription' :: Maybe AudioDescriptionLanguageCodeControl
languageCodeControl = forall a. Maybe a
Prelude.Nothing,
      $sel:remixSettings:AudioDescription' :: Maybe RemixSettings
remixSettings = forall a. Maybe a
Prelude.Nothing,
      $sel:streamName:AudioDescription' :: Maybe Text
streamName = forall a. Maybe a
Prelude.Nothing,
      $sel:audioSelectorName:AudioDescription' :: Text
audioSelectorName = Text
pAudioSelectorName_,
      $sel:name:AudioDescription' :: Text
name = Text
pName_
    }

-- | Advanced audio normalization settings.
audioDescription_audioNormalizationSettings :: Lens.Lens' AudioDescription (Prelude.Maybe AudioNormalizationSettings)
audioDescription_audioNormalizationSettings :: Lens' AudioDescription (Maybe AudioNormalizationSettings)
audioDescription_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)

-- | 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 :: Lens' AudioDescription (Maybe AudioType)
audioDescription_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)

-- | 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 :: Lens' AudioDescription (Maybe AudioDescriptionAudioTypeControl)
audioDescription_audioTypeControl = 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)

-- | 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 :: Lens' AudioDescription (Maybe AudioWatermarkSettings)
audioDescription_audioWatermarkingSettings = 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)

-- | Audio codec settings.
audioDescription_codecSettings :: Lens.Lens' AudioDescription (Prelude.Maybe AudioCodecSettings)
audioDescription_codecSettings :: Lens' AudioDescription (Maybe AudioCodecSettings)
audioDescription_codecSettings = 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)

-- | 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 :: Lens' AudioDescription (Maybe Text)
audioDescription_languageCode = 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)

-- | 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 :: Lens' AudioDescription (Maybe AudioDescriptionLanguageCodeControl)
audioDescription_languageCodeControl = 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)

-- | Settings that control how input audio channels are remixed into the
-- output audio channels.
audioDescription_remixSettings :: Lens.Lens' AudioDescription (Prelude.Maybe RemixSettings)
audioDescription_remixSettings :: Lens' AudioDescription (Maybe RemixSettings)
audioDescription_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)

-- | 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 :: Lens' AudioDescription (Maybe Text)
audioDescription_streamName = 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)

-- | The name of the AudioSelector used as the source for this
-- AudioDescription.
audioDescription_audioSelectorName :: Lens.Lens' AudioDescription Prelude.Text
audioDescription_audioSelectorName :: Lens' AudioDescription Text
audioDescription_audioSelectorName = 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 :: Lens' AudioDescription Text
audioDescription_name = 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 Data.FromJSON AudioDescription where
  parseJSON :: Value -> Parser AudioDescription
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"AudioDescription"
      ( \Object
x ->
          Maybe AudioNormalizationSettings
-> Maybe AudioType
-> Maybe AudioDescriptionAudioTypeControl
-> Maybe AudioWatermarkSettings
-> Maybe AudioCodecSettings
-> Maybe Text
-> Maybe AudioDescriptionLanguageCodeControl
-> Maybe RemixSettings
-> Maybe Text
-> Text
-> Text
-> AudioDescription
AudioDescription'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"audioNormalizationSettings")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"audioType")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"audioTypeControl")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"audioWatermarkingSettings")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"codecSettings")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"languageCode")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"languageCodeControl")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"remixSettings")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"streamName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"audioSelectorName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"name")
      )

instance Prelude.Hashable AudioDescription where
  hashWithSalt :: Int -> AudioDescription -> Int
hashWithSalt Int
_salt AudioDescription' {Maybe Text
Maybe AudioDescriptionAudioTypeControl
Maybe AudioDescriptionLanguageCodeControl
Maybe AudioNormalizationSettings
Maybe AudioType
Maybe AudioWatermarkSettings
Maybe RemixSettings
Maybe AudioCodecSettings
Text
name :: Text
audioSelectorName :: Text
streamName :: Maybe Text
remixSettings :: Maybe RemixSettings
languageCodeControl :: Maybe AudioDescriptionLanguageCodeControl
languageCode :: Maybe Text
codecSettings :: Maybe AudioCodecSettings
audioWatermarkingSettings :: Maybe AudioWatermarkSettings
audioTypeControl :: Maybe AudioDescriptionAudioTypeControl
audioType :: Maybe AudioType
audioNormalizationSettings :: Maybe AudioNormalizationSettings
$sel:name:AudioDescription' :: AudioDescription -> Text
$sel:audioSelectorName:AudioDescription' :: AudioDescription -> Text
$sel:streamName:AudioDescription' :: AudioDescription -> Maybe Text
$sel:remixSettings:AudioDescription' :: AudioDescription -> Maybe RemixSettings
$sel:languageCodeControl:AudioDescription' :: AudioDescription -> Maybe AudioDescriptionLanguageCodeControl
$sel:languageCode:AudioDescription' :: AudioDescription -> Maybe Text
$sel:codecSettings:AudioDescription' :: AudioDescription -> Maybe AudioCodecSettings
$sel:audioWatermarkingSettings:AudioDescription' :: AudioDescription -> Maybe AudioWatermarkSettings
$sel:audioTypeControl:AudioDescription' :: AudioDescription -> Maybe AudioDescriptionAudioTypeControl
$sel:audioType:AudioDescription' :: AudioDescription -> Maybe AudioType
$sel:audioNormalizationSettings:AudioDescription' :: AudioDescription -> Maybe AudioNormalizationSettings
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AudioNormalizationSettings
audioNormalizationSettings
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AudioType
audioType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AudioDescriptionAudioTypeControl
audioTypeControl
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AudioWatermarkSettings
audioWatermarkingSettings
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AudioCodecSettings
codecSettings
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
languageCode
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AudioDescriptionLanguageCodeControl
languageCodeControl
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe RemixSettings
remixSettings
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
streamName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
audioSelectorName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name

instance Prelude.NFData AudioDescription where
  rnf :: AudioDescription -> ()
rnf AudioDescription' {Maybe Text
Maybe AudioDescriptionAudioTypeControl
Maybe AudioDescriptionLanguageCodeControl
Maybe AudioNormalizationSettings
Maybe AudioType
Maybe AudioWatermarkSettings
Maybe RemixSettings
Maybe AudioCodecSettings
Text
name :: Text
audioSelectorName :: Text
streamName :: Maybe Text
remixSettings :: Maybe RemixSettings
languageCodeControl :: Maybe AudioDescriptionLanguageCodeControl
languageCode :: Maybe Text
codecSettings :: Maybe AudioCodecSettings
audioWatermarkingSettings :: Maybe AudioWatermarkSettings
audioTypeControl :: Maybe AudioDescriptionAudioTypeControl
audioType :: Maybe AudioType
audioNormalizationSettings :: Maybe AudioNormalizationSettings
$sel:name:AudioDescription' :: AudioDescription -> Text
$sel:audioSelectorName:AudioDescription' :: AudioDescription -> Text
$sel:streamName:AudioDescription' :: AudioDescription -> Maybe Text
$sel:remixSettings:AudioDescription' :: AudioDescription -> Maybe RemixSettings
$sel:languageCodeControl:AudioDescription' :: AudioDescription -> Maybe AudioDescriptionLanguageCodeControl
$sel:languageCode:AudioDescription' :: AudioDescription -> Maybe Text
$sel:codecSettings:AudioDescription' :: AudioDescription -> Maybe AudioCodecSettings
$sel:audioWatermarkingSettings:AudioDescription' :: AudioDescription -> Maybe AudioWatermarkSettings
$sel:audioTypeControl:AudioDescription' :: AudioDescription -> Maybe AudioDescriptionAudioTypeControl
$sel:audioType:AudioDescription' :: AudioDescription -> Maybe AudioType
$sel:audioNormalizationSettings:AudioDescription' :: AudioDescription -> Maybe AudioNormalizationSettings
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe AudioNormalizationSettings
audioNormalizationSettings
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AudioType
audioType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AudioDescriptionAudioTypeControl
audioTypeControl
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AudioWatermarkSettings
audioWatermarkingSettings
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AudioCodecSettings
codecSettings
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
languageCode
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AudioDescriptionLanguageCodeControl
languageCodeControl
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe RemixSettings
remixSettings
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
streamName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
audioSelectorName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name

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