{-# 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.Step where
import Amazonka.Amplify.Types.JobStatus
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Step = Step'
{
Step -> Maybe Text
logUrl :: Prelude.Maybe Prelude.Text,
Step -> Maybe Text
context :: Prelude.Maybe Prelude.Text,
Step -> Maybe Text
testArtifactsUrl :: Prelude.Maybe Prelude.Text,
Step -> Maybe Text
artifactsUrl :: Prelude.Maybe Prelude.Text,
Step -> Maybe Text
testConfigUrl :: Prelude.Maybe Prelude.Text,
Step -> Maybe (HashMap Text Text)
screenshots :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
Step -> Maybe Text
statusReason :: Prelude.Maybe Prelude.Text,
Step -> Text
stepName :: Prelude.Text,
Step -> POSIX
startTime :: Core.POSIX,
Step -> JobStatus
status :: JobStatus,
Step -> POSIX
endTime :: Core.POSIX
}
deriving (Step -> Step -> Bool
(Step -> Step -> Bool) -> (Step -> Step -> Bool) -> Eq Step
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Step -> Step -> Bool
$c/= :: Step -> Step -> Bool
== :: Step -> Step -> Bool
$c== :: Step -> Step -> Bool
Prelude.Eq, ReadPrec [Step]
ReadPrec Step
Int -> ReadS Step
ReadS [Step]
(Int -> ReadS Step)
-> ReadS [Step] -> ReadPrec Step -> ReadPrec [Step] -> Read Step
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Step]
$creadListPrec :: ReadPrec [Step]
readPrec :: ReadPrec Step
$creadPrec :: ReadPrec Step
readList :: ReadS [Step]
$creadList :: ReadS [Step]
readsPrec :: Int -> ReadS Step
$creadsPrec :: Int -> ReadS Step
Prelude.Read, Int -> Step -> ShowS
[Step] -> ShowS
Step -> String
(Int -> Step -> ShowS)
-> (Step -> String) -> ([Step] -> ShowS) -> Show Step
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Step] -> ShowS
$cshowList :: [Step] -> ShowS
show :: Step -> String
$cshow :: Step -> String
showsPrec :: Int -> Step -> ShowS
$cshowsPrec :: Int -> Step -> ShowS
Prelude.Show, (forall x. Step -> Rep Step x)
-> (forall x. Rep Step x -> Step) -> Generic Step
forall x. Rep Step x -> Step
forall x. Step -> Rep Step x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Step x -> Step
$cfrom :: forall x. Step -> Rep Step x
Prelude.Generic)
newStep ::
Prelude.Text ->
Prelude.UTCTime ->
JobStatus ->
Prelude.UTCTime ->
Step
newStep :: Text -> UTCTime -> JobStatus -> UTCTime -> Step
newStep Text
pStepName_ UTCTime
pStartTime_ JobStatus
pStatus_ UTCTime
pEndTime_ =
Step' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Text
-> POSIX
-> JobStatus
-> POSIX
-> Step
Step'
{ $sel:logUrl:Step' :: Maybe Text
logUrl = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:context:Step' :: Maybe Text
context = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:testArtifactsUrl:Step' :: Maybe Text
testArtifactsUrl = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:artifactsUrl:Step' :: Maybe Text
artifactsUrl = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:testConfigUrl:Step' :: Maybe Text
testConfigUrl = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:screenshots:Step' :: Maybe (HashMap Text Text)
screenshots = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:statusReason:Step' :: Maybe Text
statusReason = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:stepName:Step' :: Text
stepName = Text
pStepName_,
$sel:startTime:Step' :: 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:Step' :: JobStatus
status = JobStatus
pStatus_,
$sel:endTime:Step' :: POSIX
endTime = 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
pEndTime_
}
step_logUrl :: Lens.Lens' Step (Prelude.Maybe Prelude.Text)
step_logUrl :: (Maybe Text -> f (Maybe Text)) -> Step -> f Step
step_logUrl = (Step -> Maybe Text)
-> (Step -> Maybe Text -> Step)
-> Lens Step Step (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Step' {Maybe Text
logUrl :: Maybe Text
$sel:logUrl:Step' :: Step -> Maybe Text
logUrl} -> Maybe Text
logUrl) (\s :: Step
s@Step' {} Maybe Text
a -> Step
s {$sel:logUrl:Step' :: Maybe Text
logUrl = Maybe Text
a} :: Step)
step_context :: Lens.Lens' Step (Prelude.Maybe Prelude.Text)
step_context :: (Maybe Text -> f (Maybe Text)) -> Step -> f Step
step_context = (Step -> Maybe Text)
-> (Step -> Maybe Text -> Step)
-> Lens Step Step (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Step' {Maybe Text
context :: Maybe Text
$sel:context:Step' :: Step -> Maybe Text
context} -> Maybe Text
context) (\s :: Step
s@Step' {} Maybe Text
a -> Step
s {$sel:context:Step' :: Maybe Text
context = Maybe Text
a} :: Step)
step_testArtifactsUrl :: Lens.Lens' Step (Prelude.Maybe Prelude.Text)
step_testArtifactsUrl :: (Maybe Text -> f (Maybe Text)) -> Step -> f Step
step_testArtifactsUrl = (Step -> Maybe Text)
-> (Step -> Maybe Text -> Step)
-> Lens Step Step (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Step' {Maybe Text
testArtifactsUrl :: Maybe Text
$sel:testArtifactsUrl:Step' :: Step -> Maybe Text
testArtifactsUrl} -> Maybe Text
testArtifactsUrl) (\s :: Step
s@Step' {} Maybe Text
a -> Step
s {$sel:testArtifactsUrl:Step' :: Maybe Text
testArtifactsUrl = Maybe Text
a} :: Step)
step_artifactsUrl :: Lens.Lens' Step (Prelude.Maybe Prelude.Text)
step_artifactsUrl :: (Maybe Text -> f (Maybe Text)) -> Step -> f Step
step_artifactsUrl = (Step -> Maybe Text)
-> (Step -> Maybe Text -> Step)
-> Lens Step Step (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Step' {Maybe Text
artifactsUrl :: Maybe Text
$sel:artifactsUrl:Step' :: Step -> Maybe Text
artifactsUrl} -> Maybe Text
artifactsUrl) (\s :: Step
s@Step' {} Maybe Text
a -> Step
s {$sel:artifactsUrl:Step' :: Maybe Text
artifactsUrl = Maybe Text
a} :: Step)
step_testConfigUrl :: Lens.Lens' Step (Prelude.Maybe Prelude.Text)
step_testConfigUrl :: (Maybe Text -> f (Maybe Text)) -> Step -> f Step
step_testConfigUrl = (Step -> Maybe Text)
-> (Step -> Maybe Text -> Step)
-> Lens Step Step (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Step' {Maybe Text
testConfigUrl :: Maybe Text
$sel:testConfigUrl:Step' :: Step -> Maybe Text
testConfigUrl} -> Maybe Text
testConfigUrl) (\s :: Step
s@Step' {} Maybe Text
a -> Step
s {$sel:testConfigUrl:Step' :: Maybe Text
testConfigUrl = Maybe Text
a} :: Step)
step_screenshots :: Lens.Lens' Step (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
step_screenshots :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Step -> f Step
step_screenshots = (Step -> Maybe (HashMap Text Text))
-> (Step -> Maybe (HashMap Text Text) -> Step)
-> Lens
Step Step (Maybe (HashMap Text Text)) (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Step' {Maybe (HashMap Text Text)
screenshots :: Maybe (HashMap Text Text)
$sel:screenshots:Step' :: Step -> Maybe (HashMap Text Text)
screenshots} -> Maybe (HashMap Text Text)
screenshots) (\s :: Step
s@Step' {} Maybe (HashMap Text Text)
a -> Step
s {$sel:screenshots:Step' :: Maybe (HashMap Text Text)
screenshots = Maybe (HashMap Text Text)
a} :: Step) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Step -> f Step)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Step
-> f Step
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
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
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
step_statusReason :: Lens.Lens' Step (Prelude.Maybe Prelude.Text)
step_statusReason :: (Maybe Text -> f (Maybe Text)) -> Step -> f Step
step_statusReason = (Step -> Maybe Text)
-> (Step -> Maybe Text -> Step)
-> Lens Step Step (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Step' {Maybe Text
statusReason :: Maybe Text
$sel:statusReason:Step' :: Step -> Maybe Text
statusReason} -> Maybe Text
statusReason) (\s :: Step
s@Step' {} Maybe Text
a -> Step
s {$sel:statusReason:Step' :: Maybe Text
statusReason = Maybe Text
a} :: Step)
step_stepName :: Lens.Lens' Step Prelude.Text
step_stepName :: (Text -> f Text) -> Step -> f Step
step_stepName = (Step -> Text)
-> (Step -> Text -> Step) -> Lens Step Step Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Step' {Text
stepName :: Text
$sel:stepName:Step' :: Step -> Text
stepName} -> Text
stepName) (\s :: Step
s@Step' {} Text
a -> Step
s {$sel:stepName:Step' :: Text
stepName = Text
a} :: Step)
step_startTime :: Lens.Lens' Step Prelude.UTCTime
step_startTime :: (UTCTime -> f UTCTime) -> Step -> f Step
step_startTime = (Step -> POSIX)
-> (Step -> POSIX -> Step) -> Lens Step Step POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Step' {POSIX
startTime :: POSIX
$sel:startTime:Step' :: Step -> POSIX
startTime} -> POSIX
startTime) (\s :: Step
s@Step' {} POSIX
a -> Step
s {$sel:startTime:Step' :: POSIX
startTime = POSIX
a} :: Step) ((POSIX -> f POSIX) -> Step -> f Step)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> Step
-> f Step
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
step_status :: Lens.Lens' Step JobStatus
step_status :: (JobStatus -> f JobStatus) -> Step -> f Step
step_status = (Step -> JobStatus)
-> (Step -> JobStatus -> Step)
-> Lens Step Step JobStatus JobStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Step' {JobStatus
status :: JobStatus
$sel:status:Step' :: Step -> JobStatus
status} -> JobStatus
status) (\s :: Step
s@Step' {} JobStatus
a -> Step
s {$sel:status:Step' :: JobStatus
status = JobStatus
a} :: Step)
step_endTime :: Lens.Lens' Step Prelude.UTCTime
step_endTime :: (UTCTime -> f UTCTime) -> Step -> f Step
step_endTime = (Step -> POSIX)
-> (Step -> POSIX -> Step) -> Lens Step Step POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Step' {POSIX
endTime :: POSIX
$sel:endTime:Step' :: Step -> POSIX
endTime} -> POSIX
endTime) (\s :: Step
s@Step' {} POSIX
a -> Step
s {$sel:endTime:Step' :: POSIX
endTime = POSIX
a} :: Step) ((POSIX -> f POSIX) -> Step -> f Step)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> Step
-> f Step
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
instance Core.FromJSON Step where
parseJSON :: Value -> Parser Step
parseJSON =
String -> (Object -> Parser Step) -> Value -> Parser Step
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Step"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Text
-> POSIX
-> JobStatus
-> POSIX
-> Step
Step'
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Text
-> POSIX
-> JobStatus
-> POSIX
-> Step)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Text
-> POSIX
-> JobStatus
-> POSIX
-> Step)
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
"logUrl")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Text
-> POSIX
-> JobStatus
-> POSIX
-> Step)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Text
-> POSIX
-> JobStatus
-> POSIX
-> Step)
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
"context")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Text
-> POSIX
-> JobStatus
-> POSIX
-> Step)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Text
-> POSIX
-> JobStatus
-> POSIX
-> Step)
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
"testArtifactsUrl")
Parser
(Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Text
-> POSIX
-> JobStatus
-> POSIX
-> Step)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Text
-> POSIX
-> JobStatus
-> POSIX
-> Step)
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
"artifactsUrl")
Parser
(Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Text
-> POSIX
-> JobStatus
-> POSIX
-> Step)
-> Parser (Maybe Text)
-> Parser
(Maybe (HashMap Text Text)
-> Maybe Text -> Text -> POSIX -> JobStatus -> POSIX -> Step)
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
"testConfigUrl")
Parser
(Maybe (HashMap Text Text)
-> Maybe Text -> Text -> POSIX -> JobStatus -> POSIX -> Step)
-> Parser (Maybe (HashMap Text Text))
-> Parser
(Maybe Text -> Text -> POSIX -> JobStatus -> POSIX -> Step)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"screenshots" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
Parser (Maybe Text -> Text -> POSIX -> JobStatus -> POSIX -> Step)
-> Parser (Maybe Text)
-> Parser (Text -> POSIX -> JobStatus -> POSIX -> Step)
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
"statusReason")
Parser (Text -> POSIX -> JobStatus -> POSIX -> Step)
-> Parser Text -> Parser (POSIX -> JobStatus -> POSIX -> Step)
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
"stepName")
Parser (POSIX -> JobStatus -> POSIX -> Step)
-> Parser POSIX -> Parser (JobStatus -> POSIX -> Step)
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 -> POSIX -> Step)
-> Parser JobStatus -> Parser (POSIX -> Step)
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 (POSIX -> Step) -> Parser POSIX -> Parser Step
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
"endTime")
)
instance Prelude.Hashable Step
instance Prelude.NFData Step