1<?php
2/*
3 * Copyright 2014 Google Inc.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6 * use this file except in compliance with the License. You may obtain a copy of
7 * the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 * License for the specific language governing permissions and limitations under
15 * the License.
16 */
17
18namespace Google\Service\CloudTalentSolution\Resource;
19
20use Google\Service\CloudTalentSolution\BatchCreateJobsRequest;
21use Google\Service\CloudTalentSolution\BatchDeleteJobsRequest;
22use Google\Service\CloudTalentSolution\BatchUpdateJobsRequest;
23use Google\Service\CloudTalentSolution\Job;
24use Google\Service\CloudTalentSolution\JobsEmpty;
25use Google\Service\CloudTalentSolution\ListJobsResponse;
26use Google\Service\CloudTalentSolution\Operation;
27use Google\Service\CloudTalentSolution\SearchJobsRequest;
28use Google\Service\CloudTalentSolution\SearchJobsResponse;
29
30/**
31 * The "jobs" collection of methods.
32 * Typical usage is:
33 *  <code>
34 *   $jobsService = new Google\Service\CloudTalentSolution(...);
35 *   $jobs = $jobsService->jobs;
36 *  </code>
37 */
38class ProjectsTenantsJobs extends \Google\Service\Resource
39{
40  /**
41   * Begins executing a batch create jobs operation. (jobs.batchCreate)
42   *
43   * @param string $parent Required. The resource name of the tenant under which
44   * the job is created. The format is
45   * "projects/{project_id}/tenants/{tenant_id}". For example,
46   * "projects/foo/tenants/bar".
47   * @param BatchCreateJobsRequest $postBody
48   * @param array $optParams Optional parameters.
49   * @return Operation
50   */
51  public function batchCreate($parent, BatchCreateJobsRequest $postBody, $optParams = [])
52  {
53    $params = ['parent' => $parent, 'postBody' => $postBody];
54    $params = array_merge($params, $optParams);
55    return $this->call('batchCreate', [$params], Operation::class);
56  }
57  /**
58   * Begins executing a batch delete jobs operation. (jobs.batchDelete)
59   *
60   * @param string $parent Required. The resource name of the tenant under which
61   * the job is created. The format is
62   * "projects/{project_id}/tenants/{tenant_id}". For example,
63   * "projects/foo/tenants/bar". The parent of all of the jobs specified in
64   * `names` must match this field.
65   * @param BatchDeleteJobsRequest $postBody
66   * @param array $optParams Optional parameters.
67   * @return Operation
68   */
69  public function batchDelete($parent, BatchDeleteJobsRequest $postBody, $optParams = [])
70  {
71    $params = ['parent' => $parent, 'postBody' => $postBody];
72    $params = array_merge($params, $optParams);
73    return $this->call('batchDelete', [$params], Operation::class);
74  }
75  /**
76   * Begins executing a batch update jobs operation. (jobs.batchUpdate)
77   *
78   * @param string $parent Required. The resource name of the tenant under which
79   * the job is created. The format is
80   * "projects/{project_id}/tenants/{tenant_id}". For example,
81   * "projects/foo/tenants/bar".
82   * @param BatchUpdateJobsRequest $postBody
83   * @param array $optParams Optional parameters.
84   * @return Operation
85   */
86  public function batchUpdate($parent, BatchUpdateJobsRequest $postBody, $optParams = [])
87  {
88    $params = ['parent' => $parent, 'postBody' => $postBody];
89    $params = array_merge($params, $optParams);
90    return $this->call('batchUpdate', [$params], Operation::class);
91  }
92  /**
93   * Creates a new job. Typically, the job becomes searchable within 10 seconds,
94   * but it may take up to 5 minutes. (jobs.create)
95   *
96   * @param string $parent Required. The resource name of the tenant under which
97   * the job is created. The format is
98   * "projects/{project_id}/tenants/{tenant_id}". For example,
99   * "projects/foo/tenants/bar".
100   * @param Job $postBody
101   * @param array $optParams Optional parameters.
102   * @return Job
103   */
104  public function create($parent, Job $postBody, $optParams = [])
105  {
106    $params = ['parent' => $parent, 'postBody' => $postBody];
107    $params = array_merge($params, $optParams);
108    return $this->call('create', [$params], Job::class);
109  }
110  /**
111   * Deletes the specified job. Typically, the job becomes unsearchable within 10
112   * seconds, but it may take up to 5 minutes. (jobs.delete)
113   *
114   * @param string $name Required. The resource name of the job to be deleted. The
115   * format is "projects/{project_id}/tenants/{tenant_id}/jobs/{job_id}". For
116   * example, "projects/foo/tenants/bar/jobs/baz".
117   * @param array $optParams Optional parameters.
118   * @return JobsEmpty
119   */
120  public function delete($name, $optParams = [])
121  {
122    $params = ['name' => $name];
123    $params = array_merge($params, $optParams);
124    return $this->call('delete', [$params], JobsEmpty::class);
125  }
126  /**
127   * Retrieves the specified job, whose status is OPEN or recently EXPIRED within
128   * the last 90 days. (jobs.get)
129   *
130   * @param string $name Required. The resource name of the job to retrieve. The
131   * format is "projects/{project_id}/tenants/{tenant_id}/jobs/{job_id}". For
132   * example, "projects/foo/tenants/bar/jobs/baz".
133   * @param array $optParams Optional parameters.
134   * @return Job
135   */
136  public function get($name, $optParams = [])
137  {
138    $params = ['name' => $name];
139    $params = array_merge($params, $optParams);
140    return $this->call('get', [$params], Job::class);
141  }
142  /**
143   * Lists jobs by filter. (jobs.listProjectsTenantsJobs)
144   *
145   * @param string $parent Required. The resource name of the tenant under which
146   * the job is created. The format is
147   * "projects/{project_id}/tenants/{tenant_id}". For example,
148   * "projects/foo/tenants/bar".
149   * @param array $optParams Optional parameters.
150   *
151   * @opt_param string filter Required. The filter string specifies the jobs to be
152   * enumerated. Supported operator: =, AND The fields eligible for filtering are:
153   * * `companyName` * `requisitionId` * `status` Available values: OPEN, EXPIRED,
154   * ALL. Defaults to OPEN if no value is specified. At least one of `companyName`
155   * and `requisitionId` must present or an INVALID_ARGUMENT error is thrown.
156   * Sample Query: * companyName = "projects/foo/tenants/bar/companies/baz" *
157   * companyName = "projects/foo/tenants/bar/companies/baz" AND requisitionId =
158   * "req-1" * companyName = "projects/foo/tenants/bar/companies/baz" AND status =
159   * "EXPIRED" * requisitionId = "req-1" * requisitionId = "req-1" AND status =
160   * "EXPIRED"
161   * @opt_param string jobView The desired job attributes returned for jobs in the
162   * search response. Defaults to JobView.JOB_VIEW_FULL if no value is specified.
163   * @opt_param int pageSize The maximum number of jobs to be returned per page of
164   * results. If job_view is set to JobView.JOB_VIEW_ID_ONLY, the maximum allowed
165   * page size is 1000. Otherwise, the maximum allowed page size is 100. Default
166   * is 100 if empty or a number < 1 is specified.
167   * @opt_param string pageToken The starting point of a query result.
168   * @return ListJobsResponse
169   */
170  public function listProjectsTenantsJobs($parent, $optParams = [])
171  {
172    $params = ['parent' => $parent];
173    $params = array_merge($params, $optParams);
174    return $this->call('list', [$params], ListJobsResponse::class);
175  }
176  /**
177   * Updates specified job. Typically, updated contents become visible in search
178   * results within 10 seconds, but it may take up to 5 minutes. (jobs.patch)
179   *
180   * @param string $name Required during job update. The resource name for the
181   * job. This is generated by the service when a job is created. The format is
182   * "projects/{project_id}/tenants/{tenant_id}/jobs/{job_id}". For example,
183   * "projects/foo/tenants/bar/jobs/baz". Use of this field in job queries and API
184   * calls is preferred over the use of requisition_id since this value is unique.
185   * @param Job $postBody
186   * @param array $optParams Optional parameters.
187   *
188   * @opt_param string updateMask Strongly recommended for the best service
189   * experience. If update_mask is provided, only the specified fields in job are
190   * updated. Otherwise all the fields are updated. A field mask to restrict the
191   * fields that are updated. Only top level fields of Job are supported.
192   * @return Job
193   */
194  public function patch($name, Job $postBody, $optParams = [])
195  {
196    $params = ['name' => $name, 'postBody' => $postBody];
197    $params = array_merge($params, $optParams);
198    return $this->call('patch', [$params], Job::class);
199  }
200  /**
201   * Searches for jobs using the provided SearchJobsRequest. This call constrains
202   * the visibility of jobs present in the database, and only returns jobs that
203   * the caller has permission to search against. (jobs.search)
204   *
205   * @param string $parent Required. The resource name of the tenant to search
206   * within. The format is "projects/{project_id}/tenants/{tenant_id}". For
207   * example, "projects/foo/tenants/bar".
208   * @param SearchJobsRequest $postBody
209   * @param array $optParams Optional parameters.
210   * @return SearchJobsResponse
211   */
212  public function search($parent, SearchJobsRequest $postBody, $optParams = [])
213  {
214    $params = ['parent' => $parent, 'postBody' => $postBody];
215    $params = array_merge($params, $optParams);
216    return $this->call('search', [$params], SearchJobsResponse::class);
217  }
218  /**
219   * Searches for jobs using the provided SearchJobsRequest. This API call is
220   * intended for the use case of targeting passive job seekers (for example, job
221   * seekers who have signed up to receive email alerts about potential job
222   * opportunities), it has different algorithmic adjustments that are designed to
223   * specifically target passive job seekers. This call constrains the visibility
224   * of jobs present in the database, and only returns jobs the caller has
225   * permission to search against. (jobs.searchForAlert)
226   *
227   * @param string $parent Required. The resource name of the tenant to search
228   * within. The format is "projects/{project_id}/tenants/{tenant_id}". For
229   * example, "projects/foo/tenants/bar".
230   * @param SearchJobsRequest $postBody
231   * @param array $optParams Optional parameters.
232   * @return SearchJobsResponse
233   */
234  public function searchForAlert($parent, SearchJobsRequest $postBody, $optParams = [])
235  {
236    $params = ['parent' => $parent, 'postBody' => $postBody];
237    $params = array_merge($params, $optParams);
238    return $this->call('searchForAlert', [$params], SearchJobsResponse::class);
239  }
240}
241
242// Adding a class alias for backwards compatibility with the previous class name.
243class_alias(ProjectsTenantsJobs::class, 'Google_Service_CloudTalentSolution_Resource_ProjectsTenantsJobs');
244