{-# 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.MediaPackageVOD.Types.HlsManifest where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaPackageVOD.Types.AdMarkers
import Amazonka.MediaPackageVOD.Types.StreamSelection
import qualified Amazonka.Prelude as Prelude
data HlsManifest = HlsManifest'
{
HlsManifest -> Maybe Text
manifestName :: Prelude.Maybe Prelude.Text,
HlsManifest -> Maybe Int
programDateTimeIntervalSeconds :: Prelude.Maybe Prelude.Int,
HlsManifest -> Maybe StreamSelection
streamSelection :: Prelude.Maybe StreamSelection,
HlsManifest -> Maybe AdMarkers
adMarkers :: Prelude.Maybe AdMarkers,
HlsManifest -> Maybe Bool
includeIframeOnlyStream :: Prelude.Maybe Prelude.Bool,
HlsManifest -> Maybe Bool
repeatExtXKey :: Prelude.Maybe Prelude.Bool
}
deriving (HlsManifest -> HlsManifest -> Bool
(HlsManifest -> HlsManifest -> Bool)
-> (HlsManifest -> HlsManifest -> Bool) -> Eq HlsManifest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HlsManifest -> HlsManifest -> Bool
$c/= :: HlsManifest -> HlsManifest -> Bool
== :: HlsManifest -> HlsManifest -> Bool
$c== :: HlsManifest -> HlsManifest -> Bool
Prelude.Eq, ReadPrec [HlsManifest]
ReadPrec HlsManifest
Int -> ReadS HlsManifest
ReadS [HlsManifest]
(Int -> ReadS HlsManifest)
-> ReadS [HlsManifest]
-> ReadPrec HlsManifest
-> ReadPrec [HlsManifest]
-> Read HlsManifest
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [HlsManifest]
$creadListPrec :: ReadPrec [HlsManifest]
readPrec :: ReadPrec HlsManifest
$creadPrec :: ReadPrec HlsManifest
readList :: ReadS [HlsManifest]
$creadList :: ReadS [HlsManifest]
readsPrec :: Int -> ReadS HlsManifest
$creadsPrec :: Int -> ReadS HlsManifest
Prelude.Read, Int -> HlsManifest -> ShowS
[HlsManifest] -> ShowS
HlsManifest -> String
(Int -> HlsManifest -> ShowS)
-> (HlsManifest -> String)
-> ([HlsManifest] -> ShowS)
-> Show HlsManifest
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HlsManifest] -> ShowS
$cshowList :: [HlsManifest] -> ShowS
show :: HlsManifest -> String
$cshow :: HlsManifest -> String
showsPrec :: Int -> HlsManifest -> ShowS
$cshowsPrec :: Int -> HlsManifest -> ShowS
Prelude.Show, (forall x. HlsManifest -> Rep HlsManifest x)
-> (forall x. Rep HlsManifest x -> HlsManifest)
-> Generic HlsManifest
forall x. Rep HlsManifest x -> HlsManifest
forall x. HlsManifest -> Rep HlsManifest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep HlsManifest x -> HlsManifest
$cfrom :: forall x. HlsManifest -> Rep HlsManifest x
Prelude.Generic)
newHlsManifest ::
HlsManifest
newHlsManifest :: HlsManifest
newHlsManifest =
HlsManifest' :: Maybe Text
-> Maybe Int
-> Maybe StreamSelection
-> Maybe AdMarkers
-> Maybe Bool
-> Maybe Bool
-> HlsManifest
HlsManifest'
{ $sel:manifestName:HlsManifest' :: Maybe Text
manifestName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:programDateTimeIntervalSeconds:HlsManifest' :: Maybe Int
programDateTimeIntervalSeconds = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:streamSelection:HlsManifest' :: Maybe StreamSelection
streamSelection = Maybe StreamSelection
forall a. Maybe a
Prelude.Nothing,
$sel:adMarkers:HlsManifest' :: Maybe AdMarkers
adMarkers = Maybe AdMarkers
forall a. Maybe a
Prelude.Nothing,
$sel:includeIframeOnlyStream:HlsManifest' :: Maybe Bool
includeIframeOnlyStream = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:repeatExtXKey:HlsManifest' :: Maybe Bool
repeatExtXKey = Maybe Bool
forall a. Maybe a
Prelude.Nothing
}
hlsManifest_manifestName :: Lens.Lens' HlsManifest (Prelude.Maybe Prelude.Text)
hlsManifest_manifestName :: (Maybe Text -> f (Maybe Text)) -> HlsManifest -> f HlsManifest
hlsManifest_manifestName = (HlsManifest -> Maybe Text)
-> (HlsManifest -> Maybe Text -> HlsManifest)
-> Lens HlsManifest HlsManifest (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HlsManifest' {Maybe Text
manifestName :: Maybe Text
$sel:manifestName:HlsManifest' :: HlsManifest -> Maybe Text
manifestName} -> Maybe Text
manifestName) (\s :: HlsManifest
s@HlsManifest' {} Maybe Text
a -> HlsManifest
s {$sel:manifestName:HlsManifest' :: Maybe Text
manifestName = Maybe Text
a} :: HlsManifest)
hlsManifest_programDateTimeIntervalSeconds :: Lens.Lens' HlsManifest (Prelude.Maybe Prelude.Int)
hlsManifest_programDateTimeIntervalSeconds :: (Maybe Int -> f (Maybe Int)) -> HlsManifest -> f HlsManifest
hlsManifest_programDateTimeIntervalSeconds = (HlsManifest -> Maybe Int)
-> (HlsManifest -> Maybe Int -> HlsManifest)
-> Lens HlsManifest HlsManifest (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HlsManifest' {Maybe Int
programDateTimeIntervalSeconds :: Maybe Int
$sel:programDateTimeIntervalSeconds:HlsManifest' :: HlsManifest -> Maybe Int
programDateTimeIntervalSeconds} -> Maybe Int
programDateTimeIntervalSeconds) (\s :: HlsManifest
s@HlsManifest' {} Maybe Int
a -> HlsManifest
s {$sel:programDateTimeIntervalSeconds:HlsManifest' :: Maybe Int
programDateTimeIntervalSeconds = Maybe Int
a} :: HlsManifest)
hlsManifest_streamSelection :: Lens.Lens' HlsManifest (Prelude.Maybe StreamSelection)
hlsManifest_streamSelection :: (Maybe StreamSelection -> f (Maybe StreamSelection))
-> HlsManifest -> f HlsManifest
hlsManifest_streamSelection = (HlsManifest -> Maybe StreamSelection)
-> (HlsManifest -> Maybe StreamSelection -> HlsManifest)
-> Lens
HlsManifest
HlsManifest
(Maybe StreamSelection)
(Maybe StreamSelection)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HlsManifest' {Maybe StreamSelection
streamSelection :: Maybe StreamSelection
$sel:streamSelection:HlsManifest' :: HlsManifest -> Maybe StreamSelection
streamSelection} -> Maybe StreamSelection
streamSelection) (\s :: HlsManifest
s@HlsManifest' {} Maybe StreamSelection
a -> HlsManifest
s {$sel:streamSelection:HlsManifest' :: Maybe StreamSelection
streamSelection = Maybe StreamSelection
a} :: HlsManifest)
hlsManifest_adMarkers :: Lens.Lens' HlsManifest (Prelude.Maybe AdMarkers)
hlsManifest_adMarkers :: (Maybe AdMarkers -> f (Maybe AdMarkers))
-> HlsManifest -> f HlsManifest
hlsManifest_adMarkers = (HlsManifest -> Maybe AdMarkers)
-> (HlsManifest -> Maybe AdMarkers -> HlsManifest)
-> Lens HlsManifest HlsManifest (Maybe AdMarkers) (Maybe AdMarkers)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HlsManifest' {Maybe AdMarkers
adMarkers :: Maybe AdMarkers
$sel:adMarkers:HlsManifest' :: HlsManifest -> Maybe AdMarkers
adMarkers} -> Maybe AdMarkers
adMarkers) (\s :: HlsManifest
s@HlsManifest' {} Maybe AdMarkers
a -> HlsManifest
s {$sel:adMarkers:HlsManifest' :: Maybe AdMarkers
adMarkers = Maybe AdMarkers
a} :: HlsManifest)
hlsManifest_includeIframeOnlyStream :: Lens.Lens' HlsManifest (Prelude.Maybe Prelude.Bool)
hlsManifest_includeIframeOnlyStream :: (Maybe Bool -> f (Maybe Bool)) -> HlsManifest -> f HlsManifest
hlsManifest_includeIframeOnlyStream = (HlsManifest -> Maybe Bool)
-> (HlsManifest -> Maybe Bool -> HlsManifest)
-> Lens HlsManifest HlsManifest (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HlsManifest' {Maybe Bool
includeIframeOnlyStream :: Maybe Bool
$sel:includeIframeOnlyStream:HlsManifest' :: HlsManifest -> Maybe Bool
includeIframeOnlyStream} -> Maybe Bool
includeIframeOnlyStream) (\s :: HlsManifest
s@HlsManifest' {} Maybe Bool
a -> HlsManifest
s {$sel:includeIframeOnlyStream:HlsManifest' :: Maybe Bool
includeIframeOnlyStream = Maybe Bool
a} :: HlsManifest)
hlsManifest_repeatExtXKey :: Lens.Lens' HlsManifest (Prelude.Maybe Prelude.Bool)
hlsManifest_repeatExtXKey :: (Maybe Bool -> f (Maybe Bool)) -> HlsManifest -> f HlsManifest
hlsManifest_repeatExtXKey = (HlsManifest -> Maybe Bool)
-> (HlsManifest -> Maybe Bool -> HlsManifest)
-> Lens HlsManifest HlsManifest (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HlsManifest' {Maybe Bool
repeatExtXKey :: Maybe Bool
$sel:repeatExtXKey:HlsManifest' :: HlsManifest -> Maybe Bool
repeatExtXKey} -> Maybe Bool
repeatExtXKey) (\s :: HlsManifest
s@HlsManifest' {} Maybe Bool
a -> HlsManifest
s {$sel:repeatExtXKey:HlsManifest' :: Maybe Bool
repeatExtXKey = Maybe Bool
a} :: HlsManifest)
instance Core.FromJSON HlsManifest where
parseJSON :: Value -> Parser HlsManifest
parseJSON =
String
-> (Object -> Parser HlsManifest) -> Value -> Parser HlsManifest
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"HlsManifest"
( \Object
x ->
Maybe Text
-> Maybe Int
-> Maybe StreamSelection
-> Maybe AdMarkers
-> Maybe Bool
-> Maybe Bool
-> HlsManifest
HlsManifest'
(Maybe Text
-> Maybe Int
-> Maybe StreamSelection
-> Maybe AdMarkers
-> Maybe Bool
-> Maybe Bool
-> HlsManifest)
-> Parser (Maybe Text)
-> Parser
(Maybe Int
-> Maybe StreamSelection
-> Maybe AdMarkers
-> Maybe Bool
-> Maybe Bool
-> HlsManifest)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"manifestName")
Parser
(Maybe Int
-> Maybe StreamSelection
-> Maybe AdMarkers
-> Maybe Bool
-> Maybe Bool
-> HlsManifest)
-> Parser (Maybe Int)
-> Parser
(Maybe StreamSelection
-> Maybe AdMarkers -> Maybe Bool -> Maybe Bool -> HlsManifest)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"programDateTimeIntervalSeconds")
Parser
(Maybe StreamSelection
-> Maybe AdMarkers -> Maybe Bool -> Maybe Bool -> HlsManifest)
-> Parser (Maybe StreamSelection)
-> Parser
(Maybe AdMarkers -> Maybe Bool -> Maybe Bool -> HlsManifest)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe StreamSelection)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"streamSelection")
Parser (Maybe AdMarkers -> Maybe Bool -> Maybe Bool -> HlsManifest)
-> Parser (Maybe AdMarkers)
-> Parser (Maybe Bool -> Maybe Bool -> HlsManifest)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AdMarkers)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"adMarkers")
Parser (Maybe Bool -> Maybe Bool -> HlsManifest)
-> Parser (Maybe Bool) -> Parser (Maybe Bool -> HlsManifest)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"includeIframeOnlyStream")
Parser (Maybe Bool -> HlsManifest)
-> Parser (Maybe Bool) -> Parser HlsManifest
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"repeatExtXKey")
)
instance Prelude.Hashable HlsManifest
instance Prelude.NFData HlsManifest
instance Core.ToJSON HlsManifest where
toJSON :: HlsManifest -> Value
toJSON HlsManifest' {Maybe Bool
Maybe Int
Maybe Text
Maybe AdMarkers
Maybe StreamSelection
repeatExtXKey :: Maybe Bool
includeIframeOnlyStream :: Maybe Bool
adMarkers :: Maybe AdMarkers
streamSelection :: Maybe StreamSelection
programDateTimeIntervalSeconds :: Maybe Int
manifestName :: Maybe Text
$sel:repeatExtXKey:HlsManifest' :: HlsManifest -> Maybe Bool
$sel:includeIframeOnlyStream:HlsManifest' :: HlsManifest -> Maybe Bool
$sel:adMarkers:HlsManifest' :: HlsManifest -> Maybe AdMarkers
$sel:streamSelection:HlsManifest' :: HlsManifest -> Maybe StreamSelection
$sel:programDateTimeIntervalSeconds:HlsManifest' :: HlsManifest -> Maybe Int
$sel:manifestName:HlsManifest' :: HlsManifest -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"manifestName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
manifestName,
(Text
"programDateTimeIntervalSeconds" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
programDateTimeIntervalSeconds,
(Text
"streamSelection" Text -> StreamSelection -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(StreamSelection -> Pair) -> Maybe StreamSelection -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe StreamSelection
streamSelection,
(Text
"adMarkers" Text -> AdMarkers -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (AdMarkers -> Pair) -> Maybe AdMarkers -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AdMarkers
adMarkers,
(Text
"includeIframeOnlyStream" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
includeIframeOnlyStream,
(Text
"repeatExtXKey" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
repeatExtXKey
]
)