{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data BuildBatchPhase = BuildBatchPhase'
{
BuildBatchPhase -> Maybe [PhaseContext]
contexts :: Prelude.Maybe [PhaseContext],
BuildBatchPhase -> Maybe Integer
durationInSeconds :: Prelude.Maybe Prelude.Integer,
BuildBatchPhase -> Maybe POSIX
endTime :: Prelude.Maybe Data.POSIX,
BuildBatchPhase -> Maybe StatusType
phaseStatus :: Prelude.Maybe StatusType,
BuildBatchPhase -> Maybe BuildBatchPhaseType
phaseType :: Prelude.Maybe BuildBatchPhaseType,
BuildBatchPhase -> Maybe POSIX
startTime :: Prelude.Maybe Data.POSIX
}
deriving (BuildBatchPhase -> BuildBatchPhase -> Bool
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]
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
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. 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'
{ $sel:contexts:BuildBatchPhase' :: Maybe [PhaseContext]
contexts = forall a. Maybe a
Prelude.Nothing,
$sel:durationInSeconds:BuildBatchPhase' :: Maybe Integer
durationInSeconds = forall a. Maybe a
Prelude.Nothing,
$sel:endTime:BuildBatchPhase' :: Maybe POSIX
endTime = forall a. Maybe a
Prelude.Nothing,
$sel:phaseStatus:BuildBatchPhase' :: Maybe StatusType
phaseStatus = forall a. Maybe a
Prelude.Nothing,
$sel:phaseType:BuildBatchPhase' :: Maybe BuildBatchPhaseType
phaseType = forall a. Maybe a
Prelude.Nothing,
$sel:startTime:BuildBatchPhase' :: Maybe POSIX
startTime = forall a. Maybe a
Prelude.Nothing
}
buildBatchPhase_contexts :: Lens.Lens' BuildBatchPhase (Prelude.Maybe [PhaseContext])
buildBatchPhase_contexts :: Lens' BuildBatchPhase (Maybe [PhaseContext])
buildBatchPhase_contexts = 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) 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
buildBatchPhase_durationInSeconds :: Lens.Lens' BuildBatchPhase (Prelude.Maybe Prelude.Integer)
buildBatchPhase_durationInSeconds :: Lens' BuildBatchPhase (Maybe Integer)
buildBatchPhase_durationInSeconds = 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)
buildBatchPhase_endTime :: Lens.Lens' BuildBatchPhase (Prelude.Maybe Prelude.UTCTime)
buildBatchPhase_endTime :: Lens' BuildBatchPhase (Maybe UTCTime)
buildBatchPhase_endTime = 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) 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
buildBatchPhase_phaseStatus :: Lens.Lens' BuildBatchPhase (Prelude.Maybe StatusType)
buildBatchPhase_phaseStatus :: Lens' BuildBatchPhase (Maybe StatusType)
buildBatchPhase_phaseStatus = 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 :: Lens' BuildBatchPhase (Maybe BuildBatchPhaseType)
buildBatchPhase_phaseType = 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_startTime :: Lens.Lens' BuildBatchPhase (Prelude.Maybe Prelude.UTCTime)
buildBatchPhase_startTime :: Lens' BuildBatchPhase (Maybe UTCTime)
buildBatchPhase_startTime = 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) 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 BuildBatchPhase where
parseJSON :: Value -> Parser BuildBatchPhase
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"BuildBatchPhase"
( \Object
x ->
Maybe [PhaseContext]
-> Maybe Integer
-> Maybe POSIX
-> Maybe StatusType
-> Maybe BuildBatchPhaseType
-> Maybe POSIX
-> BuildBatchPhase
BuildBatchPhase'
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 BuildBatchPhase where
hashWithSalt :: Int -> BuildBatchPhase -> Int
hashWithSalt Int
_salt BuildBatchPhase' {Maybe Integer
Maybe [PhaseContext]
Maybe POSIX
Maybe BuildBatchPhaseType
Maybe StatusType
startTime :: Maybe POSIX
phaseType :: Maybe BuildBatchPhaseType
phaseStatus :: Maybe StatusType
endTime :: Maybe POSIX
durationInSeconds :: Maybe Integer
contexts :: Maybe [PhaseContext]
$sel:startTime:BuildBatchPhase' :: BuildBatchPhase -> Maybe POSIX
$sel:phaseType:BuildBatchPhase' :: BuildBatchPhase -> Maybe BuildBatchPhaseType
$sel:phaseStatus:BuildBatchPhase' :: BuildBatchPhase -> Maybe StatusType
$sel:endTime:BuildBatchPhase' :: BuildBatchPhase -> Maybe POSIX
$sel:durationInSeconds:BuildBatchPhase' :: BuildBatchPhase -> Maybe Integer
$sel:contexts:BuildBatchPhase' :: BuildBatchPhase -> 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 BuildBatchPhaseType
phaseType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
startTime
instance Prelude.NFData BuildBatchPhase where
rnf :: BuildBatchPhase -> ()
rnf BuildBatchPhase' {Maybe Integer
Maybe [PhaseContext]
Maybe POSIX
Maybe BuildBatchPhaseType
Maybe StatusType
startTime :: Maybe POSIX
phaseType :: Maybe BuildBatchPhaseType
phaseStatus :: Maybe StatusType
endTime :: Maybe POSIX
durationInSeconds :: Maybe Integer
contexts :: Maybe [PhaseContext]
$sel:startTime:BuildBatchPhase' :: BuildBatchPhase -> Maybe POSIX
$sel:phaseType:BuildBatchPhase' :: BuildBatchPhase -> Maybe BuildBatchPhaseType
$sel:phaseStatus:BuildBatchPhase' :: BuildBatchPhase -> Maybe StatusType
$sel:endTime:BuildBatchPhase' :: BuildBatchPhase -> Maybe POSIX
$sel:durationInSeconds:BuildBatchPhase' :: BuildBatchPhase -> Maybe Integer
$sel:contexts:BuildBatchPhase' :: BuildBatchPhase -> 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 BuildBatchPhaseType
phaseType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
startTime