{-# 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.CodeBuild.Types.BuildPhase where
import Amazonka.CodeBuild.Types.BuildPhaseType
import Amazonka.CodeBuild.Types.PhaseContext
import Amazonka.CodeBuild.Types.StatusType
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data BuildPhase = BuildPhase'
{
BuildPhase -> Maybe [PhaseContext]
contexts :: Prelude.Maybe [PhaseContext],
BuildPhase -> Maybe Integer
durationInSeconds :: Prelude.Maybe Prelude.Integer,
BuildPhase -> Maybe POSIX
endTime :: Prelude.Maybe Data.POSIX,
BuildPhase -> Maybe StatusType
phaseStatus :: Prelude.Maybe StatusType,
BuildPhase -> Maybe BuildPhaseType
phaseType :: Prelude.Maybe BuildPhaseType,
BuildPhase -> Maybe POSIX
startTime :: Prelude.Maybe Data.POSIX
}
deriving (BuildPhase -> BuildPhase -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BuildPhase -> BuildPhase -> Bool
$c/= :: BuildPhase -> BuildPhase -> Bool
== :: BuildPhase -> BuildPhase -> Bool
$c== :: BuildPhase -> BuildPhase -> Bool
Prelude.Eq, ReadPrec [BuildPhase]
ReadPrec BuildPhase
Int -> ReadS BuildPhase
ReadS [BuildPhase]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BuildPhase]
$creadListPrec :: ReadPrec [BuildPhase]
readPrec :: ReadPrec BuildPhase
$creadPrec :: ReadPrec BuildPhase
readList :: ReadS [BuildPhase]
$creadList :: ReadS [BuildPhase]
readsPrec :: Int -> ReadS BuildPhase
$creadsPrec :: Int -> ReadS BuildPhase
Prelude.Read, Int -> BuildPhase -> ShowS
[BuildPhase] -> ShowS
BuildPhase -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BuildPhase] -> ShowS
$cshowList :: [BuildPhase] -> ShowS
show :: BuildPhase -> String
$cshow :: BuildPhase -> String
showsPrec :: Int -> BuildPhase -> ShowS
$cshowsPrec :: Int -> BuildPhase -> ShowS
Prelude.Show, forall x. Rep BuildPhase x -> BuildPhase
forall x. BuildPhase -> Rep BuildPhase x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BuildPhase x -> BuildPhase
$cfrom :: forall x. BuildPhase -> Rep BuildPhase x
Prelude.Generic)
newBuildPhase ::
BuildPhase
newBuildPhase :: BuildPhase
newBuildPhase =
BuildPhase'
{ $sel:contexts:BuildPhase' :: Maybe [PhaseContext]
contexts = forall a. Maybe a
Prelude.Nothing,
$sel:durationInSeconds:BuildPhase' :: Maybe Integer
durationInSeconds = forall a. Maybe a
Prelude.Nothing,
$sel:endTime:BuildPhase' :: Maybe POSIX
endTime = forall a. Maybe a
Prelude.Nothing,
$sel:phaseStatus:BuildPhase' :: Maybe StatusType
phaseStatus = forall a. Maybe a
Prelude.Nothing,
$sel:phaseType:BuildPhase' :: Maybe BuildPhaseType
phaseType = forall a. Maybe a
Prelude.Nothing,
$sel:startTime:BuildPhase' :: Maybe POSIX
startTime = forall a. Maybe a
Prelude.Nothing
}
buildPhase_contexts :: Lens.Lens' BuildPhase (Prelude.Maybe [PhaseContext])
buildPhase_contexts :: Lens' BuildPhase (Maybe [PhaseContext])
buildPhase_contexts = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BuildPhase' {Maybe [PhaseContext]
contexts :: Maybe [PhaseContext]
$sel:contexts:BuildPhase' :: BuildPhase -> Maybe [PhaseContext]
contexts} -> Maybe [PhaseContext]
contexts) (\s :: BuildPhase
s@BuildPhase' {} Maybe [PhaseContext]
a -> BuildPhase
s {$sel:contexts:BuildPhase' :: Maybe [PhaseContext]
contexts = Maybe [PhaseContext]
a} :: BuildPhase) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
buildPhase_durationInSeconds :: Lens.Lens' BuildPhase (Prelude.Maybe Prelude.Integer)
buildPhase_durationInSeconds :: Lens' BuildPhase (Maybe Integer)
buildPhase_durationInSeconds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BuildPhase' {Maybe Integer
durationInSeconds :: Maybe Integer
$sel:durationInSeconds:BuildPhase' :: BuildPhase -> Maybe Integer
durationInSeconds} -> Maybe Integer
durationInSeconds) (\s :: BuildPhase
s@BuildPhase' {} Maybe Integer
a -> BuildPhase
s {$sel:durationInSeconds:BuildPhase' :: Maybe Integer
durationInSeconds = Maybe Integer
a} :: BuildPhase)
buildPhase_endTime :: Lens.Lens' BuildPhase (Prelude.Maybe Prelude.UTCTime)
buildPhase_endTime :: Lens' BuildPhase (Maybe UTCTime)
buildPhase_endTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BuildPhase' {Maybe POSIX
endTime :: Maybe POSIX
$sel:endTime:BuildPhase' :: BuildPhase -> Maybe POSIX
endTime} -> Maybe POSIX
endTime) (\s :: BuildPhase
s@BuildPhase' {} Maybe POSIX
a -> BuildPhase
s {$sel:endTime:BuildPhase' :: Maybe POSIX
endTime = Maybe POSIX
a} :: BuildPhase) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
buildPhase_phaseStatus :: Lens.Lens' BuildPhase (Prelude.Maybe StatusType)
buildPhase_phaseStatus :: Lens' BuildPhase (Maybe StatusType)
buildPhase_phaseStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BuildPhase' {Maybe StatusType
phaseStatus :: Maybe StatusType
$sel:phaseStatus:BuildPhase' :: BuildPhase -> Maybe StatusType
phaseStatus} -> Maybe StatusType
phaseStatus) (\s :: BuildPhase
s@BuildPhase' {} Maybe StatusType
a -> BuildPhase
s {$sel:phaseStatus:BuildPhase' :: Maybe StatusType
phaseStatus = Maybe StatusType
a} :: BuildPhase)
buildPhase_phaseType :: Lens.Lens' BuildPhase (Prelude.Maybe BuildPhaseType)
buildPhase_phaseType :: Lens' BuildPhase (Maybe BuildPhaseType)
buildPhase_phaseType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BuildPhase' {Maybe BuildPhaseType
phaseType :: Maybe BuildPhaseType
$sel:phaseType:BuildPhase' :: BuildPhase -> Maybe BuildPhaseType
phaseType} -> Maybe BuildPhaseType
phaseType) (\s :: BuildPhase
s@BuildPhase' {} Maybe BuildPhaseType
a -> BuildPhase
s {$sel:phaseType:BuildPhase' :: Maybe BuildPhaseType
phaseType = Maybe BuildPhaseType
a} :: BuildPhase)
buildPhase_startTime :: Lens.Lens' BuildPhase (Prelude.Maybe Prelude.UTCTime)
buildPhase_startTime :: Lens' BuildPhase (Maybe UTCTime)
buildPhase_startTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BuildPhase' {Maybe POSIX
startTime :: Maybe POSIX
$sel:startTime:BuildPhase' :: BuildPhase -> Maybe POSIX
startTime} -> Maybe POSIX
startTime) (\s :: BuildPhase
s@BuildPhase' {} Maybe POSIX
a -> BuildPhase
s {$sel:startTime:BuildPhase' :: Maybe POSIX
startTime = Maybe POSIX
a} :: BuildPhase) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
instance Data.FromJSON BuildPhase where
parseJSON :: Value -> Parser BuildPhase
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"BuildPhase"
( \Object
x ->
Maybe [PhaseContext]
-> Maybe Integer
-> Maybe POSIX
-> Maybe StatusType
-> Maybe BuildPhaseType
-> Maybe POSIX
-> BuildPhase
BuildPhase'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"contexts" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"durationInSeconds")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"endTime")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"phaseStatus")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"phaseType")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"startTime")
)
instance Prelude.Hashable BuildPhase where
hashWithSalt :: Int -> BuildPhase -> Int
hashWithSalt Int
_salt BuildPhase' {Maybe Integer
Maybe [PhaseContext]
Maybe POSIX
Maybe BuildPhaseType
Maybe StatusType
startTime :: Maybe POSIX
phaseType :: Maybe BuildPhaseType
phaseStatus :: Maybe StatusType
endTime :: Maybe POSIX
durationInSeconds :: Maybe Integer
contexts :: Maybe [PhaseContext]
$sel:startTime:BuildPhase' :: BuildPhase -> Maybe POSIX
$sel:phaseType:BuildPhase' :: BuildPhase -> Maybe BuildPhaseType
$sel:phaseStatus:BuildPhase' :: BuildPhase -> Maybe StatusType
$sel:endTime:BuildPhase' :: BuildPhase -> Maybe POSIX
$sel:durationInSeconds:BuildPhase' :: BuildPhase -> Maybe Integer
$sel:contexts:BuildPhase' :: BuildPhase -> Maybe [PhaseContext]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [PhaseContext]
contexts
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
durationInSeconds
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
endTime
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe StatusType
phaseStatus
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe BuildPhaseType
phaseType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
startTime
instance Prelude.NFData BuildPhase where
rnf :: BuildPhase -> ()
rnf BuildPhase' {Maybe Integer
Maybe [PhaseContext]
Maybe POSIX
Maybe BuildPhaseType
Maybe StatusType
startTime :: Maybe POSIX
phaseType :: Maybe BuildPhaseType
phaseStatus :: Maybe StatusType
endTime :: Maybe POSIX
durationInSeconds :: Maybe Integer
contexts :: Maybe [PhaseContext]
$sel:startTime:BuildPhase' :: BuildPhase -> Maybe POSIX
$sel:phaseType:BuildPhase' :: BuildPhase -> Maybe BuildPhaseType
$sel:phaseStatus:BuildPhase' :: BuildPhase -> Maybe StatusType
$sel:endTime:BuildPhase' :: BuildPhase -> Maybe POSIX
$sel:durationInSeconds:BuildPhase' :: BuildPhase -> Maybe Integer
$sel:contexts:BuildPhase' :: BuildPhase -> Maybe [PhaseContext]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [PhaseContext]
contexts
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
durationInSeconds
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
endTime
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe StatusType
phaseStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe BuildPhaseType
phaseType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
startTime