{-# 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.Glue.GetJobRuns
-- 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)
--
-- Retrieves metadata for all runs of a given job definition.
--
-- This operation returns paginated results.
module Amazonka.Glue.GetJobRuns
  ( -- * Creating a Request
    GetJobRuns (..),
    newGetJobRuns,

    -- * Request Lenses
    getJobRuns_nextToken,
    getJobRuns_maxResults,
    getJobRuns_jobName,

    -- * Destructuring the Response
    GetJobRunsResponse (..),
    newGetJobRunsResponse,

    -- * Response Lenses
    getJobRunsResponse_nextToken,
    getJobRunsResponse_jobRuns,
    getJobRunsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.Glue.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:/ 'newGetJobRuns' smart constructor.
data GetJobRuns = GetJobRuns'
  { -- | A continuation token, if this is a continuation call.
    GetJobRuns -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum size of the response.
    GetJobRuns -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The name of the job definition for which to retrieve all job runs.
    GetJobRuns -> Text
jobName :: Prelude.Text
  }
  deriving (GetJobRuns -> GetJobRuns -> Bool
(GetJobRuns -> GetJobRuns -> Bool)
-> (GetJobRuns -> GetJobRuns -> Bool) -> Eq GetJobRuns
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetJobRuns -> GetJobRuns -> Bool
$c/= :: GetJobRuns -> GetJobRuns -> Bool
== :: GetJobRuns -> GetJobRuns -> Bool
$c== :: GetJobRuns -> GetJobRuns -> Bool
Prelude.Eq, ReadPrec [GetJobRuns]
ReadPrec GetJobRuns
Int -> ReadS GetJobRuns
ReadS [GetJobRuns]
(Int -> ReadS GetJobRuns)
-> ReadS [GetJobRuns]
-> ReadPrec GetJobRuns
-> ReadPrec [GetJobRuns]
-> Read GetJobRuns
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetJobRuns]
$creadListPrec :: ReadPrec [GetJobRuns]
readPrec :: ReadPrec GetJobRuns
$creadPrec :: ReadPrec GetJobRuns
readList :: ReadS [GetJobRuns]
$creadList :: ReadS [GetJobRuns]
readsPrec :: Int -> ReadS GetJobRuns
$creadsPrec :: Int -> ReadS GetJobRuns
Prelude.Read, Int -> GetJobRuns -> ShowS
[GetJobRuns] -> ShowS
GetJobRuns -> String
(Int -> GetJobRuns -> ShowS)
-> (GetJobRuns -> String)
-> ([GetJobRuns] -> ShowS)
-> Show GetJobRuns
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetJobRuns] -> ShowS
$cshowList :: [GetJobRuns] -> ShowS
show :: GetJobRuns -> String
$cshow :: GetJobRuns -> String
showsPrec :: Int -> GetJobRuns -> ShowS
$cshowsPrec :: Int -> GetJobRuns -> ShowS
Prelude.Show, (forall x. GetJobRuns -> Rep GetJobRuns x)
-> (forall x. Rep GetJobRuns x -> GetJobRuns) -> Generic GetJobRuns
forall x. Rep GetJobRuns x -> GetJobRuns
forall x. GetJobRuns -> Rep GetJobRuns x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetJobRuns x -> GetJobRuns
$cfrom :: forall x. GetJobRuns -> Rep GetJobRuns x
Prelude.Generic)

-- |
-- Create a value of 'GetJobRuns' 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:
--
-- 'nextToken', 'getJobRuns_nextToken' - A continuation token, if this is a continuation call.
--
-- 'maxResults', 'getJobRuns_maxResults' - The maximum size of the response.
--
-- 'jobName', 'getJobRuns_jobName' - The name of the job definition for which to retrieve all job runs.
newGetJobRuns ::
  -- | 'jobName'
  Prelude.Text ->
  GetJobRuns
newGetJobRuns :: Text -> GetJobRuns
newGetJobRuns Text
pJobName_ =
  GetJobRuns' :: Maybe Text -> Maybe Natural -> Text -> GetJobRuns
GetJobRuns'
    { $sel:nextToken:GetJobRuns' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:GetJobRuns' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:jobName:GetJobRuns' :: Text
jobName = Text
pJobName_
    }

-- | A continuation token, if this is a continuation call.
getJobRuns_nextToken :: Lens.Lens' GetJobRuns (Prelude.Maybe Prelude.Text)
getJobRuns_nextToken :: (Maybe Text -> f (Maybe Text)) -> GetJobRuns -> f GetJobRuns
getJobRuns_nextToken = (GetJobRuns -> Maybe Text)
-> (GetJobRuns -> Maybe Text -> GetJobRuns)
-> Lens GetJobRuns GetJobRuns (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetJobRuns' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetJobRuns' :: GetJobRuns -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetJobRuns
s@GetJobRuns' {} Maybe Text
a -> GetJobRuns
s {$sel:nextToken:GetJobRuns' :: Maybe Text
nextToken = Maybe Text
a} :: GetJobRuns)

-- | The maximum size of the response.
getJobRuns_maxResults :: Lens.Lens' GetJobRuns (Prelude.Maybe Prelude.Natural)
getJobRuns_maxResults :: (Maybe Natural -> f (Maybe Natural)) -> GetJobRuns -> f GetJobRuns
getJobRuns_maxResults = (GetJobRuns -> Maybe Natural)
-> (GetJobRuns -> Maybe Natural -> GetJobRuns)
-> Lens GetJobRuns GetJobRuns (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetJobRuns' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:GetJobRuns' :: GetJobRuns -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: GetJobRuns
s@GetJobRuns' {} Maybe Natural
a -> GetJobRuns
s {$sel:maxResults:GetJobRuns' :: Maybe Natural
maxResults = Maybe Natural
a} :: GetJobRuns)

-- | The name of the job definition for which to retrieve all job runs.
getJobRuns_jobName :: Lens.Lens' GetJobRuns Prelude.Text
getJobRuns_jobName :: (Text -> f Text) -> GetJobRuns -> f GetJobRuns
getJobRuns_jobName = (GetJobRuns -> Text)
-> (GetJobRuns -> Text -> GetJobRuns)
-> Lens GetJobRuns GetJobRuns Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetJobRuns' {Text
jobName :: Text
$sel:jobName:GetJobRuns' :: GetJobRuns -> Text
jobName} -> Text
jobName) (\s :: GetJobRuns
s@GetJobRuns' {} Text
a -> GetJobRuns
s {$sel:jobName:GetJobRuns' :: Text
jobName = Text
a} :: GetJobRuns)

instance Core.AWSPager GetJobRuns where
  page :: GetJobRuns -> AWSResponse GetJobRuns -> Maybe GetJobRuns
page GetJobRuns
rq AWSResponse GetJobRuns
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse GetJobRuns
GetJobRunsResponse
rs
            GetJobRunsResponse
-> Getting (First Text) GetJobRunsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> GetJobRunsResponse -> Const (First Text) GetJobRunsResponse
Lens' GetJobRunsResponse (Maybe Text)
getJobRunsResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
 -> GetJobRunsResponse -> Const (First Text) GetJobRunsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) GetJobRunsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe GetJobRuns
forall a. Maybe a
Prelude.Nothing
    | Maybe [JobRun] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse GetJobRuns
GetJobRunsResponse
rs
            GetJobRunsResponse
-> Getting (First [JobRun]) GetJobRunsResponse [JobRun]
-> Maybe [JobRun]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [JobRun] -> Const (First [JobRun]) (Maybe [JobRun]))
-> GetJobRunsResponse -> Const (First [JobRun]) GetJobRunsResponse
Lens' GetJobRunsResponse (Maybe [JobRun])
getJobRunsResponse_jobRuns ((Maybe [JobRun] -> Const (First [JobRun]) (Maybe [JobRun]))
 -> GetJobRunsResponse -> Const (First [JobRun]) GetJobRunsResponse)
-> (([JobRun] -> Const (First [JobRun]) [JobRun])
    -> Maybe [JobRun] -> Const (First [JobRun]) (Maybe [JobRun]))
-> Getting (First [JobRun]) GetJobRunsResponse [JobRun]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([JobRun] -> Const (First [JobRun]) [JobRun])
-> Maybe [JobRun] -> Const (First [JobRun]) (Maybe [JobRun])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe GetJobRuns
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      GetJobRuns -> Maybe GetJobRuns
forall a. a -> Maybe a
Prelude.Just (GetJobRuns -> Maybe GetJobRuns) -> GetJobRuns -> Maybe GetJobRuns
forall a b. (a -> b) -> a -> b
Prelude.$
        GetJobRuns
rq
          GetJobRuns -> (GetJobRuns -> GetJobRuns) -> GetJobRuns
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> GetJobRuns -> Identity GetJobRuns
Lens GetJobRuns GetJobRuns (Maybe Text) (Maybe Text)
getJobRuns_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> GetJobRuns -> Identity GetJobRuns)
-> Maybe Text -> GetJobRuns -> GetJobRuns
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse GetJobRuns
GetJobRunsResponse
rs
          GetJobRunsResponse
-> Getting (First Text) GetJobRunsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> GetJobRunsResponse -> Const (First Text) GetJobRunsResponse
Lens' GetJobRunsResponse (Maybe Text)
getJobRunsResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
 -> GetJobRunsResponse -> Const (First Text) GetJobRunsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) GetJobRunsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest GetJobRuns where
  type AWSResponse GetJobRuns = GetJobRunsResponse
  request :: GetJobRuns -> Request GetJobRuns
request = Service -> GetJobRuns -> Request GetJobRuns
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy GetJobRuns
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetJobRuns)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetJobRuns))
-> Logger
-> Service
-> Proxy GetJobRuns
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetJobRuns)))
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 Text -> Maybe [JobRun] -> Int -> GetJobRunsResponse
GetJobRunsResponse'
            (Maybe Text -> Maybe [JobRun] -> Int -> GetJobRunsResponse)
-> Either String (Maybe Text)
-> Either String (Maybe [JobRun] -> Int -> GetJobRunsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"NextToken")
            Either String (Maybe [JobRun] -> Int -> GetJobRunsResponse)
-> Either String (Maybe [JobRun])
-> Either String (Int -> GetJobRunsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [JobRun]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"JobRuns" Either String (Maybe (Maybe [JobRun]))
-> Maybe [JobRun] -> Either String (Maybe [JobRun])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [JobRun]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Int -> GetJobRunsResponse)
-> Either String Int -> Either String GetJobRunsResponse
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 GetJobRuns

instance Prelude.NFData GetJobRuns

instance Core.ToHeaders GetJobRuns where
  toHeaders :: GetJobRuns -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetJobRuns -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# (ByteString
"AWSGlue.GetJobRuns" :: Prelude.ByteString),
            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 GetJobRuns where
  toJSON :: GetJobRuns -> Value
toJSON GetJobRuns' {Maybe Natural
Maybe Text
Text
jobName :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:jobName:GetJobRuns' :: GetJobRuns -> Text
$sel:maxResults:GetJobRuns' :: GetJobRuns -> Maybe Natural
$sel:nextToken:GetJobRuns' :: GetJobRuns -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"NextToken" 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
nextToken,
            (Text
"MaxResults" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"JobName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
jobName)
          ]
      )

instance Core.ToPath GetJobRuns where
  toPath :: GetJobRuns -> ByteString
toPath = ByteString -> GetJobRuns -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | /See:/ 'newGetJobRunsResponse' smart constructor.
data GetJobRunsResponse = GetJobRunsResponse'
  { -- | A continuation token, if not all requested job runs have been returned.
    GetJobRunsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A list of job-run metadata objects.
    GetJobRunsResponse -> Maybe [JobRun]
jobRuns :: Prelude.Maybe [JobRun],
    -- | The response's http status code.
    GetJobRunsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetJobRunsResponse -> GetJobRunsResponse -> Bool
(GetJobRunsResponse -> GetJobRunsResponse -> Bool)
-> (GetJobRunsResponse -> GetJobRunsResponse -> Bool)
-> Eq GetJobRunsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetJobRunsResponse -> GetJobRunsResponse -> Bool
$c/= :: GetJobRunsResponse -> GetJobRunsResponse -> Bool
== :: GetJobRunsResponse -> GetJobRunsResponse -> Bool
$c== :: GetJobRunsResponse -> GetJobRunsResponse -> Bool
Prelude.Eq, ReadPrec [GetJobRunsResponse]
ReadPrec GetJobRunsResponse
Int -> ReadS GetJobRunsResponse
ReadS [GetJobRunsResponse]
(Int -> ReadS GetJobRunsResponse)
-> ReadS [GetJobRunsResponse]
-> ReadPrec GetJobRunsResponse
-> ReadPrec [GetJobRunsResponse]
-> Read GetJobRunsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetJobRunsResponse]
$creadListPrec :: ReadPrec [GetJobRunsResponse]
readPrec :: ReadPrec GetJobRunsResponse
$creadPrec :: ReadPrec GetJobRunsResponse
readList :: ReadS [GetJobRunsResponse]
$creadList :: ReadS [GetJobRunsResponse]
readsPrec :: Int -> ReadS GetJobRunsResponse
$creadsPrec :: Int -> ReadS GetJobRunsResponse
Prelude.Read, Int -> GetJobRunsResponse -> ShowS
[GetJobRunsResponse] -> ShowS
GetJobRunsResponse -> String
(Int -> GetJobRunsResponse -> ShowS)
-> (GetJobRunsResponse -> String)
-> ([GetJobRunsResponse] -> ShowS)
-> Show GetJobRunsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetJobRunsResponse] -> ShowS
$cshowList :: [GetJobRunsResponse] -> ShowS
show :: GetJobRunsResponse -> String
$cshow :: GetJobRunsResponse -> String
showsPrec :: Int -> GetJobRunsResponse -> ShowS
$cshowsPrec :: Int -> GetJobRunsResponse -> ShowS
Prelude.Show, (forall x. GetJobRunsResponse -> Rep GetJobRunsResponse x)
-> (forall x. Rep GetJobRunsResponse x -> GetJobRunsResponse)
-> Generic GetJobRunsResponse
forall x. Rep GetJobRunsResponse x -> GetJobRunsResponse
forall x. GetJobRunsResponse -> Rep GetJobRunsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetJobRunsResponse x -> GetJobRunsResponse
$cfrom :: forall x. GetJobRunsResponse -> Rep GetJobRunsResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetJobRunsResponse' 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:
--
-- 'nextToken', 'getJobRunsResponse_nextToken' - A continuation token, if not all requested job runs have been returned.
--
-- 'jobRuns', 'getJobRunsResponse_jobRuns' - A list of job-run metadata objects.
--
-- 'httpStatus', 'getJobRunsResponse_httpStatus' - The response's http status code.
newGetJobRunsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetJobRunsResponse
newGetJobRunsResponse :: Int -> GetJobRunsResponse
newGetJobRunsResponse Int
pHttpStatus_ =
  GetJobRunsResponse' :: Maybe Text -> Maybe [JobRun] -> Int -> GetJobRunsResponse
GetJobRunsResponse'
    { $sel:nextToken:GetJobRunsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:jobRuns:GetJobRunsResponse' :: Maybe [JobRun]
jobRuns = Maybe [JobRun]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetJobRunsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A continuation token, if not all requested job runs have been returned.
getJobRunsResponse_nextToken :: Lens.Lens' GetJobRunsResponse (Prelude.Maybe Prelude.Text)
getJobRunsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetJobRunsResponse -> f GetJobRunsResponse
getJobRunsResponse_nextToken = (GetJobRunsResponse -> Maybe Text)
-> (GetJobRunsResponse -> Maybe Text -> GetJobRunsResponse)
-> Lens' GetJobRunsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetJobRunsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetJobRunsResponse' :: GetJobRunsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetJobRunsResponse
s@GetJobRunsResponse' {} Maybe Text
a -> GetJobRunsResponse
s {$sel:nextToken:GetJobRunsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: GetJobRunsResponse)

-- | A list of job-run metadata objects.
getJobRunsResponse_jobRuns :: Lens.Lens' GetJobRunsResponse (Prelude.Maybe [JobRun])
getJobRunsResponse_jobRuns :: (Maybe [JobRun] -> f (Maybe [JobRun]))
-> GetJobRunsResponse -> f GetJobRunsResponse
getJobRunsResponse_jobRuns = (GetJobRunsResponse -> Maybe [JobRun])
-> (GetJobRunsResponse -> Maybe [JobRun] -> GetJobRunsResponse)
-> Lens' GetJobRunsResponse (Maybe [JobRun])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetJobRunsResponse' {Maybe [JobRun]
jobRuns :: Maybe [JobRun]
$sel:jobRuns:GetJobRunsResponse' :: GetJobRunsResponse -> Maybe [JobRun]
jobRuns} -> Maybe [JobRun]
jobRuns) (\s :: GetJobRunsResponse
s@GetJobRunsResponse' {} Maybe [JobRun]
a -> GetJobRunsResponse
s {$sel:jobRuns:GetJobRunsResponse' :: Maybe [JobRun]
jobRuns = Maybe [JobRun]
a} :: GetJobRunsResponse) ((Maybe [JobRun] -> f (Maybe [JobRun]))
 -> GetJobRunsResponse -> f GetJobRunsResponse)
-> ((Maybe [JobRun] -> f (Maybe [JobRun]))
    -> Maybe [JobRun] -> f (Maybe [JobRun]))
-> (Maybe [JobRun] -> f (Maybe [JobRun]))
-> GetJobRunsResponse
-> f GetJobRunsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [JobRun] [JobRun] [JobRun] [JobRun]
-> Iso
     (Maybe [JobRun]) (Maybe [JobRun]) (Maybe [JobRun]) (Maybe [JobRun])
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 [JobRun] [JobRun] [JobRun] [JobRun]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData GetJobRunsResponse