{-# 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 Amazonka.ElasticTranscoder.Types.Encryption
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data CaptionFormat = CaptionFormat'
{
CaptionFormat -> Maybe Text
pattern' :: Prelude.Maybe Prelude.Text,
CaptionFormat -> Maybe Text
format :: Prelude.Maybe Prelude.Text,
CaptionFormat -> Maybe Encryption
encryption :: Prelude.Maybe Encryption
}
deriving (CaptionFormat -> CaptionFormat -> Bool
(CaptionFormat -> CaptionFormat -> Bool)
-> (CaptionFormat -> CaptionFormat -> Bool) -> Eq CaptionFormat
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]
(Int -> ReadS CaptionFormat)
-> ReadS [CaptionFormat]
-> ReadPrec CaptionFormat
-> ReadPrec [CaptionFormat]
-> Read 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
(Int -> CaptionFormat -> ShowS)
-> (CaptionFormat -> String)
-> ([CaptionFormat] -> ShowS)
-> Show CaptionFormat
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. CaptionFormat -> Rep CaptionFormat x)
-> (forall x. Rep CaptionFormat x -> CaptionFormat)
-> Generic CaptionFormat
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' :: Maybe Text -> Maybe Text -> Maybe Encryption -> CaptionFormat
CaptionFormat'
{ $sel:pattern':CaptionFormat' :: Maybe Text
pattern' = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:format:CaptionFormat' :: Maybe Text
format = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:encryption:CaptionFormat' :: Maybe Encryption
encryption = Maybe Encryption
forall a. Maybe a
Prelude.Nothing
}
captionFormat_pattern :: Lens.Lens' CaptionFormat (Prelude.Maybe Prelude.Text)
captionFormat_pattern :: (Maybe Text -> f (Maybe Text)) -> CaptionFormat -> f CaptionFormat
captionFormat_pattern = (CaptionFormat -> Maybe Text)
-> (CaptionFormat -> Maybe Text -> CaptionFormat)
-> Lens CaptionFormat CaptionFormat (Maybe Text) (Maybe Text)
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)
captionFormat_format :: Lens.Lens' CaptionFormat (Prelude.Maybe Prelude.Text)
captionFormat_format :: (Maybe Text -> f (Maybe Text)) -> CaptionFormat -> f CaptionFormat
captionFormat_format = (CaptionFormat -> Maybe Text)
-> (CaptionFormat -> Maybe Text -> CaptionFormat)
-> Lens CaptionFormat CaptionFormat (Maybe Text) (Maybe Text)
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_encryption :: Lens.Lens' CaptionFormat (Prelude.Maybe Encryption)
captionFormat_encryption :: (Maybe Encryption -> f (Maybe Encryption))
-> CaptionFormat -> f CaptionFormat
captionFormat_encryption = (CaptionFormat -> Maybe Encryption)
-> (CaptionFormat -> Maybe Encryption -> CaptionFormat)
-> Lens
CaptionFormat CaptionFormat (Maybe Encryption) (Maybe 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)
instance Core.FromJSON CaptionFormat where
parseJSON :: Value -> Parser CaptionFormat
parseJSON =
String
-> (Object -> Parser CaptionFormat)
-> Value
-> Parser CaptionFormat
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"CaptionFormat"
( \Object
x ->
Maybe Text -> Maybe Text -> Maybe Encryption -> CaptionFormat
CaptionFormat'
(Maybe Text -> Maybe Text -> Maybe Encryption -> CaptionFormat)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Encryption -> CaptionFormat)
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
"Pattern")
Parser (Maybe Text -> Maybe Encryption -> CaptionFormat)
-> Parser (Maybe Text)
-> Parser (Maybe Encryption -> CaptionFormat)
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
"Format")
Parser (Maybe Encryption -> CaptionFormat)
-> Parser (Maybe Encryption) -> Parser CaptionFormat
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Encryption)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Encryption")
)
instance Prelude.Hashable CaptionFormat
instance Prelude.NFData CaptionFormat
instance Core.ToJSON CaptionFormat where
toJSON :: CaptionFormat -> Value
toJSON CaptionFormat' {Maybe Text
Maybe Encryption
encryption :: Maybe Encryption
format :: Maybe Text
pattern' :: Maybe Text
$sel:encryption:CaptionFormat' :: CaptionFormat -> Maybe Encryption
$sel:format:CaptionFormat' :: CaptionFormat -> Maybe Text
$sel:pattern':CaptionFormat' :: CaptionFormat -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Pattern" 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
pattern',
(Text
"Format" 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
format,
(Text
"Encryption" Text -> Encryption -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Encryption -> Pair) -> Maybe Encryption -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Encryption
encryption
]
)