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

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MediaLive.Types.WebvttDestinationStyleControl
import qualified Amazonka.Prelude as Prelude

-- | Webvtt Destination Settings
--
-- /See:/ 'newWebvttDestinationSettings' smart constructor.
data WebvttDestinationSettings = WebvttDestinationSettings'
  { -- | Controls whether the color and position of the source captions is passed
    -- through to the WebVTT output captions. PASSTHROUGH - Valid only if the
    -- source captions are EMBEDDED or TELETEXT. NO_STYLE_DATA - Don\'t pass
    -- through the style. The output captions will not contain any font styling
    -- information.
    WebvttDestinationSettings -> Maybe WebvttDestinationStyleControl
styleControl :: Prelude.Maybe WebvttDestinationStyleControl
  }
  deriving (WebvttDestinationSettings -> WebvttDestinationSettings -> Bool
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]
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
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.
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:
--
-- 'styleControl', 'webvttDestinationSettings_styleControl' - Controls whether the color and position of the source captions is passed
-- through to the WebVTT output captions. PASSTHROUGH - Valid only if the
-- source captions are EMBEDDED or TELETEXT. NO_STYLE_DATA - Don\'t pass
-- through the style. The output captions will not contain any font styling
-- information.
newWebvttDestinationSettings ::
  WebvttDestinationSettings
newWebvttDestinationSettings :: WebvttDestinationSettings
newWebvttDestinationSettings =
  WebvttDestinationSettings'
    { $sel:styleControl:WebvttDestinationSettings' :: Maybe WebvttDestinationStyleControl
styleControl =
        forall a. Maybe a
Prelude.Nothing
    }

-- | Controls whether the color and position of the source captions is passed
-- through to the WebVTT output captions. PASSTHROUGH - Valid only if the
-- source captions are EMBEDDED or TELETEXT. NO_STYLE_DATA - Don\'t pass
-- through the style. The output captions will not contain any font styling
-- information.
webvttDestinationSettings_styleControl :: Lens.Lens' WebvttDestinationSettings (Prelude.Maybe WebvttDestinationStyleControl)
webvttDestinationSettings_styleControl :: Lens'
  WebvttDestinationSettings (Maybe WebvttDestinationStyleControl)
webvttDestinationSettings_styleControl = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WebvttDestinationSettings' {Maybe WebvttDestinationStyleControl
styleControl :: Maybe WebvttDestinationStyleControl
$sel:styleControl:WebvttDestinationSettings' :: WebvttDestinationSettings -> Maybe WebvttDestinationStyleControl
styleControl} -> Maybe WebvttDestinationStyleControl
styleControl) (\s :: WebvttDestinationSettings
s@WebvttDestinationSettings' {} Maybe WebvttDestinationStyleControl
a -> WebvttDestinationSettings
s {$sel:styleControl:WebvttDestinationSettings' :: Maybe WebvttDestinationStyleControl
styleControl = Maybe WebvttDestinationStyleControl
a} :: WebvttDestinationSettings)

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

instance Prelude.Hashable WebvttDestinationSettings where
  hashWithSalt :: Int -> WebvttDestinationSettings -> Int
hashWithSalt Int
_salt WebvttDestinationSettings' {Maybe WebvttDestinationStyleControl
styleControl :: Maybe WebvttDestinationStyleControl
$sel:styleControl:WebvttDestinationSettings' :: WebvttDestinationSettings -> Maybe WebvttDestinationStyleControl
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe WebvttDestinationStyleControl
styleControl

instance Prelude.NFData WebvttDestinationSettings where
  rnf :: WebvttDestinationSettings -> ()
rnf WebvttDestinationSettings' {Maybe WebvttDestinationStyleControl
styleControl :: Maybe WebvttDestinationStyleControl
$sel:styleControl:WebvttDestinationSettings' :: WebvttDestinationSettings -> Maybe WebvttDestinationStyleControl
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe WebvttDestinationStyleControl
styleControl

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