{-# 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.InputLossFailoverSettings where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data InputLossFailoverSettings = InputLossFailoverSettings'
{
InputLossFailoverSettings -> Maybe Natural
inputLossThresholdMsec :: Prelude.Maybe Prelude.Natural
}
deriving (InputLossFailoverSettings -> InputLossFailoverSettings -> Bool
(InputLossFailoverSettings -> InputLossFailoverSettings -> Bool)
-> (InputLossFailoverSettings -> InputLossFailoverSettings -> Bool)
-> Eq InputLossFailoverSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InputLossFailoverSettings -> InputLossFailoverSettings -> Bool
$c/= :: InputLossFailoverSettings -> InputLossFailoverSettings -> Bool
== :: InputLossFailoverSettings -> InputLossFailoverSettings -> Bool
$c== :: InputLossFailoverSettings -> InputLossFailoverSettings -> Bool
Prelude.Eq, ReadPrec [InputLossFailoverSettings]
ReadPrec InputLossFailoverSettings
Int -> ReadS InputLossFailoverSettings
ReadS [InputLossFailoverSettings]
(Int -> ReadS InputLossFailoverSettings)
-> ReadS [InputLossFailoverSettings]
-> ReadPrec InputLossFailoverSettings
-> ReadPrec [InputLossFailoverSettings]
-> Read InputLossFailoverSettings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InputLossFailoverSettings]
$creadListPrec :: ReadPrec [InputLossFailoverSettings]
readPrec :: ReadPrec InputLossFailoverSettings
$creadPrec :: ReadPrec InputLossFailoverSettings
readList :: ReadS [InputLossFailoverSettings]
$creadList :: ReadS [InputLossFailoverSettings]
readsPrec :: Int -> ReadS InputLossFailoverSettings
$creadsPrec :: Int -> ReadS InputLossFailoverSettings
Prelude.Read, Int -> InputLossFailoverSettings -> ShowS
[InputLossFailoverSettings] -> ShowS
InputLossFailoverSettings -> String
(Int -> InputLossFailoverSettings -> ShowS)
-> (InputLossFailoverSettings -> String)
-> ([InputLossFailoverSettings] -> ShowS)
-> Show InputLossFailoverSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InputLossFailoverSettings] -> ShowS
$cshowList :: [InputLossFailoverSettings] -> ShowS
show :: InputLossFailoverSettings -> String
$cshow :: InputLossFailoverSettings -> String
showsPrec :: Int -> InputLossFailoverSettings -> ShowS
$cshowsPrec :: Int -> InputLossFailoverSettings -> ShowS
Prelude.Show, (forall x.
InputLossFailoverSettings -> Rep InputLossFailoverSettings x)
-> (forall x.
Rep InputLossFailoverSettings x -> InputLossFailoverSettings)
-> Generic InputLossFailoverSettings
forall x.
Rep InputLossFailoverSettings x -> InputLossFailoverSettings
forall x.
InputLossFailoverSettings -> Rep InputLossFailoverSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep InputLossFailoverSettings x -> InputLossFailoverSettings
$cfrom :: forall x.
InputLossFailoverSettings -> Rep InputLossFailoverSettings x
Prelude.Generic)
newInputLossFailoverSettings ::
InputLossFailoverSettings
newInputLossFailoverSettings :: InputLossFailoverSettings
newInputLossFailoverSettings =
InputLossFailoverSettings' :: Maybe Natural -> InputLossFailoverSettings
InputLossFailoverSettings'
{ $sel:inputLossThresholdMsec:InputLossFailoverSettings' :: Maybe Natural
inputLossThresholdMsec =
Maybe Natural
forall a. Maybe a
Prelude.Nothing
}
inputLossFailoverSettings_inputLossThresholdMsec :: Lens.Lens' InputLossFailoverSettings (Prelude.Maybe Prelude.Natural)
inputLossFailoverSettings_inputLossThresholdMsec :: (Maybe Natural -> f (Maybe Natural))
-> InputLossFailoverSettings -> f InputLossFailoverSettings
inputLossFailoverSettings_inputLossThresholdMsec = (InputLossFailoverSettings -> Maybe Natural)
-> (InputLossFailoverSettings
-> Maybe Natural -> InputLossFailoverSettings)
-> Lens
InputLossFailoverSettings
InputLossFailoverSettings
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputLossFailoverSettings' {Maybe Natural
inputLossThresholdMsec :: Maybe Natural
$sel:inputLossThresholdMsec:InputLossFailoverSettings' :: InputLossFailoverSettings -> Maybe Natural
inputLossThresholdMsec} -> Maybe Natural
inputLossThresholdMsec) (\s :: InputLossFailoverSettings
s@InputLossFailoverSettings' {} Maybe Natural
a -> InputLossFailoverSettings
s {$sel:inputLossThresholdMsec:InputLossFailoverSettings' :: Maybe Natural
inputLossThresholdMsec = Maybe Natural
a} :: InputLossFailoverSettings)
instance Core.FromJSON InputLossFailoverSettings where
parseJSON :: Value -> Parser InputLossFailoverSettings
parseJSON =
String
-> (Object -> Parser InputLossFailoverSettings)
-> Value
-> Parser InputLossFailoverSettings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"InputLossFailoverSettings"
( \Object
x ->
Maybe Natural -> InputLossFailoverSettings
InputLossFailoverSettings'
(Maybe Natural -> InputLossFailoverSettings)
-> Parser (Maybe Natural) -> Parser InputLossFailoverSettings
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
"inputLossThresholdMsec")
)
instance Prelude.Hashable InputLossFailoverSettings
instance Prelude.NFData InputLossFailoverSettings
instance Core.ToJSON InputLossFailoverSettings where
toJSON :: InputLossFailoverSettings -> Value
toJSON InputLossFailoverSettings' {Maybe Natural
inputLossThresholdMsec :: Maybe Natural
$sel:inputLossThresholdMsec:InputLossFailoverSettings' :: InputLossFailoverSettings -> Maybe Natural
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"inputLossThresholdMsec" 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
inputLossThresholdMsec
]
)