{-# 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.HlsMediaStoreSettings where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaLive.Types.HlsMediaStoreStorageClass
import qualified Amazonka.Prelude as Prelude
data HlsMediaStoreSettings = HlsMediaStoreSettings'
{
HlsMediaStoreSettings -> Maybe Natural
numRetries :: Prelude.Maybe Prelude.Natural,
HlsMediaStoreSettings -> Maybe Natural
connectionRetryInterval :: Prelude.Maybe Prelude.Natural,
HlsMediaStoreSettings -> Maybe Natural
filecacheDuration :: Prelude.Maybe Prelude.Natural,
HlsMediaStoreSettings -> Maybe HlsMediaStoreStorageClass
mediaStoreStorageClass :: Prelude.Maybe HlsMediaStoreStorageClass,
HlsMediaStoreSettings -> Maybe Natural
restartDelay :: Prelude.Maybe Prelude.Natural
}
deriving (HlsMediaStoreSettings -> HlsMediaStoreSettings -> Bool
(HlsMediaStoreSettings -> HlsMediaStoreSettings -> Bool)
-> (HlsMediaStoreSettings -> HlsMediaStoreSettings -> Bool)
-> Eq HlsMediaStoreSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HlsMediaStoreSettings -> HlsMediaStoreSettings -> Bool
$c/= :: HlsMediaStoreSettings -> HlsMediaStoreSettings -> Bool
== :: HlsMediaStoreSettings -> HlsMediaStoreSettings -> Bool
$c== :: HlsMediaStoreSettings -> HlsMediaStoreSettings -> Bool
Prelude.Eq, ReadPrec [HlsMediaStoreSettings]
ReadPrec HlsMediaStoreSettings
Int -> ReadS HlsMediaStoreSettings
ReadS [HlsMediaStoreSettings]
(Int -> ReadS HlsMediaStoreSettings)
-> ReadS [HlsMediaStoreSettings]
-> ReadPrec HlsMediaStoreSettings
-> ReadPrec [HlsMediaStoreSettings]
-> Read HlsMediaStoreSettings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [HlsMediaStoreSettings]
$creadListPrec :: ReadPrec [HlsMediaStoreSettings]
readPrec :: ReadPrec HlsMediaStoreSettings
$creadPrec :: ReadPrec HlsMediaStoreSettings
readList :: ReadS [HlsMediaStoreSettings]
$creadList :: ReadS [HlsMediaStoreSettings]
readsPrec :: Int -> ReadS HlsMediaStoreSettings
$creadsPrec :: Int -> ReadS HlsMediaStoreSettings
Prelude.Read, Int -> HlsMediaStoreSettings -> ShowS
[HlsMediaStoreSettings] -> ShowS
HlsMediaStoreSettings -> String
(Int -> HlsMediaStoreSettings -> ShowS)
-> (HlsMediaStoreSettings -> String)
-> ([HlsMediaStoreSettings] -> ShowS)
-> Show HlsMediaStoreSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HlsMediaStoreSettings] -> ShowS
$cshowList :: [HlsMediaStoreSettings] -> ShowS
show :: HlsMediaStoreSettings -> String
$cshow :: HlsMediaStoreSettings -> String
showsPrec :: Int -> HlsMediaStoreSettings -> ShowS
$cshowsPrec :: Int -> HlsMediaStoreSettings -> ShowS
Prelude.Show, (forall x. HlsMediaStoreSettings -> Rep HlsMediaStoreSettings x)
-> (forall x. Rep HlsMediaStoreSettings x -> HlsMediaStoreSettings)
-> Generic HlsMediaStoreSettings
forall x. Rep HlsMediaStoreSettings x -> HlsMediaStoreSettings
forall x. HlsMediaStoreSettings -> Rep HlsMediaStoreSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep HlsMediaStoreSettings x -> HlsMediaStoreSettings
$cfrom :: forall x. HlsMediaStoreSettings -> Rep HlsMediaStoreSettings x
Prelude.Generic)
newHlsMediaStoreSettings ::
HlsMediaStoreSettings
newHlsMediaStoreSettings :: HlsMediaStoreSettings
newHlsMediaStoreSettings =
HlsMediaStoreSettings' :: Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe HlsMediaStoreStorageClass
-> Maybe Natural
-> HlsMediaStoreSettings
HlsMediaStoreSettings'
{ $sel:numRetries:HlsMediaStoreSettings' :: Maybe Natural
numRetries =
Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:connectionRetryInterval:HlsMediaStoreSettings' :: Maybe Natural
connectionRetryInterval = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:filecacheDuration:HlsMediaStoreSettings' :: Maybe Natural
filecacheDuration = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:mediaStoreStorageClass:HlsMediaStoreSettings' :: Maybe HlsMediaStoreStorageClass
mediaStoreStorageClass = Maybe HlsMediaStoreStorageClass
forall a. Maybe a
Prelude.Nothing,
$sel:restartDelay:HlsMediaStoreSettings' :: Maybe Natural
restartDelay = Maybe Natural
forall a. Maybe a
Prelude.Nothing
}
hlsMediaStoreSettings_numRetries :: Lens.Lens' HlsMediaStoreSettings (Prelude.Maybe Prelude.Natural)
hlsMediaStoreSettings_numRetries :: (Maybe Natural -> f (Maybe Natural))
-> HlsMediaStoreSettings -> f HlsMediaStoreSettings
hlsMediaStoreSettings_numRetries = (HlsMediaStoreSettings -> Maybe Natural)
-> (HlsMediaStoreSettings
-> Maybe Natural -> HlsMediaStoreSettings)
-> Lens
HlsMediaStoreSettings
HlsMediaStoreSettings
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HlsMediaStoreSettings' {Maybe Natural
numRetries :: Maybe Natural
$sel:numRetries:HlsMediaStoreSettings' :: HlsMediaStoreSettings -> Maybe Natural
numRetries} -> Maybe Natural
numRetries) (\s :: HlsMediaStoreSettings
s@HlsMediaStoreSettings' {} Maybe Natural
a -> HlsMediaStoreSettings
s {$sel:numRetries:HlsMediaStoreSettings' :: Maybe Natural
numRetries = Maybe Natural
a} :: HlsMediaStoreSettings)
hlsMediaStoreSettings_connectionRetryInterval :: Lens.Lens' HlsMediaStoreSettings (Prelude.Maybe Prelude.Natural)
hlsMediaStoreSettings_connectionRetryInterval :: (Maybe Natural -> f (Maybe Natural))
-> HlsMediaStoreSettings -> f HlsMediaStoreSettings
hlsMediaStoreSettings_connectionRetryInterval = (HlsMediaStoreSettings -> Maybe Natural)
-> (HlsMediaStoreSettings
-> Maybe Natural -> HlsMediaStoreSettings)
-> Lens
HlsMediaStoreSettings
HlsMediaStoreSettings
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HlsMediaStoreSettings' {Maybe Natural
connectionRetryInterval :: Maybe Natural
$sel:connectionRetryInterval:HlsMediaStoreSettings' :: HlsMediaStoreSettings -> Maybe Natural
connectionRetryInterval} -> Maybe Natural
connectionRetryInterval) (\s :: HlsMediaStoreSettings
s@HlsMediaStoreSettings' {} Maybe Natural
a -> HlsMediaStoreSettings
s {$sel:connectionRetryInterval:HlsMediaStoreSettings' :: Maybe Natural
connectionRetryInterval = Maybe Natural
a} :: HlsMediaStoreSettings)
hlsMediaStoreSettings_filecacheDuration :: Lens.Lens' HlsMediaStoreSettings (Prelude.Maybe Prelude.Natural)
hlsMediaStoreSettings_filecacheDuration :: (Maybe Natural -> f (Maybe Natural))
-> HlsMediaStoreSettings -> f HlsMediaStoreSettings
hlsMediaStoreSettings_filecacheDuration = (HlsMediaStoreSettings -> Maybe Natural)
-> (HlsMediaStoreSettings
-> Maybe Natural -> HlsMediaStoreSettings)
-> Lens
HlsMediaStoreSettings
HlsMediaStoreSettings
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HlsMediaStoreSettings' {Maybe Natural
filecacheDuration :: Maybe Natural
$sel:filecacheDuration:HlsMediaStoreSettings' :: HlsMediaStoreSettings -> Maybe Natural
filecacheDuration} -> Maybe Natural
filecacheDuration) (\s :: HlsMediaStoreSettings
s@HlsMediaStoreSettings' {} Maybe Natural
a -> HlsMediaStoreSettings
s {$sel:filecacheDuration:HlsMediaStoreSettings' :: Maybe Natural
filecacheDuration = Maybe Natural
a} :: HlsMediaStoreSettings)
hlsMediaStoreSettings_mediaStoreStorageClass :: Lens.Lens' HlsMediaStoreSettings (Prelude.Maybe HlsMediaStoreStorageClass)
hlsMediaStoreSettings_mediaStoreStorageClass :: (Maybe HlsMediaStoreStorageClass
-> f (Maybe HlsMediaStoreStorageClass))
-> HlsMediaStoreSettings -> f HlsMediaStoreSettings
hlsMediaStoreSettings_mediaStoreStorageClass = (HlsMediaStoreSettings -> Maybe HlsMediaStoreStorageClass)
-> (HlsMediaStoreSettings
-> Maybe HlsMediaStoreStorageClass -> HlsMediaStoreSettings)
-> Lens
HlsMediaStoreSettings
HlsMediaStoreSettings
(Maybe HlsMediaStoreStorageClass)
(Maybe HlsMediaStoreStorageClass)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HlsMediaStoreSettings' {Maybe HlsMediaStoreStorageClass
mediaStoreStorageClass :: Maybe HlsMediaStoreStorageClass
$sel:mediaStoreStorageClass:HlsMediaStoreSettings' :: HlsMediaStoreSettings -> Maybe HlsMediaStoreStorageClass
mediaStoreStorageClass} -> Maybe HlsMediaStoreStorageClass
mediaStoreStorageClass) (\s :: HlsMediaStoreSettings
s@HlsMediaStoreSettings' {} Maybe HlsMediaStoreStorageClass
a -> HlsMediaStoreSettings
s {$sel:mediaStoreStorageClass:HlsMediaStoreSettings' :: Maybe HlsMediaStoreStorageClass
mediaStoreStorageClass = Maybe HlsMediaStoreStorageClass
a} :: HlsMediaStoreSettings)
hlsMediaStoreSettings_restartDelay :: Lens.Lens' HlsMediaStoreSettings (Prelude.Maybe Prelude.Natural)
hlsMediaStoreSettings_restartDelay :: (Maybe Natural -> f (Maybe Natural))
-> HlsMediaStoreSettings -> f HlsMediaStoreSettings
hlsMediaStoreSettings_restartDelay = (HlsMediaStoreSettings -> Maybe Natural)
-> (HlsMediaStoreSettings
-> Maybe Natural -> HlsMediaStoreSettings)
-> Lens
HlsMediaStoreSettings
HlsMediaStoreSettings
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HlsMediaStoreSettings' {Maybe Natural
restartDelay :: Maybe Natural
$sel:restartDelay:HlsMediaStoreSettings' :: HlsMediaStoreSettings -> Maybe Natural
restartDelay} -> Maybe Natural
restartDelay) (\s :: HlsMediaStoreSettings
s@HlsMediaStoreSettings' {} Maybe Natural
a -> HlsMediaStoreSettings
s {$sel:restartDelay:HlsMediaStoreSettings' :: Maybe Natural
restartDelay = Maybe Natural
a} :: HlsMediaStoreSettings)
instance Core.FromJSON HlsMediaStoreSettings where
parseJSON :: Value -> Parser HlsMediaStoreSettings
parseJSON =
String
-> (Object -> Parser HlsMediaStoreSettings)
-> Value
-> Parser HlsMediaStoreSettings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"HlsMediaStoreSettings"
( \Object
x ->
Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe HlsMediaStoreStorageClass
-> Maybe Natural
-> HlsMediaStoreSettings
HlsMediaStoreSettings'
(Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe HlsMediaStoreStorageClass
-> Maybe Natural
-> HlsMediaStoreSettings)
-> Parser (Maybe Natural)
-> Parser
(Maybe Natural
-> Maybe Natural
-> Maybe HlsMediaStoreStorageClass
-> Maybe Natural
-> HlsMediaStoreSettings)
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
"numRetries")
Parser
(Maybe Natural
-> Maybe Natural
-> Maybe HlsMediaStoreStorageClass
-> Maybe Natural
-> HlsMediaStoreSettings)
-> Parser (Maybe Natural)
-> Parser
(Maybe Natural
-> Maybe HlsMediaStoreStorageClass
-> Maybe Natural
-> HlsMediaStoreSettings)
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
"connectionRetryInterval")
Parser
(Maybe Natural
-> Maybe HlsMediaStoreStorageClass
-> Maybe Natural
-> HlsMediaStoreSettings)
-> Parser (Maybe Natural)
-> Parser
(Maybe HlsMediaStoreStorageClass
-> Maybe Natural -> HlsMediaStoreSettings)
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
"filecacheDuration")
Parser
(Maybe HlsMediaStoreStorageClass
-> Maybe Natural -> HlsMediaStoreSettings)
-> Parser (Maybe HlsMediaStoreStorageClass)
-> Parser (Maybe Natural -> HlsMediaStoreSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe HlsMediaStoreStorageClass)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"mediaStoreStorageClass")
Parser (Maybe Natural -> HlsMediaStoreSettings)
-> Parser (Maybe Natural) -> Parser HlsMediaStoreSettings
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
"restartDelay")
)
instance Prelude.Hashable HlsMediaStoreSettings
instance Prelude.NFData HlsMediaStoreSettings
instance Core.ToJSON HlsMediaStoreSettings where
toJSON :: HlsMediaStoreSettings -> Value
toJSON HlsMediaStoreSettings' {Maybe Natural
Maybe HlsMediaStoreStorageClass
restartDelay :: Maybe Natural
mediaStoreStorageClass :: Maybe HlsMediaStoreStorageClass
filecacheDuration :: Maybe Natural
connectionRetryInterval :: Maybe Natural
numRetries :: Maybe Natural
$sel:restartDelay:HlsMediaStoreSettings' :: HlsMediaStoreSettings -> Maybe Natural
$sel:mediaStoreStorageClass:HlsMediaStoreSettings' :: HlsMediaStoreSettings -> Maybe HlsMediaStoreStorageClass
$sel:filecacheDuration:HlsMediaStoreSettings' :: HlsMediaStoreSettings -> Maybe Natural
$sel:connectionRetryInterval:HlsMediaStoreSettings' :: HlsMediaStoreSettings -> Maybe Natural
$sel:numRetries:HlsMediaStoreSettings' :: HlsMediaStoreSettings -> Maybe Natural
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"numRetries" 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
numRetries,
(Text
"connectionRetryInterval" 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
connectionRetryInterval,
(Text
"filecacheDuration" 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
filecacheDuration,
(Text
"mediaStoreStorageClass" Text -> HlsMediaStoreStorageClass -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(HlsMediaStoreStorageClass -> Pair)
-> Maybe HlsMediaStoreStorageClass -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe HlsMediaStoreStorageClass
mediaStoreStorageClass,
(Text
"restartDelay" 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
restartDelay
]
)