{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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.
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'
{ $sel:duration:Scte35SpliceInsertScheduleActionSettings' :: Maybe Natural
duration =
forall a. Maybe a
Prelude.Nothing,
$sel:spliceEventId:Scte35SpliceInsertScheduleActionSettings' :: Natural
spliceEventId = Natural
pSpliceEventId_
}
scte35SpliceInsertScheduleActionSettings_duration :: Lens.Lens' Scte35SpliceInsertScheduleActionSettings (Prelude.Maybe Prelude.Natural)
scte35SpliceInsertScheduleActionSettings_duration :: Lens' Scte35SpliceInsertScheduleActionSettings (Maybe Natural)
scte35SpliceInsertScheduleActionSettings_duration = 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 :: Lens' Scte35SpliceInsertScheduleActionSettings Natural
scte35SpliceInsertScheduleActionSettings_spliceEventId = 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
Data.FromJSON
Scte35SpliceInsertScheduleActionSettings
where
parseJSON :: Value -> Parser Scte35SpliceInsertScheduleActionSettings
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Scte35SpliceInsertScheduleActionSettings"
( \Object
x ->
Maybe Natural
-> Natural -> Scte35SpliceInsertScheduleActionSettings
Scte35SpliceInsertScheduleActionSettings'
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
"duration")
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
"spliceEventId")
)
instance
Prelude.Hashable
Scte35SpliceInsertScheduleActionSettings
where
hashWithSalt :: Int -> Scte35SpliceInsertScheduleActionSettings -> Int
hashWithSalt
Int
_salt
Scte35SpliceInsertScheduleActionSettings' {Natural
Maybe Natural
spliceEventId :: Natural
duration :: Maybe Natural
$sel:spliceEventId:Scte35SpliceInsertScheduleActionSettings' :: Scte35SpliceInsertScheduleActionSettings -> Natural
$sel:duration:Scte35SpliceInsertScheduleActionSettings' :: Scte35SpliceInsertScheduleActionSettings -> Maybe Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
duration
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
spliceEventId
instance
Prelude.NFData
Scte35SpliceInsertScheduleActionSettings
where
rnf :: Scte35SpliceInsertScheduleActionSettings -> ()
rnf Scte35SpliceInsertScheduleActionSettings' {Natural
Maybe Natural
spliceEventId :: Natural
duration :: Maybe Natural
$sel:spliceEventId:Scte35SpliceInsertScheduleActionSettings' :: Scte35SpliceInsertScheduleActionSettings -> Natural
$sel:duration:Scte35SpliceInsertScheduleActionSettings' :: Scte35SpliceInsertScheduleActionSettings -> Maybe Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
duration
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Natural
spliceEventId
instance
Data.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
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"duration" 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
duration,
forall a. a -> Maybe a
Prelude.Just
(Key
"spliceEventId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Natural
spliceEventId)
]
)