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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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
(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:
--
-- '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' :: Maybe WebvttDestinationStyleControl -> WebvttDestinationSettings
WebvttDestinationSettings'
    { $sel:styleControl:WebvttDestinationSettings' :: Maybe WebvttDestinationStyleControl
styleControl =
        Maybe WebvttDestinationStyleControl
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 :: (Maybe WebvttDestinationStyleControl
 -> f (Maybe WebvttDestinationStyleControl))
-> WebvttDestinationSettings -> f WebvttDestinationSettings
webvttDestinationSettings_styleControl = (WebvttDestinationSettings -> Maybe WebvttDestinationStyleControl)
-> (WebvttDestinationSettings
    -> Maybe WebvttDestinationStyleControl
    -> WebvttDestinationSettings)
-> Lens
     WebvttDestinationSettings
     WebvttDestinationSettings
     (Maybe WebvttDestinationStyleControl)
     (Maybe WebvttDestinationStyleControl)
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 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 WebvttDestinationStyleControl -> WebvttDestinationSettings
WebvttDestinationSettings'
            (Maybe WebvttDestinationStyleControl -> WebvttDestinationSettings)
-> Parser (Maybe WebvttDestinationStyleControl)
-> Parser WebvttDestinationSettings
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe WebvttDestinationStyleControl)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"styleControl")
      )

instance Prelude.Hashable WebvttDestinationSettings

instance Prelude.NFData WebvttDestinationSettings

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