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

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

-- | Tile and thumbnail settings applicable when imageBasedTrickPlay is
-- ADVANCED
--
-- /See:/ 'newHlsImageBasedTrickPlaySettings' smart constructor.
data HlsImageBasedTrickPlaySettings = HlsImageBasedTrickPlaySettings'
  { -- | Number of thumbnails in each row of a tile image. Set a value between 1
    -- and 512.
    HlsImageBasedTrickPlaySettings -> Maybe Natural
tileWidth :: Prelude.Maybe Prelude.Natural,
    -- | Height of each thumbnail within each tile image, in pixels. Leave blank
    -- to maintain aspect ratio with thumbnail width. If following the aspect
    -- ratio would lead to a total tile height greater than 4096, then the job
    -- will be rejected. Must be divisible by 2.
    HlsImageBasedTrickPlaySettings -> Maybe Natural
thumbnailHeight :: Prelude.Maybe Prelude.Natural,
    -- | The cadence MediaConvert follows for generating thumbnails. If set to
    -- FOLLOW_IFRAME, MediaConvert generates thumbnails for each IDR frame in
    -- the output (matching the GOP cadence). If set to FOLLOW_CUSTOM,
    -- MediaConvert generates thumbnails according to the interval you specify
    -- in thumbnailInterval.
    HlsImageBasedTrickPlaySettings -> Maybe HlsIntervalCadence
intervalCadence :: Prelude.Maybe HlsIntervalCadence,
    -- | Width of each thumbnail within each tile image, in pixels. Default is
    -- 312. Must be divisible by 8.
    HlsImageBasedTrickPlaySettings -> Maybe Natural
thumbnailWidth :: Prelude.Maybe Prelude.Natural,
    -- | Enter the interval, in seconds, that MediaConvert uses to generate
    -- thumbnails. If the interval you enter doesn\'t align with the output
    -- frame rate, MediaConvert automatically rounds the interval to align with
    -- the output frame rate. For example, if the output frame rate is 29.97
    -- frames per second and you enter 5, MediaConvert uses a 150 frame
    -- interval to generate thumbnails.
    HlsImageBasedTrickPlaySettings -> Maybe Double
thumbnailInterval :: Prelude.Maybe Prelude.Double,
    -- | Number of thumbnails in each column of a tile image. Set a value between
    -- 2 and 2048. Must be divisible by 2.
    HlsImageBasedTrickPlaySettings -> Maybe Natural
tileHeight :: Prelude.Maybe Prelude.Natural
  }
  deriving (HlsImageBasedTrickPlaySettings
-> HlsImageBasedTrickPlaySettings -> Bool
(HlsImageBasedTrickPlaySettings
 -> HlsImageBasedTrickPlaySettings -> Bool)
-> (HlsImageBasedTrickPlaySettings
    -> HlsImageBasedTrickPlaySettings -> Bool)
-> Eq HlsImageBasedTrickPlaySettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HlsImageBasedTrickPlaySettings
-> HlsImageBasedTrickPlaySettings -> Bool
$c/= :: HlsImageBasedTrickPlaySettings
-> HlsImageBasedTrickPlaySettings -> Bool
== :: HlsImageBasedTrickPlaySettings
-> HlsImageBasedTrickPlaySettings -> Bool
$c== :: HlsImageBasedTrickPlaySettings
-> HlsImageBasedTrickPlaySettings -> Bool
Prelude.Eq, ReadPrec [HlsImageBasedTrickPlaySettings]
ReadPrec HlsImageBasedTrickPlaySettings
Int -> ReadS HlsImageBasedTrickPlaySettings
ReadS [HlsImageBasedTrickPlaySettings]
(Int -> ReadS HlsImageBasedTrickPlaySettings)
-> ReadS [HlsImageBasedTrickPlaySettings]
-> ReadPrec HlsImageBasedTrickPlaySettings
-> ReadPrec [HlsImageBasedTrickPlaySettings]
-> Read HlsImageBasedTrickPlaySettings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [HlsImageBasedTrickPlaySettings]
$creadListPrec :: ReadPrec [HlsImageBasedTrickPlaySettings]
readPrec :: ReadPrec HlsImageBasedTrickPlaySettings
$creadPrec :: ReadPrec HlsImageBasedTrickPlaySettings
readList :: ReadS [HlsImageBasedTrickPlaySettings]
$creadList :: ReadS [HlsImageBasedTrickPlaySettings]
readsPrec :: Int -> ReadS HlsImageBasedTrickPlaySettings
$creadsPrec :: Int -> ReadS HlsImageBasedTrickPlaySettings
Prelude.Read, Int -> HlsImageBasedTrickPlaySettings -> ShowS
[HlsImageBasedTrickPlaySettings] -> ShowS
HlsImageBasedTrickPlaySettings -> String
(Int -> HlsImageBasedTrickPlaySettings -> ShowS)
-> (HlsImageBasedTrickPlaySettings -> String)
-> ([HlsImageBasedTrickPlaySettings] -> ShowS)
-> Show HlsImageBasedTrickPlaySettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HlsImageBasedTrickPlaySettings] -> ShowS
$cshowList :: [HlsImageBasedTrickPlaySettings] -> ShowS
show :: HlsImageBasedTrickPlaySettings -> String
$cshow :: HlsImageBasedTrickPlaySettings -> String
showsPrec :: Int -> HlsImageBasedTrickPlaySettings -> ShowS
$cshowsPrec :: Int -> HlsImageBasedTrickPlaySettings -> ShowS
Prelude.Show, (forall x.
 HlsImageBasedTrickPlaySettings
 -> Rep HlsImageBasedTrickPlaySettings x)
-> (forall x.
    Rep HlsImageBasedTrickPlaySettings x
    -> HlsImageBasedTrickPlaySettings)
-> Generic HlsImageBasedTrickPlaySettings
forall x.
Rep HlsImageBasedTrickPlaySettings x
-> HlsImageBasedTrickPlaySettings
forall x.
HlsImageBasedTrickPlaySettings
-> Rep HlsImageBasedTrickPlaySettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep HlsImageBasedTrickPlaySettings x
-> HlsImageBasedTrickPlaySettings
$cfrom :: forall x.
HlsImageBasedTrickPlaySettings
-> Rep HlsImageBasedTrickPlaySettings x
Prelude.Generic)

-- |
-- Create a value of 'HlsImageBasedTrickPlaySettings' 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:
--
-- 'tileWidth', 'hlsImageBasedTrickPlaySettings_tileWidth' - Number of thumbnails in each row of a tile image. Set a value between 1
-- and 512.
--
-- 'thumbnailHeight', 'hlsImageBasedTrickPlaySettings_thumbnailHeight' - Height of each thumbnail within each tile image, in pixels. Leave blank
-- to maintain aspect ratio with thumbnail width. If following the aspect
-- ratio would lead to a total tile height greater than 4096, then the job
-- will be rejected. Must be divisible by 2.
--
-- 'intervalCadence', 'hlsImageBasedTrickPlaySettings_intervalCadence' - The cadence MediaConvert follows for generating thumbnails. If set to
-- FOLLOW_IFRAME, MediaConvert generates thumbnails for each IDR frame in
-- the output (matching the GOP cadence). If set to FOLLOW_CUSTOM,
-- MediaConvert generates thumbnails according to the interval you specify
-- in thumbnailInterval.
--
-- 'thumbnailWidth', 'hlsImageBasedTrickPlaySettings_thumbnailWidth' - Width of each thumbnail within each tile image, in pixels. Default is
-- 312. Must be divisible by 8.
--
-- 'thumbnailInterval', 'hlsImageBasedTrickPlaySettings_thumbnailInterval' - Enter the interval, in seconds, that MediaConvert uses to generate
-- thumbnails. If the interval you enter doesn\'t align with the output
-- frame rate, MediaConvert automatically rounds the interval to align with
-- the output frame rate. For example, if the output frame rate is 29.97
-- frames per second and you enter 5, MediaConvert uses a 150 frame
-- interval to generate thumbnails.
--
-- 'tileHeight', 'hlsImageBasedTrickPlaySettings_tileHeight' - Number of thumbnails in each column of a tile image. Set a value between
-- 2 and 2048. Must be divisible by 2.
newHlsImageBasedTrickPlaySettings ::
  HlsImageBasedTrickPlaySettings
newHlsImageBasedTrickPlaySettings :: HlsImageBasedTrickPlaySettings
newHlsImageBasedTrickPlaySettings =
  HlsImageBasedTrickPlaySettings' :: Maybe Natural
-> Maybe Natural
-> Maybe HlsIntervalCadence
-> Maybe Natural
-> Maybe Double
-> Maybe Natural
-> HlsImageBasedTrickPlaySettings
HlsImageBasedTrickPlaySettings'
    { $sel:tileWidth:HlsImageBasedTrickPlaySettings' :: Maybe Natural
tileWidth =
        Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:thumbnailHeight:HlsImageBasedTrickPlaySettings' :: Maybe Natural
thumbnailHeight = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:intervalCadence:HlsImageBasedTrickPlaySettings' :: Maybe HlsIntervalCadence
intervalCadence = Maybe HlsIntervalCadence
forall a. Maybe a
Prelude.Nothing,
      $sel:thumbnailWidth:HlsImageBasedTrickPlaySettings' :: Maybe Natural
thumbnailWidth = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:thumbnailInterval:HlsImageBasedTrickPlaySettings' :: Maybe Double
thumbnailInterval = Maybe Double
forall a. Maybe a
Prelude.Nothing,
      $sel:tileHeight:HlsImageBasedTrickPlaySettings' :: Maybe Natural
tileHeight = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | Number of thumbnails in each row of a tile image. Set a value between 1
-- and 512.
hlsImageBasedTrickPlaySettings_tileWidth :: Lens.Lens' HlsImageBasedTrickPlaySettings (Prelude.Maybe Prelude.Natural)
hlsImageBasedTrickPlaySettings_tileWidth :: (Maybe Natural -> f (Maybe Natural))
-> HlsImageBasedTrickPlaySettings
-> f HlsImageBasedTrickPlaySettings
hlsImageBasedTrickPlaySettings_tileWidth = (HlsImageBasedTrickPlaySettings -> Maybe Natural)
-> (HlsImageBasedTrickPlaySettings
    -> Maybe Natural -> HlsImageBasedTrickPlaySettings)
-> Lens
     HlsImageBasedTrickPlaySettings
     HlsImageBasedTrickPlaySettings
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HlsImageBasedTrickPlaySettings' {Maybe Natural
tileWidth :: Maybe Natural
$sel:tileWidth:HlsImageBasedTrickPlaySettings' :: HlsImageBasedTrickPlaySettings -> Maybe Natural
tileWidth} -> Maybe Natural
tileWidth) (\s :: HlsImageBasedTrickPlaySettings
s@HlsImageBasedTrickPlaySettings' {} Maybe Natural
a -> HlsImageBasedTrickPlaySettings
s {$sel:tileWidth:HlsImageBasedTrickPlaySettings' :: Maybe Natural
tileWidth = Maybe Natural
a} :: HlsImageBasedTrickPlaySettings)

-- | Height of each thumbnail within each tile image, in pixels. Leave blank
-- to maintain aspect ratio with thumbnail width. If following the aspect
-- ratio would lead to a total tile height greater than 4096, then the job
-- will be rejected. Must be divisible by 2.
hlsImageBasedTrickPlaySettings_thumbnailHeight :: Lens.Lens' HlsImageBasedTrickPlaySettings (Prelude.Maybe Prelude.Natural)
hlsImageBasedTrickPlaySettings_thumbnailHeight :: (Maybe Natural -> f (Maybe Natural))
-> HlsImageBasedTrickPlaySettings
-> f HlsImageBasedTrickPlaySettings
hlsImageBasedTrickPlaySettings_thumbnailHeight = (HlsImageBasedTrickPlaySettings -> Maybe Natural)
-> (HlsImageBasedTrickPlaySettings
    -> Maybe Natural -> HlsImageBasedTrickPlaySettings)
-> Lens
     HlsImageBasedTrickPlaySettings
     HlsImageBasedTrickPlaySettings
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HlsImageBasedTrickPlaySettings' {Maybe Natural
thumbnailHeight :: Maybe Natural
$sel:thumbnailHeight:HlsImageBasedTrickPlaySettings' :: HlsImageBasedTrickPlaySettings -> Maybe Natural
thumbnailHeight} -> Maybe Natural
thumbnailHeight) (\s :: HlsImageBasedTrickPlaySettings
s@HlsImageBasedTrickPlaySettings' {} Maybe Natural
a -> HlsImageBasedTrickPlaySettings
s {$sel:thumbnailHeight:HlsImageBasedTrickPlaySettings' :: Maybe Natural
thumbnailHeight = Maybe Natural
a} :: HlsImageBasedTrickPlaySettings)

-- | The cadence MediaConvert follows for generating thumbnails. If set to
-- FOLLOW_IFRAME, MediaConvert generates thumbnails for each IDR frame in
-- the output (matching the GOP cadence). If set to FOLLOW_CUSTOM,
-- MediaConvert generates thumbnails according to the interval you specify
-- in thumbnailInterval.
hlsImageBasedTrickPlaySettings_intervalCadence :: Lens.Lens' HlsImageBasedTrickPlaySettings (Prelude.Maybe HlsIntervalCadence)
hlsImageBasedTrickPlaySettings_intervalCadence :: (Maybe HlsIntervalCadence -> f (Maybe HlsIntervalCadence))
-> HlsImageBasedTrickPlaySettings
-> f HlsImageBasedTrickPlaySettings
hlsImageBasedTrickPlaySettings_intervalCadence = (HlsImageBasedTrickPlaySettings -> Maybe HlsIntervalCadence)
-> (HlsImageBasedTrickPlaySettings
    -> Maybe HlsIntervalCadence -> HlsImageBasedTrickPlaySettings)
-> Lens
     HlsImageBasedTrickPlaySettings
     HlsImageBasedTrickPlaySettings
     (Maybe HlsIntervalCadence)
     (Maybe HlsIntervalCadence)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HlsImageBasedTrickPlaySettings' {Maybe HlsIntervalCadence
intervalCadence :: Maybe HlsIntervalCadence
$sel:intervalCadence:HlsImageBasedTrickPlaySettings' :: HlsImageBasedTrickPlaySettings -> Maybe HlsIntervalCadence
intervalCadence} -> Maybe HlsIntervalCadence
intervalCadence) (\s :: HlsImageBasedTrickPlaySettings
s@HlsImageBasedTrickPlaySettings' {} Maybe HlsIntervalCadence
a -> HlsImageBasedTrickPlaySettings
s {$sel:intervalCadence:HlsImageBasedTrickPlaySettings' :: Maybe HlsIntervalCadence
intervalCadence = Maybe HlsIntervalCadence
a} :: HlsImageBasedTrickPlaySettings)

-- | Width of each thumbnail within each tile image, in pixels. Default is
-- 312. Must be divisible by 8.
hlsImageBasedTrickPlaySettings_thumbnailWidth :: Lens.Lens' HlsImageBasedTrickPlaySettings (Prelude.Maybe Prelude.Natural)
hlsImageBasedTrickPlaySettings_thumbnailWidth :: (Maybe Natural -> f (Maybe Natural))
-> HlsImageBasedTrickPlaySettings
-> f HlsImageBasedTrickPlaySettings
hlsImageBasedTrickPlaySettings_thumbnailWidth = (HlsImageBasedTrickPlaySettings -> Maybe Natural)
-> (HlsImageBasedTrickPlaySettings
    -> Maybe Natural -> HlsImageBasedTrickPlaySettings)
-> Lens
     HlsImageBasedTrickPlaySettings
     HlsImageBasedTrickPlaySettings
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HlsImageBasedTrickPlaySettings' {Maybe Natural
thumbnailWidth :: Maybe Natural
$sel:thumbnailWidth:HlsImageBasedTrickPlaySettings' :: HlsImageBasedTrickPlaySettings -> Maybe Natural
thumbnailWidth} -> Maybe Natural
thumbnailWidth) (\s :: HlsImageBasedTrickPlaySettings
s@HlsImageBasedTrickPlaySettings' {} Maybe Natural
a -> HlsImageBasedTrickPlaySettings
s {$sel:thumbnailWidth:HlsImageBasedTrickPlaySettings' :: Maybe Natural
thumbnailWidth = Maybe Natural
a} :: HlsImageBasedTrickPlaySettings)

-- | Enter the interval, in seconds, that MediaConvert uses to generate
-- thumbnails. If the interval you enter doesn\'t align with the output
-- frame rate, MediaConvert automatically rounds the interval to align with
-- the output frame rate. For example, if the output frame rate is 29.97
-- frames per second and you enter 5, MediaConvert uses a 150 frame
-- interval to generate thumbnails.
hlsImageBasedTrickPlaySettings_thumbnailInterval :: Lens.Lens' HlsImageBasedTrickPlaySettings (Prelude.Maybe Prelude.Double)
hlsImageBasedTrickPlaySettings_thumbnailInterval :: (Maybe Double -> f (Maybe Double))
-> HlsImageBasedTrickPlaySettings
-> f HlsImageBasedTrickPlaySettings
hlsImageBasedTrickPlaySettings_thumbnailInterval = (HlsImageBasedTrickPlaySettings -> Maybe Double)
-> (HlsImageBasedTrickPlaySettings
    -> Maybe Double -> HlsImageBasedTrickPlaySettings)
-> Lens
     HlsImageBasedTrickPlaySettings
     HlsImageBasedTrickPlaySettings
     (Maybe Double)
     (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HlsImageBasedTrickPlaySettings' {Maybe Double
thumbnailInterval :: Maybe Double
$sel:thumbnailInterval:HlsImageBasedTrickPlaySettings' :: HlsImageBasedTrickPlaySettings -> Maybe Double
thumbnailInterval} -> Maybe Double
thumbnailInterval) (\s :: HlsImageBasedTrickPlaySettings
s@HlsImageBasedTrickPlaySettings' {} Maybe Double
a -> HlsImageBasedTrickPlaySettings
s {$sel:thumbnailInterval:HlsImageBasedTrickPlaySettings' :: Maybe Double
thumbnailInterval = Maybe Double
a} :: HlsImageBasedTrickPlaySettings)

-- | Number of thumbnails in each column of a tile image. Set a value between
-- 2 and 2048. Must be divisible by 2.
hlsImageBasedTrickPlaySettings_tileHeight :: Lens.Lens' HlsImageBasedTrickPlaySettings (Prelude.Maybe Prelude.Natural)
hlsImageBasedTrickPlaySettings_tileHeight :: (Maybe Natural -> f (Maybe Natural))
-> HlsImageBasedTrickPlaySettings
-> f HlsImageBasedTrickPlaySettings
hlsImageBasedTrickPlaySettings_tileHeight = (HlsImageBasedTrickPlaySettings -> Maybe Natural)
-> (HlsImageBasedTrickPlaySettings
    -> Maybe Natural -> HlsImageBasedTrickPlaySettings)
-> Lens
     HlsImageBasedTrickPlaySettings
     HlsImageBasedTrickPlaySettings
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HlsImageBasedTrickPlaySettings' {Maybe Natural
tileHeight :: Maybe Natural
$sel:tileHeight:HlsImageBasedTrickPlaySettings' :: HlsImageBasedTrickPlaySettings -> Maybe Natural
tileHeight} -> Maybe Natural
tileHeight) (\s :: HlsImageBasedTrickPlaySettings
s@HlsImageBasedTrickPlaySettings' {} Maybe Natural
a -> HlsImageBasedTrickPlaySettings
s {$sel:tileHeight:HlsImageBasedTrickPlaySettings' :: Maybe Natural
tileHeight = Maybe Natural
a} :: HlsImageBasedTrickPlaySettings)

instance Core.FromJSON HlsImageBasedTrickPlaySettings where
  parseJSON :: Value -> Parser HlsImageBasedTrickPlaySettings
parseJSON =
    String
-> (Object -> Parser HlsImageBasedTrickPlaySettings)
-> Value
-> Parser HlsImageBasedTrickPlaySettings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"HlsImageBasedTrickPlaySettings"
      ( \Object
x ->
          Maybe Natural
-> Maybe Natural
-> Maybe HlsIntervalCadence
-> Maybe Natural
-> Maybe Double
-> Maybe Natural
-> HlsImageBasedTrickPlaySettings
HlsImageBasedTrickPlaySettings'
            (Maybe Natural
 -> Maybe Natural
 -> Maybe HlsIntervalCadence
 -> Maybe Natural
 -> Maybe Double
 -> Maybe Natural
 -> HlsImageBasedTrickPlaySettings)
-> Parser (Maybe Natural)
-> Parser
     (Maybe Natural
      -> Maybe HlsIntervalCadence
      -> Maybe Natural
      -> Maybe Double
      -> Maybe Natural
      -> HlsImageBasedTrickPlaySettings)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"tileWidth")
            Parser
  (Maybe Natural
   -> Maybe HlsIntervalCadence
   -> Maybe Natural
   -> Maybe Double
   -> Maybe Natural
   -> HlsImageBasedTrickPlaySettings)
-> Parser (Maybe Natural)
-> Parser
     (Maybe HlsIntervalCadence
      -> Maybe Natural
      -> Maybe Double
      -> Maybe Natural
      -> HlsImageBasedTrickPlaySettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"thumbnailHeight")
            Parser
  (Maybe HlsIntervalCadence
   -> Maybe Natural
   -> Maybe Double
   -> Maybe Natural
   -> HlsImageBasedTrickPlaySettings)
-> Parser (Maybe HlsIntervalCadence)
-> Parser
     (Maybe Natural
      -> Maybe Double -> Maybe Natural -> HlsImageBasedTrickPlaySettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe HlsIntervalCadence)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"intervalCadence")
            Parser
  (Maybe Natural
   -> Maybe Double -> Maybe Natural -> HlsImageBasedTrickPlaySettings)
-> Parser (Maybe Natural)
-> Parser
     (Maybe Double -> Maybe Natural -> HlsImageBasedTrickPlaySettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"thumbnailWidth")
            Parser
  (Maybe Double -> Maybe Natural -> HlsImageBasedTrickPlaySettings)
-> Parser (Maybe Double)
-> Parser (Maybe Natural -> HlsImageBasedTrickPlaySettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"thumbnailInterval")
            Parser (Maybe Natural -> HlsImageBasedTrickPlaySettings)
-> Parser (Maybe Natural) -> Parser HlsImageBasedTrickPlaySettings
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"tileHeight")
      )

instance
  Prelude.Hashable
    HlsImageBasedTrickPlaySettings

instance
  Prelude.NFData
    HlsImageBasedTrickPlaySettings

instance Core.ToJSON HlsImageBasedTrickPlaySettings where
  toJSON :: HlsImageBasedTrickPlaySettings -> Value
toJSON HlsImageBasedTrickPlaySettings' {Maybe Double
Maybe Natural
Maybe HlsIntervalCadence
tileHeight :: Maybe Natural
thumbnailInterval :: Maybe Double
thumbnailWidth :: Maybe Natural
intervalCadence :: Maybe HlsIntervalCadence
thumbnailHeight :: Maybe Natural
tileWidth :: Maybe Natural
$sel:tileHeight:HlsImageBasedTrickPlaySettings' :: HlsImageBasedTrickPlaySettings -> Maybe Natural
$sel:thumbnailInterval:HlsImageBasedTrickPlaySettings' :: HlsImageBasedTrickPlaySettings -> Maybe Double
$sel:thumbnailWidth:HlsImageBasedTrickPlaySettings' :: HlsImageBasedTrickPlaySettings -> Maybe Natural
$sel:intervalCadence:HlsImageBasedTrickPlaySettings' :: HlsImageBasedTrickPlaySettings -> Maybe HlsIntervalCadence
$sel:thumbnailHeight:HlsImageBasedTrickPlaySettings' :: HlsImageBasedTrickPlaySettings -> Maybe Natural
$sel:tileWidth:HlsImageBasedTrickPlaySettings' :: HlsImageBasedTrickPlaySettings -> Maybe Natural
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"tileWidth" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
tileWidth,
            (Text
"thumbnailHeight" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
thumbnailHeight,
            (Text
"intervalCadence" Text -> HlsIntervalCadence -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (HlsIntervalCadence -> Pair)
-> Maybe HlsIntervalCadence -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe HlsIntervalCadence
intervalCadence,
            (Text
"thumbnailWidth" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
thumbnailWidth,
            (Text
"thumbnailInterval" Text -> Double -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Double -> Pair) -> Maybe Double -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Double
thumbnailInterval,
            (Text
"tileHeight" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
tileHeight
          ]
      )