{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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'
{ $sel:framerateDenominator:CaptionSourceFramerate' :: Maybe Natural
framerateDenominator =
forall a. Maybe a
Prelude.Nothing,
$sel:framerateNumerator:CaptionSourceFramerate' :: Maybe Natural
framerateNumerator = forall a. Maybe a
Prelude.Nothing
}
captionSourceFramerate_framerateDenominator :: Lens.Lens' CaptionSourceFramerate (Prelude.Maybe Prelude.Natural)
captionSourceFramerate_framerateDenominator :: Lens' CaptionSourceFramerate (Maybe Natural)
captionSourceFramerate_framerateDenominator = 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 :: Lens' CaptionSourceFramerate (Maybe Natural)
captionSourceFramerate_framerateNumerator = 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 Data.FromJSON CaptionSourceFramerate where
parseJSON :: Value -> Parser CaptionSourceFramerate
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"CaptionSourceFramerate"
( \Object
x ->
Maybe Natural -> Maybe Natural -> CaptionSourceFramerate
CaptionSourceFramerate'
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
"framerateDenominator")
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
"framerateNumerator")
)
instance Prelude.Hashable CaptionSourceFramerate where
hashWithSalt :: Int -> CaptionSourceFramerate -> Int
hashWithSalt Int
_salt CaptionSourceFramerate' {Maybe Natural
framerateNumerator :: Maybe Natural
framerateDenominator :: Maybe Natural
$sel:framerateNumerator:CaptionSourceFramerate' :: CaptionSourceFramerate -> Maybe Natural
$sel:framerateDenominator:CaptionSourceFramerate' :: CaptionSourceFramerate -> Maybe Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
framerateDenominator
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
framerateNumerator
instance Prelude.NFData CaptionSourceFramerate where
rnf :: CaptionSourceFramerate -> ()
rnf CaptionSourceFramerate' {Maybe Natural
framerateNumerator :: Maybe Natural
framerateDenominator :: Maybe Natural
$sel:framerateNumerator:CaptionSourceFramerate' :: CaptionSourceFramerate -> Maybe Natural
$sel:framerateDenominator:CaptionSourceFramerate' :: CaptionSourceFramerate -> Maybe Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
framerateDenominator
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
framerateNumerator
instance Data.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
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"framerateDenominator" 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 Natural
framerateDenominator,
(Key
"framerateNumerator" 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 Natural
framerateNumerator
]
)