{-# 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.MediaConvert.Types.M2tsScte35Esam
-- 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.MediaConvert.Types.M2tsScte35Esam 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

-- | Settings for SCTE-35 signals from ESAM. Include this in your job
-- settings to put SCTE-35 markers in your HLS and transport stream outputs
-- at the insertion points that you specify in an ESAM XML document.
-- Provide the document in the setting SCC XML (sccXml).
--
-- /See:/ 'newM2tsScte35Esam' smart constructor.
data M2tsScte35Esam = M2tsScte35Esam'
  { -- | Packet Identifier (PID) of the SCTE-35 stream in the transport stream
    -- generated by ESAM.
    M2tsScte35Esam -> Maybe Natural
scte35EsamPid :: Prelude.Maybe Prelude.Natural
  }
  deriving (M2tsScte35Esam -> M2tsScte35Esam -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: M2tsScte35Esam -> M2tsScte35Esam -> Bool
$c/= :: M2tsScte35Esam -> M2tsScte35Esam -> Bool
== :: M2tsScte35Esam -> M2tsScte35Esam -> Bool
$c== :: M2tsScte35Esam -> M2tsScte35Esam -> Bool
Prelude.Eq, ReadPrec [M2tsScte35Esam]
ReadPrec M2tsScte35Esam
Int -> ReadS M2tsScte35Esam
ReadS [M2tsScte35Esam]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [M2tsScte35Esam]
$creadListPrec :: ReadPrec [M2tsScte35Esam]
readPrec :: ReadPrec M2tsScte35Esam
$creadPrec :: ReadPrec M2tsScte35Esam
readList :: ReadS [M2tsScte35Esam]
$creadList :: ReadS [M2tsScte35Esam]
readsPrec :: Int -> ReadS M2tsScte35Esam
$creadsPrec :: Int -> ReadS M2tsScte35Esam
Prelude.Read, Int -> M2tsScte35Esam -> ShowS
[M2tsScte35Esam] -> ShowS
M2tsScte35Esam -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [M2tsScte35Esam] -> ShowS
$cshowList :: [M2tsScte35Esam] -> ShowS
show :: M2tsScte35Esam -> String
$cshow :: M2tsScte35Esam -> String
showsPrec :: Int -> M2tsScte35Esam -> ShowS
$cshowsPrec :: Int -> M2tsScte35Esam -> ShowS
Prelude.Show, forall x. Rep M2tsScte35Esam x -> M2tsScte35Esam
forall x. M2tsScte35Esam -> Rep M2tsScte35Esam x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep M2tsScte35Esam x -> M2tsScte35Esam
$cfrom :: forall x. M2tsScte35Esam -> Rep M2tsScte35Esam x
Prelude.Generic)

-- |
-- Create a value of 'M2tsScte35Esam' 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:
--
-- 'scte35EsamPid', 'm2tsScte35Esam_scte35EsamPid' - Packet Identifier (PID) of the SCTE-35 stream in the transport stream
-- generated by ESAM.
newM2tsScte35Esam ::
  M2tsScte35Esam
newM2tsScte35Esam :: M2tsScte35Esam
newM2tsScte35Esam =
  M2tsScte35Esam' {$sel:scte35EsamPid:M2tsScte35Esam' :: Maybe Natural
scte35EsamPid = forall a. Maybe a
Prelude.Nothing}

-- | Packet Identifier (PID) of the SCTE-35 stream in the transport stream
-- generated by ESAM.
m2tsScte35Esam_scte35EsamPid :: Lens.Lens' M2tsScte35Esam (Prelude.Maybe Prelude.Natural)
m2tsScte35Esam_scte35EsamPid :: Lens' M2tsScte35Esam (Maybe Natural)
m2tsScte35Esam_scte35EsamPid = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\M2tsScte35Esam' {Maybe Natural
scte35EsamPid :: Maybe Natural
$sel:scte35EsamPid:M2tsScte35Esam' :: M2tsScte35Esam -> Maybe Natural
scte35EsamPid} -> Maybe Natural
scte35EsamPid) (\s :: M2tsScte35Esam
s@M2tsScte35Esam' {} Maybe Natural
a -> M2tsScte35Esam
s {$sel:scte35EsamPid:M2tsScte35Esam' :: Maybe Natural
scte35EsamPid = Maybe Natural
a} :: M2tsScte35Esam)

instance Data.FromJSON M2tsScte35Esam where
  parseJSON :: Value -> Parser M2tsScte35Esam
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"M2tsScte35Esam"
      ( \Object
x ->
          Maybe Natural -> M2tsScte35Esam
M2tsScte35Esam'
            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
"scte35EsamPid")
      )

instance Prelude.Hashable M2tsScte35Esam where
  hashWithSalt :: Int -> M2tsScte35Esam -> Int
hashWithSalt Int
_salt M2tsScte35Esam' {Maybe Natural
scte35EsamPid :: Maybe Natural
$sel:scte35EsamPid:M2tsScte35Esam' :: M2tsScte35Esam -> Maybe Natural
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
scte35EsamPid

instance Prelude.NFData M2tsScte35Esam where
  rnf :: M2tsScte35Esam -> ()
rnf M2tsScte35Esam' {Maybe Natural
scte35EsamPid :: Maybe Natural
$sel:scte35EsamPid:M2tsScte35Esam' :: M2tsScte35Esam -> Maybe Natural
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
scte35EsamPid

instance Data.ToJSON M2tsScte35Esam where
  toJSON :: M2tsScte35Esam -> Value
toJSON M2tsScte35Esam' {Maybe Natural
scte35EsamPid :: Maybe Natural
$sel:scte35EsamPid:M2tsScte35Esam' :: M2tsScte35Esam -> Maybe Natural
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"scte35EsamPid" 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
scte35EsamPid
          ]
      )