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