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\CloudRuntimeConfig\Resource; 19 20use Google\Service\CloudRuntimeConfig\CancelOperationRequest; 21use Google\Service\CloudRuntimeConfig\ListOperationsResponse; 22use Google\Service\CloudRuntimeConfig\RuntimeconfigEmpty; 23 24/** 25 * The "operations" collection of methods. 26 * Typical usage is: 27 * <code> 28 * $runtimeconfigService = new Google\Service\CloudRuntimeConfig(...); 29 * $operations = $runtimeconfigService->operations; 30 * </code> 31 */ 32class Operations extends \Google\Service\Resource 33{ 34 /** 35 * Starts asynchronous cancellation on a long-running operation. The server 36 * makes a best effort to cancel the operation, but success is not guaranteed. 37 * If the server doesn't support this method, it returns 38 * `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or 39 * other methods to check whether the cancellation succeeded or whether the 40 * operation completed despite cancellation. On successful cancellation, the 41 * operation is not deleted; instead, it becomes an operation with an 42 * Operation.error value with a google.rpc.Status.code of 1, corresponding to 43 * `Code.CANCELLED`. (operations.cancel) 44 * 45 * @param string $name The name of the operation resource to be cancelled. 46 * @param CancelOperationRequest $postBody 47 * @param array $optParams Optional parameters. 48 * @return RuntimeconfigEmpty 49 */ 50 public function cancel($name, CancelOperationRequest $postBody, $optParams = []) 51 { 52 $params = ['name' => $name, 'postBody' => $postBody]; 53 $params = array_merge($params, $optParams); 54 return $this->call('cancel', [$params], RuntimeconfigEmpty::class); 55 } 56 /** 57 * Deletes a long-running operation. This method indicates that the client is no 58 * longer interested in the operation result. It does not cancel the operation. 59 * If the server doesn't support this method, it returns 60 * `google.rpc.Code.UNIMPLEMENTED`. (operations.delete) 61 * 62 * @param string $name The name of the operation resource to be deleted. 63 * @param array $optParams Optional parameters. 64 * @return RuntimeconfigEmpty 65 */ 66 public function delete($name, $optParams = []) 67 { 68 $params = ['name' => $name]; 69 $params = array_merge($params, $optParams); 70 return $this->call('delete', [$params], RuntimeconfigEmpty::class); 71 } 72 /** 73 * Lists operations that match the specified filter in the request. If the 74 * server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the 75 * `name` binding allows API services to override the binding to use different 76 * resource name schemes, such as `users/operations`. To override the binding, 77 * API services can add a binding such as `"/v1/{name=users}/operations"` to 78 * their service configuration. For backwards compatibility, the default name 79 * includes the operations collection id, however overriding users must ensure 80 * the name binding is the parent resource, without the operations collection 81 * id. (operations.listOperations) 82 * 83 * @param string $name The name of the operation's parent resource. 84 * @param array $optParams Optional parameters. 85 * 86 * @opt_param string filter The standard list filter. 87 * @opt_param int pageSize The standard list page size. 88 * @opt_param string pageToken The standard list page token. 89 * @return ListOperationsResponse 90 */ 91 public function listOperations($name, $optParams = []) 92 { 93 $params = ['name' => $name]; 94 $params = array_merge($params, $optParams); 95 return $this->call('list', [$params], ListOperationsResponse::class); 96 } 97} 98 99// Adding a class alias for backwards compatibility with the previous class name. 100class_alias(Operations::class, 'Google_Service_CloudRuntimeConfig_Resource_Operations'); 101