{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

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

-- |
-- Module      : Amazonka.Amplify.StartJob
-- 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)
--
-- Starts a new job for a branch of an Amplify app.
module Amazonka.Amplify.StartJob
  ( -- * Creating a Request
    StartJob (..),
    newStartJob,

    -- * Request Lenses
    startJob_commitId,
    startJob_jobId,
    startJob_jobReason,
    startJob_commitTime,
    startJob_commitMessage,
    startJob_appId,
    startJob_branchName,
    startJob_jobType,

    -- * Destructuring the Response
    StartJobResponse (..),
    newStartJobResponse,

    -- * Response Lenses
    startJobResponse_httpStatus,
    startJobResponse_jobSummary,
  )
where

import Amazonka.Amplify.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | The request structure for the start job request.
--
-- /See:/ 'newStartJob' smart constructor.
data StartJob = StartJob'
  { -- | The commit ID from a third-party repository provider for the job.
    StartJob -> Maybe Text
commitId :: Prelude.Maybe Prelude.Text,
    -- | The unique ID for an existing job. This is required if the value of
    -- @jobType@ is @RETRY@.
    StartJob -> Maybe Text
jobId :: Prelude.Maybe Prelude.Text,
    -- | A descriptive reason for starting this job.
    StartJob -> Maybe Text
jobReason :: Prelude.Maybe Prelude.Text,
    -- | The commit date and time for the job.
    StartJob -> Maybe POSIX
commitTime :: Prelude.Maybe Core.POSIX,
    -- | The commit message from a third-party repository provider for the job.
    StartJob -> Maybe Text
commitMessage :: Prelude.Maybe Prelude.Text,
    -- | The unique ID for an Amplify app.
    StartJob -> Text
appId :: Prelude.Text,
    -- | The branch name for the job.
    StartJob -> Text
branchName :: Prelude.Text,
    -- | Describes the type for the job. The job type @RELEASE@ starts a new job
    -- with the latest change from the specified branch. This value is
    -- available only for apps that are connected to a repository. The job type
    -- @RETRY@ retries an existing job. If the job type value is @RETRY@, the
    -- @jobId@ is also required.
    StartJob -> JobType
jobType :: JobType
  }
  deriving (StartJob -> StartJob -> Bool
(StartJob -> StartJob -> Bool)
-> (StartJob -> StartJob -> Bool) -> Eq StartJob
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartJob -> StartJob -> Bool
$c/= :: StartJob -> StartJob -> Bool
== :: StartJob -> StartJob -> Bool
$c== :: StartJob -> StartJob -> Bool
Prelude.Eq, ReadPrec [StartJob]
ReadPrec StartJob
Int -> ReadS StartJob
ReadS [StartJob]
(Int -> ReadS StartJob)
-> ReadS [StartJob]
-> ReadPrec StartJob
-> ReadPrec [StartJob]
-> Read StartJob
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartJob]
$creadListPrec :: ReadPrec [StartJob]
readPrec :: ReadPrec StartJob
$creadPrec :: ReadPrec StartJob
readList :: ReadS [StartJob]
$creadList :: ReadS [StartJob]
readsPrec :: Int -> ReadS StartJob
$creadsPrec :: Int -> ReadS StartJob
Prelude.Read, Int -> StartJob -> ShowS
[StartJob] -> ShowS
StartJob -> String
(Int -> StartJob -> ShowS)
-> (StartJob -> String) -> ([StartJob] -> ShowS) -> Show StartJob
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartJob] -> ShowS
$cshowList :: [StartJob] -> ShowS
show :: StartJob -> String
$cshow :: StartJob -> String
showsPrec :: Int -> StartJob -> ShowS
$cshowsPrec :: Int -> StartJob -> ShowS
Prelude.Show, (forall x. StartJob -> Rep StartJob x)
-> (forall x. Rep StartJob x -> StartJob) -> Generic StartJob
forall x. Rep StartJob x -> StartJob
forall x. StartJob -> Rep StartJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StartJob x -> StartJob
$cfrom :: forall x. StartJob -> Rep StartJob x
Prelude.Generic)

-- |
-- Create a value of 'StartJob' 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:
--
-- 'commitId', 'startJob_commitId' - The commit ID from a third-party repository provider for the job.
--
-- 'jobId', 'startJob_jobId' - The unique ID for an existing job. This is required if the value of
-- @jobType@ is @RETRY@.
--
-- 'jobReason', 'startJob_jobReason' - A descriptive reason for starting this job.
--
-- 'commitTime', 'startJob_commitTime' - The commit date and time for the job.
--
-- 'commitMessage', 'startJob_commitMessage' - The commit message from a third-party repository provider for the job.
--
-- 'appId', 'startJob_appId' - The unique ID for an Amplify app.
--
-- 'branchName', 'startJob_branchName' - The branch name for the job.
--
-- 'jobType', 'startJob_jobType' - Describes the type for the job. The job type @RELEASE@ starts a new job
-- with the latest change from the specified branch. This value is
-- available only for apps that are connected to a repository. The job type
-- @RETRY@ retries an existing job. If the job type value is @RETRY@, the
-- @jobId@ is also required.
newStartJob ::
  -- | 'appId'
  Prelude.Text ->
  -- | 'branchName'
  Prelude.Text ->
  -- | 'jobType'
  JobType ->
  StartJob
newStartJob :: Text -> Text -> JobType -> StartJob
newStartJob Text
pAppId_ Text
pBranchName_ JobType
pJobType_ =
  StartJob' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Text
-> Text
-> JobType
-> StartJob
StartJob'
    { $sel:commitId:StartJob' :: Maybe Text
commitId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:jobId:StartJob' :: Maybe Text
jobId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:jobReason:StartJob' :: Maybe Text
jobReason = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:commitTime:StartJob' :: Maybe POSIX
commitTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:commitMessage:StartJob' :: Maybe Text
commitMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:appId:StartJob' :: Text
appId = Text
pAppId_,
      $sel:branchName:StartJob' :: Text
branchName = Text
pBranchName_,
      $sel:jobType:StartJob' :: JobType
jobType = JobType
pJobType_
    }

-- | The commit ID from a third-party repository provider for the job.
startJob_commitId :: Lens.Lens' StartJob (Prelude.Maybe Prelude.Text)
startJob_commitId :: (Maybe Text -> f (Maybe Text)) -> StartJob -> f StartJob
startJob_commitId = (StartJob -> Maybe Text)
-> (StartJob -> Maybe Text -> StartJob)
-> Lens StartJob StartJob (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartJob' {Maybe Text
commitId :: Maybe Text
$sel:commitId:StartJob' :: StartJob -> Maybe Text
commitId} -> Maybe Text
commitId) (\s :: StartJob
s@StartJob' {} Maybe Text
a -> StartJob
s {$sel:commitId:StartJob' :: Maybe Text
commitId = Maybe Text
a} :: StartJob)

-- | The unique ID for an existing job. This is required if the value of
-- @jobType@ is @RETRY@.
startJob_jobId :: Lens.Lens' StartJob (Prelude.Maybe Prelude.Text)
startJob_jobId :: (Maybe Text -> f (Maybe Text)) -> StartJob -> f StartJob
startJob_jobId = (StartJob -> Maybe Text)
-> (StartJob -> Maybe Text -> StartJob)
-> Lens StartJob StartJob (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartJob' {Maybe Text
jobId :: Maybe Text
$sel:jobId:StartJob' :: StartJob -> Maybe Text
jobId} -> Maybe Text
jobId) (\s :: StartJob
s@StartJob' {} Maybe Text
a -> StartJob
s {$sel:jobId:StartJob' :: Maybe Text
jobId = Maybe Text
a} :: StartJob)

-- | A descriptive reason for starting this job.
startJob_jobReason :: Lens.Lens' StartJob (Prelude.Maybe Prelude.Text)
startJob_jobReason :: (Maybe Text -> f (Maybe Text)) -> StartJob -> f StartJob
startJob_jobReason = (StartJob -> Maybe Text)
-> (StartJob -> Maybe Text -> StartJob)
-> Lens StartJob StartJob (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartJob' {Maybe Text
jobReason :: Maybe Text
$sel:jobReason:StartJob' :: StartJob -> Maybe Text
jobReason} -> Maybe Text
jobReason) (\s :: StartJob
s@StartJob' {} Maybe Text
a -> StartJob
s {$sel:jobReason:StartJob' :: Maybe Text
jobReason = Maybe Text
a} :: StartJob)

-- | The commit date and time for the job.
startJob_commitTime :: Lens.Lens' StartJob (Prelude.Maybe Prelude.UTCTime)
startJob_commitTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> StartJob -> f StartJob
startJob_commitTime = (StartJob -> Maybe POSIX)
-> (StartJob -> Maybe POSIX -> StartJob)
-> Lens StartJob StartJob (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartJob' {Maybe POSIX
commitTime :: Maybe POSIX
$sel:commitTime:StartJob' :: StartJob -> Maybe POSIX
commitTime} -> Maybe POSIX
commitTime) (\s :: StartJob
s@StartJob' {} Maybe POSIX
a -> StartJob
s {$sel:commitTime:StartJob' :: Maybe POSIX
commitTime = Maybe POSIX
a} :: StartJob) ((Maybe POSIX -> f (Maybe POSIX)) -> StartJob -> f StartJob)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> StartJob
-> f StartJob
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 commit message from a third-party repository provider for the job.
startJob_commitMessage :: Lens.Lens' StartJob (Prelude.Maybe Prelude.Text)
startJob_commitMessage :: (Maybe Text -> f (Maybe Text)) -> StartJob -> f StartJob
startJob_commitMessage = (StartJob -> Maybe Text)
-> (StartJob -> Maybe Text -> StartJob)
-> Lens StartJob StartJob (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartJob' {Maybe Text
commitMessage :: Maybe Text
$sel:commitMessage:StartJob' :: StartJob -> Maybe Text
commitMessage} -> Maybe Text
commitMessage) (\s :: StartJob
s@StartJob' {} Maybe Text
a -> StartJob
s {$sel:commitMessage:StartJob' :: Maybe Text
commitMessage = Maybe Text
a} :: StartJob)

-- | The unique ID for an Amplify app.
startJob_appId :: Lens.Lens' StartJob Prelude.Text
startJob_appId :: (Text -> f Text) -> StartJob -> f StartJob
startJob_appId = (StartJob -> Text)
-> (StartJob -> Text -> StartJob)
-> Lens StartJob StartJob Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartJob' {Text
appId :: Text
$sel:appId:StartJob' :: StartJob -> Text
appId} -> Text
appId) (\s :: StartJob
s@StartJob' {} Text
a -> StartJob
s {$sel:appId:StartJob' :: Text
appId = Text
a} :: StartJob)

-- | The branch name for the job.
startJob_branchName :: Lens.Lens' StartJob Prelude.Text
startJob_branchName :: (Text -> f Text) -> StartJob -> f StartJob
startJob_branchName = (StartJob -> Text)
-> (StartJob -> Text -> StartJob)
-> Lens StartJob StartJob Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartJob' {Text
branchName :: Text
$sel:branchName:StartJob' :: StartJob -> Text
branchName} -> Text
branchName) (\s :: StartJob
s@StartJob' {} Text
a -> StartJob
s {$sel:branchName:StartJob' :: Text
branchName = Text
a} :: StartJob)

-- | Describes the type for the job. The job type @RELEASE@ starts a new job
-- with the latest change from the specified branch. This value is
-- available only for apps that are connected to a repository. The job type
-- @RETRY@ retries an existing job. If the job type value is @RETRY@, the
-- @jobId@ is also required.
startJob_jobType :: Lens.Lens' StartJob JobType
startJob_jobType :: (JobType -> f JobType) -> StartJob -> f StartJob
startJob_jobType = (StartJob -> JobType)
-> (StartJob -> JobType -> StartJob)
-> Lens StartJob StartJob JobType JobType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartJob' {JobType
jobType :: JobType
$sel:jobType:StartJob' :: StartJob -> JobType
jobType} -> JobType
jobType) (\s :: StartJob
s@StartJob' {} JobType
a -> StartJob
s {$sel:jobType:StartJob' :: JobType
jobType = JobType
a} :: StartJob)

instance Core.AWSRequest StartJob where
  type AWSResponse StartJob = StartJobResponse
  request :: StartJob -> Request StartJob
request = Service -> StartJob -> Request StartJob
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy StartJob
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse StartJob)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse StartJob))
-> Logger
-> Service
-> Proxy StartJob
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse StartJob)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Int -> JobSummary -> StartJobResponse
StartJobResponse'
            (Int -> JobSummary -> StartJobResponse)
-> Either String Int
-> Either String (JobSummary -> StartJobResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            Either String (JobSummary -> StartJobResponse)
-> Either String JobSummary -> Either String StartJobResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String JobSummary
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"jobSummary")
      )

instance Prelude.Hashable StartJob

instance Prelude.NFData StartJob

instance Core.ToHeaders StartJob where
  toHeaders :: StartJob -> ResponseHeaders
toHeaders =
    ResponseHeaders -> StartJob -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON StartJob where
  toJSON :: StartJob -> Value
toJSON StartJob' {Maybe Text
Maybe POSIX
Text
JobType
jobType :: JobType
branchName :: Text
appId :: Text
commitMessage :: Maybe Text
commitTime :: Maybe POSIX
jobReason :: Maybe Text
jobId :: Maybe Text
commitId :: Maybe Text
$sel:jobType:StartJob' :: StartJob -> JobType
$sel:branchName:StartJob' :: StartJob -> Text
$sel:appId:StartJob' :: StartJob -> Text
$sel:commitMessage:StartJob' :: StartJob -> Maybe Text
$sel:commitTime:StartJob' :: StartJob -> Maybe POSIX
$sel:jobReason:StartJob' :: StartJob -> Maybe Text
$sel:jobId:StartJob' :: StartJob -> Maybe Text
$sel:commitId:StartJob' :: StartJob -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"commitId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
commitId,
            (Text
"jobId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
jobId,
            (Text
"jobReason" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
jobReason,
            (Text
"commitTime" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (POSIX -> Pair) -> Maybe POSIX -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe POSIX
commitTime,
            (Text
"commitMessage" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
commitMessage,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"jobType" Text -> JobType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= JobType
jobType)
          ]
      )

instance Core.ToPath StartJob where
  toPath :: StartJob -> ByteString
toPath StartJob' {Maybe Text
Maybe POSIX
Text
JobType
jobType :: JobType
branchName :: Text
appId :: Text
commitMessage :: Maybe Text
commitTime :: Maybe POSIX
jobReason :: Maybe Text
jobId :: Maybe Text
commitId :: Maybe Text
$sel:jobType:StartJob' :: StartJob -> JobType
$sel:branchName:StartJob' :: StartJob -> Text
$sel:appId:StartJob' :: StartJob -> Text
$sel:commitMessage:StartJob' :: StartJob -> Maybe Text
$sel:commitTime:StartJob' :: StartJob -> Maybe POSIX
$sel:jobReason:StartJob' :: StartJob -> Maybe Text
$sel:jobId:StartJob' :: StartJob -> Maybe Text
$sel:commitId:StartJob' :: StartJob -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/apps/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
appId,
        ByteString
"/branches/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
branchName,
        ByteString
"/jobs"
      ]

instance Core.ToQuery StartJob where
  toQuery :: StartJob -> QueryString
toQuery = QueryString -> StartJob -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | The result structure for the run job request.
--
-- /See:/ 'newStartJobResponse' smart constructor.
data StartJobResponse = StartJobResponse'
  { -- | The response's http status code.
    StartJobResponse -> Int
httpStatus :: Prelude.Int,
    -- | The summary for the job.
    StartJobResponse -> JobSummary
jobSummary :: JobSummary
  }
  deriving (StartJobResponse -> StartJobResponse -> Bool
(StartJobResponse -> StartJobResponse -> Bool)
-> (StartJobResponse -> StartJobResponse -> Bool)
-> Eq StartJobResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartJobResponse -> StartJobResponse -> Bool
$c/= :: StartJobResponse -> StartJobResponse -> Bool
== :: StartJobResponse -> StartJobResponse -> Bool
$c== :: StartJobResponse -> StartJobResponse -> Bool
Prelude.Eq, ReadPrec [StartJobResponse]
ReadPrec StartJobResponse
Int -> ReadS StartJobResponse
ReadS [StartJobResponse]
(Int -> ReadS StartJobResponse)
-> ReadS [StartJobResponse]
-> ReadPrec StartJobResponse
-> ReadPrec [StartJobResponse]
-> Read StartJobResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartJobResponse]
$creadListPrec :: ReadPrec [StartJobResponse]
readPrec :: ReadPrec StartJobResponse
$creadPrec :: ReadPrec StartJobResponse
readList :: ReadS [StartJobResponse]
$creadList :: ReadS [StartJobResponse]
readsPrec :: Int -> ReadS StartJobResponse
$creadsPrec :: Int -> ReadS StartJobResponse
Prelude.Read, Int -> StartJobResponse -> ShowS
[StartJobResponse] -> ShowS
StartJobResponse -> String
(Int -> StartJobResponse -> ShowS)
-> (StartJobResponse -> String)
-> ([StartJobResponse] -> ShowS)
-> Show StartJobResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartJobResponse] -> ShowS
$cshowList :: [StartJobResponse] -> ShowS
show :: StartJobResponse -> String
$cshow :: StartJobResponse -> String
showsPrec :: Int -> StartJobResponse -> ShowS
$cshowsPrec :: Int -> StartJobResponse -> ShowS
Prelude.Show, (forall x. StartJobResponse -> Rep StartJobResponse x)
-> (forall x. Rep StartJobResponse x -> StartJobResponse)
-> Generic StartJobResponse
forall x. Rep StartJobResponse x -> StartJobResponse
forall x. StartJobResponse -> Rep StartJobResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StartJobResponse x -> StartJobResponse
$cfrom :: forall x. StartJobResponse -> Rep StartJobResponse x
Prelude.Generic)

-- |
-- Create a value of 'StartJobResponse' 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:
--
-- 'httpStatus', 'startJobResponse_httpStatus' - The response's http status code.
--
-- 'jobSummary', 'startJobResponse_jobSummary' - The summary for the job.
newStartJobResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'jobSummary'
  JobSummary ->
  StartJobResponse
newStartJobResponse :: Int -> JobSummary -> StartJobResponse
newStartJobResponse Int
pHttpStatus_ JobSummary
pJobSummary_ =
  StartJobResponse' :: Int -> JobSummary -> StartJobResponse
StartJobResponse'
    { $sel:httpStatus:StartJobResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:jobSummary:StartJobResponse' :: JobSummary
jobSummary = JobSummary
pJobSummary_
    }

-- | The response's http status code.
startJobResponse_httpStatus :: Lens.Lens' StartJobResponse Prelude.Int
startJobResponse_httpStatus :: (Int -> f Int) -> StartJobResponse -> f StartJobResponse
startJobResponse_httpStatus = (StartJobResponse -> Int)
-> (StartJobResponse -> Int -> StartJobResponse)
-> Lens StartJobResponse StartJobResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartJobResponse' {Int
httpStatus :: Int
$sel:httpStatus:StartJobResponse' :: StartJobResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: StartJobResponse
s@StartJobResponse' {} Int
a -> StartJobResponse
s {$sel:httpStatus:StartJobResponse' :: Int
httpStatus = Int
a} :: StartJobResponse)

-- | The summary for the job.
startJobResponse_jobSummary :: Lens.Lens' StartJobResponse JobSummary
startJobResponse_jobSummary :: (JobSummary -> f JobSummary)
-> StartJobResponse -> f StartJobResponse
startJobResponse_jobSummary = (StartJobResponse -> JobSummary)
-> (StartJobResponse -> JobSummary -> StartJobResponse)
-> Lens StartJobResponse StartJobResponse JobSummary JobSummary
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartJobResponse' {JobSummary
jobSummary :: JobSummary
$sel:jobSummary:StartJobResponse' :: StartJobResponse -> JobSummary
jobSummary} -> JobSummary
jobSummary) (\s :: StartJobResponse
s@StartJobResponse' {} JobSummary
a -> StartJobResponse
s {$sel:jobSummary:StartJobResponse' :: JobSummary
jobSummary = JobSummary
a} :: StartJobResponse)

instance Prelude.NFData StartJobResponse