{-# 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.ElasticTranscoder.Types.CaptionSource where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.ElasticTranscoder.Types.Encryption
import qualified Amazonka.Prelude as Prelude
data CaptionSource = CaptionSource'
{
CaptionSource -> Maybe Encryption
encryption :: Prelude.Maybe Encryption,
CaptionSource -> Maybe Text
key :: Prelude.Maybe Prelude.Text,
CaptionSource -> Maybe Text
label :: Prelude.Maybe Prelude.Text,
CaptionSource -> Maybe Text
language :: Prelude.Maybe Prelude.Text,
CaptionSource -> Maybe Text
timeOffset :: Prelude.Maybe Prelude.Text
}
deriving (CaptionSource -> CaptionSource -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CaptionSource -> CaptionSource -> Bool
$c/= :: CaptionSource -> CaptionSource -> Bool
== :: CaptionSource -> CaptionSource -> Bool
$c== :: CaptionSource -> CaptionSource -> Bool
Prelude.Eq, ReadPrec [CaptionSource]
ReadPrec CaptionSource
Int -> ReadS CaptionSource
ReadS [CaptionSource]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CaptionSource]
$creadListPrec :: ReadPrec [CaptionSource]
readPrec :: ReadPrec CaptionSource
$creadPrec :: ReadPrec CaptionSource
readList :: ReadS [CaptionSource]
$creadList :: ReadS [CaptionSource]
readsPrec :: Int -> ReadS CaptionSource
$creadsPrec :: Int -> ReadS CaptionSource
Prelude.Read, Int -> CaptionSource -> ShowS
[CaptionSource] -> ShowS
CaptionSource -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CaptionSource] -> ShowS
$cshowList :: [CaptionSource] -> ShowS
show :: CaptionSource -> String
$cshow :: CaptionSource -> String
showsPrec :: Int -> CaptionSource -> ShowS
$cshowsPrec :: Int -> CaptionSource -> ShowS
Prelude.Show, forall x. Rep CaptionSource x -> CaptionSource
forall x. CaptionSource -> Rep CaptionSource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CaptionSource x -> CaptionSource
$cfrom :: forall x. CaptionSource -> Rep CaptionSource x
Prelude.Generic)
newCaptionSource ::
CaptionSource
newCaptionSource :: CaptionSource
newCaptionSource =
CaptionSource'
{ $sel:encryption:CaptionSource' :: Maybe Encryption
encryption = forall a. Maybe a
Prelude.Nothing,
$sel:key:CaptionSource' :: Maybe Text
key = forall a. Maybe a
Prelude.Nothing,
$sel:label:CaptionSource' :: Maybe Text
label = forall a. Maybe a
Prelude.Nothing,
$sel:language:CaptionSource' :: Maybe Text
language = forall a. Maybe a
Prelude.Nothing,
$sel:timeOffset:CaptionSource' :: Maybe Text
timeOffset = forall a. Maybe a
Prelude.Nothing
}
captionSource_encryption :: Lens.Lens' CaptionSource (Prelude.Maybe Encryption)
captionSource_encryption :: Lens' CaptionSource (Maybe Encryption)
captionSource_encryption = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CaptionSource' {Maybe Encryption
encryption :: Maybe Encryption
$sel:encryption:CaptionSource' :: CaptionSource -> Maybe Encryption
encryption} -> Maybe Encryption
encryption) (\s :: CaptionSource
s@CaptionSource' {} Maybe Encryption
a -> CaptionSource
s {$sel:encryption:CaptionSource' :: Maybe Encryption
encryption = Maybe Encryption
a} :: CaptionSource)
captionSource_key :: Lens.Lens' CaptionSource (Prelude.Maybe Prelude.Text)
captionSource_key :: Lens' CaptionSource (Maybe Text)
captionSource_key = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CaptionSource' {Maybe Text
key :: Maybe Text
$sel:key:CaptionSource' :: CaptionSource -> Maybe Text
key} -> Maybe Text
key) (\s :: CaptionSource
s@CaptionSource' {} Maybe Text
a -> CaptionSource
s {$sel:key:CaptionSource' :: Maybe Text
key = Maybe Text
a} :: CaptionSource)
captionSource_label :: Lens.Lens' CaptionSource (Prelude.Maybe Prelude.Text)
captionSource_label :: Lens' CaptionSource (Maybe Text)
captionSource_label = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CaptionSource' {Maybe Text
label :: Maybe Text
$sel:label:CaptionSource' :: CaptionSource -> Maybe Text
label} -> Maybe Text
label) (\s :: CaptionSource
s@CaptionSource' {} Maybe Text
a -> CaptionSource
s {$sel:label:CaptionSource' :: Maybe Text
label = Maybe Text
a} :: CaptionSource)
captionSource_language :: Lens.Lens' CaptionSource (Prelude.Maybe Prelude.Text)
captionSource_language :: Lens' CaptionSource (Maybe Text)
captionSource_language = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CaptionSource' {Maybe Text
language :: Maybe Text
$sel:language:CaptionSource' :: CaptionSource -> Maybe Text
language} -> Maybe Text
language) (\s :: CaptionSource
s@CaptionSource' {} Maybe Text
a -> CaptionSource
s {$sel:language:CaptionSource' :: Maybe Text
language = Maybe Text
a} :: CaptionSource)
captionSource_timeOffset :: Lens.Lens' CaptionSource (Prelude.Maybe Prelude.Text)
captionSource_timeOffset :: Lens' CaptionSource (Maybe Text)
captionSource_timeOffset = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CaptionSource' {Maybe Text
timeOffset :: Maybe Text
$sel:timeOffset:CaptionSource' :: CaptionSource -> Maybe Text
timeOffset} -> Maybe Text
timeOffset) (\s :: CaptionSource
s@CaptionSource' {} Maybe Text
a -> CaptionSource
s {$sel:timeOffset:CaptionSource' :: Maybe Text
timeOffset = Maybe Text
a} :: CaptionSource)
instance Data.FromJSON CaptionSource where
parseJSON :: Value -> Parser CaptionSource
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"CaptionSource"
( \Object
x ->
Maybe Encryption
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> CaptionSource
CaptionSource'
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
"Encryption")
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
"Key")
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
"Label")
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
"Language")
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
"TimeOffset")
)
instance Prelude.Hashable CaptionSource where
hashWithSalt :: Int -> CaptionSource -> Int
hashWithSalt Int
_salt CaptionSource' {Maybe Text
Maybe Encryption
timeOffset :: Maybe Text
language :: Maybe Text
label :: Maybe Text
key :: Maybe Text
encryption :: Maybe Encryption
$sel:timeOffset:CaptionSource' :: CaptionSource -> Maybe Text
$sel:language:CaptionSource' :: CaptionSource -> Maybe Text
$sel:label:CaptionSource' :: CaptionSource -> Maybe Text
$sel:key:CaptionSource' :: CaptionSource -> Maybe Text
$sel:encryption:CaptionSource' :: CaptionSource -> Maybe Encryption
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Encryption
encryption
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
key
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
label
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
language
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
timeOffset
instance Prelude.NFData CaptionSource where
rnf :: CaptionSource -> ()
rnf CaptionSource' {Maybe Text
Maybe Encryption
timeOffset :: Maybe Text
language :: Maybe Text
label :: Maybe Text
key :: Maybe Text
encryption :: Maybe Encryption
$sel:timeOffset:CaptionSource' :: CaptionSource -> Maybe Text
$sel:language:CaptionSource' :: CaptionSource -> Maybe Text
$sel:label:CaptionSource' :: CaptionSource -> Maybe Text
$sel:key:CaptionSource' :: CaptionSource -> Maybe Text
$sel:encryption:CaptionSource' :: CaptionSource -> Maybe Encryption
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Encryption
encryption
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
key
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
label
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
language
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
timeOffset
instance Data.ToJSON CaptionSource where
toJSON :: CaptionSource -> Value
toJSON CaptionSource' {Maybe Text
Maybe Encryption
timeOffset :: Maybe Text
language :: Maybe Text
label :: Maybe Text
key :: Maybe Text
encryption :: Maybe Encryption
$sel:timeOffset:CaptionSource' :: CaptionSource -> Maybe Text
$sel:language:CaptionSource' :: CaptionSource -> Maybe Text
$sel:label:CaptionSource' :: CaptionSource -> Maybe Text
$sel:key:CaptionSource' :: CaptionSource -> Maybe Text
$sel:encryption:CaptionSource' :: CaptionSource -> Maybe Encryption
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"Encryption" 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 Encryption
encryption,
(Key
"Key" 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
key,
(Key
"Label" 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
label,
(Key
"Language" 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
language,
(Key
"TimeOffset" 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
timeOffset
]
)