{-# 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.TimecodeBurninSettings
-- 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.TimecodeBurninSettings 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.TimecodeBurninFontSize
import Amazonka.MediaLive.Types.TimecodeBurninPosition
import qualified Amazonka.Prelude as Prelude

-- | Timecode Burnin Settings
--
-- /See:/ 'newTimecodeBurninSettings' smart constructor.
data TimecodeBurninSettings = TimecodeBurninSettings'
  { -- | Create a timecode burn-in prefix (optional)
    TimecodeBurninSettings -> Maybe Text
prefix :: Prelude.Maybe Prelude.Text,
    -- | Choose a timecode burn-in output position
    TimecodeBurninSettings -> TimecodeBurninPosition
position :: TimecodeBurninPosition,
    -- | Choose a timecode burn-in font size
    TimecodeBurninSettings -> TimecodeBurninFontSize
fontSize :: TimecodeBurninFontSize
  }
  deriving (TimecodeBurninSettings -> TimecodeBurninSettings -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TimecodeBurninSettings -> TimecodeBurninSettings -> Bool
$c/= :: TimecodeBurninSettings -> TimecodeBurninSettings -> Bool
== :: TimecodeBurninSettings -> TimecodeBurninSettings -> Bool
$c== :: TimecodeBurninSettings -> TimecodeBurninSettings -> Bool
Prelude.Eq, ReadPrec [TimecodeBurninSettings]
ReadPrec TimecodeBurninSettings
Int -> ReadS TimecodeBurninSettings
ReadS [TimecodeBurninSettings]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TimecodeBurninSettings]
$creadListPrec :: ReadPrec [TimecodeBurninSettings]
readPrec :: ReadPrec TimecodeBurninSettings
$creadPrec :: ReadPrec TimecodeBurninSettings
readList :: ReadS [TimecodeBurninSettings]
$creadList :: ReadS [TimecodeBurninSettings]
readsPrec :: Int -> ReadS TimecodeBurninSettings
$creadsPrec :: Int -> ReadS TimecodeBurninSettings
Prelude.Read, Int -> TimecodeBurninSettings -> ShowS
[TimecodeBurninSettings] -> ShowS
TimecodeBurninSettings -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TimecodeBurninSettings] -> ShowS
$cshowList :: [TimecodeBurninSettings] -> ShowS
show :: TimecodeBurninSettings -> String
$cshow :: TimecodeBurninSettings -> String
showsPrec :: Int -> TimecodeBurninSettings -> ShowS
$cshowsPrec :: Int -> TimecodeBurninSettings -> ShowS
Prelude.Show, forall x. Rep TimecodeBurninSettings x -> TimecodeBurninSettings
forall x. TimecodeBurninSettings -> Rep TimecodeBurninSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TimecodeBurninSettings x -> TimecodeBurninSettings
$cfrom :: forall x. TimecodeBurninSettings -> Rep TimecodeBurninSettings x
Prelude.Generic)

-- |
-- Create a value of 'TimecodeBurninSettings' 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:
--
-- 'prefix', 'timecodeBurninSettings_prefix' - Create a timecode burn-in prefix (optional)
--
-- 'position', 'timecodeBurninSettings_position' - Choose a timecode burn-in output position
--
-- 'fontSize', 'timecodeBurninSettings_fontSize' - Choose a timecode burn-in font size
newTimecodeBurninSettings ::
  -- | 'position'
  TimecodeBurninPosition ->
  -- | 'fontSize'
  TimecodeBurninFontSize ->
  TimecodeBurninSettings
newTimecodeBurninSettings :: TimecodeBurninPosition
-> TimecodeBurninFontSize -> TimecodeBurninSettings
newTimecodeBurninSettings TimecodeBurninPosition
pPosition_ TimecodeBurninFontSize
pFontSize_ =
  TimecodeBurninSettings'
    { $sel:prefix:TimecodeBurninSettings' :: Maybe Text
prefix = forall a. Maybe a
Prelude.Nothing,
      $sel:position:TimecodeBurninSettings' :: TimecodeBurninPosition
position = TimecodeBurninPosition
pPosition_,
      $sel:fontSize:TimecodeBurninSettings' :: TimecodeBurninFontSize
fontSize = TimecodeBurninFontSize
pFontSize_
    }

-- | Create a timecode burn-in prefix (optional)
timecodeBurninSettings_prefix :: Lens.Lens' TimecodeBurninSettings (Prelude.Maybe Prelude.Text)
timecodeBurninSettings_prefix :: Lens' TimecodeBurninSettings (Maybe Text)
timecodeBurninSettings_prefix = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TimecodeBurninSettings' {Maybe Text
prefix :: Maybe Text
$sel:prefix:TimecodeBurninSettings' :: TimecodeBurninSettings -> Maybe Text
prefix} -> Maybe Text
prefix) (\s :: TimecodeBurninSettings
s@TimecodeBurninSettings' {} Maybe Text
a -> TimecodeBurninSettings
s {$sel:prefix:TimecodeBurninSettings' :: Maybe Text
prefix = Maybe Text
a} :: TimecodeBurninSettings)

-- | Choose a timecode burn-in output position
timecodeBurninSettings_position :: Lens.Lens' TimecodeBurninSettings TimecodeBurninPosition
timecodeBurninSettings_position :: Lens' TimecodeBurninSettings TimecodeBurninPosition
timecodeBurninSettings_position = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TimecodeBurninSettings' {TimecodeBurninPosition
position :: TimecodeBurninPosition
$sel:position:TimecodeBurninSettings' :: TimecodeBurninSettings -> TimecodeBurninPosition
position} -> TimecodeBurninPosition
position) (\s :: TimecodeBurninSettings
s@TimecodeBurninSettings' {} TimecodeBurninPosition
a -> TimecodeBurninSettings
s {$sel:position:TimecodeBurninSettings' :: TimecodeBurninPosition
position = TimecodeBurninPosition
a} :: TimecodeBurninSettings)

-- | Choose a timecode burn-in font size
timecodeBurninSettings_fontSize :: Lens.Lens' TimecodeBurninSettings TimecodeBurninFontSize
timecodeBurninSettings_fontSize :: Lens' TimecodeBurninSettings TimecodeBurninFontSize
timecodeBurninSettings_fontSize = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TimecodeBurninSettings' {TimecodeBurninFontSize
fontSize :: TimecodeBurninFontSize
$sel:fontSize:TimecodeBurninSettings' :: TimecodeBurninSettings -> TimecodeBurninFontSize
fontSize} -> TimecodeBurninFontSize
fontSize) (\s :: TimecodeBurninSettings
s@TimecodeBurninSettings' {} TimecodeBurninFontSize
a -> TimecodeBurninSettings
s {$sel:fontSize:TimecodeBurninSettings' :: TimecodeBurninFontSize
fontSize = TimecodeBurninFontSize
a} :: TimecodeBurninSettings)

instance Data.FromJSON TimecodeBurninSettings where
  parseJSON :: Value -> Parser TimecodeBurninSettings
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"TimecodeBurninSettings"
      ( \Object
x ->
          Maybe Text
-> TimecodeBurninPosition
-> TimecodeBurninFontSize
-> TimecodeBurninSettings
TimecodeBurninSettings'
            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
"prefix")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"position")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"fontSize")
      )

instance Prelude.Hashable TimecodeBurninSettings where
  hashWithSalt :: Int -> TimecodeBurninSettings -> Int
hashWithSalt Int
_salt TimecodeBurninSettings' {Maybe Text
TimecodeBurninFontSize
TimecodeBurninPosition
fontSize :: TimecodeBurninFontSize
position :: TimecodeBurninPosition
prefix :: Maybe Text
$sel:fontSize:TimecodeBurninSettings' :: TimecodeBurninSettings -> TimecodeBurninFontSize
$sel:position:TimecodeBurninSettings' :: TimecodeBurninSettings -> TimecodeBurninPosition
$sel:prefix:TimecodeBurninSettings' :: TimecodeBurninSettings -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
prefix
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` TimecodeBurninPosition
position
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` TimecodeBurninFontSize
fontSize

instance Prelude.NFData TimecodeBurninSettings where
  rnf :: TimecodeBurninSettings -> ()
rnf TimecodeBurninSettings' {Maybe Text
TimecodeBurninFontSize
TimecodeBurninPosition
fontSize :: TimecodeBurninFontSize
position :: TimecodeBurninPosition
prefix :: Maybe Text
$sel:fontSize:TimecodeBurninSettings' :: TimecodeBurninSettings -> TimecodeBurninFontSize
$sel:position:TimecodeBurninSettings' :: TimecodeBurninSettings -> TimecodeBurninPosition
$sel:prefix:TimecodeBurninSettings' :: TimecodeBurninSettings -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
prefix
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf TimecodeBurninPosition
position
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf TimecodeBurninFontSize
fontSize

instance Data.ToJSON TimecodeBurninSettings where
  toJSON :: TimecodeBurninSettings -> Value
toJSON TimecodeBurninSettings' {Maybe Text
TimecodeBurninFontSize
TimecodeBurninPosition
fontSize :: TimecodeBurninFontSize
position :: TimecodeBurninPosition
prefix :: Maybe Text
$sel:fontSize:TimecodeBurninSettings' :: TimecodeBurninSettings -> TimecodeBurninFontSize
$sel:position:TimecodeBurninSettings' :: TimecodeBurninSettings -> TimecodeBurninPosition
$sel:prefix:TimecodeBurninSettings' :: TimecodeBurninSettings -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"prefix" 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 Text
prefix,
            forall a. a -> Maybe a
Prelude.Just (Key
"position" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= TimecodeBurninPosition
position),
            forall a. a -> Maybe a
Prelude.Just (Key
"fontSize" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= TimecodeBurninFontSize
fontSize)
          ]
      )