{-# 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.StandardHlsSettings
-- 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.StandardHlsSettings 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.M3u8Settings
import qualified Amazonka.Prelude as Prelude

-- | Standard Hls Settings
--
-- /See:/ 'newStandardHlsSettings' smart constructor.
data StandardHlsSettings = StandardHlsSettings'
  { -- | 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 \',\'.
    StandardHlsSettings -> Maybe Text
audioRenditionSets :: Prelude.Maybe Prelude.Text,
    StandardHlsSettings -> M3u8Settings
m3u8Settings :: M3u8Settings
  }
  deriving (StandardHlsSettings -> StandardHlsSettings -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StandardHlsSettings -> StandardHlsSettings -> Bool
$c/= :: StandardHlsSettings -> StandardHlsSettings -> Bool
== :: StandardHlsSettings -> StandardHlsSettings -> Bool
$c== :: StandardHlsSettings -> StandardHlsSettings -> Bool
Prelude.Eq, ReadPrec [StandardHlsSettings]
ReadPrec StandardHlsSettings
Int -> ReadS StandardHlsSettings
ReadS [StandardHlsSettings]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StandardHlsSettings]
$creadListPrec :: ReadPrec [StandardHlsSettings]
readPrec :: ReadPrec StandardHlsSettings
$creadPrec :: ReadPrec StandardHlsSettings
readList :: ReadS [StandardHlsSettings]
$creadList :: ReadS [StandardHlsSettings]
readsPrec :: Int -> ReadS StandardHlsSettings
$creadsPrec :: Int -> ReadS StandardHlsSettings
Prelude.Read, Int -> StandardHlsSettings -> ShowS
[StandardHlsSettings] -> ShowS
StandardHlsSettings -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StandardHlsSettings] -> ShowS
$cshowList :: [StandardHlsSettings] -> ShowS
show :: StandardHlsSettings -> String
$cshow :: StandardHlsSettings -> String
showsPrec :: Int -> StandardHlsSettings -> ShowS
$cshowsPrec :: Int -> StandardHlsSettings -> ShowS
Prelude.Show, forall x. Rep StandardHlsSettings x -> StandardHlsSettings
forall x. StandardHlsSettings -> Rep StandardHlsSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StandardHlsSettings x -> StandardHlsSettings
$cfrom :: forall x. StandardHlsSettings -> Rep StandardHlsSettings x
Prelude.Generic)

-- |
-- Create a value of 'StandardHlsSettings' 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', 'standardHlsSettings_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 \',\'.
--
-- 'm3u8Settings', 'standardHlsSettings_m3u8Settings' - Undocumented member.
newStandardHlsSettings ::
  -- | 'm3u8Settings'
  M3u8Settings ->
  StandardHlsSettings
newStandardHlsSettings :: M3u8Settings -> StandardHlsSettings
newStandardHlsSettings M3u8Settings
pM3u8Settings_ =
  StandardHlsSettings'
    { $sel:audioRenditionSets:StandardHlsSettings' :: Maybe Text
audioRenditionSets =
        forall a. Maybe a
Prelude.Nothing,
      $sel:m3u8Settings:StandardHlsSettings' :: M3u8Settings
m3u8Settings = M3u8Settings
pM3u8Settings_
    }

-- | 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 \',\'.
standardHlsSettings_audioRenditionSets :: Lens.Lens' StandardHlsSettings (Prelude.Maybe Prelude.Text)
standardHlsSettings_audioRenditionSets :: Lens' StandardHlsSettings (Maybe Text)
standardHlsSettings_audioRenditionSets = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StandardHlsSettings' {Maybe Text
audioRenditionSets :: Maybe Text
$sel:audioRenditionSets:StandardHlsSettings' :: StandardHlsSettings -> Maybe Text
audioRenditionSets} -> Maybe Text
audioRenditionSets) (\s :: StandardHlsSettings
s@StandardHlsSettings' {} Maybe Text
a -> StandardHlsSettings
s {$sel:audioRenditionSets:StandardHlsSettings' :: Maybe Text
audioRenditionSets = Maybe Text
a} :: StandardHlsSettings)

-- | Undocumented member.
standardHlsSettings_m3u8Settings :: Lens.Lens' StandardHlsSettings M3u8Settings
standardHlsSettings_m3u8Settings :: Lens' StandardHlsSettings M3u8Settings
standardHlsSettings_m3u8Settings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StandardHlsSettings' {M3u8Settings
m3u8Settings :: M3u8Settings
$sel:m3u8Settings:StandardHlsSettings' :: StandardHlsSettings -> M3u8Settings
m3u8Settings} -> M3u8Settings
m3u8Settings) (\s :: StandardHlsSettings
s@StandardHlsSettings' {} M3u8Settings
a -> StandardHlsSettings
s {$sel:m3u8Settings:StandardHlsSettings' :: M3u8Settings
m3u8Settings = M3u8Settings
a} :: StandardHlsSettings)

instance Data.FromJSON StandardHlsSettings where
  parseJSON :: Value -> Parser StandardHlsSettings
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"StandardHlsSettings"
      ( \Object
x ->
          Maybe Text -> M3u8Settings -> StandardHlsSettings
StandardHlsSettings'
            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 a
Data..: Key
"m3u8Settings")
      )

instance Prelude.Hashable StandardHlsSettings where
  hashWithSalt :: Int -> StandardHlsSettings -> Int
hashWithSalt Int
_salt StandardHlsSettings' {Maybe Text
M3u8Settings
m3u8Settings :: M3u8Settings
audioRenditionSets :: Maybe Text
$sel:m3u8Settings:StandardHlsSettings' :: StandardHlsSettings -> M3u8Settings
$sel:audioRenditionSets:StandardHlsSettings' :: StandardHlsSettings -> 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` M3u8Settings
m3u8Settings

instance Prelude.NFData StandardHlsSettings where
  rnf :: StandardHlsSettings -> ()
rnf StandardHlsSettings' {Maybe Text
M3u8Settings
m3u8Settings :: M3u8Settings
audioRenditionSets :: Maybe Text
$sel:m3u8Settings:StandardHlsSettings' :: StandardHlsSettings -> M3u8Settings
$sel:audioRenditionSets:StandardHlsSettings' :: StandardHlsSettings -> 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 M3u8Settings
m3u8Settings

instance Data.ToJSON StandardHlsSettings where
  toJSON :: StandardHlsSettings -> Value
toJSON StandardHlsSettings' {Maybe Text
M3u8Settings
m3u8Settings :: M3u8Settings
audioRenditionSets :: Maybe Text
$sel:m3u8Settings:StandardHlsSettings' :: StandardHlsSettings -> M3u8Settings
$sel:audioRenditionSets:StandardHlsSettings' :: StandardHlsSettings -> 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,
            forall a. a -> Maybe a
Prelude.Just (Key
"m3u8Settings" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= M3u8Settings
m3u8Settings)
          ]
      )