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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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
(InputClipping -> InputClipping -> Bool)
-> (InputClipping -> InputClipping -> Bool) -> Eq InputClipping
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]
(Int -> ReadS InputClipping)
-> ReadS [InputClipping]
-> ReadPrec InputClipping
-> ReadPrec [InputClipping]
-> Read 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
(Int -> InputClipping -> ShowS)
-> (InputClipping -> String)
-> ([InputClipping] -> ShowS)
-> Show InputClipping
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. InputClipping -> Rep InputClipping x)
-> (forall x. Rep InputClipping x -> InputClipping)
-> Generic InputClipping
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' :: Maybe Text -> Maybe Text -> InputClipping
InputClipping'
    { $sel:endTimecode:InputClipping' :: Maybe Text
endTimecode = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:startTimecode:InputClipping' :: Maybe Text
startTimecode = Maybe Text
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 :: (Maybe Text -> f (Maybe Text)) -> InputClipping -> f InputClipping
inputClipping_endTimecode = (InputClipping -> Maybe Text)
-> (InputClipping -> Maybe Text -> InputClipping)
-> Lens InputClipping InputClipping (Maybe Text) (Maybe Text)
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 :: (Maybe Text -> f (Maybe Text)) -> InputClipping -> f InputClipping
inputClipping_startTimecode = (InputClipping -> Maybe Text)
-> (InputClipping -> Maybe Text -> InputClipping)
-> Lens InputClipping InputClipping (Maybe Text) (Maybe Text)
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 Core.FromJSON InputClipping where
  parseJSON :: Value -> Parser InputClipping
parseJSON =
    String
-> (Object -> Parser InputClipping)
-> Value
-> Parser InputClipping
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"InputClipping"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> InputClipping
InputClipping'
            (Maybe Text -> Maybe Text -> InputClipping)
-> Parser (Maybe Text) -> Parser (Maybe Text -> InputClipping)
forall (f :: * -> *) a b. Functor 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
"endTimecode")
            Parser (Maybe Text -> InputClipping)
-> Parser (Maybe Text) -> Parser InputClipping
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
"startTimecode")
      )

instance Prelude.Hashable InputClipping

instance Prelude.NFData InputClipping

instance Core.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
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"endTimecode" 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
endTimecode,
            (Text
"startTimecode" 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
startTimecode
          ]
      )