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