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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaConvert.Types.MotionImageInsertionFramerate
import Amazonka.MediaConvert.Types.MotionImageInsertionMode
import Amazonka.MediaConvert.Types.MotionImageInsertionOffset
import Amazonka.MediaConvert.Types.MotionImagePlayback
import qualified Amazonka.Prelude as Prelude

-- | Overlay motion graphics on top of your video. The motion graphics that
-- you specify here appear on all outputs in all output groups. For more
-- information, see
-- https:\/\/docs.aws.amazon.com\/mediaconvert\/latest\/ug\/motion-graphic-overlay.html.
--
-- /See:/ 'newMotionImageInserter' smart constructor.
data MotionImageInserter = MotionImageInserter'
  { -- | If your motion graphic asset is a .mov file, keep this setting
    -- unspecified. If your motion graphic asset is a series of .png files,
    -- specify the frame rate of the overlay in frames per second, as a
    -- fraction. For example, specify 24 fps as 24\/1. Make sure that the
    -- number of images in your series matches the frame rate and your intended
    -- overlay duration. For example, if you want a 30-second overlay at 30
    -- fps, you should have 900 .png images. This overlay frame rate doesn\'t
    -- need to match the frame rate of the underlying video.
    MotionImageInserter -> Maybe MotionImageInsertionFramerate
framerate :: Prelude.Maybe MotionImageInsertionFramerate,
    -- | Specify when the motion overlay begins. Use timecode format (HH:MM:SS:FF
    -- or HH:MM:SS;FF). Make sure that the timecode you provide here takes into
    -- account how you have set up your timecode configuration under both job
    -- settings and input settings. The simplest way to do that is to set both
    -- to start at 0. If you need to set up your job to follow timecodes
    -- embedded in your source that don\'t start at zero, make sure that you
    -- specify a start time that is after the first embedded timecode. For more
    -- information, see
    -- https:\/\/docs.aws.amazon.com\/mediaconvert\/latest\/ug\/setting-up-timecode.html
    -- Find job-wide and input timecode configuration settings in your JSON job
    -- settings specification at settings>timecodeConfig>source and
    -- settings>inputs>timecodeSource.
    MotionImageInserter -> Maybe Text
startTime :: Prelude.Maybe Prelude.Text,
    -- | Use Offset to specify the placement of your motion graphic overlay on
    -- the video frame. Specify in pixels, from the upper-left corner of the
    -- frame. If you don\'t specify an offset, the service scales your overlay
    -- to the full size of the frame. Otherwise, the service inserts the
    -- overlay at its native resolution and scales the size up or down with any
    -- video scaling.
    MotionImageInserter -> Maybe MotionImageInsertionOffset
offset :: Prelude.Maybe MotionImageInsertionOffset,
    -- | Specify the .mov file or series of .png files that you want to overlay
    -- on your video. For .png files, provide the file name of the first file
    -- in the series. Make sure that the names of the .png files end with
    -- sequential numbers that specify the order that they are played in. For
    -- example, overlay_000.png, overlay_001.png, overlay_002.png, and so on.
    -- The sequence must start at zero, and each image file name must have the
    -- same number of digits. Pad your initial file names with enough zeros to
    -- complete the sequence. For example, if the first image is overlay_0.png,
    -- there can be only 10 images in the sequence, with the last image being
    -- overlay_9.png. But if the first image is overlay_00.png, there can be
    -- 100 images in the sequence.
    MotionImageInserter -> Maybe Text
input :: Prelude.Maybe Prelude.Text,
    -- | Choose the type of motion graphic asset that you are providing for your
    -- overlay. You can choose either a .mov file or a series of .png files.
    MotionImageInserter -> Maybe MotionImageInsertionMode
insertionMode :: Prelude.Maybe MotionImageInsertionMode,
    -- | Specify whether your motion graphic overlay repeats on a loop or plays
    -- only once.
    MotionImageInserter -> Maybe MotionImagePlayback
playback :: Prelude.Maybe MotionImagePlayback
  }
  deriving (MotionImageInserter -> MotionImageInserter -> Bool
(MotionImageInserter -> MotionImageInserter -> Bool)
-> (MotionImageInserter -> MotionImageInserter -> Bool)
-> Eq MotionImageInserter
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MotionImageInserter -> MotionImageInserter -> Bool
$c/= :: MotionImageInserter -> MotionImageInserter -> Bool
== :: MotionImageInserter -> MotionImageInserter -> Bool
$c== :: MotionImageInserter -> MotionImageInserter -> Bool
Prelude.Eq, ReadPrec [MotionImageInserter]
ReadPrec MotionImageInserter
Int -> ReadS MotionImageInserter
ReadS [MotionImageInserter]
(Int -> ReadS MotionImageInserter)
-> ReadS [MotionImageInserter]
-> ReadPrec MotionImageInserter
-> ReadPrec [MotionImageInserter]
-> Read MotionImageInserter
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MotionImageInserter]
$creadListPrec :: ReadPrec [MotionImageInserter]
readPrec :: ReadPrec MotionImageInserter
$creadPrec :: ReadPrec MotionImageInserter
readList :: ReadS [MotionImageInserter]
$creadList :: ReadS [MotionImageInserter]
readsPrec :: Int -> ReadS MotionImageInserter
$creadsPrec :: Int -> ReadS MotionImageInserter
Prelude.Read, Int -> MotionImageInserter -> ShowS
[MotionImageInserter] -> ShowS
MotionImageInserter -> String
(Int -> MotionImageInserter -> ShowS)
-> (MotionImageInserter -> String)
-> ([MotionImageInserter] -> ShowS)
-> Show MotionImageInserter
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MotionImageInserter] -> ShowS
$cshowList :: [MotionImageInserter] -> ShowS
show :: MotionImageInserter -> String
$cshow :: MotionImageInserter -> String
showsPrec :: Int -> MotionImageInserter -> ShowS
$cshowsPrec :: Int -> MotionImageInserter -> ShowS
Prelude.Show, (forall x. MotionImageInserter -> Rep MotionImageInserter x)
-> (forall x. Rep MotionImageInserter x -> MotionImageInserter)
-> Generic MotionImageInserter
forall x. Rep MotionImageInserter x -> MotionImageInserter
forall x. MotionImageInserter -> Rep MotionImageInserter x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MotionImageInserter x -> MotionImageInserter
$cfrom :: forall x. MotionImageInserter -> Rep MotionImageInserter x
Prelude.Generic)

-- |
-- Create a value of 'MotionImageInserter' 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:
--
-- 'framerate', 'motionImageInserter_framerate' - If your motion graphic asset is a .mov file, keep this setting
-- unspecified. If your motion graphic asset is a series of .png files,
-- specify the frame rate of the overlay in frames per second, as a
-- fraction. For example, specify 24 fps as 24\/1. Make sure that the
-- number of images in your series matches the frame rate and your intended
-- overlay duration. For example, if you want a 30-second overlay at 30
-- fps, you should have 900 .png images. This overlay frame rate doesn\'t
-- need to match the frame rate of the underlying video.
--
-- 'startTime', 'motionImageInserter_startTime' - Specify when the motion overlay begins. Use timecode format (HH:MM:SS:FF
-- or HH:MM:SS;FF). Make sure that the timecode you provide here takes into
-- account how you have set up your timecode configuration under both job
-- settings and input settings. The simplest way to do that is to set both
-- to start at 0. If you need to set up your job to follow timecodes
-- embedded in your source that don\'t start at zero, make sure that you
-- specify a start time that is after the first embedded timecode. For more
-- information, see
-- https:\/\/docs.aws.amazon.com\/mediaconvert\/latest\/ug\/setting-up-timecode.html
-- Find job-wide and input timecode configuration settings in your JSON job
-- settings specification at settings>timecodeConfig>source and
-- settings>inputs>timecodeSource.
--
-- 'offset', 'motionImageInserter_offset' - Use Offset to specify the placement of your motion graphic overlay on
-- the video frame. Specify in pixels, from the upper-left corner of the
-- frame. If you don\'t specify an offset, the service scales your overlay
-- to the full size of the frame. Otherwise, the service inserts the
-- overlay at its native resolution and scales the size up or down with any
-- video scaling.
--
-- 'input', 'motionImageInserter_input' - Specify the .mov file or series of .png files that you want to overlay
-- on your video. For .png files, provide the file name of the first file
-- in the series. Make sure that the names of the .png files end with
-- sequential numbers that specify the order that they are played in. For
-- example, overlay_000.png, overlay_001.png, overlay_002.png, and so on.
-- The sequence must start at zero, and each image file name must have the
-- same number of digits. Pad your initial file names with enough zeros to
-- complete the sequence. For example, if the first image is overlay_0.png,
-- there can be only 10 images in the sequence, with the last image being
-- overlay_9.png. But if the first image is overlay_00.png, there can be
-- 100 images in the sequence.
--
-- 'insertionMode', 'motionImageInserter_insertionMode' - Choose the type of motion graphic asset that you are providing for your
-- overlay. You can choose either a .mov file or a series of .png files.
--
-- 'playback', 'motionImageInserter_playback' - Specify whether your motion graphic overlay repeats on a loop or plays
-- only once.
newMotionImageInserter ::
  MotionImageInserter
newMotionImageInserter :: MotionImageInserter
newMotionImageInserter =
  MotionImageInserter' :: Maybe MotionImageInsertionFramerate
-> Maybe Text
-> Maybe MotionImageInsertionOffset
-> Maybe Text
-> Maybe MotionImageInsertionMode
-> Maybe MotionImagePlayback
-> MotionImageInserter
MotionImageInserter'
    { $sel:framerate:MotionImageInserter' :: Maybe MotionImageInsertionFramerate
framerate = Maybe MotionImageInsertionFramerate
forall a. Maybe a
Prelude.Nothing,
      $sel:startTime:MotionImageInserter' :: Maybe Text
startTime = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:offset:MotionImageInserter' :: Maybe MotionImageInsertionOffset
offset = Maybe MotionImageInsertionOffset
forall a. Maybe a
Prelude.Nothing,
      $sel:input:MotionImageInserter' :: Maybe Text
input = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:insertionMode:MotionImageInserter' :: Maybe MotionImageInsertionMode
insertionMode = Maybe MotionImageInsertionMode
forall a. Maybe a
Prelude.Nothing,
      $sel:playback:MotionImageInserter' :: Maybe MotionImagePlayback
playback = Maybe MotionImagePlayback
forall a. Maybe a
Prelude.Nothing
    }

-- | If your motion graphic asset is a .mov file, keep this setting
-- unspecified. If your motion graphic asset is a series of .png files,
-- specify the frame rate of the overlay in frames per second, as a
-- fraction. For example, specify 24 fps as 24\/1. Make sure that the
-- number of images in your series matches the frame rate and your intended
-- overlay duration. For example, if you want a 30-second overlay at 30
-- fps, you should have 900 .png images. This overlay frame rate doesn\'t
-- need to match the frame rate of the underlying video.
motionImageInserter_framerate :: Lens.Lens' MotionImageInserter (Prelude.Maybe MotionImageInsertionFramerate)
motionImageInserter_framerate :: (Maybe MotionImageInsertionFramerate
 -> f (Maybe MotionImageInsertionFramerate))
-> MotionImageInserter -> f MotionImageInserter
motionImageInserter_framerate = (MotionImageInserter -> Maybe MotionImageInsertionFramerate)
-> (MotionImageInserter
    -> Maybe MotionImageInsertionFramerate -> MotionImageInserter)
-> Lens
     MotionImageInserter
     MotionImageInserter
     (Maybe MotionImageInsertionFramerate)
     (Maybe MotionImageInsertionFramerate)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MotionImageInserter' {Maybe MotionImageInsertionFramerate
framerate :: Maybe MotionImageInsertionFramerate
$sel:framerate:MotionImageInserter' :: MotionImageInserter -> Maybe MotionImageInsertionFramerate
framerate} -> Maybe MotionImageInsertionFramerate
framerate) (\s :: MotionImageInserter
s@MotionImageInserter' {} Maybe MotionImageInsertionFramerate
a -> MotionImageInserter
s {$sel:framerate:MotionImageInserter' :: Maybe MotionImageInsertionFramerate
framerate = Maybe MotionImageInsertionFramerate
a} :: MotionImageInserter)

-- | Specify when the motion overlay begins. Use timecode format (HH:MM:SS:FF
-- or HH:MM:SS;FF). Make sure that the timecode you provide here takes into
-- account how you have set up your timecode configuration under both job
-- settings and input settings. The simplest way to do that is to set both
-- to start at 0. If you need to set up your job to follow timecodes
-- embedded in your source that don\'t start at zero, make sure that you
-- specify a start time that is after the first embedded timecode. For more
-- information, see
-- https:\/\/docs.aws.amazon.com\/mediaconvert\/latest\/ug\/setting-up-timecode.html
-- Find job-wide and input timecode configuration settings in your JSON job
-- settings specification at settings>timecodeConfig>source and
-- settings>inputs>timecodeSource.
motionImageInserter_startTime :: Lens.Lens' MotionImageInserter (Prelude.Maybe Prelude.Text)
motionImageInserter_startTime :: (Maybe Text -> f (Maybe Text))
-> MotionImageInserter -> f MotionImageInserter
motionImageInserter_startTime = (MotionImageInserter -> Maybe Text)
-> (MotionImageInserter -> Maybe Text -> MotionImageInserter)
-> Lens
     MotionImageInserter MotionImageInserter (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MotionImageInserter' {Maybe Text
startTime :: Maybe Text
$sel:startTime:MotionImageInserter' :: MotionImageInserter -> Maybe Text
startTime} -> Maybe Text
startTime) (\s :: MotionImageInserter
s@MotionImageInserter' {} Maybe Text
a -> MotionImageInserter
s {$sel:startTime:MotionImageInserter' :: Maybe Text
startTime = Maybe Text
a} :: MotionImageInserter)

-- | Use Offset to specify the placement of your motion graphic overlay on
-- the video frame. Specify in pixels, from the upper-left corner of the
-- frame. If you don\'t specify an offset, the service scales your overlay
-- to the full size of the frame. Otherwise, the service inserts the
-- overlay at its native resolution and scales the size up or down with any
-- video scaling.
motionImageInserter_offset :: Lens.Lens' MotionImageInserter (Prelude.Maybe MotionImageInsertionOffset)
motionImageInserter_offset :: (Maybe MotionImageInsertionOffset
 -> f (Maybe MotionImageInsertionOffset))
-> MotionImageInserter -> f MotionImageInserter
motionImageInserter_offset = (MotionImageInserter -> Maybe MotionImageInsertionOffset)
-> (MotionImageInserter
    -> Maybe MotionImageInsertionOffset -> MotionImageInserter)
-> Lens
     MotionImageInserter
     MotionImageInserter
     (Maybe MotionImageInsertionOffset)
     (Maybe MotionImageInsertionOffset)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MotionImageInserter' {Maybe MotionImageInsertionOffset
offset :: Maybe MotionImageInsertionOffset
$sel:offset:MotionImageInserter' :: MotionImageInserter -> Maybe MotionImageInsertionOffset
offset} -> Maybe MotionImageInsertionOffset
offset) (\s :: MotionImageInserter
s@MotionImageInserter' {} Maybe MotionImageInsertionOffset
a -> MotionImageInserter
s {$sel:offset:MotionImageInserter' :: Maybe MotionImageInsertionOffset
offset = Maybe MotionImageInsertionOffset
a} :: MotionImageInserter)

-- | Specify the .mov file or series of .png files that you want to overlay
-- on your video. For .png files, provide the file name of the first file
-- in the series. Make sure that the names of the .png files end with
-- sequential numbers that specify the order that they are played in. For
-- example, overlay_000.png, overlay_001.png, overlay_002.png, and so on.
-- The sequence must start at zero, and each image file name must have the
-- same number of digits. Pad your initial file names with enough zeros to
-- complete the sequence. For example, if the first image is overlay_0.png,
-- there can be only 10 images in the sequence, with the last image being
-- overlay_9.png. But if the first image is overlay_00.png, there can be
-- 100 images in the sequence.
motionImageInserter_input :: Lens.Lens' MotionImageInserter (Prelude.Maybe Prelude.Text)
motionImageInserter_input :: (Maybe Text -> f (Maybe Text))
-> MotionImageInserter -> f MotionImageInserter
motionImageInserter_input = (MotionImageInserter -> Maybe Text)
-> (MotionImageInserter -> Maybe Text -> MotionImageInserter)
-> Lens
     MotionImageInserter MotionImageInserter (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MotionImageInserter' {Maybe Text
input :: Maybe Text
$sel:input:MotionImageInserter' :: MotionImageInserter -> Maybe Text
input} -> Maybe Text
input) (\s :: MotionImageInserter
s@MotionImageInserter' {} Maybe Text
a -> MotionImageInserter
s {$sel:input:MotionImageInserter' :: Maybe Text
input = Maybe Text
a} :: MotionImageInserter)

-- | Choose the type of motion graphic asset that you are providing for your
-- overlay. You can choose either a .mov file or a series of .png files.
motionImageInserter_insertionMode :: Lens.Lens' MotionImageInserter (Prelude.Maybe MotionImageInsertionMode)
motionImageInserter_insertionMode :: (Maybe MotionImageInsertionMode
 -> f (Maybe MotionImageInsertionMode))
-> MotionImageInserter -> f MotionImageInserter
motionImageInserter_insertionMode = (MotionImageInserter -> Maybe MotionImageInsertionMode)
-> (MotionImageInserter
    -> Maybe MotionImageInsertionMode -> MotionImageInserter)
-> Lens
     MotionImageInserter
     MotionImageInserter
     (Maybe MotionImageInsertionMode)
     (Maybe MotionImageInsertionMode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MotionImageInserter' {Maybe MotionImageInsertionMode
insertionMode :: Maybe MotionImageInsertionMode
$sel:insertionMode:MotionImageInserter' :: MotionImageInserter -> Maybe MotionImageInsertionMode
insertionMode} -> Maybe MotionImageInsertionMode
insertionMode) (\s :: MotionImageInserter
s@MotionImageInserter' {} Maybe MotionImageInsertionMode
a -> MotionImageInserter
s {$sel:insertionMode:MotionImageInserter' :: Maybe MotionImageInsertionMode
insertionMode = Maybe MotionImageInsertionMode
a} :: MotionImageInserter)

-- | Specify whether your motion graphic overlay repeats on a loop or plays
-- only once.
motionImageInserter_playback :: Lens.Lens' MotionImageInserter (Prelude.Maybe MotionImagePlayback)
motionImageInserter_playback :: (Maybe MotionImagePlayback -> f (Maybe MotionImagePlayback))
-> MotionImageInserter -> f MotionImageInserter
motionImageInserter_playback = (MotionImageInserter -> Maybe MotionImagePlayback)
-> (MotionImageInserter
    -> Maybe MotionImagePlayback -> MotionImageInserter)
-> Lens
     MotionImageInserter
     MotionImageInserter
     (Maybe MotionImagePlayback)
     (Maybe MotionImagePlayback)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MotionImageInserter' {Maybe MotionImagePlayback
playback :: Maybe MotionImagePlayback
$sel:playback:MotionImageInserter' :: MotionImageInserter -> Maybe MotionImagePlayback
playback} -> Maybe MotionImagePlayback
playback) (\s :: MotionImageInserter
s@MotionImageInserter' {} Maybe MotionImagePlayback
a -> MotionImageInserter
s {$sel:playback:MotionImageInserter' :: Maybe MotionImagePlayback
playback = Maybe MotionImagePlayback
a} :: MotionImageInserter)

instance Core.FromJSON MotionImageInserter where
  parseJSON :: Value -> Parser MotionImageInserter
parseJSON =
    String
-> (Object -> Parser MotionImageInserter)
-> Value
-> Parser MotionImageInserter
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"MotionImageInserter"
      ( \Object
x ->
          Maybe MotionImageInsertionFramerate
-> Maybe Text
-> Maybe MotionImageInsertionOffset
-> Maybe Text
-> Maybe MotionImageInsertionMode
-> Maybe MotionImagePlayback
-> MotionImageInserter
MotionImageInserter'
            (Maybe MotionImageInsertionFramerate
 -> Maybe Text
 -> Maybe MotionImageInsertionOffset
 -> Maybe Text
 -> Maybe MotionImageInsertionMode
 -> Maybe MotionImagePlayback
 -> MotionImageInserter)
-> Parser (Maybe MotionImageInsertionFramerate)
-> Parser
     (Maybe Text
      -> Maybe MotionImageInsertionOffset
      -> Maybe Text
      -> Maybe MotionImageInsertionMode
      -> Maybe MotionImagePlayback
      -> MotionImageInserter)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe MotionImageInsertionFramerate)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"framerate")
            Parser
  (Maybe Text
   -> Maybe MotionImageInsertionOffset
   -> Maybe Text
   -> Maybe MotionImageInsertionMode
   -> Maybe MotionImagePlayback
   -> MotionImageInserter)
-> Parser (Maybe Text)
-> Parser
     (Maybe MotionImageInsertionOffset
      -> Maybe Text
      -> Maybe MotionImageInsertionMode
      -> Maybe MotionImagePlayback
      -> MotionImageInserter)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"startTime")
            Parser
  (Maybe MotionImageInsertionOffset
   -> Maybe Text
   -> Maybe MotionImageInsertionMode
   -> Maybe MotionImagePlayback
   -> MotionImageInserter)
-> Parser (Maybe MotionImageInsertionOffset)
-> Parser
     (Maybe Text
      -> Maybe MotionImageInsertionMode
      -> Maybe MotionImagePlayback
      -> MotionImageInserter)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe MotionImageInsertionOffset)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"offset")
            Parser
  (Maybe Text
   -> Maybe MotionImageInsertionMode
   -> Maybe MotionImagePlayback
   -> MotionImageInserter)
-> Parser (Maybe Text)
-> Parser
     (Maybe MotionImageInsertionMode
      -> Maybe MotionImagePlayback -> MotionImageInserter)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"input")
            Parser
  (Maybe MotionImageInsertionMode
   -> Maybe MotionImagePlayback -> MotionImageInserter)
-> Parser (Maybe MotionImageInsertionMode)
-> Parser (Maybe MotionImagePlayback -> MotionImageInserter)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe MotionImageInsertionMode)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"insertionMode")
            Parser (Maybe MotionImagePlayback -> MotionImageInserter)
-> Parser (Maybe MotionImagePlayback) -> Parser MotionImageInserter
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe MotionImagePlayback)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"playback")
      )

instance Prelude.Hashable MotionImageInserter

instance Prelude.NFData MotionImageInserter

instance Core.ToJSON MotionImageInserter where
  toJSON :: MotionImageInserter -> Value
toJSON MotionImageInserter' {Maybe Text
Maybe MotionImageInsertionFramerate
Maybe MotionImageInsertionMode
Maybe MotionImageInsertionOffset
Maybe MotionImagePlayback
playback :: Maybe MotionImagePlayback
insertionMode :: Maybe MotionImageInsertionMode
input :: Maybe Text
offset :: Maybe MotionImageInsertionOffset
startTime :: Maybe Text
framerate :: Maybe MotionImageInsertionFramerate
$sel:playback:MotionImageInserter' :: MotionImageInserter -> Maybe MotionImagePlayback
$sel:insertionMode:MotionImageInserter' :: MotionImageInserter -> Maybe MotionImageInsertionMode
$sel:input:MotionImageInserter' :: MotionImageInserter -> Maybe Text
$sel:offset:MotionImageInserter' :: MotionImageInserter -> Maybe MotionImageInsertionOffset
$sel:startTime:MotionImageInserter' :: MotionImageInserter -> Maybe Text
$sel:framerate:MotionImageInserter' :: MotionImageInserter -> Maybe MotionImageInsertionFramerate
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"framerate" Text -> MotionImageInsertionFramerate -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (MotionImageInsertionFramerate -> Pair)
-> Maybe MotionImageInsertionFramerate -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe MotionImageInsertionFramerate
framerate,
            (Text
"startTime" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
startTime,
            (Text
"offset" Text -> MotionImageInsertionOffset -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (MotionImageInsertionOffset -> Pair)
-> Maybe MotionImageInsertionOffset -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe MotionImageInsertionOffset
offset,
            (Text
"input" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
input,
            (Text
"insertionMode" Text -> MotionImageInsertionMode -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (MotionImageInsertionMode -> Pair)
-> Maybe MotionImageInsertionMode -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe MotionImageInsertionMode
insertionMode,
            (Text
"playback" Text -> MotionImagePlayback -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (MotionImagePlayback -> Pair)
-> Maybe MotionImagePlayback -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe MotionImagePlayback
playback
          ]
      )