{-# 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.WebvttHlsSourceSettings where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaConvert.Types.LanguageCode
import qualified Amazonka.Prelude as Prelude
data WebvttHlsSourceSettings = WebvttHlsSourceSettings'
{
WebvttHlsSourceSettings -> Maybe Text
renditionName :: Prelude.Maybe Prelude.Text,
WebvttHlsSourceSettings -> Maybe Text
renditionGroupId :: Prelude.Maybe Prelude.Text,
WebvttHlsSourceSettings -> Maybe LanguageCode
renditionLanguageCode :: Prelude.Maybe LanguageCode
}
deriving (WebvttHlsSourceSettings -> WebvttHlsSourceSettings -> Bool
(WebvttHlsSourceSettings -> WebvttHlsSourceSettings -> Bool)
-> (WebvttHlsSourceSettings -> WebvttHlsSourceSettings -> Bool)
-> Eq WebvttHlsSourceSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WebvttHlsSourceSettings -> WebvttHlsSourceSettings -> Bool
$c/= :: WebvttHlsSourceSettings -> WebvttHlsSourceSettings -> Bool
== :: WebvttHlsSourceSettings -> WebvttHlsSourceSettings -> Bool
$c== :: WebvttHlsSourceSettings -> WebvttHlsSourceSettings -> Bool
Prelude.Eq, ReadPrec [WebvttHlsSourceSettings]
ReadPrec WebvttHlsSourceSettings
Int -> ReadS WebvttHlsSourceSettings
ReadS [WebvttHlsSourceSettings]
(Int -> ReadS WebvttHlsSourceSettings)
-> ReadS [WebvttHlsSourceSettings]
-> ReadPrec WebvttHlsSourceSettings
-> ReadPrec [WebvttHlsSourceSettings]
-> Read WebvttHlsSourceSettings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [WebvttHlsSourceSettings]
$creadListPrec :: ReadPrec [WebvttHlsSourceSettings]
readPrec :: ReadPrec WebvttHlsSourceSettings
$creadPrec :: ReadPrec WebvttHlsSourceSettings
readList :: ReadS [WebvttHlsSourceSettings]
$creadList :: ReadS [WebvttHlsSourceSettings]
readsPrec :: Int -> ReadS WebvttHlsSourceSettings
$creadsPrec :: Int -> ReadS WebvttHlsSourceSettings
Prelude.Read, Int -> WebvttHlsSourceSettings -> ShowS
[WebvttHlsSourceSettings] -> ShowS
WebvttHlsSourceSettings -> String
(Int -> WebvttHlsSourceSettings -> ShowS)
-> (WebvttHlsSourceSettings -> String)
-> ([WebvttHlsSourceSettings] -> ShowS)
-> Show WebvttHlsSourceSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WebvttHlsSourceSettings] -> ShowS
$cshowList :: [WebvttHlsSourceSettings] -> ShowS
show :: WebvttHlsSourceSettings -> String
$cshow :: WebvttHlsSourceSettings -> String
showsPrec :: Int -> WebvttHlsSourceSettings -> ShowS
$cshowsPrec :: Int -> WebvttHlsSourceSettings -> ShowS
Prelude.Show, (forall x.
WebvttHlsSourceSettings -> Rep WebvttHlsSourceSettings x)
-> (forall x.
Rep WebvttHlsSourceSettings x -> WebvttHlsSourceSettings)
-> Generic WebvttHlsSourceSettings
forall x. Rep WebvttHlsSourceSettings x -> WebvttHlsSourceSettings
forall x. WebvttHlsSourceSettings -> Rep WebvttHlsSourceSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep WebvttHlsSourceSettings x -> WebvttHlsSourceSettings
$cfrom :: forall x. WebvttHlsSourceSettings -> Rep WebvttHlsSourceSettings x
Prelude.Generic)
newWebvttHlsSourceSettings ::
WebvttHlsSourceSettings
newWebvttHlsSourceSettings :: WebvttHlsSourceSettings
newWebvttHlsSourceSettings =
WebvttHlsSourceSettings' :: Maybe Text
-> Maybe Text -> Maybe LanguageCode -> WebvttHlsSourceSettings
WebvttHlsSourceSettings'
{ $sel:renditionName:WebvttHlsSourceSettings' :: Maybe Text
renditionName =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:renditionGroupId:WebvttHlsSourceSettings' :: Maybe Text
renditionGroupId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:renditionLanguageCode:WebvttHlsSourceSettings' :: Maybe LanguageCode
renditionLanguageCode = Maybe LanguageCode
forall a. Maybe a
Prelude.Nothing
}
webvttHlsSourceSettings_renditionName :: Lens.Lens' WebvttHlsSourceSettings (Prelude.Maybe Prelude.Text)
webvttHlsSourceSettings_renditionName :: (Maybe Text -> f (Maybe Text))
-> WebvttHlsSourceSettings -> f WebvttHlsSourceSettings
webvttHlsSourceSettings_renditionName = (WebvttHlsSourceSettings -> Maybe Text)
-> (WebvttHlsSourceSettings
-> Maybe Text -> WebvttHlsSourceSettings)
-> Lens
WebvttHlsSourceSettings
WebvttHlsSourceSettings
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WebvttHlsSourceSettings' {Maybe Text
renditionName :: Maybe Text
$sel:renditionName:WebvttHlsSourceSettings' :: WebvttHlsSourceSettings -> Maybe Text
renditionName} -> Maybe Text
renditionName) (\s :: WebvttHlsSourceSettings
s@WebvttHlsSourceSettings' {} Maybe Text
a -> WebvttHlsSourceSettings
s {$sel:renditionName:WebvttHlsSourceSettings' :: Maybe Text
renditionName = Maybe Text
a} :: WebvttHlsSourceSettings)
webvttHlsSourceSettings_renditionGroupId :: Lens.Lens' WebvttHlsSourceSettings (Prelude.Maybe Prelude.Text)
webvttHlsSourceSettings_renditionGroupId :: (Maybe Text -> f (Maybe Text))
-> WebvttHlsSourceSettings -> f WebvttHlsSourceSettings
webvttHlsSourceSettings_renditionGroupId = (WebvttHlsSourceSettings -> Maybe Text)
-> (WebvttHlsSourceSettings
-> Maybe Text -> WebvttHlsSourceSettings)
-> Lens
WebvttHlsSourceSettings
WebvttHlsSourceSettings
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WebvttHlsSourceSettings' {Maybe Text
renditionGroupId :: Maybe Text
$sel:renditionGroupId:WebvttHlsSourceSettings' :: WebvttHlsSourceSettings -> Maybe Text
renditionGroupId} -> Maybe Text
renditionGroupId) (\s :: WebvttHlsSourceSettings
s@WebvttHlsSourceSettings' {} Maybe Text
a -> WebvttHlsSourceSettings
s {$sel:renditionGroupId:WebvttHlsSourceSettings' :: Maybe Text
renditionGroupId = Maybe Text
a} :: WebvttHlsSourceSettings)
webvttHlsSourceSettings_renditionLanguageCode :: Lens.Lens' WebvttHlsSourceSettings (Prelude.Maybe LanguageCode)
webvttHlsSourceSettings_renditionLanguageCode :: (Maybe LanguageCode -> f (Maybe LanguageCode))
-> WebvttHlsSourceSettings -> f WebvttHlsSourceSettings
webvttHlsSourceSettings_renditionLanguageCode = (WebvttHlsSourceSettings -> Maybe LanguageCode)
-> (WebvttHlsSourceSettings
-> Maybe LanguageCode -> WebvttHlsSourceSettings)
-> Lens
WebvttHlsSourceSettings
WebvttHlsSourceSettings
(Maybe LanguageCode)
(Maybe LanguageCode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WebvttHlsSourceSettings' {Maybe LanguageCode
renditionLanguageCode :: Maybe LanguageCode
$sel:renditionLanguageCode:WebvttHlsSourceSettings' :: WebvttHlsSourceSettings -> Maybe LanguageCode
renditionLanguageCode} -> Maybe LanguageCode
renditionLanguageCode) (\s :: WebvttHlsSourceSettings
s@WebvttHlsSourceSettings' {} Maybe LanguageCode
a -> WebvttHlsSourceSettings
s {$sel:renditionLanguageCode:WebvttHlsSourceSettings' :: Maybe LanguageCode
renditionLanguageCode = Maybe LanguageCode
a} :: WebvttHlsSourceSettings)
instance Core.FromJSON WebvttHlsSourceSettings where
parseJSON :: Value -> Parser WebvttHlsSourceSettings
parseJSON =
String
-> (Object -> Parser WebvttHlsSourceSettings)
-> Value
-> Parser WebvttHlsSourceSettings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"WebvttHlsSourceSettings"
( \Object
x ->
Maybe Text
-> Maybe Text -> Maybe LanguageCode -> WebvttHlsSourceSettings
WebvttHlsSourceSettings'
(Maybe Text
-> Maybe Text -> Maybe LanguageCode -> WebvttHlsSourceSettings)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe LanguageCode -> WebvttHlsSourceSettings)
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
"renditionName")
Parser
(Maybe Text -> Maybe LanguageCode -> WebvttHlsSourceSettings)
-> Parser (Maybe Text)
-> Parser (Maybe LanguageCode -> WebvttHlsSourceSettings)
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
"renditionGroupId")
Parser (Maybe LanguageCode -> WebvttHlsSourceSettings)
-> Parser (Maybe LanguageCode) -> Parser WebvttHlsSourceSettings
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
"renditionLanguageCode")
)
instance Prelude.Hashable WebvttHlsSourceSettings
instance Prelude.NFData WebvttHlsSourceSettings
instance Core.ToJSON WebvttHlsSourceSettings where
toJSON :: WebvttHlsSourceSettings -> Value
toJSON WebvttHlsSourceSettings' {Maybe Text
Maybe LanguageCode
renditionLanguageCode :: Maybe LanguageCode
renditionGroupId :: Maybe Text
renditionName :: Maybe Text
$sel:renditionLanguageCode:WebvttHlsSourceSettings' :: WebvttHlsSourceSettings -> Maybe LanguageCode
$sel:renditionGroupId:WebvttHlsSourceSettings' :: WebvttHlsSourceSettings -> Maybe Text
$sel:renditionName:WebvttHlsSourceSettings' :: WebvttHlsSourceSettings -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"renditionName" 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
renditionName,
(Text
"renditionGroupId" 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
renditionGroupId,
(Text
"renditionLanguageCode" 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
renditionLanguageCode
]
)