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