{-# 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.AutomaticInputFailoverSettings where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MediaLive.Types.FailoverCondition
import Amazonka.MediaLive.Types.InputPreference
import qualified Amazonka.Prelude as Prelude
data AutomaticInputFailoverSettings = AutomaticInputFailoverSettings'
{
AutomaticInputFailoverSettings -> Maybe Natural
errorClearTimeMsec :: Prelude.Maybe Prelude.Natural,
AutomaticInputFailoverSettings -> Maybe [FailoverCondition]
failoverConditions :: Prelude.Maybe [FailoverCondition],
AutomaticInputFailoverSettings -> Maybe InputPreference
inputPreference :: Prelude.Maybe InputPreference,
AutomaticInputFailoverSettings -> Text
secondaryInputId :: Prelude.Text
}
deriving (AutomaticInputFailoverSettings
-> AutomaticInputFailoverSettings -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AutomaticInputFailoverSettings
-> AutomaticInputFailoverSettings -> Bool
$c/= :: AutomaticInputFailoverSettings
-> AutomaticInputFailoverSettings -> Bool
== :: AutomaticInputFailoverSettings
-> AutomaticInputFailoverSettings -> Bool
$c== :: AutomaticInputFailoverSettings
-> AutomaticInputFailoverSettings -> Bool
Prelude.Eq, ReadPrec [AutomaticInputFailoverSettings]
ReadPrec AutomaticInputFailoverSettings
Int -> ReadS AutomaticInputFailoverSettings
ReadS [AutomaticInputFailoverSettings]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AutomaticInputFailoverSettings]
$creadListPrec :: ReadPrec [AutomaticInputFailoverSettings]
readPrec :: ReadPrec AutomaticInputFailoverSettings
$creadPrec :: ReadPrec AutomaticInputFailoverSettings
readList :: ReadS [AutomaticInputFailoverSettings]
$creadList :: ReadS [AutomaticInputFailoverSettings]
readsPrec :: Int -> ReadS AutomaticInputFailoverSettings
$creadsPrec :: Int -> ReadS AutomaticInputFailoverSettings
Prelude.Read, Int -> AutomaticInputFailoverSettings -> ShowS
[AutomaticInputFailoverSettings] -> ShowS
AutomaticInputFailoverSettings -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AutomaticInputFailoverSettings] -> ShowS
$cshowList :: [AutomaticInputFailoverSettings] -> ShowS
show :: AutomaticInputFailoverSettings -> String
$cshow :: AutomaticInputFailoverSettings -> String
showsPrec :: Int -> AutomaticInputFailoverSettings -> ShowS
$cshowsPrec :: Int -> AutomaticInputFailoverSettings -> ShowS
Prelude.Show, forall x.
Rep AutomaticInputFailoverSettings x
-> AutomaticInputFailoverSettings
forall x.
AutomaticInputFailoverSettings
-> Rep AutomaticInputFailoverSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AutomaticInputFailoverSettings x
-> AutomaticInputFailoverSettings
$cfrom :: forall x.
AutomaticInputFailoverSettings
-> Rep AutomaticInputFailoverSettings x
Prelude.Generic)
newAutomaticInputFailoverSettings ::
Prelude.Text ->
AutomaticInputFailoverSettings
newAutomaticInputFailoverSettings :: Text -> AutomaticInputFailoverSettings
newAutomaticInputFailoverSettings Text
pSecondaryInputId_ =
AutomaticInputFailoverSettings'
{ $sel:errorClearTimeMsec:AutomaticInputFailoverSettings' :: Maybe Natural
errorClearTimeMsec =
forall a. Maybe a
Prelude.Nothing,
$sel:failoverConditions:AutomaticInputFailoverSettings' :: Maybe [FailoverCondition]
failoverConditions = forall a. Maybe a
Prelude.Nothing,
$sel:inputPreference:AutomaticInputFailoverSettings' :: Maybe InputPreference
inputPreference = forall a. Maybe a
Prelude.Nothing,
$sel:secondaryInputId:AutomaticInputFailoverSettings' :: Text
secondaryInputId = Text
pSecondaryInputId_
}
automaticInputFailoverSettings_errorClearTimeMsec :: Lens.Lens' AutomaticInputFailoverSettings (Prelude.Maybe Prelude.Natural)
automaticInputFailoverSettings_errorClearTimeMsec :: Lens' AutomaticInputFailoverSettings (Maybe Natural)
automaticInputFailoverSettings_errorClearTimeMsec = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutomaticInputFailoverSettings' {Maybe Natural
errorClearTimeMsec :: Maybe Natural
$sel:errorClearTimeMsec:AutomaticInputFailoverSettings' :: AutomaticInputFailoverSettings -> Maybe Natural
errorClearTimeMsec} -> Maybe Natural
errorClearTimeMsec) (\s :: AutomaticInputFailoverSettings
s@AutomaticInputFailoverSettings' {} Maybe Natural
a -> AutomaticInputFailoverSettings
s {$sel:errorClearTimeMsec:AutomaticInputFailoverSettings' :: Maybe Natural
errorClearTimeMsec = Maybe Natural
a} :: AutomaticInputFailoverSettings)
automaticInputFailoverSettings_failoverConditions :: Lens.Lens' AutomaticInputFailoverSettings (Prelude.Maybe [FailoverCondition])
automaticInputFailoverSettings_failoverConditions :: Lens' AutomaticInputFailoverSettings (Maybe [FailoverCondition])
automaticInputFailoverSettings_failoverConditions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutomaticInputFailoverSettings' {Maybe [FailoverCondition]
failoverConditions :: Maybe [FailoverCondition]
$sel:failoverConditions:AutomaticInputFailoverSettings' :: AutomaticInputFailoverSettings -> Maybe [FailoverCondition]
failoverConditions} -> Maybe [FailoverCondition]
failoverConditions) (\s :: AutomaticInputFailoverSettings
s@AutomaticInputFailoverSettings' {} Maybe [FailoverCondition]
a -> AutomaticInputFailoverSettings
s {$sel:failoverConditions:AutomaticInputFailoverSettings' :: Maybe [FailoverCondition]
failoverConditions = Maybe [FailoverCondition]
a} :: AutomaticInputFailoverSettings) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
automaticInputFailoverSettings_inputPreference :: Lens.Lens' AutomaticInputFailoverSettings (Prelude.Maybe InputPreference)
automaticInputFailoverSettings_inputPreference :: Lens' AutomaticInputFailoverSettings (Maybe InputPreference)
automaticInputFailoverSettings_inputPreference = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutomaticInputFailoverSettings' {Maybe InputPreference
inputPreference :: Maybe InputPreference
$sel:inputPreference:AutomaticInputFailoverSettings' :: AutomaticInputFailoverSettings -> Maybe InputPreference
inputPreference} -> Maybe InputPreference
inputPreference) (\s :: AutomaticInputFailoverSettings
s@AutomaticInputFailoverSettings' {} Maybe InputPreference
a -> AutomaticInputFailoverSettings
s {$sel:inputPreference:AutomaticInputFailoverSettings' :: Maybe InputPreference
inputPreference = Maybe InputPreference
a} :: AutomaticInputFailoverSettings)
automaticInputFailoverSettings_secondaryInputId :: Lens.Lens' AutomaticInputFailoverSettings Prelude.Text
automaticInputFailoverSettings_secondaryInputId :: Lens' AutomaticInputFailoverSettings Text
automaticInputFailoverSettings_secondaryInputId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutomaticInputFailoverSettings' {Text
secondaryInputId :: Text
$sel:secondaryInputId:AutomaticInputFailoverSettings' :: AutomaticInputFailoverSettings -> Text
secondaryInputId} -> Text
secondaryInputId) (\s :: AutomaticInputFailoverSettings
s@AutomaticInputFailoverSettings' {} Text
a -> AutomaticInputFailoverSettings
s {$sel:secondaryInputId:AutomaticInputFailoverSettings' :: Text
secondaryInputId = Text
a} :: AutomaticInputFailoverSettings)
instance Data.FromJSON AutomaticInputFailoverSettings where
parseJSON :: Value -> Parser AutomaticInputFailoverSettings
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"AutomaticInputFailoverSettings"
( \Object
x ->
Maybe Natural
-> Maybe [FailoverCondition]
-> Maybe InputPreference
-> Text
-> AutomaticInputFailoverSettings
AutomaticInputFailoverSettings'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"errorClearTimeMsec")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"failoverConditions"
forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"inputPreference")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"secondaryInputId")
)
instance
Prelude.Hashable
AutomaticInputFailoverSettings
where
hashWithSalt :: Int -> AutomaticInputFailoverSettings -> Int
hashWithSalt
Int
_salt
AutomaticInputFailoverSettings' {Maybe Natural
Maybe [FailoverCondition]
Maybe InputPreference
Text
secondaryInputId :: Text
inputPreference :: Maybe InputPreference
failoverConditions :: Maybe [FailoverCondition]
errorClearTimeMsec :: Maybe Natural
$sel:secondaryInputId:AutomaticInputFailoverSettings' :: AutomaticInputFailoverSettings -> Text
$sel:inputPreference:AutomaticInputFailoverSettings' :: AutomaticInputFailoverSettings -> Maybe InputPreference
$sel:failoverConditions:AutomaticInputFailoverSettings' :: AutomaticInputFailoverSettings -> Maybe [FailoverCondition]
$sel:errorClearTimeMsec:AutomaticInputFailoverSettings' :: AutomaticInputFailoverSettings -> Maybe Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
errorClearTimeMsec
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [FailoverCondition]
failoverConditions
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe InputPreference
inputPreference
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
secondaryInputId
instance
Prelude.NFData
AutomaticInputFailoverSettings
where
rnf :: AutomaticInputFailoverSettings -> ()
rnf AutomaticInputFailoverSettings' {Maybe Natural
Maybe [FailoverCondition]
Maybe InputPreference
Text
secondaryInputId :: Text
inputPreference :: Maybe InputPreference
failoverConditions :: Maybe [FailoverCondition]
errorClearTimeMsec :: Maybe Natural
$sel:secondaryInputId:AutomaticInputFailoverSettings' :: AutomaticInputFailoverSettings -> Text
$sel:inputPreference:AutomaticInputFailoverSettings' :: AutomaticInputFailoverSettings -> Maybe InputPreference
$sel:failoverConditions:AutomaticInputFailoverSettings' :: AutomaticInputFailoverSettings -> Maybe [FailoverCondition]
$sel:errorClearTimeMsec:AutomaticInputFailoverSettings' :: AutomaticInputFailoverSettings -> Maybe Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
errorClearTimeMsec
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [FailoverCondition]
failoverConditions
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe InputPreference
inputPreference
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
secondaryInputId
instance Data.ToJSON AutomaticInputFailoverSettings where
toJSON :: AutomaticInputFailoverSettings -> Value
toJSON AutomaticInputFailoverSettings' {Maybe Natural
Maybe [FailoverCondition]
Maybe InputPreference
Text
secondaryInputId :: Text
inputPreference :: Maybe InputPreference
failoverConditions :: Maybe [FailoverCondition]
errorClearTimeMsec :: Maybe Natural
$sel:secondaryInputId:AutomaticInputFailoverSettings' :: AutomaticInputFailoverSettings -> Text
$sel:inputPreference:AutomaticInputFailoverSettings' :: AutomaticInputFailoverSettings -> Maybe InputPreference
$sel:failoverConditions:AutomaticInputFailoverSettings' :: AutomaticInputFailoverSettings -> Maybe [FailoverCondition]
$sel:errorClearTimeMsec:AutomaticInputFailoverSettings' :: AutomaticInputFailoverSettings -> Maybe Natural
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"errorClearTimeMsec" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
errorClearTimeMsec,
(Key
"failoverConditions" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [FailoverCondition]
failoverConditions,
(Key
"inputPreference" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe InputPreference
inputPreference,
forall a. a -> Maybe a
Prelude.Just
(Key
"secondaryInputId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
secondaryInputId)
]
)