{-# 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.MediaPackageVOD.Types.DashPackage where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaPackageVOD.Types.DashEncryption
import Amazonka.MediaPackageVOD.Types.DashManifest
import Amazonka.MediaPackageVOD.Types.PeriodTriggersElement
import Amazonka.MediaPackageVOD.Types.SegmentTemplateFormat
import qualified Amazonka.Prelude as Prelude
data DashPackage = DashPackage'
{
DashPackage -> Maybe Bool
includeEncoderConfigurationInSegments :: Prelude.Maybe Prelude.Bool,
DashPackage -> Maybe SegmentTemplateFormat
segmentTemplateFormat :: Prelude.Maybe SegmentTemplateFormat,
DashPackage -> Maybe Int
segmentDurationSeconds :: Prelude.Maybe Prelude.Int,
DashPackage -> Maybe DashEncryption
encryption :: Prelude.Maybe DashEncryption,
DashPackage -> Maybe [PeriodTriggersElement]
periodTriggers :: Prelude.Maybe [PeriodTriggersElement],
DashPackage -> [DashManifest]
dashManifests :: [DashManifest]
}
deriving (DashPackage -> DashPackage -> Bool
(DashPackage -> DashPackage -> Bool)
-> (DashPackage -> DashPackage -> Bool) -> Eq DashPackage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DashPackage -> DashPackage -> Bool
$c/= :: DashPackage -> DashPackage -> Bool
== :: DashPackage -> DashPackage -> Bool
$c== :: DashPackage -> DashPackage -> Bool
Prelude.Eq, ReadPrec [DashPackage]
ReadPrec DashPackage
Int -> ReadS DashPackage
ReadS [DashPackage]
(Int -> ReadS DashPackage)
-> ReadS [DashPackage]
-> ReadPrec DashPackage
-> ReadPrec [DashPackage]
-> Read DashPackage
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DashPackage]
$creadListPrec :: ReadPrec [DashPackage]
readPrec :: ReadPrec DashPackage
$creadPrec :: ReadPrec DashPackage
readList :: ReadS [DashPackage]
$creadList :: ReadS [DashPackage]
readsPrec :: Int -> ReadS DashPackage
$creadsPrec :: Int -> ReadS DashPackage
Prelude.Read, Int -> DashPackage -> ShowS
[DashPackage] -> ShowS
DashPackage -> String
(Int -> DashPackage -> ShowS)
-> (DashPackage -> String)
-> ([DashPackage] -> ShowS)
-> Show DashPackage
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DashPackage] -> ShowS
$cshowList :: [DashPackage] -> ShowS
show :: DashPackage -> String
$cshow :: DashPackage -> String
showsPrec :: Int -> DashPackage -> ShowS
$cshowsPrec :: Int -> DashPackage -> ShowS
Prelude.Show, (forall x. DashPackage -> Rep DashPackage x)
-> (forall x. Rep DashPackage x -> DashPackage)
-> Generic DashPackage
forall x. Rep DashPackage x -> DashPackage
forall x. DashPackage -> Rep DashPackage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DashPackage x -> DashPackage
$cfrom :: forall x. DashPackage -> Rep DashPackage x
Prelude.Generic)
newDashPackage ::
DashPackage
newDashPackage :: DashPackage
newDashPackage =
DashPackage' :: Maybe Bool
-> Maybe SegmentTemplateFormat
-> Maybe Int
-> Maybe DashEncryption
-> Maybe [PeriodTriggersElement]
-> [DashManifest]
-> DashPackage
DashPackage'
{ $sel:includeEncoderConfigurationInSegments:DashPackage' :: Maybe Bool
includeEncoderConfigurationInSegments =
Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:segmentTemplateFormat:DashPackage' :: Maybe SegmentTemplateFormat
segmentTemplateFormat = Maybe SegmentTemplateFormat
forall a. Maybe a
Prelude.Nothing,
$sel:segmentDurationSeconds:DashPackage' :: Maybe Int
segmentDurationSeconds = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:encryption:DashPackage' :: Maybe DashEncryption
encryption = Maybe DashEncryption
forall a. Maybe a
Prelude.Nothing,
$sel:periodTriggers:DashPackage' :: Maybe [PeriodTriggersElement]
periodTriggers = Maybe [PeriodTriggersElement]
forall a. Maybe a
Prelude.Nothing,
$sel:dashManifests:DashPackage' :: [DashManifest]
dashManifests = [DashManifest]
forall a. Monoid a => a
Prelude.mempty
}
dashPackage_includeEncoderConfigurationInSegments :: Lens.Lens' DashPackage (Prelude.Maybe Prelude.Bool)
dashPackage_includeEncoderConfigurationInSegments :: (Maybe Bool -> f (Maybe Bool)) -> DashPackage -> f DashPackage
dashPackage_includeEncoderConfigurationInSegments = (DashPackage -> Maybe Bool)
-> (DashPackage -> Maybe Bool -> DashPackage)
-> Lens DashPackage DashPackage (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DashPackage' {Maybe Bool
includeEncoderConfigurationInSegments :: Maybe Bool
$sel:includeEncoderConfigurationInSegments:DashPackage' :: DashPackage -> Maybe Bool
includeEncoderConfigurationInSegments} -> Maybe Bool
includeEncoderConfigurationInSegments) (\s :: DashPackage
s@DashPackage' {} Maybe Bool
a -> DashPackage
s {$sel:includeEncoderConfigurationInSegments:DashPackage' :: Maybe Bool
includeEncoderConfigurationInSegments = Maybe Bool
a} :: DashPackage)
dashPackage_segmentTemplateFormat :: Lens.Lens' DashPackage (Prelude.Maybe SegmentTemplateFormat)
dashPackage_segmentTemplateFormat :: (Maybe SegmentTemplateFormat -> f (Maybe SegmentTemplateFormat))
-> DashPackage -> f DashPackage
dashPackage_segmentTemplateFormat = (DashPackage -> Maybe SegmentTemplateFormat)
-> (DashPackage -> Maybe SegmentTemplateFormat -> DashPackage)
-> Lens
DashPackage
DashPackage
(Maybe SegmentTemplateFormat)
(Maybe SegmentTemplateFormat)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DashPackage' {Maybe SegmentTemplateFormat
segmentTemplateFormat :: Maybe SegmentTemplateFormat
$sel:segmentTemplateFormat:DashPackage' :: DashPackage -> Maybe SegmentTemplateFormat
segmentTemplateFormat} -> Maybe SegmentTemplateFormat
segmentTemplateFormat) (\s :: DashPackage
s@DashPackage' {} Maybe SegmentTemplateFormat
a -> DashPackage
s {$sel:segmentTemplateFormat:DashPackage' :: Maybe SegmentTemplateFormat
segmentTemplateFormat = Maybe SegmentTemplateFormat
a} :: DashPackage)
dashPackage_segmentDurationSeconds :: Lens.Lens' DashPackage (Prelude.Maybe Prelude.Int)
dashPackage_segmentDurationSeconds :: (Maybe Int -> f (Maybe Int)) -> DashPackage -> f DashPackage
dashPackage_segmentDurationSeconds = (DashPackage -> Maybe Int)
-> (DashPackage -> Maybe Int -> DashPackage)
-> Lens DashPackage DashPackage (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DashPackage' {Maybe Int
segmentDurationSeconds :: Maybe Int
$sel:segmentDurationSeconds:DashPackage' :: DashPackage -> Maybe Int
segmentDurationSeconds} -> Maybe Int
segmentDurationSeconds) (\s :: DashPackage
s@DashPackage' {} Maybe Int
a -> DashPackage
s {$sel:segmentDurationSeconds:DashPackage' :: Maybe Int
segmentDurationSeconds = Maybe Int
a} :: DashPackage)
dashPackage_encryption :: Lens.Lens' DashPackage (Prelude.Maybe DashEncryption)
dashPackage_encryption :: (Maybe DashEncryption -> f (Maybe DashEncryption))
-> DashPackage -> f DashPackage
dashPackage_encryption = (DashPackage -> Maybe DashEncryption)
-> (DashPackage -> Maybe DashEncryption -> DashPackage)
-> Lens
DashPackage
DashPackage
(Maybe DashEncryption)
(Maybe DashEncryption)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DashPackage' {Maybe DashEncryption
encryption :: Maybe DashEncryption
$sel:encryption:DashPackage' :: DashPackage -> Maybe DashEncryption
encryption} -> Maybe DashEncryption
encryption) (\s :: DashPackage
s@DashPackage' {} Maybe DashEncryption
a -> DashPackage
s {$sel:encryption:DashPackage' :: Maybe DashEncryption
encryption = Maybe DashEncryption
a} :: DashPackage)
dashPackage_periodTriggers :: Lens.Lens' DashPackage (Prelude.Maybe [PeriodTriggersElement])
dashPackage_periodTriggers :: (Maybe [PeriodTriggersElement]
-> f (Maybe [PeriodTriggersElement]))
-> DashPackage -> f DashPackage
dashPackage_periodTriggers = (DashPackage -> Maybe [PeriodTriggersElement])
-> (DashPackage -> Maybe [PeriodTriggersElement] -> DashPackage)
-> Lens
DashPackage
DashPackage
(Maybe [PeriodTriggersElement])
(Maybe [PeriodTriggersElement])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DashPackage' {Maybe [PeriodTriggersElement]
periodTriggers :: Maybe [PeriodTriggersElement]
$sel:periodTriggers:DashPackage' :: DashPackage -> Maybe [PeriodTriggersElement]
periodTriggers} -> Maybe [PeriodTriggersElement]
periodTriggers) (\s :: DashPackage
s@DashPackage' {} Maybe [PeriodTriggersElement]
a -> DashPackage
s {$sel:periodTriggers:DashPackage' :: Maybe [PeriodTriggersElement]
periodTriggers = Maybe [PeriodTriggersElement]
a} :: DashPackage) ((Maybe [PeriodTriggersElement]
-> f (Maybe [PeriodTriggersElement]))
-> DashPackage -> f DashPackage)
-> ((Maybe [PeriodTriggersElement]
-> f (Maybe [PeriodTriggersElement]))
-> Maybe [PeriodTriggersElement]
-> f (Maybe [PeriodTriggersElement]))
-> (Maybe [PeriodTriggersElement]
-> f (Maybe [PeriodTriggersElement]))
-> DashPackage
-> f DashPackage
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[PeriodTriggersElement]
[PeriodTriggersElement]
[PeriodTriggersElement]
[PeriodTriggersElement]
-> Iso
(Maybe [PeriodTriggersElement])
(Maybe [PeriodTriggersElement])
(Maybe [PeriodTriggersElement])
(Maybe [PeriodTriggersElement])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
[PeriodTriggersElement]
[PeriodTriggersElement]
[PeriodTriggersElement]
[PeriodTriggersElement]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
dashPackage_dashManifests :: Lens.Lens' DashPackage [DashManifest]
dashPackage_dashManifests :: ([DashManifest] -> f [DashManifest])
-> DashPackage -> f DashPackage
dashPackage_dashManifests = (DashPackage -> [DashManifest])
-> (DashPackage -> [DashManifest] -> DashPackage)
-> Lens DashPackage DashPackage [DashManifest] [DashManifest]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DashPackage' {[DashManifest]
dashManifests :: [DashManifest]
$sel:dashManifests:DashPackage' :: DashPackage -> [DashManifest]
dashManifests} -> [DashManifest]
dashManifests) (\s :: DashPackage
s@DashPackage' {} [DashManifest]
a -> DashPackage
s {$sel:dashManifests:DashPackage' :: [DashManifest]
dashManifests = [DashManifest]
a} :: DashPackage) (([DashManifest] -> f [DashManifest])
-> DashPackage -> f DashPackage)
-> (([DashManifest] -> f [DashManifest])
-> [DashManifest] -> f [DashManifest])
-> ([DashManifest] -> f [DashManifest])
-> DashPackage
-> f DashPackage
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([DashManifest] -> f [DashManifest])
-> [DashManifest] -> f [DashManifest]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON DashPackage where
parseJSON :: Value -> Parser DashPackage
parseJSON =
String
-> (Object -> Parser DashPackage) -> Value -> Parser DashPackage
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"DashPackage"
( \Object
x ->
Maybe Bool
-> Maybe SegmentTemplateFormat
-> Maybe Int
-> Maybe DashEncryption
-> Maybe [PeriodTriggersElement]
-> [DashManifest]
-> DashPackage
DashPackage'
(Maybe Bool
-> Maybe SegmentTemplateFormat
-> Maybe Int
-> Maybe DashEncryption
-> Maybe [PeriodTriggersElement]
-> [DashManifest]
-> DashPackage)
-> Parser (Maybe Bool)
-> Parser
(Maybe SegmentTemplateFormat
-> Maybe Int
-> Maybe DashEncryption
-> Maybe [PeriodTriggersElement]
-> [DashManifest]
-> DashPackage)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"includeEncoderConfigurationInSegments")
Parser
(Maybe SegmentTemplateFormat
-> Maybe Int
-> Maybe DashEncryption
-> Maybe [PeriodTriggersElement]
-> [DashManifest]
-> DashPackage)
-> Parser (Maybe SegmentTemplateFormat)
-> Parser
(Maybe Int
-> Maybe DashEncryption
-> Maybe [PeriodTriggersElement]
-> [DashManifest]
-> DashPackage)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe SegmentTemplateFormat)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"segmentTemplateFormat")
Parser
(Maybe Int
-> Maybe DashEncryption
-> Maybe [PeriodTriggersElement]
-> [DashManifest]
-> DashPackage)
-> Parser (Maybe Int)
-> Parser
(Maybe DashEncryption
-> Maybe [PeriodTriggersElement] -> [DashManifest] -> DashPackage)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"segmentDurationSeconds")
Parser
(Maybe DashEncryption
-> Maybe [PeriodTriggersElement] -> [DashManifest] -> DashPackage)
-> Parser (Maybe DashEncryption)
-> Parser
(Maybe [PeriodTriggersElement] -> [DashManifest] -> DashPackage)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe DashEncryption)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"encryption")
Parser
(Maybe [PeriodTriggersElement] -> [DashManifest] -> DashPackage)
-> Parser (Maybe [PeriodTriggersElement])
-> Parser ([DashManifest] -> DashPackage)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [PeriodTriggersElement]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"periodTriggers" Parser (Maybe (Maybe [PeriodTriggersElement]))
-> Maybe [PeriodTriggersElement]
-> Parser (Maybe [PeriodTriggersElement])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [PeriodTriggersElement]
forall a. Monoid a => a
Prelude.mempty)
Parser ([DashManifest] -> DashPackage)
-> Parser [DashManifest] -> Parser DashPackage
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe [DashManifest])
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"dashManifests" Parser (Maybe [DashManifest])
-> [DashManifest] -> Parser [DashManifest]
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= [DashManifest]
forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable DashPackage
instance Prelude.NFData DashPackage
instance Core.ToJSON DashPackage where
toJSON :: DashPackage -> Value
toJSON DashPackage' {[DashManifest]
Maybe Bool
Maybe Int
Maybe [PeriodTriggersElement]
Maybe SegmentTemplateFormat
Maybe DashEncryption
dashManifests :: [DashManifest]
periodTriggers :: Maybe [PeriodTriggersElement]
encryption :: Maybe DashEncryption
segmentDurationSeconds :: Maybe Int
segmentTemplateFormat :: Maybe SegmentTemplateFormat
includeEncoderConfigurationInSegments :: Maybe Bool
$sel:dashManifests:DashPackage' :: DashPackage -> [DashManifest]
$sel:periodTriggers:DashPackage' :: DashPackage -> Maybe [PeriodTriggersElement]
$sel:encryption:DashPackage' :: DashPackage -> Maybe DashEncryption
$sel:segmentDurationSeconds:DashPackage' :: DashPackage -> Maybe Int
$sel:segmentTemplateFormat:DashPackage' :: DashPackage -> Maybe SegmentTemplateFormat
$sel:includeEncoderConfigurationInSegments:DashPackage' :: DashPackage -> Maybe Bool
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"includeEncoderConfigurationInSegments" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
includeEncoderConfigurationInSegments,
(Text
"segmentTemplateFormat" Text -> SegmentTemplateFormat -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(SegmentTemplateFormat -> Pair)
-> Maybe SegmentTemplateFormat -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SegmentTemplateFormat
segmentTemplateFormat,
(Text
"segmentDurationSeconds" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
segmentDurationSeconds,
(Text
"encryption" Text -> DashEncryption -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (DashEncryption -> Pair) -> Maybe DashEncryption -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DashEncryption
encryption,
(Text
"periodTriggers" Text -> [PeriodTriggersElement] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
([PeriodTriggersElement] -> Pair)
-> Maybe [PeriodTriggersElement] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [PeriodTriggersElement]
periodTriggers,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"dashManifests" Text -> [DashManifest] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [DashManifest]
dashManifests)
]
)