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