get method

Future<Job> get(
  1. String projectId,
  2. String jobId, {
  3. String? location,
  4. String? $fields,
})

Returns information about a specific job.

Job information is available for a six month period after creation. Requires that you're the person who ran the job, or have the Is Owner project role.

Request parameters:

projectId - Required. Project ID of the requested job. Value must have pattern ^\[^/\]+$.

jobId - Required. Job ID of the requested job. Value must have pattern ^\[^/\]+$.

location - The geographic location of the job. You must specify the location to run the job for the following scenarios: - If the location to run a job is not in the us or the eu multi-regional location - If the job's location is in a single region (for example, us-central1) For more information, see https://cloud.google.com/bigquery/docs/locations#specifying_your_location.

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

Completes with a Job.

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<Job> get(
  core.String projectId,
  core.String jobId, {
  core.String? location,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (location != null) 'location': [location],
    if ($fields != null) 'fields': [$fields],
  };

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

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