source: vendor/google/apiclient-services/src/Drive/Resource/Operation.php

Last change on this file was e3d4e0a, checked in by Vlado 222039 <vlado.popovski@…>, 12 days ago

Upload project files

  • Property mode set to 100644
File size: 2.6 KB
Line 
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\Drive\Resource;
19
20/**
21 * The "operation" collection of methods.
22 * Typical usage is:
23 * <code>
24 * $driveService = new Google\Service\Drive(...);
25 * $operation = $driveService->operation;
26 * </code>
27 */
28class Operation extends \Google\Service\Resource
29{
30 /**
31 * Starts asynchronous cancellation on a long-running operation. The server
32 * makes a best effort to cancel the operation, but success is not guaranteed.
33 * If the server doesn't support this method, it returns
34 * `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or
35 * other methods to check whether the cancellation succeeded or whether the
36 * operation completed despite cancellation. On successful cancellation, the
37 * operation is not deleted; instead, it becomes an operation with an
38 * Operation.error value with a google.rpc.Status.code of `1`, corresponding to
39 * `Code.CANCELLED`. (operation.cancel)
40 *
41 * @param string $name The name of the operation resource to be cancelled.
42 * @param array $optParams Optional parameters.
43 * @throws \Google\Service\Exception
44 */
45 public function cancel($name, $optParams = [])
46 {
47 $params = ['name' => $name];
48 $params = array_merge($params, $optParams);
49 return $this->call('cancel', [$params]);
50 }
51 /**
52 * Deletes a long-running operation. This method indicates that the client is no
53 * longer interested in the operation result. It does not cancel the operation.
54 * If the server doesn't support this method, it returns
55 * `google.rpc.Code.UNIMPLEMENTED`. (operation.delete)
56 *
57 * @param string $name The name of the operation resource to be deleted.
58 * @param array $optParams Optional parameters.
59 * @throws \Google\Service\Exception
60 */
61 public function delete($name, $optParams = [])
62 {
63 $params = ['name' => $name];
64 $params = array_merge($params, $optParams);
65 return $this->call('delete', [$params]);
66 }
67}
68
69// Adding a class alias for backwards compatibility with the previous class name.
70class_alias(Operation::class, 'Google_Service_Drive_Resource_Operation');
Note: See TracBrowser for help on using the repository browser.