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