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\Dataflow\Resource;
19
20use Google\Service\Dataflow\LeaseWorkItemRequest;
21use Google\Service\Dataflow\LeaseWorkItemResponse;
22use Google\Service\Dataflow\ReportWorkItemStatusRequest;
23use 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->workItems;
31 *  </code>
32 */
33class 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   */
47  public function lease($projectId, $location, $jobId, LeaseWorkItemRequest $postBody, $optParams = [])
48  {
49    $params = ['projectId' => $projectId, 'location' => $location, 'jobId' => $jobId, 'postBody' => $postBody];
50    $params = array_merge($params, $optParams);
51    return $this->call('lease', [$params], LeaseWorkItemResponse::class);
52  }
53  /**
54   * Reports the status of dataflow WorkItems leased by a worker.
55   * (workItems.reportStatus)
56   *
57   * @param string $projectId The project which owns the WorkItem's job.
58   * @param string $location The [regional endpoint]
59   * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that
60   * contains the WorkItem's job.
61   * @param string $jobId The job which the WorkItem is part of.
62   * @param ReportWorkItemStatusRequest $postBody
63   * @param array $optParams Optional parameters.
64   * @return ReportWorkItemStatusResponse
65   */
66  public function reportStatus($projectId, $location, $jobId, ReportWorkItemStatusRequest $postBody, $optParams = [])
67  {
68    $params = ['projectId' => $projectId, 'location' => $location, 'jobId' => $jobId, 'postBody' => $postBody];
69    $params = array_merge($params, $optParams);
70    return $this->call('reportStatus', [$params], ReportWorkItemStatusResponse::class);
71  }
72}
73
74// Adding a class alias for backwards compatibility with the previous class name.
75class_alias(ProjectsLocationsJobsWorkItems::class, 'Google_Service_Dataflow_Resource_ProjectsLocationsJobsWorkItems');
76