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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaConvert.Types.WebvttStylePassthrough
import qualified Amazonka.Prelude as Prelude

-- | Settings related to WebVTT captions. WebVTT 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. For more information, see
-- https:\/\/docs.aws.amazon.com\/mediaconvert\/latest\/ug\/ttml-and-webvtt-output-captions.html.
-- When you work directly in your JSON job specification, include this
-- object and any required children when you set destinationType to WebVTT.
--
-- /See:/ 'newWebvttDestinationSettings' smart constructor.
data WebvttDestinationSettings = WebvttDestinationSettings'
  { -- | 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.
    WebvttDestinationSettings -> Maybe WebvttStylePassthrough
stylePassthrough :: Prelude.Maybe WebvttStylePassthrough
  }
  deriving (WebvttDestinationSettings -> WebvttDestinationSettings -> Bool
(WebvttDestinationSettings -> WebvttDestinationSettings -> Bool)
-> (WebvttDestinationSettings -> WebvttDestinationSettings -> Bool)
-> Eq WebvttDestinationSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WebvttDestinationSettings -> WebvttDestinationSettings -> Bool
$c/= :: WebvttDestinationSettings -> WebvttDestinationSettings -> Bool
== :: WebvttDestinationSettings -> WebvttDestinationSettings -> Bool
$c== :: WebvttDestinationSettings -> WebvttDestinationSettings -> Bool
Prelude.Eq, ReadPrec [WebvttDestinationSettings]
ReadPrec WebvttDestinationSettings
Int -> ReadS WebvttDestinationSettings
ReadS [WebvttDestinationSettings]
(Int -> ReadS WebvttDestinationSettings)
-> ReadS [WebvttDestinationSettings]
-> ReadPrec WebvttDestinationSettings
-> ReadPrec [WebvttDestinationSettings]
-> Read WebvttDestinationSettings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [WebvttDestinationSettings]
$creadListPrec :: ReadPrec [WebvttDestinationSettings]
readPrec :: ReadPrec WebvttDestinationSettings
$creadPrec :: ReadPrec WebvttDestinationSettings
readList :: ReadS [WebvttDestinationSettings]
$creadList :: ReadS [WebvttDestinationSettings]
readsPrec :: Int -> ReadS WebvttDestinationSettings
$creadsPrec :: Int -> ReadS WebvttDestinationSettings
Prelude.Read, Int -> WebvttDestinationSettings -> ShowS
[WebvttDestinationSettings] -> ShowS
WebvttDestinationSettings -> String
(Int -> WebvttDestinationSettings -> ShowS)
-> (WebvttDestinationSettings -> String)
-> ([WebvttDestinationSettings] -> ShowS)
-> Show WebvttDestinationSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WebvttDestinationSettings] -> ShowS
$cshowList :: [WebvttDestinationSettings] -> ShowS
show :: WebvttDestinationSettings -> String
$cshow :: WebvttDestinationSettings -> String
showsPrec :: Int -> WebvttDestinationSettings -> ShowS
$cshowsPrec :: Int -> WebvttDestinationSettings -> ShowS
Prelude.Show, (forall x.
 WebvttDestinationSettings -> Rep WebvttDestinationSettings x)
-> (forall x.
    Rep WebvttDestinationSettings x -> WebvttDestinationSettings)
-> Generic WebvttDestinationSettings
forall x.
Rep WebvttDestinationSettings x -> WebvttDestinationSettings
forall x.
WebvttDestinationSettings -> Rep WebvttDestinationSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep WebvttDestinationSettings x -> WebvttDestinationSettings
$cfrom :: forall x.
WebvttDestinationSettings -> Rep WebvttDestinationSettings x
Prelude.Generic)

-- |
-- Create a value of 'WebvttDestinationSettings' 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', 'webvttDestinationSettings_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.
newWebvttDestinationSettings ::
  WebvttDestinationSettings
newWebvttDestinationSettings :: WebvttDestinationSettings
newWebvttDestinationSettings =
  WebvttDestinationSettings' :: Maybe WebvttStylePassthrough -> WebvttDestinationSettings
WebvttDestinationSettings'
    { $sel:stylePassthrough:WebvttDestinationSettings' :: Maybe WebvttStylePassthrough
stylePassthrough =
        Maybe WebvttStylePassthrough
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.
webvttDestinationSettings_stylePassthrough :: Lens.Lens' WebvttDestinationSettings (Prelude.Maybe WebvttStylePassthrough)
webvttDestinationSettings_stylePassthrough :: (Maybe WebvttStylePassthrough -> f (Maybe WebvttStylePassthrough))
-> WebvttDestinationSettings -> f WebvttDestinationSettings
webvttDestinationSettings_stylePassthrough = (WebvttDestinationSettings -> Maybe WebvttStylePassthrough)
-> (WebvttDestinationSettings
    -> Maybe WebvttStylePassthrough -> WebvttDestinationSettings)
-> Lens
     WebvttDestinationSettings
     WebvttDestinationSettings
     (Maybe WebvttStylePassthrough)
     (Maybe WebvttStylePassthrough)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WebvttDestinationSettings' {Maybe WebvttStylePassthrough
stylePassthrough :: Maybe WebvttStylePassthrough
$sel:stylePassthrough:WebvttDestinationSettings' :: WebvttDestinationSettings -> Maybe WebvttStylePassthrough
stylePassthrough} -> Maybe WebvttStylePassthrough
stylePassthrough) (\s :: WebvttDestinationSettings
s@WebvttDestinationSettings' {} Maybe WebvttStylePassthrough
a -> WebvttDestinationSettings
s {$sel:stylePassthrough:WebvttDestinationSettings' :: Maybe WebvttStylePassthrough
stylePassthrough = Maybe WebvttStylePassthrough
a} :: WebvttDestinationSettings)

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

instance Prelude.Hashable WebvttDestinationSettings

instance Prelude.NFData WebvttDestinationSettings

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