{-# 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.MediaConvert.Types.FrameCaptureSettings where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data FrameCaptureSettings = FrameCaptureSettings'
{
FrameCaptureSettings -> Maybe Natural
quality :: Prelude.Maybe Prelude.Natural,
FrameCaptureSettings -> Maybe Natural
framerateDenominator :: Prelude.Maybe Prelude.Natural,
FrameCaptureSettings -> Maybe Natural
maxCaptures :: Prelude.Maybe Prelude.Natural,
FrameCaptureSettings -> Maybe Natural
framerateNumerator :: Prelude.Maybe Prelude.Natural
}
deriving (FrameCaptureSettings -> FrameCaptureSettings -> Bool
(FrameCaptureSettings -> FrameCaptureSettings -> Bool)
-> (FrameCaptureSettings -> FrameCaptureSettings -> Bool)
-> Eq FrameCaptureSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FrameCaptureSettings -> FrameCaptureSettings -> Bool
$c/= :: FrameCaptureSettings -> FrameCaptureSettings -> Bool
== :: FrameCaptureSettings -> FrameCaptureSettings -> Bool
$c== :: FrameCaptureSettings -> FrameCaptureSettings -> Bool
Prelude.Eq, ReadPrec [FrameCaptureSettings]
ReadPrec FrameCaptureSettings
Int -> ReadS FrameCaptureSettings
ReadS [FrameCaptureSettings]
(Int -> ReadS FrameCaptureSettings)
-> ReadS [FrameCaptureSettings]
-> ReadPrec FrameCaptureSettings
-> ReadPrec [FrameCaptureSettings]
-> Read FrameCaptureSettings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FrameCaptureSettings]
$creadListPrec :: ReadPrec [FrameCaptureSettings]
readPrec :: ReadPrec FrameCaptureSettings
$creadPrec :: ReadPrec FrameCaptureSettings
readList :: ReadS [FrameCaptureSettings]
$creadList :: ReadS [FrameCaptureSettings]
readsPrec :: Int -> ReadS FrameCaptureSettings
$creadsPrec :: Int -> ReadS FrameCaptureSettings
Prelude.Read, Int -> FrameCaptureSettings -> ShowS
[FrameCaptureSettings] -> ShowS
FrameCaptureSettings -> String
(Int -> FrameCaptureSettings -> ShowS)
-> (FrameCaptureSettings -> String)
-> ([FrameCaptureSettings] -> ShowS)
-> Show FrameCaptureSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FrameCaptureSettings] -> ShowS
$cshowList :: [FrameCaptureSettings] -> ShowS
show :: FrameCaptureSettings -> String
$cshow :: FrameCaptureSettings -> String
showsPrec :: Int -> FrameCaptureSettings -> ShowS
$cshowsPrec :: Int -> FrameCaptureSettings -> ShowS
Prelude.Show, (forall x. FrameCaptureSettings -> Rep FrameCaptureSettings x)
-> (forall x. Rep FrameCaptureSettings x -> FrameCaptureSettings)
-> Generic FrameCaptureSettings
forall x. Rep FrameCaptureSettings x -> FrameCaptureSettings
forall x. FrameCaptureSettings -> Rep FrameCaptureSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FrameCaptureSettings x -> FrameCaptureSettings
$cfrom :: forall x. FrameCaptureSettings -> Rep FrameCaptureSettings x
Prelude.Generic)
newFrameCaptureSettings ::
FrameCaptureSettings
newFrameCaptureSettings :: FrameCaptureSettings
newFrameCaptureSettings =
FrameCaptureSettings' :: Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> FrameCaptureSettings
FrameCaptureSettings'
{ $sel:quality:FrameCaptureSettings' :: Maybe Natural
quality = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:framerateDenominator:FrameCaptureSettings' :: Maybe Natural
framerateDenominator = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:maxCaptures:FrameCaptureSettings' :: Maybe Natural
maxCaptures = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:framerateNumerator:FrameCaptureSettings' :: Maybe Natural
framerateNumerator = Maybe Natural
forall a. Maybe a
Prelude.Nothing
}
frameCaptureSettings_quality :: Lens.Lens' FrameCaptureSettings (Prelude.Maybe Prelude.Natural)
frameCaptureSettings_quality :: (Maybe Natural -> f (Maybe Natural))
-> FrameCaptureSettings -> f FrameCaptureSettings
frameCaptureSettings_quality = (FrameCaptureSettings -> Maybe Natural)
-> (FrameCaptureSettings -> Maybe Natural -> FrameCaptureSettings)
-> Lens
FrameCaptureSettings
FrameCaptureSettings
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FrameCaptureSettings' {Maybe Natural
quality :: Maybe Natural
$sel:quality:FrameCaptureSettings' :: FrameCaptureSettings -> Maybe Natural
quality} -> Maybe Natural
quality) (\s :: FrameCaptureSettings
s@FrameCaptureSettings' {} Maybe Natural
a -> FrameCaptureSettings
s {$sel:quality:FrameCaptureSettings' :: Maybe Natural
quality = Maybe Natural
a} :: FrameCaptureSettings)
frameCaptureSettings_framerateDenominator :: Lens.Lens' FrameCaptureSettings (Prelude.Maybe Prelude.Natural)
frameCaptureSettings_framerateDenominator :: (Maybe Natural -> f (Maybe Natural))
-> FrameCaptureSettings -> f FrameCaptureSettings
frameCaptureSettings_framerateDenominator = (FrameCaptureSettings -> Maybe Natural)
-> (FrameCaptureSettings -> Maybe Natural -> FrameCaptureSettings)
-> Lens
FrameCaptureSettings
FrameCaptureSettings
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FrameCaptureSettings' {Maybe Natural
framerateDenominator :: Maybe Natural
$sel:framerateDenominator:FrameCaptureSettings' :: FrameCaptureSettings -> Maybe Natural
framerateDenominator} -> Maybe Natural
framerateDenominator) (\s :: FrameCaptureSettings
s@FrameCaptureSettings' {} Maybe Natural
a -> FrameCaptureSettings
s {$sel:framerateDenominator:FrameCaptureSettings' :: Maybe Natural
framerateDenominator = Maybe Natural
a} :: FrameCaptureSettings)
frameCaptureSettings_maxCaptures :: Lens.Lens' FrameCaptureSettings (Prelude.Maybe Prelude.Natural)
frameCaptureSettings_maxCaptures :: (Maybe Natural -> f (Maybe Natural))
-> FrameCaptureSettings -> f FrameCaptureSettings
frameCaptureSettings_maxCaptures = (FrameCaptureSettings -> Maybe Natural)
-> (FrameCaptureSettings -> Maybe Natural -> FrameCaptureSettings)
-> Lens
FrameCaptureSettings
FrameCaptureSettings
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FrameCaptureSettings' {Maybe Natural
maxCaptures :: Maybe Natural
$sel:maxCaptures:FrameCaptureSettings' :: FrameCaptureSettings -> Maybe Natural
maxCaptures} -> Maybe Natural
maxCaptures) (\s :: FrameCaptureSettings
s@FrameCaptureSettings' {} Maybe Natural
a -> FrameCaptureSettings
s {$sel:maxCaptures:FrameCaptureSettings' :: Maybe Natural
maxCaptures = Maybe Natural
a} :: FrameCaptureSettings)
frameCaptureSettings_framerateNumerator :: Lens.Lens' FrameCaptureSettings (Prelude.Maybe Prelude.Natural)
frameCaptureSettings_framerateNumerator :: (Maybe Natural -> f (Maybe Natural))
-> FrameCaptureSettings -> f FrameCaptureSettings
frameCaptureSettings_framerateNumerator = (FrameCaptureSettings -> Maybe Natural)
-> (FrameCaptureSettings -> Maybe Natural -> FrameCaptureSettings)
-> Lens
FrameCaptureSettings
FrameCaptureSettings
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FrameCaptureSettings' {Maybe Natural
framerateNumerator :: Maybe Natural
$sel:framerateNumerator:FrameCaptureSettings' :: FrameCaptureSettings -> Maybe Natural
framerateNumerator} -> Maybe Natural
framerateNumerator) (\s :: FrameCaptureSettings
s@FrameCaptureSettings' {} Maybe Natural
a -> FrameCaptureSettings
s {$sel:framerateNumerator:FrameCaptureSettings' :: Maybe Natural
framerateNumerator = Maybe Natural
a} :: FrameCaptureSettings)
instance Core.FromJSON FrameCaptureSettings where
parseJSON :: Value -> Parser FrameCaptureSettings
parseJSON =
String
-> (Object -> Parser FrameCaptureSettings)
-> Value
-> Parser FrameCaptureSettings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"FrameCaptureSettings"
( \Object
x ->
Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> FrameCaptureSettings
FrameCaptureSettings'
(Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> FrameCaptureSettings)
-> Parser (Maybe Natural)
-> Parser
(Maybe Natural
-> Maybe Natural -> Maybe Natural -> FrameCaptureSettings)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"quality")
Parser
(Maybe Natural
-> Maybe Natural -> Maybe Natural -> FrameCaptureSettings)
-> Parser (Maybe Natural)
-> Parser (Maybe Natural -> Maybe Natural -> FrameCaptureSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"framerateDenominator")
Parser (Maybe Natural -> Maybe Natural -> FrameCaptureSettings)
-> Parser (Maybe Natural)
-> Parser (Maybe Natural -> FrameCaptureSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"maxCaptures")
Parser (Maybe Natural -> FrameCaptureSettings)
-> Parser (Maybe Natural) -> Parser FrameCaptureSettings
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"framerateNumerator")
)
instance Prelude.Hashable FrameCaptureSettings
instance Prelude.NFData FrameCaptureSettings
instance Core.ToJSON FrameCaptureSettings where
toJSON :: FrameCaptureSettings -> Value
toJSON FrameCaptureSettings' {Maybe Natural
framerateNumerator :: Maybe Natural
maxCaptures :: Maybe Natural
framerateDenominator :: Maybe Natural
quality :: Maybe Natural
$sel:framerateNumerator:FrameCaptureSettings' :: FrameCaptureSettings -> Maybe Natural
$sel:maxCaptures:FrameCaptureSettings' :: FrameCaptureSettings -> Maybe Natural
$sel:framerateDenominator:FrameCaptureSettings' :: FrameCaptureSettings -> Maybe Natural
$sel:quality:FrameCaptureSettings' :: FrameCaptureSettings -> Maybe Natural
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"quality" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
quality,
(Text
"framerateDenominator" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
framerateDenominator,
(Text
"maxCaptures" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxCaptures,
(Text
"framerateNumerator" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
framerateNumerator
]
)