{-# 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.CaptionSourceFramerate where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data CaptionSourceFramerate = CaptionSourceFramerate'
{
CaptionSourceFramerate -> Maybe Natural
framerateDenominator :: Prelude.Maybe Prelude.Natural,
CaptionSourceFramerate -> Maybe Natural
framerateNumerator :: Prelude.Maybe Prelude.Natural
}
deriving (CaptionSourceFramerate -> CaptionSourceFramerate -> Bool
(CaptionSourceFramerate -> CaptionSourceFramerate -> Bool)
-> (CaptionSourceFramerate -> CaptionSourceFramerate -> Bool)
-> Eq CaptionSourceFramerate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CaptionSourceFramerate -> CaptionSourceFramerate -> Bool
$c/= :: CaptionSourceFramerate -> CaptionSourceFramerate -> Bool
== :: CaptionSourceFramerate -> CaptionSourceFramerate -> Bool
$c== :: CaptionSourceFramerate -> CaptionSourceFramerate -> Bool
Prelude.Eq, ReadPrec [CaptionSourceFramerate]
ReadPrec CaptionSourceFramerate
Int -> ReadS CaptionSourceFramerate
ReadS [CaptionSourceFramerate]
(Int -> ReadS CaptionSourceFramerate)
-> ReadS [CaptionSourceFramerate]
-> ReadPrec CaptionSourceFramerate
-> ReadPrec [CaptionSourceFramerate]
-> Read CaptionSourceFramerate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CaptionSourceFramerate]
$creadListPrec :: ReadPrec [CaptionSourceFramerate]
readPrec :: ReadPrec CaptionSourceFramerate
$creadPrec :: ReadPrec CaptionSourceFramerate
readList :: ReadS [CaptionSourceFramerate]
$creadList :: ReadS [CaptionSourceFramerate]
readsPrec :: Int -> ReadS CaptionSourceFramerate
$creadsPrec :: Int -> ReadS CaptionSourceFramerate
Prelude.Read, Int -> CaptionSourceFramerate -> ShowS
[CaptionSourceFramerate] -> ShowS
CaptionSourceFramerate -> String
(Int -> CaptionSourceFramerate -> ShowS)
-> (CaptionSourceFramerate -> String)
-> ([CaptionSourceFramerate] -> ShowS)
-> Show CaptionSourceFramerate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CaptionSourceFramerate] -> ShowS
$cshowList :: [CaptionSourceFramerate] -> ShowS
show :: CaptionSourceFramerate -> String
$cshow :: CaptionSourceFramerate -> String
showsPrec :: Int -> CaptionSourceFramerate -> ShowS
$cshowsPrec :: Int -> CaptionSourceFramerate -> ShowS
Prelude.Show, (forall x. CaptionSourceFramerate -> Rep CaptionSourceFramerate x)
-> (forall x.
Rep CaptionSourceFramerate x -> CaptionSourceFramerate)
-> Generic CaptionSourceFramerate
forall x. Rep CaptionSourceFramerate x -> CaptionSourceFramerate
forall x. CaptionSourceFramerate -> Rep CaptionSourceFramerate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CaptionSourceFramerate x -> CaptionSourceFramerate
$cfrom :: forall x. CaptionSourceFramerate -> Rep CaptionSourceFramerate x
Prelude.Generic)
newCaptionSourceFramerate ::
CaptionSourceFramerate
newCaptionSourceFramerate :: CaptionSourceFramerate
newCaptionSourceFramerate =
CaptionSourceFramerate' :: Maybe Natural -> Maybe Natural -> CaptionSourceFramerate
CaptionSourceFramerate'
{ $sel:framerateDenominator:CaptionSourceFramerate' :: Maybe Natural
framerateDenominator =
Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:framerateNumerator:CaptionSourceFramerate' :: Maybe Natural
framerateNumerator = Maybe Natural
forall a. Maybe a
Prelude.Nothing
}
captionSourceFramerate_framerateDenominator :: Lens.Lens' CaptionSourceFramerate (Prelude.Maybe Prelude.Natural)
captionSourceFramerate_framerateDenominator :: (Maybe Natural -> f (Maybe Natural))
-> CaptionSourceFramerate -> f CaptionSourceFramerate
captionSourceFramerate_framerateDenominator = (CaptionSourceFramerate -> Maybe Natural)
-> (CaptionSourceFramerate
-> Maybe Natural -> CaptionSourceFramerate)
-> Lens
CaptionSourceFramerate
CaptionSourceFramerate
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CaptionSourceFramerate' {Maybe Natural
framerateDenominator :: Maybe Natural
$sel:framerateDenominator:CaptionSourceFramerate' :: CaptionSourceFramerate -> Maybe Natural
framerateDenominator} -> Maybe Natural
framerateDenominator) (\s :: CaptionSourceFramerate
s@CaptionSourceFramerate' {} Maybe Natural
a -> CaptionSourceFramerate
s {$sel:framerateDenominator:CaptionSourceFramerate' :: Maybe Natural
framerateDenominator = Maybe Natural
a} :: CaptionSourceFramerate)
captionSourceFramerate_framerateNumerator :: Lens.Lens' CaptionSourceFramerate (Prelude.Maybe Prelude.Natural)
captionSourceFramerate_framerateNumerator :: (Maybe Natural -> f (Maybe Natural))
-> CaptionSourceFramerate -> f CaptionSourceFramerate
captionSourceFramerate_framerateNumerator = (CaptionSourceFramerate -> Maybe Natural)
-> (CaptionSourceFramerate
-> Maybe Natural -> CaptionSourceFramerate)
-> Lens
CaptionSourceFramerate
CaptionSourceFramerate
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CaptionSourceFramerate' {Maybe Natural
framerateNumerator :: Maybe Natural
$sel:framerateNumerator:CaptionSourceFramerate' :: CaptionSourceFramerate -> Maybe Natural
framerateNumerator} -> Maybe Natural
framerateNumerator) (\s :: CaptionSourceFramerate
s@CaptionSourceFramerate' {} Maybe Natural
a -> CaptionSourceFramerate
s {$sel:framerateNumerator:CaptionSourceFramerate' :: Maybe Natural
framerateNumerator = Maybe Natural
a} :: CaptionSourceFramerate)
instance Core.FromJSON CaptionSourceFramerate where
parseJSON :: Value -> Parser CaptionSourceFramerate
parseJSON =
String
-> (Object -> Parser CaptionSourceFramerate)
-> Value
-> Parser CaptionSourceFramerate
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"CaptionSourceFramerate"
( \Object
x ->
Maybe Natural -> Maybe Natural -> CaptionSourceFramerate
CaptionSourceFramerate'
(Maybe Natural -> Maybe Natural -> CaptionSourceFramerate)
-> Parser (Maybe Natural)
-> Parser (Maybe Natural -> CaptionSourceFramerate)
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
"framerateDenominator")
Parser (Maybe Natural -> CaptionSourceFramerate)
-> Parser (Maybe Natural) -> Parser CaptionSourceFramerate
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 CaptionSourceFramerate
instance Prelude.NFData CaptionSourceFramerate
instance Core.ToJSON CaptionSourceFramerate where
toJSON :: CaptionSourceFramerate -> Value
toJSON CaptionSourceFramerate' {Maybe Natural
framerateNumerator :: Maybe Natural
framerateDenominator :: Maybe Natural
$sel:framerateNumerator:CaptionSourceFramerate' :: CaptionSourceFramerate -> Maybe Natural
$sel:framerateDenominator:CaptionSourceFramerate' :: CaptionSourceFramerate -> Maybe Natural
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (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
"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
]
)