{-# 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.DvbNitSettings 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 DvbNitSettings = DvbNitSettings'
{
DvbNitSettings -> Maybe Natural
repInterval :: Prelude.Maybe Prelude.Natural,
DvbNitSettings -> Text
networkName :: Prelude.Text,
DvbNitSettings -> Natural
networkId :: Prelude.Natural
}
deriving (DvbNitSettings -> DvbNitSettings -> Bool
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]
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
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. 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 ::
Prelude.Text ->
Prelude.Natural ->
DvbNitSettings
newDvbNitSettings :: Text -> Natural -> DvbNitSettings
newDvbNitSettings Text
pNetworkName_ Natural
pNetworkId_ =
DvbNitSettings'
{ $sel:repInterval:DvbNitSettings' :: Maybe Natural
repInterval = forall a. Maybe a
Prelude.Nothing,
$sel:networkName:DvbNitSettings' :: Text
networkName = Text
pNetworkName_,
$sel:networkId:DvbNitSettings' :: Natural
networkId = Natural
pNetworkId_
}
dvbNitSettings_repInterval :: Lens.Lens' DvbNitSettings (Prelude.Maybe Prelude.Natural)
dvbNitSettings_repInterval :: Lens' DvbNitSettings (Maybe Natural)
dvbNitSettings_repInterval = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DvbNitSettings' {Maybe Natural
repInterval :: Maybe Natural
$sel:repInterval:DvbNitSettings' :: DvbNitSettings -> Maybe Natural
repInterval} -> Maybe Natural
repInterval) (\s :: DvbNitSettings
s@DvbNitSettings' {} Maybe Natural
a -> DvbNitSettings
s {$sel:repInterval:DvbNitSettings' :: Maybe Natural
repInterval = Maybe Natural
a} :: DvbNitSettings)
dvbNitSettings_networkName :: Lens.Lens' DvbNitSettings Prelude.Text
dvbNitSettings_networkName :: Lens' DvbNitSettings Text
dvbNitSettings_networkName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DvbNitSettings' {Text
networkName :: Text
$sel:networkName:DvbNitSettings' :: DvbNitSettings -> Text
networkName} -> Text
networkName) (\s :: DvbNitSettings
s@DvbNitSettings' {} Text
a -> DvbNitSettings
s {$sel:networkName:DvbNitSettings' :: Text
networkName = Text
a} :: DvbNitSettings)
dvbNitSettings_networkId :: Lens.Lens' DvbNitSettings Prelude.Natural
dvbNitSettings_networkId :: Lens' DvbNitSettings Natural
dvbNitSettings_networkId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DvbNitSettings' {Natural
networkId :: Natural
$sel:networkId:DvbNitSettings' :: DvbNitSettings -> Natural
networkId} -> Natural
networkId) (\s :: DvbNitSettings
s@DvbNitSettings' {} Natural
a -> DvbNitSettings
s {$sel:networkId:DvbNitSettings' :: Natural
networkId = Natural
a} :: DvbNitSettings)
instance Data.FromJSON DvbNitSettings where
parseJSON :: Value -> Parser DvbNitSettings
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"DvbNitSettings"
( \Object
x ->
Maybe Natural -> Text -> Natural -> DvbNitSettings
DvbNitSettings'
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
"repInterval")
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
"networkName")
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
"networkId")
)
instance Prelude.Hashable DvbNitSettings where
hashWithSalt :: Int -> DvbNitSettings -> Int
hashWithSalt Int
_salt DvbNitSettings' {Natural
Maybe Natural
Text
networkId :: Natural
networkName :: Text
repInterval :: Maybe Natural
$sel:networkId:DvbNitSettings' :: DvbNitSettings -> Natural
$sel:networkName:DvbNitSettings' :: DvbNitSettings -> Text
$sel:repInterval:DvbNitSettings' :: DvbNitSettings -> Maybe Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
repInterval
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
networkName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
networkId
instance Prelude.NFData DvbNitSettings where
rnf :: DvbNitSettings -> ()
rnf DvbNitSettings' {Natural
Maybe Natural
Text
networkId :: Natural
networkName :: Text
repInterval :: Maybe Natural
$sel:networkId:DvbNitSettings' :: DvbNitSettings -> Natural
$sel:networkName:DvbNitSettings' :: DvbNitSettings -> Text
$sel:repInterval:DvbNitSettings' :: DvbNitSettings -> Maybe Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
repInterval
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
networkName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Natural
networkId
instance Data.ToJSON DvbNitSettings where
toJSON :: DvbNitSettings -> Value
toJSON DvbNitSettings' {Natural
Maybe Natural
Text
networkId :: Natural
networkName :: Text
repInterval :: Maybe Natural
$sel:networkId:DvbNitSettings' :: DvbNitSettings -> Natural
$sel:networkName:DvbNitSettings' :: DvbNitSettings -> Text
$sel:repInterval:DvbNitSettings' :: DvbNitSettings -> Maybe Natural
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"repInterval" 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
repInterval,
forall a. a -> Maybe a
Prelude.Just (Key
"networkName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
networkName),
forall a. a -> Maybe a
Prelude.Just (Key
"networkId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Natural
networkId)
]
)