{-# 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.JobWatermark 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 JobWatermark = JobWatermark'
{
JobWatermark -> Maybe Text
presetWatermarkId :: Prelude.Maybe Prelude.Text,
JobWatermark -> Maybe Text
inputKey :: Prelude.Maybe Prelude.Text,
JobWatermark -> Maybe Encryption
encryption :: Prelude.Maybe Encryption
}
deriving (JobWatermark -> JobWatermark -> Bool
(JobWatermark -> JobWatermark -> Bool)
-> (JobWatermark -> JobWatermark -> Bool) -> Eq JobWatermark
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: JobWatermark -> JobWatermark -> Bool
$c/= :: JobWatermark -> JobWatermark -> Bool
== :: JobWatermark -> JobWatermark -> Bool
$c== :: JobWatermark -> JobWatermark -> Bool
Prelude.Eq, ReadPrec [JobWatermark]
ReadPrec JobWatermark
Int -> ReadS JobWatermark
ReadS [JobWatermark]
(Int -> ReadS JobWatermark)
-> ReadS [JobWatermark]
-> ReadPrec JobWatermark
-> ReadPrec [JobWatermark]
-> Read JobWatermark
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [JobWatermark]
$creadListPrec :: ReadPrec [JobWatermark]
readPrec :: ReadPrec JobWatermark
$creadPrec :: ReadPrec JobWatermark
readList :: ReadS [JobWatermark]
$creadList :: ReadS [JobWatermark]
readsPrec :: Int -> ReadS JobWatermark
$creadsPrec :: Int -> ReadS JobWatermark
Prelude.Read, Int -> JobWatermark -> ShowS
[JobWatermark] -> ShowS
JobWatermark -> String
(Int -> JobWatermark -> ShowS)
-> (JobWatermark -> String)
-> ([JobWatermark] -> ShowS)
-> Show JobWatermark
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [JobWatermark] -> ShowS
$cshowList :: [JobWatermark] -> ShowS
show :: JobWatermark -> String
$cshow :: JobWatermark -> String
showsPrec :: Int -> JobWatermark -> ShowS
$cshowsPrec :: Int -> JobWatermark -> ShowS
Prelude.Show, (forall x. JobWatermark -> Rep JobWatermark x)
-> (forall x. Rep JobWatermark x -> JobWatermark)
-> Generic JobWatermark
forall x. Rep JobWatermark x -> JobWatermark
forall x. JobWatermark -> Rep JobWatermark x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep JobWatermark x -> JobWatermark
$cfrom :: forall x. JobWatermark -> Rep JobWatermark x
Prelude.Generic)
newJobWatermark ::
JobWatermark
newJobWatermark :: JobWatermark
newJobWatermark =
JobWatermark' :: Maybe Text -> Maybe Text -> Maybe Encryption -> JobWatermark
JobWatermark'
{ $sel:presetWatermarkId:JobWatermark' :: Maybe Text
presetWatermarkId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:inputKey:JobWatermark' :: Maybe Text
inputKey = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:encryption:JobWatermark' :: Maybe Encryption
encryption = Maybe Encryption
forall a. Maybe a
Prelude.Nothing
}
jobWatermark_presetWatermarkId :: Lens.Lens' JobWatermark (Prelude.Maybe Prelude.Text)
jobWatermark_presetWatermarkId :: (Maybe Text -> f (Maybe Text)) -> JobWatermark -> f JobWatermark
jobWatermark_presetWatermarkId = (JobWatermark -> Maybe Text)
-> (JobWatermark -> Maybe Text -> JobWatermark)
-> Lens JobWatermark JobWatermark (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobWatermark' {Maybe Text
presetWatermarkId :: Maybe Text
$sel:presetWatermarkId:JobWatermark' :: JobWatermark -> Maybe Text
presetWatermarkId} -> Maybe Text
presetWatermarkId) (\s :: JobWatermark
s@JobWatermark' {} Maybe Text
a -> JobWatermark
s {$sel:presetWatermarkId:JobWatermark' :: Maybe Text
presetWatermarkId = Maybe Text
a} :: JobWatermark)
jobWatermark_inputKey :: Lens.Lens' JobWatermark (Prelude.Maybe Prelude.Text)
jobWatermark_inputKey :: (Maybe Text -> f (Maybe Text)) -> JobWatermark -> f JobWatermark
jobWatermark_inputKey = (JobWatermark -> Maybe Text)
-> (JobWatermark -> Maybe Text -> JobWatermark)
-> Lens JobWatermark JobWatermark (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobWatermark' {Maybe Text
inputKey :: Maybe Text
$sel:inputKey:JobWatermark' :: JobWatermark -> Maybe Text
inputKey} -> Maybe Text
inputKey) (\s :: JobWatermark
s@JobWatermark' {} Maybe Text
a -> JobWatermark
s {$sel:inputKey:JobWatermark' :: Maybe Text
inputKey = Maybe Text
a} :: JobWatermark)
jobWatermark_encryption :: Lens.Lens' JobWatermark (Prelude.Maybe Encryption)
jobWatermark_encryption :: (Maybe Encryption -> f (Maybe Encryption))
-> JobWatermark -> f JobWatermark
jobWatermark_encryption = (JobWatermark -> Maybe Encryption)
-> (JobWatermark -> Maybe Encryption -> JobWatermark)
-> Lens
JobWatermark JobWatermark (Maybe Encryption) (Maybe Encryption)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobWatermark' {Maybe Encryption
encryption :: Maybe Encryption
$sel:encryption:JobWatermark' :: JobWatermark -> Maybe Encryption
encryption} -> Maybe Encryption
encryption) (\s :: JobWatermark
s@JobWatermark' {} Maybe Encryption
a -> JobWatermark
s {$sel:encryption:JobWatermark' :: Maybe Encryption
encryption = Maybe Encryption
a} :: JobWatermark)
instance Core.FromJSON JobWatermark where
parseJSON :: Value -> Parser JobWatermark
parseJSON =
String
-> (Object -> Parser JobWatermark) -> Value -> Parser JobWatermark
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"JobWatermark"
( \Object
x ->
Maybe Text -> Maybe Text -> Maybe Encryption -> JobWatermark
JobWatermark'
(Maybe Text -> Maybe Text -> Maybe Encryption -> JobWatermark)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Encryption -> JobWatermark)
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
"PresetWatermarkId")
Parser (Maybe Text -> Maybe Encryption -> JobWatermark)
-> Parser (Maybe Text) -> Parser (Maybe Encryption -> JobWatermark)
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
"InputKey")
Parser (Maybe Encryption -> JobWatermark)
-> Parser (Maybe Encryption) -> Parser JobWatermark
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 JobWatermark
instance Prelude.NFData JobWatermark
instance Core.ToJSON JobWatermark where
toJSON :: JobWatermark -> Value
toJSON JobWatermark' {Maybe Text
Maybe Encryption
encryption :: Maybe Encryption
inputKey :: Maybe Text
presetWatermarkId :: Maybe Text
$sel:encryption:JobWatermark' :: JobWatermark -> Maybe Encryption
$sel:inputKey:JobWatermark' :: JobWatermark -> Maybe Text
$sel:presetWatermarkId:JobWatermark' :: JobWatermark -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"PresetWatermarkId" 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
presetWatermarkId,
(Text
"InputKey" 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
inputKey,
(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
]
)