{-# 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.JobAlbumArt where
import qualified Amazonka.Core as Core
import Amazonka.ElasticTranscoder.Types.Artwork
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data JobAlbumArt = JobAlbumArt'
{
JobAlbumArt -> Maybe Text
mergePolicy :: Prelude.Maybe Prelude.Text,
JobAlbumArt -> Maybe [Artwork]
artwork :: Prelude.Maybe [Artwork]
}
deriving (JobAlbumArt -> JobAlbumArt -> Bool
(JobAlbumArt -> JobAlbumArt -> Bool)
-> (JobAlbumArt -> JobAlbumArt -> Bool) -> Eq JobAlbumArt
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: JobAlbumArt -> JobAlbumArt -> Bool
$c/= :: JobAlbumArt -> JobAlbumArt -> Bool
== :: JobAlbumArt -> JobAlbumArt -> Bool
$c== :: JobAlbumArt -> JobAlbumArt -> Bool
Prelude.Eq, ReadPrec [JobAlbumArt]
ReadPrec JobAlbumArt
Int -> ReadS JobAlbumArt
ReadS [JobAlbumArt]
(Int -> ReadS JobAlbumArt)
-> ReadS [JobAlbumArt]
-> ReadPrec JobAlbumArt
-> ReadPrec [JobAlbumArt]
-> Read JobAlbumArt
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [JobAlbumArt]
$creadListPrec :: ReadPrec [JobAlbumArt]
readPrec :: ReadPrec JobAlbumArt
$creadPrec :: ReadPrec JobAlbumArt
readList :: ReadS [JobAlbumArt]
$creadList :: ReadS [JobAlbumArt]
readsPrec :: Int -> ReadS JobAlbumArt
$creadsPrec :: Int -> ReadS JobAlbumArt
Prelude.Read, Int -> JobAlbumArt -> ShowS
[JobAlbumArt] -> ShowS
JobAlbumArt -> String
(Int -> JobAlbumArt -> ShowS)
-> (JobAlbumArt -> String)
-> ([JobAlbumArt] -> ShowS)
-> Show JobAlbumArt
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [JobAlbumArt] -> ShowS
$cshowList :: [JobAlbumArt] -> ShowS
show :: JobAlbumArt -> String
$cshow :: JobAlbumArt -> String
showsPrec :: Int -> JobAlbumArt -> ShowS
$cshowsPrec :: Int -> JobAlbumArt -> ShowS
Prelude.Show, (forall x. JobAlbumArt -> Rep JobAlbumArt x)
-> (forall x. Rep JobAlbumArt x -> JobAlbumArt)
-> Generic JobAlbumArt
forall x. Rep JobAlbumArt x -> JobAlbumArt
forall x. JobAlbumArt -> Rep JobAlbumArt x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep JobAlbumArt x -> JobAlbumArt
$cfrom :: forall x. JobAlbumArt -> Rep JobAlbumArt x
Prelude.Generic)
newJobAlbumArt ::
JobAlbumArt
newJobAlbumArt :: JobAlbumArt
newJobAlbumArt =
JobAlbumArt' :: Maybe Text -> Maybe [Artwork] -> JobAlbumArt
JobAlbumArt'
{ $sel:mergePolicy:JobAlbumArt' :: Maybe Text
mergePolicy = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:artwork:JobAlbumArt' :: Maybe [Artwork]
artwork = Maybe [Artwork]
forall a. Maybe a
Prelude.Nothing
}
jobAlbumArt_mergePolicy :: Lens.Lens' JobAlbumArt (Prelude.Maybe Prelude.Text)
jobAlbumArt_mergePolicy :: (Maybe Text -> f (Maybe Text)) -> JobAlbumArt -> f JobAlbumArt
jobAlbumArt_mergePolicy = (JobAlbumArt -> Maybe Text)
-> (JobAlbumArt -> Maybe Text -> JobAlbumArt)
-> Lens JobAlbumArt JobAlbumArt (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobAlbumArt' {Maybe Text
mergePolicy :: Maybe Text
$sel:mergePolicy:JobAlbumArt' :: JobAlbumArt -> Maybe Text
mergePolicy} -> Maybe Text
mergePolicy) (\s :: JobAlbumArt
s@JobAlbumArt' {} Maybe Text
a -> JobAlbumArt
s {$sel:mergePolicy:JobAlbumArt' :: Maybe Text
mergePolicy = Maybe Text
a} :: JobAlbumArt)
jobAlbumArt_artwork :: Lens.Lens' JobAlbumArt (Prelude.Maybe [Artwork])
jobAlbumArt_artwork :: (Maybe [Artwork] -> f (Maybe [Artwork]))
-> JobAlbumArt -> f JobAlbumArt
jobAlbumArt_artwork = (JobAlbumArt -> Maybe [Artwork])
-> (JobAlbumArt -> Maybe [Artwork] -> JobAlbumArt)
-> Lens JobAlbumArt JobAlbumArt (Maybe [Artwork]) (Maybe [Artwork])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobAlbumArt' {Maybe [Artwork]
artwork :: Maybe [Artwork]
$sel:artwork:JobAlbumArt' :: JobAlbumArt -> Maybe [Artwork]
artwork} -> Maybe [Artwork]
artwork) (\s :: JobAlbumArt
s@JobAlbumArt' {} Maybe [Artwork]
a -> JobAlbumArt
s {$sel:artwork:JobAlbumArt' :: Maybe [Artwork]
artwork = Maybe [Artwork]
a} :: JobAlbumArt) ((Maybe [Artwork] -> f (Maybe [Artwork]))
-> JobAlbumArt -> f JobAlbumArt)
-> ((Maybe [Artwork] -> f (Maybe [Artwork]))
-> Maybe [Artwork] -> f (Maybe [Artwork]))
-> (Maybe [Artwork] -> f (Maybe [Artwork]))
-> JobAlbumArt
-> f JobAlbumArt
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Artwork] [Artwork] [Artwork] [Artwork]
-> Iso
(Maybe [Artwork])
(Maybe [Artwork])
(Maybe [Artwork])
(Maybe [Artwork])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Artwork] [Artwork] [Artwork] [Artwork]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON JobAlbumArt where
parseJSON :: Value -> Parser JobAlbumArt
parseJSON =
String
-> (Object -> Parser JobAlbumArt) -> Value -> Parser JobAlbumArt
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"JobAlbumArt"
( \Object
x ->
Maybe Text -> Maybe [Artwork] -> JobAlbumArt
JobAlbumArt'
(Maybe Text -> Maybe [Artwork] -> JobAlbumArt)
-> Parser (Maybe Text) -> Parser (Maybe [Artwork] -> JobAlbumArt)
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
"MergePolicy")
Parser (Maybe [Artwork] -> JobAlbumArt)
-> Parser (Maybe [Artwork]) -> Parser JobAlbumArt
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Artwork]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Artwork" Parser (Maybe (Maybe [Artwork]))
-> Maybe [Artwork] -> Parser (Maybe [Artwork])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Artwork]
forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable JobAlbumArt
instance Prelude.NFData JobAlbumArt
instance Core.ToJSON JobAlbumArt where
toJSON :: JobAlbumArt -> Value
toJSON JobAlbumArt' {Maybe [Artwork]
Maybe Text
artwork :: Maybe [Artwork]
mergePolicy :: Maybe Text
$sel:artwork:JobAlbumArt' :: JobAlbumArt -> Maybe [Artwork]
$sel:mergePolicy:JobAlbumArt' :: JobAlbumArt -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"MergePolicy" 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
mergePolicy,
(Text
"Artwork" Text -> [Artwork] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Artwork] -> Pair) -> Maybe [Artwork] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Artwork]
artwork
]
)