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