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

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

instance Prelude.Hashable SrtDestinationSettings

instance Prelude.NFData SrtDestinationSettings

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