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