{-# 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.MediaTailor.Types.SegmentationDescriptor 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 SegmentationDescriptor = SegmentationDescriptor'
{
SegmentationDescriptor -> Maybe Int
segmentNum :: Prelude.Maybe Prelude.Int,
SegmentationDescriptor -> Maybe Int
segmentationEventId :: Prelude.Maybe Prelude.Int,
SegmentationDescriptor -> Maybe Int
segmentationTypeId :: Prelude.Maybe Prelude.Int,
SegmentationDescriptor -> Maybe Text
segmentationUpid :: Prelude.Maybe Prelude.Text,
SegmentationDescriptor -> Maybe Int
segmentationUpidType :: Prelude.Maybe Prelude.Int,
SegmentationDescriptor -> Maybe Int
segmentsExpected :: Prelude.Maybe Prelude.Int,
SegmentationDescriptor -> Maybe Int
subSegmentNum :: Prelude.Maybe Prelude.Int,
SegmentationDescriptor -> Maybe Int
subSegmentsExpected :: Prelude.Maybe Prelude.Int
}
deriving (SegmentationDescriptor -> SegmentationDescriptor -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SegmentationDescriptor -> SegmentationDescriptor -> Bool
$c/= :: SegmentationDescriptor -> SegmentationDescriptor -> Bool
== :: SegmentationDescriptor -> SegmentationDescriptor -> Bool
$c== :: SegmentationDescriptor -> SegmentationDescriptor -> Bool
Prelude.Eq, ReadPrec [SegmentationDescriptor]
ReadPrec SegmentationDescriptor
Int -> ReadS SegmentationDescriptor
ReadS [SegmentationDescriptor]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SegmentationDescriptor]
$creadListPrec :: ReadPrec [SegmentationDescriptor]
readPrec :: ReadPrec SegmentationDescriptor
$creadPrec :: ReadPrec SegmentationDescriptor
readList :: ReadS [SegmentationDescriptor]
$creadList :: ReadS [SegmentationDescriptor]
readsPrec :: Int -> ReadS SegmentationDescriptor
$creadsPrec :: Int -> ReadS SegmentationDescriptor
Prelude.Read, Int -> SegmentationDescriptor -> ShowS
[SegmentationDescriptor] -> ShowS
SegmentationDescriptor -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SegmentationDescriptor] -> ShowS
$cshowList :: [SegmentationDescriptor] -> ShowS
show :: SegmentationDescriptor -> String
$cshow :: SegmentationDescriptor -> String
showsPrec :: Int -> SegmentationDescriptor -> ShowS
$cshowsPrec :: Int -> SegmentationDescriptor -> ShowS
Prelude.Show, forall x. Rep SegmentationDescriptor x -> SegmentationDescriptor
forall x. SegmentationDescriptor -> Rep SegmentationDescriptor x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SegmentationDescriptor x -> SegmentationDescriptor
$cfrom :: forall x. SegmentationDescriptor -> Rep SegmentationDescriptor x
Prelude.Generic)
newSegmentationDescriptor ::
SegmentationDescriptor
newSegmentationDescriptor :: SegmentationDescriptor
newSegmentationDescriptor =
SegmentationDescriptor'
{ $sel:segmentNum:SegmentationDescriptor' :: Maybe Int
segmentNum =
forall a. Maybe a
Prelude.Nothing,
$sel:segmentationEventId:SegmentationDescriptor' :: Maybe Int
segmentationEventId = forall a. Maybe a
Prelude.Nothing,
$sel:segmentationTypeId:SegmentationDescriptor' :: Maybe Int
segmentationTypeId = forall a. Maybe a
Prelude.Nothing,
$sel:segmentationUpid:SegmentationDescriptor' :: Maybe Text
segmentationUpid = forall a. Maybe a
Prelude.Nothing,
$sel:segmentationUpidType:SegmentationDescriptor' :: Maybe Int
segmentationUpidType = forall a. Maybe a
Prelude.Nothing,
$sel:segmentsExpected:SegmentationDescriptor' :: Maybe Int
segmentsExpected = forall a. Maybe a
Prelude.Nothing,
$sel:subSegmentNum:SegmentationDescriptor' :: Maybe Int
subSegmentNum = forall a. Maybe a
Prelude.Nothing,
$sel:subSegmentsExpected:SegmentationDescriptor' :: Maybe Int
subSegmentsExpected = forall a. Maybe a
Prelude.Nothing
}
segmentationDescriptor_segmentNum :: Lens.Lens' SegmentationDescriptor (Prelude.Maybe Prelude.Int)
segmentationDescriptor_segmentNum :: Lens' SegmentationDescriptor (Maybe Int)
segmentationDescriptor_segmentNum = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SegmentationDescriptor' {Maybe Int
segmentNum :: Maybe Int
$sel:segmentNum:SegmentationDescriptor' :: SegmentationDescriptor -> Maybe Int
segmentNum} -> Maybe Int
segmentNum) (\s :: SegmentationDescriptor
s@SegmentationDescriptor' {} Maybe Int
a -> SegmentationDescriptor
s {$sel:segmentNum:SegmentationDescriptor' :: Maybe Int
segmentNum = Maybe Int
a} :: SegmentationDescriptor)
segmentationDescriptor_segmentationEventId :: Lens.Lens' SegmentationDescriptor (Prelude.Maybe Prelude.Int)
segmentationDescriptor_segmentationEventId :: Lens' SegmentationDescriptor (Maybe Int)
segmentationDescriptor_segmentationEventId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SegmentationDescriptor' {Maybe Int
segmentationEventId :: Maybe Int
$sel:segmentationEventId:SegmentationDescriptor' :: SegmentationDescriptor -> Maybe Int
segmentationEventId} -> Maybe Int
segmentationEventId) (\s :: SegmentationDescriptor
s@SegmentationDescriptor' {} Maybe Int
a -> SegmentationDescriptor
s {$sel:segmentationEventId:SegmentationDescriptor' :: Maybe Int
segmentationEventId = Maybe Int
a} :: SegmentationDescriptor)
segmentationDescriptor_segmentationTypeId :: Lens.Lens' SegmentationDescriptor (Prelude.Maybe Prelude.Int)
segmentationDescriptor_segmentationTypeId :: Lens' SegmentationDescriptor (Maybe Int)
segmentationDescriptor_segmentationTypeId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SegmentationDescriptor' {Maybe Int
segmentationTypeId :: Maybe Int
$sel:segmentationTypeId:SegmentationDescriptor' :: SegmentationDescriptor -> Maybe Int
segmentationTypeId} -> Maybe Int
segmentationTypeId) (\s :: SegmentationDescriptor
s@SegmentationDescriptor' {} Maybe Int
a -> SegmentationDescriptor
s {$sel:segmentationTypeId:SegmentationDescriptor' :: Maybe Int
segmentationTypeId = Maybe Int
a} :: SegmentationDescriptor)
segmentationDescriptor_segmentationUpid :: Lens.Lens' SegmentationDescriptor (Prelude.Maybe Prelude.Text)
segmentationDescriptor_segmentationUpid :: Lens' SegmentationDescriptor (Maybe Text)
segmentationDescriptor_segmentationUpid = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SegmentationDescriptor' {Maybe Text
segmentationUpid :: Maybe Text
$sel:segmentationUpid:SegmentationDescriptor' :: SegmentationDescriptor -> Maybe Text
segmentationUpid} -> Maybe Text
segmentationUpid) (\s :: SegmentationDescriptor
s@SegmentationDescriptor' {} Maybe Text
a -> SegmentationDescriptor
s {$sel:segmentationUpid:SegmentationDescriptor' :: Maybe Text
segmentationUpid = Maybe Text
a} :: SegmentationDescriptor)
segmentationDescriptor_segmentationUpidType :: Lens.Lens' SegmentationDescriptor (Prelude.Maybe Prelude.Int)
segmentationDescriptor_segmentationUpidType :: Lens' SegmentationDescriptor (Maybe Int)
segmentationDescriptor_segmentationUpidType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SegmentationDescriptor' {Maybe Int
segmentationUpidType :: Maybe Int
$sel:segmentationUpidType:SegmentationDescriptor' :: SegmentationDescriptor -> Maybe Int
segmentationUpidType} -> Maybe Int
segmentationUpidType) (\s :: SegmentationDescriptor
s@SegmentationDescriptor' {} Maybe Int
a -> SegmentationDescriptor
s {$sel:segmentationUpidType:SegmentationDescriptor' :: Maybe Int
segmentationUpidType = Maybe Int
a} :: SegmentationDescriptor)
segmentationDescriptor_segmentsExpected :: Lens.Lens' SegmentationDescriptor (Prelude.Maybe Prelude.Int)
segmentationDescriptor_segmentsExpected :: Lens' SegmentationDescriptor (Maybe Int)
segmentationDescriptor_segmentsExpected = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SegmentationDescriptor' {Maybe Int
segmentsExpected :: Maybe Int
$sel:segmentsExpected:SegmentationDescriptor' :: SegmentationDescriptor -> Maybe Int
segmentsExpected} -> Maybe Int
segmentsExpected) (\s :: SegmentationDescriptor
s@SegmentationDescriptor' {} Maybe Int
a -> SegmentationDescriptor
s {$sel:segmentsExpected:SegmentationDescriptor' :: Maybe Int
segmentsExpected = Maybe Int
a} :: SegmentationDescriptor)
segmentationDescriptor_subSegmentNum :: Lens.Lens' SegmentationDescriptor (Prelude.Maybe Prelude.Int)
segmentationDescriptor_subSegmentNum :: Lens' SegmentationDescriptor (Maybe Int)
segmentationDescriptor_subSegmentNum = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SegmentationDescriptor' {Maybe Int
subSegmentNum :: Maybe Int
$sel:subSegmentNum:SegmentationDescriptor' :: SegmentationDescriptor -> Maybe Int
subSegmentNum} -> Maybe Int
subSegmentNum) (\s :: SegmentationDescriptor
s@SegmentationDescriptor' {} Maybe Int
a -> SegmentationDescriptor
s {$sel:subSegmentNum:SegmentationDescriptor' :: Maybe Int
subSegmentNum = Maybe Int
a} :: SegmentationDescriptor)
segmentationDescriptor_subSegmentsExpected :: Lens.Lens' SegmentationDescriptor (Prelude.Maybe Prelude.Int)
segmentationDescriptor_subSegmentsExpected :: Lens' SegmentationDescriptor (Maybe Int)
segmentationDescriptor_subSegmentsExpected = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SegmentationDescriptor' {Maybe Int
subSegmentsExpected :: Maybe Int
$sel:subSegmentsExpected:SegmentationDescriptor' :: SegmentationDescriptor -> Maybe Int
subSegmentsExpected} -> Maybe Int
subSegmentsExpected) (\s :: SegmentationDescriptor
s@SegmentationDescriptor' {} Maybe Int
a -> SegmentationDescriptor
s {$sel:subSegmentsExpected:SegmentationDescriptor' :: Maybe Int
subSegmentsExpected = Maybe Int
a} :: SegmentationDescriptor)
instance Data.FromJSON SegmentationDescriptor where
parseJSON :: Value -> Parser SegmentationDescriptor
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"SegmentationDescriptor"
( \Object
x ->
Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> SegmentationDescriptor
SegmentationDescriptor'
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
"SegmentNum")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"SegmentationEventId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"SegmentationTypeId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"SegmentationUpid")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"SegmentationUpidType")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"SegmentsExpected")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"SubSegmentNum")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"SubSegmentsExpected")
)
instance Prelude.Hashable SegmentationDescriptor where
hashWithSalt :: Int -> SegmentationDescriptor -> Int
hashWithSalt Int
_salt SegmentationDescriptor' {Maybe Int
Maybe Text
subSegmentsExpected :: Maybe Int
subSegmentNum :: Maybe Int
segmentsExpected :: Maybe Int
segmentationUpidType :: Maybe Int
segmentationUpid :: Maybe Text
segmentationTypeId :: Maybe Int
segmentationEventId :: Maybe Int
segmentNum :: Maybe Int
$sel:subSegmentsExpected:SegmentationDescriptor' :: SegmentationDescriptor -> Maybe Int
$sel:subSegmentNum:SegmentationDescriptor' :: SegmentationDescriptor -> Maybe Int
$sel:segmentsExpected:SegmentationDescriptor' :: SegmentationDescriptor -> Maybe Int
$sel:segmentationUpidType:SegmentationDescriptor' :: SegmentationDescriptor -> Maybe Int
$sel:segmentationUpid:SegmentationDescriptor' :: SegmentationDescriptor -> Maybe Text
$sel:segmentationTypeId:SegmentationDescriptor' :: SegmentationDescriptor -> Maybe Int
$sel:segmentationEventId:SegmentationDescriptor' :: SegmentationDescriptor -> Maybe Int
$sel:segmentNum:SegmentationDescriptor' :: SegmentationDescriptor -> Maybe Int
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
segmentNum
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
segmentationEventId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
segmentationTypeId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
segmentationUpid
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
segmentationUpidType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
segmentsExpected
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
subSegmentNum
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
subSegmentsExpected
instance Prelude.NFData SegmentationDescriptor where
rnf :: SegmentationDescriptor -> ()
rnf SegmentationDescriptor' {Maybe Int
Maybe Text
subSegmentsExpected :: Maybe Int
subSegmentNum :: Maybe Int
segmentsExpected :: Maybe Int
segmentationUpidType :: Maybe Int
segmentationUpid :: Maybe Text
segmentationTypeId :: Maybe Int
segmentationEventId :: Maybe Int
segmentNum :: Maybe Int
$sel:subSegmentsExpected:SegmentationDescriptor' :: SegmentationDescriptor -> Maybe Int
$sel:subSegmentNum:SegmentationDescriptor' :: SegmentationDescriptor -> Maybe Int
$sel:segmentsExpected:SegmentationDescriptor' :: SegmentationDescriptor -> Maybe Int
$sel:segmentationUpidType:SegmentationDescriptor' :: SegmentationDescriptor -> Maybe Int
$sel:segmentationUpid:SegmentationDescriptor' :: SegmentationDescriptor -> Maybe Text
$sel:segmentationTypeId:SegmentationDescriptor' :: SegmentationDescriptor -> Maybe Int
$sel:segmentationEventId:SegmentationDescriptor' :: SegmentationDescriptor -> Maybe Int
$sel:segmentNum:SegmentationDescriptor' :: SegmentationDescriptor -> Maybe Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
segmentNum
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
segmentationEventId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
segmentationTypeId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
segmentationUpid
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
segmentationUpidType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
segmentsExpected
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
subSegmentNum
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
subSegmentsExpected
instance Data.ToJSON SegmentationDescriptor where
toJSON :: SegmentationDescriptor -> Value
toJSON SegmentationDescriptor' {Maybe Int
Maybe Text
subSegmentsExpected :: Maybe Int
subSegmentNum :: Maybe Int
segmentsExpected :: Maybe Int
segmentationUpidType :: Maybe Int
segmentationUpid :: Maybe Text
segmentationTypeId :: Maybe Int
segmentationEventId :: Maybe Int
segmentNum :: Maybe Int
$sel:subSegmentsExpected:SegmentationDescriptor' :: SegmentationDescriptor -> Maybe Int
$sel:subSegmentNum:SegmentationDescriptor' :: SegmentationDescriptor -> Maybe Int
$sel:segmentsExpected:SegmentationDescriptor' :: SegmentationDescriptor -> Maybe Int
$sel:segmentationUpidType:SegmentationDescriptor' :: SegmentationDescriptor -> Maybe Int
$sel:segmentationUpid:SegmentationDescriptor' :: SegmentationDescriptor -> Maybe Text
$sel:segmentationTypeId:SegmentationDescriptor' :: SegmentationDescriptor -> Maybe Int
$sel:segmentationEventId:SegmentationDescriptor' :: SegmentationDescriptor -> Maybe Int
$sel:segmentNum:SegmentationDescriptor' :: SegmentationDescriptor -> Maybe Int
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"SegmentNum" 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 Int
segmentNum,
(Key
"SegmentationEventId" 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 Int
segmentationEventId,
(Key
"SegmentationTypeId" 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 Int
segmentationTypeId,
(Key
"SegmentationUpid" 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 Text
segmentationUpid,
(Key
"SegmentationUpidType" 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 Int
segmentationUpidType,
(Key
"SegmentsExpected" 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 Int
segmentsExpected,
(Key
"SubSegmentNum" 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 Int
subSegmentNum,
(Key
"SubSegmentsExpected" 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 Int
subSegmentsExpected
]
)