{-# 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.HlsInputSettings where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaLive.Types.HlsScte35SourceType
import qualified Amazonka.Prelude as Prelude
data HlsInputSettings = HlsInputSettings'
{
HlsInputSettings -> Maybe Natural
bufferSegments :: Prelude.Maybe Prelude.Natural,
HlsInputSettings -> Maybe Natural
retries :: Prelude.Maybe Prelude.Natural,
HlsInputSettings -> Maybe Natural
retryInterval :: Prelude.Maybe Prelude.Natural,
HlsInputSettings -> Maybe Natural
bandwidth :: Prelude.Maybe Prelude.Natural,
HlsInputSettings -> Maybe HlsScte35SourceType
scte35Source :: Prelude.Maybe HlsScte35SourceType
}
deriving (HlsInputSettings -> HlsInputSettings -> Bool
(HlsInputSettings -> HlsInputSettings -> Bool)
-> (HlsInputSettings -> HlsInputSettings -> Bool)
-> Eq HlsInputSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HlsInputSettings -> HlsInputSettings -> Bool
$c/= :: HlsInputSettings -> HlsInputSettings -> Bool
== :: HlsInputSettings -> HlsInputSettings -> Bool
$c== :: HlsInputSettings -> HlsInputSettings -> Bool
Prelude.Eq, ReadPrec [HlsInputSettings]
ReadPrec HlsInputSettings
Int -> ReadS HlsInputSettings
ReadS [HlsInputSettings]
(Int -> ReadS HlsInputSettings)
-> ReadS [HlsInputSettings]
-> ReadPrec HlsInputSettings
-> ReadPrec [HlsInputSettings]
-> Read HlsInputSettings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [HlsInputSettings]
$creadListPrec :: ReadPrec [HlsInputSettings]
readPrec :: ReadPrec HlsInputSettings
$creadPrec :: ReadPrec HlsInputSettings
readList :: ReadS [HlsInputSettings]
$creadList :: ReadS [HlsInputSettings]
readsPrec :: Int -> ReadS HlsInputSettings
$creadsPrec :: Int -> ReadS HlsInputSettings
Prelude.Read, Int -> HlsInputSettings -> ShowS
[HlsInputSettings] -> ShowS
HlsInputSettings -> String
(Int -> HlsInputSettings -> ShowS)
-> (HlsInputSettings -> String)
-> ([HlsInputSettings] -> ShowS)
-> Show HlsInputSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HlsInputSettings] -> ShowS
$cshowList :: [HlsInputSettings] -> ShowS
show :: HlsInputSettings -> String
$cshow :: HlsInputSettings -> String
showsPrec :: Int -> HlsInputSettings -> ShowS
$cshowsPrec :: Int -> HlsInputSettings -> ShowS
Prelude.Show, (forall x. HlsInputSettings -> Rep HlsInputSettings x)
-> (forall x. Rep HlsInputSettings x -> HlsInputSettings)
-> Generic HlsInputSettings
forall x. Rep HlsInputSettings x -> HlsInputSettings
forall x. HlsInputSettings -> Rep HlsInputSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep HlsInputSettings x -> HlsInputSettings
$cfrom :: forall x. HlsInputSettings -> Rep HlsInputSettings x
Prelude.Generic)
newHlsInputSettings ::
HlsInputSettings
newHlsInputSettings :: HlsInputSettings
newHlsInputSettings =
HlsInputSettings' :: Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe HlsScte35SourceType
-> HlsInputSettings
HlsInputSettings'
{ $sel:bufferSegments:HlsInputSettings' :: Maybe Natural
bufferSegments = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:retries:HlsInputSettings' :: Maybe Natural
retries = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:retryInterval:HlsInputSettings' :: Maybe Natural
retryInterval = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:bandwidth:HlsInputSettings' :: Maybe Natural
bandwidth = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:scte35Source:HlsInputSettings' :: Maybe HlsScte35SourceType
scte35Source = Maybe HlsScte35SourceType
forall a. Maybe a
Prelude.Nothing
}
hlsInputSettings_bufferSegments :: Lens.Lens' HlsInputSettings (Prelude.Maybe Prelude.Natural)
hlsInputSettings_bufferSegments :: (Maybe Natural -> f (Maybe Natural))
-> HlsInputSettings -> f HlsInputSettings
hlsInputSettings_bufferSegments = (HlsInputSettings -> Maybe Natural)
-> (HlsInputSettings -> Maybe Natural -> HlsInputSettings)
-> Lens
HlsInputSettings HlsInputSettings (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HlsInputSettings' {Maybe Natural
bufferSegments :: Maybe Natural
$sel:bufferSegments:HlsInputSettings' :: HlsInputSettings -> Maybe Natural
bufferSegments} -> Maybe Natural
bufferSegments) (\s :: HlsInputSettings
s@HlsInputSettings' {} Maybe Natural
a -> HlsInputSettings
s {$sel:bufferSegments:HlsInputSettings' :: Maybe Natural
bufferSegments = Maybe Natural
a} :: HlsInputSettings)
hlsInputSettings_retries :: Lens.Lens' HlsInputSettings (Prelude.Maybe Prelude.Natural)
hlsInputSettings_retries :: (Maybe Natural -> f (Maybe Natural))
-> HlsInputSettings -> f HlsInputSettings
hlsInputSettings_retries = (HlsInputSettings -> Maybe Natural)
-> (HlsInputSettings -> Maybe Natural -> HlsInputSettings)
-> Lens
HlsInputSettings HlsInputSettings (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HlsInputSettings' {Maybe Natural
retries :: Maybe Natural
$sel:retries:HlsInputSettings' :: HlsInputSettings -> Maybe Natural
retries} -> Maybe Natural
retries) (\s :: HlsInputSettings
s@HlsInputSettings' {} Maybe Natural
a -> HlsInputSettings
s {$sel:retries:HlsInputSettings' :: Maybe Natural
retries = Maybe Natural
a} :: HlsInputSettings)
hlsInputSettings_retryInterval :: Lens.Lens' HlsInputSettings (Prelude.Maybe Prelude.Natural)
hlsInputSettings_retryInterval :: (Maybe Natural -> f (Maybe Natural))
-> HlsInputSettings -> f HlsInputSettings
hlsInputSettings_retryInterval = (HlsInputSettings -> Maybe Natural)
-> (HlsInputSettings -> Maybe Natural -> HlsInputSettings)
-> Lens
HlsInputSettings HlsInputSettings (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HlsInputSettings' {Maybe Natural
retryInterval :: Maybe Natural
$sel:retryInterval:HlsInputSettings' :: HlsInputSettings -> Maybe Natural
retryInterval} -> Maybe Natural
retryInterval) (\s :: HlsInputSettings
s@HlsInputSettings' {} Maybe Natural
a -> HlsInputSettings
s {$sel:retryInterval:HlsInputSettings' :: Maybe Natural
retryInterval = Maybe Natural
a} :: HlsInputSettings)
hlsInputSettings_bandwidth :: Lens.Lens' HlsInputSettings (Prelude.Maybe Prelude.Natural)
hlsInputSettings_bandwidth :: (Maybe Natural -> f (Maybe Natural))
-> HlsInputSettings -> f HlsInputSettings
hlsInputSettings_bandwidth = (HlsInputSettings -> Maybe Natural)
-> (HlsInputSettings -> Maybe Natural -> HlsInputSettings)
-> Lens
HlsInputSettings HlsInputSettings (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HlsInputSettings' {Maybe Natural
bandwidth :: Maybe Natural
$sel:bandwidth:HlsInputSettings' :: HlsInputSettings -> Maybe Natural
bandwidth} -> Maybe Natural
bandwidth) (\s :: HlsInputSettings
s@HlsInputSettings' {} Maybe Natural
a -> HlsInputSettings
s {$sel:bandwidth:HlsInputSettings' :: Maybe Natural
bandwidth = Maybe Natural
a} :: HlsInputSettings)
hlsInputSettings_scte35Source :: Lens.Lens' HlsInputSettings (Prelude.Maybe HlsScte35SourceType)
hlsInputSettings_scte35Source :: (Maybe HlsScte35SourceType -> f (Maybe HlsScte35SourceType))
-> HlsInputSettings -> f HlsInputSettings
hlsInputSettings_scte35Source = (HlsInputSettings -> Maybe HlsScte35SourceType)
-> (HlsInputSettings
-> Maybe HlsScte35SourceType -> HlsInputSettings)
-> Lens
HlsInputSettings
HlsInputSettings
(Maybe HlsScte35SourceType)
(Maybe HlsScte35SourceType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HlsInputSettings' {Maybe HlsScte35SourceType
scte35Source :: Maybe HlsScte35SourceType
$sel:scte35Source:HlsInputSettings' :: HlsInputSettings -> Maybe HlsScte35SourceType
scte35Source} -> Maybe HlsScte35SourceType
scte35Source) (\s :: HlsInputSettings
s@HlsInputSettings' {} Maybe HlsScte35SourceType
a -> HlsInputSettings
s {$sel:scte35Source:HlsInputSettings' :: Maybe HlsScte35SourceType
scte35Source = Maybe HlsScte35SourceType
a} :: HlsInputSettings)
instance Core.FromJSON HlsInputSettings where
parseJSON :: Value -> Parser HlsInputSettings
parseJSON =
String
-> (Object -> Parser HlsInputSettings)
-> Value
-> Parser HlsInputSettings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"HlsInputSettings"
( \Object
x ->
Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe HlsScte35SourceType
-> HlsInputSettings
HlsInputSettings'
(Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe HlsScte35SourceType
-> HlsInputSettings)
-> Parser (Maybe Natural)
-> Parser
(Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe HlsScte35SourceType
-> HlsInputSettings)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"bufferSegments")
Parser
(Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe HlsScte35SourceType
-> HlsInputSettings)
-> Parser (Maybe Natural)
-> Parser
(Maybe Natural
-> Maybe Natural -> Maybe HlsScte35SourceType -> HlsInputSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"retries")
Parser
(Maybe Natural
-> Maybe Natural -> Maybe HlsScte35SourceType -> HlsInputSettings)
-> Parser (Maybe Natural)
-> Parser
(Maybe Natural -> Maybe HlsScte35SourceType -> HlsInputSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"retryInterval")
Parser
(Maybe Natural -> Maybe HlsScte35SourceType -> HlsInputSettings)
-> Parser (Maybe Natural)
-> Parser (Maybe HlsScte35SourceType -> HlsInputSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"bandwidth")
Parser (Maybe HlsScte35SourceType -> HlsInputSettings)
-> Parser (Maybe HlsScte35SourceType) -> Parser HlsInputSettings
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe HlsScte35SourceType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"scte35Source")
)
instance Prelude.Hashable HlsInputSettings
instance Prelude.NFData HlsInputSettings
instance Core.ToJSON HlsInputSettings where
toJSON :: HlsInputSettings -> Value
toJSON HlsInputSettings' {Maybe Natural
Maybe HlsScte35SourceType
scte35Source :: Maybe HlsScte35SourceType
bandwidth :: Maybe Natural
retryInterval :: Maybe Natural
retries :: Maybe Natural
bufferSegments :: Maybe Natural
$sel:scte35Source:HlsInputSettings' :: HlsInputSettings -> Maybe HlsScte35SourceType
$sel:bandwidth:HlsInputSettings' :: HlsInputSettings -> Maybe Natural
$sel:retryInterval:HlsInputSettings' :: HlsInputSettings -> Maybe Natural
$sel:retries:HlsInputSettings' :: HlsInputSettings -> Maybe Natural
$sel:bufferSegments:HlsInputSettings' :: HlsInputSettings -> Maybe Natural
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"bufferSegments" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
bufferSegments,
(Text
"retries" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
retries,
(Text
"retryInterval" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
retryInterval,
(Text
"bandwidth" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
bandwidth,
(Text
"scte35Source" Text -> HlsScte35SourceType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HlsScte35SourceType -> Pair)
-> Maybe HlsScte35SourceType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe HlsScte35SourceType
scte35Source
]
)