{-# 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.Lens as Lens
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
(CaptionLanguageMapping -> CaptionLanguageMapping -> Bool)
-> (CaptionLanguageMapping -> CaptionLanguageMapping -> Bool)
-> Eq CaptionLanguageMapping
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]
(Int -> ReadS CaptionLanguageMapping)
-> ReadS [CaptionLanguageMapping]
-> ReadPrec CaptionLanguageMapping
-> ReadPrec [CaptionLanguageMapping]
-> Read 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
(Int -> CaptionLanguageMapping -> ShowS)
-> (CaptionLanguageMapping -> String)
-> ([CaptionLanguageMapping] -> ShowS)
-> Show CaptionLanguageMapping
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. CaptionLanguageMapping -> Rep CaptionLanguageMapping x)
-> (forall x.
Rep CaptionLanguageMapping x -> CaptionLanguageMapping)
-> Generic CaptionLanguageMapping
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' :: Text -> Text -> Natural -> CaptionLanguageMapping
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 :: (Text -> f Text)
-> CaptionLanguageMapping -> f CaptionLanguageMapping
captionLanguageMapping_languageCode = (CaptionLanguageMapping -> Text)
-> (CaptionLanguageMapping -> Text -> CaptionLanguageMapping)
-> Lens CaptionLanguageMapping CaptionLanguageMapping Text Text
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 :: (Text -> f Text)
-> CaptionLanguageMapping -> f CaptionLanguageMapping
captionLanguageMapping_languageDescription = (CaptionLanguageMapping -> Text)
-> (CaptionLanguageMapping -> Text -> CaptionLanguageMapping)
-> Lens CaptionLanguageMapping CaptionLanguageMapping Text Text
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 :: (Natural -> f Natural)
-> CaptionLanguageMapping -> f CaptionLanguageMapping
captionLanguageMapping_captionChannel = (CaptionLanguageMapping -> Natural)
-> (CaptionLanguageMapping -> Natural -> CaptionLanguageMapping)
-> Lens
CaptionLanguageMapping CaptionLanguageMapping Natural Natural
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 Core.FromJSON CaptionLanguageMapping where
parseJSON :: Value -> Parser CaptionLanguageMapping
parseJSON =
String
-> (Object -> Parser CaptionLanguageMapping)
-> Value
-> Parser CaptionLanguageMapping
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"CaptionLanguageMapping"
( \Object
x ->
Text -> Text -> Natural -> CaptionLanguageMapping
CaptionLanguageMapping'
(Text -> Text -> Natural -> CaptionLanguageMapping)
-> Parser Text
-> Parser (Text -> Natural -> CaptionLanguageMapping)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"languageCode")
Parser (Text -> Natural -> CaptionLanguageMapping)
-> Parser Text -> Parser (Natural -> CaptionLanguageMapping)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"languageDescription")
Parser (Natural -> CaptionLanguageMapping)
-> Parser Natural -> Parser CaptionLanguageMapping
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Natural
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"captionChannel")
)
instance Prelude.Hashable CaptionLanguageMapping
instance Prelude.NFData CaptionLanguageMapping
instance Core.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
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"languageCode" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
languageCode),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"languageDescription" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
languageDescription),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"captionChannel" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Natural
captionChannel)
]
)