{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.MediaPackageVOD.Types.DashPackage
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
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

-- | A Dynamic Adaptive Streaming over HTTP (DASH) packaging configuration.
--
-- /See:/ 'newDashPackage' smart constructor.
data DashPackage = DashPackage'
  { -- | When includeEncoderConfigurationInSegments is set to true, MediaPackage
    -- places your encoder\'s Sequence Parameter Set (SPS), Picture Parameter
    -- Set (PPS), and Video Parameter Set (VPS) metadata in every video segment
    -- instead of in the init fragment. This lets you use different
    -- SPS\/PPS\/VPS settings for your assets during content playback.
    DashPackage -> Maybe Bool
includeEncoderConfigurationInSegments :: Prelude.Maybe Prelude.Bool,
    -- | Determines the type of SegmentTemplate included in the Media
    -- Presentation Description (MPD). When set to NUMBER_WITH_TIMELINE, a full
    -- timeline is presented in each SegmentTemplate, with $Number$ media URLs.
    -- When set to TIME_WITH_TIMELINE, a full timeline is presented in each
    -- SegmentTemplate, with $Time$ media URLs. When set to
    -- NUMBER_WITH_DURATION, only a duration is included in each
    -- SegmentTemplate, with $Number$ media URLs.
    DashPackage -> Maybe SegmentTemplateFormat
segmentTemplateFormat :: Prelude.Maybe SegmentTemplateFormat,
    -- | Duration (in seconds) of each segment. Actual segments will be rounded
    -- to the nearest multiple of the source segment duration.
    DashPackage -> Maybe Int
segmentDurationSeconds :: Prelude.Maybe Prelude.Int,
    DashPackage -> Maybe DashEncryption
encryption :: Prelude.Maybe DashEncryption,
    -- | A list of triggers that controls when the outgoing Dynamic Adaptive
    -- Streaming over HTTP (DASH) Media Presentation Description (MPD) will be
    -- partitioned into multiple periods. If empty, the content will not be
    -- partitioned into more than one period. If the list contains \"ADS\", new
    -- periods will be created where the Asset contains SCTE-35 ad markers.
    DashPackage -> Maybe [PeriodTriggersElement]
periodTriggers :: Prelude.Maybe [PeriodTriggersElement],
    -- | A list of DASH manifest configurations.
    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)

-- |
-- Create a value of 'DashPackage' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'includeEncoderConfigurationInSegments', 'dashPackage_includeEncoderConfigurationInSegments' - When includeEncoderConfigurationInSegments is set to true, MediaPackage
-- places your encoder\'s Sequence Parameter Set (SPS), Picture Parameter
-- Set (PPS), and Video Parameter Set (VPS) metadata in every video segment
-- instead of in the init fragment. This lets you use different
-- SPS\/PPS\/VPS settings for your assets during content playback.
--
-- 'segmentTemplateFormat', 'dashPackage_segmentTemplateFormat' - Determines the type of SegmentTemplate included in the Media
-- Presentation Description (MPD). When set to NUMBER_WITH_TIMELINE, a full
-- timeline is presented in each SegmentTemplate, with $Number$ media URLs.
-- When set to TIME_WITH_TIMELINE, a full timeline is presented in each
-- SegmentTemplate, with $Time$ media URLs. When set to
-- NUMBER_WITH_DURATION, only a duration is included in each
-- SegmentTemplate, with $Number$ media URLs.
--
-- 'segmentDurationSeconds', 'dashPackage_segmentDurationSeconds' - Duration (in seconds) of each segment. Actual segments will be rounded
-- to the nearest multiple of the source segment duration.
--
-- 'encryption', 'dashPackage_encryption' - Undocumented member.
--
-- 'periodTriggers', 'dashPackage_periodTriggers' - A list of triggers that controls when the outgoing Dynamic Adaptive
-- Streaming over HTTP (DASH) Media Presentation Description (MPD) will be
-- partitioned into multiple periods. If empty, the content will not be
-- partitioned into more than one period. If the list contains \"ADS\", new
-- periods will be created where the Asset contains SCTE-35 ad markers.
--
-- 'dashManifests', 'dashPackage_dashManifests' - A list of DASH manifest configurations.
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
    }

-- | When includeEncoderConfigurationInSegments is set to true, MediaPackage
-- places your encoder\'s Sequence Parameter Set (SPS), Picture Parameter
-- Set (PPS), and Video Parameter Set (VPS) metadata in every video segment
-- instead of in the init fragment. This lets you use different
-- SPS\/PPS\/VPS settings for your assets during content playback.
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)

-- | Determines the type of SegmentTemplate included in the Media
-- Presentation Description (MPD). When set to NUMBER_WITH_TIMELINE, a full
-- timeline is presented in each SegmentTemplate, with $Number$ media URLs.
-- When set to TIME_WITH_TIMELINE, a full timeline is presented in each
-- SegmentTemplate, with $Time$ media URLs. When set to
-- NUMBER_WITH_DURATION, only a duration is included in each
-- SegmentTemplate, with $Number$ media URLs.
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)

-- | Duration (in seconds) of each segment. Actual segments will be rounded
-- to the nearest multiple of the source segment duration.
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)

-- | Undocumented member.
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)

-- | A list of triggers that controls when the outgoing Dynamic Adaptive
-- Streaming over HTTP (DASH) Media Presentation Description (MPD) will be
-- partitioned into multiple periods. If empty, the content will not be
-- partitioned into more than one period. If the list contains \"ADS\", new
-- periods will be created where the Asset contains SCTE-35 ad markers.
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

-- | A list of DASH manifest configurations.
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)
          ]
      )