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\Dataflow\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\Dataflow\LeaseWorkItemRequest;
|
---|
21 | use Google\Service\Dataflow\LeaseWorkItemResponse;
|
---|
22 | use Google\Service\Dataflow\ReportWorkItemStatusRequest;
|
---|
23 | use Google\Service\Dataflow\ReportWorkItemStatusResponse;
|
---|
24 |
|
---|
25 | /**
|
---|
26 | * The "workItems" collection of methods.
|
---|
27 | * Typical usage is:
|
---|
28 | * <code>
|
---|
29 | * $dataflowService = new Google\Service\Dataflow(...);
|
---|
30 | * $workItems = $dataflowService->projects_locations_jobs_workItems;
|
---|
31 | * </code>
|
---|
32 | */
|
---|
33 | class ProjectsLocationsJobsWorkItems extends \Google\Service\Resource
|
---|
34 | {
|
---|
35 | /**
|
---|
36 | * Leases a dataflow WorkItem to run. (workItems.lease)
|
---|
37 | *
|
---|
38 | * @param string $projectId Identifies the project this worker belongs to.
|
---|
39 | * @param string $location The [regional endpoint]
|
---|
40 | * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that
|
---|
41 | * contains the WorkItem's job.
|
---|
42 | * @param string $jobId Identifies the workflow job this worker belongs to.
|
---|
43 | * @param LeaseWorkItemRequest $postBody
|
---|
44 | * @param array $optParams Optional parameters.
|
---|
45 | * @return LeaseWorkItemResponse
|
---|
46 | * @throws \Google\Service\Exception
|
---|
47 | */
|
---|
48 | public function lease($projectId, $location, $jobId, LeaseWorkItemRequest $postBody, $optParams = [])
|
---|
49 | {
|
---|
50 | $params = ['projectId' => $projectId, 'location' => $location, 'jobId' => $jobId, 'postBody' => $postBody];
|
---|
51 | $params = array_merge($params, $optParams);
|
---|
52 | return $this->call('lease', [$params], LeaseWorkItemResponse::class);
|
---|
53 | }
|
---|
54 | /**
|
---|
55 | * Reports the status of dataflow WorkItems leased by a worker.
|
---|
56 | * (workItems.reportStatus)
|
---|
57 | *
|
---|
58 | * @param string $projectId The project which owns the WorkItem's job.
|
---|
59 | * @param string $location The [regional endpoint]
|
---|
60 | * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that
|
---|
61 | * contains the WorkItem's job.
|
---|
62 | * @param string $jobId The job which the WorkItem is part of.
|
---|
63 | * @param ReportWorkItemStatusRequest $postBody
|
---|
64 | * @param array $optParams Optional parameters.
|
---|
65 | * @return ReportWorkItemStatusResponse
|
---|
66 | * @throws \Google\Service\Exception
|
---|
67 | */
|
---|
68 | public function reportStatus($projectId, $location, $jobId, ReportWorkItemStatusRequest $postBody, $optParams = [])
|
---|
69 | {
|
---|
70 | $params = ['projectId' => $projectId, 'location' => $location, 'jobId' => $jobId, 'postBody' => $postBody];
|
---|
71 | $params = array_merge($params, $optParams);
|
---|
72 | return $this->call('reportStatus', [$params], ReportWorkItemStatusResponse::class);
|
---|
73 | }
|
---|
74 | }
|
---|
75 |
|
---|
76 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
77 | class_alias(ProjectsLocationsJobsWorkItems::class, 'Google_Service_Dataflow_Resource_ProjectsLocationsJobsWorkItems');
|
---|