{-# 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.Amplify.Types.JobSummary where
import Amazonka.Amplify.Types.JobStatus
import Amazonka.Amplify.Types.JobType
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data JobSummary = JobSummary'
{
JobSummary -> Maybe POSIX
endTime :: Prelude.Maybe Core.POSIX,
JobSummary -> Text
jobArn :: Prelude.Text,
JobSummary -> Text
jobId :: Prelude.Text,
JobSummary -> Text
commitId :: Prelude.Text,
JobSummary -> Text
commitMessage :: Prelude.Text,
JobSummary -> POSIX
commitTime :: Core.POSIX,
JobSummary -> POSIX
startTime :: Core.POSIX,
JobSummary -> JobStatus
status :: JobStatus,
JobSummary -> JobType
jobType :: JobType
}
deriving (JobSummary -> JobSummary -> Bool
(JobSummary -> JobSummary -> Bool)
-> (JobSummary -> JobSummary -> Bool) -> Eq JobSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: JobSummary -> JobSummary -> Bool
$c/= :: JobSummary -> JobSummary -> Bool
== :: JobSummary -> JobSummary -> Bool
$c== :: JobSummary -> JobSummary -> Bool
Prelude.Eq, ReadPrec [JobSummary]
ReadPrec JobSummary
Int -> ReadS JobSummary
ReadS [JobSummary]
(Int -> ReadS JobSummary)
-> ReadS [JobSummary]
-> ReadPrec JobSummary
-> ReadPrec [JobSummary]
-> Read JobSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [JobSummary]
$creadListPrec :: ReadPrec [JobSummary]
readPrec :: ReadPrec JobSummary
$creadPrec :: ReadPrec JobSummary
readList :: ReadS [JobSummary]
$creadList :: ReadS [JobSummary]
readsPrec :: Int -> ReadS JobSummary
$creadsPrec :: Int -> ReadS JobSummary
Prelude.Read, Int -> JobSummary -> ShowS
[JobSummary] -> ShowS
JobSummary -> String
(Int -> JobSummary -> ShowS)
-> (JobSummary -> String)
-> ([JobSummary] -> ShowS)
-> Show JobSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [JobSummary] -> ShowS
$cshowList :: [JobSummary] -> ShowS
show :: JobSummary -> String
$cshow :: JobSummary -> String
showsPrec :: Int -> JobSummary -> ShowS
$cshowsPrec :: Int -> JobSummary -> ShowS
Prelude.Show, (forall x. JobSummary -> Rep JobSummary x)
-> (forall x. Rep JobSummary x -> JobSummary) -> Generic JobSummary
forall x. Rep JobSummary x -> JobSummary
forall x. JobSummary -> Rep JobSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep JobSummary x -> JobSummary
$cfrom :: forall x. JobSummary -> Rep JobSummary x
Prelude.Generic)
newJobSummary ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.UTCTime ->
Prelude.UTCTime ->
JobStatus ->
JobType ->
JobSummary
newJobSummary :: Text
-> Text
-> Text
-> Text
-> UTCTime
-> UTCTime
-> JobStatus
-> JobType
-> JobSummary
newJobSummary
Text
pJobArn_
Text
pJobId_
Text
pCommitId_
Text
pCommitMessage_
UTCTime
pCommitTime_
UTCTime
pStartTime_
JobStatus
pStatus_
JobType
pJobType_ =
JobSummary' :: Maybe POSIX
-> Text
-> Text
-> Text
-> Text
-> POSIX
-> POSIX
-> JobStatus
-> JobType
-> JobSummary
JobSummary'
{ $sel:endTime:JobSummary' :: Maybe POSIX
endTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:jobArn:JobSummary' :: Text
jobArn = Text
pJobArn_,
$sel:jobId:JobSummary' :: Text
jobId = Text
pJobId_,
$sel:commitId:JobSummary' :: Text
commitId = Text
pCommitId_,
$sel:commitMessage:JobSummary' :: Text
commitMessage = Text
pCommitMessage_,
$sel:commitTime:JobSummary' :: POSIX
commitTime = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
-> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pCommitTime_,
$sel:startTime:JobSummary' :: POSIX
startTime = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
-> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pStartTime_,
$sel:status:JobSummary' :: JobStatus
status = JobStatus
pStatus_,
$sel:jobType:JobSummary' :: JobType
jobType = JobType
pJobType_
}
jobSummary_endTime :: Lens.Lens' JobSummary (Prelude.Maybe Prelude.UTCTime)
jobSummary_endTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> JobSummary -> f JobSummary
jobSummary_endTime = (JobSummary -> Maybe POSIX)
-> (JobSummary -> Maybe POSIX -> JobSummary)
-> Lens JobSummary JobSummary (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobSummary' {Maybe POSIX
endTime :: Maybe POSIX
$sel:endTime:JobSummary' :: JobSummary -> Maybe POSIX
endTime} -> Maybe POSIX
endTime) (\s :: JobSummary
s@JobSummary' {} Maybe POSIX
a -> JobSummary
s {$sel:endTime:JobSummary' :: Maybe POSIX
endTime = Maybe POSIX
a} :: JobSummary) ((Maybe POSIX -> f (Maybe POSIX)) -> JobSummary -> f JobSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> JobSummary
-> f JobSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
jobSummary_jobArn :: Lens.Lens' JobSummary Prelude.Text
jobSummary_jobArn :: (Text -> f Text) -> JobSummary -> f JobSummary
jobSummary_jobArn = (JobSummary -> Text)
-> (JobSummary -> Text -> JobSummary)
-> Lens JobSummary JobSummary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobSummary' {Text
jobArn :: Text
$sel:jobArn:JobSummary' :: JobSummary -> Text
jobArn} -> Text
jobArn) (\s :: JobSummary
s@JobSummary' {} Text
a -> JobSummary
s {$sel:jobArn:JobSummary' :: Text
jobArn = Text
a} :: JobSummary)
jobSummary_jobId :: Lens.Lens' JobSummary Prelude.Text
jobSummary_jobId :: (Text -> f Text) -> JobSummary -> f JobSummary
jobSummary_jobId = (JobSummary -> Text)
-> (JobSummary -> Text -> JobSummary)
-> Lens JobSummary JobSummary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobSummary' {Text
jobId :: Text
$sel:jobId:JobSummary' :: JobSummary -> Text
jobId} -> Text
jobId) (\s :: JobSummary
s@JobSummary' {} Text
a -> JobSummary
s {$sel:jobId:JobSummary' :: Text
jobId = Text
a} :: JobSummary)
jobSummary_commitId :: Lens.Lens' JobSummary Prelude.Text
jobSummary_commitId :: (Text -> f Text) -> JobSummary -> f JobSummary
jobSummary_commitId = (JobSummary -> Text)
-> (JobSummary -> Text -> JobSummary)
-> Lens JobSummary JobSummary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobSummary' {Text
commitId :: Text
$sel:commitId:JobSummary' :: JobSummary -> Text
commitId} -> Text
commitId) (\s :: JobSummary
s@JobSummary' {} Text
a -> JobSummary
s {$sel:commitId:JobSummary' :: Text
commitId = Text
a} :: JobSummary)
jobSummary_commitMessage :: Lens.Lens' JobSummary Prelude.Text
jobSummary_commitMessage :: (Text -> f Text) -> JobSummary -> f JobSummary
jobSummary_commitMessage = (JobSummary -> Text)
-> (JobSummary -> Text -> JobSummary)
-> Lens JobSummary JobSummary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobSummary' {Text
commitMessage :: Text
$sel:commitMessage:JobSummary' :: JobSummary -> Text
commitMessage} -> Text
commitMessage) (\s :: JobSummary
s@JobSummary' {} Text
a -> JobSummary
s {$sel:commitMessage:JobSummary' :: Text
commitMessage = Text
a} :: JobSummary)
jobSummary_commitTime :: Lens.Lens' JobSummary Prelude.UTCTime
jobSummary_commitTime :: (UTCTime -> f UTCTime) -> JobSummary -> f JobSummary
jobSummary_commitTime = (JobSummary -> POSIX)
-> (JobSummary -> POSIX -> JobSummary)
-> Lens JobSummary JobSummary POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobSummary' {POSIX
commitTime :: POSIX
$sel:commitTime:JobSummary' :: JobSummary -> POSIX
commitTime} -> POSIX
commitTime) (\s :: JobSummary
s@JobSummary' {} POSIX
a -> JobSummary
s {$sel:commitTime:JobSummary' :: POSIX
commitTime = POSIX
a} :: JobSummary) ((POSIX -> f POSIX) -> JobSummary -> f JobSummary)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> JobSummary
-> f JobSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
jobSummary_startTime :: Lens.Lens' JobSummary Prelude.UTCTime
jobSummary_startTime :: (UTCTime -> f UTCTime) -> JobSummary -> f JobSummary
jobSummary_startTime = (JobSummary -> POSIX)
-> (JobSummary -> POSIX -> JobSummary)
-> Lens JobSummary JobSummary POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobSummary' {POSIX
startTime :: POSIX
$sel:startTime:JobSummary' :: JobSummary -> POSIX
startTime} -> POSIX
startTime) (\s :: JobSummary
s@JobSummary' {} POSIX
a -> JobSummary
s {$sel:startTime:JobSummary' :: POSIX
startTime = POSIX
a} :: JobSummary) ((POSIX -> f POSIX) -> JobSummary -> f JobSummary)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> JobSummary
-> f JobSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
jobSummary_status :: Lens.Lens' JobSummary JobStatus
jobSummary_status :: (JobStatus -> f JobStatus) -> JobSummary -> f JobSummary
jobSummary_status = (JobSummary -> JobStatus)
-> (JobSummary -> JobStatus -> JobSummary)
-> Lens JobSummary JobSummary JobStatus JobStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobSummary' {JobStatus
status :: JobStatus
$sel:status:JobSummary' :: JobSummary -> JobStatus
status} -> JobStatus
status) (\s :: JobSummary
s@JobSummary' {} JobStatus
a -> JobSummary
s {$sel:status:JobSummary' :: JobStatus
status = JobStatus
a} :: JobSummary)
jobSummary_jobType :: Lens.Lens' JobSummary JobType
jobSummary_jobType :: (JobType -> f JobType) -> JobSummary -> f JobSummary
jobSummary_jobType = (JobSummary -> JobType)
-> (JobSummary -> JobType -> JobSummary)
-> Lens JobSummary JobSummary JobType JobType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobSummary' {JobType
jobType :: JobType
$sel:jobType:JobSummary' :: JobSummary -> JobType
jobType} -> JobType
jobType) (\s :: JobSummary
s@JobSummary' {} JobType
a -> JobSummary
s {$sel:jobType:JobSummary' :: JobType
jobType = JobType
a} :: JobSummary)
instance Core.FromJSON JobSummary where
parseJSON :: Value -> Parser JobSummary
parseJSON =
String
-> (Object -> Parser JobSummary) -> Value -> Parser JobSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"JobSummary"
( \Object
x ->
Maybe POSIX
-> Text
-> Text
-> Text
-> Text
-> POSIX
-> POSIX
-> JobStatus
-> JobType
-> JobSummary
JobSummary'
(Maybe POSIX
-> Text
-> Text
-> Text
-> Text
-> POSIX
-> POSIX
-> JobStatus
-> JobType
-> JobSummary)
-> Parser (Maybe POSIX)
-> Parser
(Text
-> Text
-> Text
-> Text
-> POSIX
-> POSIX
-> JobStatus
-> JobType
-> JobSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"endTime")
Parser
(Text
-> Text
-> Text
-> Text
-> POSIX
-> POSIX
-> JobStatus
-> JobType
-> JobSummary)
-> Parser Text
-> Parser
(Text
-> Text
-> Text
-> POSIX
-> POSIX
-> JobStatus
-> JobType
-> JobSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"jobArn")
Parser
(Text
-> Text
-> Text
-> POSIX
-> POSIX
-> JobStatus
-> JobType
-> JobSummary)
-> Parser Text
-> Parser
(Text
-> Text -> POSIX -> POSIX -> JobStatus -> JobType -> JobSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"jobId")
Parser
(Text
-> Text -> POSIX -> POSIX -> JobStatus -> JobType -> JobSummary)
-> Parser Text
-> Parser
(Text -> POSIX -> POSIX -> JobStatus -> JobType -> JobSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"commitId")
Parser
(Text -> POSIX -> POSIX -> JobStatus -> JobType -> JobSummary)
-> Parser Text
-> Parser (POSIX -> POSIX -> JobStatus -> JobType -> JobSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"commitMessage")
Parser (POSIX -> POSIX -> JobStatus -> JobType -> JobSummary)
-> Parser POSIX
-> Parser (POSIX -> JobStatus -> JobType -> JobSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser POSIX
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"commitTime")
Parser (POSIX -> JobStatus -> JobType -> JobSummary)
-> Parser POSIX -> Parser (JobStatus -> JobType -> JobSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser POSIX
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"startTime")
Parser (JobStatus -> JobType -> JobSummary)
-> Parser JobStatus -> Parser (JobType -> JobSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser JobStatus
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"status")
Parser (JobType -> JobSummary)
-> Parser JobType -> Parser JobSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser JobType
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"jobType")
)
instance Prelude.Hashable JobSummary
instance Prelude.NFData JobSummary