{-# 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.EmbeddedDestinationSettings
-- 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.EmbeddedDestinationSettings 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 related to CEA\/EIA-608 and CEA\/EIA-708 (also called embedded
-- or ancillary) captions. Set up embedded captions in the same output as
-- your video. For more information, see
-- https:\/\/docs.aws.amazon.com\/mediaconvert\/latest\/ug\/embedded-output-captions.html.
-- When you work directly in your JSON job specification, include this
-- object and any required children when you set destinationType to
-- EMBEDDED, EMBEDDED_PLUS_SCTE20, or SCTE20_PLUS_EMBEDDED.
--
-- /See:/ 'newEmbeddedDestinationSettings' smart constructor.
data EmbeddedDestinationSettings = EmbeddedDestinationSettings'
  { -- | Ignore this setting unless your input captions are SCC format and your
    -- output captions are embedded in the video stream. Specify a CC number
    -- for each captions channel in this output. If you have two channels,
    -- choose CC numbers that aren\'t in the same field. For example, choose 1
    -- and 3. For more information, see
    -- https:\/\/docs.aws.amazon.com\/console\/mediaconvert\/dual-scc-to-embedded.
    EmbeddedDestinationSettings -> Maybe Natural
destination608ChannelNumber :: Prelude.Maybe Prelude.Natural,
    -- | Ignore this setting unless your input captions are SCC format and you
    -- want both 608 and 708 captions embedded in your output stream.
    -- Optionally, specify the 708 service number for each output captions
    -- channel. Choose a different number for each channel. To use this
    -- setting, also set Force 608 to 708 upconvert (Convert608To708) to
    -- Upconvert (UPCONVERT) in your input captions selector settings. If you
    -- choose to upconvert but don\'t specify a 708 service number,
    -- MediaConvert uses the number that you specify for CC channel number
    -- (destination608ChannelNumber) for the 708 service number. For more
    -- information, see
    -- https:\/\/docs.aws.amazon.com\/console\/mediaconvert\/dual-scc-to-embedded.
    EmbeddedDestinationSettings -> Maybe Natural
destination708ServiceNumber :: Prelude.Maybe Prelude.Natural
  }
  deriving (EmbeddedDestinationSettings -> EmbeddedDestinationSettings -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EmbeddedDestinationSettings -> EmbeddedDestinationSettings -> Bool
$c/= :: EmbeddedDestinationSettings -> EmbeddedDestinationSettings -> Bool
== :: EmbeddedDestinationSettings -> EmbeddedDestinationSettings -> Bool
$c== :: EmbeddedDestinationSettings -> EmbeddedDestinationSettings -> Bool
Prelude.Eq, ReadPrec [EmbeddedDestinationSettings]
ReadPrec EmbeddedDestinationSettings
Int -> ReadS EmbeddedDestinationSettings
ReadS [EmbeddedDestinationSettings]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EmbeddedDestinationSettings]
$creadListPrec :: ReadPrec [EmbeddedDestinationSettings]
readPrec :: ReadPrec EmbeddedDestinationSettings
$creadPrec :: ReadPrec EmbeddedDestinationSettings
readList :: ReadS [EmbeddedDestinationSettings]
$creadList :: ReadS [EmbeddedDestinationSettings]
readsPrec :: Int -> ReadS EmbeddedDestinationSettings
$creadsPrec :: Int -> ReadS EmbeddedDestinationSettings
Prelude.Read, Int -> EmbeddedDestinationSettings -> ShowS
[EmbeddedDestinationSettings] -> ShowS
EmbeddedDestinationSettings -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EmbeddedDestinationSettings] -> ShowS
$cshowList :: [EmbeddedDestinationSettings] -> ShowS
show :: EmbeddedDestinationSettings -> String
$cshow :: EmbeddedDestinationSettings -> String
showsPrec :: Int -> EmbeddedDestinationSettings -> ShowS
$cshowsPrec :: Int -> EmbeddedDestinationSettings -> ShowS
Prelude.Show, forall x.
Rep EmbeddedDestinationSettings x -> EmbeddedDestinationSettings
forall x.
EmbeddedDestinationSettings -> Rep EmbeddedDestinationSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep EmbeddedDestinationSettings x -> EmbeddedDestinationSettings
$cfrom :: forall x.
EmbeddedDestinationSettings -> Rep EmbeddedDestinationSettings x
Prelude.Generic)

-- |
-- Create a value of 'EmbeddedDestinationSettings' 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:
--
-- 'destination608ChannelNumber', 'embeddedDestinationSettings_destination608ChannelNumber' - Ignore this setting unless your input captions are SCC format and your
-- output captions are embedded in the video stream. Specify a CC number
-- for each captions channel in this output. If you have two channels,
-- choose CC numbers that aren\'t in the same field. For example, choose 1
-- and 3. For more information, see
-- https:\/\/docs.aws.amazon.com\/console\/mediaconvert\/dual-scc-to-embedded.
--
-- 'destination708ServiceNumber', 'embeddedDestinationSettings_destination708ServiceNumber' - Ignore this setting unless your input captions are SCC format and you
-- want both 608 and 708 captions embedded in your output stream.
-- Optionally, specify the 708 service number for each output captions
-- channel. Choose a different number for each channel. To use this
-- setting, also set Force 608 to 708 upconvert (Convert608To708) to
-- Upconvert (UPCONVERT) in your input captions selector settings. If you
-- choose to upconvert but don\'t specify a 708 service number,
-- MediaConvert uses the number that you specify for CC channel number
-- (destination608ChannelNumber) for the 708 service number. For more
-- information, see
-- https:\/\/docs.aws.amazon.com\/console\/mediaconvert\/dual-scc-to-embedded.
newEmbeddedDestinationSettings ::
  EmbeddedDestinationSettings
newEmbeddedDestinationSettings :: EmbeddedDestinationSettings
newEmbeddedDestinationSettings =
  EmbeddedDestinationSettings'
    { $sel:destination608ChannelNumber:EmbeddedDestinationSettings' :: Maybe Natural
destination608ChannelNumber =
        forall a. Maybe a
Prelude.Nothing,
      $sel:destination708ServiceNumber:EmbeddedDestinationSettings' :: Maybe Natural
destination708ServiceNumber = forall a. Maybe a
Prelude.Nothing
    }

-- | Ignore this setting unless your input captions are SCC format and your
-- output captions are embedded in the video stream. Specify a CC number
-- for each captions channel in this output. If you have two channels,
-- choose CC numbers that aren\'t in the same field. For example, choose 1
-- and 3. For more information, see
-- https:\/\/docs.aws.amazon.com\/console\/mediaconvert\/dual-scc-to-embedded.
embeddedDestinationSettings_destination608ChannelNumber :: Lens.Lens' EmbeddedDestinationSettings (Prelude.Maybe Prelude.Natural)
embeddedDestinationSettings_destination608ChannelNumber :: Lens' EmbeddedDestinationSettings (Maybe Natural)
embeddedDestinationSettings_destination608ChannelNumber = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EmbeddedDestinationSettings' {Maybe Natural
destination608ChannelNumber :: Maybe Natural
$sel:destination608ChannelNumber:EmbeddedDestinationSettings' :: EmbeddedDestinationSettings -> Maybe Natural
destination608ChannelNumber} -> Maybe Natural
destination608ChannelNumber) (\s :: EmbeddedDestinationSettings
s@EmbeddedDestinationSettings' {} Maybe Natural
a -> EmbeddedDestinationSettings
s {$sel:destination608ChannelNumber:EmbeddedDestinationSettings' :: Maybe Natural
destination608ChannelNumber = Maybe Natural
a} :: EmbeddedDestinationSettings)

-- | Ignore this setting unless your input captions are SCC format and you
-- want both 608 and 708 captions embedded in your output stream.
-- Optionally, specify the 708 service number for each output captions
-- channel. Choose a different number for each channel. To use this
-- setting, also set Force 608 to 708 upconvert (Convert608To708) to
-- Upconvert (UPCONVERT) in your input captions selector settings. If you
-- choose to upconvert but don\'t specify a 708 service number,
-- MediaConvert uses the number that you specify for CC channel number
-- (destination608ChannelNumber) for the 708 service number. For more
-- information, see
-- https:\/\/docs.aws.amazon.com\/console\/mediaconvert\/dual-scc-to-embedded.
embeddedDestinationSettings_destination708ServiceNumber :: Lens.Lens' EmbeddedDestinationSettings (Prelude.Maybe Prelude.Natural)
embeddedDestinationSettings_destination708ServiceNumber :: Lens' EmbeddedDestinationSettings (Maybe Natural)
embeddedDestinationSettings_destination708ServiceNumber = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EmbeddedDestinationSettings' {Maybe Natural
destination708ServiceNumber :: Maybe Natural
$sel:destination708ServiceNumber:EmbeddedDestinationSettings' :: EmbeddedDestinationSettings -> Maybe Natural
destination708ServiceNumber} -> Maybe Natural
destination708ServiceNumber) (\s :: EmbeddedDestinationSettings
s@EmbeddedDestinationSettings' {} Maybe Natural
a -> EmbeddedDestinationSettings
s {$sel:destination708ServiceNumber:EmbeddedDestinationSettings' :: Maybe Natural
destination708ServiceNumber = Maybe Natural
a} :: EmbeddedDestinationSettings)

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

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

instance Prelude.NFData EmbeddedDestinationSettings where
  rnf :: EmbeddedDestinationSettings -> ()
rnf EmbeddedDestinationSettings' {Maybe Natural
destination708ServiceNumber :: Maybe Natural
destination608ChannelNumber :: Maybe Natural
$sel:destination708ServiceNumber:EmbeddedDestinationSettings' :: EmbeddedDestinationSettings -> Maybe Natural
$sel:destination608ChannelNumber:EmbeddedDestinationSettings' :: EmbeddedDestinationSettings -> Maybe Natural
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
destination608ChannelNumber
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
destination708ServiceNumber

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