{-# 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.CaptionDescription where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MediaConvert.Types.CaptionDestinationSettings
import Amazonka.MediaConvert.Types.LanguageCode
import qualified Amazonka.Prelude as Prelude
data CaptionDescription = CaptionDescription'
{
CaptionDescription -> Maybe Text
captionSelectorName :: Prelude.Maybe Prelude.Text,
CaptionDescription -> Maybe Text
customLanguageCode :: Prelude.Maybe Prelude.Text,
CaptionDescription -> Maybe CaptionDestinationSettings
destinationSettings :: Prelude.Maybe CaptionDestinationSettings,
CaptionDescription -> Maybe LanguageCode
languageCode :: Prelude.Maybe LanguageCode,
CaptionDescription -> Maybe Text
languageDescription :: Prelude.Maybe Prelude.Text
}
deriving (CaptionDescription -> CaptionDescription -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CaptionDescription -> CaptionDescription -> Bool
$c/= :: CaptionDescription -> CaptionDescription -> Bool
== :: CaptionDescription -> CaptionDescription -> Bool
$c== :: CaptionDescription -> CaptionDescription -> Bool
Prelude.Eq, ReadPrec [CaptionDescription]
ReadPrec CaptionDescription
Int -> ReadS CaptionDescription
ReadS [CaptionDescription]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CaptionDescription]
$creadListPrec :: ReadPrec [CaptionDescription]
readPrec :: ReadPrec CaptionDescription
$creadPrec :: ReadPrec CaptionDescription
readList :: ReadS [CaptionDescription]
$creadList :: ReadS [CaptionDescription]
readsPrec :: Int -> ReadS CaptionDescription
$creadsPrec :: Int -> ReadS CaptionDescription
Prelude.Read, Int -> CaptionDescription -> ShowS
[CaptionDescription] -> ShowS
CaptionDescription -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CaptionDescription] -> ShowS
$cshowList :: [CaptionDescription] -> ShowS
show :: CaptionDescription -> String
$cshow :: CaptionDescription -> String
showsPrec :: Int -> CaptionDescription -> ShowS
$cshowsPrec :: Int -> CaptionDescription -> ShowS
Prelude.Show, forall x. Rep CaptionDescription x -> CaptionDescription
forall x. CaptionDescription -> Rep CaptionDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CaptionDescription x -> CaptionDescription
$cfrom :: forall x. CaptionDescription -> Rep CaptionDescription x
Prelude.Generic)
newCaptionDescription ::
CaptionDescription
newCaptionDescription :: CaptionDescription
newCaptionDescription =
CaptionDescription'
{ $sel:captionSelectorName:CaptionDescription' :: Maybe Text
captionSelectorName =
forall a. Maybe a
Prelude.Nothing,
$sel:customLanguageCode:CaptionDescription' :: Maybe Text
customLanguageCode = forall a. Maybe a
Prelude.Nothing,
$sel:destinationSettings:CaptionDescription' :: Maybe CaptionDestinationSettings
destinationSettings = forall a. Maybe a
Prelude.Nothing,
$sel:languageCode:CaptionDescription' :: Maybe LanguageCode
languageCode = forall a. Maybe a
Prelude.Nothing,
$sel:languageDescription:CaptionDescription' :: Maybe Text
languageDescription = forall a. Maybe a
Prelude.Nothing
}
captionDescription_captionSelectorName :: Lens.Lens' CaptionDescription (Prelude.Maybe Prelude.Text)
captionDescription_captionSelectorName :: Lens' CaptionDescription (Maybe Text)
captionDescription_captionSelectorName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CaptionDescription' {Maybe Text
captionSelectorName :: Maybe Text
$sel:captionSelectorName:CaptionDescription' :: CaptionDescription -> Maybe Text
captionSelectorName} -> Maybe Text
captionSelectorName) (\s :: CaptionDescription
s@CaptionDescription' {} Maybe Text
a -> CaptionDescription
s {$sel:captionSelectorName:CaptionDescription' :: Maybe Text
captionSelectorName = Maybe Text
a} :: CaptionDescription)
captionDescription_customLanguageCode :: Lens.Lens' CaptionDescription (Prelude.Maybe Prelude.Text)
captionDescription_customLanguageCode :: Lens' CaptionDescription (Maybe Text)
captionDescription_customLanguageCode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CaptionDescription' {Maybe Text
customLanguageCode :: Maybe Text
$sel:customLanguageCode:CaptionDescription' :: CaptionDescription -> Maybe Text
customLanguageCode} -> Maybe Text
customLanguageCode) (\s :: CaptionDescription
s@CaptionDescription' {} Maybe Text
a -> CaptionDescription
s {$sel:customLanguageCode:CaptionDescription' :: Maybe Text
customLanguageCode = Maybe Text
a} :: CaptionDescription)
captionDescription_destinationSettings :: Lens.Lens' CaptionDescription (Prelude.Maybe CaptionDestinationSettings)
captionDescription_destinationSettings :: Lens' CaptionDescription (Maybe CaptionDestinationSettings)
captionDescription_destinationSettings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CaptionDescription' {Maybe CaptionDestinationSettings
destinationSettings :: Maybe CaptionDestinationSettings
$sel:destinationSettings:CaptionDescription' :: CaptionDescription -> Maybe CaptionDestinationSettings
destinationSettings} -> Maybe CaptionDestinationSettings
destinationSettings) (\s :: CaptionDescription
s@CaptionDescription' {} Maybe CaptionDestinationSettings
a -> CaptionDescription
s {$sel:destinationSettings:CaptionDescription' :: Maybe CaptionDestinationSettings
destinationSettings = Maybe CaptionDestinationSettings
a} :: CaptionDescription)
captionDescription_languageCode :: Lens.Lens' CaptionDescription (Prelude.Maybe LanguageCode)
captionDescription_languageCode :: Lens' CaptionDescription (Maybe LanguageCode)
captionDescription_languageCode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CaptionDescription' {Maybe LanguageCode
languageCode :: Maybe LanguageCode
$sel:languageCode:CaptionDescription' :: CaptionDescription -> Maybe LanguageCode
languageCode} -> Maybe LanguageCode
languageCode) (\s :: CaptionDescription
s@CaptionDescription' {} Maybe LanguageCode
a -> CaptionDescription
s {$sel:languageCode:CaptionDescription' :: Maybe LanguageCode
languageCode = Maybe LanguageCode
a} :: CaptionDescription)
captionDescription_languageDescription :: Lens.Lens' CaptionDescription (Prelude.Maybe Prelude.Text)
captionDescription_languageDescription :: Lens' CaptionDescription (Maybe Text)
captionDescription_languageDescription = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CaptionDescription' {Maybe Text
languageDescription :: Maybe Text
$sel:languageDescription:CaptionDescription' :: CaptionDescription -> Maybe Text
languageDescription} -> Maybe Text
languageDescription) (\s :: CaptionDescription
s@CaptionDescription' {} Maybe Text
a -> CaptionDescription
s {$sel:languageDescription:CaptionDescription' :: Maybe Text
languageDescription = Maybe Text
a} :: CaptionDescription)
instance Data.FromJSON CaptionDescription where
parseJSON :: Value -> Parser CaptionDescription
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"CaptionDescription"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe CaptionDestinationSettings
-> Maybe LanguageCode
-> Maybe Text
-> CaptionDescription
CaptionDescription'
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
"captionSelectorName")
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
"customLanguageCode")
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
"destinationSettings")
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
"languageCode")
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
"languageDescription")
)
instance Prelude.Hashable CaptionDescription where
hashWithSalt :: Int -> CaptionDescription -> Int
hashWithSalt Int
_salt CaptionDescription' {Maybe Text
Maybe LanguageCode
Maybe CaptionDestinationSettings
languageDescription :: Maybe Text
languageCode :: Maybe LanguageCode
destinationSettings :: Maybe CaptionDestinationSettings
customLanguageCode :: Maybe Text
captionSelectorName :: Maybe Text
$sel:languageDescription:CaptionDescription' :: CaptionDescription -> Maybe Text
$sel:languageCode:CaptionDescription' :: CaptionDescription -> Maybe LanguageCode
$sel:destinationSettings:CaptionDescription' :: CaptionDescription -> Maybe CaptionDestinationSettings
$sel:customLanguageCode:CaptionDescription' :: CaptionDescription -> Maybe Text
$sel:captionSelectorName:CaptionDescription' :: CaptionDescription -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
captionSelectorName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
customLanguageCode
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CaptionDestinationSettings
destinationSettings
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe LanguageCode
languageCode
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
languageDescription
instance Prelude.NFData CaptionDescription where
rnf :: CaptionDescription -> ()
rnf CaptionDescription' {Maybe Text
Maybe LanguageCode
Maybe CaptionDestinationSettings
languageDescription :: Maybe Text
languageCode :: Maybe LanguageCode
destinationSettings :: Maybe CaptionDestinationSettings
customLanguageCode :: Maybe Text
captionSelectorName :: Maybe Text
$sel:languageDescription:CaptionDescription' :: CaptionDescription -> Maybe Text
$sel:languageCode:CaptionDescription' :: CaptionDescription -> Maybe LanguageCode
$sel:destinationSettings:CaptionDescription' :: CaptionDescription -> Maybe CaptionDestinationSettings
$sel:customLanguageCode:CaptionDescription' :: CaptionDescription -> Maybe Text
$sel:captionSelectorName:CaptionDescription' :: CaptionDescription -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
captionSelectorName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
customLanguageCode
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe CaptionDestinationSettings
destinationSettings
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe LanguageCode
languageCode
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
languageDescription
instance Data.ToJSON CaptionDescription where
toJSON :: CaptionDescription -> Value
toJSON CaptionDescription' {Maybe Text
Maybe LanguageCode
Maybe CaptionDestinationSettings
languageDescription :: Maybe Text
languageCode :: Maybe LanguageCode
destinationSettings :: Maybe CaptionDestinationSettings
customLanguageCode :: Maybe Text
captionSelectorName :: Maybe Text
$sel:languageDescription:CaptionDescription' :: CaptionDescription -> Maybe Text
$sel:languageCode:CaptionDescription' :: CaptionDescription -> Maybe LanguageCode
$sel:destinationSettings:CaptionDescription' :: CaptionDescription -> Maybe CaptionDestinationSettings
$sel:customLanguageCode:CaptionDescription' :: CaptionDescription -> Maybe Text
$sel:captionSelectorName:CaptionDescription' :: CaptionDescription -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"captionSelectorName" 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 Text
captionSelectorName,
(Key
"customLanguageCode" 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 Text
customLanguageCode,
(Key
"destinationSettings" 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 CaptionDestinationSettings
destinationSettings,
(Key
"languageCode" 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 LanguageCode
languageCode,
(Key
"languageDescription" 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 Text
languageDescription
]
)