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