{-# 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.HlsSettings
-- 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.HlsSettings 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.AudioOnlyHlsSettings
import Amazonka.MediaLive.Types.Fmp4HlsSettings
import Amazonka.MediaLive.Types.FrameCaptureHlsSettings
import Amazonka.MediaLive.Types.StandardHlsSettings
import qualified Amazonka.Prelude as Prelude

-- | Hls Settings
--
-- /See:/ 'newHlsSettings' smart constructor.
data HlsSettings = HlsSettings'
  { HlsSettings -> Maybe AudioOnlyHlsSettings
audioOnlyHlsSettings :: Prelude.Maybe AudioOnlyHlsSettings,
    HlsSettings -> Maybe Fmp4HlsSettings
fmp4HlsSettings :: Prelude.Maybe Fmp4HlsSettings,
    HlsSettings -> Maybe FrameCaptureHlsSettings
frameCaptureHlsSettings :: Prelude.Maybe FrameCaptureHlsSettings,
    HlsSettings -> Maybe StandardHlsSettings
standardHlsSettings :: Prelude.Maybe StandardHlsSettings
  }
  deriving (HlsSettings -> HlsSettings -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HlsSettings -> HlsSettings -> Bool
$c/= :: HlsSettings -> HlsSettings -> Bool
== :: HlsSettings -> HlsSettings -> Bool
$c== :: HlsSettings -> HlsSettings -> Bool
Prelude.Eq, ReadPrec [HlsSettings]
ReadPrec HlsSettings
Int -> ReadS HlsSettings
ReadS [HlsSettings]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [HlsSettings]
$creadListPrec :: ReadPrec [HlsSettings]
readPrec :: ReadPrec HlsSettings
$creadPrec :: ReadPrec HlsSettings
readList :: ReadS [HlsSettings]
$creadList :: ReadS [HlsSettings]
readsPrec :: Int -> ReadS HlsSettings
$creadsPrec :: Int -> ReadS HlsSettings
Prelude.Read, Int -> HlsSettings -> ShowS
[HlsSettings] -> ShowS
HlsSettings -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HlsSettings] -> ShowS
$cshowList :: [HlsSettings] -> ShowS
show :: HlsSettings -> String
$cshow :: HlsSettings -> String
showsPrec :: Int -> HlsSettings -> ShowS
$cshowsPrec :: Int -> HlsSettings -> ShowS
Prelude.Show, forall x. Rep HlsSettings x -> HlsSettings
forall x. HlsSettings -> Rep HlsSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep HlsSettings x -> HlsSettings
$cfrom :: forall x. HlsSettings -> Rep HlsSettings x
Prelude.Generic)

-- |
-- Create a value of 'HlsSettings' 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:
--
-- 'audioOnlyHlsSettings', 'hlsSettings_audioOnlyHlsSettings' - Undocumented member.
--
-- 'fmp4HlsSettings', 'hlsSettings_fmp4HlsSettings' - Undocumented member.
--
-- 'frameCaptureHlsSettings', 'hlsSettings_frameCaptureHlsSettings' - Undocumented member.
--
-- 'standardHlsSettings', 'hlsSettings_standardHlsSettings' - Undocumented member.
newHlsSettings ::
  HlsSettings
newHlsSettings :: HlsSettings
newHlsSettings =
  HlsSettings'
    { $sel:audioOnlyHlsSettings:HlsSettings' :: Maybe AudioOnlyHlsSettings
audioOnlyHlsSettings =
        forall a. Maybe a
Prelude.Nothing,
      $sel:fmp4HlsSettings:HlsSettings' :: Maybe Fmp4HlsSettings
fmp4HlsSettings = forall a. Maybe a
Prelude.Nothing,
      $sel:frameCaptureHlsSettings:HlsSettings' :: Maybe FrameCaptureHlsSettings
frameCaptureHlsSettings = forall a. Maybe a
Prelude.Nothing,
      $sel:standardHlsSettings:HlsSettings' :: Maybe StandardHlsSettings
standardHlsSettings = forall a. Maybe a
Prelude.Nothing
    }

-- | Undocumented member.
hlsSettings_audioOnlyHlsSettings :: Lens.Lens' HlsSettings (Prelude.Maybe AudioOnlyHlsSettings)
hlsSettings_audioOnlyHlsSettings :: Lens' HlsSettings (Maybe AudioOnlyHlsSettings)
hlsSettings_audioOnlyHlsSettings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HlsSettings' {Maybe AudioOnlyHlsSettings
audioOnlyHlsSettings :: Maybe AudioOnlyHlsSettings
$sel:audioOnlyHlsSettings:HlsSettings' :: HlsSettings -> Maybe AudioOnlyHlsSettings
audioOnlyHlsSettings} -> Maybe AudioOnlyHlsSettings
audioOnlyHlsSettings) (\s :: HlsSettings
s@HlsSettings' {} Maybe AudioOnlyHlsSettings
a -> HlsSettings
s {$sel:audioOnlyHlsSettings:HlsSettings' :: Maybe AudioOnlyHlsSettings
audioOnlyHlsSettings = Maybe AudioOnlyHlsSettings
a} :: HlsSettings)

-- | Undocumented member.
hlsSettings_fmp4HlsSettings :: Lens.Lens' HlsSettings (Prelude.Maybe Fmp4HlsSettings)
hlsSettings_fmp4HlsSettings :: Lens' HlsSettings (Maybe Fmp4HlsSettings)
hlsSettings_fmp4HlsSettings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HlsSettings' {Maybe Fmp4HlsSettings
fmp4HlsSettings :: Maybe Fmp4HlsSettings
$sel:fmp4HlsSettings:HlsSettings' :: HlsSettings -> Maybe Fmp4HlsSettings
fmp4HlsSettings} -> Maybe Fmp4HlsSettings
fmp4HlsSettings) (\s :: HlsSettings
s@HlsSettings' {} Maybe Fmp4HlsSettings
a -> HlsSettings
s {$sel:fmp4HlsSettings:HlsSettings' :: Maybe Fmp4HlsSettings
fmp4HlsSettings = Maybe Fmp4HlsSettings
a} :: HlsSettings)

-- | Undocumented member.
hlsSettings_frameCaptureHlsSettings :: Lens.Lens' HlsSettings (Prelude.Maybe FrameCaptureHlsSettings)
hlsSettings_frameCaptureHlsSettings :: Lens' HlsSettings (Maybe FrameCaptureHlsSettings)
hlsSettings_frameCaptureHlsSettings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HlsSettings' {Maybe FrameCaptureHlsSettings
frameCaptureHlsSettings :: Maybe FrameCaptureHlsSettings
$sel:frameCaptureHlsSettings:HlsSettings' :: HlsSettings -> Maybe FrameCaptureHlsSettings
frameCaptureHlsSettings} -> Maybe FrameCaptureHlsSettings
frameCaptureHlsSettings) (\s :: HlsSettings
s@HlsSettings' {} Maybe FrameCaptureHlsSettings
a -> HlsSettings
s {$sel:frameCaptureHlsSettings:HlsSettings' :: Maybe FrameCaptureHlsSettings
frameCaptureHlsSettings = Maybe FrameCaptureHlsSettings
a} :: HlsSettings)

-- | Undocumented member.
hlsSettings_standardHlsSettings :: Lens.Lens' HlsSettings (Prelude.Maybe StandardHlsSettings)
hlsSettings_standardHlsSettings :: Lens' HlsSettings (Maybe StandardHlsSettings)
hlsSettings_standardHlsSettings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HlsSettings' {Maybe StandardHlsSettings
standardHlsSettings :: Maybe StandardHlsSettings
$sel:standardHlsSettings:HlsSettings' :: HlsSettings -> Maybe StandardHlsSettings
standardHlsSettings} -> Maybe StandardHlsSettings
standardHlsSettings) (\s :: HlsSettings
s@HlsSettings' {} Maybe StandardHlsSettings
a -> HlsSettings
s {$sel:standardHlsSettings:HlsSettings' :: Maybe StandardHlsSettings
standardHlsSettings = Maybe StandardHlsSettings
a} :: HlsSettings)

instance Data.FromJSON HlsSettings where
  parseJSON :: Value -> Parser HlsSettings
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"HlsSettings"
      ( \Object
x ->
          Maybe AudioOnlyHlsSettings
-> Maybe Fmp4HlsSettings
-> Maybe FrameCaptureHlsSettings
-> Maybe StandardHlsSettings
-> HlsSettings
HlsSettings'
            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
"audioOnlyHlsSettings")
            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
"fmp4HlsSettings")
            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
"frameCaptureHlsSettings")
            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
"standardHlsSettings")
      )

instance Prelude.Hashable HlsSettings where
  hashWithSalt :: Int -> HlsSettings -> Int
hashWithSalt Int
_salt HlsSettings' {Maybe Fmp4HlsSettings
Maybe FrameCaptureHlsSettings
Maybe AudioOnlyHlsSettings
Maybe StandardHlsSettings
standardHlsSettings :: Maybe StandardHlsSettings
frameCaptureHlsSettings :: Maybe FrameCaptureHlsSettings
fmp4HlsSettings :: Maybe Fmp4HlsSettings
audioOnlyHlsSettings :: Maybe AudioOnlyHlsSettings
$sel:standardHlsSettings:HlsSettings' :: HlsSettings -> Maybe StandardHlsSettings
$sel:frameCaptureHlsSettings:HlsSettings' :: HlsSettings -> Maybe FrameCaptureHlsSettings
$sel:fmp4HlsSettings:HlsSettings' :: HlsSettings -> Maybe Fmp4HlsSettings
$sel:audioOnlyHlsSettings:HlsSettings' :: HlsSettings -> Maybe AudioOnlyHlsSettings
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AudioOnlyHlsSettings
audioOnlyHlsSettings
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Fmp4HlsSettings
fmp4HlsSettings
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe FrameCaptureHlsSettings
frameCaptureHlsSettings
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe StandardHlsSettings
standardHlsSettings

instance Prelude.NFData HlsSettings where
  rnf :: HlsSettings -> ()
rnf HlsSettings' {Maybe Fmp4HlsSettings
Maybe FrameCaptureHlsSettings
Maybe AudioOnlyHlsSettings
Maybe StandardHlsSettings
standardHlsSettings :: Maybe StandardHlsSettings
frameCaptureHlsSettings :: Maybe FrameCaptureHlsSettings
fmp4HlsSettings :: Maybe Fmp4HlsSettings
audioOnlyHlsSettings :: Maybe AudioOnlyHlsSettings
$sel:standardHlsSettings:HlsSettings' :: HlsSettings -> Maybe StandardHlsSettings
$sel:frameCaptureHlsSettings:HlsSettings' :: HlsSettings -> Maybe FrameCaptureHlsSettings
$sel:fmp4HlsSettings:HlsSettings' :: HlsSettings -> Maybe Fmp4HlsSettings
$sel:audioOnlyHlsSettings:HlsSettings' :: HlsSettings -> Maybe AudioOnlyHlsSettings
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe AudioOnlyHlsSettings
audioOnlyHlsSettings
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Fmp4HlsSettings
fmp4HlsSettings
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe FrameCaptureHlsSettings
frameCaptureHlsSettings
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe StandardHlsSettings
standardHlsSettings

instance Data.ToJSON HlsSettings where
  toJSON :: HlsSettings -> Value
toJSON HlsSettings' {Maybe Fmp4HlsSettings
Maybe FrameCaptureHlsSettings
Maybe AudioOnlyHlsSettings
Maybe StandardHlsSettings
standardHlsSettings :: Maybe StandardHlsSettings
frameCaptureHlsSettings :: Maybe FrameCaptureHlsSettings
fmp4HlsSettings :: Maybe Fmp4HlsSettings
audioOnlyHlsSettings :: Maybe AudioOnlyHlsSettings
$sel:standardHlsSettings:HlsSettings' :: HlsSettings -> Maybe StandardHlsSettings
$sel:frameCaptureHlsSettings:HlsSettings' :: HlsSettings -> Maybe FrameCaptureHlsSettings
$sel:fmp4HlsSettings:HlsSettings' :: HlsSettings -> Maybe Fmp4HlsSettings
$sel:audioOnlyHlsSettings:HlsSettings' :: HlsSettings -> Maybe AudioOnlyHlsSettings
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"audioOnlyHlsSettings" 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 AudioOnlyHlsSettings
audioOnlyHlsSettings,
            (Key
"fmp4HlsSettings" 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 Fmp4HlsSettings
fmp4HlsSettings,
            (Key
"frameCaptureHlsSettings" 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 FrameCaptureHlsSettings
frameCaptureHlsSettings,
            (Key
"standardHlsSettings" 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 StandardHlsSettings
standardHlsSettings
          ]
      )