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