{-# 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.MediaConvert.Types.CaptionDescriptionPreset where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaConvert.Types.CaptionDestinationSettings
import Amazonka.MediaConvert.Types.LanguageCode
import qualified Amazonka.Prelude as Prelude
data CaptionDescriptionPreset = CaptionDescriptionPreset'
{
CaptionDescriptionPreset -> Maybe Text
customLanguageCode :: Prelude.Maybe Prelude.Text,
CaptionDescriptionPreset -> Maybe LanguageCode
languageCode :: Prelude.Maybe LanguageCode,
CaptionDescriptionPreset -> Maybe CaptionDestinationSettings
destinationSettings :: Prelude.Maybe CaptionDestinationSettings,
CaptionDescriptionPreset -> Maybe Text
languageDescription :: Prelude.Maybe Prelude.Text
}
deriving (CaptionDescriptionPreset -> CaptionDescriptionPreset -> Bool
(CaptionDescriptionPreset -> CaptionDescriptionPreset -> Bool)
-> (CaptionDescriptionPreset -> CaptionDescriptionPreset -> Bool)
-> Eq CaptionDescriptionPreset
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CaptionDescriptionPreset -> CaptionDescriptionPreset -> Bool
$c/= :: CaptionDescriptionPreset -> CaptionDescriptionPreset -> Bool
== :: CaptionDescriptionPreset -> CaptionDescriptionPreset -> Bool
$c== :: CaptionDescriptionPreset -> CaptionDescriptionPreset -> Bool
Prelude.Eq, ReadPrec [CaptionDescriptionPreset]
ReadPrec CaptionDescriptionPreset
Int -> ReadS CaptionDescriptionPreset
ReadS [CaptionDescriptionPreset]
(Int -> ReadS CaptionDescriptionPreset)
-> ReadS [CaptionDescriptionPreset]
-> ReadPrec CaptionDescriptionPreset
-> ReadPrec [CaptionDescriptionPreset]
-> Read CaptionDescriptionPreset
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CaptionDescriptionPreset]
$creadListPrec :: ReadPrec [CaptionDescriptionPreset]
readPrec :: ReadPrec CaptionDescriptionPreset
$creadPrec :: ReadPrec CaptionDescriptionPreset
readList :: ReadS [CaptionDescriptionPreset]
$creadList :: ReadS [CaptionDescriptionPreset]
readsPrec :: Int -> ReadS CaptionDescriptionPreset
$creadsPrec :: Int -> ReadS CaptionDescriptionPreset
Prelude.Read, Int -> CaptionDescriptionPreset -> ShowS
[CaptionDescriptionPreset] -> ShowS
CaptionDescriptionPreset -> String
(Int -> CaptionDescriptionPreset -> ShowS)
-> (CaptionDescriptionPreset -> String)
-> ([CaptionDescriptionPreset] -> ShowS)
-> Show CaptionDescriptionPreset
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CaptionDescriptionPreset] -> ShowS
$cshowList :: [CaptionDescriptionPreset] -> ShowS
show :: CaptionDescriptionPreset -> String
$cshow :: CaptionDescriptionPreset -> String
showsPrec :: Int -> CaptionDescriptionPreset -> ShowS
$cshowsPrec :: Int -> CaptionDescriptionPreset -> ShowS
Prelude.Show, (forall x.
CaptionDescriptionPreset -> Rep CaptionDescriptionPreset x)
-> (forall x.
Rep CaptionDescriptionPreset x -> CaptionDescriptionPreset)
-> Generic CaptionDescriptionPreset
forall x.
Rep CaptionDescriptionPreset x -> CaptionDescriptionPreset
forall x.
CaptionDescriptionPreset -> Rep CaptionDescriptionPreset x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CaptionDescriptionPreset x -> CaptionDescriptionPreset
$cfrom :: forall x.
CaptionDescriptionPreset -> Rep CaptionDescriptionPreset x
Prelude.Generic)
newCaptionDescriptionPreset ::
CaptionDescriptionPreset
newCaptionDescriptionPreset :: CaptionDescriptionPreset
newCaptionDescriptionPreset =
CaptionDescriptionPreset' :: Maybe Text
-> Maybe LanguageCode
-> Maybe CaptionDestinationSettings
-> Maybe Text
-> CaptionDescriptionPreset
CaptionDescriptionPreset'
{ $sel:customLanguageCode:CaptionDescriptionPreset' :: Maybe Text
customLanguageCode =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:languageCode:CaptionDescriptionPreset' :: Maybe LanguageCode
languageCode = Maybe LanguageCode
forall a. Maybe a
Prelude.Nothing,
$sel:destinationSettings:CaptionDescriptionPreset' :: Maybe CaptionDestinationSettings
destinationSettings = Maybe CaptionDestinationSettings
forall a. Maybe a
Prelude.Nothing,
$sel:languageDescription:CaptionDescriptionPreset' :: Maybe Text
languageDescription = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
captionDescriptionPreset_customLanguageCode :: Lens.Lens' CaptionDescriptionPreset (Prelude.Maybe Prelude.Text)
captionDescriptionPreset_customLanguageCode :: (Maybe Text -> f (Maybe Text))
-> CaptionDescriptionPreset -> f CaptionDescriptionPreset
captionDescriptionPreset_customLanguageCode = (CaptionDescriptionPreset -> Maybe Text)
-> (CaptionDescriptionPreset
-> Maybe Text -> CaptionDescriptionPreset)
-> Lens
CaptionDescriptionPreset
CaptionDescriptionPreset
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CaptionDescriptionPreset' {Maybe Text
customLanguageCode :: Maybe Text
$sel:customLanguageCode:CaptionDescriptionPreset' :: CaptionDescriptionPreset -> Maybe Text
customLanguageCode} -> Maybe Text
customLanguageCode) (\s :: CaptionDescriptionPreset
s@CaptionDescriptionPreset' {} Maybe Text
a -> CaptionDescriptionPreset
s {$sel:customLanguageCode:CaptionDescriptionPreset' :: Maybe Text
customLanguageCode = Maybe Text
a} :: CaptionDescriptionPreset)
captionDescriptionPreset_languageCode :: Lens.Lens' CaptionDescriptionPreset (Prelude.Maybe LanguageCode)
captionDescriptionPreset_languageCode :: (Maybe LanguageCode -> f (Maybe LanguageCode))
-> CaptionDescriptionPreset -> f CaptionDescriptionPreset
captionDescriptionPreset_languageCode = (CaptionDescriptionPreset -> Maybe LanguageCode)
-> (CaptionDescriptionPreset
-> Maybe LanguageCode -> CaptionDescriptionPreset)
-> Lens
CaptionDescriptionPreset
CaptionDescriptionPreset
(Maybe LanguageCode)
(Maybe LanguageCode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CaptionDescriptionPreset' {Maybe LanguageCode
languageCode :: Maybe LanguageCode
$sel:languageCode:CaptionDescriptionPreset' :: CaptionDescriptionPreset -> Maybe LanguageCode
languageCode} -> Maybe LanguageCode
languageCode) (\s :: CaptionDescriptionPreset
s@CaptionDescriptionPreset' {} Maybe LanguageCode
a -> CaptionDescriptionPreset
s {$sel:languageCode:CaptionDescriptionPreset' :: Maybe LanguageCode
languageCode = Maybe LanguageCode
a} :: CaptionDescriptionPreset)
captionDescriptionPreset_destinationSettings :: Lens.Lens' CaptionDescriptionPreset (Prelude.Maybe CaptionDestinationSettings)
captionDescriptionPreset_destinationSettings :: (Maybe CaptionDestinationSettings
-> f (Maybe CaptionDestinationSettings))
-> CaptionDescriptionPreset -> f CaptionDescriptionPreset
captionDescriptionPreset_destinationSettings = (CaptionDescriptionPreset -> Maybe CaptionDestinationSettings)
-> (CaptionDescriptionPreset
-> Maybe CaptionDestinationSettings -> CaptionDescriptionPreset)
-> Lens
CaptionDescriptionPreset
CaptionDescriptionPreset
(Maybe CaptionDestinationSettings)
(Maybe CaptionDestinationSettings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CaptionDescriptionPreset' {Maybe CaptionDestinationSettings
destinationSettings :: Maybe CaptionDestinationSettings
$sel:destinationSettings:CaptionDescriptionPreset' :: CaptionDescriptionPreset -> Maybe CaptionDestinationSettings
destinationSettings} -> Maybe CaptionDestinationSettings
destinationSettings) (\s :: CaptionDescriptionPreset
s@CaptionDescriptionPreset' {} Maybe CaptionDestinationSettings
a -> CaptionDescriptionPreset
s {$sel:destinationSettings:CaptionDescriptionPreset' :: Maybe CaptionDestinationSettings
destinationSettings = Maybe CaptionDestinationSettings
a} :: CaptionDescriptionPreset)
captionDescriptionPreset_languageDescription :: Lens.Lens' CaptionDescriptionPreset (Prelude.Maybe Prelude.Text)
captionDescriptionPreset_languageDescription :: (Maybe Text -> f (Maybe Text))
-> CaptionDescriptionPreset -> f CaptionDescriptionPreset
captionDescriptionPreset_languageDescription = (CaptionDescriptionPreset -> Maybe Text)
-> (CaptionDescriptionPreset
-> Maybe Text -> CaptionDescriptionPreset)
-> Lens
CaptionDescriptionPreset
CaptionDescriptionPreset
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CaptionDescriptionPreset' {Maybe Text
languageDescription :: Maybe Text
$sel:languageDescription:CaptionDescriptionPreset' :: CaptionDescriptionPreset -> Maybe Text
languageDescription} -> Maybe Text
languageDescription) (\s :: CaptionDescriptionPreset
s@CaptionDescriptionPreset' {} Maybe Text
a -> CaptionDescriptionPreset
s {$sel:languageDescription:CaptionDescriptionPreset' :: Maybe Text
languageDescription = Maybe Text
a} :: CaptionDescriptionPreset)
instance Core.FromJSON CaptionDescriptionPreset where
parseJSON :: Value -> Parser CaptionDescriptionPreset
parseJSON =
String
-> (Object -> Parser CaptionDescriptionPreset)
-> Value
-> Parser CaptionDescriptionPreset
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"CaptionDescriptionPreset"
( \Object
x ->
Maybe Text
-> Maybe LanguageCode
-> Maybe CaptionDestinationSettings
-> Maybe Text
-> CaptionDescriptionPreset
CaptionDescriptionPreset'
(Maybe Text
-> Maybe LanguageCode
-> Maybe CaptionDestinationSettings
-> Maybe Text
-> CaptionDescriptionPreset)
-> Parser (Maybe Text)
-> Parser
(Maybe LanguageCode
-> Maybe CaptionDestinationSettings
-> Maybe Text
-> CaptionDescriptionPreset)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"customLanguageCode")
Parser
(Maybe LanguageCode
-> Maybe CaptionDestinationSettings
-> Maybe Text
-> CaptionDescriptionPreset)
-> Parser (Maybe LanguageCode)
-> Parser
(Maybe CaptionDestinationSettings
-> Maybe Text -> CaptionDescriptionPreset)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe LanguageCode)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"languageCode")
Parser
(Maybe CaptionDestinationSettings
-> Maybe Text -> CaptionDescriptionPreset)
-> Parser (Maybe CaptionDestinationSettings)
-> Parser (Maybe Text -> CaptionDescriptionPreset)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe CaptionDestinationSettings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"destinationSettings")
Parser (Maybe Text -> CaptionDescriptionPreset)
-> Parser (Maybe Text) -> Parser CaptionDescriptionPreset
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"languageDescription")
)
instance Prelude.Hashable CaptionDescriptionPreset
instance Prelude.NFData CaptionDescriptionPreset
instance Core.ToJSON CaptionDescriptionPreset where
toJSON :: CaptionDescriptionPreset -> Value
toJSON CaptionDescriptionPreset' {Maybe Text
Maybe LanguageCode
Maybe CaptionDestinationSettings
languageDescription :: Maybe Text
destinationSettings :: Maybe CaptionDestinationSettings
languageCode :: Maybe LanguageCode
customLanguageCode :: Maybe Text
$sel:languageDescription:CaptionDescriptionPreset' :: CaptionDescriptionPreset -> Maybe Text
$sel:destinationSettings:CaptionDescriptionPreset' :: CaptionDescriptionPreset -> Maybe CaptionDestinationSettings
$sel:languageCode:CaptionDescriptionPreset' :: CaptionDescriptionPreset -> Maybe LanguageCode
$sel:customLanguageCode:CaptionDescriptionPreset' :: CaptionDescriptionPreset -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"customLanguageCode" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
customLanguageCode,
(Text
"languageCode" Text -> LanguageCode -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (LanguageCode -> Pair) -> Maybe LanguageCode -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe LanguageCode
languageCode,
(Text
"destinationSettings" Text -> CaptionDestinationSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(CaptionDestinationSettings -> Pair)
-> Maybe CaptionDestinationSettings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CaptionDestinationSettings
destinationSettings,
(Text
"languageDescription" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
languageDescription
]
)