{-# 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.Fmp4HlsSettings
-- 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.Fmp4HlsSettings 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.Fmp4NielsenId3Behavior
import Amazonka.MediaLive.Types.Fmp4TimedMetadataBehavior
import qualified Amazonka.Prelude as Prelude

-- | Fmp4 Hls Settings
--
-- /See:/ 'newFmp4HlsSettings' smart constructor.
data Fmp4HlsSettings = Fmp4HlsSettings'
  { -- | List all the audio groups that are used with the video output stream.
    -- Input all the audio GROUP-IDs that are associated to the video, separate
    -- by \',\'.
    Fmp4HlsSettings -> Maybe Text
audioRenditionSets :: Prelude.Maybe Prelude.Text,
    -- | If set to passthrough, Nielsen inaudible tones for media tracking will
    -- be detected in the input audio and an equivalent ID3 tag will be
    -- inserted in the output.
    Fmp4HlsSettings -> Maybe Fmp4NielsenId3Behavior
nielsenId3Behavior :: Prelude.Maybe Fmp4NielsenId3Behavior,
    -- | When set to passthrough, timed metadata is passed through from input to
    -- output.
    Fmp4HlsSettings -> Maybe Fmp4TimedMetadataBehavior
timedMetadataBehavior :: Prelude.Maybe Fmp4TimedMetadataBehavior
  }
  deriving (Fmp4HlsSettings -> Fmp4HlsSettings -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Fmp4HlsSettings -> Fmp4HlsSettings -> Bool
$c/= :: Fmp4HlsSettings -> Fmp4HlsSettings -> Bool
== :: Fmp4HlsSettings -> Fmp4HlsSettings -> Bool
$c== :: Fmp4HlsSettings -> Fmp4HlsSettings -> Bool
Prelude.Eq, ReadPrec [Fmp4HlsSettings]
ReadPrec Fmp4HlsSettings
Int -> ReadS Fmp4HlsSettings
ReadS [Fmp4HlsSettings]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Fmp4HlsSettings]
$creadListPrec :: ReadPrec [Fmp4HlsSettings]
readPrec :: ReadPrec Fmp4HlsSettings
$creadPrec :: ReadPrec Fmp4HlsSettings
readList :: ReadS [Fmp4HlsSettings]
$creadList :: ReadS [Fmp4HlsSettings]
readsPrec :: Int -> ReadS Fmp4HlsSettings
$creadsPrec :: Int -> ReadS Fmp4HlsSettings
Prelude.Read, Int -> Fmp4HlsSettings -> ShowS
[Fmp4HlsSettings] -> ShowS
Fmp4HlsSettings -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Fmp4HlsSettings] -> ShowS
$cshowList :: [Fmp4HlsSettings] -> ShowS
show :: Fmp4HlsSettings -> String
$cshow :: Fmp4HlsSettings -> String
showsPrec :: Int -> Fmp4HlsSettings -> ShowS
$cshowsPrec :: Int -> Fmp4HlsSettings -> ShowS
Prelude.Show, forall x. Rep Fmp4HlsSettings x -> Fmp4HlsSettings
forall x. Fmp4HlsSettings -> Rep Fmp4HlsSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Fmp4HlsSettings x -> Fmp4HlsSettings
$cfrom :: forall x. Fmp4HlsSettings -> Rep Fmp4HlsSettings x
Prelude.Generic)

-- |
-- Create a value of 'Fmp4HlsSettings' 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:
--
-- 'audioRenditionSets', 'fmp4HlsSettings_audioRenditionSets' - List all the audio groups that are used with the video output stream.
-- Input all the audio GROUP-IDs that are associated to the video, separate
-- by \',\'.
--
-- 'nielsenId3Behavior', 'fmp4HlsSettings_nielsenId3Behavior' - If set to passthrough, Nielsen inaudible tones for media tracking will
-- be detected in the input audio and an equivalent ID3 tag will be
-- inserted in the output.
--
-- 'timedMetadataBehavior', 'fmp4HlsSettings_timedMetadataBehavior' - When set to passthrough, timed metadata is passed through from input to
-- output.
newFmp4HlsSettings ::
  Fmp4HlsSettings
newFmp4HlsSettings :: Fmp4HlsSettings
newFmp4HlsSettings =
  Fmp4HlsSettings'
    { $sel:audioRenditionSets:Fmp4HlsSettings' :: Maybe Text
audioRenditionSets =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nielsenId3Behavior:Fmp4HlsSettings' :: Maybe Fmp4NielsenId3Behavior
nielsenId3Behavior = forall a. Maybe a
Prelude.Nothing,
      $sel:timedMetadataBehavior:Fmp4HlsSettings' :: Maybe Fmp4TimedMetadataBehavior
timedMetadataBehavior = forall a. Maybe a
Prelude.Nothing
    }

-- | List all the audio groups that are used with the video output stream.
-- Input all the audio GROUP-IDs that are associated to the video, separate
-- by \',\'.
fmp4HlsSettings_audioRenditionSets :: Lens.Lens' Fmp4HlsSettings (Prelude.Maybe Prelude.Text)
fmp4HlsSettings_audioRenditionSets :: Lens' Fmp4HlsSettings (Maybe Text)
fmp4HlsSettings_audioRenditionSets = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Fmp4HlsSettings' {Maybe Text
audioRenditionSets :: Maybe Text
$sel:audioRenditionSets:Fmp4HlsSettings' :: Fmp4HlsSettings -> Maybe Text
audioRenditionSets} -> Maybe Text
audioRenditionSets) (\s :: Fmp4HlsSettings
s@Fmp4HlsSettings' {} Maybe Text
a -> Fmp4HlsSettings
s {$sel:audioRenditionSets:Fmp4HlsSettings' :: Maybe Text
audioRenditionSets = Maybe Text
a} :: Fmp4HlsSettings)

-- | If set to passthrough, Nielsen inaudible tones for media tracking will
-- be detected in the input audio and an equivalent ID3 tag will be
-- inserted in the output.
fmp4HlsSettings_nielsenId3Behavior :: Lens.Lens' Fmp4HlsSettings (Prelude.Maybe Fmp4NielsenId3Behavior)
fmp4HlsSettings_nielsenId3Behavior :: Lens' Fmp4HlsSettings (Maybe Fmp4NielsenId3Behavior)
fmp4HlsSettings_nielsenId3Behavior = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Fmp4HlsSettings' {Maybe Fmp4NielsenId3Behavior
nielsenId3Behavior :: Maybe Fmp4NielsenId3Behavior
$sel:nielsenId3Behavior:Fmp4HlsSettings' :: Fmp4HlsSettings -> Maybe Fmp4NielsenId3Behavior
nielsenId3Behavior} -> Maybe Fmp4NielsenId3Behavior
nielsenId3Behavior) (\s :: Fmp4HlsSettings
s@Fmp4HlsSettings' {} Maybe Fmp4NielsenId3Behavior
a -> Fmp4HlsSettings
s {$sel:nielsenId3Behavior:Fmp4HlsSettings' :: Maybe Fmp4NielsenId3Behavior
nielsenId3Behavior = Maybe Fmp4NielsenId3Behavior
a} :: Fmp4HlsSettings)

-- | When set to passthrough, timed metadata is passed through from input to
-- output.
fmp4HlsSettings_timedMetadataBehavior :: Lens.Lens' Fmp4HlsSettings (Prelude.Maybe Fmp4TimedMetadataBehavior)
fmp4HlsSettings_timedMetadataBehavior :: Lens' Fmp4HlsSettings (Maybe Fmp4TimedMetadataBehavior)
fmp4HlsSettings_timedMetadataBehavior = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Fmp4HlsSettings' {Maybe Fmp4TimedMetadataBehavior
timedMetadataBehavior :: Maybe Fmp4TimedMetadataBehavior
$sel:timedMetadataBehavior:Fmp4HlsSettings' :: Fmp4HlsSettings -> Maybe Fmp4TimedMetadataBehavior
timedMetadataBehavior} -> Maybe Fmp4TimedMetadataBehavior
timedMetadataBehavior) (\s :: Fmp4HlsSettings
s@Fmp4HlsSettings' {} Maybe Fmp4TimedMetadataBehavior
a -> Fmp4HlsSettings
s {$sel:timedMetadataBehavior:Fmp4HlsSettings' :: Maybe Fmp4TimedMetadataBehavior
timedMetadataBehavior = Maybe Fmp4TimedMetadataBehavior
a} :: Fmp4HlsSettings)

instance Data.FromJSON Fmp4HlsSettings where
  parseJSON :: Value -> Parser Fmp4HlsSettings
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"Fmp4HlsSettings"
      ( \Object
x ->
          Maybe Text
-> Maybe Fmp4NielsenId3Behavior
-> Maybe Fmp4TimedMetadataBehavior
-> Fmp4HlsSettings
Fmp4HlsSettings'
            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
"audioRenditionSets")
            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
"nielsenId3Behavior")
            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
"timedMetadataBehavior")
      )

instance Prelude.Hashable Fmp4HlsSettings where
  hashWithSalt :: Int -> Fmp4HlsSettings -> Int
hashWithSalt Int
_salt Fmp4HlsSettings' {Maybe Text
Maybe Fmp4NielsenId3Behavior
Maybe Fmp4TimedMetadataBehavior
timedMetadataBehavior :: Maybe Fmp4TimedMetadataBehavior
nielsenId3Behavior :: Maybe Fmp4NielsenId3Behavior
audioRenditionSets :: Maybe Text
$sel:timedMetadataBehavior:Fmp4HlsSettings' :: Fmp4HlsSettings -> Maybe Fmp4TimedMetadataBehavior
$sel:nielsenId3Behavior:Fmp4HlsSettings' :: Fmp4HlsSettings -> Maybe Fmp4NielsenId3Behavior
$sel:audioRenditionSets:Fmp4HlsSettings' :: Fmp4HlsSettings -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
audioRenditionSets
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Fmp4NielsenId3Behavior
nielsenId3Behavior
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Fmp4TimedMetadataBehavior
timedMetadataBehavior

instance Prelude.NFData Fmp4HlsSettings where
  rnf :: Fmp4HlsSettings -> ()
rnf Fmp4HlsSettings' {Maybe Text
Maybe Fmp4NielsenId3Behavior
Maybe Fmp4TimedMetadataBehavior
timedMetadataBehavior :: Maybe Fmp4TimedMetadataBehavior
nielsenId3Behavior :: Maybe Fmp4NielsenId3Behavior
audioRenditionSets :: Maybe Text
$sel:timedMetadataBehavior:Fmp4HlsSettings' :: Fmp4HlsSettings -> Maybe Fmp4TimedMetadataBehavior
$sel:nielsenId3Behavior:Fmp4HlsSettings' :: Fmp4HlsSettings -> Maybe Fmp4NielsenId3Behavior
$sel:audioRenditionSets:Fmp4HlsSettings' :: Fmp4HlsSettings -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
audioRenditionSets
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Fmp4NielsenId3Behavior
nielsenId3Behavior
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Fmp4TimedMetadataBehavior
timedMetadataBehavior

instance Data.ToJSON Fmp4HlsSettings where
  toJSON :: Fmp4HlsSettings -> Value
toJSON Fmp4HlsSettings' {Maybe Text
Maybe Fmp4NielsenId3Behavior
Maybe Fmp4TimedMetadataBehavior
timedMetadataBehavior :: Maybe Fmp4TimedMetadataBehavior
nielsenId3Behavior :: Maybe Fmp4NielsenId3Behavior
audioRenditionSets :: Maybe Text
$sel:timedMetadataBehavior:Fmp4HlsSettings' :: Fmp4HlsSettings -> Maybe Fmp4TimedMetadataBehavior
$sel:nielsenId3Behavior:Fmp4HlsSettings' :: Fmp4HlsSettings -> Maybe Fmp4NielsenId3Behavior
$sel:audioRenditionSets:Fmp4HlsSettings' :: Fmp4HlsSettings -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"audioRenditionSets" 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
audioRenditionSets,
            (Key
"nielsenId3Behavior" 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 Fmp4NielsenId3Behavior
nielsenId3Behavior,
            (Key
"timedMetadataBehavior" 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 Fmp4TimedMetadataBehavior
timedMetadataBehavior
          ]
      )