{-# 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.CaptionLanguageMapping 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 CaptionLanguageMapping = CaptionLanguageMapping'
{
CaptionLanguageMapping -> Text
languageCode :: Prelude.Text,
CaptionLanguageMapping -> Text
languageDescription :: Prelude.Text,
CaptionLanguageMapping -> Natural
captionChannel :: Prelude.Natural
}
deriving (CaptionLanguageMapping -> CaptionLanguageMapping -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CaptionLanguageMapping -> CaptionLanguageMapping -> Bool
$c/= :: CaptionLanguageMapping -> CaptionLanguageMapping -> Bool
== :: CaptionLanguageMapping -> CaptionLanguageMapping -> Bool
$c== :: CaptionLanguageMapping -> CaptionLanguageMapping -> Bool
Prelude.Eq, ReadPrec [CaptionLanguageMapping]
ReadPrec CaptionLanguageMapping
Int -> ReadS CaptionLanguageMapping
ReadS [CaptionLanguageMapping]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CaptionLanguageMapping]
$creadListPrec :: ReadPrec [CaptionLanguageMapping]
readPrec :: ReadPrec CaptionLanguageMapping
$creadPrec :: ReadPrec CaptionLanguageMapping
readList :: ReadS [CaptionLanguageMapping]
$creadList :: ReadS [CaptionLanguageMapping]
readsPrec :: Int -> ReadS CaptionLanguageMapping
$creadsPrec :: Int -> ReadS CaptionLanguageMapping
Prelude.Read, Int -> CaptionLanguageMapping -> ShowS
[CaptionLanguageMapping] -> ShowS
CaptionLanguageMapping -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CaptionLanguageMapping] -> ShowS
$cshowList :: [CaptionLanguageMapping] -> ShowS
show :: CaptionLanguageMapping -> String
$cshow :: CaptionLanguageMapping -> String
showsPrec :: Int -> CaptionLanguageMapping -> ShowS
$cshowsPrec :: Int -> CaptionLanguageMapping -> ShowS
Prelude.Show, forall x. Rep CaptionLanguageMapping x -> CaptionLanguageMapping
forall x. CaptionLanguageMapping -> Rep CaptionLanguageMapping x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CaptionLanguageMapping x -> CaptionLanguageMapping
$cfrom :: forall x. CaptionLanguageMapping -> Rep CaptionLanguageMapping x
Prelude.Generic)
newCaptionLanguageMapping ::
Prelude.Text ->
Prelude.Text ->
Prelude.Natural ->
CaptionLanguageMapping
newCaptionLanguageMapping :: Text -> Text -> Natural -> CaptionLanguageMapping
newCaptionLanguageMapping
Text
pLanguageCode_
Text
pLanguageDescription_
Natural
pCaptionChannel_ =
CaptionLanguageMapping'
{ $sel:languageCode:CaptionLanguageMapping' :: Text
languageCode =
Text
pLanguageCode_,
$sel:languageDescription:CaptionLanguageMapping' :: Text
languageDescription = Text
pLanguageDescription_,
$sel:captionChannel:CaptionLanguageMapping' :: Natural
captionChannel = Natural
pCaptionChannel_
}
captionLanguageMapping_languageCode :: Lens.Lens' CaptionLanguageMapping Prelude.Text
captionLanguageMapping_languageCode :: Lens' CaptionLanguageMapping Text
captionLanguageMapping_languageCode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CaptionLanguageMapping' {Text
languageCode :: Text
$sel:languageCode:CaptionLanguageMapping' :: CaptionLanguageMapping -> Text
languageCode} -> Text
languageCode) (\s :: CaptionLanguageMapping
s@CaptionLanguageMapping' {} Text
a -> CaptionLanguageMapping
s {$sel:languageCode:CaptionLanguageMapping' :: Text
languageCode = Text
a} :: CaptionLanguageMapping)
captionLanguageMapping_languageDescription :: Lens.Lens' CaptionLanguageMapping Prelude.Text
captionLanguageMapping_languageDescription :: Lens' CaptionLanguageMapping Text
captionLanguageMapping_languageDescription = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CaptionLanguageMapping' {Text
languageDescription :: Text
$sel:languageDescription:CaptionLanguageMapping' :: CaptionLanguageMapping -> Text
languageDescription} -> Text
languageDescription) (\s :: CaptionLanguageMapping
s@CaptionLanguageMapping' {} Text
a -> CaptionLanguageMapping
s {$sel:languageDescription:CaptionLanguageMapping' :: Text
languageDescription = Text
a} :: CaptionLanguageMapping)
captionLanguageMapping_captionChannel :: Lens.Lens' CaptionLanguageMapping Prelude.Natural
captionLanguageMapping_captionChannel :: Lens' CaptionLanguageMapping Natural
captionLanguageMapping_captionChannel = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CaptionLanguageMapping' {Natural
captionChannel :: Natural
$sel:captionChannel:CaptionLanguageMapping' :: CaptionLanguageMapping -> Natural
captionChannel} -> Natural
captionChannel) (\s :: CaptionLanguageMapping
s@CaptionLanguageMapping' {} Natural
a -> CaptionLanguageMapping
s {$sel:captionChannel:CaptionLanguageMapping' :: Natural
captionChannel = Natural
a} :: CaptionLanguageMapping)
instance Data.FromJSON CaptionLanguageMapping where
parseJSON :: Value -> Parser CaptionLanguageMapping
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"CaptionLanguageMapping"
( \Object
x ->
Text -> Text -> Natural -> CaptionLanguageMapping
CaptionLanguageMapping'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"languageCode")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"languageDescription")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"captionChannel")
)
instance Prelude.Hashable CaptionLanguageMapping where
hashWithSalt :: Int -> CaptionLanguageMapping -> Int
hashWithSalt Int
_salt CaptionLanguageMapping' {Natural
Text
captionChannel :: Natural
languageDescription :: Text
languageCode :: Text
$sel:captionChannel:CaptionLanguageMapping' :: CaptionLanguageMapping -> Natural
$sel:languageDescription:CaptionLanguageMapping' :: CaptionLanguageMapping -> Text
$sel:languageCode:CaptionLanguageMapping' :: CaptionLanguageMapping -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
languageCode
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
languageDescription
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
captionChannel
instance Prelude.NFData CaptionLanguageMapping where
rnf :: CaptionLanguageMapping -> ()
rnf CaptionLanguageMapping' {Natural
Text
captionChannel :: Natural
languageDescription :: Text
languageCode :: Text
$sel:captionChannel:CaptionLanguageMapping' :: CaptionLanguageMapping -> Natural
$sel:languageDescription:CaptionLanguageMapping' :: CaptionLanguageMapping -> Text
$sel:languageCode:CaptionLanguageMapping' :: CaptionLanguageMapping -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
languageCode
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
languageDescription
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Natural
captionChannel
instance Data.ToJSON CaptionLanguageMapping where
toJSON :: CaptionLanguageMapping -> Value
toJSON CaptionLanguageMapping' {Natural
Text
captionChannel :: Natural
languageDescription :: Text
languageCode :: Text
$sel:captionChannel:CaptionLanguageMapping' :: CaptionLanguageMapping -> Natural
$sel:languageDescription:CaptionLanguageMapping' :: CaptionLanguageMapping -> Text
$sel:languageCode:CaptionLanguageMapping' :: CaptionLanguageMapping -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"languageCode" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
languageCode),
forall a. a -> Maybe a
Prelude.Just
(Key
"languageDescription" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
languageDescription),
forall a. a -> Maybe a
Prelude.Just
(Key
"captionChannel" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Natural
captionChannel)
]
)