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