{-# 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.CaptionFormat 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 CaptionFormat = CaptionFormat'
{
CaptionFormat -> Maybe Encryption
encryption :: Prelude.Maybe Encryption,
CaptionFormat -> Maybe Text
format :: Prelude.Maybe Prelude.Text,
CaptionFormat -> Maybe Text
pattern' :: Prelude.Maybe Prelude.Text
}
deriving (CaptionFormat -> CaptionFormat -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CaptionFormat -> CaptionFormat -> Bool
$c/= :: CaptionFormat -> CaptionFormat -> Bool
== :: CaptionFormat -> CaptionFormat -> Bool
$c== :: CaptionFormat -> CaptionFormat -> Bool
Prelude.Eq, ReadPrec [CaptionFormat]
ReadPrec CaptionFormat
Int -> ReadS CaptionFormat
ReadS [CaptionFormat]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CaptionFormat]
$creadListPrec :: ReadPrec [CaptionFormat]
readPrec :: ReadPrec CaptionFormat
$creadPrec :: ReadPrec CaptionFormat
readList :: ReadS [CaptionFormat]
$creadList :: ReadS [CaptionFormat]
readsPrec :: Int -> ReadS CaptionFormat
$creadsPrec :: Int -> ReadS CaptionFormat
Prelude.Read, Int -> CaptionFormat -> ShowS
[CaptionFormat] -> ShowS
CaptionFormat -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CaptionFormat] -> ShowS
$cshowList :: [CaptionFormat] -> ShowS
show :: CaptionFormat -> String
$cshow :: CaptionFormat -> String
showsPrec :: Int -> CaptionFormat -> ShowS
$cshowsPrec :: Int -> CaptionFormat -> ShowS
Prelude.Show, forall x. Rep CaptionFormat x -> CaptionFormat
forall x. CaptionFormat -> Rep CaptionFormat x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CaptionFormat x -> CaptionFormat
$cfrom :: forall x. CaptionFormat -> Rep CaptionFormat x
Prelude.Generic)
newCaptionFormat ::
CaptionFormat
newCaptionFormat :: CaptionFormat
newCaptionFormat =
CaptionFormat'
{ $sel:encryption:CaptionFormat' :: Maybe Encryption
encryption = forall a. Maybe a
Prelude.Nothing,
$sel:format:CaptionFormat' :: Maybe Text
format = forall a. Maybe a
Prelude.Nothing,
$sel:pattern':CaptionFormat' :: Maybe Text
pattern' = forall a. Maybe a
Prelude.Nothing
}
captionFormat_encryption :: Lens.Lens' CaptionFormat (Prelude.Maybe Encryption)
captionFormat_encryption :: Lens' CaptionFormat (Maybe Encryption)
captionFormat_encryption = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CaptionFormat' {Maybe Encryption
encryption :: Maybe Encryption
$sel:encryption:CaptionFormat' :: CaptionFormat -> Maybe Encryption
encryption} -> Maybe Encryption
encryption) (\s :: CaptionFormat
s@CaptionFormat' {} Maybe Encryption
a -> CaptionFormat
s {$sel:encryption:CaptionFormat' :: Maybe Encryption
encryption = Maybe Encryption
a} :: CaptionFormat)
captionFormat_format :: Lens.Lens' CaptionFormat (Prelude.Maybe Prelude.Text)
captionFormat_format :: Lens' CaptionFormat (Maybe Text)
captionFormat_format = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CaptionFormat' {Maybe Text
format :: Maybe Text
$sel:format:CaptionFormat' :: CaptionFormat -> Maybe Text
format} -> Maybe Text
format) (\s :: CaptionFormat
s@CaptionFormat' {} Maybe Text
a -> CaptionFormat
s {$sel:format:CaptionFormat' :: Maybe Text
format = Maybe Text
a} :: CaptionFormat)
captionFormat_pattern :: Lens.Lens' CaptionFormat (Prelude.Maybe Prelude.Text)
captionFormat_pattern :: Lens' CaptionFormat (Maybe Text)
captionFormat_pattern = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CaptionFormat' {Maybe Text
pattern' :: Maybe Text
$sel:pattern':CaptionFormat' :: CaptionFormat -> Maybe Text
pattern'} -> Maybe Text
pattern') (\s :: CaptionFormat
s@CaptionFormat' {} Maybe Text
a -> CaptionFormat
s {$sel:pattern':CaptionFormat' :: Maybe Text
pattern' = Maybe Text
a} :: CaptionFormat)
instance Data.FromJSON CaptionFormat where
parseJSON :: Value -> Parser CaptionFormat
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"CaptionFormat"
( \Object
x ->
Maybe Encryption -> Maybe Text -> Maybe Text -> CaptionFormat
CaptionFormat'
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
"Format")
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
"Pattern")
)
instance Prelude.Hashable CaptionFormat where
hashWithSalt :: Int -> CaptionFormat -> Int
hashWithSalt Int
_salt CaptionFormat' {Maybe Text
Maybe Encryption
pattern' :: Maybe Text
format :: Maybe Text
encryption :: Maybe Encryption
$sel:pattern':CaptionFormat' :: CaptionFormat -> Maybe Text
$sel:format:CaptionFormat' :: CaptionFormat -> Maybe Text
$sel:encryption:CaptionFormat' :: CaptionFormat -> 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
format
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
pattern'
instance Prelude.NFData CaptionFormat where
rnf :: CaptionFormat -> ()
rnf CaptionFormat' {Maybe Text
Maybe Encryption
pattern' :: Maybe Text
format :: Maybe Text
encryption :: Maybe Encryption
$sel:pattern':CaptionFormat' :: CaptionFormat -> Maybe Text
$sel:format:CaptionFormat' :: CaptionFormat -> Maybe Text
$sel:encryption:CaptionFormat' :: CaptionFormat -> 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
format
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
pattern'
instance Data.ToJSON CaptionFormat where
toJSON :: CaptionFormat -> Value
toJSON CaptionFormat' {Maybe Text
Maybe Encryption
pattern' :: Maybe Text
format :: Maybe Text
encryption :: Maybe Encryption
$sel:pattern':CaptionFormat' :: CaptionFormat -> Maybe Text
$sel:format:CaptionFormat' :: CaptionFormat -> Maybe Text
$sel:encryption:CaptionFormat' :: CaptionFormat -> 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
"Format" 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
format,
(Key
"Pattern" 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
pattern'
]
)