googleanalytics
/
lib
/
analytics-admin
/
vendor
/
google
/
longrunning
/
src
/
LongRunning
/
OperationsGrpcClient.php
googleanalytics
/
lib
/
analytics-admin
/
vendor
/
google
/
longrunning
/
src
/
LongRunning
Last commit date
CancelOperationRequest.php
3 years ago
DeleteOperationRequest.php
3 years ago
GetOperationRequest.php
3 years ago
ListOperationsRequest.php
3 years ago
ListOperationsResponse.php
3 years ago
Operation.php
3 years ago
OperationInfo.php
3 years ago
OperationsGrpcClient.php
3 years ago
WaitOperationRequest.php
3 years ago
OperationsGrpcClient.php
150 lines
| 1 | <?php |
| 2 | // GENERATED CODE -- DO NOT EDIT! |
| 3 | |
| 4 | // Original file comments: |
| 5 | // Copyright 2020 Google LLC |
| 6 | // |
| 7 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 8 | // you may not use this file except in compliance with the License. |
| 9 | // You may obtain a copy of the License at |
| 10 | // |
| 11 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | // |
| 13 | // Unless required by applicable law or agreed to in writing, software |
| 14 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | // See the License for the specific language governing permissions and |
| 17 | // limitations under the License. |
| 18 | // |
| 19 | namespace Google\LongRunning; |
| 20 | |
| 21 | /** |
| 22 | * Manages long-running operations with an API service. |
| 23 | * |
| 24 | * When an API method normally takes long time to complete, it can be designed |
| 25 | * to return [Operation][google.longrunning.Operation] to the client, and the client can use this |
| 26 | * interface to receive the real response asynchronously by polling the |
| 27 | * operation resource, or pass the operation resource to another API (such as |
| 28 | * Google Cloud Pub/Sub API) to receive the response. Any API service that |
| 29 | * returns long-running operations should implement the `Operations` interface |
| 30 | * so developers can have a consistent client experience. |
| 31 | */ |
| 32 | class OperationsGrpcClient extends \Grpc\BaseStub { |
| 33 | |
| 34 | /** |
| 35 | * @param string $hostname hostname |
| 36 | * @param array $opts channel options |
| 37 | * @param \Grpc\Channel $channel (optional) re-use channel object |
| 38 | */ |
| 39 | public function __construct($hostname, $opts, $channel = null) { |
| 40 | parent::__construct($hostname, $opts, $channel); |
| 41 | } |
| 42 | |
| 43 | /** |
| 44 | * Lists operations that match the specified filter in the request. If the |
| 45 | * server doesn't support this method, it returns `UNIMPLEMENTED`. |
| 46 | * |
| 47 | * NOTE: the `name` binding allows API services to override the binding |
| 48 | * to use different resource name schemes, such as `users/*/operations`. To |
| 49 | * override the binding, API services can add a binding such as |
| 50 | * `"/v1/{name=users/*}/operations"` to their service configuration. |
| 51 | * For backwards compatibility, the default name includes the operations |
| 52 | * collection id, however overriding users must ensure the name binding |
| 53 | * is the parent resource, without the operations collection id. |
| 54 | * @param \Google\LongRunning\ListOperationsRequest $argument input argument |
| 55 | * @param array $metadata metadata |
| 56 | * @param array $options call options |
| 57 | * @return \Grpc\UnaryCall |
| 58 | */ |
| 59 | public function ListOperations(\Google\LongRunning\ListOperationsRequest $argument, |
| 60 | $metadata = [], $options = []) { |
| 61 | return $this->_simpleRequest('/google.longrunning.Operations/ListOperations', |
| 62 | $argument, |
| 63 | ['\Google\LongRunning\ListOperationsResponse', 'decode'], |
| 64 | $metadata, $options); |
| 65 | } |
| 66 | |
| 67 | /** |
| 68 | * Gets the latest state of a long-running operation. Clients can use this |
| 69 | * method to poll the operation result at intervals as recommended by the API |
| 70 | * service. |
| 71 | * @param \Google\LongRunning\GetOperationRequest $argument input argument |
| 72 | * @param array $metadata metadata |
| 73 | * @param array $options call options |
| 74 | * @return \Grpc\UnaryCall |
| 75 | */ |
| 76 | public function GetOperation(\Google\LongRunning\GetOperationRequest $argument, |
| 77 | $metadata = [], $options = []) { |
| 78 | return $this->_simpleRequest('/google.longrunning.Operations/GetOperation', |
| 79 | $argument, |
| 80 | ['\Google\LongRunning\Operation', 'decode'], |
| 81 | $metadata, $options); |
| 82 | } |
| 83 | |
| 84 | /** |
| 85 | * Deletes a long-running operation. This method indicates that the client is |
| 86 | * no longer interested in the operation result. It does not cancel the |
| 87 | * operation. If the server doesn't support this method, it returns |
| 88 | * `google.rpc.Code.UNIMPLEMENTED`. |
| 89 | * @param \Google\LongRunning\DeleteOperationRequest $argument input argument |
| 90 | * @param array $metadata metadata |
| 91 | * @param array $options call options |
| 92 | * @return \Grpc\UnaryCall |
| 93 | */ |
| 94 | public function DeleteOperation(\Google\LongRunning\DeleteOperationRequest $argument, |
| 95 | $metadata = [], $options = []) { |
| 96 | return $this->_simpleRequest('/google.longrunning.Operations/DeleteOperation', |
| 97 | $argument, |
| 98 | ['\Google\Protobuf\GPBEmpty', 'decode'], |
| 99 | $metadata, $options); |
| 100 | } |
| 101 | |
| 102 | /** |
| 103 | * Starts asynchronous cancellation on a long-running operation. The server |
| 104 | * makes a best effort to cancel the operation, but success is not |
| 105 | * guaranteed. If the server doesn't support this method, it returns |
| 106 | * `google.rpc.Code.UNIMPLEMENTED`. Clients can use |
| 107 | * [Operations.GetOperation][google.longrunning.Operations.GetOperation] or |
| 108 | * other methods to check whether the cancellation succeeded or whether the |
| 109 | * operation completed despite cancellation. On successful cancellation, |
| 110 | * the operation is not deleted; instead, it becomes an operation with |
| 111 | * an [Operation.error][google.longrunning.Operation.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, |
| 112 | * corresponding to `Code.CANCELLED`. |
| 113 | * @param \Google\LongRunning\CancelOperationRequest $argument input argument |
| 114 | * @param array $metadata metadata |
| 115 | * @param array $options call options |
| 116 | * @return \Grpc\UnaryCall |
| 117 | */ |
| 118 | public function CancelOperation(\Google\LongRunning\CancelOperationRequest $argument, |
| 119 | $metadata = [], $options = []) { |
| 120 | return $this->_simpleRequest('/google.longrunning.Operations/CancelOperation', |
| 121 | $argument, |
| 122 | ['\Google\Protobuf\GPBEmpty', 'decode'], |
| 123 | $metadata, $options); |
| 124 | } |
| 125 | |
| 126 | /** |
| 127 | * Waits until the specified long-running operation is done or reaches at most |
| 128 | * a specified timeout, returning the latest state. If the operation is |
| 129 | * already done, the latest state is immediately returned. If the timeout |
| 130 | * specified is greater than the default HTTP/RPC timeout, the HTTP/RPC |
| 131 | * timeout is used. If the server does not support this method, it returns |
| 132 | * `google.rpc.Code.UNIMPLEMENTED`. |
| 133 | * Note that this method is on a best-effort basis. It may return the latest |
| 134 | * state before the specified timeout (including immediately), meaning even an |
| 135 | * immediate response is no guarantee that the operation is done. |
| 136 | * @param \Google\LongRunning\WaitOperationRequest $argument input argument |
| 137 | * @param array $metadata metadata |
| 138 | * @param array $options call options |
| 139 | * @return \Grpc\UnaryCall |
| 140 | */ |
| 141 | public function WaitOperation(\Google\LongRunning\WaitOperationRequest $argument, |
| 142 | $metadata = [], $options = []) { |
| 143 | return $this->_simpleRequest('/google.longrunning.Operations/WaitOperation', |
| 144 | $argument, |
| 145 | ['\Google\LongRunning\Operation', 'decode'], |
| 146 | $metadata, $options); |
| 147 | } |
| 148 | |
| 149 | } |
| 150 |