{-# 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.BuildBatchPhase where
import Amazonka.CodeBuild.Types.BuildBatchPhaseType
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 BuildBatchPhase = BuildBatchPhase'
{
BuildBatchPhase -> Maybe [PhaseContext]
contexts :: Prelude.Maybe [PhaseContext],
BuildBatchPhase -> Maybe POSIX
startTime :: Prelude.Maybe Core.POSIX,
BuildBatchPhase -> Maybe StatusType
phaseStatus :: Prelude.Maybe StatusType,
BuildBatchPhase -> Maybe BuildBatchPhaseType
phaseType :: Prelude.Maybe BuildBatchPhaseType,
BuildBatchPhase -> Maybe POSIX
endTime :: Prelude.Maybe Core.POSIX,
BuildBatchPhase -> Maybe Integer
durationInSeconds :: Prelude.Maybe Prelude.Integer
}
deriving (BuildBatchPhase -> BuildBatchPhase -> Bool
(BuildBatchPhase -> BuildBatchPhase -> Bool)
-> (BuildBatchPhase -> BuildBatchPhase -> Bool)
-> Eq BuildBatchPhase
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BuildBatchPhase -> BuildBatchPhase -> Bool
$c/= :: BuildBatchPhase -> BuildBatchPhase -> Bool
== :: BuildBatchPhase -> BuildBatchPhase -> Bool
$c== :: BuildBatchPhase -> BuildBatchPhase -> Bool
Prelude.Eq, ReadPrec [BuildBatchPhase]
ReadPrec BuildBatchPhase
Int -> ReadS BuildBatchPhase
ReadS [BuildBatchPhase]
(Int -> ReadS BuildBatchPhase)
-> ReadS [BuildBatchPhase]
-> ReadPrec BuildBatchPhase
-> ReadPrec [BuildBatchPhase]
-> Read BuildBatchPhase
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BuildBatchPhase]
$creadListPrec :: ReadPrec [BuildBatchPhase]
readPrec :: ReadPrec BuildBatchPhase
$creadPrec :: ReadPrec BuildBatchPhase
readList :: ReadS [BuildBatchPhase]
$creadList :: ReadS [BuildBatchPhase]
readsPrec :: Int -> ReadS BuildBatchPhase
$creadsPrec :: Int -> ReadS BuildBatchPhase
Prelude.Read, Int -> BuildBatchPhase -> ShowS
[BuildBatchPhase] -> ShowS
BuildBatchPhase -> String
(Int -> BuildBatchPhase -> ShowS)
-> (BuildBatchPhase -> String)
-> ([BuildBatchPhase] -> ShowS)
-> Show BuildBatchPhase
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BuildBatchPhase] -> ShowS
$cshowList :: [BuildBatchPhase] -> ShowS
show :: BuildBatchPhase -> String
$cshow :: BuildBatchPhase -> String
showsPrec :: Int -> BuildBatchPhase -> ShowS
$cshowsPrec :: Int -> BuildBatchPhase -> ShowS
Prelude.Show, (forall x. BuildBatchPhase -> Rep BuildBatchPhase x)
-> (forall x. Rep BuildBatchPhase x -> BuildBatchPhase)
-> Generic BuildBatchPhase
forall x. Rep BuildBatchPhase x -> BuildBatchPhase
forall x. BuildBatchPhase -> Rep BuildBatchPhase x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BuildBatchPhase x -> BuildBatchPhase
$cfrom :: forall x. BuildBatchPhase -> Rep BuildBatchPhase x
Prelude.Generic)
newBuildBatchPhase ::
BuildBatchPhase
newBuildBatchPhase :: BuildBatchPhase
newBuildBatchPhase =
BuildBatchPhase' :: Maybe [PhaseContext]
-> Maybe POSIX
-> Maybe StatusType
-> Maybe BuildBatchPhaseType
-> Maybe POSIX
-> Maybe Integer
-> BuildBatchPhase
BuildBatchPhase'
{ $sel:contexts:BuildBatchPhase' :: Maybe [PhaseContext]
contexts = Maybe [PhaseContext]
forall a. Maybe a
Prelude.Nothing,
$sel:startTime:BuildBatchPhase' :: Maybe POSIX
startTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:phaseStatus:BuildBatchPhase' :: Maybe StatusType
phaseStatus = Maybe StatusType
forall a. Maybe a
Prelude.Nothing,
$sel:phaseType:BuildBatchPhase' :: Maybe BuildBatchPhaseType
phaseType = Maybe BuildBatchPhaseType
forall a. Maybe a
Prelude.Nothing,
$sel:endTime:BuildBatchPhase' :: Maybe POSIX
endTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:durationInSeconds:BuildBatchPhase' :: Maybe Integer
durationInSeconds = Maybe Integer
forall a. Maybe a
Prelude.Nothing
}
buildBatchPhase_contexts :: Lens.Lens' BuildBatchPhase (Prelude.Maybe [PhaseContext])
buildBatchPhase_contexts :: (Maybe [PhaseContext] -> f (Maybe [PhaseContext]))
-> BuildBatchPhase -> f BuildBatchPhase
buildBatchPhase_contexts = (BuildBatchPhase -> Maybe [PhaseContext])
-> (BuildBatchPhase -> Maybe [PhaseContext] -> BuildBatchPhase)
-> Lens
BuildBatchPhase
BuildBatchPhase
(Maybe [PhaseContext])
(Maybe [PhaseContext])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BuildBatchPhase' {Maybe [PhaseContext]
contexts :: Maybe [PhaseContext]
$sel:contexts:BuildBatchPhase' :: BuildBatchPhase -> Maybe [PhaseContext]
contexts} -> Maybe [PhaseContext]
contexts) (\s :: BuildBatchPhase
s@BuildBatchPhase' {} Maybe [PhaseContext]
a -> BuildBatchPhase
s {$sel:contexts:BuildBatchPhase' :: Maybe [PhaseContext]
contexts = Maybe [PhaseContext]
a} :: BuildBatchPhase) ((Maybe [PhaseContext] -> f (Maybe [PhaseContext]))
-> BuildBatchPhase -> f BuildBatchPhase)
-> ((Maybe [PhaseContext] -> f (Maybe [PhaseContext]))
-> Maybe [PhaseContext] -> f (Maybe [PhaseContext]))
-> (Maybe [PhaseContext] -> f (Maybe [PhaseContext]))
-> BuildBatchPhase
-> f BuildBatchPhase
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
buildBatchPhase_startTime :: Lens.Lens' BuildBatchPhase (Prelude.Maybe Prelude.UTCTime)
buildBatchPhase_startTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> BuildBatchPhase -> f BuildBatchPhase
buildBatchPhase_startTime = (BuildBatchPhase -> Maybe POSIX)
-> (BuildBatchPhase -> Maybe POSIX -> BuildBatchPhase)
-> Lens BuildBatchPhase BuildBatchPhase (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BuildBatchPhase' {Maybe POSIX
startTime :: Maybe POSIX
$sel:startTime:BuildBatchPhase' :: BuildBatchPhase -> Maybe POSIX
startTime} -> Maybe POSIX
startTime) (\s :: BuildBatchPhase
s@BuildBatchPhase' {} Maybe POSIX
a -> BuildBatchPhase
s {$sel:startTime:BuildBatchPhase' :: Maybe POSIX
startTime = Maybe POSIX
a} :: BuildBatchPhase) ((Maybe POSIX -> f (Maybe POSIX))
-> BuildBatchPhase -> f BuildBatchPhase)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> BuildBatchPhase
-> f BuildBatchPhase
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
buildBatchPhase_phaseStatus :: Lens.Lens' BuildBatchPhase (Prelude.Maybe StatusType)
buildBatchPhase_phaseStatus :: (Maybe StatusType -> f (Maybe StatusType))
-> BuildBatchPhase -> f BuildBatchPhase
buildBatchPhase_phaseStatus = (BuildBatchPhase -> Maybe StatusType)
-> (BuildBatchPhase -> Maybe StatusType -> BuildBatchPhase)
-> Lens
BuildBatchPhase
BuildBatchPhase
(Maybe StatusType)
(Maybe StatusType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BuildBatchPhase' {Maybe StatusType
phaseStatus :: Maybe StatusType
$sel:phaseStatus:BuildBatchPhase' :: BuildBatchPhase -> Maybe StatusType
phaseStatus} -> Maybe StatusType
phaseStatus) (\s :: BuildBatchPhase
s@BuildBatchPhase' {} Maybe StatusType
a -> BuildBatchPhase
s {$sel:phaseStatus:BuildBatchPhase' :: Maybe StatusType
phaseStatus = Maybe StatusType
a} :: BuildBatchPhase)
buildBatchPhase_phaseType :: Lens.Lens' BuildBatchPhase (Prelude.Maybe BuildBatchPhaseType)
buildBatchPhase_phaseType :: (Maybe BuildBatchPhaseType -> f (Maybe BuildBatchPhaseType))
-> BuildBatchPhase -> f BuildBatchPhase
buildBatchPhase_phaseType = (BuildBatchPhase -> Maybe BuildBatchPhaseType)
-> (BuildBatchPhase
-> Maybe BuildBatchPhaseType -> BuildBatchPhase)
-> Lens
BuildBatchPhase
BuildBatchPhase
(Maybe BuildBatchPhaseType)
(Maybe BuildBatchPhaseType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BuildBatchPhase' {Maybe BuildBatchPhaseType
phaseType :: Maybe BuildBatchPhaseType
$sel:phaseType:BuildBatchPhase' :: BuildBatchPhase -> Maybe BuildBatchPhaseType
phaseType} -> Maybe BuildBatchPhaseType
phaseType) (\s :: BuildBatchPhase
s@BuildBatchPhase' {} Maybe BuildBatchPhaseType
a -> BuildBatchPhase
s {$sel:phaseType:BuildBatchPhase' :: Maybe BuildBatchPhaseType
phaseType = Maybe BuildBatchPhaseType
a} :: BuildBatchPhase)
buildBatchPhase_endTime :: Lens.Lens' BuildBatchPhase (Prelude.Maybe Prelude.UTCTime)
buildBatchPhase_endTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> BuildBatchPhase -> f BuildBatchPhase
buildBatchPhase_endTime = (BuildBatchPhase -> Maybe POSIX)
-> (BuildBatchPhase -> Maybe POSIX -> BuildBatchPhase)
-> Lens BuildBatchPhase BuildBatchPhase (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BuildBatchPhase' {Maybe POSIX
endTime :: Maybe POSIX
$sel:endTime:BuildBatchPhase' :: BuildBatchPhase -> Maybe POSIX
endTime} -> Maybe POSIX
endTime) (\s :: BuildBatchPhase
s@BuildBatchPhase' {} Maybe POSIX
a -> BuildBatchPhase
s {$sel:endTime:BuildBatchPhase' :: Maybe POSIX
endTime = Maybe POSIX
a} :: BuildBatchPhase) ((Maybe POSIX -> f (Maybe POSIX))
-> BuildBatchPhase -> f BuildBatchPhase)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> BuildBatchPhase
-> f BuildBatchPhase
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
buildBatchPhase_durationInSeconds :: Lens.Lens' BuildBatchPhase (Prelude.Maybe Prelude.Integer)
buildBatchPhase_durationInSeconds :: (Maybe Integer -> f (Maybe Integer))
-> BuildBatchPhase -> f BuildBatchPhase
buildBatchPhase_durationInSeconds = (BuildBatchPhase -> Maybe Integer)
-> (BuildBatchPhase -> Maybe Integer -> BuildBatchPhase)
-> Lens
BuildBatchPhase BuildBatchPhase (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BuildBatchPhase' {Maybe Integer
durationInSeconds :: Maybe Integer
$sel:durationInSeconds:BuildBatchPhase' :: BuildBatchPhase -> Maybe Integer
durationInSeconds} -> Maybe Integer
durationInSeconds) (\s :: BuildBatchPhase
s@BuildBatchPhase' {} Maybe Integer
a -> BuildBatchPhase
s {$sel:durationInSeconds:BuildBatchPhase' :: Maybe Integer
durationInSeconds = Maybe Integer
a} :: BuildBatchPhase)
instance Core.FromJSON BuildBatchPhase where
parseJSON :: Value -> Parser BuildBatchPhase
parseJSON =
String
-> (Object -> Parser BuildBatchPhase)
-> Value
-> Parser BuildBatchPhase
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"BuildBatchPhase"
( \Object
x ->
Maybe [PhaseContext]
-> Maybe POSIX
-> Maybe StatusType
-> Maybe BuildBatchPhaseType
-> Maybe POSIX
-> Maybe Integer
-> BuildBatchPhase
BuildBatchPhase'
(Maybe [PhaseContext]
-> Maybe POSIX
-> Maybe StatusType
-> Maybe BuildBatchPhaseType
-> Maybe POSIX
-> Maybe Integer
-> BuildBatchPhase)
-> Parser (Maybe [PhaseContext])
-> Parser
(Maybe POSIX
-> Maybe StatusType
-> Maybe BuildBatchPhaseType
-> Maybe POSIX
-> Maybe Integer
-> BuildBatchPhase)
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 BuildBatchPhaseType
-> Maybe POSIX
-> Maybe Integer
-> BuildBatchPhase)
-> Parser (Maybe POSIX)
-> Parser
(Maybe StatusType
-> Maybe BuildBatchPhaseType
-> Maybe POSIX
-> Maybe Integer
-> BuildBatchPhase)
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 BuildBatchPhaseType
-> Maybe POSIX
-> Maybe Integer
-> BuildBatchPhase)
-> Parser (Maybe StatusType)
-> Parser
(Maybe BuildBatchPhaseType
-> Maybe POSIX -> Maybe Integer -> BuildBatchPhase)
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 BuildBatchPhaseType
-> Maybe POSIX -> Maybe Integer -> BuildBatchPhase)
-> Parser (Maybe BuildBatchPhaseType)
-> Parser (Maybe POSIX -> Maybe Integer -> BuildBatchPhase)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe BuildBatchPhaseType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"phaseType")
Parser (Maybe POSIX -> Maybe Integer -> BuildBatchPhase)
-> Parser (Maybe POSIX)
-> Parser (Maybe Integer -> BuildBatchPhase)
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 -> BuildBatchPhase)
-> Parser (Maybe Integer) -> Parser BuildBatchPhase
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 BuildBatchPhase
instance Prelude.NFData BuildBatchPhase