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\Container\Resource;
19
20use Google\Service\Container\CancelOperationRequest;
21use Google\Service\Container\ContainerEmpty;
22use Google\Service\Container\ListOperationsResponse;
23use Google\Service\Container\Operation;
24
25/**
26 * The "operations" collection of methods.
27 * Typical usage is:
28 *  <code>
29 *   $containerService = new Google\Service\Container(...);
30 *   $operations = $containerService->operations;
31 *  </code>
32 */
33class ProjectsLocationsOperations extends \Google\Service\Resource
34{
35  /**
36   * Cancels the specified operation. (operations.cancel)
37   *
38   * @param string $name The name (project, location, operation id) of the
39   * operation to cancel. Specified in the format `projects/locations/operations`.
40   * @param CancelOperationRequest $postBody
41   * @param array $optParams Optional parameters.
42   * @return ContainerEmpty
43   */
44  public function cancel($name, CancelOperationRequest $postBody, $optParams = [])
45  {
46    $params = ['name' => $name, 'postBody' => $postBody];
47    $params = array_merge($params, $optParams);
48    return $this->call('cancel', [$params], ContainerEmpty::class);
49  }
50  /**
51   * Gets the specified operation. (operations.get)
52   *
53   * @param string $name The name (project, location, operation id) of the
54   * operation to get. Specified in the format `projects/locations/operations`.
55   * @param array $optParams Optional parameters.
56   *
57   * @opt_param string operationId Deprecated. The server-assigned `name` of the
58   * operation. This field has been deprecated and replaced by the name field.
59   * @opt_param string projectId Deprecated. The Google Developers Console
60   * [project ID or project
61   * number](https://support.google.com/cloud/answer/6158840). This field has been
62   * deprecated and replaced by the name field.
63   * @opt_param string zone Deprecated. The name of the Google Compute Engine
64   * [zone](https://cloud.google.com/compute/docs/zones#available) in which the
65   * cluster resides. This field has been deprecated and replaced by the name
66   * field.
67   * @return Operation
68   */
69  public function get($name, $optParams = [])
70  {
71    $params = ['name' => $name];
72    $params = array_merge($params, $optParams);
73    return $this->call('get', [$params], Operation::class);
74  }
75  /**
76   * Lists all operations in a project in a specific zone or all zones.
77   * (operations.listProjectsLocationsOperations)
78   *
79   * @param string $parent The parent (project and location) where the operations
80   * will be listed. Specified in the format `projects/locations`. Location "-"
81   * matches all zones and all regions.
82   * @param array $optParams Optional parameters.
83   *
84   * @opt_param string projectId Deprecated. The Google Developers Console
85   * [project ID or project
86   * number](https://support.google.com/cloud/answer/6158840). This field has been
87   * deprecated and replaced by the parent field.
88   * @opt_param string zone Deprecated. The name of the Google Compute Engine
89   * [zone](https://cloud.google.com/compute/docs/zones#available) to return
90   * operations for, or `-` for all zones. This field has been deprecated and
91   * replaced by the parent field.
92   * @return ListOperationsResponse
93   */
94  public function listProjectsLocationsOperations($parent, $optParams = [])
95  {
96    $params = ['parent' => $parent];
97    $params = array_merge($params, $optParams);
98    return $this->call('list', [$params], ListOperationsResponse::class);
99  }
100}
101
102// Adding a class alias for backwards compatibility with the previous class name.
103class_alias(ProjectsLocationsOperations::class, 'Google_Service_Container_Resource_ProjectsLocationsOperations');
104