{-# 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.RtmpOutputSettings where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaLive.Types.OutputLocationRef
import Amazonka.MediaLive.Types.RtmpOutputCertificateMode
import qualified Amazonka.Prelude as Prelude
data RtmpOutputSettings = RtmpOutputSettings'
{
RtmpOutputSettings -> Maybe Natural
numRetries :: Prelude.Maybe Prelude.Natural,
RtmpOutputSettings -> Maybe RtmpOutputCertificateMode
certificateMode :: Prelude.Maybe RtmpOutputCertificateMode,
RtmpOutputSettings -> Maybe Natural
connectionRetryInterval :: Prelude.Maybe Prelude.Natural,
RtmpOutputSettings -> OutputLocationRef
destination :: OutputLocationRef
}
deriving (RtmpOutputSettings -> RtmpOutputSettings -> Bool
(RtmpOutputSettings -> RtmpOutputSettings -> Bool)
-> (RtmpOutputSettings -> RtmpOutputSettings -> Bool)
-> Eq RtmpOutputSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RtmpOutputSettings -> RtmpOutputSettings -> Bool
$c/= :: RtmpOutputSettings -> RtmpOutputSettings -> Bool
== :: RtmpOutputSettings -> RtmpOutputSettings -> Bool
$c== :: RtmpOutputSettings -> RtmpOutputSettings -> Bool
Prelude.Eq, ReadPrec [RtmpOutputSettings]
ReadPrec RtmpOutputSettings
Int -> ReadS RtmpOutputSettings
ReadS [RtmpOutputSettings]
(Int -> ReadS RtmpOutputSettings)
-> ReadS [RtmpOutputSettings]
-> ReadPrec RtmpOutputSettings
-> ReadPrec [RtmpOutputSettings]
-> Read RtmpOutputSettings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RtmpOutputSettings]
$creadListPrec :: ReadPrec [RtmpOutputSettings]
readPrec :: ReadPrec RtmpOutputSettings
$creadPrec :: ReadPrec RtmpOutputSettings
readList :: ReadS [RtmpOutputSettings]
$creadList :: ReadS [RtmpOutputSettings]
readsPrec :: Int -> ReadS RtmpOutputSettings
$creadsPrec :: Int -> ReadS RtmpOutputSettings
Prelude.Read, Int -> RtmpOutputSettings -> ShowS
[RtmpOutputSettings] -> ShowS
RtmpOutputSettings -> String
(Int -> RtmpOutputSettings -> ShowS)
-> (RtmpOutputSettings -> String)
-> ([RtmpOutputSettings] -> ShowS)
-> Show RtmpOutputSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RtmpOutputSettings] -> ShowS
$cshowList :: [RtmpOutputSettings] -> ShowS
show :: RtmpOutputSettings -> String
$cshow :: RtmpOutputSettings -> String
showsPrec :: Int -> RtmpOutputSettings -> ShowS
$cshowsPrec :: Int -> RtmpOutputSettings -> ShowS
Prelude.Show, (forall x. RtmpOutputSettings -> Rep RtmpOutputSettings x)
-> (forall x. Rep RtmpOutputSettings x -> RtmpOutputSettings)
-> Generic RtmpOutputSettings
forall x. Rep RtmpOutputSettings x -> RtmpOutputSettings
forall x. RtmpOutputSettings -> Rep RtmpOutputSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RtmpOutputSettings x -> RtmpOutputSettings
$cfrom :: forall x. RtmpOutputSettings -> Rep RtmpOutputSettings x
Prelude.Generic)
newRtmpOutputSettings ::
OutputLocationRef ->
RtmpOutputSettings
newRtmpOutputSettings :: OutputLocationRef -> RtmpOutputSettings
newRtmpOutputSettings OutputLocationRef
pDestination_ =
RtmpOutputSettings' :: Maybe Natural
-> Maybe RtmpOutputCertificateMode
-> Maybe Natural
-> OutputLocationRef
-> RtmpOutputSettings
RtmpOutputSettings'
{ $sel:numRetries:RtmpOutputSettings' :: Maybe Natural
numRetries = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:certificateMode:RtmpOutputSettings' :: Maybe RtmpOutputCertificateMode
certificateMode = Maybe RtmpOutputCertificateMode
forall a. Maybe a
Prelude.Nothing,
$sel:connectionRetryInterval:RtmpOutputSettings' :: Maybe Natural
connectionRetryInterval = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:destination:RtmpOutputSettings' :: OutputLocationRef
destination = OutputLocationRef
pDestination_
}
rtmpOutputSettings_numRetries :: Lens.Lens' RtmpOutputSettings (Prelude.Maybe Prelude.Natural)
rtmpOutputSettings_numRetries :: (Maybe Natural -> f (Maybe Natural))
-> RtmpOutputSettings -> f RtmpOutputSettings
rtmpOutputSettings_numRetries = (RtmpOutputSettings -> Maybe Natural)
-> (RtmpOutputSettings -> Maybe Natural -> RtmpOutputSettings)
-> Lens
RtmpOutputSettings
RtmpOutputSettings
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RtmpOutputSettings' {Maybe Natural
numRetries :: Maybe Natural
$sel:numRetries:RtmpOutputSettings' :: RtmpOutputSettings -> Maybe Natural
numRetries} -> Maybe Natural
numRetries) (\s :: RtmpOutputSettings
s@RtmpOutputSettings' {} Maybe Natural
a -> RtmpOutputSettings
s {$sel:numRetries:RtmpOutputSettings' :: Maybe Natural
numRetries = Maybe Natural
a} :: RtmpOutputSettings)
rtmpOutputSettings_certificateMode :: Lens.Lens' RtmpOutputSettings (Prelude.Maybe RtmpOutputCertificateMode)
rtmpOutputSettings_certificateMode :: (Maybe RtmpOutputCertificateMode
-> f (Maybe RtmpOutputCertificateMode))
-> RtmpOutputSettings -> f RtmpOutputSettings
rtmpOutputSettings_certificateMode = (RtmpOutputSettings -> Maybe RtmpOutputCertificateMode)
-> (RtmpOutputSettings
-> Maybe RtmpOutputCertificateMode -> RtmpOutputSettings)
-> Lens
RtmpOutputSettings
RtmpOutputSettings
(Maybe RtmpOutputCertificateMode)
(Maybe RtmpOutputCertificateMode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RtmpOutputSettings' {Maybe RtmpOutputCertificateMode
certificateMode :: Maybe RtmpOutputCertificateMode
$sel:certificateMode:RtmpOutputSettings' :: RtmpOutputSettings -> Maybe RtmpOutputCertificateMode
certificateMode} -> Maybe RtmpOutputCertificateMode
certificateMode) (\s :: RtmpOutputSettings
s@RtmpOutputSettings' {} Maybe RtmpOutputCertificateMode
a -> RtmpOutputSettings
s {$sel:certificateMode:RtmpOutputSettings' :: Maybe RtmpOutputCertificateMode
certificateMode = Maybe RtmpOutputCertificateMode
a} :: RtmpOutputSettings)
rtmpOutputSettings_connectionRetryInterval :: Lens.Lens' RtmpOutputSettings (Prelude.Maybe Prelude.Natural)
rtmpOutputSettings_connectionRetryInterval :: (Maybe Natural -> f (Maybe Natural))
-> RtmpOutputSettings -> f RtmpOutputSettings
rtmpOutputSettings_connectionRetryInterval = (RtmpOutputSettings -> Maybe Natural)
-> (RtmpOutputSettings -> Maybe Natural -> RtmpOutputSettings)
-> Lens
RtmpOutputSettings
RtmpOutputSettings
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RtmpOutputSettings' {Maybe Natural
connectionRetryInterval :: Maybe Natural
$sel:connectionRetryInterval:RtmpOutputSettings' :: RtmpOutputSettings -> Maybe Natural
connectionRetryInterval} -> Maybe Natural
connectionRetryInterval) (\s :: RtmpOutputSettings
s@RtmpOutputSettings' {} Maybe Natural
a -> RtmpOutputSettings
s {$sel:connectionRetryInterval:RtmpOutputSettings' :: Maybe Natural
connectionRetryInterval = Maybe Natural
a} :: RtmpOutputSettings)
rtmpOutputSettings_destination :: Lens.Lens' RtmpOutputSettings OutputLocationRef
rtmpOutputSettings_destination :: (OutputLocationRef -> f OutputLocationRef)
-> RtmpOutputSettings -> f RtmpOutputSettings
rtmpOutputSettings_destination = (RtmpOutputSettings -> OutputLocationRef)
-> (RtmpOutputSettings -> OutputLocationRef -> RtmpOutputSettings)
-> Lens
RtmpOutputSettings
RtmpOutputSettings
OutputLocationRef
OutputLocationRef
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RtmpOutputSettings' {OutputLocationRef
destination :: OutputLocationRef
$sel:destination:RtmpOutputSettings' :: RtmpOutputSettings -> OutputLocationRef
destination} -> OutputLocationRef
destination) (\s :: RtmpOutputSettings
s@RtmpOutputSettings' {} OutputLocationRef
a -> RtmpOutputSettings
s {$sel:destination:RtmpOutputSettings' :: OutputLocationRef
destination = OutputLocationRef
a} :: RtmpOutputSettings)
instance Core.FromJSON RtmpOutputSettings where
parseJSON :: Value -> Parser RtmpOutputSettings
parseJSON =
String
-> (Object -> Parser RtmpOutputSettings)
-> Value
-> Parser RtmpOutputSettings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"RtmpOutputSettings"
( \Object
x ->
Maybe Natural
-> Maybe RtmpOutputCertificateMode
-> Maybe Natural
-> OutputLocationRef
-> RtmpOutputSettings
RtmpOutputSettings'
(Maybe Natural
-> Maybe RtmpOutputCertificateMode
-> Maybe Natural
-> OutputLocationRef
-> RtmpOutputSettings)
-> Parser (Maybe Natural)
-> Parser
(Maybe RtmpOutputCertificateMode
-> Maybe Natural -> OutputLocationRef -> RtmpOutputSettings)
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 RtmpOutputCertificateMode
-> Maybe Natural -> OutputLocationRef -> RtmpOutputSettings)
-> Parser (Maybe RtmpOutputCertificateMode)
-> Parser
(Maybe Natural -> OutputLocationRef -> RtmpOutputSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe RtmpOutputCertificateMode)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"certificateMode")
Parser (Maybe Natural -> OutputLocationRef -> RtmpOutputSettings)
-> Parser (Maybe Natural)
-> Parser (OutputLocationRef -> RtmpOutputSettings)
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 (OutputLocationRef -> RtmpOutputSettings)
-> Parser OutputLocationRef -> Parser RtmpOutputSettings
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser OutputLocationRef
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"destination")
)
instance Prelude.Hashable RtmpOutputSettings
instance Prelude.NFData RtmpOutputSettings
instance Core.ToJSON RtmpOutputSettings where
toJSON :: RtmpOutputSettings -> Value
toJSON RtmpOutputSettings' {Maybe Natural
Maybe RtmpOutputCertificateMode
OutputLocationRef
destination :: OutputLocationRef
connectionRetryInterval :: Maybe Natural
certificateMode :: Maybe RtmpOutputCertificateMode
numRetries :: Maybe Natural
$sel:destination:RtmpOutputSettings' :: RtmpOutputSettings -> OutputLocationRef
$sel:connectionRetryInterval:RtmpOutputSettings' :: RtmpOutputSettings -> Maybe Natural
$sel:certificateMode:RtmpOutputSettings' :: RtmpOutputSettings -> Maybe RtmpOutputCertificateMode
$sel:numRetries:RtmpOutputSettings' :: RtmpOutputSettings -> 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
"certificateMode" Text -> RtmpOutputCertificateMode -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(RtmpOutputCertificateMode -> Pair)
-> Maybe RtmpOutputCertificateMode -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RtmpOutputCertificateMode
certificateMode,
(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,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"destination" Text -> OutputLocationRef -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= OutputLocationRef
destination)
]
)