{-# 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 #-}
module Amazonka.MediaLive.Types.InputClippingSettings where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MediaLive.Types.InputTimecodeSource
import Amazonka.MediaLive.Types.StartTimecode
import Amazonka.MediaLive.Types.StopTimecode
import qualified Amazonka.Prelude as Prelude
data InputClippingSettings = InputClippingSettings'
{
InputClippingSettings -> Maybe StartTimecode
startTimecode :: Prelude.Maybe StartTimecode,
InputClippingSettings -> Maybe StopTimecode
stopTimecode :: Prelude.Maybe StopTimecode,
InputClippingSettings -> InputTimecodeSource
inputTimecodeSource :: InputTimecodeSource
}
deriving (InputClippingSettings -> InputClippingSettings -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InputClippingSettings -> InputClippingSettings -> Bool
$c/= :: InputClippingSettings -> InputClippingSettings -> Bool
== :: InputClippingSettings -> InputClippingSettings -> Bool
$c== :: InputClippingSettings -> InputClippingSettings -> Bool
Prelude.Eq, ReadPrec [InputClippingSettings]
ReadPrec InputClippingSettings
Int -> ReadS InputClippingSettings
ReadS [InputClippingSettings]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InputClippingSettings]
$creadListPrec :: ReadPrec [InputClippingSettings]
readPrec :: ReadPrec InputClippingSettings
$creadPrec :: ReadPrec InputClippingSettings
readList :: ReadS [InputClippingSettings]
$creadList :: ReadS [InputClippingSettings]
readsPrec :: Int -> ReadS InputClippingSettings
$creadsPrec :: Int -> ReadS InputClippingSettings
Prelude.Read, Int -> InputClippingSettings -> ShowS
[InputClippingSettings] -> ShowS
InputClippingSettings -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InputClippingSettings] -> ShowS
$cshowList :: [InputClippingSettings] -> ShowS
show :: InputClippingSettings -> String
$cshow :: InputClippingSettings -> String
showsPrec :: Int -> InputClippingSettings -> ShowS
$cshowsPrec :: Int -> InputClippingSettings -> ShowS
Prelude.Show, forall x. Rep InputClippingSettings x -> InputClippingSettings
forall x. InputClippingSettings -> Rep InputClippingSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InputClippingSettings x -> InputClippingSettings
$cfrom :: forall x. InputClippingSettings -> Rep InputClippingSettings x
Prelude.Generic)
newInputClippingSettings ::
InputTimecodeSource ->
InputClippingSettings
newInputClippingSettings :: InputTimecodeSource -> InputClippingSettings
newInputClippingSettings InputTimecodeSource
pInputTimecodeSource_ =
InputClippingSettings'
{ $sel:startTimecode:InputClippingSettings' :: Maybe StartTimecode
startTimecode =
forall a. Maybe a
Prelude.Nothing,
$sel:stopTimecode:InputClippingSettings' :: Maybe StopTimecode
stopTimecode = forall a. Maybe a
Prelude.Nothing,
$sel:inputTimecodeSource:InputClippingSettings' :: InputTimecodeSource
inputTimecodeSource = InputTimecodeSource
pInputTimecodeSource_
}
inputClippingSettings_startTimecode :: Lens.Lens' InputClippingSettings (Prelude.Maybe StartTimecode)
inputClippingSettings_startTimecode :: Lens' InputClippingSettings (Maybe StartTimecode)
inputClippingSettings_startTimecode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputClippingSettings' {Maybe StartTimecode
startTimecode :: Maybe StartTimecode
$sel:startTimecode:InputClippingSettings' :: InputClippingSettings -> Maybe StartTimecode
startTimecode} -> Maybe StartTimecode
startTimecode) (\s :: InputClippingSettings
s@InputClippingSettings' {} Maybe StartTimecode
a -> InputClippingSettings
s {$sel:startTimecode:InputClippingSettings' :: Maybe StartTimecode
startTimecode = Maybe StartTimecode
a} :: InputClippingSettings)
inputClippingSettings_stopTimecode :: Lens.Lens' InputClippingSettings (Prelude.Maybe StopTimecode)
inputClippingSettings_stopTimecode :: Lens' InputClippingSettings (Maybe StopTimecode)
inputClippingSettings_stopTimecode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputClippingSettings' {Maybe StopTimecode
stopTimecode :: Maybe StopTimecode
$sel:stopTimecode:InputClippingSettings' :: InputClippingSettings -> Maybe StopTimecode
stopTimecode} -> Maybe StopTimecode
stopTimecode) (\s :: InputClippingSettings
s@InputClippingSettings' {} Maybe StopTimecode
a -> InputClippingSettings
s {$sel:stopTimecode:InputClippingSettings' :: Maybe StopTimecode
stopTimecode = Maybe StopTimecode
a} :: InputClippingSettings)
inputClippingSettings_inputTimecodeSource :: Lens.Lens' InputClippingSettings InputTimecodeSource
inputClippingSettings_inputTimecodeSource :: Lens' InputClippingSettings InputTimecodeSource
inputClippingSettings_inputTimecodeSource = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputClippingSettings' {InputTimecodeSource
inputTimecodeSource :: InputTimecodeSource
$sel:inputTimecodeSource:InputClippingSettings' :: InputClippingSettings -> InputTimecodeSource
inputTimecodeSource} -> InputTimecodeSource
inputTimecodeSource) (\s :: InputClippingSettings
s@InputClippingSettings' {} InputTimecodeSource
a -> InputClippingSettings
s {$sel:inputTimecodeSource:InputClippingSettings' :: InputTimecodeSource
inputTimecodeSource = InputTimecodeSource
a} :: InputClippingSettings)
instance Data.FromJSON InputClippingSettings where
parseJSON :: Value -> Parser InputClippingSettings
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"InputClippingSettings"
( \Object
x ->
Maybe StartTimecode
-> Maybe StopTimecode
-> InputTimecodeSource
-> InputClippingSettings
InputClippingSettings'
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
"startTimecode")
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
"stopTimecode")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"inputTimecodeSource")
)
instance Prelude.Hashable InputClippingSettings where
hashWithSalt :: Int -> InputClippingSettings -> Int
hashWithSalt Int
_salt InputClippingSettings' {Maybe StartTimecode
Maybe StopTimecode
InputTimecodeSource
inputTimecodeSource :: InputTimecodeSource
stopTimecode :: Maybe StopTimecode
startTimecode :: Maybe StartTimecode
$sel:inputTimecodeSource:InputClippingSettings' :: InputClippingSettings -> InputTimecodeSource
$sel:stopTimecode:InputClippingSettings' :: InputClippingSettings -> Maybe StopTimecode
$sel:startTimecode:InputClippingSettings' :: InputClippingSettings -> Maybe StartTimecode
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe StartTimecode
startTimecode
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe StopTimecode
stopTimecode
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` InputTimecodeSource
inputTimecodeSource
instance Prelude.NFData InputClippingSettings where
rnf :: InputClippingSettings -> ()
rnf InputClippingSettings' {Maybe StartTimecode
Maybe StopTimecode
InputTimecodeSource
inputTimecodeSource :: InputTimecodeSource
stopTimecode :: Maybe StopTimecode
startTimecode :: Maybe StartTimecode
$sel:inputTimecodeSource:InputClippingSettings' :: InputClippingSettings -> InputTimecodeSource
$sel:stopTimecode:InputClippingSettings' :: InputClippingSettings -> Maybe StopTimecode
$sel:startTimecode:InputClippingSettings' :: InputClippingSettings -> Maybe StartTimecode
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe StartTimecode
startTimecode
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe StopTimecode
stopTimecode
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf InputTimecodeSource
inputTimecodeSource
instance Data.ToJSON InputClippingSettings where
toJSON :: InputClippingSettings -> Value
toJSON InputClippingSettings' {Maybe StartTimecode
Maybe StopTimecode
InputTimecodeSource
inputTimecodeSource :: InputTimecodeSource
stopTimecode :: Maybe StopTimecode
startTimecode :: Maybe StartTimecode
$sel:inputTimecodeSource:InputClippingSettings' :: InputClippingSettings -> InputTimecodeSource
$sel:stopTimecode:InputClippingSettings' :: InputClippingSettings -> Maybe StopTimecode
$sel:startTimecode:InputClippingSettings' :: InputClippingSettings -> Maybe StartTimecode
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (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 StartTimecode
startTimecode,
(Key
"stopTimecode" 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 StopTimecode
stopTimecode,
forall a. a -> Maybe a
Prelude.Just
(Key
"inputTimecodeSource" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= InputTimecodeSource
inputTimecodeSource)
]
)