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