{-# 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-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.EmbeddedDestinationSettings where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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
(EmbeddedDestinationSettings
 -> EmbeddedDestinationSettings -> Bool)
-> (EmbeddedDestinationSettings
    -> EmbeddedDestinationSettings -> Bool)
-> Eq EmbeddedDestinationSettings
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]
(Int -> ReadS EmbeddedDestinationSettings)
-> ReadS [EmbeddedDestinationSettings]
-> ReadPrec EmbeddedDestinationSettings
-> ReadPrec [EmbeddedDestinationSettings]
-> Read 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
(Int -> EmbeddedDestinationSettings -> ShowS)
-> (EmbeddedDestinationSettings -> String)
-> ([EmbeddedDestinationSettings] -> ShowS)
-> Show EmbeddedDestinationSettings
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.
 EmbeddedDestinationSettings -> Rep EmbeddedDestinationSettings x)
-> (forall x.
    Rep EmbeddedDestinationSettings x -> EmbeddedDestinationSettings)
-> Generic EmbeddedDestinationSettings
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' :: Maybe Natural -> Maybe Natural -> EmbeddedDestinationSettings
EmbeddedDestinationSettings'
    { $sel:destination608ChannelNumber:EmbeddedDestinationSettings' :: Maybe Natural
destination608ChannelNumber =
        Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:destination708ServiceNumber:EmbeddedDestinationSettings' :: Maybe Natural
destination708ServiceNumber = Maybe Natural
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 :: (Maybe Natural -> f (Maybe Natural))
-> EmbeddedDestinationSettings -> f EmbeddedDestinationSettings
embeddedDestinationSettings_destination608ChannelNumber = (EmbeddedDestinationSettings -> Maybe Natural)
-> (EmbeddedDestinationSettings
    -> Maybe Natural -> EmbeddedDestinationSettings)
-> Lens
     EmbeddedDestinationSettings
     EmbeddedDestinationSettings
     (Maybe Natural)
     (Maybe Natural)
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 :: (Maybe Natural -> f (Maybe Natural))
-> EmbeddedDestinationSettings -> f EmbeddedDestinationSettings
embeddedDestinationSettings_destination708ServiceNumber = (EmbeddedDestinationSettings -> Maybe Natural)
-> (EmbeddedDestinationSettings
    -> Maybe Natural -> EmbeddedDestinationSettings)
-> Lens
     EmbeddedDestinationSettings
     EmbeddedDestinationSettings
     (Maybe Natural)
     (Maybe Natural)
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 Core.FromJSON EmbeddedDestinationSettings where
  parseJSON :: Value -> Parser EmbeddedDestinationSettings
parseJSON =
    String
-> (Object -> Parser EmbeddedDestinationSettings)
-> Value
-> Parser EmbeddedDestinationSettings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"EmbeddedDestinationSettings"
      ( \Object
x ->
          Maybe Natural -> Maybe Natural -> EmbeddedDestinationSettings
EmbeddedDestinationSettings'
            (Maybe Natural -> Maybe Natural -> EmbeddedDestinationSettings)
-> Parser (Maybe Natural)
-> Parser (Maybe Natural -> EmbeddedDestinationSettings)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"destination608ChannelNumber")
            Parser (Maybe Natural -> EmbeddedDestinationSettings)
-> Parser (Maybe Natural) -> Parser EmbeddedDestinationSettings
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"destination708ServiceNumber")
      )

instance Prelude.Hashable EmbeddedDestinationSettings

instance Prelude.NFData EmbeddedDestinationSettings

instance Core.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
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"destination608ChannelNumber" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
destination608ChannelNumber,
            (Text
"destination708ServiceNumber" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
destination708ServiceNumber
          ]
      )