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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | ESAM SignalProcessingNotification data defined by
-- OC-SP-ESAM-API-I03-131025.
--
-- /See:/ 'newEsamSignalProcessingNotification' smart constructor.
data EsamSignalProcessingNotification = EsamSignalProcessingNotification'
  { -- | Provide your ESAM SignalProcessingNotification XML document inside your
    -- JSON job settings. Form the XML document as per
    -- OC-SP-ESAM-API-I03-131025. The transcoder will use the signal processing
    -- instructions in the message that you supply. Provide your ESAM
    -- SignalProcessingNotification XML document inside your JSON job settings.
    -- For your MPEG2-TS file outputs, if you want the service to place SCTE-35
    -- markers at the insertion points you specify in the XML document, you
    -- must also enable SCTE-35 ESAM (scte35Esam). Note that you can either
    -- specify an ESAM XML document or enable SCTE-35 passthrough. You can\'t
    -- do both.
    EsamSignalProcessingNotification -> Maybe Text
sccXml :: Prelude.Maybe Prelude.Text
  }
  deriving (EsamSignalProcessingNotification
-> EsamSignalProcessingNotification -> Bool
(EsamSignalProcessingNotification
 -> EsamSignalProcessingNotification -> Bool)
-> (EsamSignalProcessingNotification
    -> EsamSignalProcessingNotification -> Bool)
-> Eq EsamSignalProcessingNotification
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EsamSignalProcessingNotification
-> EsamSignalProcessingNotification -> Bool
$c/= :: EsamSignalProcessingNotification
-> EsamSignalProcessingNotification -> Bool
== :: EsamSignalProcessingNotification
-> EsamSignalProcessingNotification -> Bool
$c== :: EsamSignalProcessingNotification
-> EsamSignalProcessingNotification -> Bool
Prelude.Eq, ReadPrec [EsamSignalProcessingNotification]
ReadPrec EsamSignalProcessingNotification
Int -> ReadS EsamSignalProcessingNotification
ReadS [EsamSignalProcessingNotification]
(Int -> ReadS EsamSignalProcessingNotification)
-> ReadS [EsamSignalProcessingNotification]
-> ReadPrec EsamSignalProcessingNotification
-> ReadPrec [EsamSignalProcessingNotification]
-> Read EsamSignalProcessingNotification
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EsamSignalProcessingNotification]
$creadListPrec :: ReadPrec [EsamSignalProcessingNotification]
readPrec :: ReadPrec EsamSignalProcessingNotification
$creadPrec :: ReadPrec EsamSignalProcessingNotification
readList :: ReadS [EsamSignalProcessingNotification]
$creadList :: ReadS [EsamSignalProcessingNotification]
readsPrec :: Int -> ReadS EsamSignalProcessingNotification
$creadsPrec :: Int -> ReadS EsamSignalProcessingNotification
Prelude.Read, Int -> EsamSignalProcessingNotification -> ShowS
[EsamSignalProcessingNotification] -> ShowS
EsamSignalProcessingNotification -> String
(Int -> EsamSignalProcessingNotification -> ShowS)
-> (EsamSignalProcessingNotification -> String)
-> ([EsamSignalProcessingNotification] -> ShowS)
-> Show EsamSignalProcessingNotification
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EsamSignalProcessingNotification] -> ShowS
$cshowList :: [EsamSignalProcessingNotification] -> ShowS
show :: EsamSignalProcessingNotification -> String
$cshow :: EsamSignalProcessingNotification -> String
showsPrec :: Int -> EsamSignalProcessingNotification -> ShowS
$cshowsPrec :: Int -> EsamSignalProcessingNotification -> ShowS
Prelude.Show, (forall x.
 EsamSignalProcessingNotification
 -> Rep EsamSignalProcessingNotification x)
-> (forall x.
    Rep EsamSignalProcessingNotification x
    -> EsamSignalProcessingNotification)
-> Generic EsamSignalProcessingNotification
forall x.
Rep EsamSignalProcessingNotification x
-> EsamSignalProcessingNotification
forall x.
EsamSignalProcessingNotification
-> Rep EsamSignalProcessingNotification x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep EsamSignalProcessingNotification x
-> EsamSignalProcessingNotification
$cfrom :: forall x.
EsamSignalProcessingNotification
-> Rep EsamSignalProcessingNotification x
Prelude.Generic)

-- |
-- Create a value of 'EsamSignalProcessingNotification' 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:
--
-- 'sccXml', 'esamSignalProcessingNotification_sccXml' - Provide your ESAM SignalProcessingNotification XML document inside your
-- JSON job settings. Form the XML document as per
-- OC-SP-ESAM-API-I03-131025. The transcoder will use the signal processing
-- instructions in the message that you supply. Provide your ESAM
-- SignalProcessingNotification XML document inside your JSON job settings.
-- For your MPEG2-TS file outputs, if you want the service to place SCTE-35
-- markers at the insertion points you specify in the XML document, you
-- must also enable SCTE-35 ESAM (scte35Esam). Note that you can either
-- specify an ESAM XML document or enable SCTE-35 passthrough. You can\'t
-- do both.
newEsamSignalProcessingNotification ::
  EsamSignalProcessingNotification
newEsamSignalProcessingNotification :: EsamSignalProcessingNotification
newEsamSignalProcessingNotification =
  EsamSignalProcessingNotification' :: Maybe Text -> EsamSignalProcessingNotification
EsamSignalProcessingNotification'
    { $sel:sccXml:EsamSignalProcessingNotification' :: Maybe Text
sccXml =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | Provide your ESAM SignalProcessingNotification XML document inside your
-- JSON job settings. Form the XML document as per
-- OC-SP-ESAM-API-I03-131025. The transcoder will use the signal processing
-- instructions in the message that you supply. Provide your ESAM
-- SignalProcessingNotification XML document inside your JSON job settings.
-- For your MPEG2-TS file outputs, if you want the service to place SCTE-35
-- markers at the insertion points you specify in the XML document, you
-- must also enable SCTE-35 ESAM (scte35Esam). Note that you can either
-- specify an ESAM XML document or enable SCTE-35 passthrough. You can\'t
-- do both.
esamSignalProcessingNotification_sccXml :: Lens.Lens' EsamSignalProcessingNotification (Prelude.Maybe Prelude.Text)
esamSignalProcessingNotification_sccXml :: (Maybe Text -> f (Maybe Text))
-> EsamSignalProcessingNotification
-> f EsamSignalProcessingNotification
esamSignalProcessingNotification_sccXml = (EsamSignalProcessingNotification -> Maybe Text)
-> (EsamSignalProcessingNotification
    -> Maybe Text -> EsamSignalProcessingNotification)
-> Lens
     EsamSignalProcessingNotification
     EsamSignalProcessingNotification
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EsamSignalProcessingNotification' {Maybe Text
sccXml :: Maybe Text
$sel:sccXml:EsamSignalProcessingNotification' :: EsamSignalProcessingNotification -> Maybe Text
sccXml} -> Maybe Text
sccXml) (\s :: EsamSignalProcessingNotification
s@EsamSignalProcessingNotification' {} Maybe Text
a -> EsamSignalProcessingNotification
s {$sel:sccXml:EsamSignalProcessingNotification' :: Maybe Text
sccXml = Maybe Text
a} :: EsamSignalProcessingNotification)

instance
  Core.FromJSON
    EsamSignalProcessingNotification
  where
  parseJSON :: Value -> Parser EsamSignalProcessingNotification
parseJSON =
    String
-> (Object -> Parser EsamSignalProcessingNotification)
-> Value
-> Parser EsamSignalProcessingNotification
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"EsamSignalProcessingNotification"
      ( \Object
x ->
          Maybe Text -> EsamSignalProcessingNotification
EsamSignalProcessingNotification'
            (Maybe Text -> EsamSignalProcessingNotification)
-> Parser (Maybe Text) -> Parser EsamSignalProcessingNotification
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"sccXml")
      )

instance
  Prelude.Hashable
    EsamSignalProcessingNotification

instance
  Prelude.NFData
    EsamSignalProcessingNotification

instance Core.ToJSON EsamSignalProcessingNotification where
  toJSON :: EsamSignalProcessingNotification -> Value
toJSON EsamSignalProcessingNotification' {Maybe Text
sccXml :: Maybe Text
$sel:sccXml:EsamSignalProcessingNotification' :: EsamSignalProcessingNotification -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [(Text
"sccXml" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
sccXml]
      )