{-# 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 #-}
module Amazonka.MediaLive.Types.HlsSettings where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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
data HlsSettings = HlsSettings'
{ HlsSettings -> Maybe Fmp4HlsSettings
fmp4HlsSettings :: Prelude.Maybe Fmp4HlsSettings,
HlsSettings -> Maybe AudioOnlyHlsSettings
audioOnlyHlsSettings :: Prelude.Maybe AudioOnlyHlsSettings,
HlsSettings -> Maybe FrameCaptureHlsSettings
frameCaptureHlsSettings :: Prelude.Maybe FrameCaptureHlsSettings,
HlsSettings -> Maybe StandardHlsSettings
standardHlsSettings :: Prelude.Maybe StandardHlsSettings
}
deriving (HlsSettings -> HlsSettings -> Bool
(HlsSettings -> HlsSettings -> Bool)
-> (HlsSettings -> HlsSettings -> Bool) -> Eq HlsSettings
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]
(Int -> ReadS HlsSettings)
-> ReadS [HlsSettings]
-> ReadPrec HlsSettings
-> ReadPrec [HlsSettings]
-> Read 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
(Int -> HlsSettings -> ShowS)
-> (HlsSettings -> String)
-> ([HlsSettings] -> ShowS)
-> Show HlsSettings
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. HlsSettings -> Rep HlsSettings x)
-> (forall x. Rep HlsSettings x -> HlsSettings)
-> Generic HlsSettings
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)
newHlsSettings ::
HlsSettings
newHlsSettings :: HlsSettings
newHlsSettings =
HlsSettings' :: Maybe Fmp4HlsSettings
-> Maybe AudioOnlyHlsSettings
-> Maybe FrameCaptureHlsSettings
-> Maybe StandardHlsSettings
-> HlsSettings
HlsSettings'
{ $sel:fmp4HlsSettings:HlsSettings' :: Maybe Fmp4HlsSettings
fmp4HlsSettings = Maybe Fmp4HlsSettings
forall a. Maybe a
Prelude.Nothing,
$sel:audioOnlyHlsSettings:HlsSettings' :: Maybe AudioOnlyHlsSettings
audioOnlyHlsSettings = Maybe AudioOnlyHlsSettings
forall a. Maybe a
Prelude.Nothing,
$sel:frameCaptureHlsSettings:HlsSettings' :: Maybe FrameCaptureHlsSettings
frameCaptureHlsSettings = Maybe FrameCaptureHlsSettings
forall a. Maybe a
Prelude.Nothing,
$sel:standardHlsSettings:HlsSettings' :: Maybe StandardHlsSettings
standardHlsSettings = Maybe StandardHlsSettings
forall a. Maybe a
Prelude.Nothing
}
hlsSettings_fmp4HlsSettings :: Lens.Lens' HlsSettings (Prelude.Maybe Fmp4HlsSettings)
hlsSettings_fmp4HlsSettings :: (Maybe Fmp4HlsSettings -> f (Maybe Fmp4HlsSettings))
-> HlsSettings -> f HlsSettings
hlsSettings_fmp4HlsSettings = (HlsSettings -> Maybe Fmp4HlsSettings)
-> (HlsSettings -> Maybe Fmp4HlsSettings -> HlsSettings)
-> Lens
HlsSettings
HlsSettings
(Maybe Fmp4HlsSettings)
(Maybe 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)
hlsSettings_audioOnlyHlsSettings :: Lens.Lens' HlsSettings (Prelude.Maybe AudioOnlyHlsSettings)
hlsSettings_audioOnlyHlsSettings :: (Maybe AudioOnlyHlsSettings -> f (Maybe AudioOnlyHlsSettings))
-> HlsSettings -> f HlsSettings
hlsSettings_audioOnlyHlsSettings = (HlsSettings -> Maybe AudioOnlyHlsSettings)
-> (HlsSettings -> Maybe AudioOnlyHlsSettings -> HlsSettings)
-> Lens
HlsSettings
HlsSettings
(Maybe AudioOnlyHlsSettings)
(Maybe 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)
hlsSettings_frameCaptureHlsSettings :: Lens.Lens' HlsSettings (Prelude.Maybe FrameCaptureHlsSettings)
hlsSettings_frameCaptureHlsSettings :: (Maybe FrameCaptureHlsSettings
-> f (Maybe FrameCaptureHlsSettings))
-> HlsSettings -> f HlsSettings
hlsSettings_frameCaptureHlsSettings = (HlsSettings -> Maybe FrameCaptureHlsSettings)
-> (HlsSettings -> Maybe FrameCaptureHlsSettings -> HlsSettings)
-> Lens
HlsSettings
HlsSettings
(Maybe FrameCaptureHlsSettings)
(Maybe 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)
hlsSettings_standardHlsSettings :: Lens.Lens' HlsSettings (Prelude.Maybe StandardHlsSettings)
hlsSettings_standardHlsSettings :: (Maybe StandardHlsSettings -> f (Maybe StandardHlsSettings))
-> HlsSettings -> f HlsSettings
hlsSettings_standardHlsSettings = (HlsSettings -> Maybe StandardHlsSettings)
-> (HlsSettings -> Maybe StandardHlsSettings -> HlsSettings)
-> Lens
HlsSettings
HlsSettings
(Maybe StandardHlsSettings)
(Maybe 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 Core.FromJSON HlsSettings where
parseJSON :: Value -> Parser HlsSettings
parseJSON =
String
-> (Object -> Parser HlsSettings) -> Value -> Parser HlsSettings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"HlsSettings"
( \Object
x ->
Maybe Fmp4HlsSettings
-> Maybe AudioOnlyHlsSettings
-> Maybe FrameCaptureHlsSettings
-> Maybe StandardHlsSettings
-> HlsSettings
HlsSettings'
(Maybe Fmp4HlsSettings
-> Maybe AudioOnlyHlsSettings
-> Maybe FrameCaptureHlsSettings
-> Maybe StandardHlsSettings
-> HlsSettings)
-> Parser (Maybe Fmp4HlsSettings)
-> Parser
(Maybe AudioOnlyHlsSettings
-> Maybe FrameCaptureHlsSettings
-> Maybe StandardHlsSettings
-> HlsSettings)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Fmp4HlsSettings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"fmp4HlsSettings")
Parser
(Maybe AudioOnlyHlsSettings
-> Maybe FrameCaptureHlsSettings
-> Maybe StandardHlsSettings
-> HlsSettings)
-> Parser (Maybe AudioOnlyHlsSettings)
-> Parser
(Maybe FrameCaptureHlsSettings
-> Maybe StandardHlsSettings -> HlsSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AudioOnlyHlsSettings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"audioOnlyHlsSettings")
Parser
(Maybe FrameCaptureHlsSettings
-> Maybe StandardHlsSettings -> HlsSettings)
-> Parser (Maybe FrameCaptureHlsSettings)
-> Parser (Maybe StandardHlsSettings -> HlsSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe FrameCaptureHlsSettings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"frameCaptureHlsSettings")
Parser (Maybe StandardHlsSettings -> HlsSettings)
-> Parser (Maybe StandardHlsSettings) -> Parser HlsSettings
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe StandardHlsSettings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"standardHlsSettings")
)
instance Prelude.Hashable HlsSettings
instance Prelude.NFData HlsSettings
instance Core.ToJSON HlsSettings where
toJSON :: HlsSettings -> Value
toJSON HlsSettings' {Maybe Fmp4HlsSettings
Maybe FrameCaptureHlsSettings
Maybe AudioOnlyHlsSettings
Maybe StandardHlsSettings
standardHlsSettings :: Maybe StandardHlsSettings
frameCaptureHlsSettings :: Maybe FrameCaptureHlsSettings
audioOnlyHlsSettings :: Maybe AudioOnlyHlsSettings
fmp4HlsSettings :: Maybe Fmp4HlsSettings
$sel:standardHlsSettings:HlsSettings' :: HlsSettings -> Maybe StandardHlsSettings
$sel:frameCaptureHlsSettings:HlsSettings' :: HlsSettings -> Maybe FrameCaptureHlsSettings
$sel:audioOnlyHlsSettings:HlsSettings' :: HlsSettings -> Maybe AudioOnlyHlsSettings
$sel:fmp4HlsSettings:HlsSettings' :: HlsSettings -> Maybe Fmp4HlsSettings
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"fmp4HlsSettings" Text -> Fmp4HlsSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Fmp4HlsSettings -> Pair) -> Maybe Fmp4HlsSettings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Fmp4HlsSettings
fmp4HlsSettings,
(Text
"audioOnlyHlsSettings" Text -> AudioOnlyHlsSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(AudioOnlyHlsSettings -> Pair)
-> Maybe AudioOnlyHlsSettings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AudioOnlyHlsSettings
audioOnlyHlsSettings,
(Text
"frameCaptureHlsSettings" Text -> FrameCaptureHlsSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(FrameCaptureHlsSettings -> Pair)
-> Maybe FrameCaptureHlsSettings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe FrameCaptureHlsSettings
frameCaptureHlsSettings,
(Text
"standardHlsSettings" Text -> StandardHlsSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(StandardHlsSettings -> Pair)
-> Maybe StandardHlsSettings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe StandardHlsSettings
standardHlsSettings
]
)