{-# 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.MediaConvert.Types.AacSettings
-- 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.MediaConvert.Types.AacSettings where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaConvert.Types.AacAudioDescriptionBroadcasterMix
import Amazonka.MediaConvert.Types.AacCodecProfile
import Amazonka.MediaConvert.Types.AacCodingMode
import Amazonka.MediaConvert.Types.AacRateControlMode
import Amazonka.MediaConvert.Types.AacRawFormat
import Amazonka.MediaConvert.Types.AacSpecification
import Amazonka.MediaConvert.Types.AacVbrQuality
import qualified Amazonka.Prelude as Prelude

-- | Required when you set (Codec) under (AudioDescriptions)>(CodecSettings)
-- to the value AAC. The service accepts one of two mutually exclusive
-- groups of AAC settings--VBR and CBR. To select one of these modes, set
-- the value of Bitrate control mode (rateControlMode) to \"VBR\" or
-- \"CBR\". In VBR mode, you control the audio quality with the setting VBR
-- quality (vbrQuality). In CBR mode, you use the setting Bitrate
-- (bitrate). Defaults and valid values depend on the rate control mode.
--
-- /See:/ 'newAacSettings' smart constructor.
data AacSettings = AacSettings'
  { -- | Choose BROADCASTER_MIXED_AD when the input contains pre-mixed main audio
    -- + audio description (AD) as a stereo pair. The value for AudioType will
    -- be set to 3, which signals to downstream systems that this stream
    -- contains \"broadcaster mixed AD\". Note that the input received by the
    -- encoder must contain pre-mixed audio; the encoder does not perform the
    -- mixing. When you choose BROADCASTER_MIXED_AD, the encoder ignores any
    -- values you provide in AudioType and FollowInputAudioType. Choose NORMAL
    -- when the input does not contain pre-mixed audio + audio description
    -- (AD). In this case, the encoder will use any values you provide for
    -- AudioType and FollowInputAudioType.
    AacSettings -> Maybe AacAudioDescriptionBroadcasterMix
audioDescriptionBroadcasterMix :: Prelude.Maybe AacAudioDescriptionBroadcasterMix,
    -- | Enables LATM\/LOAS AAC output. Note that if you use LATM\/LOAS AAC in an
    -- output, you must choose \"No container\" for the output container.
    AacSettings -> Maybe AacRawFormat
rawFormat :: Prelude.Maybe AacRawFormat,
    -- | Mono (Audio Description), Mono, Stereo, or 5.1 channel layout. Valid
    -- values depend on rate control mode and profile. \"1.0 - Audio
    -- Description (Receiver Mix)\" setting receives a stereo description plus
    -- control track and emits a mono AAC encode of the description track, with
    -- control data emitted in the PES header as per ETSI TS 101 154 Annex E.
    AacSettings -> Maybe AacCodingMode
codingMode :: Prelude.Maybe AacCodingMode,
    -- | Rate Control Mode.
    AacSettings -> Maybe AacRateControlMode
rateControlMode :: Prelude.Maybe AacRateControlMode,
    -- | Sample rate in Hz. Valid values depend on rate control mode and profile.
    AacSettings -> Maybe Natural
sampleRate :: Prelude.Maybe Prelude.Natural,
    -- | Use MPEG-2 AAC instead of MPEG-4 AAC audio for raw or MPEG-2 Transport
    -- Stream containers.
    AacSettings -> Maybe AacSpecification
specification :: Prelude.Maybe AacSpecification,
    -- | AAC Profile.
    AacSettings -> Maybe AacCodecProfile
codecProfile :: Prelude.Maybe AacCodecProfile,
    -- | Specify the average bitrate in bits per second. The set of valid values
    -- for this setting is: 6000, 8000, 10000, 12000, 14000, 16000, 20000,
    -- 24000, 28000, 32000, 40000, 48000, 56000, 64000, 80000, 96000, 112000,
    -- 128000, 160000, 192000, 224000, 256000, 288000, 320000, 384000, 448000,
    -- 512000, 576000, 640000, 768000, 896000, 1024000. The value you set is
    -- also constrained by the values that you choose for Profile
    -- (codecProfile), Bitrate control mode (codingMode), and Sample rate
    -- (sampleRate). Default values depend on Bitrate control mode and Profile.
    AacSettings -> Maybe Natural
bitrate :: Prelude.Maybe Prelude.Natural,
    -- | VBR Quality Level - Only used if rate_control_mode is VBR.
    AacSettings -> Maybe AacVbrQuality
vbrQuality :: Prelude.Maybe AacVbrQuality
  }
  deriving (AacSettings -> AacSettings -> Bool
(AacSettings -> AacSettings -> Bool)
-> (AacSettings -> AacSettings -> Bool) -> Eq AacSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AacSettings -> AacSettings -> Bool
$c/= :: AacSettings -> AacSettings -> Bool
== :: AacSettings -> AacSettings -> Bool
$c== :: AacSettings -> AacSettings -> Bool
Prelude.Eq, ReadPrec [AacSettings]
ReadPrec AacSettings
Int -> ReadS AacSettings
ReadS [AacSettings]
(Int -> ReadS AacSettings)
-> ReadS [AacSettings]
-> ReadPrec AacSettings
-> ReadPrec [AacSettings]
-> Read AacSettings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AacSettings]
$creadListPrec :: ReadPrec [AacSettings]
readPrec :: ReadPrec AacSettings
$creadPrec :: ReadPrec AacSettings
readList :: ReadS [AacSettings]
$creadList :: ReadS [AacSettings]
readsPrec :: Int -> ReadS AacSettings
$creadsPrec :: Int -> ReadS AacSettings
Prelude.Read, Int -> AacSettings -> ShowS
[AacSettings] -> ShowS
AacSettings -> String
(Int -> AacSettings -> ShowS)
-> (AacSettings -> String)
-> ([AacSettings] -> ShowS)
-> Show AacSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AacSettings] -> ShowS
$cshowList :: [AacSettings] -> ShowS
show :: AacSettings -> String
$cshow :: AacSettings -> String
showsPrec :: Int -> AacSettings -> ShowS
$cshowsPrec :: Int -> AacSettings -> ShowS
Prelude.Show, (forall x. AacSettings -> Rep AacSettings x)
-> (forall x. Rep AacSettings x -> AacSettings)
-> Generic AacSettings
forall x. Rep AacSettings x -> AacSettings
forall x. AacSettings -> Rep AacSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AacSettings x -> AacSettings
$cfrom :: forall x. AacSettings -> Rep AacSettings x
Prelude.Generic)

-- |
-- Create a value of 'AacSettings' 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:
--
-- 'audioDescriptionBroadcasterMix', 'aacSettings_audioDescriptionBroadcasterMix' - Choose BROADCASTER_MIXED_AD when the input contains pre-mixed main audio
-- + audio description (AD) as a stereo pair. The value for AudioType will
-- be set to 3, which signals to downstream systems that this stream
-- contains \"broadcaster mixed AD\". Note that the input received by the
-- encoder must contain pre-mixed audio; the encoder does not perform the
-- mixing. When you choose BROADCASTER_MIXED_AD, the encoder ignores any
-- values you provide in AudioType and FollowInputAudioType. Choose NORMAL
-- when the input does not contain pre-mixed audio + audio description
-- (AD). In this case, the encoder will use any values you provide for
-- AudioType and FollowInputAudioType.
--
-- 'rawFormat', 'aacSettings_rawFormat' - Enables LATM\/LOAS AAC output. Note that if you use LATM\/LOAS AAC in an
-- output, you must choose \"No container\" for the output container.
--
-- 'codingMode', 'aacSettings_codingMode' - Mono (Audio Description), Mono, Stereo, or 5.1 channel layout. Valid
-- values depend on rate control mode and profile. \"1.0 - Audio
-- Description (Receiver Mix)\" setting receives a stereo description plus
-- control track and emits a mono AAC encode of the description track, with
-- control data emitted in the PES header as per ETSI TS 101 154 Annex E.
--
-- 'rateControlMode', 'aacSettings_rateControlMode' - Rate Control Mode.
--
-- 'sampleRate', 'aacSettings_sampleRate' - Sample rate in Hz. Valid values depend on rate control mode and profile.
--
-- 'specification', 'aacSettings_specification' - Use MPEG-2 AAC instead of MPEG-4 AAC audio for raw or MPEG-2 Transport
-- Stream containers.
--
-- 'codecProfile', 'aacSettings_codecProfile' - AAC Profile.
--
-- 'bitrate', 'aacSettings_bitrate' - Specify the average bitrate in bits per second. The set of valid values
-- for this setting is: 6000, 8000, 10000, 12000, 14000, 16000, 20000,
-- 24000, 28000, 32000, 40000, 48000, 56000, 64000, 80000, 96000, 112000,
-- 128000, 160000, 192000, 224000, 256000, 288000, 320000, 384000, 448000,
-- 512000, 576000, 640000, 768000, 896000, 1024000. The value you set is
-- also constrained by the values that you choose for Profile
-- (codecProfile), Bitrate control mode (codingMode), and Sample rate
-- (sampleRate). Default values depend on Bitrate control mode and Profile.
--
-- 'vbrQuality', 'aacSettings_vbrQuality' - VBR Quality Level - Only used if rate_control_mode is VBR.
newAacSettings ::
  AacSettings
newAacSettings :: AacSettings
newAacSettings =
  AacSettings' :: Maybe AacAudioDescriptionBroadcasterMix
-> Maybe AacRawFormat
-> Maybe AacCodingMode
-> Maybe AacRateControlMode
-> Maybe Natural
-> Maybe AacSpecification
-> Maybe AacCodecProfile
-> Maybe Natural
-> Maybe AacVbrQuality
-> AacSettings
AacSettings'
    { $sel:audioDescriptionBroadcasterMix:AacSettings' :: Maybe AacAudioDescriptionBroadcasterMix
audioDescriptionBroadcasterMix =
        Maybe AacAudioDescriptionBroadcasterMix
forall a. Maybe a
Prelude.Nothing,
      $sel:rawFormat:AacSettings' :: Maybe AacRawFormat
rawFormat = Maybe AacRawFormat
forall a. Maybe a
Prelude.Nothing,
      $sel:codingMode:AacSettings' :: Maybe AacCodingMode
codingMode = Maybe AacCodingMode
forall a. Maybe a
Prelude.Nothing,
      $sel:rateControlMode:AacSettings' :: Maybe AacRateControlMode
rateControlMode = Maybe AacRateControlMode
forall a. Maybe a
Prelude.Nothing,
      $sel:sampleRate:AacSettings' :: Maybe Natural
sampleRate = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:specification:AacSettings' :: Maybe AacSpecification
specification = Maybe AacSpecification
forall a. Maybe a
Prelude.Nothing,
      $sel:codecProfile:AacSettings' :: Maybe AacCodecProfile
codecProfile = Maybe AacCodecProfile
forall a. Maybe a
Prelude.Nothing,
      $sel:bitrate:AacSettings' :: Maybe Natural
bitrate = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:vbrQuality:AacSettings' :: Maybe AacVbrQuality
vbrQuality = Maybe AacVbrQuality
forall a. Maybe a
Prelude.Nothing
    }

-- | Choose BROADCASTER_MIXED_AD when the input contains pre-mixed main audio
-- + audio description (AD) as a stereo pair. The value for AudioType will
-- be set to 3, which signals to downstream systems that this stream
-- contains \"broadcaster mixed AD\". Note that the input received by the
-- encoder must contain pre-mixed audio; the encoder does not perform the
-- mixing. When you choose BROADCASTER_MIXED_AD, the encoder ignores any
-- values you provide in AudioType and FollowInputAudioType. Choose NORMAL
-- when the input does not contain pre-mixed audio + audio description
-- (AD). In this case, the encoder will use any values you provide for
-- AudioType and FollowInputAudioType.
aacSettings_audioDescriptionBroadcasterMix :: Lens.Lens' AacSettings (Prelude.Maybe AacAudioDescriptionBroadcasterMix)
aacSettings_audioDescriptionBroadcasterMix :: (Maybe AacAudioDescriptionBroadcasterMix
 -> f (Maybe AacAudioDescriptionBroadcasterMix))
-> AacSettings -> f AacSettings
aacSettings_audioDescriptionBroadcasterMix = (AacSettings -> Maybe AacAudioDescriptionBroadcasterMix)
-> (AacSettings
    -> Maybe AacAudioDescriptionBroadcasterMix -> AacSettings)
-> Lens
     AacSettings
     AacSettings
     (Maybe AacAudioDescriptionBroadcasterMix)
     (Maybe AacAudioDescriptionBroadcasterMix)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AacSettings' {Maybe AacAudioDescriptionBroadcasterMix
audioDescriptionBroadcasterMix :: Maybe AacAudioDescriptionBroadcasterMix
$sel:audioDescriptionBroadcasterMix:AacSettings' :: AacSettings -> Maybe AacAudioDescriptionBroadcasterMix
audioDescriptionBroadcasterMix} -> Maybe AacAudioDescriptionBroadcasterMix
audioDescriptionBroadcasterMix) (\s :: AacSettings
s@AacSettings' {} Maybe AacAudioDescriptionBroadcasterMix
a -> AacSettings
s {$sel:audioDescriptionBroadcasterMix:AacSettings' :: Maybe AacAudioDescriptionBroadcasterMix
audioDescriptionBroadcasterMix = Maybe AacAudioDescriptionBroadcasterMix
a} :: AacSettings)

-- | Enables LATM\/LOAS AAC output. Note that if you use LATM\/LOAS AAC in an
-- output, you must choose \"No container\" for the output container.
aacSettings_rawFormat :: Lens.Lens' AacSettings (Prelude.Maybe AacRawFormat)
aacSettings_rawFormat :: (Maybe AacRawFormat -> f (Maybe AacRawFormat))
-> AacSettings -> f AacSettings
aacSettings_rawFormat = (AacSettings -> Maybe AacRawFormat)
-> (AacSettings -> Maybe AacRawFormat -> AacSettings)
-> Lens
     AacSettings AacSettings (Maybe AacRawFormat) (Maybe AacRawFormat)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AacSettings' {Maybe AacRawFormat
rawFormat :: Maybe AacRawFormat
$sel:rawFormat:AacSettings' :: AacSettings -> Maybe AacRawFormat
rawFormat} -> Maybe AacRawFormat
rawFormat) (\s :: AacSettings
s@AacSettings' {} Maybe AacRawFormat
a -> AacSettings
s {$sel:rawFormat:AacSettings' :: Maybe AacRawFormat
rawFormat = Maybe AacRawFormat
a} :: AacSettings)

-- | Mono (Audio Description), Mono, Stereo, or 5.1 channel layout. Valid
-- values depend on rate control mode and profile. \"1.0 - Audio
-- Description (Receiver Mix)\" setting receives a stereo description plus
-- control track and emits a mono AAC encode of the description track, with
-- control data emitted in the PES header as per ETSI TS 101 154 Annex E.
aacSettings_codingMode :: Lens.Lens' AacSettings (Prelude.Maybe AacCodingMode)
aacSettings_codingMode :: (Maybe AacCodingMode -> f (Maybe AacCodingMode))
-> AacSettings -> f AacSettings
aacSettings_codingMode = (AacSettings -> Maybe AacCodingMode)
-> (AacSettings -> Maybe AacCodingMode -> AacSettings)
-> Lens
     AacSettings AacSettings (Maybe AacCodingMode) (Maybe AacCodingMode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AacSettings' {Maybe AacCodingMode
codingMode :: Maybe AacCodingMode
$sel:codingMode:AacSettings' :: AacSettings -> Maybe AacCodingMode
codingMode} -> Maybe AacCodingMode
codingMode) (\s :: AacSettings
s@AacSettings' {} Maybe AacCodingMode
a -> AacSettings
s {$sel:codingMode:AacSettings' :: Maybe AacCodingMode
codingMode = Maybe AacCodingMode
a} :: AacSettings)

-- | Rate Control Mode.
aacSettings_rateControlMode :: Lens.Lens' AacSettings (Prelude.Maybe AacRateControlMode)
aacSettings_rateControlMode :: (Maybe AacRateControlMode -> f (Maybe AacRateControlMode))
-> AacSettings -> f AacSettings
aacSettings_rateControlMode = (AacSettings -> Maybe AacRateControlMode)
-> (AacSettings -> Maybe AacRateControlMode -> AacSettings)
-> Lens
     AacSettings
     AacSettings
     (Maybe AacRateControlMode)
     (Maybe AacRateControlMode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AacSettings' {Maybe AacRateControlMode
rateControlMode :: Maybe AacRateControlMode
$sel:rateControlMode:AacSettings' :: AacSettings -> Maybe AacRateControlMode
rateControlMode} -> Maybe AacRateControlMode
rateControlMode) (\s :: AacSettings
s@AacSettings' {} Maybe AacRateControlMode
a -> AacSettings
s {$sel:rateControlMode:AacSettings' :: Maybe AacRateControlMode
rateControlMode = Maybe AacRateControlMode
a} :: AacSettings)

-- | Sample rate in Hz. Valid values depend on rate control mode and profile.
aacSettings_sampleRate :: Lens.Lens' AacSettings (Prelude.Maybe Prelude.Natural)
aacSettings_sampleRate :: (Maybe Natural -> f (Maybe Natural))
-> AacSettings -> f AacSettings
aacSettings_sampleRate = (AacSettings -> Maybe Natural)
-> (AacSettings -> Maybe Natural -> AacSettings)
-> Lens AacSettings AacSettings (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AacSettings' {Maybe Natural
sampleRate :: Maybe Natural
$sel:sampleRate:AacSettings' :: AacSettings -> Maybe Natural
sampleRate} -> Maybe Natural
sampleRate) (\s :: AacSettings
s@AacSettings' {} Maybe Natural
a -> AacSettings
s {$sel:sampleRate:AacSettings' :: Maybe Natural
sampleRate = Maybe Natural
a} :: AacSettings)

-- | Use MPEG-2 AAC instead of MPEG-4 AAC audio for raw or MPEG-2 Transport
-- Stream containers.
aacSettings_specification :: Lens.Lens' AacSettings (Prelude.Maybe AacSpecification)
aacSettings_specification :: (Maybe AacSpecification -> f (Maybe AacSpecification))
-> AacSettings -> f AacSettings
aacSettings_specification = (AacSettings -> Maybe AacSpecification)
-> (AacSettings -> Maybe AacSpecification -> AacSettings)
-> Lens
     AacSettings
     AacSettings
     (Maybe AacSpecification)
     (Maybe AacSpecification)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AacSettings' {Maybe AacSpecification
specification :: Maybe AacSpecification
$sel:specification:AacSettings' :: AacSettings -> Maybe AacSpecification
specification} -> Maybe AacSpecification
specification) (\s :: AacSettings
s@AacSettings' {} Maybe AacSpecification
a -> AacSettings
s {$sel:specification:AacSettings' :: Maybe AacSpecification
specification = Maybe AacSpecification
a} :: AacSettings)

-- | AAC Profile.
aacSettings_codecProfile :: Lens.Lens' AacSettings (Prelude.Maybe AacCodecProfile)
aacSettings_codecProfile :: (Maybe AacCodecProfile -> f (Maybe AacCodecProfile))
-> AacSettings -> f AacSettings
aacSettings_codecProfile = (AacSettings -> Maybe AacCodecProfile)
-> (AacSettings -> Maybe AacCodecProfile -> AacSettings)
-> Lens
     AacSettings
     AacSettings
     (Maybe AacCodecProfile)
     (Maybe AacCodecProfile)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AacSettings' {Maybe AacCodecProfile
codecProfile :: Maybe AacCodecProfile
$sel:codecProfile:AacSettings' :: AacSettings -> Maybe AacCodecProfile
codecProfile} -> Maybe AacCodecProfile
codecProfile) (\s :: AacSettings
s@AacSettings' {} Maybe AacCodecProfile
a -> AacSettings
s {$sel:codecProfile:AacSettings' :: Maybe AacCodecProfile
codecProfile = Maybe AacCodecProfile
a} :: AacSettings)

-- | Specify the average bitrate in bits per second. The set of valid values
-- for this setting is: 6000, 8000, 10000, 12000, 14000, 16000, 20000,
-- 24000, 28000, 32000, 40000, 48000, 56000, 64000, 80000, 96000, 112000,
-- 128000, 160000, 192000, 224000, 256000, 288000, 320000, 384000, 448000,
-- 512000, 576000, 640000, 768000, 896000, 1024000. The value you set is
-- also constrained by the values that you choose for Profile
-- (codecProfile), Bitrate control mode (codingMode), and Sample rate
-- (sampleRate). Default values depend on Bitrate control mode and Profile.
aacSettings_bitrate :: Lens.Lens' AacSettings (Prelude.Maybe Prelude.Natural)
aacSettings_bitrate :: (Maybe Natural -> f (Maybe Natural))
-> AacSettings -> f AacSettings
aacSettings_bitrate = (AacSettings -> Maybe Natural)
-> (AacSettings -> Maybe Natural -> AacSettings)
-> Lens AacSettings AacSettings (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AacSettings' {Maybe Natural
bitrate :: Maybe Natural
$sel:bitrate:AacSettings' :: AacSettings -> Maybe Natural
bitrate} -> Maybe Natural
bitrate) (\s :: AacSettings
s@AacSettings' {} Maybe Natural
a -> AacSettings
s {$sel:bitrate:AacSettings' :: Maybe Natural
bitrate = Maybe Natural
a} :: AacSettings)

-- | VBR Quality Level - Only used if rate_control_mode is VBR.
aacSettings_vbrQuality :: Lens.Lens' AacSettings (Prelude.Maybe AacVbrQuality)
aacSettings_vbrQuality :: (Maybe AacVbrQuality -> f (Maybe AacVbrQuality))
-> AacSettings -> f AacSettings
aacSettings_vbrQuality = (AacSettings -> Maybe AacVbrQuality)
-> (AacSettings -> Maybe AacVbrQuality -> AacSettings)
-> Lens
     AacSettings AacSettings (Maybe AacVbrQuality) (Maybe AacVbrQuality)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AacSettings' {Maybe AacVbrQuality
vbrQuality :: Maybe AacVbrQuality
$sel:vbrQuality:AacSettings' :: AacSettings -> Maybe AacVbrQuality
vbrQuality} -> Maybe AacVbrQuality
vbrQuality) (\s :: AacSettings
s@AacSettings' {} Maybe AacVbrQuality
a -> AacSettings
s {$sel:vbrQuality:AacSettings' :: Maybe AacVbrQuality
vbrQuality = Maybe AacVbrQuality
a} :: AacSettings)

instance Core.FromJSON AacSettings where
  parseJSON :: Value -> Parser AacSettings
parseJSON =
    String
-> (Object -> Parser AacSettings) -> Value -> Parser AacSettings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AacSettings"
      ( \Object
x ->
          Maybe AacAudioDescriptionBroadcasterMix
-> Maybe AacRawFormat
-> Maybe AacCodingMode
-> Maybe AacRateControlMode
-> Maybe Natural
-> Maybe AacSpecification
-> Maybe AacCodecProfile
-> Maybe Natural
-> Maybe AacVbrQuality
-> AacSettings
AacSettings'
            (Maybe AacAudioDescriptionBroadcasterMix
 -> Maybe AacRawFormat
 -> Maybe AacCodingMode
 -> Maybe AacRateControlMode
 -> Maybe Natural
 -> Maybe AacSpecification
 -> Maybe AacCodecProfile
 -> Maybe Natural
 -> Maybe AacVbrQuality
 -> AacSettings)
-> Parser (Maybe AacAudioDescriptionBroadcasterMix)
-> Parser
     (Maybe AacRawFormat
      -> Maybe AacCodingMode
      -> Maybe AacRateControlMode
      -> Maybe Natural
      -> Maybe AacSpecification
      -> Maybe AacCodecProfile
      -> Maybe Natural
      -> Maybe AacVbrQuality
      -> AacSettings)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe AacAudioDescriptionBroadcasterMix)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"audioDescriptionBroadcasterMix")
            Parser
  (Maybe AacRawFormat
   -> Maybe AacCodingMode
   -> Maybe AacRateControlMode
   -> Maybe Natural
   -> Maybe AacSpecification
   -> Maybe AacCodecProfile
   -> Maybe Natural
   -> Maybe AacVbrQuality
   -> AacSettings)
-> Parser (Maybe AacRawFormat)
-> Parser
     (Maybe AacCodingMode
      -> Maybe AacRateControlMode
      -> Maybe Natural
      -> Maybe AacSpecification
      -> Maybe AacCodecProfile
      -> Maybe Natural
      -> Maybe AacVbrQuality
      -> AacSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AacRawFormat)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"rawFormat")
            Parser
  (Maybe AacCodingMode
   -> Maybe AacRateControlMode
   -> Maybe Natural
   -> Maybe AacSpecification
   -> Maybe AacCodecProfile
   -> Maybe Natural
   -> Maybe AacVbrQuality
   -> AacSettings)
-> Parser (Maybe AacCodingMode)
-> Parser
     (Maybe AacRateControlMode
      -> Maybe Natural
      -> Maybe AacSpecification
      -> Maybe AacCodecProfile
      -> Maybe Natural
      -> Maybe AacVbrQuality
      -> AacSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AacCodingMode)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"codingMode")
            Parser
  (Maybe AacRateControlMode
   -> Maybe Natural
   -> Maybe AacSpecification
   -> Maybe AacCodecProfile
   -> Maybe Natural
   -> Maybe AacVbrQuality
   -> AacSettings)
-> Parser (Maybe AacRateControlMode)
-> Parser
     (Maybe Natural
      -> Maybe AacSpecification
      -> Maybe AacCodecProfile
      -> Maybe Natural
      -> Maybe AacVbrQuality
      -> AacSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AacRateControlMode)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"rateControlMode")
            Parser
  (Maybe Natural
   -> Maybe AacSpecification
   -> Maybe AacCodecProfile
   -> Maybe Natural
   -> Maybe AacVbrQuality
   -> AacSettings)
-> Parser (Maybe Natural)
-> Parser
     (Maybe AacSpecification
      -> Maybe AacCodecProfile
      -> Maybe Natural
      -> Maybe AacVbrQuality
      -> AacSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"sampleRate")
            Parser
  (Maybe AacSpecification
   -> Maybe AacCodecProfile
   -> Maybe Natural
   -> Maybe AacVbrQuality
   -> AacSettings)
-> Parser (Maybe AacSpecification)
-> Parser
     (Maybe AacCodecProfile
      -> Maybe Natural -> Maybe AacVbrQuality -> AacSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AacSpecification)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"specification")
            Parser
  (Maybe AacCodecProfile
   -> Maybe Natural -> Maybe AacVbrQuality -> AacSettings)
-> Parser (Maybe AacCodecProfile)
-> Parser (Maybe Natural -> Maybe AacVbrQuality -> AacSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AacCodecProfile)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"codecProfile")
            Parser (Maybe Natural -> Maybe AacVbrQuality -> AacSettings)
-> Parser (Maybe Natural)
-> Parser (Maybe AacVbrQuality -> AacSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"bitrate")
            Parser (Maybe AacVbrQuality -> AacSettings)
-> Parser (Maybe AacVbrQuality) -> Parser AacSettings
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AacVbrQuality)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"vbrQuality")
      )

instance Prelude.Hashable AacSettings

instance Prelude.NFData AacSettings

instance Core.ToJSON AacSettings where
  toJSON :: AacSettings -> Value
toJSON AacSettings' {Maybe Natural
Maybe AacAudioDescriptionBroadcasterMix
Maybe AacCodecProfile
Maybe AacCodingMode
Maybe AacRateControlMode
Maybe AacRawFormat
Maybe AacSpecification
Maybe AacVbrQuality
vbrQuality :: Maybe AacVbrQuality
bitrate :: Maybe Natural
codecProfile :: Maybe AacCodecProfile
specification :: Maybe AacSpecification
sampleRate :: Maybe Natural
rateControlMode :: Maybe AacRateControlMode
codingMode :: Maybe AacCodingMode
rawFormat :: Maybe AacRawFormat
audioDescriptionBroadcasterMix :: Maybe AacAudioDescriptionBroadcasterMix
$sel:vbrQuality:AacSettings' :: AacSettings -> Maybe AacVbrQuality
$sel:bitrate:AacSettings' :: AacSettings -> Maybe Natural
$sel:codecProfile:AacSettings' :: AacSettings -> Maybe AacCodecProfile
$sel:specification:AacSettings' :: AacSettings -> Maybe AacSpecification
$sel:sampleRate:AacSettings' :: AacSettings -> Maybe Natural
$sel:rateControlMode:AacSettings' :: AacSettings -> Maybe AacRateControlMode
$sel:codingMode:AacSettings' :: AacSettings -> Maybe AacCodingMode
$sel:rawFormat:AacSettings' :: AacSettings -> Maybe AacRawFormat
$sel:audioDescriptionBroadcasterMix:AacSettings' :: AacSettings -> Maybe AacAudioDescriptionBroadcasterMix
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"audioDescriptionBroadcasterMix" Text -> AacAudioDescriptionBroadcasterMix -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (AacAudioDescriptionBroadcasterMix -> Pair)
-> Maybe AacAudioDescriptionBroadcasterMix -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AacAudioDescriptionBroadcasterMix
audioDescriptionBroadcasterMix,
            (Text
"rawFormat" Text -> AacRawFormat -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (AacRawFormat -> Pair) -> Maybe AacRawFormat -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AacRawFormat
rawFormat,
            (Text
"codingMode" Text -> AacCodingMode -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (AacCodingMode -> Pair) -> Maybe AacCodingMode -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AacCodingMode
codingMode,
            (Text
"rateControlMode" Text -> AacRateControlMode -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (AacRateControlMode -> Pair)
-> Maybe AacRateControlMode -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AacRateControlMode
rateControlMode,
            (Text
"sampleRate" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
sampleRate,
            (Text
"specification" Text -> AacSpecification -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (AacSpecification -> Pair) -> Maybe AacSpecification -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AacSpecification
specification,
            (Text
"codecProfile" Text -> AacCodecProfile -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (AacCodecProfile -> Pair) -> Maybe AacCodecProfile -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AacCodecProfile
codecProfile,
            (Text
"bitrate" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
bitrate,
            (Text
"vbrQuality" Text -> AacVbrQuality -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (AacVbrQuality -> Pair) -> Maybe AacVbrQuality -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AacVbrQuality
vbrQuality
          ]
      )