{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.MediaLive.Types.RtmpGroupSettings
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.MediaLive.Types.RtmpGroupSettings where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaLive.Types.AuthenticationScheme
import Amazonka.MediaLive.Types.InputLossActionForRtmpOut
import Amazonka.MediaLive.Types.RtmpAdMarkers
import Amazonka.MediaLive.Types.RtmpCacheFullBehavior
import Amazonka.MediaLive.Types.RtmpCaptionData
import qualified Amazonka.Prelude as Prelude

-- | Rtmp Group Settings
--
-- /See:/ 'newRtmpGroupSettings' smart constructor.
data RtmpGroupSettings = RtmpGroupSettings'
  { -- | Controls the behavior of this RTMP group if input becomes unavailable. -
    -- emitOutput: Emit a slate until input returns. - pauseOutput: Stop
    -- transmitting data until input returns. This does not close the
    -- underlying RTMP connection.
    RtmpGroupSettings -> Maybe InputLossActionForRtmpOut
inputLossAction :: Prelude.Maybe InputLossActionForRtmpOut,
    -- | Controls the types of data that passes to onCaptionInfo outputs. If set
    -- to \'all\' then 608 and 708 carried DTVCC data will be passed. If set to
    -- \'field1AndField2608\' then DTVCC data will be stripped out, but 608
    -- data from both fields will be passed. If set to \'field1608\' then only
    -- the data carried in 608 from field 1 video will be passed.
    RtmpGroupSettings -> Maybe RtmpCaptionData
captionData :: Prelude.Maybe RtmpCaptionData,
    -- | Choose the ad marker type for this output group. MediaLive will create a
    -- message based on the content of each SCTE-35 message, format it for that
    -- marker type, and insert it in the datastream.
    RtmpGroupSettings -> Maybe [RtmpAdMarkers]
adMarkers :: Prelude.Maybe [RtmpAdMarkers],
    -- | If a streaming output fails, number of seconds to wait until a restart
    -- is initiated. A value of 0 means never restart.
    RtmpGroupSettings -> Maybe Natural
restartDelay :: Prelude.Maybe Prelude.Natural,
    -- | Authentication scheme to use when connecting with CDN
    RtmpGroupSettings -> Maybe AuthenticationScheme
authenticationScheme :: Prelude.Maybe AuthenticationScheme,
    -- | Cache length, in seconds, is used to calculate buffer size.
    RtmpGroupSettings -> Maybe Natural
cacheLength :: Prelude.Maybe Prelude.Natural,
    -- | Controls behavior when content cache fills up. If remote origin server
    -- stalls the RTMP connection and does not accept content fast enough the
    -- \'Media Cache\' will fill up. When the cache reaches the duration
    -- specified by cacheLength the cache will stop accepting new content. If
    -- set to disconnectImmediately, the RTMP output will force a disconnect.
    -- Clear the media cache, and reconnect after restartDelay seconds. If set
    -- to waitForServer, the RTMP output will wait up to 5 minutes to allow the
    -- origin server to begin accepting data again.
    RtmpGroupSettings -> Maybe RtmpCacheFullBehavior
cacheFullBehavior :: Prelude.Maybe RtmpCacheFullBehavior
  }
  deriving (RtmpGroupSettings -> RtmpGroupSettings -> Bool
(RtmpGroupSettings -> RtmpGroupSettings -> Bool)
-> (RtmpGroupSettings -> RtmpGroupSettings -> Bool)
-> Eq RtmpGroupSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RtmpGroupSettings -> RtmpGroupSettings -> Bool
$c/= :: RtmpGroupSettings -> RtmpGroupSettings -> Bool
== :: RtmpGroupSettings -> RtmpGroupSettings -> Bool
$c== :: RtmpGroupSettings -> RtmpGroupSettings -> Bool
Prelude.Eq, ReadPrec [RtmpGroupSettings]
ReadPrec RtmpGroupSettings
Int -> ReadS RtmpGroupSettings
ReadS [RtmpGroupSettings]
(Int -> ReadS RtmpGroupSettings)
-> ReadS [RtmpGroupSettings]
-> ReadPrec RtmpGroupSettings
-> ReadPrec [RtmpGroupSettings]
-> Read RtmpGroupSettings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RtmpGroupSettings]
$creadListPrec :: ReadPrec [RtmpGroupSettings]
readPrec :: ReadPrec RtmpGroupSettings
$creadPrec :: ReadPrec RtmpGroupSettings
readList :: ReadS [RtmpGroupSettings]
$creadList :: ReadS [RtmpGroupSettings]
readsPrec :: Int -> ReadS RtmpGroupSettings
$creadsPrec :: Int -> ReadS RtmpGroupSettings
Prelude.Read, Int -> RtmpGroupSettings -> ShowS
[RtmpGroupSettings] -> ShowS
RtmpGroupSettings -> String
(Int -> RtmpGroupSettings -> ShowS)
-> (RtmpGroupSettings -> String)
-> ([RtmpGroupSettings] -> ShowS)
-> Show RtmpGroupSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RtmpGroupSettings] -> ShowS
$cshowList :: [RtmpGroupSettings] -> ShowS
show :: RtmpGroupSettings -> String
$cshow :: RtmpGroupSettings -> String
showsPrec :: Int -> RtmpGroupSettings -> ShowS
$cshowsPrec :: Int -> RtmpGroupSettings -> ShowS
Prelude.Show, (forall x. RtmpGroupSettings -> Rep RtmpGroupSettings x)
-> (forall x. Rep RtmpGroupSettings x -> RtmpGroupSettings)
-> Generic RtmpGroupSettings
forall x. Rep RtmpGroupSettings x -> RtmpGroupSettings
forall x. RtmpGroupSettings -> Rep RtmpGroupSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RtmpGroupSettings x -> RtmpGroupSettings
$cfrom :: forall x. RtmpGroupSettings -> Rep RtmpGroupSettings x
Prelude.Generic)

-- |
-- Create a value of 'RtmpGroupSettings' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'inputLossAction', 'rtmpGroupSettings_inputLossAction' - Controls the behavior of this RTMP group if input becomes unavailable. -
-- emitOutput: Emit a slate until input returns. - pauseOutput: Stop
-- transmitting data until input returns. This does not close the
-- underlying RTMP connection.
--
-- 'captionData', 'rtmpGroupSettings_captionData' - Controls the types of data that passes to onCaptionInfo outputs. If set
-- to \'all\' then 608 and 708 carried DTVCC data will be passed. If set to
-- \'field1AndField2608\' then DTVCC data will be stripped out, but 608
-- data from both fields will be passed. If set to \'field1608\' then only
-- the data carried in 608 from field 1 video will be passed.
--
-- 'adMarkers', 'rtmpGroupSettings_adMarkers' - Choose the ad marker type for this output group. MediaLive will create a
-- message based on the content of each SCTE-35 message, format it for that
-- marker type, and insert it in the datastream.
--
-- 'restartDelay', 'rtmpGroupSettings_restartDelay' - If a streaming output fails, number of seconds to wait until a restart
-- is initiated. A value of 0 means never restart.
--
-- 'authenticationScheme', 'rtmpGroupSettings_authenticationScheme' - Authentication scheme to use when connecting with CDN
--
-- 'cacheLength', 'rtmpGroupSettings_cacheLength' - Cache length, in seconds, is used to calculate buffer size.
--
-- 'cacheFullBehavior', 'rtmpGroupSettings_cacheFullBehavior' - Controls behavior when content cache fills up. If remote origin server
-- stalls the RTMP connection and does not accept content fast enough the
-- \'Media Cache\' will fill up. When the cache reaches the duration
-- specified by cacheLength the cache will stop accepting new content. If
-- set to disconnectImmediately, the RTMP output will force a disconnect.
-- Clear the media cache, and reconnect after restartDelay seconds. If set
-- to waitForServer, the RTMP output will wait up to 5 minutes to allow the
-- origin server to begin accepting data again.
newRtmpGroupSettings ::
  RtmpGroupSettings
newRtmpGroupSettings :: RtmpGroupSettings
newRtmpGroupSettings =
  RtmpGroupSettings' :: Maybe InputLossActionForRtmpOut
-> Maybe RtmpCaptionData
-> Maybe [RtmpAdMarkers]
-> Maybe Natural
-> Maybe AuthenticationScheme
-> Maybe Natural
-> Maybe RtmpCacheFullBehavior
-> RtmpGroupSettings
RtmpGroupSettings'
    { $sel:inputLossAction:RtmpGroupSettings' :: Maybe InputLossActionForRtmpOut
inputLossAction =
        Maybe InputLossActionForRtmpOut
forall a. Maybe a
Prelude.Nothing,
      $sel:captionData:RtmpGroupSettings' :: Maybe RtmpCaptionData
captionData = Maybe RtmpCaptionData
forall a. Maybe a
Prelude.Nothing,
      $sel:adMarkers:RtmpGroupSettings' :: Maybe [RtmpAdMarkers]
adMarkers = Maybe [RtmpAdMarkers]
forall a. Maybe a
Prelude.Nothing,
      $sel:restartDelay:RtmpGroupSettings' :: Maybe Natural
restartDelay = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:authenticationScheme:RtmpGroupSettings' :: Maybe AuthenticationScheme
authenticationScheme = Maybe AuthenticationScheme
forall a. Maybe a
Prelude.Nothing,
      $sel:cacheLength:RtmpGroupSettings' :: Maybe Natural
cacheLength = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:cacheFullBehavior:RtmpGroupSettings' :: Maybe RtmpCacheFullBehavior
cacheFullBehavior = Maybe RtmpCacheFullBehavior
forall a. Maybe a
Prelude.Nothing
    }

-- | Controls the behavior of this RTMP group if input becomes unavailable. -
-- emitOutput: Emit a slate until input returns. - pauseOutput: Stop
-- transmitting data until input returns. This does not close the
-- underlying RTMP connection.
rtmpGroupSettings_inputLossAction :: Lens.Lens' RtmpGroupSettings (Prelude.Maybe InputLossActionForRtmpOut)
rtmpGroupSettings_inputLossAction :: (Maybe InputLossActionForRtmpOut
 -> f (Maybe InputLossActionForRtmpOut))
-> RtmpGroupSettings -> f RtmpGroupSettings
rtmpGroupSettings_inputLossAction = (RtmpGroupSettings -> Maybe InputLossActionForRtmpOut)
-> (RtmpGroupSettings
    -> Maybe InputLossActionForRtmpOut -> RtmpGroupSettings)
-> Lens
     RtmpGroupSettings
     RtmpGroupSettings
     (Maybe InputLossActionForRtmpOut)
     (Maybe InputLossActionForRtmpOut)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RtmpGroupSettings' {Maybe InputLossActionForRtmpOut
inputLossAction :: Maybe InputLossActionForRtmpOut
$sel:inputLossAction:RtmpGroupSettings' :: RtmpGroupSettings -> Maybe InputLossActionForRtmpOut
inputLossAction} -> Maybe InputLossActionForRtmpOut
inputLossAction) (\s :: RtmpGroupSettings
s@RtmpGroupSettings' {} Maybe InputLossActionForRtmpOut
a -> RtmpGroupSettings
s {$sel:inputLossAction:RtmpGroupSettings' :: Maybe InputLossActionForRtmpOut
inputLossAction = Maybe InputLossActionForRtmpOut
a} :: RtmpGroupSettings)

-- | Controls the types of data that passes to onCaptionInfo outputs. If set
-- to \'all\' then 608 and 708 carried DTVCC data will be passed. If set to
-- \'field1AndField2608\' then DTVCC data will be stripped out, but 608
-- data from both fields will be passed. If set to \'field1608\' then only
-- the data carried in 608 from field 1 video will be passed.
rtmpGroupSettings_captionData :: Lens.Lens' RtmpGroupSettings (Prelude.Maybe RtmpCaptionData)
rtmpGroupSettings_captionData :: (Maybe RtmpCaptionData -> f (Maybe RtmpCaptionData))
-> RtmpGroupSettings -> f RtmpGroupSettings
rtmpGroupSettings_captionData = (RtmpGroupSettings -> Maybe RtmpCaptionData)
-> (RtmpGroupSettings
    -> Maybe RtmpCaptionData -> RtmpGroupSettings)
-> Lens
     RtmpGroupSettings
     RtmpGroupSettings
     (Maybe RtmpCaptionData)
     (Maybe RtmpCaptionData)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RtmpGroupSettings' {Maybe RtmpCaptionData
captionData :: Maybe RtmpCaptionData
$sel:captionData:RtmpGroupSettings' :: RtmpGroupSettings -> Maybe RtmpCaptionData
captionData} -> Maybe RtmpCaptionData
captionData) (\s :: RtmpGroupSettings
s@RtmpGroupSettings' {} Maybe RtmpCaptionData
a -> RtmpGroupSettings
s {$sel:captionData:RtmpGroupSettings' :: Maybe RtmpCaptionData
captionData = Maybe RtmpCaptionData
a} :: RtmpGroupSettings)

-- | Choose the ad marker type for this output group. MediaLive will create a
-- message based on the content of each SCTE-35 message, format it for that
-- marker type, and insert it in the datastream.
rtmpGroupSettings_adMarkers :: Lens.Lens' RtmpGroupSettings (Prelude.Maybe [RtmpAdMarkers])
rtmpGroupSettings_adMarkers :: (Maybe [RtmpAdMarkers] -> f (Maybe [RtmpAdMarkers]))
-> RtmpGroupSettings -> f RtmpGroupSettings
rtmpGroupSettings_adMarkers = (RtmpGroupSettings -> Maybe [RtmpAdMarkers])
-> (RtmpGroupSettings
    -> Maybe [RtmpAdMarkers] -> RtmpGroupSettings)
-> Lens
     RtmpGroupSettings
     RtmpGroupSettings
     (Maybe [RtmpAdMarkers])
     (Maybe [RtmpAdMarkers])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RtmpGroupSettings' {Maybe [RtmpAdMarkers]
adMarkers :: Maybe [RtmpAdMarkers]
$sel:adMarkers:RtmpGroupSettings' :: RtmpGroupSettings -> Maybe [RtmpAdMarkers]
adMarkers} -> Maybe [RtmpAdMarkers]
adMarkers) (\s :: RtmpGroupSettings
s@RtmpGroupSettings' {} Maybe [RtmpAdMarkers]
a -> RtmpGroupSettings
s {$sel:adMarkers:RtmpGroupSettings' :: Maybe [RtmpAdMarkers]
adMarkers = Maybe [RtmpAdMarkers]
a} :: RtmpGroupSettings) ((Maybe [RtmpAdMarkers] -> f (Maybe [RtmpAdMarkers]))
 -> RtmpGroupSettings -> f RtmpGroupSettings)
-> ((Maybe [RtmpAdMarkers] -> f (Maybe [RtmpAdMarkers]))
    -> Maybe [RtmpAdMarkers] -> f (Maybe [RtmpAdMarkers]))
-> (Maybe [RtmpAdMarkers] -> f (Maybe [RtmpAdMarkers]))
-> RtmpGroupSettings
-> f RtmpGroupSettings
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [RtmpAdMarkers] [RtmpAdMarkers] [RtmpAdMarkers] [RtmpAdMarkers]
-> Iso
     (Maybe [RtmpAdMarkers])
     (Maybe [RtmpAdMarkers])
     (Maybe [RtmpAdMarkers])
     (Maybe [RtmpAdMarkers])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  [RtmpAdMarkers] [RtmpAdMarkers] [RtmpAdMarkers] [RtmpAdMarkers]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | If a streaming output fails, number of seconds to wait until a restart
-- is initiated. A value of 0 means never restart.
rtmpGroupSettings_restartDelay :: Lens.Lens' RtmpGroupSettings (Prelude.Maybe Prelude.Natural)
rtmpGroupSettings_restartDelay :: (Maybe Natural -> f (Maybe Natural))
-> RtmpGroupSettings -> f RtmpGroupSettings
rtmpGroupSettings_restartDelay = (RtmpGroupSettings -> Maybe Natural)
-> (RtmpGroupSettings -> Maybe Natural -> RtmpGroupSettings)
-> Lens
     RtmpGroupSettings RtmpGroupSettings (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RtmpGroupSettings' {Maybe Natural
restartDelay :: Maybe Natural
$sel:restartDelay:RtmpGroupSettings' :: RtmpGroupSettings -> Maybe Natural
restartDelay} -> Maybe Natural
restartDelay) (\s :: RtmpGroupSettings
s@RtmpGroupSettings' {} Maybe Natural
a -> RtmpGroupSettings
s {$sel:restartDelay:RtmpGroupSettings' :: Maybe Natural
restartDelay = Maybe Natural
a} :: RtmpGroupSettings)

-- | Authentication scheme to use when connecting with CDN
rtmpGroupSettings_authenticationScheme :: Lens.Lens' RtmpGroupSettings (Prelude.Maybe AuthenticationScheme)
rtmpGroupSettings_authenticationScheme :: (Maybe AuthenticationScheme -> f (Maybe AuthenticationScheme))
-> RtmpGroupSettings -> f RtmpGroupSettings
rtmpGroupSettings_authenticationScheme = (RtmpGroupSettings -> Maybe AuthenticationScheme)
-> (RtmpGroupSettings
    -> Maybe AuthenticationScheme -> RtmpGroupSettings)
-> Lens
     RtmpGroupSettings
     RtmpGroupSettings
     (Maybe AuthenticationScheme)
     (Maybe AuthenticationScheme)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RtmpGroupSettings' {Maybe AuthenticationScheme
authenticationScheme :: Maybe AuthenticationScheme
$sel:authenticationScheme:RtmpGroupSettings' :: RtmpGroupSettings -> Maybe AuthenticationScheme
authenticationScheme} -> Maybe AuthenticationScheme
authenticationScheme) (\s :: RtmpGroupSettings
s@RtmpGroupSettings' {} Maybe AuthenticationScheme
a -> RtmpGroupSettings
s {$sel:authenticationScheme:RtmpGroupSettings' :: Maybe AuthenticationScheme
authenticationScheme = Maybe AuthenticationScheme
a} :: RtmpGroupSettings)

-- | Cache length, in seconds, is used to calculate buffer size.
rtmpGroupSettings_cacheLength :: Lens.Lens' RtmpGroupSettings (Prelude.Maybe Prelude.Natural)
rtmpGroupSettings_cacheLength :: (Maybe Natural -> f (Maybe Natural))
-> RtmpGroupSettings -> f RtmpGroupSettings
rtmpGroupSettings_cacheLength = (RtmpGroupSettings -> Maybe Natural)
-> (RtmpGroupSettings -> Maybe Natural -> RtmpGroupSettings)
-> Lens
     RtmpGroupSettings RtmpGroupSettings (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RtmpGroupSettings' {Maybe Natural
cacheLength :: Maybe Natural
$sel:cacheLength:RtmpGroupSettings' :: RtmpGroupSettings -> Maybe Natural
cacheLength} -> Maybe Natural
cacheLength) (\s :: RtmpGroupSettings
s@RtmpGroupSettings' {} Maybe Natural
a -> RtmpGroupSettings
s {$sel:cacheLength:RtmpGroupSettings' :: Maybe Natural
cacheLength = Maybe Natural
a} :: RtmpGroupSettings)

-- | Controls behavior when content cache fills up. If remote origin server
-- stalls the RTMP connection and does not accept content fast enough the
-- \'Media Cache\' will fill up. When the cache reaches the duration
-- specified by cacheLength the cache will stop accepting new content. If
-- set to disconnectImmediately, the RTMP output will force a disconnect.
-- Clear the media cache, and reconnect after restartDelay seconds. If set
-- to waitForServer, the RTMP output will wait up to 5 minutes to allow the
-- origin server to begin accepting data again.
rtmpGroupSettings_cacheFullBehavior :: Lens.Lens' RtmpGroupSettings (Prelude.Maybe RtmpCacheFullBehavior)
rtmpGroupSettings_cacheFullBehavior :: (Maybe RtmpCacheFullBehavior -> f (Maybe RtmpCacheFullBehavior))
-> RtmpGroupSettings -> f RtmpGroupSettings
rtmpGroupSettings_cacheFullBehavior = (RtmpGroupSettings -> Maybe RtmpCacheFullBehavior)
-> (RtmpGroupSettings
    -> Maybe RtmpCacheFullBehavior -> RtmpGroupSettings)
-> Lens
     RtmpGroupSettings
     RtmpGroupSettings
     (Maybe RtmpCacheFullBehavior)
     (Maybe RtmpCacheFullBehavior)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RtmpGroupSettings' {Maybe RtmpCacheFullBehavior
cacheFullBehavior :: Maybe RtmpCacheFullBehavior
$sel:cacheFullBehavior:RtmpGroupSettings' :: RtmpGroupSettings -> Maybe RtmpCacheFullBehavior
cacheFullBehavior} -> Maybe RtmpCacheFullBehavior
cacheFullBehavior) (\s :: RtmpGroupSettings
s@RtmpGroupSettings' {} Maybe RtmpCacheFullBehavior
a -> RtmpGroupSettings
s {$sel:cacheFullBehavior:RtmpGroupSettings' :: Maybe RtmpCacheFullBehavior
cacheFullBehavior = Maybe RtmpCacheFullBehavior
a} :: RtmpGroupSettings)

instance Core.FromJSON RtmpGroupSettings where
  parseJSON :: Value -> Parser RtmpGroupSettings
parseJSON =
    String
-> (Object -> Parser RtmpGroupSettings)
-> Value
-> Parser RtmpGroupSettings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"RtmpGroupSettings"
      ( \Object
x ->
          Maybe InputLossActionForRtmpOut
-> Maybe RtmpCaptionData
-> Maybe [RtmpAdMarkers]
-> Maybe Natural
-> Maybe AuthenticationScheme
-> Maybe Natural
-> Maybe RtmpCacheFullBehavior
-> RtmpGroupSettings
RtmpGroupSettings'
            (Maybe InputLossActionForRtmpOut
 -> Maybe RtmpCaptionData
 -> Maybe [RtmpAdMarkers]
 -> Maybe Natural
 -> Maybe AuthenticationScheme
 -> Maybe Natural
 -> Maybe RtmpCacheFullBehavior
 -> RtmpGroupSettings)
-> Parser (Maybe InputLossActionForRtmpOut)
-> Parser
     (Maybe RtmpCaptionData
      -> Maybe [RtmpAdMarkers]
      -> Maybe Natural
      -> Maybe AuthenticationScheme
      -> Maybe Natural
      -> Maybe RtmpCacheFullBehavior
      -> RtmpGroupSettings)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe InputLossActionForRtmpOut)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"inputLossAction")
            Parser
  (Maybe RtmpCaptionData
   -> Maybe [RtmpAdMarkers]
   -> Maybe Natural
   -> Maybe AuthenticationScheme
   -> Maybe Natural
   -> Maybe RtmpCacheFullBehavior
   -> RtmpGroupSettings)
-> Parser (Maybe RtmpCaptionData)
-> Parser
     (Maybe [RtmpAdMarkers]
      -> Maybe Natural
      -> Maybe AuthenticationScheme
      -> Maybe Natural
      -> Maybe RtmpCacheFullBehavior
      -> RtmpGroupSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe RtmpCaptionData)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"captionData")
            Parser
  (Maybe [RtmpAdMarkers]
   -> Maybe Natural
   -> Maybe AuthenticationScheme
   -> Maybe Natural
   -> Maybe RtmpCacheFullBehavior
   -> RtmpGroupSettings)
-> Parser (Maybe [RtmpAdMarkers])
-> Parser
     (Maybe Natural
      -> Maybe AuthenticationScheme
      -> Maybe Natural
      -> Maybe RtmpCacheFullBehavior
      -> RtmpGroupSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [RtmpAdMarkers]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"adMarkers" Parser (Maybe (Maybe [RtmpAdMarkers]))
-> Maybe [RtmpAdMarkers] -> Parser (Maybe [RtmpAdMarkers])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [RtmpAdMarkers]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe Natural
   -> Maybe AuthenticationScheme
   -> Maybe Natural
   -> Maybe RtmpCacheFullBehavior
   -> RtmpGroupSettings)
-> Parser (Maybe Natural)
-> Parser
     (Maybe AuthenticationScheme
      -> Maybe Natural
      -> Maybe RtmpCacheFullBehavior
      -> RtmpGroupSettings)
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")
            Parser
  (Maybe AuthenticationScheme
   -> Maybe Natural
   -> Maybe RtmpCacheFullBehavior
   -> RtmpGroupSettings)
-> Parser (Maybe AuthenticationScheme)
-> Parser
     (Maybe Natural -> Maybe RtmpCacheFullBehavior -> RtmpGroupSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AuthenticationScheme)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"authenticationScheme")
            Parser
  (Maybe Natural -> Maybe RtmpCacheFullBehavior -> RtmpGroupSettings)
-> Parser (Maybe Natural)
-> Parser (Maybe RtmpCacheFullBehavior -> RtmpGroupSettings)
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
"cacheLength")
            Parser (Maybe RtmpCacheFullBehavior -> RtmpGroupSettings)
-> Parser (Maybe RtmpCacheFullBehavior) -> Parser RtmpGroupSettings
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe RtmpCacheFullBehavior)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"cacheFullBehavior")
      )

instance Prelude.Hashable RtmpGroupSettings

instance Prelude.NFData RtmpGroupSettings

instance Core.ToJSON RtmpGroupSettings where
  toJSON :: RtmpGroupSettings -> Value
toJSON RtmpGroupSettings' {Maybe Natural
Maybe [RtmpAdMarkers]
Maybe AuthenticationScheme
Maybe InputLossActionForRtmpOut
Maybe RtmpCacheFullBehavior
Maybe RtmpCaptionData
cacheFullBehavior :: Maybe RtmpCacheFullBehavior
cacheLength :: Maybe Natural
authenticationScheme :: Maybe AuthenticationScheme
restartDelay :: Maybe Natural
adMarkers :: Maybe [RtmpAdMarkers]
captionData :: Maybe RtmpCaptionData
inputLossAction :: Maybe InputLossActionForRtmpOut
$sel:cacheFullBehavior:RtmpGroupSettings' :: RtmpGroupSettings -> Maybe RtmpCacheFullBehavior
$sel:cacheLength:RtmpGroupSettings' :: RtmpGroupSettings -> Maybe Natural
$sel:authenticationScheme:RtmpGroupSettings' :: RtmpGroupSettings -> Maybe AuthenticationScheme
$sel:restartDelay:RtmpGroupSettings' :: RtmpGroupSettings -> Maybe Natural
$sel:adMarkers:RtmpGroupSettings' :: RtmpGroupSettings -> Maybe [RtmpAdMarkers]
$sel:captionData:RtmpGroupSettings' :: RtmpGroupSettings -> Maybe RtmpCaptionData
$sel:inputLossAction:RtmpGroupSettings' :: RtmpGroupSettings -> Maybe InputLossActionForRtmpOut
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"inputLossAction" Text -> InputLossActionForRtmpOut -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (InputLossActionForRtmpOut -> Pair)
-> Maybe InputLossActionForRtmpOut -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe InputLossActionForRtmpOut
inputLossAction,
            (Text
"captionData" Text -> RtmpCaptionData -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (RtmpCaptionData -> Pair) -> Maybe RtmpCaptionData -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RtmpCaptionData
captionData,
            (Text
"adMarkers" Text -> [RtmpAdMarkers] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([RtmpAdMarkers] -> Pair) -> Maybe [RtmpAdMarkers] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [RtmpAdMarkers]
adMarkers,
            (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,
            (Text
"authenticationScheme" Text -> AuthenticationScheme -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (AuthenticationScheme -> Pair)
-> Maybe AuthenticationScheme -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AuthenticationScheme
authenticationScheme,
            (Text
"cacheLength" 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
cacheLength,
            (Text
"cacheFullBehavior" Text -> RtmpCacheFullBehavior -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (RtmpCacheFullBehavior -> Pair)
-> Maybe RtmpCacheFullBehavior -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RtmpCacheFullBehavior
cacheFullBehavior
          ]
      )