list method

Future<JobList> list(
  1. String projectId, {
  2. bool? allUsers,
  3. String? maxCreationTime,
  4. int? maxResults,
  5. String? minCreationTime,
  6. String? pageToken,
  7. String? parentJobId,
  8. String? projection,
  9. List<String>? stateFilter,
  10. String? $fields,
})

Lists all jobs that you started in the specified project.

Job information is available for a six month period after creation. The job list is sorted in reverse chronological order, by job creation time. Requires the Can View project role, or the Is Owner project role if you set the allUsers property.

Request parameters:

projectId - Project ID of the jobs to list. Value must have pattern ^\[^/\]+$.

allUsers - Whether to display jobs owned by all users in the project. Default False.

maxCreationTime - Max value for job creation time, in milliseconds since the POSIX epoch. If set, only jobs created before or at this timestamp are returned.

maxResults - The maximum number of results to return in a single response page. Leverage the page tokens to iterate through the entire collection.

minCreationTime - Min value for job creation time, in milliseconds since the POSIX epoch. If set, only jobs created after or at this timestamp are returned.

pageToken - Page token, returned by a previous call, to request the next page of results.

parentJobId - If set, show only child jobs of the specified parent. Otherwise, show all top-level jobs.

projection - Restrict information returned to a set of selected fields Possible string values are:

  • "full" : Includes all job data
  • "minimal" : Does not include the job configuration

stateFilter - Filter for job state

$fields - Selector specifying which fields to include in a partial response.

Completes with a JobList.

Completes with a commons.ApiRequestError if the API endpoint returned an error.

If the used http.Client completes with an error when making a REST call, this method will complete with the same error.

Implementation

async.Future<JobList> list(
  core.String projectId, {
  core.bool? allUsers,
  core.String? maxCreationTime,
  core.int? maxResults,
  core.String? minCreationTime,
  core.String? pageToken,
  core.String? parentJobId,
  core.String? projection,
  core.List<core.String>? stateFilter,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (allUsers != null) 'allUsers': ['${allUsers}'],
    if (maxCreationTime != null) 'maxCreationTime': [maxCreationTime],
    if (maxResults != null) 'maxResults': ['${maxResults}'],
    if (minCreationTime != null) 'minCreationTime': [minCreationTime],
    if (pageToken != null) 'pageToken': [pageToken],
    if (parentJobId != null) 'parentJobId': [parentJobId],
    if (projection != null) 'projection': [projection],
    if (stateFilter != null) 'stateFilter': stateFilter,
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'projects/' + core.Uri.encodeFull('$projectId') + '/jobs';

  final response_ = await _requester.request(
    url_,
    'GET',
    queryParams: queryParams_,
  );
  return JobList.fromJson(response_ as core.Map<core.String, core.dynamic>);
}