{-# 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.Lens as Lens
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 StopTimecode
stopTimecode :: Prelude.Maybe StopTimecode,
InputClippingSettings -> Maybe StartTimecode
startTimecode :: Prelude.Maybe StartTimecode,
InputClippingSettings -> InputTimecodeSource
inputTimecodeSource :: InputTimecodeSource
}
deriving (InputClippingSettings -> InputClippingSettings -> Bool
(InputClippingSettings -> InputClippingSettings -> Bool)
-> (InputClippingSettings -> InputClippingSettings -> Bool)
-> Eq InputClippingSettings
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]
(Int -> ReadS InputClippingSettings)
-> ReadS [InputClippingSettings]
-> ReadPrec InputClippingSettings
-> ReadPrec [InputClippingSettings]
-> Read 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
(Int -> InputClippingSettings -> ShowS)
-> (InputClippingSettings -> String)
-> ([InputClippingSettings] -> ShowS)
-> Show InputClippingSettings
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. InputClippingSettings -> Rep InputClippingSettings x)
-> (forall x. Rep InputClippingSettings x -> InputClippingSettings)
-> Generic InputClippingSettings
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' :: Maybe StopTimecode
-> Maybe StartTimecode
-> InputTimecodeSource
-> InputClippingSettings
InputClippingSettings'
{ $sel:stopTimecode:InputClippingSettings' :: Maybe StopTimecode
stopTimecode =
Maybe StopTimecode
forall a. Maybe a
Prelude.Nothing,
$sel:startTimecode:InputClippingSettings' :: Maybe StartTimecode
startTimecode = Maybe StartTimecode
forall a. Maybe a
Prelude.Nothing,
$sel:inputTimecodeSource:InputClippingSettings' :: InputTimecodeSource
inputTimecodeSource = InputTimecodeSource
pInputTimecodeSource_
}
inputClippingSettings_stopTimecode :: Lens.Lens' InputClippingSettings (Prelude.Maybe StopTimecode)
inputClippingSettings_stopTimecode :: (Maybe StopTimecode -> f (Maybe StopTimecode))
-> InputClippingSettings -> f InputClippingSettings
inputClippingSettings_stopTimecode = (InputClippingSettings -> Maybe StopTimecode)
-> (InputClippingSettings
-> Maybe StopTimecode -> InputClippingSettings)
-> Lens
InputClippingSettings
InputClippingSettings
(Maybe StopTimecode)
(Maybe 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_startTimecode :: Lens.Lens' InputClippingSettings (Prelude.Maybe StartTimecode)
inputClippingSettings_startTimecode :: (Maybe StartTimecode -> f (Maybe StartTimecode))
-> InputClippingSettings -> f InputClippingSettings
inputClippingSettings_startTimecode = (InputClippingSettings -> Maybe StartTimecode)
-> (InputClippingSettings
-> Maybe StartTimecode -> InputClippingSettings)
-> Lens
InputClippingSettings
InputClippingSettings
(Maybe StartTimecode)
(Maybe 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_inputTimecodeSource :: Lens.Lens' InputClippingSettings InputTimecodeSource
inputClippingSettings_inputTimecodeSource :: (InputTimecodeSource -> f InputTimecodeSource)
-> InputClippingSettings -> f InputClippingSettings
inputClippingSettings_inputTimecodeSource = (InputClippingSettings -> InputTimecodeSource)
-> (InputClippingSettings
-> InputTimecodeSource -> InputClippingSettings)
-> Lens
InputClippingSettings
InputClippingSettings
InputTimecodeSource
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 Core.FromJSON InputClippingSettings where
parseJSON :: Value -> Parser InputClippingSettings
parseJSON =
String
-> (Object -> Parser InputClippingSettings)
-> Value
-> Parser InputClippingSettings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"InputClippingSettings"
( \Object
x ->
Maybe StopTimecode
-> Maybe StartTimecode
-> InputTimecodeSource
-> InputClippingSettings
InputClippingSettings'
(Maybe StopTimecode
-> Maybe StartTimecode
-> InputTimecodeSource
-> InputClippingSettings)
-> Parser (Maybe StopTimecode)
-> Parser
(Maybe StartTimecode
-> InputTimecodeSource -> InputClippingSettings)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe StopTimecode)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"stopTimecode")
Parser
(Maybe StartTimecode
-> InputTimecodeSource -> InputClippingSettings)
-> Parser (Maybe StartTimecode)
-> Parser (InputTimecodeSource -> InputClippingSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe StartTimecode)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"startTimecode")
Parser (InputTimecodeSource -> InputClippingSettings)
-> Parser InputTimecodeSource -> Parser InputClippingSettings
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser InputTimecodeSource
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"inputTimecodeSource")
)
instance Prelude.Hashable InputClippingSettings
instance Prelude.NFData InputClippingSettings
instance Core.ToJSON InputClippingSettings where
toJSON :: InputClippingSettings -> Value
toJSON InputClippingSettings' {Maybe StartTimecode
Maybe StopTimecode
InputTimecodeSource
inputTimecodeSource :: InputTimecodeSource
startTimecode :: Maybe StartTimecode
stopTimecode :: Maybe StopTimecode
$sel:inputTimecodeSource:InputClippingSettings' :: InputClippingSettings -> InputTimecodeSource
$sel:startTimecode:InputClippingSettings' :: InputClippingSettings -> Maybe StartTimecode
$sel:stopTimecode:InputClippingSettings' :: InputClippingSettings -> Maybe StopTimecode
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"stopTimecode" Text -> StopTimecode -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (StopTimecode -> Pair) -> Maybe StopTimecode -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe StopTimecode
stopTimecode,
(Text
"startTimecode" Text -> StartTimecode -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (StartTimecode -> Pair) -> Maybe StartTimecode -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe StartTimecode
startTimecode,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"inputTimecodeSource" Text -> InputTimecodeSource -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= InputTimecodeSource
inputTimecodeSource)
]
)