{-# 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.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data BuildPhase = BuildPhase'
{
BuildPhase -> Maybe [PhaseContext]
contexts :: Prelude.Maybe [PhaseContext],
BuildPhase -> Maybe POSIX
startTime :: Prelude.Maybe Core.POSIX,
BuildPhase -> Maybe StatusType
phaseStatus :: Prelude.Maybe StatusType,
BuildPhase -> Maybe BuildPhaseType
phaseType :: Prelude.Maybe BuildPhaseType,
BuildPhase -> Maybe POSIX
endTime :: Prelude.Maybe Core.POSIX,
BuildPhase -> Maybe Integer
durationInSeconds :: Prelude.Maybe Prelude.Integer
}
deriving (BuildPhase -> BuildPhase -> Bool
(BuildPhase -> BuildPhase -> Bool)
-> (BuildPhase -> BuildPhase -> Bool) -> Eq BuildPhase
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]
(Int -> ReadS BuildPhase)
-> ReadS [BuildPhase]
-> ReadPrec BuildPhase
-> ReadPrec [BuildPhase]
-> Read 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
(Int -> BuildPhase -> ShowS)
-> (BuildPhase -> String)
-> ([BuildPhase] -> ShowS)
-> Show BuildPhase
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. BuildPhase -> Rep BuildPhase x)
-> (forall x. Rep BuildPhase x -> BuildPhase) -> Generic BuildPhase
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' :: Maybe [PhaseContext]
-> Maybe POSIX
-> Maybe StatusType
-> Maybe BuildPhaseType
-> Maybe POSIX
-> Maybe Integer
-> BuildPhase
BuildPhase'
{ $sel:contexts:BuildPhase' :: Maybe [PhaseContext]
contexts = Maybe [PhaseContext]
forall a. Maybe a
Prelude.Nothing,
$sel:startTime:BuildPhase' :: Maybe POSIX
startTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:phaseStatus:BuildPhase' :: Maybe StatusType
phaseStatus = Maybe StatusType
forall a. Maybe a
Prelude.Nothing,
$sel:phaseType:BuildPhase' :: Maybe BuildPhaseType
phaseType = Maybe BuildPhaseType
forall a. Maybe a
Prelude.Nothing,
$sel:endTime:BuildPhase' :: Maybe POSIX
endTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:durationInSeconds:BuildPhase' :: Maybe Integer
durationInSeconds = Maybe Integer
forall a. Maybe a
Prelude.Nothing
}
buildPhase_contexts :: Lens.Lens' BuildPhase (Prelude.Maybe [PhaseContext])
buildPhase_contexts :: (Maybe [PhaseContext] -> f (Maybe [PhaseContext]))
-> BuildPhase -> f BuildPhase
buildPhase_contexts = (BuildPhase -> Maybe [PhaseContext])
-> (BuildPhase -> Maybe [PhaseContext] -> BuildPhase)
-> Lens
BuildPhase BuildPhase (Maybe [PhaseContext]) (Maybe [PhaseContext])
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) ((Maybe [PhaseContext] -> f (Maybe [PhaseContext]))
-> BuildPhase -> f BuildPhase)
-> ((Maybe [PhaseContext] -> f (Maybe [PhaseContext]))
-> Maybe [PhaseContext] -> f (Maybe [PhaseContext]))
-> (Maybe [PhaseContext] -> f (Maybe [PhaseContext]))
-> BuildPhase
-> f BuildPhase
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [PhaseContext] [PhaseContext] [PhaseContext] [PhaseContext]
-> Iso
(Maybe [PhaseContext])
(Maybe [PhaseContext])
(Maybe [PhaseContext])
(Maybe [PhaseContext])
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 [PhaseContext] [PhaseContext] [PhaseContext] [PhaseContext]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
buildPhase_startTime :: Lens.Lens' BuildPhase (Prelude.Maybe Prelude.UTCTime)
buildPhase_startTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> BuildPhase -> f BuildPhase
buildPhase_startTime = (BuildPhase -> Maybe POSIX)
-> (BuildPhase -> Maybe POSIX -> BuildPhase)
-> Lens BuildPhase BuildPhase (Maybe POSIX) (Maybe POSIX)
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) ((Maybe POSIX -> f (Maybe POSIX)) -> BuildPhase -> f BuildPhase)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> BuildPhase
-> f BuildPhase
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
buildPhase_phaseStatus :: Lens.Lens' BuildPhase (Prelude.Maybe StatusType)
buildPhase_phaseStatus :: (Maybe StatusType -> f (Maybe StatusType))
-> BuildPhase -> f BuildPhase
buildPhase_phaseStatus = (BuildPhase -> Maybe StatusType)
-> (BuildPhase -> Maybe StatusType -> BuildPhase)
-> Lens BuildPhase BuildPhase (Maybe StatusType) (Maybe StatusType)
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 :: (Maybe BuildPhaseType -> f (Maybe BuildPhaseType))
-> BuildPhase -> f BuildPhase
buildPhase_phaseType = (BuildPhase -> Maybe BuildPhaseType)
-> (BuildPhase -> Maybe BuildPhaseType -> BuildPhase)
-> Lens
BuildPhase BuildPhase (Maybe BuildPhaseType) (Maybe BuildPhaseType)
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_endTime :: Lens.Lens' BuildPhase (Prelude.Maybe Prelude.UTCTime)
buildPhase_endTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> BuildPhase -> f BuildPhase
buildPhase_endTime = (BuildPhase -> Maybe POSIX)
-> (BuildPhase -> Maybe POSIX -> BuildPhase)
-> Lens BuildPhase BuildPhase (Maybe POSIX) (Maybe POSIX)
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) ((Maybe POSIX -> f (Maybe POSIX)) -> BuildPhase -> f BuildPhase)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> BuildPhase
-> f BuildPhase
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
buildPhase_durationInSeconds :: Lens.Lens' BuildPhase (Prelude.Maybe Prelude.Integer)
buildPhase_durationInSeconds :: (Maybe Integer -> f (Maybe Integer)) -> BuildPhase -> f BuildPhase
buildPhase_durationInSeconds = (BuildPhase -> Maybe Integer)
-> (BuildPhase -> Maybe Integer -> BuildPhase)
-> Lens BuildPhase BuildPhase (Maybe Integer) (Maybe Integer)
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)
instance Core.FromJSON BuildPhase where
parseJSON :: Value -> Parser BuildPhase
parseJSON =
String
-> (Object -> Parser BuildPhase) -> Value -> Parser BuildPhase
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"BuildPhase"
( \Object
x ->
Maybe [PhaseContext]
-> Maybe POSIX
-> Maybe StatusType
-> Maybe BuildPhaseType
-> Maybe POSIX
-> Maybe Integer
-> BuildPhase
BuildPhase'
(Maybe [PhaseContext]
-> Maybe POSIX
-> Maybe StatusType
-> Maybe BuildPhaseType
-> Maybe POSIX
-> Maybe Integer
-> BuildPhase)
-> Parser (Maybe [PhaseContext])
-> Parser
(Maybe POSIX
-> Maybe StatusType
-> Maybe BuildPhaseType
-> Maybe POSIX
-> Maybe Integer
-> BuildPhase)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe [PhaseContext]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"contexts" Parser (Maybe (Maybe [PhaseContext]))
-> Maybe [PhaseContext] -> Parser (Maybe [PhaseContext])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [PhaseContext]
forall a. Monoid a => a
Prelude.mempty)
Parser
(Maybe POSIX
-> Maybe StatusType
-> Maybe BuildPhaseType
-> Maybe POSIX
-> Maybe Integer
-> BuildPhase)
-> Parser (Maybe POSIX)
-> Parser
(Maybe StatusType
-> Maybe BuildPhaseType
-> Maybe POSIX
-> Maybe Integer
-> BuildPhase)
forall (f :: * -> *) a b. Applicative f => 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
"startTime")
Parser
(Maybe StatusType
-> Maybe BuildPhaseType
-> Maybe POSIX
-> Maybe Integer
-> BuildPhase)
-> Parser (Maybe StatusType)
-> Parser
(Maybe BuildPhaseType
-> Maybe POSIX -> Maybe Integer -> BuildPhase)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe StatusType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"phaseStatus")
Parser
(Maybe BuildPhaseType
-> Maybe POSIX -> Maybe Integer -> BuildPhase)
-> Parser (Maybe BuildPhaseType)
-> Parser (Maybe POSIX -> Maybe Integer -> BuildPhase)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe BuildPhaseType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"phaseType")
Parser (Maybe POSIX -> Maybe Integer -> BuildPhase)
-> Parser (Maybe POSIX) -> Parser (Maybe Integer -> BuildPhase)
forall (f :: * -> *) a b. Applicative f => 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 (Maybe Integer -> BuildPhase)
-> Parser (Maybe Integer) -> Parser BuildPhase
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"durationInSeconds")
)
instance Prelude.Hashable BuildPhase
instance Prelude.NFData BuildPhase