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