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

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MediaConvert.Types.SrtStylePassthrough
import qualified Amazonka.Prelude as Prelude

-- | Settings related to SRT captions. SRT is a sidecar format that holds
-- captions in a file that is separate from the video container. Set up
-- sidecar captions in the same output group, but different output from
-- your video. When you work directly in your JSON job specification,
-- include this object and any required children when you set
-- destinationType to SRT.
--
-- /See:/ 'newSrtDestinationSettings' smart constructor.
data SrtDestinationSettings = SrtDestinationSettings'
  { -- | Set Style passthrough (StylePassthrough) to ENABLED to use the available
    -- style, color, and position information from your input captions.
    -- MediaConvert uses default settings for any missing style and position
    -- information in your input captions. Set Style passthrough to DISABLED,
    -- or leave blank, to ignore the style and position information from your
    -- input captions and use simplified output captions.
    SrtDestinationSettings -> Maybe SrtStylePassthrough
stylePassthrough :: Prelude.Maybe SrtStylePassthrough
  }
  deriving (SrtDestinationSettings -> SrtDestinationSettings -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SrtDestinationSettings -> SrtDestinationSettings -> Bool
$c/= :: SrtDestinationSettings -> SrtDestinationSettings -> Bool
== :: SrtDestinationSettings -> SrtDestinationSettings -> Bool
$c== :: SrtDestinationSettings -> SrtDestinationSettings -> Bool
Prelude.Eq, ReadPrec [SrtDestinationSettings]
ReadPrec SrtDestinationSettings
Int -> ReadS SrtDestinationSettings
ReadS [SrtDestinationSettings]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SrtDestinationSettings]
$creadListPrec :: ReadPrec [SrtDestinationSettings]
readPrec :: ReadPrec SrtDestinationSettings
$creadPrec :: ReadPrec SrtDestinationSettings
readList :: ReadS [SrtDestinationSettings]
$creadList :: ReadS [SrtDestinationSettings]
readsPrec :: Int -> ReadS SrtDestinationSettings
$creadsPrec :: Int -> ReadS SrtDestinationSettings
Prelude.Read, Int -> SrtDestinationSettings -> ShowS
[SrtDestinationSettings] -> ShowS
SrtDestinationSettings -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SrtDestinationSettings] -> ShowS
$cshowList :: [SrtDestinationSettings] -> ShowS
show :: SrtDestinationSettings -> String
$cshow :: SrtDestinationSettings -> String
showsPrec :: Int -> SrtDestinationSettings -> ShowS
$cshowsPrec :: Int -> SrtDestinationSettings -> ShowS
Prelude.Show, forall x. Rep SrtDestinationSettings x -> SrtDestinationSettings
forall x. SrtDestinationSettings -> Rep SrtDestinationSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SrtDestinationSettings x -> SrtDestinationSettings
$cfrom :: forall x. SrtDestinationSettings -> Rep SrtDestinationSettings x
Prelude.Generic)

-- |
-- Create a value of 'SrtDestinationSettings' 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:
--
-- 'stylePassthrough', 'srtDestinationSettings_stylePassthrough' - Set Style passthrough (StylePassthrough) to ENABLED to use the available
-- style, color, and position information from your input captions.
-- MediaConvert uses default settings for any missing style and position
-- information in your input captions. Set Style passthrough to DISABLED,
-- or leave blank, to ignore the style and position information from your
-- input captions and use simplified output captions.
newSrtDestinationSettings ::
  SrtDestinationSettings
newSrtDestinationSettings :: SrtDestinationSettings
newSrtDestinationSettings =
  SrtDestinationSettings'
    { $sel:stylePassthrough:SrtDestinationSettings' :: Maybe SrtStylePassthrough
stylePassthrough =
        forall a. Maybe a
Prelude.Nothing
    }

-- | Set Style passthrough (StylePassthrough) to ENABLED to use the available
-- style, color, and position information from your input captions.
-- MediaConvert uses default settings for any missing style and position
-- information in your input captions. Set Style passthrough to DISABLED,
-- or leave blank, to ignore the style and position information from your
-- input captions and use simplified output captions.
srtDestinationSettings_stylePassthrough :: Lens.Lens' SrtDestinationSettings (Prelude.Maybe SrtStylePassthrough)
srtDestinationSettings_stylePassthrough :: Lens' SrtDestinationSettings (Maybe SrtStylePassthrough)
srtDestinationSettings_stylePassthrough = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SrtDestinationSettings' {Maybe SrtStylePassthrough
stylePassthrough :: Maybe SrtStylePassthrough
$sel:stylePassthrough:SrtDestinationSettings' :: SrtDestinationSettings -> Maybe SrtStylePassthrough
stylePassthrough} -> Maybe SrtStylePassthrough
stylePassthrough) (\s :: SrtDestinationSettings
s@SrtDestinationSettings' {} Maybe SrtStylePassthrough
a -> SrtDestinationSettings
s {$sel:stylePassthrough:SrtDestinationSettings' :: Maybe SrtStylePassthrough
stylePassthrough = Maybe SrtStylePassthrough
a} :: SrtDestinationSettings)

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

instance Prelude.Hashable SrtDestinationSettings where
  hashWithSalt :: Int -> SrtDestinationSettings -> Int
hashWithSalt Int
_salt SrtDestinationSettings' {Maybe SrtStylePassthrough
stylePassthrough :: Maybe SrtStylePassthrough
$sel:stylePassthrough:SrtDestinationSettings' :: SrtDestinationSettings -> Maybe SrtStylePassthrough
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SrtStylePassthrough
stylePassthrough

instance Prelude.NFData SrtDestinationSettings where
  rnf :: SrtDestinationSettings -> ()
rnf SrtDestinationSettings' {Maybe SrtStylePassthrough
stylePassthrough :: Maybe SrtStylePassthrough
$sel:stylePassthrough:SrtDestinationSettings' :: SrtDestinationSettings -> Maybe SrtStylePassthrough
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe SrtStylePassthrough
stylePassthrough

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