{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.CodeBuild.Types.BuildBatchPhase
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
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

-- | Contains information about a stage for a batch build.
--
-- /See:/ 'newBuildBatchPhase' smart constructor.
data BuildBatchPhase = BuildBatchPhase'
  { -- | Additional information about the batch build phase. Especially to help
    -- troubleshoot a failed batch build.
    BuildBatchPhase -> Maybe [PhaseContext]
contexts :: Prelude.Maybe [PhaseContext],
    -- | When the batch build phase started, expressed in Unix time format.
    BuildBatchPhase -> Maybe POSIX
startTime :: Prelude.Maybe Core.POSIX,
    -- | The current status of the batch build phase. Valid values include:
    --
    -- [FAILED]
    --     The build phase failed.
    --
    -- [FAULT]
    --     The build phase faulted.
    --
    -- [IN_PROGRESS]
    --     The build phase is still in progress.
    --
    -- [STOPPED]
    --     The build phase stopped.
    --
    -- [SUCCEEDED]
    --     The build phase succeeded.
    --
    -- [TIMED_OUT]
    --     The build phase timed out.
    BuildBatchPhase -> Maybe StatusType
phaseStatus :: Prelude.Maybe StatusType,
    -- | The name of the batch build phase. Valid values include:
    --
    -- [COMBINE_ARTIFACTS]
    --     Build output artifacts are being combined and uploaded to the output
    --     location.
    --
    -- [DOWNLOAD_BATCHSPEC]
    --     The batch build specification is being downloaded.
    --
    -- [FAILED]
    --     One or more of the builds failed.
    --
    -- [IN_PROGRESS]
    --     The batch build is in progress.
    --
    -- [STOPPED]
    --     The batch build was stopped.
    --
    -- [SUBMITTED]
    --     The btach build has been submitted.
    --
    -- [SUCCEEDED]
    --     The batch build succeeded.
    BuildBatchPhase -> Maybe BuildBatchPhaseType
phaseType :: Prelude.Maybe BuildBatchPhaseType,
    -- | When the batch build phase ended, expressed in Unix time format.
    BuildBatchPhase -> Maybe POSIX
endTime :: Prelude.Maybe Core.POSIX,
    -- | How long, in seconds, between the starting and ending times of the batch
    -- build\'s phase.
    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)

-- |
-- Create a value of 'BuildBatchPhase' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'contexts', 'buildBatchPhase_contexts' - Additional information about the batch build phase. Especially to help
-- troubleshoot a failed batch build.
--
-- 'startTime', 'buildBatchPhase_startTime' - When the batch build phase started, expressed in Unix time format.
--
-- 'phaseStatus', 'buildBatchPhase_phaseStatus' - The current status of the batch build phase. Valid values include:
--
-- [FAILED]
--     The build phase failed.
--
-- [FAULT]
--     The build phase faulted.
--
-- [IN_PROGRESS]
--     The build phase is still in progress.
--
-- [STOPPED]
--     The build phase stopped.
--
-- [SUCCEEDED]
--     The build phase succeeded.
--
-- [TIMED_OUT]
--     The build phase timed out.
--
-- 'phaseType', 'buildBatchPhase_phaseType' - The name of the batch build phase. Valid values include:
--
-- [COMBINE_ARTIFACTS]
--     Build output artifacts are being combined and uploaded to the output
--     location.
--
-- [DOWNLOAD_BATCHSPEC]
--     The batch build specification is being downloaded.
--
-- [FAILED]
--     One or more of the builds failed.
--
-- [IN_PROGRESS]
--     The batch build is in progress.
--
-- [STOPPED]
--     The batch build was stopped.
--
-- [SUBMITTED]
--     The btach build has been submitted.
--
-- [SUCCEEDED]
--     The batch build succeeded.
--
-- 'endTime', 'buildBatchPhase_endTime' - When the batch build phase ended, expressed in Unix time format.
--
-- 'durationInSeconds', 'buildBatchPhase_durationInSeconds' - How long, in seconds, between the starting and ending times of the batch
-- build\'s phase.
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
    }

-- | Additional information about the batch build phase. Especially to help
-- troubleshoot a failed batch build.
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

-- | When the batch build phase started, expressed in Unix time format.
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

-- | The current status of the batch build phase. Valid values include:
--
-- [FAILED]
--     The build phase failed.
--
-- [FAULT]
--     The build phase faulted.
--
-- [IN_PROGRESS]
--     The build phase is still in progress.
--
-- [STOPPED]
--     The build phase stopped.
--
-- [SUCCEEDED]
--     The build phase succeeded.
--
-- [TIMED_OUT]
--     The build phase timed out.
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)

-- | The name of the batch build phase. Valid values include:
--
-- [COMBINE_ARTIFACTS]
--     Build output artifacts are being combined and uploaded to the output
--     location.
--
-- [DOWNLOAD_BATCHSPEC]
--     The batch build specification is being downloaded.
--
-- [FAILED]
--     One or more of the builds failed.
--
-- [IN_PROGRESS]
--     The batch build is in progress.
--
-- [STOPPED]
--     The batch build was stopped.
--
-- [SUBMITTED]
--     The btach build has been submitted.
--
-- [SUCCEEDED]
--     The batch build succeeded.
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)

-- | When the batch build phase ended, expressed in Unix time format.
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

-- | How long, in seconds, between the starting and ending times of the batch
-- build\'s phase.
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