source: vendor/google/apiclient-services/src/Storage/Resource/Operations.php

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

Upload project files

  • Property mode set to 100644
File size: 4.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\Storage\Resource;
19
20use Google\Service\Storage\AdvanceRelocateBucketOperationRequest;
21use Google\Service\Storage\GoogleLongrunningListOperationsResponse;
22use Google\Service\Storage\GoogleLongrunningOperation;
23
24/**
25 * The "operations" collection of methods.
26 * Typical usage is:
27 * <code>
28 * $storageService = new Google\Service\Storage(...);
29 * $operations = $storageService->operations;
30 * </code>
31 */
32class Operations extends \Google\Service\Resource
33{
34 /**
35 * Starts asynchronous advancement of the relocate bucket operation in the case
36 * of required write downtime, to allow it to lock the bucket at the source
37 * location, and proceed with the bucket location swap. The server makes a best
38 * effort to advance the relocate bucket operation, but success is not
39 * guaranteed. (operations.advanceRelocateBucket)
40 *
41 * @param string $bucket Name of the bucket to advance the relocate for.
42 * @param string $operationId ID of the operation resource.
43 * @param AdvanceRelocateBucketOperationRequest $postBody
44 * @param array $optParams Optional parameters.
45 * @throws \Google\Service\Exception
46 */
47 public function advanceRelocateBucket($bucket, $operationId, AdvanceRelocateBucketOperationRequest $postBody, $optParams = [])
48 {
49 $params = ['bucket' => $bucket, 'operationId' => $operationId, 'postBody' => $postBody];
50 $params = array_merge($params, $optParams);
51 return $this->call('advanceRelocateBucket', [$params]);
52 }
53 /**
54 * Starts asynchronous cancellation on a long-running operation. The server
55 * makes a best effort to cancel the operation, but success is not guaranteed.
56 * (operations.cancel)
57 *
58 * @param string $bucket The parent bucket of the operation resource.
59 * @param string $operationId The ID of the operation resource.
60 * @param array $optParams Optional parameters.
61 * @throws \Google\Service\Exception
62 */
63 public function cancel($bucket, $operationId, $optParams = [])
64 {
65 $params = ['bucket' => $bucket, 'operationId' => $operationId];
66 $params = array_merge($params, $optParams);
67 return $this->call('cancel', [$params]);
68 }
69 /**
70 * Gets the latest state of a long-running operation. (operations.get)
71 *
72 * @param string $bucket The parent bucket of the operation resource.
73 * @param string $operationId The ID of the operation resource.
74 * @param array $optParams Optional parameters.
75 * @return GoogleLongrunningOperation
76 * @throws \Google\Service\Exception
77 */
78 public function get($bucket, $operationId, $optParams = [])
79 {
80 $params = ['bucket' => $bucket, 'operationId' => $operationId];
81 $params = array_merge($params, $optParams);
82 return $this->call('get', [$params], GoogleLongrunningOperation::class);
83 }
84 /**
85 * Lists operations that match the specified filter in the request.
86 * (operations.listOperations)
87 *
88 * @param string $bucket Name of the bucket in which to look for operations.
89 * @param array $optParams Optional parameters.
90 *
91 * @opt_param string filter A filter to narrow down results to a preferred
92 * subset. The filtering language is documented in more detail in
93 * [AIP-160](https://google.aip.dev/160).
94 * @opt_param int pageSize Maximum number of items to return in a single page of
95 * responses. Fewer total results may be returned than requested. The service
96 * uses this parameter or 100 items, whichever is smaller.
97 * @opt_param string pageToken A previously-returned page token representing
98 * part of the larger set of results to view.
99 * @return GoogleLongrunningListOperationsResponse
100 * @throws \Google\Service\Exception
101 */
102 public function listOperations($bucket, $optParams = [])
103 {
104 $params = ['bucket' => $bucket];
105 $params = array_merge($params, $optParams);
106 return $this->call('list', [$params], GoogleLongrunningListOperationsResponse::class);
107 }
108}
109
110// Adding a class alias for backwards compatibility with the previous class name.
111class_alias(Operations::class, 'Google_Service_Storage_Resource_Operations');
Note: See TracBrowser for help on using the repository browser.