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

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

-- | Tile and thumbnail settings applicable when imageBasedTrickPlay is
-- ADVANCED
--
-- /See:/ 'newCmafImageBasedTrickPlaySettings' smart constructor.
data CmafImageBasedTrickPlaySettings = CmafImageBasedTrickPlaySettings'
  { -- | Number of thumbnails in each row of a tile image. Set a value between 1
    -- and 512.
    CmafImageBasedTrickPlaySettings -> 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.
    CmafImageBasedTrickPlaySettings -> 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.
    CmafImageBasedTrickPlaySettings -> Maybe CmafIntervalCadence
intervalCadence :: Prelude.Maybe CmafIntervalCadence,
    -- | Width of each thumbnail within each tile image, in pixels. Default is
    -- 312. Must be divisible by 8.
    CmafImageBasedTrickPlaySettings -> 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.
    CmafImageBasedTrickPlaySettings -> 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.
    CmafImageBasedTrickPlaySettings -> Maybe Natural
tileHeight :: Prelude.Maybe Prelude.Natural
  }
  deriving (CmafImageBasedTrickPlaySettings
-> CmafImageBasedTrickPlaySettings -> Bool
(CmafImageBasedTrickPlaySettings
 -> CmafImageBasedTrickPlaySettings -> Bool)
-> (CmafImageBasedTrickPlaySettings
    -> CmafImageBasedTrickPlaySettings -> Bool)
-> Eq CmafImageBasedTrickPlaySettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CmafImageBasedTrickPlaySettings
-> CmafImageBasedTrickPlaySettings -> Bool
$c/= :: CmafImageBasedTrickPlaySettings
-> CmafImageBasedTrickPlaySettings -> Bool
== :: CmafImageBasedTrickPlaySettings
-> CmafImageBasedTrickPlaySettings -> Bool
$c== :: CmafImageBasedTrickPlaySettings
-> CmafImageBasedTrickPlaySettings -> Bool
Prelude.Eq, ReadPrec [CmafImageBasedTrickPlaySettings]
ReadPrec CmafImageBasedTrickPlaySettings
Int -> ReadS CmafImageBasedTrickPlaySettings
ReadS [CmafImageBasedTrickPlaySettings]
(Int -> ReadS CmafImageBasedTrickPlaySettings)
-> ReadS [CmafImageBasedTrickPlaySettings]
-> ReadPrec CmafImageBasedTrickPlaySettings
-> ReadPrec [CmafImageBasedTrickPlaySettings]
-> Read CmafImageBasedTrickPlaySettings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CmafImageBasedTrickPlaySettings]
$creadListPrec :: ReadPrec [CmafImageBasedTrickPlaySettings]
readPrec :: ReadPrec CmafImageBasedTrickPlaySettings
$creadPrec :: ReadPrec CmafImageBasedTrickPlaySettings
readList :: ReadS [CmafImageBasedTrickPlaySettings]
$creadList :: ReadS [CmafImageBasedTrickPlaySettings]
readsPrec :: Int -> ReadS CmafImageBasedTrickPlaySettings
$creadsPrec :: Int -> ReadS CmafImageBasedTrickPlaySettings
Prelude.Read, Int -> CmafImageBasedTrickPlaySettings -> ShowS
[CmafImageBasedTrickPlaySettings] -> ShowS
CmafImageBasedTrickPlaySettings -> String
(Int -> CmafImageBasedTrickPlaySettings -> ShowS)
-> (CmafImageBasedTrickPlaySettings -> String)
-> ([CmafImageBasedTrickPlaySettings] -> ShowS)
-> Show CmafImageBasedTrickPlaySettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CmafImageBasedTrickPlaySettings] -> ShowS
$cshowList :: [CmafImageBasedTrickPlaySettings] -> ShowS
show :: CmafImageBasedTrickPlaySettings -> String
$cshow :: CmafImageBasedTrickPlaySettings -> String
showsPrec :: Int -> CmafImageBasedTrickPlaySettings -> ShowS
$cshowsPrec :: Int -> CmafImageBasedTrickPlaySettings -> ShowS
Prelude.Show, (forall x.
 CmafImageBasedTrickPlaySettings
 -> Rep CmafImageBasedTrickPlaySettings x)
-> (forall x.
    Rep CmafImageBasedTrickPlaySettings x
    -> CmafImageBasedTrickPlaySettings)
-> Generic CmafImageBasedTrickPlaySettings
forall x.
Rep CmafImageBasedTrickPlaySettings x
-> CmafImageBasedTrickPlaySettings
forall x.
CmafImageBasedTrickPlaySettings
-> Rep CmafImageBasedTrickPlaySettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CmafImageBasedTrickPlaySettings x
-> CmafImageBasedTrickPlaySettings
$cfrom :: forall x.
CmafImageBasedTrickPlaySettings
-> Rep CmafImageBasedTrickPlaySettings x
Prelude.Generic)

-- |
-- Create a value of 'CmafImageBasedTrickPlaySettings' 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', 'cmafImageBasedTrickPlaySettings_tileWidth' - Number of thumbnails in each row of a tile image. Set a value between 1
-- and 512.
--
-- 'thumbnailHeight', 'cmafImageBasedTrickPlaySettings_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', 'cmafImageBasedTrickPlaySettings_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', 'cmafImageBasedTrickPlaySettings_thumbnailWidth' - Width of each thumbnail within each tile image, in pixels. Default is
-- 312. Must be divisible by 8.
--
-- 'thumbnailInterval', 'cmafImageBasedTrickPlaySettings_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', 'cmafImageBasedTrickPlaySettings_tileHeight' - Number of thumbnails in each column of a tile image. Set a value between
-- 2 and 2048. Must be divisible by 2.
newCmafImageBasedTrickPlaySettings ::
  CmafImageBasedTrickPlaySettings
newCmafImageBasedTrickPlaySettings :: CmafImageBasedTrickPlaySettings
newCmafImageBasedTrickPlaySettings =
  CmafImageBasedTrickPlaySettings' :: Maybe Natural
-> Maybe Natural
-> Maybe CmafIntervalCadence
-> Maybe Natural
-> Maybe Double
-> Maybe Natural
-> CmafImageBasedTrickPlaySettings
CmafImageBasedTrickPlaySettings'
    { $sel:tileWidth:CmafImageBasedTrickPlaySettings' :: Maybe Natural
tileWidth =
        Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:thumbnailHeight:CmafImageBasedTrickPlaySettings' :: Maybe Natural
thumbnailHeight = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:intervalCadence:CmafImageBasedTrickPlaySettings' :: Maybe CmafIntervalCadence
intervalCadence = Maybe CmafIntervalCadence
forall a. Maybe a
Prelude.Nothing,
      $sel:thumbnailWidth:CmafImageBasedTrickPlaySettings' :: Maybe Natural
thumbnailWidth = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:thumbnailInterval:CmafImageBasedTrickPlaySettings' :: Maybe Double
thumbnailInterval = Maybe Double
forall a. Maybe a
Prelude.Nothing,
      $sel:tileHeight:CmafImageBasedTrickPlaySettings' :: 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.
cmafImageBasedTrickPlaySettings_tileWidth :: Lens.Lens' CmafImageBasedTrickPlaySettings (Prelude.Maybe Prelude.Natural)
cmafImageBasedTrickPlaySettings_tileWidth :: (Maybe Natural -> f (Maybe Natural))
-> CmafImageBasedTrickPlaySettings
-> f CmafImageBasedTrickPlaySettings
cmafImageBasedTrickPlaySettings_tileWidth = (CmafImageBasedTrickPlaySettings -> Maybe Natural)
-> (CmafImageBasedTrickPlaySettings
    -> Maybe Natural -> CmafImageBasedTrickPlaySettings)
-> Lens
     CmafImageBasedTrickPlaySettings
     CmafImageBasedTrickPlaySettings
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CmafImageBasedTrickPlaySettings' {Maybe Natural
tileWidth :: Maybe Natural
$sel:tileWidth:CmafImageBasedTrickPlaySettings' :: CmafImageBasedTrickPlaySettings -> Maybe Natural
tileWidth} -> Maybe Natural
tileWidth) (\s :: CmafImageBasedTrickPlaySettings
s@CmafImageBasedTrickPlaySettings' {} Maybe Natural
a -> CmafImageBasedTrickPlaySettings
s {$sel:tileWidth:CmafImageBasedTrickPlaySettings' :: Maybe Natural
tileWidth = Maybe Natural
a} :: CmafImageBasedTrickPlaySettings)

-- | 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.
cmafImageBasedTrickPlaySettings_thumbnailHeight :: Lens.Lens' CmafImageBasedTrickPlaySettings (Prelude.Maybe Prelude.Natural)
cmafImageBasedTrickPlaySettings_thumbnailHeight :: (Maybe Natural -> f (Maybe Natural))
-> CmafImageBasedTrickPlaySettings
-> f CmafImageBasedTrickPlaySettings
cmafImageBasedTrickPlaySettings_thumbnailHeight = (CmafImageBasedTrickPlaySettings -> Maybe Natural)
-> (CmafImageBasedTrickPlaySettings
    -> Maybe Natural -> CmafImageBasedTrickPlaySettings)
-> Lens
     CmafImageBasedTrickPlaySettings
     CmafImageBasedTrickPlaySettings
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CmafImageBasedTrickPlaySettings' {Maybe Natural
thumbnailHeight :: Maybe Natural
$sel:thumbnailHeight:CmafImageBasedTrickPlaySettings' :: CmafImageBasedTrickPlaySettings -> Maybe Natural
thumbnailHeight} -> Maybe Natural
thumbnailHeight) (\s :: CmafImageBasedTrickPlaySettings
s@CmafImageBasedTrickPlaySettings' {} Maybe Natural
a -> CmafImageBasedTrickPlaySettings
s {$sel:thumbnailHeight:CmafImageBasedTrickPlaySettings' :: Maybe Natural
thumbnailHeight = Maybe Natural
a} :: CmafImageBasedTrickPlaySettings)

-- | 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.
cmafImageBasedTrickPlaySettings_intervalCadence :: Lens.Lens' CmafImageBasedTrickPlaySettings (Prelude.Maybe CmafIntervalCadence)
cmafImageBasedTrickPlaySettings_intervalCadence :: (Maybe CmafIntervalCadence -> f (Maybe CmafIntervalCadence))
-> CmafImageBasedTrickPlaySettings
-> f CmafImageBasedTrickPlaySettings
cmafImageBasedTrickPlaySettings_intervalCadence = (CmafImageBasedTrickPlaySettings -> Maybe CmafIntervalCadence)
-> (CmafImageBasedTrickPlaySettings
    -> Maybe CmafIntervalCadence -> CmafImageBasedTrickPlaySettings)
-> Lens
     CmafImageBasedTrickPlaySettings
     CmafImageBasedTrickPlaySettings
     (Maybe CmafIntervalCadence)
     (Maybe CmafIntervalCadence)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CmafImageBasedTrickPlaySettings' {Maybe CmafIntervalCadence
intervalCadence :: Maybe CmafIntervalCadence
$sel:intervalCadence:CmafImageBasedTrickPlaySettings' :: CmafImageBasedTrickPlaySettings -> Maybe CmafIntervalCadence
intervalCadence} -> Maybe CmafIntervalCadence
intervalCadence) (\s :: CmafImageBasedTrickPlaySettings
s@CmafImageBasedTrickPlaySettings' {} Maybe CmafIntervalCadence
a -> CmafImageBasedTrickPlaySettings
s {$sel:intervalCadence:CmafImageBasedTrickPlaySettings' :: Maybe CmafIntervalCadence
intervalCadence = Maybe CmafIntervalCadence
a} :: CmafImageBasedTrickPlaySettings)

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

-- | 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.
cmafImageBasedTrickPlaySettings_thumbnailInterval :: Lens.Lens' CmafImageBasedTrickPlaySettings (Prelude.Maybe Prelude.Double)
cmafImageBasedTrickPlaySettings_thumbnailInterval :: (Maybe Double -> f (Maybe Double))
-> CmafImageBasedTrickPlaySettings
-> f CmafImageBasedTrickPlaySettings
cmafImageBasedTrickPlaySettings_thumbnailInterval = (CmafImageBasedTrickPlaySettings -> Maybe Double)
-> (CmafImageBasedTrickPlaySettings
    -> Maybe Double -> CmafImageBasedTrickPlaySettings)
-> Lens
     CmafImageBasedTrickPlaySettings
     CmafImageBasedTrickPlaySettings
     (Maybe Double)
     (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CmafImageBasedTrickPlaySettings' {Maybe Double
thumbnailInterval :: Maybe Double
$sel:thumbnailInterval:CmafImageBasedTrickPlaySettings' :: CmafImageBasedTrickPlaySettings -> Maybe Double
thumbnailInterval} -> Maybe Double
thumbnailInterval) (\s :: CmafImageBasedTrickPlaySettings
s@CmafImageBasedTrickPlaySettings' {} Maybe Double
a -> CmafImageBasedTrickPlaySettings
s {$sel:thumbnailInterval:CmafImageBasedTrickPlaySettings' :: Maybe Double
thumbnailInterval = Maybe Double
a} :: CmafImageBasedTrickPlaySettings)

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

instance
  Core.FromJSON
    CmafImageBasedTrickPlaySettings
  where
  parseJSON :: Value -> Parser CmafImageBasedTrickPlaySettings
parseJSON =
    String
-> (Object -> Parser CmafImageBasedTrickPlaySettings)
-> Value
-> Parser CmafImageBasedTrickPlaySettings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"CmafImageBasedTrickPlaySettings"
      ( \Object
x ->
          Maybe Natural
-> Maybe Natural
-> Maybe CmafIntervalCadence
-> Maybe Natural
-> Maybe Double
-> Maybe Natural
-> CmafImageBasedTrickPlaySettings
CmafImageBasedTrickPlaySettings'
            (Maybe Natural
 -> Maybe Natural
 -> Maybe CmafIntervalCadence
 -> Maybe Natural
 -> Maybe Double
 -> Maybe Natural
 -> CmafImageBasedTrickPlaySettings)
-> Parser (Maybe Natural)
-> Parser
     (Maybe Natural
      -> Maybe CmafIntervalCadence
      -> Maybe Natural
      -> Maybe Double
      -> Maybe Natural
      -> CmafImageBasedTrickPlaySettings)
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 CmafIntervalCadence
   -> Maybe Natural
   -> Maybe Double
   -> Maybe Natural
   -> CmafImageBasedTrickPlaySettings)
-> Parser (Maybe Natural)
-> Parser
     (Maybe CmafIntervalCadence
      -> Maybe Natural
      -> Maybe Double
      -> Maybe Natural
      -> CmafImageBasedTrickPlaySettings)
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 CmafIntervalCadence
   -> Maybe Natural
   -> Maybe Double
   -> Maybe Natural
   -> CmafImageBasedTrickPlaySettings)
-> Parser (Maybe CmafIntervalCadence)
-> Parser
     (Maybe Natural
      -> Maybe Double
      -> Maybe Natural
      -> CmafImageBasedTrickPlaySettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe CmafIntervalCadence)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"intervalCadence")
            Parser
  (Maybe Natural
   -> Maybe Double
   -> Maybe Natural
   -> CmafImageBasedTrickPlaySettings)
-> Parser (Maybe Natural)
-> Parser
     (Maybe Double -> Maybe Natural -> CmafImageBasedTrickPlaySettings)
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 -> CmafImageBasedTrickPlaySettings)
-> Parser (Maybe Double)
-> Parser (Maybe Natural -> CmafImageBasedTrickPlaySettings)
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 -> CmafImageBasedTrickPlaySettings)
-> Parser (Maybe Natural) -> Parser CmafImageBasedTrickPlaySettings
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
    CmafImageBasedTrickPlaySettings

instance
  Prelude.NFData
    CmafImageBasedTrickPlaySettings

instance Core.ToJSON CmafImageBasedTrickPlaySettings where
  toJSON :: CmafImageBasedTrickPlaySettings -> Value
toJSON CmafImageBasedTrickPlaySettings' {Maybe Double
Maybe Natural
Maybe CmafIntervalCadence
tileHeight :: Maybe Natural
thumbnailInterval :: Maybe Double
thumbnailWidth :: Maybe Natural
intervalCadence :: Maybe CmafIntervalCadence
thumbnailHeight :: Maybe Natural
tileWidth :: Maybe Natural
$sel:tileHeight:CmafImageBasedTrickPlaySettings' :: CmafImageBasedTrickPlaySettings -> Maybe Natural
$sel:thumbnailInterval:CmafImageBasedTrickPlaySettings' :: CmafImageBasedTrickPlaySettings -> Maybe Double
$sel:thumbnailWidth:CmafImageBasedTrickPlaySettings' :: CmafImageBasedTrickPlaySettings -> Maybe Natural
$sel:intervalCadence:CmafImageBasedTrickPlaySettings' :: CmafImageBasedTrickPlaySettings -> Maybe CmafIntervalCadence
$sel:thumbnailHeight:CmafImageBasedTrickPlaySettings' :: CmafImageBasedTrickPlaySettings -> Maybe Natural
$sel:tileWidth:CmafImageBasedTrickPlaySettings' :: CmafImageBasedTrickPlaySettings -> 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 -> CmafIntervalCadence -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (CmafIntervalCadence -> Pair)
-> Maybe CmafIntervalCadence -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CmafIntervalCadence
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
          ]
      )