list method
Lists jobs by filter.
Request parameters:
parent
- Required. The resource name of the tenant under which the job
is created. The format is "projects/{project_id}/tenants/{tenant_id}". For
example, "projects/foo/tenants/bar".
Value must have pattern ^projects/\[^/\]+/tenants/\[^/\]+$
.
filter
- Required. The filter string specifies the jobs to be
enumerated. Supported operator: =, AND The fields eligible for filtering
are: * companyName
* requisitionId
* status
Available values: OPEN,
EXPIRED, ALL. Defaults to OPEN if no value is specified. At least one of
companyName
and requisitionId
must present or an INVALID_ARGUMENT
error is thrown. Sample Query: * companyName =
"projects/foo/tenants/bar/companies/baz" * companyName =
"projects/foo/tenants/bar/companies/baz" AND requisitionId = "req-1" *
companyName = "projects/foo/tenants/bar/companies/baz" AND status =
"EXPIRED" * requisitionId = "req-1" * requisitionId = "req-1" AND status =
"EXPIRED"
jobView
- The desired job attributes returned for jobs in the search
response. Defaults to JobView.JOB_VIEW_FULL if no value is specified.
Possible string values are:
- "JOB_VIEW_UNSPECIFIED" : Default value.
- "JOB_VIEW_ID_ONLY" : A ID only view of job, with following attributes: Job.name, Job.requisition_id, Job.language_code.
- "JOB_VIEW_MINIMAL" : A minimal view of the job, with the following attributes: Job.name, Job.requisition_id, Job.title, Job.company, Job.DerivedInfo.locations, Job.language_code.
- "JOB_VIEW_SMALL" : A small view of the job, with the following attributes in the search results: Job.name, Job.requisition_id, Job.title, Job.company, Job.DerivedInfo.locations, Job.visibility, Job.language_code, Job.description.
- "JOB_VIEW_FULL" : All available attributes are included in the search results.
pageSize
- The maximum number of jobs to be returned per page of
results. If job_view is set to JobView.JOB_VIEW_ID_ONLY, the maximum
allowed page size is 1000. Otherwise, the maximum allowed page size is
100. Default is 100 if empty or a number < 1 is specified.
pageToken
- The starting point of a query result.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a ListJobsResponse.
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<ListJobsResponse> list(
core.String parent, {
core.String? filter,
core.String? jobView,
core.int? pageSize,
core.String? pageToken,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
if (filter != null) 'filter': [filter],
if (jobView != null) 'jobView': [jobView],
if (pageSize != null) 'pageSize': ['${pageSize}'],
if (pageToken != null) 'pageToken': [pageToken],
if ($fields != null) 'fields': [$fields],
};
final url_ = 'v4/' + core.Uri.encodeFull('$parent') + '/jobs';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListJobsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>);
}