{-# 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.MediaLive.Types.Scte35SegmentationDescriptor
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.MediaLive.Types.Scte35SegmentationDescriptor where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MediaLive.Types.Scte35DeliveryRestrictions
import Amazonka.MediaLive.Types.Scte35SegmentationCancelIndicator
import qualified Amazonka.Prelude as Prelude

-- | Corresponds to SCTE-35 segmentation_descriptor.
--
-- /See:/ 'newScte35SegmentationDescriptor' smart constructor.
data Scte35SegmentationDescriptor = Scte35SegmentationDescriptor'
  { -- | Holds the four SCTE-35 delivery restriction parameters.
    Scte35SegmentationDescriptor -> Maybe Scte35DeliveryRestrictions
deliveryRestrictions :: Prelude.Maybe Scte35DeliveryRestrictions,
    -- | Corresponds to SCTE-35 segment_num. A value that is valid for the
    -- specified segmentation_type_id.
    Scte35SegmentationDescriptor -> Maybe Natural
segmentNum :: Prelude.Maybe Prelude.Natural,
    -- | Corresponds to SCTE-35 segmentation_duration. Optional. The duration for
    -- the time_signal, in 90 KHz ticks. To convert seconds to ticks, multiple
    -- the seconds by 90,000. Enter time in 90 KHz clock ticks. If you do not
    -- enter a duration, the time_signal will continue until you insert a
    -- cancellation message.
    Scte35SegmentationDescriptor -> Maybe Natural
segmentationDuration :: Prelude.Maybe Prelude.Natural,
    -- | Corresponds to SCTE-35 segmentation_type_id. One of the
    -- segmentation_type_id values listed in the SCTE-35 specification. On the
    -- console, enter the ID in decimal (for example, \"52\"). In the CLI, API,
    -- or an SDK, enter the ID in hex (for example, \"0x34\") or decimal (for
    -- example, \"52\").
    Scte35SegmentationDescriptor -> Maybe Natural
segmentationTypeId :: Prelude.Maybe Prelude.Natural,
    -- | Corresponds to SCTE-35 segmentation_upid. Enter a string containing the
    -- hexadecimal representation of the characters that make up the SCTE-35
    -- segmentation_upid value. Must contain an even number of hex characters.
    -- Do not include spaces between each hex pair. For example, the ASCII
    -- \"ADS Information\" becomes hex \"41445320496e666f726d6174696f6e.
    Scte35SegmentationDescriptor -> Maybe Text
segmentationUpid :: Prelude.Maybe Prelude.Text,
    -- | Corresponds to SCTE-35 segmentation_upid_type. On the console, enter one
    -- of the types listed in the SCTE-35 specification, converted to a
    -- decimal. For example, \"0x0C\" hex from the specification is \"12\" in
    -- decimal. In the CLI, API, or an SDK, enter one of the types listed in
    -- the SCTE-35 specification, in either hex (for example, \"0x0C\" ) or in
    -- decimal (for example, \"12\").
    Scte35SegmentationDescriptor -> Maybe Natural
segmentationUpidType :: Prelude.Maybe Prelude.Natural,
    -- | Corresponds to SCTE-35 segments_expected. A value that is valid for the
    -- specified segmentation_type_id.
    Scte35SegmentationDescriptor -> Maybe Natural
segmentsExpected :: Prelude.Maybe Prelude.Natural,
    -- | Corresponds to SCTE-35 sub_segment_num. A value that is valid for the
    -- specified segmentation_type_id.
    Scte35SegmentationDescriptor -> Maybe Natural
subSegmentNum :: Prelude.Maybe Prelude.Natural,
    -- | Corresponds to SCTE-35 sub_segments_expected. A value that is valid for
    -- the specified segmentation_type_id.
    Scte35SegmentationDescriptor -> Maybe Natural
subSegmentsExpected :: Prelude.Maybe Prelude.Natural,
    -- | Corresponds to SCTE-35 segmentation_event_id.
    Scte35SegmentationDescriptor -> Natural
segmentationEventId :: Prelude.Natural,
    -- | Corresponds to SCTE-35 segmentation_event_cancel_indicator.
    Scte35SegmentationDescriptor -> Scte35SegmentationCancelIndicator
segmentationCancelIndicator :: Scte35SegmentationCancelIndicator
  }
  deriving (Scte35SegmentationDescriptor
-> Scte35SegmentationDescriptor -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Scte35SegmentationDescriptor
-> Scte35SegmentationDescriptor -> Bool
$c/= :: Scte35SegmentationDescriptor
-> Scte35SegmentationDescriptor -> Bool
== :: Scte35SegmentationDescriptor
-> Scte35SegmentationDescriptor -> Bool
$c== :: Scte35SegmentationDescriptor
-> Scte35SegmentationDescriptor -> Bool
Prelude.Eq, ReadPrec [Scte35SegmentationDescriptor]
ReadPrec Scte35SegmentationDescriptor
Int -> ReadS Scte35SegmentationDescriptor
ReadS [Scte35SegmentationDescriptor]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Scte35SegmentationDescriptor]
$creadListPrec :: ReadPrec [Scte35SegmentationDescriptor]
readPrec :: ReadPrec Scte35SegmentationDescriptor
$creadPrec :: ReadPrec Scte35SegmentationDescriptor
readList :: ReadS [Scte35SegmentationDescriptor]
$creadList :: ReadS [Scte35SegmentationDescriptor]
readsPrec :: Int -> ReadS Scte35SegmentationDescriptor
$creadsPrec :: Int -> ReadS Scte35SegmentationDescriptor
Prelude.Read, Int -> Scte35SegmentationDescriptor -> ShowS
[Scte35SegmentationDescriptor] -> ShowS
Scte35SegmentationDescriptor -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Scte35SegmentationDescriptor] -> ShowS
$cshowList :: [Scte35SegmentationDescriptor] -> ShowS
show :: Scte35SegmentationDescriptor -> String
$cshow :: Scte35SegmentationDescriptor -> String
showsPrec :: Int -> Scte35SegmentationDescriptor -> ShowS
$cshowsPrec :: Int -> Scte35SegmentationDescriptor -> ShowS
Prelude.Show, forall x.
Rep Scte35SegmentationDescriptor x -> Scte35SegmentationDescriptor
forall x.
Scte35SegmentationDescriptor -> Rep Scte35SegmentationDescriptor x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep Scte35SegmentationDescriptor x -> Scte35SegmentationDescriptor
$cfrom :: forall x.
Scte35SegmentationDescriptor -> Rep Scte35SegmentationDescriptor x
Prelude.Generic)

-- |
-- Create a value of 'Scte35SegmentationDescriptor' 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:
--
-- 'deliveryRestrictions', 'scte35SegmentationDescriptor_deliveryRestrictions' - Holds the four SCTE-35 delivery restriction parameters.
--
-- 'segmentNum', 'scte35SegmentationDescriptor_segmentNum' - Corresponds to SCTE-35 segment_num. A value that is valid for the
-- specified segmentation_type_id.
--
-- 'segmentationDuration', 'scte35SegmentationDescriptor_segmentationDuration' - Corresponds to SCTE-35 segmentation_duration. Optional. The duration for
-- the time_signal, in 90 KHz ticks. To convert seconds to ticks, multiple
-- the seconds by 90,000. Enter time in 90 KHz clock ticks. If you do not
-- enter a duration, the time_signal will continue until you insert a
-- cancellation message.
--
-- 'segmentationTypeId', 'scte35SegmentationDescriptor_segmentationTypeId' - Corresponds to SCTE-35 segmentation_type_id. One of the
-- segmentation_type_id values listed in the SCTE-35 specification. On the
-- console, enter the ID in decimal (for example, \"52\"). In the CLI, API,
-- or an SDK, enter the ID in hex (for example, \"0x34\") or decimal (for
-- example, \"52\").
--
-- 'segmentationUpid', 'scte35SegmentationDescriptor_segmentationUpid' - Corresponds to SCTE-35 segmentation_upid. Enter a string containing the
-- hexadecimal representation of the characters that make up the SCTE-35
-- segmentation_upid value. Must contain an even number of hex characters.
-- Do not include spaces between each hex pair. For example, the ASCII
-- \"ADS Information\" becomes hex \"41445320496e666f726d6174696f6e.
--
-- 'segmentationUpidType', 'scte35SegmentationDescriptor_segmentationUpidType' - Corresponds to SCTE-35 segmentation_upid_type. On the console, enter one
-- of the types listed in the SCTE-35 specification, converted to a
-- decimal. For example, \"0x0C\" hex from the specification is \"12\" in
-- decimal. In the CLI, API, or an SDK, enter one of the types listed in
-- the SCTE-35 specification, in either hex (for example, \"0x0C\" ) or in
-- decimal (for example, \"12\").
--
-- 'segmentsExpected', 'scte35SegmentationDescriptor_segmentsExpected' - Corresponds to SCTE-35 segments_expected. A value that is valid for the
-- specified segmentation_type_id.
--
-- 'subSegmentNum', 'scte35SegmentationDescriptor_subSegmentNum' - Corresponds to SCTE-35 sub_segment_num. A value that is valid for the
-- specified segmentation_type_id.
--
-- 'subSegmentsExpected', 'scte35SegmentationDescriptor_subSegmentsExpected' - Corresponds to SCTE-35 sub_segments_expected. A value that is valid for
-- the specified segmentation_type_id.
--
-- 'segmentationEventId', 'scte35SegmentationDescriptor_segmentationEventId' - Corresponds to SCTE-35 segmentation_event_id.
--
-- 'segmentationCancelIndicator', 'scte35SegmentationDescriptor_segmentationCancelIndicator' - Corresponds to SCTE-35 segmentation_event_cancel_indicator.
newScte35SegmentationDescriptor ::
  -- | 'segmentationEventId'
  Prelude.Natural ->
  -- | 'segmentationCancelIndicator'
  Scte35SegmentationCancelIndicator ->
  Scte35SegmentationDescriptor
newScte35SegmentationDescriptor :: Natural
-> Scte35SegmentationCancelIndicator
-> Scte35SegmentationDescriptor
newScte35SegmentationDescriptor
  Natural
pSegmentationEventId_
  Scte35SegmentationCancelIndicator
pSegmentationCancelIndicator_ =
    Scte35SegmentationDescriptor'
      { $sel:deliveryRestrictions:Scte35SegmentationDescriptor' :: Maybe Scte35DeliveryRestrictions
deliveryRestrictions =
          forall a. Maybe a
Prelude.Nothing,
        $sel:segmentNum:Scte35SegmentationDescriptor' :: Maybe Natural
segmentNum = forall a. Maybe a
Prelude.Nothing,
        $sel:segmentationDuration:Scte35SegmentationDescriptor' :: Maybe Natural
segmentationDuration = forall a. Maybe a
Prelude.Nothing,
        $sel:segmentationTypeId:Scte35SegmentationDescriptor' :: Maybe Natural
segmentationTypeId = forall a. Maybe a
Prelude.Nothing,
        $sel:segmentationUpid:Scte35SegmentationDescriptor' :: Maybe Text
segmentationUpid = forall a. Maybe a
Prelude.Nothing,
        $sel:segmentationUpidType:Scte35SegmentationDescriptor' :: Maybe Natural
segmentationUpidType = forall a. Maybe a
Prelude.Nothing,
        $sel:segmentsExpected:Scte35SegmentationDescriptor' :: Maybe Natural
segmentsExpected = forall a. Maybe a
Prelude.Nothing,
        $sel:subSegmentNum:Scte35SegmentationDescriptor' :: Maybe Natural
subSegmentNum = forall a. Maybe a
Prelude.Nothing,
        $sel:subSegmentsExpected:Scte35SegmentationDescriptor' :: Maybe Natural
subSegmentsExpected = forall a. Maybe a
Prelude.Nothing,
        $sel:segmentationEventId:Scte35SegmentationDescriptor' :: Natural
segmentationEventId = Natural
pSegmentationEventId_,
        $sel:segmentationCancelIndicator:Scte35SegmentationDescriptor' :: Scte35SegmentationCancelIndicator
segmentationCancelIndicator =
          Scte35SegmentationCancelIndicator
pSegmentationCancelIndicator_
      }

-- | Holds the four SCTE-35 delivery restriction parameters.
scte35SegmentationDescriptor_deliveryRestrictions :: Lens.Lens' Scte35SegmentationDescriptor (Prelude.Maybe Scte35DeliveryRestrictions)
scte35SegmentationDescriptor_deliveryRestrictions :: Lens'
  Scte35SegmentationDescriptor (Maybe Scte35DeliveryRestrictions)
scte35SegmentationDescriptor_deliveryRestrictions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Scte35SegmentationDescriptor' {Maybe Scte35DeliveryRestrictions
deliveryRestrictions :: Maybe Scte35DeliveryRestrictions
$sel:deliveryRestrictions:Scte35SegmentationDescriptor' :: Scte35SegmentationDescriptor -> Maybe Scte35DeliveryRestrictions
deliveryRestrictions} -> Maybe Scte35DeliveryRestrictions
deliveryRestrictions) (\s :: Scte35SegmentationDescriptor
s@Scte35SegmentationDescriptor' {} Maybe Scte35DeliveryRestrictions
a -> Scte35SegmentationDescriptor
s {$sel:deliveryRestrictions:Scte35SegmentationDescriptor' :: Maybe Scte35DeliveryRestrictions
deliveryRestrictions = Maybe Scte35DeliveryRestrictions
a} :: Scte35SegmentationDescriptor)

-- | Corresponds to SCTE-35 segment_num. A value that is valid for the
-- specified segmentation_type_id.
scte35SegmentationDescriptor_segmentNum :: Lens.Lens' Scte35SegmentationDescriptor (Prelude.Maybe Prelude.Natural)
scte35SegmentationDescriptor_segmentNum :: Lens' Scte35SegmentationDescriptor (Maybe Natural)
scte35SegmentationDescriptor_segmentNum = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Scte35SegmentationDescriptor' {Maybe Natural
segmentNum :: Maybe Natural
$sel:segmentNum:Scte35SegmentationDescriptor' :: Scte35SegmentationDescriptor -> Maybe Natural
segmentNum} -> Maybe Natural
segmentNum) (\s :: Scte35SegmentationDescriptor
s@Scte35SegmentationDescriptor' {} Maybe Natural
a -> Scte35SegmentationDescriptor
s {$sel:segmentNum:Scte35SegmentationDescriptor' :: Maybe Natural
segmentNum = Maybe Natural
a} :: Scte35SegmentationDescriptor)

-- | Corresponds to SCTE-35 segmentation_duration. Optional. The duration for
-- the time_signal, in 90 KHz ticks. To convert seconds to ticks, multiple
-- the seconds by 90,000. Enter time in 90 KHz clock ticks. If you do not
-- enter a duration, the time_signal will continue until you insert a
-- cancellation message.
scte35SegmentationDescriptor_segmentationDuration :: Lens.Lens' Scte35SegmentationDescriptor (Prelude.Maybe Prelude.Natural)
scte35SegmentationDescriptor_segmentationDuration :: Lens' Scte35SegmentationDescriptor (Maybe Natural)
scte35SegmentationDescriptor_segmentationDuration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Scte35SegmentationDescriptor' {Maybe Natural
segmentationDuration :: Maybe Natural
$sel:segmentationDuration:Scte35SegmentationDescriptor' :: Scte35SegmentationDescriptor -> Maybe Natural
segmentationDuration} -> Maybe Natural
segmentationDuration) (\s :: Scte35SegmentationDescriptor
s@Scte35SegmentationDescriptor' {} Maybe Natural
a -> Scte35SegmentationDescriptor
s {$sel:segmentationDuration:Scte35SegmentationDescriptor' :: Maybe Natural
segmentationDuration = Maybe Natural
a} :: Scte35SegmentationDescriptor)

-- | Corresponds to SCTE-35 segmentation_type_id. One of the
-- segmentation_type_id values listed in the SCTE-35 specification. On the
-- console, enter the ID in decimal (for example, \"52\"). In the CLI, API,
-- or an SDK, enter the ID in hex (for example, \"0x34\") or decimal (for
-- example, \"52\").
scte35SegmentationDescriptor_segmentationTypeId :: Lens.Lens' Scte35SegmentationDescriptor (Prelude.Maybe Prelude.Natural)
scte35SegmentationDescriptor_segmentationTypeId :: Lens' Scte35SegmentationDescriptor (Maybe Natural)
scte35SegmentationDescriptor_segmentationTypeId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Scte35SegmentationDescriptor' {Maybe Natural
segmentationTypeId :: Maybe Natural
$sel:segmentationTypeId:Scte35SegmentationDescriptor' :: Scte35SegmentationDescriptor -> Maybe Natural
segmentationTypeId} -> Maybe Natural
segmentationTypeId) (\s :: Scte35SegmentationDescriptor
s@Scte35SegmentationDescriptor' {} Maybe Natural
a -> Scte35SegmentationDescriptor
s {$sel:segmentationTypeId:Scte35SegmentationDescriptor' :: Maybe Natural
segmentationTypeId = Maybe Natural
a} :: Scte35SegmentationDescriptor)

-- | Corresponds to SCTE-35 segmentation_upid. Enter a string containing the
-- hexadecimal representation of the characters that make up the SCTE-35
-- segmentation_upid value. Must contain an even number of hex characters.
-- Do not include spaces between each hex pair. For example, the ASCII
-- \"ADS Information\" becomes hex \"41445320496e666f726d6174696f6e.
scte35SegmentationDescriptor_segmentationUpid :: Lens.Lens' Scte35SegmentationDescriptor (Prelude.Maybe Prelude.Text)
scte35SegmentationDescriptor_segmentationUpid :: Lens' Scte35SegmentationDescriptor (Maybe Text)
scte35SegmentationDescriptor_segmentationUpid = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Scte35SegmentationDescriptor' {Maybe Text
segmentationUpid :: Maybe Text
$sel:segmentationUpid:Scte35SegmentationDescriptor' :: Scte35SegmentationDescriptor -> Maybe Text
segmentationUpid} -> Maybe Text
segmentationUpid) (\s :: Scte35SegmentationDescriptor
s@Scte35SegmentationDescriptor' {} Maybe Text
a -> Scte35SegmentationDescriptor
s {$sel:segmentationUpid:Scte35SegmentationDescriptor' :: Maybe Text
segmentationUpid = Maybe Text
a} :: Scte35SegmentationDescriptor)

-- | Corresponds to SCTE-35 segmentation_upid_type. On the console, enter one
-- of the types listed in the SCTE-35 specification, converted to a
-- decimal. For example, \"0x0C\" hex from the specification is \"12\" in
-- decimal. In the CLI, API, or an SDK, enter one of the types listed in
-- the SCTE-35 specification, in either hex (for example, \"0x0C\" ) or in
-- decimal (for example, \"12\").
scte35SegmentationDescriptor_segmentationUpidType :: Lens.Lens' Scte35SegmentationDescriptor (Prelude.Maybe Prelude.Natural)
scte35SegmentationDescriptor_segmentationUpidType :: Lens' Scte35SegmentationDescriptor (Maybe Natural)
scte35SegmentationDescriptor_segmentationUpidType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Scte35SegmentationDescriptor' {Maybe Natural
segmentationUpidType :: Maybe Natural
$sel:segmentationUpidType:Scte35SegmentationDescriptor' :: Scte35SegmentationDescriptor -> Maybe Natural
segmentationUpidType} -> Maybe Natural
segmentationUpidType) (\s :: Scte35SegmentationDescriptor
s@Scte35SegmentationDescriptor' {} Maybe Natural
a -> Scte35SegmentationDescriptor
s {$sel:segmentationUpidType:Scte35SegmentationDescriptor' :: Maybe Natural
segmentationUpidType = Maybe Natural
a} :: Scte35SegmentationDescriptor)

-- | Corresponds to SCTE-35 segments_expected. A value that is valid for the
-- specified segmentation_type_id.
scte35SegmentationDescriptor_segmentsExpected :: Lens.Lens' Scte35SegmentationDescriptor (Prelude.Maybe Prelude.Natural)
scte35SegmentationDescriptor_segmentsExpected :: Lens' Scte35SegmentationDescriptor (Maybe Natural)
scte35SegmentationDescriptor_segmentsExpected = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Scte35SegmentationDescriptor' {Maybe Natural
segmentsExpected :: Maybe Natural
$sel:segmentsExpected:Scte35SegmentationDescriptor' :: Scte35SegmentationDescriptor -> Maybe Natural
segmentsExpected} -> Maybe Natural
segmentsExpected) (\s :: Scte35SegmentationDescriptor
s@Scte35SegmentationDescriptor' {} Maybe Natural
a -> Scte35SegmentationDescriptor
s {$sel:segmentsExpected:Scte35SegmentationDescriptor' :: Maybe Natural
segmentsExpected = Maybe Natural
a} :: Scte35SegmentationDescriptor)

-- | Corresponds to SCTE-35 sub_segment_num. A value that is valid for the
-- specified segmentation_type_id.
scte35SegmentationDescriptor_subSegmentNum :: Lens.Lens' Scte35SegmentationDescriptor (Prelude.Maybe Prelude.Natural)
scte35SegmentationDescriptor_subSegmentNum :: Lens' Scte35SegmentationDescriptor (Maybe Natural)
scte35SegmentationDescriptor_subSegmentNum = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Scte35SegmentationDescriptor' {Maybe Natural
subSegmentNum :: Maybe Natural
$sel:subSegmentNum:Scte35SegmentationDescriptor' :: Scte35SegmentationDescriptor -> Maybe Natural
subSegmentNum} -> Maybe Natural
subSegmentNum) (\s :: Scte35SegmentationDescriptor
s@Scte35SegmentationDescriptor' {} Maybe Natural
a -> Scte35SegmentationDescriptor
s {$sel:subSegmentNum:Scte35SegmentationDescriptor' :: Maybe Natural
subSegmentNum = Maybe Natural
a} :: Scte35SegmentationDescriptor)

-- | Corresponds to SCTE-35 sub_segments_expected. A value that is valid for
-- the specified segmentation_type_id.
scte35SegmentationDescriptor_subSegmentsExpected :: Lens.Lens' Scte35SegmentationDescriptor (Prelude.Maybe Prelude.Natural)
scte35SegmentationDescriptor_subSegmentsExpected :: Lens' Scte35SegmentationDescriptor (Maybe Natural)
scte35SegmentationDescriptor_subSegmentsExpected = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Scte35SegmentationDescriptor' {Maybe Natural
subSegmentsExpected :: Maybe Natural
$sel:subSegmentsExpected:Scte35SegmentationDescriptor' :: Scte35SegmentationDescriptor -> Maybe Natural
subSegmentsExpected} -> Maybe Natural
subSegmentsExpected) (\s :: Scte35SegmentationDescriptor
s@Scte35SegmentationDescriptor' {} Maybe Natural
a -> Scte35SegmentationDescriptor
s {$sel:subSegmentsExpected:Scte35SegmentationDescriptor' :: Maybe Natural
subSegmentsExpected = Maybe Natural
a} :: Scte35SegmentationDescriptor)

-- | Corresponds to SCTE-35 segmentation_event_id.
scte35SegmentationDescriptor_segmentationEventId :: Lens.Lens' Scte35SegmentationDescriptor Prelude.Natural
scte35SegmentationDescriptor_segmentationEventId :: Lens' Scte35SegmentationDescriptor Natural
scte35SegmentationDescriptor_segmentationEventId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Scte35SegmentationDescriptor' {Natural
segmentationEventId :: Natural
$sel:segmentationEventId:Scte35SegmentationDescriptor' :: Scte35SegmentationDescriptor -> Natural
segmentationEventId} -> Natural
segmentationEventId) (\s :: Scte35SegmentationDescriptor
s@Scte35SegmentationDescriptor' {} Natural
a -> Scte35SegmentationDescriptor
s {$sel:segmentationEventId:Scte35SegmentationDescriptor' :: Natural
segmentationEventId = Natural
a} :: Scte35SegmentationDescriptor)

-- | Corresponds to SCTE-35 segmentation_event_cancel_indicator.
scte35SegmentationDescriptor_segmentationCancelIndicator :: Lens.Lens' Scte35SegmentationDescriptor Scte35SegmentationCancelIndicator
scte35SegmentationDescriptor_segmentationCancelIndicator :: Lens'
  Scte35SegmentationDescriptor Scte35SegmentationCancelIndicator
scte35SegmentationDescriptor_segmentationCancelIndicator = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Scte35SegmentationDescriptor' {Scte35SegmentationCancelIndicator
segmentationCancelIndicator :: Scte35SegmentationCancelIndicator
$sel:segmentationCancelIndicator:Scte35SegmentationDescriptor' :: Scte35SegmentationDescriptor -> Scte35SegmentationCancelIndicator
segmentationCancelIndicator} -> Scte35SegmentationCancelIndicator
segmentationCancelIndicator) (\s :: Scte35SegmentationDescriptor
s@Scte35SegmentationDescriptor' {} Scte35SegmentationCancelIndicator
a -> Scte35SegmentationDescriptor
s {$sel:segmentationCancelIndicator:Scte35SegmentationDescriptor' :: Scte35SegmentationCancelIndicator
segmentationCancelIndicator = Scte35SegmentationCancelIndicator
a} :: Scte35SegmentationDescriptor)

instance Data.FromJSON Scte35SegmentationDescriptor where
  parseJSON :: Value -> Parser Scte35SegmentationDescriptor
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"Scte35SegmentationDescriptor"
      ( \Object
x ->
          Maybe Scte35DeliveryRestrictions
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe Text
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Natural
-> Scte35SegmentationCancelIndicator
-> Scte35SegmentationDescriptor
Scte35SegmentationDescriptor'
            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
"deliveryRestrictions")
            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
"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
"segmentationDuration")
            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")
            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
"segmentationEventId")
            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
"segmentationCancelIndicator")
      )

instance
  Prelude.Hashable
    Scte35SegmentationDescriptor
  where
  hashWithSalt :: Int -> Scte35SegmentationDescriptor -> Int
hashWithSalt Int
_salt Scte35SegmentationDescriptor' {Natural
Maybe Natural
Maybe Text
Maybe Scte35DeliveryRestrictions
Scte35SegmentationCancelIndicator
segmentationCancelIndicator :: Scte35SegmentationCancelIndicator
segmentationEventId :: Natural
subSegmentsExpected :: Maybe Natural
subSegmentNum :: Maybe Natural
segmentsExpected :: Maybe Natural
segmentationUpidType :: Maybe Natural
segmentationUpid :: Maybe Text
segmentationTypeId :: Maybe Natural
segmentationDuration :: Maybe Natural
segmentNum :: Maybe Natural
deliveryRestrictions :: Maybe Scte35DeliveryRestrictions
$sel:segmentationCancelIndicator:Scte35SegmentationDescriptor' :: Scte35SegmentationDescriptor -> Scte35SegmentationCancelIndicator
$sel:segmentationEventId:Scte35SegmentationDescriptor' :: Scte35SegmentationDescriptor -> Natural
$sel:subSegmentsExpected:Scte35SegmentationDescriptor' :: Scte35SegmentationDescriptor -> Maybe Natural
$sel:subSegmentNum:Scte35SegmentationDescriptor' :: Scte35SegmentationDescriptor -> Maybe Natural
$sel:segmentsExpected:Scte35SegmentationDescriptor' :: Scte35SegmentationDescriptor -> Maybe Natural
$sel:segmentationUpidType:Scte35SegmentationDescriptor' :: Scte35SegmentationDescriptor -> Maybe Natural
$sel:segmentationUpid:Scte35SegmentationDescriptor' :: Scte35SegmentationDescriptor -> Maybe Text
$sel:segmentationTypeId:Scte35SegmentationDescriptor' :: Scte35SegmentationDescriptor -> Maybe Natural
$sel:segmentationDuration:Scte35SegmentationDescriptor' :: Scte35SegmentationDescriptor -> Maybe Natural
$sel:segmentNum:Scte35SegmentationDescriptor' :: Scte35SegmentationDescriptor -> Maybe Natural
$sel:deliveryRestrictions:Scte35SegmentationDescriptor' :: Scte35SegmentationDescriptor -> Maybe Scte35DeliveryRestrictions
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Scte35DeliveryRestrictions
deliveryRestrictions
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
segmentNum
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
segmentationDuration
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
segmentationTypeId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
segmentationUpid
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
segmentationUpidType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
segmentsExpected
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
subSegmentNum
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
subSegmentsExpected
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
segmentationEventId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Scte35SegmentationCancelIndicator
segmentationCancelIndicator

instance Prelude.NFData Scte35SegmentationDescriptor where
  rnf :: Scte35SegmentationDescriptor -> ()
rnf Scte35SegmentationDescriptor' {Natural
Maybe Natural
Maybe Text
Maybe Scte35DeliveryRestrictions
Scte35SegmentationCancelIndicator
segmentationCancelIndicator :: Scte35SegmentationCancelIndicator
segmentationEventId :: Natural
subSegmentsExpected :: Maybe Natural
subSegmentNum :: Maybe Natural
segmentsExpected :: Maybe Natural
segmentationUpidType :: Maybe Natural
segmentationUpid :: Maybe Text
segmentationTypeId :: Maybe Natural
segmentationDuration :: Maybe Natural
segmentNum :: Maybe Natural
deliveryRestrictions :: Maybe Scte35DeliveryRestrictions
$sel:segmentationCancelIndicator:Scte35SegmentationDescriptor' :: Scte35SegmentationDescriptor -> Scte35SegmentationCancelIndicator
$sel:segmentationEventId:Scte35SegmentationDescriptor' :: Scte35SegmentationDescriptor -> Natural
$sel:subSegmentsExpected:Scte35SegmentationDescriptor' :: Scte35SegmentationDescriptor -> Maybe Natural
$sel:subSegmentNum:Scte35SegmentationDescriptor' :: Scte35SegmentationDescriptor -> Maybe Natural
$sel:segmentsExpected:Scte35SegmentationDescriptor' :: Scte35SegmentationDescriptor -> Maybe Natural
$sel:segmentationUpidType:Scte35SegmentationDescriptor' :: Scte35SegmentationDescriptor -> Maybe Natural
$sel:segmentationUpid:Scte35SegmentationDescriptor' :: Scte35SegmentationDescriptor -> Maybe Text
$sel:segmentationTypeId:Scte35SegmentationDescriptor' :: Scte35SegmentationDescriptor -> Maybe Natural
$sel:segmentationDuration:Scte35SegmentationDescriptor' :: Scte35SegmentationDescriptor -> Maybe Natural
$sel:segmentNum:Scte35SegmentationDescriptor' :: Scte35SegmentationDescriptor -> Maybe Natural
$sel:deliveryRestrictions:Scte35SegmentationDescriptor' :: Scte35SegmentationDescriptor -> Maybe Scte35DeliveryRestrictions
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Scte35DeliveryRestrictions
deliveryRestrictions
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
segmentNum
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
segmentationDuration
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
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 Natural
segmentationUpidType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
segmentsExpected
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
subSegmentNum
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
subSegmentsExpected
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Natural
segmentationEventId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Scte35SegmentationCancelIndicator
segmentationCancelIndicator

instance Data.ToJSON Scte35SegmentationDescriptor where
  toJSON :: Scte35SegmentationDescriptor -> Value
toJSON Scte35SegmentationDescriptor' {Natural
Maybe Natural
Maybe Text
Maybe Scte35DeliveryRestrictions
Scte35SegmentationCancelIndicator
segmentationCancelIndicator :: Scte35SegmentationCancelIndicator
segmentationEventId :: Natural
subSegmentsExpected :: Maybe Natural
subSegmentNum :: Maybe Natural
segmentsExpected :: Maybe Natural
segmentationUpidType :: Maybe Natural
segmentationUpid :: Maybe Text
segmentationTypeId :: Maybe Natural
segmentationDuration :: Maybe Natural
segmentNum :: Maybe Natural
deliveryRestrictions :: Maybe Scte35DeliveryRestrictions
$sel:segmentationCancelIndicator:Scte35SegmentationDescriptor' :: Scte35SegmentationDescriptor -> Scte35SegmentationCancelIndicator
$sel:segmentationEventId:Scte35SegmentationDescriptor' :: Scte35SegmentationDescriptor -> Natural
$sel:subSegmentsExpected:Scte35SegmentationDescriptor' :: Scte35SegmentationDescriptor -> Maybe Natural
$sel:subSegmentNum:Scte35SegmentationDescriptor' :: Scte35SegmentationDescriptor -> Maybe Natural
$sel:segmentsExpected:Scte35SegmentationDescriptor' :: Scte35SegmentationDescriptor -> Maybe Natural
$sel:segmentationUpidType:Scte35SegmentationDescriptor' :: Scte35SegmentationDescriptor -> Maybe Natural
$sel:segmentationUpid:Scte35SegmentationDescriptor' :: Scte35SegmentationDescriptor -> Maybe Text
$sel:segmentationTypeId:Scte35SegmentationDescriptor' :: Scte35SegmentationDescriptor -> Maybe Natural
$sel:segmentationDuration:Scte35SegmentationDescriptor' :: Scte35SegmentationDescriptor -> Maybe Natural
$sel:segmentNum:Scte35SegmentationDescriptor' :: Scte35SegmentationDescriptor -> Maybe Natural
$sel:deliveryRestrictions:Scte35SegmentationDescriptor' :: Scte35SegmentationDescriptor -> Maybe Scte35DeliveryRestrictions
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"deliveryRestrictions" 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 Scte35DeliveryRestrictions
deliveryRestrictions,
            (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 Natural
segmentNum,
            (Key
"segmentationDuration" 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
segmentationDuration,
            (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 Natural
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 Natural
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 Natural
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 Natural
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 Natural
subSegmentsExpected,
            forall a. a -> Maybe a
Prelude.Just
              (Key
"segmentationEventId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Natural
segmentationEventId),
            forall a. a -> Maybe a
Prelude.Just
              ( Key
"segmentationCancelIndicator"
                  forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Scte35SegmentationCancelIndicator
segmentationCancelIndicator
              )
          ]
      )