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