{-# 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.IoTJobsData.StartNextPendingJobExecution
-- 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)
--
-- Gets and starts the next pending (status IN_PROGRESS or QUEUED) job
-- execution for a thing.
module Amazonka.IoTJobsData.StartNextPendingJobExecution
  ( -- * Creating a Request
    StartNextPendingJobExecution (..),
    newStartNextPendingJobExecution,

    -- * Request Lenses
    startNextPendingJobExecution_stepTimeoutInMinutes,
    startNextPendingJobExecution_statusDetails,
    startNextPendingJobExecution_thingName,

    -- * Destructuring the Response
    StartNextPendingJobExecutionResponse (..),
    newStartNextPendingJobExecutionResponse,

    -- * Response Lenses
    startNextPendingJobExecutionResponse_execution,
    startNextPendingJobExecutionResponse_httpStatus,
  )
where

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

-- | /See:/ 'newStartNextPendingJobExecution' smart constructor.
data StartNextPendingJobExecution = StartNextPendingJobExecution'
  { -- | Specifies the amount of time this device has to finish execution of this
    -- job. If the job execution status is not set to a terminal state before
    -- this timer expires, or before the timer is reset (by calling
    -- @UpdateJobExecution@, setting the status to @IN_PROGRESS@ and specifying
    -- a new timeout value in field @stepTimeoutInMinutes@) the job execution
    -- status will be automatically set to @TIMED_OUT@. Note that setting this
    -- timeout has no effect on that job execution timeout which may have been
    -- specified when the job was created (@CreateJob@ using field
    -- @timeoutConfig@).
    StartNextPendingJobExecution -> Maybe Integer
stepTimeoutInMinutes :: Prelude.Maybe Prelude.Integer,
    -- | A collection of name\/value pairs that describe the status of the job
    -- execution. If not specified, the statusDetails are unchanged.
    StartNextPendingJobExecution -> Maybe (HashMap Text Text)
statusDetails :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The name of the thing associated with the device.
    StartNextPendingJobExecution -> Text
thingName :: Prelude.Text
  }
  deriving (StartNextPendingJobExecution
-> StartNextPendingJobExecution -> Bool
(StartNextPendingJobExecution
 -> StartNextPendingJobExecution -> Bool)
-> (StartNextPendingJobExecution
    -> StartNextPendingJobExecution -> Bool)
-> Eq StartNextPendingJobExecution
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartNextPendingJobExecution
-> StartNextPendingJobExecution -> Bool
$c/= :: StartNextPendingJobExecution
-> StartNextPendingJobExecution -> Bool
== :: StartNextPendingJobExecution
-> StartNextPendingJobExecution -> Bool
$c== :: StartNextPendingJobExecution
-> StartNextPendingJobExecution -> Bool
Prelude.Eq, ReadPrec [StartNextPendingJobExecution]
ReadPrec StartNextPendingJobExecution
Int -> ReadS StartNextPendingJobExecution
ReadS [StartNextPendingJobExecution]
(Int -> ReadS StartNextPendingJobExecution)
-> ReadS [StartNextPendingJobExecution]
-> ReadPrec StartNextPendingJobExecution
-> ReadPrec [StartNextPendingJobExecution]
-> Read StartNextPendingJobExecution
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartNextPendingJobExecution]
$creadListPrec :: ReadPrec [StartNextPendingJobExecution]
readPrec :: ReadPrec StartNextPendingJobExecution
$creadPrec :: ReadPrec StartNextPendingJobExecution
readList :: ReadS [StartNextPendingJobExecution]
$creadList :: ReadS [StartNextPendingJobExecution]
readsPrec :: Int -> ReadS StartNextPendingJobExecution
$creadsPrec :: Int -> ReadS StartNextPendingJobExecution
Prelude.Read, Int -> StartNextPendingJobExecution -> ShowS
[StartNextPendingJobExecution] -> ShowS
StartNextPendingJobExecution -> String
(Int -> StartNextPendingJobExecution -> ShowS)
-> (StartNextPendingJobExecution -> String)
-> ([StartNextPendingJobExecution] -> ShowS)
-> Show StartNextPendingJobExecution
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartNextPendingJobExecution] -> ShowS
$cshowList :: [StartNextPendingJobExecution] -> ShowS
show :: StartNextPendingJobExecution -> String
$cshow :: StartNextPendingJobExecution -> String
showsPrec :: Int -> StartNextPendingJobExecution -> ShowS
$cshowsPrec :: Int -> StartNextPendingJobExecution -> ShowS
Prelude.Show, (forall x.
 StartNextPendingJobExecution -> Rep StartNextPendingJobExecution x)
-> (forall x.
    Rep StartNextPendingJobExecution x -> StartNextPendingJobExecution)
-> Generic StartNextPendingJobExecution
forall x.
Rep StartNextPendingJobExecution x -> StartNextPendingJobExecution
forall x.
StartNextPendingJobExecution -> Rep StartNextPendingJobExecution x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StartNextPendingJobExecution x -> StartNextPendingJobExecution
$cfrom :: forall x.
StartNextPendingJobExecution -> Rep StartNextPendingJobExecution x
Prelude.Generic)

-- |
-- Create a value of 'StartNextPendingJobExecution' 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:
--
-- 'stepTimeoutInMinutes', 'startNextPendingJobExecution_stepTimeoutInMinutes' - Specifies the amount of time this device has to finish execution of this
-- job. If the job execution status is not set to a terminal state before
-- this timer expires, or before the timer is reset (by calling
-- @UpdateJobExecution@, setting the status to @IN_PROGRESS@ and specifying
-- a new timeout value in field @stepTimeoutInMinutes@) the job execution
-- status will be automatically set to @TIMED_OUT@. Note that setting this
-- timeout has no effect on that job execution timeout which may have been
-- specified when the job was created (@CreateJob@ using field
-- @timeoutConfig@).
--
-- 'statusDetails', 'startNextPendingJobExecution_statusDetails' - A collection of name\/value pairs that describe the status of the job
-- execution. If not specified, the statusDetails are unchanged.
--
-- 'thingName', 'startNextPendingJobExecution_thingName' - The name of the thing associated with the device.
newStartNextPendingJobExecution ::
  -- | 'thingName'
  Prelude.Text ->
  StartNextPendingJobExecution
newStartNextPendingJobExecution :: Text -> StartNextPendingJobExecution
newStartNextPendingJobExecution Text
pThingName_ =
  StartNextPendingJobExecution' :: Maybe Integer
-> Maybe (HashMap Text Text)
-> Text
-> StartNextPendingJobExecution
StartNextPendingJobExecution'
    { $sel:stepTimeoutInMinutes:StartNextPendingJobExecution' :: Maybe Integer
stepTimeoutInMinutes =
        Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:statusDetails:StartNextPendingJobExecution' :: Maybe (HashMap Text Text)
statusDetails = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:thingName:StartNextPendingJobExecution' :: Text
thingName = Text
pThingName_
    }

-- | Specifies the amount of time this device has to finish execution of this
-- job. If the job execution status is not set to a terminal state before
-- this timer expires, or before the timer is reset (by calling
-- @UpdateJobExecution@, setting the status to @IN_PROGRESS@ and specifying
-- a new timeout value in field @stepTimeoutInMinutes@) the job execution
-- status will be automatically set to @TIMED_OUT@. Note that setting this
-- timeout has no effect on that job execution timeout which may have been
-- specified when the job was created (@CreateJob@ using field
-- @timeoutConfig@).
startNextPendingJobExecution_stepTimeoutInMinutes :: Lens.Lens' StartNextPendingJobExecution (Prelude.Maybe Prelude.Integer)
startNextPendingJobExecution_stepTimeoutInMinutes :: (Maybe Integer -> f (Maybe Integer))
-> StartNextPendingJobExecution -> f StartNextPendingJobExecution
startNextPendingJobExecution_stepTimeoutInMinutes = (StartNextPendingJobExecution -> Maybe Integer)
-> (StartNextPendingJobExecution
    -> Maybe Integer -> StartNextPendingJobExecution)
-> Lens
     StartNextPendingJobExecution
     StartNextPendingJobExecution
     (Maybe Integer)
     (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartNextPendingJobExecution' {Maybe Integer
stepTimeoutInMinutes :: Maybe Integer
$sel:stepTimeoutInMinutes:StartNextPendingJobExecution' :: StartNextPendingJobExecution -> Maybe Integer
stepTimeoutInMinutes} -> Maybe Integer
stepTimeoutInMinutes) (\s :: StartNextPendingJobExecution
s@StartNextPendingJobExecution' {} Maybe Integer
a -> StartNextPendingJobExecution
s {$sel:stepTimeoutInMinutes:StartNextPendingJobExecution' :: Maybe Integer
stepTimeoutInMinutes = Maybe Integer
a} :: StartNextPendingJobExecution)

-- | A collection of name\/value pairs that describe the status of the job
-- execution. If not specified, the statusDetails are unchanged.
startNextPendingJobExecution_statusDetails :: Lens.Lens' StartNextPendingJobExecution (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
startNextPendingJobExecution_statusDetails :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> StartNextPendingJobExecution -> f StartNextPendingJobExecution
startNextPendingJobExecution_statusDetails = (StartNextPendingJobExecution -> Maybe (HashMap Text Text))
-> (StartNextPendingJobExecution
    -> Maybe (HashMap Text Text) -> StartNextPendingJobExecution)
-> Lens
     StartNextPendingJobExecution
     StartNextPendingJobExecution
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartNextPendingJobExecution' {Maybe (HashMap Text Text)
statusDetails :: Maybe (HashMap Text Text)
$sel:statusDetails:StartNextPendingJobExecution' :: StartNextPendingJobExecution -> Maybe (HashMap Text Text)
statusDetails} -> Maybe (HashMap Text Text)
statusDetails) (\s :: StartNextPendingJobExecution
s@StartNextPendingJobExecution' {} Maybe (HashMap Text Text)
a -> StartNextPendingJobExecution
s {$sel:statusDetails:StartNextPendingJobExecution' :: Maybe (HashMap Text Text)
statusDetails = Maybe (HashMap Text Text)
a} :: StartNextPendingJobExecution) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> StartNextPendingJobExecution -> f StartNextPendingJobExecution)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> StartNextPendingJobExecution
-> f StartNextPendingJobExecution
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of the thing associated with the device.
startNextPendingJobExecution_thingName :: Lens.Lens' StartNextPendingJobExecution Prelude.Text
startNextPendingJobExecution_thingName :: (Text -> f Text)
-> StartNextPendingJobExecution -> f StartNextPendingJobExecution
startNextPendingJobExecution_thingName = (StartNextPendingJobExecution -> Text)
-> (StartNextPendingJobExecution
    -> Text -> StartNextPendingJobExecution)
-> Lens
     StartNextPendingJobExecution StartNextPendingJobExecution Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartNextPendingJobExecution' {Text
thingName :: Text
$sel:thingName:StartNextPendingJobExecution' :: StartNextPendingJobExecution -> Text
thingName} -> Text
thingName) (\s :: StartNextPendingJobExecution
s@StartNextPendingJobExecution' {} Text
a -> StartNextPendingJobExecution
s {$sel:thingName:StartNextPendingJobExecution' :: Text
thingName = Text
a} :: StartNextPendingJobExecution)

instance Core.AWSRequest StartNextPendingJobExecution where
  type
    AWSResponse StartNextPendingJobExecution =
      StartNextPendingJobExecutionResponse
  request :: StartNextPendingJobExecution
-> Request StartNextPendingJobExecution
request = Service
-> StartNextPendingJobExecution
-> Request StartNextPendingJobExecution
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy StartNextPendingJobExecution
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse StartNextPendingJobExecution)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse StartNextPendingJobExecution))
-> Logger
-> Service
-> Proxy StartNextPendingJobExecution
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse StartNextPendingJobExecution)))
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 ->
          Maybe JobExecution -> Int -> StartNextPendingJobExecutionResponse
StartNextPendingJobExecutionResponse'
            (Maybe JobExecution -> Int -> StartNextPendingJobExecutionResponse)
-> Either String (Maybe JobExecution)
-> Either String (Int -> StartNextPendingJobExecutionResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe JobExecution)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"execution")
            Either String (Int -> StartNextPendingJobExecutionResponse)
-> Either String Int
-> Either String StartNextPendingJobExecutionResponse
forall (f :: * -> *) a b. Applicative f => 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))
      )

instance
  Prelude.Hashable
    StartNextPendingJobExecution

instance Prelude.NFData StartNextPendingJobExecution

instance Core.ToHeaders StartNextPendingJobExecution where
  toHeaders :: StartNextPendingJobExecution -> ResponseHeaders
toHeaders = ResponseHeaders -> StartNextPendingJobExecution -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

instance Core.ToJSON StartNextPendingJobExecution where
  toJSON :: StartNextPendingJobExecution -> Value
toJSON StartNextPendingJobExecution' {Maybe Integer
Maybe (HashMap Text Text)
Text
thingName :: Text
statusDetails :: Maybe (HashMap Text Text)
stepTimeoutInMinutes :: Maybe Integer
$sel:thingName:StartNextPendingJobExecution' :: StartNextPendingJobExecution -> Text
$sel:statusDetails:StartNextPendingJobExecution' :: StartNextPendingJobExecution -> Maybe (HashMap Text Text)
$sel:stepTimeoutInMinutes:StartNextPendingJobExecution' :: StartNextPendingJobExecution -> Maybe Integer
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"stepTimeoutInMinutes" Text -> Integer -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Integer -> Pair) -> Maybe Integer -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Integer
stepTimeoutInMinutes,
            (Text
"statusDetails" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
statusDetails
          ]
      )

instance Core.ToPath StartNextPendingJobExecution where
  toPath :: StartNextPendingJobExecution -> ByteString
toPath StartNextPendingJobExecution' {Maybe Integer
Maybe (HashMap Text Text)
Text
thingName :: Text
statusDetails :: Maybe (HashMap Text Text)
stepTimeoutInMinutes :: Maybe Integer
$sel:thingName:StartNextPendingJobExecution' :: StartNextPendingJobExecution -> Text
$sel:statusDetails:StartNextPendingJobExecution' :: StartNextPendingJobExecution -> Maybe (HashMap Text Text)
$sel:stepTimeoutInMinutes:StartNextPendingJobExecution' :: StartNextPendingJobExecution -> Maybe Integer
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/things/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
thingName, ByteString
"/jobs/$next"]

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

-- | /See:/ 'newStartNextPendingJobExecutionResponse' smart constructor.
data StartNextPendingJobExecutionResponse = StartNextPendingJobExecutionResponse'
  { -- | A JobExecution object.
    StartNextPendingJobExecutionResponse -> Maybe JobExecution
execution :: Prelude.Maybe JobExecution,
    -- | The response's http status code.
    StartNextPendingJobExecutionResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (StartNextPendingJobExecutionResponse
-> StartNextPendingJobExecutionResponse -> Bool
(StartNextPendingJobExecutionResponse
 -> StartNextPendingJobExecutionResponse -> Bool)
-> (StartNextPendingJobExecutionResponse
    -> StartNextPendingJobExecutionResponse -> Bool)
-> Eq StartNextPendingJobExecutionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartNextPendingJobExecutionResponse
-> StartNextPendingJobExecutionResponse -> Bool
$c/= :: StartNextPendingJobExecutionResponse
-> StartNextPendingJobExecutionResponse -> Bool
== :: StartNextPendingJobExecutionResponse
-> StartNextPendingJobExecutionResponse -> Bool
$c== :: StartNextPendingJobExecutionResponse
-> StartNextPendingJobExecutionResponse -> Bool
Prelude.Eq, ReadPrec [StartNextPendingJobExecutionResponse]
ReadPrec StartNextPendingJobExecutionResponse
Int -> ReadS StartNextPendingJobExecutionResponse
ReadS [StartNextPendingJobExecutionResponse]
(Int -> ReadS StartNextPendingJobExecutionResponse)
-> ReadS [StartNextPendingJobExecutionResponse]
-> ReadPrec StartNextPendingJobExecutionResponse
-> ReadPrec [StartNextPendingJobExecutionResponse]
-> Read StartNextPendingJobExecutionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartNextPendingJobExecutionResponse]
$creadListPrec :: ReadPrec [StartNextPendingJobExecutionResponse]
readPrec :: ReadPrec StartNextPendingJobExecutionResponse
$creadPrec :: ReadPrec StartNextPendingJobExecutionResponse
readList :: ReadS [StartNextPendingJobExecutionResponse]
$creadList :: ReadS [StartNextPendingJobExecutionResponse]
readsPrec :: Int -> ReadS StartNextPendingJobExecutionResponse
$creadsPrec :: Int -> ReadS StartNextPendingJobExecutionResponse
Prelude.Read, Int -> StartNextPendingJobExecutionResponse -> ShowS
[StartNextPendingJobExecutionResponse] -> ShowS
StartNextPendingJobExecutionResponse -> String
(Int -> StartNextPendingJobExecutionResponse -> ShowS)
-> (StartNextPendingJobExecutionResponse -> String)
-> ([StartNextPendingJobExecutionResponse] -> ShowS)
-> Show StartNextPendingJobExecutionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartNextPendingJobExecutionResponse] -> ShowS
$cshowList :: [StartNextPendingJobExecutionResponse] -> ShowS
show :: StartNextPendingJobExecutionResponse -> String
$cshow :: StartNextPendingJobExecutionResponse -> String
showsPrec :: Int -> StartNextPendingJobExecutionResponse -> ShowS
$cshowsPrec :: Int -> StartNextPendingJobExecutionResponse -> ShowS
Prelude.Show, (forall x.
 StartNextPendingJobExecutionResponse
 -> Rep StartNextPendingJobExecutionResponse x)
-> (forall x.
    Rep StartNextPendingJobExecutionResponse x
    -> StartNextPendingJobExecutionResponse)
-> Generic StartNextPendingJobExecutionResponse
forall x.
Rep StartNextPendingJobExecutionResponse x
-> StartNextPendingJobExecutionResponse
forall x.
StartNextPendingJobExecutionResponse
-> Rep StartNextPendingJobExecutionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StartNextPendingJobExecutionResponse x
-> StartNextPendingJobExecutionResponse
$cfrom :: forall x.
StartNextPendingJobExecutionResponse
-> Rep StartNextPendingJobExecutionResponse x
Prelude.Generic)

-- |
-- Create a value of 'StartNextPendingJobExecutionResponse' 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:
--
-- 'execution', 'startNextPendingJobExecutionResponse_execution' - A JobExecution object.
--
-- 'httpStatus', 'startNextPendingJobExecutionResponse_httpStatus' - The response's http status code.
newStartNextPendingJobExecutionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  StartNextPendingJobExecutionResponse
newStartNextPendingJobExecutionResponse :: Int -> StartNextPendingJobExecutionResponse
newStartNextPendingJobExecutionResponse Int
pHttpStatus_ =
  StartNextPendingJobExecutionResponse' :: Maybe JobExecution -> Int -> StartNextPendingJobExecutionResponse
StartNextPendingJobExecutionResponse'
    { $sel:execution:StartNextPendingJobExecutionResponse' :: Maybe JobExecution
execution =
        Maybe JobExecution
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:StartNextPendingJobExecutionResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A JobExecution object.
startNextPendingJobExecutionResponse_execution :: Lens.Lens' StartNextPendingJobExecutionResponse (Prelude.Maybe JobExecution)
startNextPendingJobExecutionResponse_execution :: (Maybe JobExecution -> f (Maybe JobExecution))
-> StartNextPendingJobExecutionResponse
-> f StartNextPendingJobExecutionResponse
startNextPendingJobExecutionResponse_execution = (StartNextPendingJobExecutionResponse -> Maybe JobExecution)
-> (StartNextPendingJobExecutionResponse
    -> Maybe JobExecution -> StartNextPendingJobExecutionResponse)
-> Lens
     StartNextPendingJobExecutionResponse
     StartNextPendingJobExecutionResponse
     (Maybe JobExecution)
     (Maybe JobExecution)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartNextPendingJobExecutionResponse' {Maybe JobExecution
execution :: Maybe JobExecution
$sel:execution:StartNextPendingJobExecutionResponse' :: StartNextPendingJobExecutionResponse -> Maybe JobExecution
execution} -> Maybe JobExecution
execution) (\s :: StartNextPendingJobExecutionResponse
s@StartNextPendingJobExecutionResponse' {} Maybe JobExecution
a -> StartNextPendingJobExecutionResponse
s {$sel:execution:StartNextPendingJobExecutionResponse' :: Maybe JobExecution
execution = Maybe JobExecution
a} :: StartNextPendingJobExecutionResponse)

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

instance
  Prelude.NFData
    StartNextPendingJobExecutionResponse