{-# 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.AudioSilenceFailoverSettings where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data AudioSilenceFailoverSettings = AudioSilenceFailoverSettings'
{
AudioSilenceFailoverSettings -> Maybe Natural
audioSilenceThresholdMsec :: Prelude.Maybe Prelude.Natural,
AudioSilenceFailoverSettings -> Text
audioSelectorName :: Prelude.Text
}
deriving (AudioSilenceFailoverSettings
-> AudioSilenceFailoverSettings -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AudioSilenceFailoverSettings
-> AudioSilenceFailoverSettings -> Bool
$c/= :: AudioSilenceFailoverSettings
-> AudioSilenceFailoverSettings -> Bool
== :: AudioSilenceFailoverSettings
-> AudioSilenceFailoverSettings -> Bool
$c== :: AudioSilenceFailoverSettings
-> AudioSilenceFailoverSettings -> Bool
Prelude.Eq, ReadPrec [AudioSilenceFailoverSettings]
ReadPrec AudioSilenceFailoverSettings
Int -> ReadS AudioSilenceFailoverSettings
ReadS [AudioSilenceFailoverSettings]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AudioSilenceFailoverSettings]
$creadListPrec :: ReadPrec [AudioSilenceFailoverSettings]
readPrec :: ReadPrec AudioSilenceFailoverSettings
$creadPrec :: ReadPrec AudioSilenceFailoverSettings
readList :: ReadS [AudioSilenceFailoverSettings]
$creadList :: ReadS [AudioSilenceFailoverSettings]
readsPrec :: Int -> ReadS AudioSilenceFailoverSettings
$creadsPrec :: Int -> ReadS AudioSilenceFailoverSettings
Prelude.Read, Int -> AudioSilenceFailoverSettings -> ShowS
[AudioSilenceFailoverSettings] -> ShowS
AudioSilenceFailoverSettings -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AudioSilenceFailoverSettings] -> ShowS
$cshowList :: [AudioSilenceFailoverSettings] -> ShowS
show :: AudioSilenceFailoverSettings -> String
$cshow :: AudioSilenceFailoverSettings -> String
showsPrec :: Int -> AudioSilenceFailoverSettings -> ShowS
$cshowsPrec :: Int -> AudioSilenceFailoverSettings -> ShowS
Prelude.Show, forall x.
Rep AudioSilenceFailoverSettings x -> AudioSilenceFailoverSettings
forall x.
AudioSilenceFailoverSettings -> Rep AudioSilenceFailoverSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AudioSilenceFailoverSettings x -> AudioSilenceFailoverSettings
$cfrom :: forall x.
AudioSilenceFailoverSettings -> Rep AudioSilenceFailoverSettings x
Prelude.Generic)
newAudioSilenceFailoverSettings ::
Prelude.Text ->
AudioSilenceFailoverSettings
newAudioSilenceFailoverSettings :: Text -> AudioSilenceFailoverSettings
newAudioSilenceFailoverSettings Text
pAudioSelectorName_ =
AudioSilenceFailoverSettings'
{ $sel:audioSilenceThresholdMsec:AudioSilenceFailoverSettings' :: Maybe Natural
audioSilenceThresholdMsec =
forall a. Maybe a
Prelude.Nothing,
$sel:audioSelectorName:AudioSilenceFailoverSettings' :: Text
audioSelectorName = Text
pAudioSelectorName_
}
audioSilenceFailoverSettings_audioSilenceThresholdMsec :: Lens.Lens' AudioSilenceFailoverSettings (Prelude.Maybe Prelude.Natural)
audioSilenceFailoverSettings_audioSilenceThresholdMsec :: Lens' AudioSilenceFailoverSettings (Maybe Natural)
audioSilenceFailoverSettings_audioSilenceThresholdMsec = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AudioSilenceFailoverSettings' {Maybe Natural
audioSilenceThresholdMsec :: Maybe Natural
$sel:audioSilenceThresholdMsec:AudioSilenceFailoverSettings' :: AudioSilenceFailoverSettings -> Maybe Natural
audioSilenceThresholdMsec} -> Maybe Natural
audioSilenceThresholdMsec) (\s :: AudioSilenceFailoverSettings
s@AudioSilenceFailoverSettings' {} Maybe Natural
a -> AudioSilenceFailoverSettings
s {$sel:audioSilenceThresholdMsec:AudioSilenceFailoverSettings' :: Maybe Natural
audioSilenceThresholdMsec = Maybe Natural
a} :: AudioSilenceFailoverSettings)
audioSilenceFailoverSettings_audioSelectorName :: Lens.Lens' AudioSilenceFailoverSettings Prelude.Text
audioSilenceFailoverSettings_audioSelectorName :: Lens' AudioSilenceFailoverSettings Text
audioSilenceFailoverSettings_audioSelectorName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AudioSilenceFailoverSettings' {Text
audioSelectorName :: Text
$sel:audioSelectorName:AudioSilenceFailoverSettings' :: AudioSilenceFailoverSettings -> Text
audioSelectorName} -> Text
audioSelectorName) (\s :: AudioSilenceFailoverSettings
s@AudioSilenceFailoverSettings' {} Text
a -> AudioSilenceFailoverSettings
s {$sel:audioSelectorName:AudioSilenceFailoverSettings' :: Text
audioSelectorName = Text
a} :: AudioSilenceFailoverSettings)
instance Data.FromJSON AudioSilenceFailoverSettings where
parseJSON :: Value -> Parser AudioSilenceFailoverSettings
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"AudioSilenceFailoverSettings"
( \Object
x ->
Maybe Natural -> Text -> AudioSilenceFailoverSettings
AudioSilenceFailoverSettings'
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
"audioSilenceThresholdMsec")
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
"audioSelectorName")
)
instance
Prelude.Hashable
AudioSilenceFailoverSettings
where
hashWithSalt :: Int -> AudioSilenceFailoverSettings -> Int
hashWithSalt Int
_salt AudioSilenceFailoverSettings' {Maybe Natural
Text
audioSelectorName :: Text
audioSilenceThresholdMsec :: Maybe Natural
$sel:audioSelectorName:AudioSilenceFailoverSettings' :: AudioSilenceFailoverSettings -> Text
$sel:audioSilenceThresholdMsec:AudioSilenceFailoverSettings' :: AudioSilenceFailoverSettings -> Maybe Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
audioSilenceThresholdMsec
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
audioSelectorName
instance Prelude.NFData AudioSilenceFailoverSettings where
rnf :: AudioSilenceFailoverSettings -> ()
rnf AudioSilenceFailoverSettings' {Maybe Natural
Text
audioSelectorName :: Text
audioSilenceThresholdMsec :: Maybe Natural
$sel:audioSelectorName:AudioSilenceFailoverSettings' :: AudioSilenceFailoverSettings -> Text
$sel:audioSilenceThresholdMsec:AudioSilenceFailoverSettings' :: AudioSilenceFailoverSettings -> Maybe Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
audioSilenceThresholdMsec
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
audioSelectorName
instance Data.ToJSON AudioSilenceFailoverSettings where
toJSON :: AudioSilenceFailoverSettings -> Value
toJSON AudioSilenceFailoverSettings' {Maybe Natural
Text
audioSelectorName :: Text
audioSilenceThresholdMsec :: Maybe Natural
$sel:audioSelectorName:AudioSilenceFailoverSettings' :: AudioSilenceFailoverSettings -> Text
$sel:audioSilenceThresholdMsec:AudioSilenceFailoverSettings' :: AudioSilenceFailoverSettings -> Maybe Natural
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"audioSilenceThresholdMsec" 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
audioSilenceThresholdMsec,
forall a. a -> Maybe a
Prelude.Just
(Key
"audioSelectorName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
audioSelectorName)
]
)