{-# 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.InputClipping
-- 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.MediaConvert.Types.InputClipping where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | To transcode only portions of your input, include one input clip for
-- each part of your input that you want in your output. All input clips
-- that you specify will be included in every output of the job. For more
-- information, see
-- https:\/\/docs.aws.amazon.com\/mediaconvert\/latest\/ug\/assembling-multiple-inputs-and-input-clips.html.
--
-- /See:/ 'newInputClipping' smart constructor.
data InputClipping = InputClipping'
  { -- | Set End timecode (EndTimecode) to the end of the portion of the input
    -- you are clipping. The frame corresponding to the End timecode value is
    -- included in the clip. Start timecode or End timecode may be left blank,
    -- but not both. Use the format HH:MM:SS:FF or HH:MM:SS;FF, where HH is the
    -- hour, MM is the minute, SS is the second, and FF is the frame number.
    -- When choosing this value, take into account your setting for timecode
    -- source under input settings (InputTimecodeSource). For example, if you
    -- have embedded timecodes that start at 01:00:00:00 and you want your clip
    -- to end six minutes into the video, use 01:06:00:00.
    InputClipping -> Maybe Text
endTimecode :: Prelude.Maybe Prelude.Text,
    -- | Set Start timecode (StartTimecode) to the beginning of the portion of
    -- the input you are clipping. The frame corresponding to the Start
    -- timecode value is included in the clip. Start timecode or End timecode
    -- may be left blank, but not both. Use the format HH:MM:SS:FF or
    -- HH:MM:SS;FF, where HH is the hour, MM is the minute, SS is the second,
    -- and FF is the frame number. When choosing this value, take into account
    -- your setting for Input timecode source. For example, if you have
    -- embedded timecodes that start at 01:00:00:00 and you want your clip to
    -- begin five minutes into the video, use 01:05:00:00.
    InputClipping -> Maybe Text
startTimecode :: Prelude.Maybe Prelude.Text
  }
  deriving (InputClipping -> InputClipping -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InputClipping -> InputClipping -> Bool
$c/= :: InputClipping -> InputClipping -> Bool
== :: InputClipping -> InputClipping -> Bool
$c== :: InputClipping -> InputClipping -> Bool
Prelude.Eq, ReadPrec [InputClipping]
ReadPrec InputClipping
Int -> ReadS InputClipping
ReadS [InputClipping]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InputClipping]
$creadListPrec :: ReadPrec [InputClipping]
readPrec :: ReadPrec InputClipping
$creadPrec :: ReadPrec InputClipping
readList :: ReadS [InputClipping]
$creadList :: ReadS [InputClipping]
readsPrec :: Int -> ReadS InputClipping
$creadsPrec :: Int -> ReadS InputClipping
Prelude.Read, Int -> InputClipping -> ShowS
[InputClipping] -> ShowS
InputClipping -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InputClipping] -> ShowS
$cshowList :: [InputClipping] -> ShowS
show :: InputClipping -> String
$cshow :: InputClipping -> String
showsPrec :: Int -> InputClipping -> ShowS
$cshowsPrec :: Int -> InputClipping -> ShowS
Prelude.Show, forall x. Rep InputClipping x -> InputClipping
forall x. InputClipping -> Rep InputClipping x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InputClipping x -> InputClipping
$cfrom :: forall x. InputClipping -> Rep InputClipping x
Prelude.Generic)

-- |
-- Create a value of 'InputClipping' 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:
--
-- 'endTimecode', 'inputClipping_endTimecode' - Set End timecode (EndTimecode) to the end of the portion of the input
-- you are clipping. The frame corresponding to the End timecode value is
-- included in the clip. Start timecode or End timecode may be left blank,
-- but not both. Use the format HH:MM:SS:FF or HH:MM:SS;FF, where HH is the
-- hour, MM is the minute, SS is the second, and FF is the frame number.
-- When choosing this value, take into account your setting for timecode
-- source under input settings (InputTimecodeSource). For example, if you
-- have embedded timecodes that start at 01:00:00:00 and you want your clip
-- to end six minutes into the video, use 01:06:00:00.
--
-- 'startTimecode', 'inputClipping_startTimecode' - Set Start timecode (StartTimecode) to the beginning of the portion of
-- the input you are clipping. The frame corresponding to the Start
-- timecode value is included in the clip. Start timecode or End timecode
-- may be left blank, but not both. Use the format HH:MM:SS:FF or
-- HH:MM:SS;FF, where HH is the hour, MM is the minute, SS is the second,
-- and FF is the frame number. When choosing this value, take into account
-- your setting for Input timecode source. For example, if you have
-- embedded timecodes that start at 01:00:00:00 and you want your clip to
-- begin five minutes into the video, use 01:05:00:00.
newInputClipping ::
  InputClipping
newInputClipping :: InputClipping
newInputClipping =
  InputClipping'
    { $sel:endTimecode:InputClipping' :: Maybe Text
endTimecode = forall a. Maybe a
Prelude.Nothing,
      $sel:startTimecode:InputClipping' :: Maybe Text
startTimecode = forall a. Maybe a
Prelude.Nothing
    }

-- | Set End timecode (EndTimecode) to the end of the portion of the input
-- you are clipping. The frame corresponding to the End timecode value is
-- included in the clip. Start timecode or End timecode may be left blank,
-- but not both. Use the format HH:MM:SS:FF or HH:MM:SS;FF, where HH is the
-- hour, MM is the minute, SS is the second, and FF is the frame number.
-- When choosing this value, take into account your setting for timecode
-- source under input settings (InputTimecodeSource). For example, if you
-- have embedded timecodes that start at 01:00:00:00 and you want your clip
-- to end six minutes into the video, use 01:06:00:00.
inputClipping_endTimecode :: Lens.Lens' InputClipping (Prelude.Maybe Prelude.Text)
inputClipping_endTimecode :: Lens' InputClipping (Maybe Text)
inputClipping_endTimecode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputClipping' {Maybe Text
endTimecode :: Maybe Text
$sel:endTimecode:InputClipping' :: InputClipping -> Maybe Text
endTimecode} -> Maybe Text
endTimecode) (\s :: InputClipping
s@InputClipping' {} Maybe Text
a -> InputClipping
s {$sel:endTimecode:InputClipping' :: Maybe Text
endTimecode = Maybe Text
a} :: InputClipping)

-- | Set Start timecode (StartTimecode) to the beginning of the portion of
-- the input you are clipping. The frame corresponding to the Start
-- timecode value is included in the clip. Start timecode or End timecode
-- may be left blank, but not both. Use the format HH:MM:SS:FF or
-- HH:MM:SS;FF, where HH is the hour, MM is the minute, SS is the second,
-- and FF is the frame number. When choosing this value, take into account
-- your setting for Input timecode source. For example, if you have
-- embedded timecodes that start at 01:00:00:00 and you want your clip to
-- begin five minutes into the video, use 01:05:00:00.
inputClipping_startTimecode :: Lens.Lens' InputClipping (Prelude.Maybe Prelude.Text)
inputClipping_startTimecode :: Lens' InputClipping (Maybe Text)
inputClipping_startTimecode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputClipping' {Maybe Text
startTimecode :: Maybe Text
$sel:startTimecode:InputClipping' :: InputClipping -> Maybe Text
startTimecode} -> Maybe Text
startTimecode) (\s :: InputClipping
s@InputClipping' {} Maybe Text
a -> InputClipping
s {$sel:startTimecode:InputClipping' :: Maybe Text
startTimecode = Maybe Text
a} :: InputClipping)

instance Data.FromJSON InputClipping where
  parseJSON :: Value -> Parser InputClipping
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"InputClipping"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> InputClipping
InputClipping'
            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
"endTimecode")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"startTimecode")
      )

instance Prelude.Hashable InputClipping where
  hashWithSalt :: Int -> InputClipping -> Int
hashWithSalt Int
_salt InputClipping' {Maybe Text
startTimecode :: Maybe Text
endTimecode :: Maybe Text
$sel:startTimecode:InputClipping' :: InputClipping -> Maybe Text
$sel:endTimecode:InputClipping' :: InputClipping -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
endTimecode
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
startTimecode

instance Prelude.NFData InputClipping where
  rnf :: InputClipping -> ()
rnf InputClipping' {Maybe Text
startTimecode :: Maybe Text
endTimecode :: Maybe Text
$sel:startTimecode:InputClipping' :: InputClipping -> Maybe Text
$sel:endTimecode:InputClipping' :: InputClipping -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
endTimecode
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
startTimecode

instance Data.ToJSON InputClipping where
  toJSON :: InputClipping -> Value
toJSON InputClipping' {Maybe Text
startTimecode :: Maybe Text
endTimecode :: Maybe Text
$sel:startTimecode:InputClipping' :: InputClipping -> Maybe Text
$sel:endTimecode:InputClipping' :: InputClipping -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"endTimecode" 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
endTimecode,
            (Key
"startTimecode" 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
startTimecode
          ]
      )