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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaLive.Types.AudioHlsRenditionSelection
import Amazonka.MediaLive.Types.AudioLanguageSelection
import Amazonka.MediaLive.Types.AudioPidSelection
import Amazonka.MediaLive.Types.AudioTrackSelection
import qualified Amazonka.Prelude as Prelude

-- | Audio Selector Settings
--
-- /See:/ 'newAudioSelectorSettings' smart constructor.
data AudioSelectorSettings = AudioSelectorSettings'
  { AudioSelectorSettings -> Maybe AudioLanguageSelection
audioLanguageSelection :: Prelude.Maybe AudioLanguageSelection,
    AudioSelectorSettings -> Maybe AudioTrackSelection
audioTrackSelection :: Prelude.Maybe AudioTrackSelection,
    AudioSelectorSettings -> Maybe AudioHlsRenditionSelection
audioHlsRenditionSelection :: Prelude.Maybe AudioHlsRenditionSelection,
    AudioSelectorSettings -> Maybe AudioPidSelection
audioPidSelection :: Prelude.Maybe AudioPidSelection
  }
  deriving (AudioSelectorSettings -> AudioSelectorSettings -> Bool
(AudioSelectorSettings -> AudioSelectorSettings -> Bool)
-> (AudioSelectorSettings -> AudioSelectorSettings -> Bool)
-> Eq AudioSelectorSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AudioSelectorSettings -> AudioSelectorSettings -> Bool
$c/= :: AudioSelectorSettings -> AudioSelectorSettings -> Bool
== :: AudioSelectorSettings -> AudioSelectorSettings -> Bool
$c== :: AudioSelectorSettings -> AudioSelectorSettings -> Bool
Prelude.Eq, ReadPrec [AudioSelectorSettings]
ReadPrec AudioSelectorSettings
Int -> ReadS AudioSelectorSettings
ReadS [AudioSelectorSettings]
(Int -> ReadS AudioSelectorSettings)
-> ReadS [AudioSelectorSettings]
-> ReadPrec AudioSelectorSettings
-> ReadPrec [AudioSelectorSettings]
-> Read AudioSelectorSettings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AudioSelectorSettings]
$creadListPrec :: ReadPrec [AudioSelectorSettings]
readPrec :: ReadPrec AudioSelectorSettings
$creadPrec :: ReadPrec AudioSelectorSettings
readList :: ReadS [AudioSelectorSettings]
$creadList :: ReadS [AudioSelectorSettings]
readsPrec :: Int -> ReadS AudioSelectorSettings
$creadsPrec :: Int -> ReadS AudioSelectorSettings
Prelude.Read, Int -> AudioSelectorSettings -> ShowS
[AudioSelectorSettings] -> ShowS
AudioSelectorSettings -> String
(Int -> AudioSelectorSettings -> ShowS)
-> (AudioSelectorSettings -> String)
-> ([AudioSelectorSettings] -> ShowS)
-> Show AudioSelectorSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AudioSelectorSettings] -> ShowS
$cshowList :: [AudioSelectorSettings] -> ShowS
show :: AudioSelectorSettings -> String
$cshow :: AudioSelectorSettings -> String
showsPrec :: Int -> AudioSelectorSettings -> ShowS
$cshowsPrec :: Int -> AudioSelectorSettings -> ShowS
Prelude.Show, (forall x. AudioSelectorSettings -> Rep AudioSelectorSettings x)
-> (forall x. Rep AudioSelectorSettings x -> AudioSelectorSettings)
-> Generic AudioSelectorSettings
forall x. Rep AudioSelectorSettings x -> AudioSelectorSettings
forall x. AudioSelectorSettings -> Rep AudioSelectorSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AudioSelectorSettings x -> AudioSelectorSettings
$cfrom :: forall x. AudioSelectorSettings -> Rep AudioSelectorSettings x
Prelude.Generic)

-- |
-- Create a value of 'AudioSelectorSettings' 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:
--
-- 'audioLanguageSelection', 'audioSelectorSettings_audioLanguageSelection' - Undocumented member.
--
-- 'audioTrackSelection', 'audioSelectorSettings_audioTrackSelection' - Undocumented member.
--
-- 'audioHlsRenditionSelection', 'audioSelectorSettings_audioHlsRenditionSelection' - Undocumented member.
--
-- 'audioPidSelection', 'audioSelectorSettings_audioPidSelection' - Undocumented member.
newAudioSelectorSettings ::
  AudioSelectorSettings
newAudioSelectorSettings :: AudioSelectorSettings
newAudioSelectorSettings =
  AudioSelectorSettings' :: Maybe AudioLanguageSelection
-> Maybe AudioTrackSelection
-> Maybe AudioHlsRenditionSelection
-> Maybe AudioPidSelection
-> AudioSelectorSettings
AudioSelectorSettings'
    { $sel:audioLanguageSelection:AudioSelectorSettings' :: Maybe AudioLanguageSelection
audioLanguageSelection =
        Maybe AudioLanguageSelection
forall a. Maybe a
Prelude.Nothing,
      $sel:audioTrackSelection:AudioSelectorSettings' :: Maybe AudioTrackSelection
audioTrackSelection = Maybe AudioTrackSelection
forall a. Maybe a
Prelude.Nothing,
      $sel:audioHlsRenditionSelection:AudioSelectorSettings' :: Maybe AudioHlsRenditionSelection
audioHlsRenditionSelection = Maybe AudioHlsRenditionSelection
forall a. Maybe a
Prelude.Nothing,
      $sel:audioPidSelection:AudioSelectorSettings' :: Maybe AudioPidSelection
audioPidSelection = Maybe AudioPidSelection
forall a. Maybe a
Prelude.Nothing
    }

-- | Undocumented member.
audioSelectorSettings_audioLanguageSelection :: Lens.Lens' AudioSelectorSettings (Prelude.Maybe AudioLanguageSelection)
audioSelectorSettings_audioLanguageSelection :: (Maybe AudioLanguageSelection -> f (Maybe AudioLanguageSelection))
-> AudioSelectorSettings -> f AudioSelectorSettings
audioSelectorSettings_audioLanguageSelection = (AudioSelectorSettings -> Maybe AudioLanguageSelection)
-> (AudioSelectorSettings
    -> Maybe AudioLanguageSelection -> AudioSelectorSettings)
-> Lens
     AudioSelectorSettings
     AudioSelectorSettings
     (Maybe AudioLanguageSelection)
     (Maybe AudioLanguageSelection)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AudioSelectorSettings' {Maybe AudioLanguageSelection
audioLanguageSelection :: Maybe AudioLanguageSelection
$sel:audioLanguageSelection:AudioSelectorSettings' :: AudioSelectorSettings -> Maybe AudioLanguageSelection
audioLanguageSelection} -> Maybe AudioLanguageSelection
audioLanguageSelection) (\s :: AudioSelectorSettings
s@AudioSelectorSettings' {} Maybe AudioLanguageSelection
a -> AudioSelectorSettings
s {$sel:audioLanguageSelection:AudioSelectorSettings' :: Maybe AudioLanguageSelection
audioLanguageSelection = Maybe AudioLanguageSelection
a} :: AudioSelectorSettings)

-- | Undocumented member.
audioSelectorSettings_audioTrackSelection :: Lens.Lens' AudioSelectorSettings (Prelude.Maybe AudioTrackSelection)
audioSelectorSettings_audioTrackSelection :: (Maybe AudioTrackSelection -> f (Maybe AudioTrackSelection))
-> AudioSelectorSettings -> f AudioSelectorSettings
audioSelectorSettings_audioTrackSelection = (AudioSelectorSettings -> Maybe AudioTrackSelection)
-> (AudioSelectorSettings
    -> Maybe AudioTrackSelection -> AudioSelectorSettings)
-> Lens
     AudioSelectorSettings
     AudioSelectorSettings
     (Maybe AudioTrackSelection)
     (Maybe AudioTrackSelection)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AudioSelectorSettings' {Maybe AudioTrackSelection
audioTrackSelection :: Maybe AudioTrackSelection
$sel:audioTrackSelection:AudioSelectorSettings' :: AudioSelectorSettings -> Maybe AudioTrackSelection
audioTrackSelection} -> Maybe AudioTrackSelection
audioTrackSelection) (\s :: AudioSelectorSettings
s@AudioSelectorSettings' {} Maybe AudioTrackSelection
a -> AudioSelectorSettings
s {$sel:audioTrackSelection:AudioSelectorSettings' :: Maybe AudioTrackSelection
audioTrackSelection = Maybe AudioTrackSelection
a} :: AudioSelectorSettings)

-- | Undocumented member.
audioSelectorSettings_audioHlsRenditionSelection :: Lens.Lens' AudioSelectorSettings (Prelude.Maybe AudioHlsRenditionSelection)
audioSelectorSettings_audioHlsRenditionSelection :: (Maybe AudioHlsRenditionSelection
 -> f (Maybe AudioHlsRenditionSelection))
-> AudioSelectorSettings -> f AudioSelectorSettings
audioSelectorSettings_audioHlsRenditionSelection = (AudioSelectorSettings -> Maybe AudioHlsRenditionSelection)
-> (AudioSelectorSettings
    -> Maybe AudioHlsRenditionSelection -> AudioSelectorSettings)
-> Lens
     AudioSelectorSettings
     AudioSelectorSettings
     (Maybe AudioHlsRenditionSelection)
     (Maybe AudioHlsRenditionSelection)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AudioSelectorSettings' {Maybe AudioHlsRenditionSelection
audioHlsRenditionSelection :: Maybe AudioHlsRenditionSelection
$sel:audioHlsRenditionSelection:AudioSelectorSettings' :: AudioSelectorSettings -> Maybe AudioHlsRenditionSelection
audioHlsRenditionSelection} -> Maybe AudioHlsRenditionSelection
audioHlsRenditionSelection) (\s :: AudioSelectorSettings
s@AudioSelectorSettings' {} Maybe AudioHlsRenditionSelection
a -> AudioSelectorSettings
s {$sel:audioHlsRenditionSelection:AudioSelectorSettings' :: Maybe AudioHlsRenditionSelection
audioHlsRenditionSelection = Maybe AudioHlsRenditionSelection
a} :: AudioSelectorSettings)

-- | Undocumented member.
audioSelectorSettings_audioPidSelection :: Lens.Lens' AudioSelectorSettings (Prelude.Maybe AudioPidSelection)
audioSelectorSettings_audioPidSelection :: (Maybe AudioPidSelection -> f (Maybe AudioPidSelection))
-> AudioSelectorSettings -> f AudioSelectorSettings
audioSelectorSettings_audioPidSelection = (AudioSelectorSettings -> Maybe AudioPidSelection)
-> (AudioSelectorSettings
    -> Maybe AudioPidSelection -> AudioSelectorSettings)
-> Lens
     AudioSelectorSettings
     AudioSelectorSettings
     (Maybe AudioPidSelection)
     (Maybe AudioPidSelection)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AudioSelectorSettings' {Maybe AudioPidSelection
audioPidSelection :: Maybe AudioPidSelection
$sel:audioPidSelection:AudioSelectorSettings' :: AudioSelectorSettings -> Maybe AudioPidSelection
audioPidSelection} -> Maybe AudioPidSelection
audioPidSelection) (\s :: AudioSelectorSettings
s@AudioSelectorSettings' {} Maybe AudioPidSelection
a -> AudioSelectorSettings
s {$sel:audioPidSelection:AudioSelectorSettings' :: Maybe AudioPidSelection
audioPidSelection = Maybe AudioPidSelection
a} :: AudioSelectorSettings)

instance Core.FromJSON AudioSelectorSettings where
  parseJSON :: Value -> Parser AudioSelectorSettings
parseJSON =
    String
-> (Object -> Parser AudioSelectorSettings)
-> Value
-> Parser AudioSelectorSettings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AudioSelectorSettings"
      ( \Object
x ->
          Maybe AudioLanguageSelection
-> Maybe AudioTrackSelection
-> Maybe AudioHlsRenditionSelection
-> Maybe AudioPidSelection
-> AudioSelectorSettings
AudioSelectorSettings'
            (Maybe AudioLanguageSelection
 -> Maybe AudioTrackSelection
 -> Maybe AudioHlsRenditionSelection
 -> Maybe AudioPidSelection
 -> AudioSelectorSettings)
-> Parser (Maybe AudioLanguageSelection)
-> Parser
     (Maybe AudioTrackSelection
      -> Maybe AudioHlsRenditionSelection
      -> Maybe AudioPidSelection
      -> AudioSelectorSettings)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe AudioLanguageSelection)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"audioLanguageSelection")
            Parser
  (Maybe AudioTrackSelection
   -> Maybe AudioHlsRenditionSelection
   -> Maybe AudioPidSelection
   -> AudioSelectorSettings)
-> Parser (Maybe AudioTrackSelection)
-> Parser
     (Maybe AudioHlsRenditionSelection
      -> Maybe AudioPidSelection -> AudioSelectorSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AudioTrackSelection)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"audioTrackSelection")
            Parser
  (Maybe AudioHlsRenditionSelection
   -> Maybe AudioPidSelection -> AudioSelectorSettings)
-> Parser (Maybe AudioHlsRenditionSelection)
-> Parser (Maybe AudioPidSelection -> AudioSelectorSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AudioHlsRenditionSelection)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"audioHlsRenditionSelection")
            Parser (Maybe AudioPidSelection -> AudioSelectorSettings)
-> Parser (Maybe AudioPidSelection) -> Parser AudioSelectorSettings
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AudioPidSelection)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"audioPidSelection")
      )

instance Prelude.Hashable AudioSelectorSettings

instance Prelude.NFData AudioSelectorSettings

instance Core.ToJSON AudioSelectorSettings where
  toJSON :: AudioSelectorSettings -> Value
toJSON AudioSelectorSettings' {Maybe AudioHlsRenditionSelection
Maybe AudioLanguageSelection
Maybe AudioPidSelection
Maybe AudioTrackSelection
audioPidSelection :: Maybe AudioPidSelection
audioHlsRenditionSelection :: Maybe AudioHlsRenditionSelection
audioTrackSelection :: Maybe AudioTrackSelection
audioLanguageSelection :: Maybe AudioLanguageSelection
$sel:audioPidSelection:AudioSelectorSettings' :: AudioSelectorSettings -> Maybe AudioPidSelection
$sel:audioHlsRenditionSelection:AudioSelectorSettings' :: AudioSelectorSettings -> Maybe AudioHlsRenditionSelection
$sel:audioTrackSelection:AudioSelectorSettings' :: AudioSelectorSettings -> Maybe AudioTrackSelection
$sel:audioLanguageSelection:AudioSelectorSettings' :: AudioSelectorSettings -> Maybe AudioLanguageSelection
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"audioLanguageSelection" Text -> AudioLanguageSelection -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (AudioLanguageSelection -> Pair)
-> Maybe AudioLanguageSelection -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AudioLanguageSelection
audioLanguageSelection,
            (Text
"audioTrackSelection" Text -> AudioTrackSelection -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (AudioTrackSelection -> Pair)
-> Maybe AudioTrackSelection -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AudioTrackSelection
audioTrackSelection,
            (Text
"audioHlsRenditionSelection" Text -> AudioHlsRenditionSelection -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (AudioHlsRenditionSelection -> Pair)
-> Maybe AudioHlsRenditionSelection -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AudioHlsRenditionSelection
audioHlsRenditionSelection,
            (Text
"audioPidSelection" Text -> AudioPidSelection -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (AudioPidSelection -> Pair)
-> Maybe AudioPidSelection -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AudioPidSelection
audioPidSelection
          ]
      )