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