.gitattributes000064400000000310151742734620007444 0ustar00/*.xml.dist export-ignore /tests export-ignore /.github export-ignore /.repo-metadata.json export-ignore /.OwlBot.yaml export-ignore /owlbot.py export-ignore /src/**/gapic_metadata.json export-ignore CODE_OF_CONDUCT.md000064400000003674151742734620007370 0ustar00# Contributor Code of Conduct As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities. We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, or nationality. Examples of unacceptable behavior by participants include: * The use of sexualized language or imagery * Personal attacks * Trolling or insulting/derogatory comments * Public or private harassment * Publishing other's private information, such as physical or electronic addresses, without explicit permission * Other unethical or unprofessional conduct. Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. By adopting this Code of Conduct, project maintainers commit themselves to fairly and consistently applying these principles to every aspect of managing this project. Project maintainers who do not follow or enforce the Code of Conduct may be permanently removed from the project team. This code of conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers. This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0, available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/)CONTRIBUTING.md000064400000001000151742734620006777 0ustar00# How to Contribute We'd love to accept your patches and contributions to this project. We accept and review pull requests against the main [Google Cloud PHP](https://github.com/googleapis/google-cloud-php) repository, which contains all of our client libraries. You will also need to sign a Contributor License Agreement. For more details about how to contribute, see the [CONTRIBUTING.md](https://github.com/googleapis/google-cloud-php/blob/main/CONTRIBUTING.md) file in the main Google Cloud PHP repository. LICENSE000064400000026136151742734620005574 0ustar00 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. README.md000064400000003457151742734620006047 0ustar00# Google LongRunning API for PHP > Idiomatic PHP client for [Google LongRunning API](https://cloud.google.com/service-infrastructure/docs/service-management/reference/rpc/google.longrunning). [![Latest Stable Version](https://poser.pugx.org/google/longrunning/v/stable)](https://packagist.org/packages/google/longrunning) [![Packagist](https://img.shields.io/packagist/dm/google/longrunning.svg)](https://packagist.org/packages/google/longrunning) * [API documentation](https://cloud.google.com/service-infrastructure/docs/service-management/reference/rpc/google.longrunning) **NOTE:** This repository is part of [Google Cloud PHP](https://github.com/googleapis/google-cloud-php). Any support requests, bug reports, or development contributions should be directed to that project. ### Installation To begin, install the preferred dependency manager for PHP, [Composer](https://getcomposer.org/). Now to install just this component: ```sh $ composer require google/longrunning ``` This component supports both REST over HTTP/1.1 and gRPC. In order to take advantage of the benefits offered by gRPC (such as streaming methods) please see our [gRPC installation guide](https://cloud.google.com/php/grpc). ### Authentication Please see our [Authentication guide](https://github.com/googleapis/google-cloud-php/blob/main/AUTHENTICATION.md) for more information on authenticating your client. Once authenticated, you'll be ready to start making requests. ### Version This component is considered beta. As such, it should be expected to be mostly stable and we're working towards a release candidate. We will address issues and requests with a higher priority. ### Next Steps 1. Understand the [official documentation](https://cloud.google.com/service-infrastructure/docs/service-management/reference/rpc/google.longrunning/docs). SECURITY.md000064400000000511151742734620006345 0ustar00# Security Policy To report a security issue, please use [g.co/vulnz](https://g.co/vulnz). The Google Security Team will respond within 5 working days of your report on g.co/vulnz. We use g.co/vulnz for our intake, and do coordination and disclosure here using GitHub Security Advisory to privately discuss and fix the issue. VERSION000064400000000006151742734620005623 0ustar000.2.2 composer.json000064400000001315151742734620007301 0ustar00{ "name": "google/longrunning", "description": "Google LongRunning Client for PHP", "license": "Apache-2.0", "minimum-stability": "stable", "autoload": { "psr-4": { "Google\\ApiCore\\LongRunning\\": "src/ApiCore/LongRunning", "Google\\LongRunning\\": "src/LongRunning", "GPBMetadata\\Google\\Longrunning\\": "metadata/Longrunning" } }, "extra": { "component": { "id": "longrunning", "path": "LongRunning", "entry": null, "target": "googleapis/php-longrunning" } }, "require-dev": { "google/gax": "^1.13.0", "phpunit/phpunit": "^4.8|^5.0|^8.0" } } metadata/Longrunning/Operations.php000064400000005025151742734620013475 0ustar00internalAddGeneratedFile( ' © #google/longrunning/operations.protogoogle.longrunninggoogle/api/client.protogoogle/protobuf/any.protogoogle/protobuf/duration.protogoogle/protobuf/empty.protogoogle/rpc/status.proto google/protobuf/descriptor.proto"¨ Operation name ( & metadata ( 2.google.protobuf.Any done (# error ( 2.google.rpc.StatusH( response ( 2.google.protobuf.AnyHB result"# GetOperationRequest name ( "\\ ListOperationsRequest name (  filter (  page_size ( page_token ( "d ListOperationsResponse1 operations ( 2.google.longrunning.Operation next_page_token ( "& CancelOperationRequest name ( "& DeleteOperationRequest name ( "P WaitOperationRequest name ( * timeout ( 2.google.protobuf.Duration"= OperationInfo response_type (  metadata_type ( 2ª Operations” ListOperations).google.longrunning.ListOperationsRequest*.google.longrunning.ListOperationsResponse"+‚Óä“/v1/{name=operations}ÚA name,filter GetOperation\'.google.longrunning.GetOperationRequest.google.longrunning.Operation"\'‚Óä“/v1/{name=operations/**}ÚAname~ DeleteOperation*.google.longrunning.DeleteOperationRequest.google.protobuf.Empty"\'‚Óä“*/v1/{name=operations/**}ÚAnameˆ CancelOperation*.google.longrunning.CancelOperationRequest.google.protobuf.Empty"1‚Óä“$"/v1/{name=operations/**}:cancel:*ÚAnameZ WaitOperation(.google.longrunning.WaitOperationRequest.google.longrunning.Operation"ÊAlongrunning.googleapis.comB— com.google.longrunningBOperationsProtoPZ=google.golang.org/genproto/googleapis/longrunning;longrunningøªGoogle.LongRunningÊGoogle\\LongRunningbproto3' , true); static::$is_initialized = true; } } metadata/README.md000064400000000243151742734620007615 0ustar00# Google Protobuf Metadata Classes ## WARNING! These classes are not intended for direct use - they exist only to support the generated protobuf classes in src/ src/ApiCore/LongRunning/Gapic/OperationsGapicClient.php000064400000045664151742734620017131 0ustar00cancelOperation($name); * } finally { * $operationsClient->close(); * } * ``` */ class OperationsGapicClient { use GapicClientTrait; /** The name of the service. */ const SERVICE_NAME = 'google.longrunning.Operations'; /** The default address of the service. */ const SERVICE_ADDRESS = 'longrunning.googleapis.com'; /** The default port of the service. */ const DEFAULT_SERVICE_PORT = 443; /** The name of the code generator, to be included in the agent header. */ const CODEGEN_NAME = 'gapic'; /** The default scopes required by the service. */ public static $serviceScopes = []; private static function getClientDefaults() { return [ 'serviceName' => self::SERVICE_NAME, 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, 'clientConfig' => __DIR__ . '/../resources/operations_client_config.json', 'descriptorsConfigPath' => __DIR__ . '/../resources/operations_descriptor_config.php', 'gcpApiConfigPath' => __DIR__ . '/../resources/operations_grpc_config.json', 'credentialsConfig' => [ 'defaultScopes' => self::$serviceScopes, ], 'transportConfig' => [ 'rest' => [ 'restClientConfigPath' => __DIR__ . '/../resources/operations_rest_client_config.php', ], ], ]; } /** * Constructor. * * @param array $options { * Optional. Options for configuring the service API wrapper. * * @type string $apiEndpoint * The address of the API remote host. May optionally include the port, formatted * as ":". Default 'longrunning.googleapis.com:443'. * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials * The credentials to be used by the client to authorize API calls. This option * accepts either a path to a credentials file, or a decoded credentials file as a * PHP array. * *Advanced usage*: In addition, this option can also accept a pre-constructed * {@see \Google\Auth\FetchAuthTokenInterface} object or * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these * objects are provided, any settings in $credentialsConfig will be ignored. * @type array $credentialsConfig * Options used to configure credentials, including auth token caching, for the * client. For a full list of supporting configuration options, see * {@see \Google\ApiCore\CredentialsWrapper::build()} . * @type bool $disableRetries * Determines whether or not retries defined by the client configuration should be * disabled. Defaults to `false`. * @type string|array $clientConfig * Client method configuration, including retry settings. This option can be either * a path to a JSON file, or a PHP array containing the decoded JSON data. By * default this settings points to the default client config file, which is * provided in the resources folder. * @type string|TransportInterface $transport * The transport used for executing network requests. May be either the string * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. * *Advanced usage*: Additionally, it is possible to pass in an already * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note * that when this object is provided, any settings in $transportConfig, and any * $apiEndpoint setting, will be ignored. * @type array $transportConfig * Configuration options that will be used to construct the transport. Options for * each supported transport type should be passed in a key for that transport. For * example: * $transportConfig = [ * 'grpc' => [...], * 'rest' => [...], * ]; * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the * supported options. * @type callable $clientCertSource * A callable which returns the client cert as a string. This can be used to * provide a certificate and private key to the transport layer for mTLS. * } * * @throws ValidationException */ public function __construct(array $options = []) { $clientOptions = $this->buildClientOptions($options); $this->setClientOptions($clientOptions); } /** * Starts asynchronous cancellation on a long-running operation. The server * makes a best effort to cancel the operation, but success is not * guaranteed. If the server doesn't support this method, it returns * `google.rpc.Code.UNIMPLEMENTED`. Clients can use * [Operations.GetOperation][google.longrunning.Operations.GetOperation] or * other methods to check whether the cancellation succeeded or whether the * operation completed despite cancellation. On successful cancellation, * the operation is not deleted; instead, it becomes an operation with * an [Operation.error][google.longrunning.Operation.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, * corresponding to `Code.CANCELLED`. * * Sample code: * ``` * $operationsClient = new OperationsClient(); * try { * $name = 'name'; * $operationsClient->cancelOperation($name); * } finally { * $operationsClient->close(); * } * ``` * * @param string $name The name of the operation resource to be cancelled. * @param array $optionalArgs { * Optional. * * @type RetrySettings|array $retrySettings * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an * associative array of retry settings parameters. See the documentation on * {@see RetrySettings} for example usage. * } * * @throws ApiException if the remote call fails */ public function cancelOperation($name, array $optionalArgs = []) { $request = new CancelOperationRequest(); $requestParamHeaders = []; $request->setName($name); $requestParamHeaders['name'] = $name; $requestParams = new RequestParamsHeaderDescriptor( $requestParamHeaders ); $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); return $this->startCall( 'CancelOperation', GPBEmpty::class, $optionalArgs, $request )->wait(); } /** * Deletes a long-running operation. This method indicates that the client is * no longer interested in the operation result. It does not cancel the * operation. If the server doesn't support this method, it returns * `google.rpc.Code.UNIMPLEMENTED`. * * Sample code: * ``` * $operationsClient = new OperationsClient(); * try { * $name = 'name'; * $operationsClient->deleteOperation($name); * } finally { * $operationsClient->close(); * } * ``` * * @param string $name The name of the operation resource to be deleted. * @param array $optionalArgs { * Optional. * * @type RetrySettings|array $retrySettings * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an * associative array of retry settings parameters. See the documentation on * {@see RetrySettings} for example usage. * } * * @throws ApiException if the remote call fails */ public function deleteOperation($name, array $optionalArgs = []) { $request = new DeleteOperationRequest(); $requestParamHeaders = []; $request->setName($name); $requestParamHeaders['name'] = $name; $requestParams = new RequestParamsHeaderDescriptor( $requestParamHeaders ); $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); return $this->startCall( 'DeleteOperation', GPBEmpty::class, $optionalArgs, $request )->wait(); } /** * Gets the latest state of a long-running operation. Clients can use this * method to poll the operation result at intervals as recommended by the API * service. * * Sample code: * ``` * $operationsClient = new OperationsClient(); * try { * $name = 'name'; * $response = $operationsClient->getOperation($name); * } finally { * $operationsClient->close(); * } * ``` * * @param string $name The name of the operation resource. * @param array $optionalArgs { * Optional. * * @type RetrySettings|array $retrySettings * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an * associative array of retry settings parameters. See the documentation on * {@see RetrySettings} for example usage. * } * * @return \Google\LongRunning\Operation * * @throws ApiException if the remote call fails */ public function getOperation($name, array $optionalArgs = []) { $request = new GetOperationRequest(); $requestParamHeaders = []; $request->setName($name); $requestParamHeaders['name'] = $name; $requestParams = new RequestParamsHeaderDescriptor( $requestParamHeaders ); $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); return $this->startCall( 'GetOperation', Operation::class, $optionalArgs, $request )->wait(); } /** * Lists operations that match the specified filter in the request. If the * server doesn't support this method, it returns `UNIMPLEMENTED`. * * NOTE: the `name` binding allows API services to override the binding * to use different resource name schemes, such as `users/*/operations`. To * override the binding, API services can add a binding such as * `"/v1/{name=users/*}/operations"` to their service configuration. * For backwards compatibility, the default name includes the operations * collection id, however overriding users must ensure the name binding * is the parent resource, without the operations collection id. * * Sample code: * ``` * $operationsClient = new OperationsClient(); * try { * $name = 'name'; * $filter = 'filter'; * // Iterate over pages of elements * $pagedResponse = $operationsClient->listOperations($name, $filter); * foreach ($pagedResponse->iteratePages() as $page) { * foreach ($page as $element) { * // doSomethingWith($element); * } * } * // Alternatively: * // Iterate through all elements * $pagedResponse = $operationsClient->listOperations($name, $filter); * foreach ($pagedResponse->iterateAllElements() as $element) { * // doSomethingWith($element); * } * } finally { * $operationsClient->close(); * } * ``` * * @param string $name The name of the operation's parent resource. * @param string $filter The standard list filter. * @param array $optionalArgs { * Optional. * * @type int $pageSize * The maximum number of resources contained in the underlying API * response. The API may return fewer values in a page, even if * there are additional values to be retrieved. * @type string $pageToken * A page token is used to specify a page of values to be returned. * If no page token is specified (the default), the first page * of values will be returned. Any page token used here must have * been generated by a previous call to the API. * @type RetrySettings|array $retrySettings * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an * associative array of retry settings parameters. See the documentation on * {@see RetrySettings} for example usage. * } * * @return \Google\ApiCore\PagedListResponse * * @throws ApiException if the remote call fails */ public function listOperations($name, $filter, array $optionalArgs = []) { $request = new ListOperationsRequest(); $requestParamHeaders = []; $request->setName($name); $request->setFilter($filter); $requestParamHeaders['name'] = $name; if (isset($optionalArgs['pageSize'])) { $request->setPageSize($optionalArgs['pageSize']); } if (isset($optionalArgs['pageToken'])) { $request->setPageToken($optionalArgs['pageToken']); } $requestParams = new RequestParamsHeaderDescriptor( $requestParamHeaders ); $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); return $this->getPagedListResponse( 'ListOperations', $optionalArgs, ListOperationsResponse::class, $request ); } /** * Waits until the specified long-running operation is done or reaches at most * a specified timeout, returning the latest state. If the operation is * already done, the latest state is immediately returned. If the timeout * specified is greater than the default HTTP/RPC timeout, the HTTP/RPC * timeout is used. If the server does not support this method, it returns * `google.rpc.Code.UNIMPLEMENTED`. * Note that this method is on a best-effort basis. It may return the latest * state before the specified timeout (including immediately), meaning even an * immediate response is no guarantee that the operation is done. * * Sample code: * ``` * $operationsClient = new OperationsClient(); * try { * $response = $operationsClient->waitOperation(); * } finally { * $operationsClient->close(); * } * ``` * * @param array $optionalArgs { * Optional. * * @type string $name * The name of the operation resource to wait on. * @type Duration $timeout * The maximum duration to wait before timing out. If left blank, the wait * will be at most the time permitted by the underlying HTTP/RPC protocol. * If RPC context deadline is also specified, the shorter one will be used. * @type RetrySettings|array $retrySettings * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an * associative array of retry settings parameters. See the documentation on * {@see RetrySettings} for example usage. * } * * @return \Google\LongRunning\Operation * * @throws ApiException if the remote call fails */ public function waitOperation(array $optionalArgs = []) { $request = new WaitOperationRequest(); if (isset($optionalArgs['name'])) { $request->setName($optionalArgs['name']); } if (isset($optionalArgs['timeout'])) { $request->setTimeout($optionalArgs['timeout']); } return $this->startCall( 'WaitOperation', Operation::class, $optionalArgs, $request )->wait(); } } src/ApiCore/LongRunning/OperationsClient.php000064400000002221151742734620015120 0ustar00 [ 'google.longrunning.Operations' => [ 'ListOperations' => [ 'pageStreaming' => [ 'requestPageTokenGetMethod' => 'getPageToken', 'requestPageTokenSetMethod' => 'setPageToken', 'requestPageSizeGetMethod' => 'getPageSize', 'requestPageSizeSetMethod' => 'setPageSize', 'responsePageTokenGetMethod' => 'getNextPageToken', 'resourcesGetMethod' => 'getOperations', ], ], ], ], ]; src/ApiCore/LongRunning/resources/operations_rest_client_config.php000064400000003203151742734620021754 0ustar00 [ 'google.longrunning.Operations' => [ 'CancelOperation' => [ 'method' => 'post', 'uriTemplate' => '/v1/{name=operations/**}:cancel', 'body' => '*', 'placeholders' => [ 'name' => [ 'getters' => [ 'getName', ], ], ], ], 'DeleteOperation' => [ 'method' => 'delete', 'uriTemplate' => '/v1/{name=operations/**}', 'placeholders' => [ 'name' => [ 'getters' => [ 'getName', ], ], ], ], 'GetOperation' => [ 'method' => 'get', 'uriTemplate' => '/v1/{name=operations/**}', 'placeholders' => [ 'name' => [ 'getters' => [ 'getName', ], ], ], ], 'ListOperations' => [ 'method' => 'get', 'uriTemplate' => '/v1/{name=operations}', 'placeholders' => [ 'name' => [ 'getters' => [ 'getName', ], ], ], 'queryParams' => [ 'filter', ], ], ], ], ]; src/LongRunning/CancelOperationRequest.php000064400000003243151742734620014740 0ustar00google.longrunning.CancelOperationRequest */ class CancelOperationRequest extends \Google\Protobuf\Internal\Message { /** * The name of the operation resource to be cancelled. * * Generated from protobuf field string name = 1; */ private $name = ''; /** * Constructor. * * @param array $data { * Optional. Data for populating the Message object. * * @type string $name * The name of the operation resource to be cancelled. * } */ public function __construct($data = NULL) { \GPBMetadata\Google\Longrunning\Operations::initOnce(); parent::__construct($data); } /** * The name of the operation resource to be cancelled. * * Generated from protobuf field string name = 1; * @return string */ public function getName() { return $this->name; } /** * The name of the operation resource to be cancelled. * * Generated from protobuf field string name = 1; * @param string $var * @return $this */ public function setName($var) { GPBUtil::checkString($var, True); $this->name = $var; return $this; } } src/LongRunning/DeleteOperationRequest.php000064400000003233151742734620014754 0ustar00google.longrunning.DeleteOperationRequest */ class DeleteOperationRequest extends \Google\Protobuf\Internal\Message { /** * The name of the operation resource to be deleted. * * Generated from protobuf field string name = 1; */ private $name = ''; /** * Constructor. * * @param array $data { * Optional. Data for populating the Message object. * * @type string $name * The name of the operation resource to be deleted. * } */ public function __construct($data = NULL) { \GPBMetadata\Google\Longrunning\Operations::initOnce(); parent::__construct($data); } /** * The name of the operation resource to be deleted. * * Generated from protobuf field string name = 1; * @return string */ public function getName() { return $this->name; } /** * The name of the operation resource to be deleted. * * Generated from protobuf field string name = 1; * @param string $var * @return $this */ public function setName($var) { GPBUtil::checkString($var, True); $this->name = $var; return $this; } } src/LongRunning/GetOperationRequest.php000064400000003127151742734620014273 0ustar00google.longrunning.GetOperationRequest */ class GetOperationRequest extends \Google\Protobuf\Internal\Message { /** * The name of the operation resource. * * Generated from protobuf field string name = 1; */ private $name = ''; /** * Constructor. * * @param array $data { * Optional. Data for populating the Message object. * * @type string $name * The name of the operation resource. * } */ public function __construct($data = NULL) { \GPBMetadata\Google\Longrunning\Operations::initOnce(); parent::__construct($data); } /** * The name of the operation resource. * * Generated from protobuf field string name = 1; * @return string */ public function getName() { return $this->name; } /** * The name of the operation resource. * * Generated from protobuf field string name = 1; * @param string $var * @return $this */ public function setName($var) { GPBUtil::checkString($var, True); $this->name = $var; return $this; } } src/LongRunning/ListOperationsRequest.php000064400000007672151742734620014663 0ustar00google.longrunning.ListOperationsRequest */ class ListOperationsRequest extends \Google\Protobuf\Internal\Message { /** * The name of the operation's parent resource. * * Generated from protobuf field string name = 4; */ private $name = ''; /** * The standard list filter. * * Generated from protobuf field string filter = 1; */ private $filter = ''; /** * The standard list page size. * * Generated from protobuf field int32 page_size = 2; */ private $page_size = 0; /** * The standard list page token. * * Generated from protobuf field string page_token = 3; */ private $page_token = ''; /** * Constructor. * * @param array $data { * Optional. Data for populating the Message object. * * @type string $name * The name of the operation's parent resource. * @type string $filter * The standard list filter. * @type int $page_size * The standard list page size. * @type string $page_token * The standard list page token. * } */ public function __construct($data = NULL) { \GPBMetadata\Google\Longrunning\Operations::initOnce(); parent::__construct($data); } /** * The name of the operation's parent resource. * * Generated from protobuf field string name = 4; * @return string */ public function getName() { return $this->name; } /** * The name of the operation's parent resource. * * Generated from protobuf field string name = 4; * @param string $var * @return $this */ public function setName($var) { GPBUtil::checkString($var, True); $this->name = $var; return $this; } /** * The standard list filter. * * Generated from protobuf field string filter = 1; * @return string */ public function getFilter() { return $this->filter; } /** * The standard list filter. * * Generated from protobuf field string filter = 1; * @param string $var * @return $this */ public function setFilter($var) { GPBUtil::checkString($var, True); $this->filter = $var; return $this; } /** * The standard list page size. * * Generated from protobuf field int32 page_size = 2; * @return int */ public function getPageSize() { return $this->page_size; } /** * The standard list page size. * * Generated from protobuf field int32 page_size = 2; * @param int $var * @return $this */ public function setPageSize($var) { GPBUtil::checkInt32($var); $this->page_size = $var; return $this; } /** * The standard list page token. * * Generated from protobuf field string page_token = 3; * @return string */ public function getPageToken() { return $this->page_token; } /** * The standard list page token. * * Generated from protobuf field string page_token = 3; * @param string $var * @return $this */ public function setPageToken($var) { GPBUtil::checkString($var, True); $this->page_token = $var; return $this; } } src/LongRunning/ListOperationsResponse.php000064400000005763151742734620015030 0ustar00google.longrunning.ListOperationsResponse */ class ListOperationsResponse extends \Google\Protobuf\Internal\Message { /** * A list of operations that matches the specified filter in the request. * * Generated from protobuf field repeated .google.longrunning.Operation operations = 1; */ private $operations; /** * The standard List next-page token. * * Generated from protobuf field string next_page_token = 2; */ private $next_page_token = ''; /** * Constructor. * * @param array $data { * Optional. Data for populating the Message object. * * @type array<\Google\LongRunning\Operation>|\Google\Protobuf\Internal\RepeatedField $operations * A list of operations that matches the specified filter in the request. * @type string $next_page_token * The standard List next-page token. * } */ public function __construct($data = NULL) { \GPBMetadata\Google\Longrunning\Operations::initOnce(); parent::__construct($data); } /** * A list of operations that matches the specified filter in the request. * * Generated from protobuf field repeated .google.longrunning.Operation operations = 1; * @return \Google\Protobuf\Internal\RepeatedField */ public function getOperations() { return $this->operations; } /** * A list of operations that matches the specified filter in the request. * * Generated from protobuf field repeated .google.longrunning.Operation operations = 1; * @param array<\Google\LongRunning\Operation>|\Google\Protobuf\Internal\RepeatedField $var * @return $this */ public function setOperations($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\LongRunning\Operation::class); $this->operations = $arr; return $this; } /** * The standard List next-page token. * * Generated from protobuf field string next_page_token = 2; * @return string */ public function getNextPageToken() { return $this->next_page_token; } /** * The standard List next-page token. * * Generated from protobuf field string next_page_token = 2; * @param string $var * @return $this */ public function setNextPageToken($var) { GPBUtil::checkString($var, True); $this->next_page_token = $var; return $this; } } src/LongRunning/Operation.php000064400000022300151742734620012254 0ustar00google.longrunning.Operation */ class Operation extends \Google\Protobuf\Internal\Message { /** * The server-assigned name, which is only unique within the same service that * originally returns it. If you use the default HTTP mapping, the * `name` should be a resource name ending with `operations/{unique_id}`. * * Generated from protobuf field string name = 1; */ private $name = ''; /** * Service-specific metadata associated with the operation. It typically * contains progress information and common metadata such as create time. * Some services might not provide such metadata. Any method that returns a * long-running operation should document the metadata type, if any. * * Generated from protobuf field .google.protobuf.Any metadata = 2; */ private $metadata = null; /** * If the value is `false`, it means the operation is still in progress. * If `true`, the operation is completed, and either `error` or `response` is * available. * * Generated from protobuf field bool done = 3; */ private $done = false; protected $result; /** * Constructor. * * @param array $data { * Optional. Data for populating the Message object. * * @type string $name * The server-assigned name, which is only unique within the same service that * originally returns it. If you use the default HTTP mapping, the * `name` should be a resource name ending with `operations/{unique_id}`. * @type \Google\Protobuf\Any $metadata * Service-specific metadata associated with the operation. It typically * contains progress information and common metadata such as create time. * Some services might not provide such metadata. Any method that returns a * long-running operation should document the metadata type, if any. * @type bool $done * If the value is `false`, it means the operation is still in progress. * If `true`, the operation is completed, and either `error` or `response` is * available. * @type \Google\Rpc\Status $error * The error result of the operation in case of failure or cancellation. * @type \Google\Protobuf\Any $response * The normal response of the operation in case of success. If the original * method returns no data on success, such as `Delete`, the response is * `google.protobuf.Empty`. If the original method is standard * `Get`/`Create`/`Update`, the response should be the resource. For other * methods, the response should have the type `XxxResponse`, where `Xxx` * is the original method name. For example, if the original method name * is `TakeSnapshot()`, the inferred response type is * `TakeSnapshotResponse`. * } */ public function __construct($data = NULL) { \GPBMetadata\Google\Longrunning\Operations::initOnce(); parent::__construct($data); } /** * The server-assigned name, which is only unique within the same service that * originally returns it. If you use the default HTTP mapping, the * `name` should be a resource name ending with `operations/{unique_id}`. * * Generated from protobuf field string name = 1; * @return string */ public function getName() { return $this->name; } /** * The server-assigned name, which is only unique within the same service that * originally returns it. If you use the default HTTP mapping, the * `name` should be a resource name ending with `operations/{unique_id}`. * * Generated from protobuf field string name = 1; * @param string $var * @return $this */ public function setName($var) { GPBUtil::checkString($var, True); $this->name = $var; return $this; } /** * Service-specific metadata associated with the operation. It typically * contains progress information and common metadata such as create time. * Some services might not provide such metadata. Any method that returns a * long-running operation should document the metadata type, if any. * * Generated from protobuf field .google.protobuf.Any metadata = 2; * @return \Google\Protobuf\Any|null */ public function getMetadata() { return $this->metadata; } public function hasMetadata() { return isset($this->metadata); } public function clearMetadata() { unset($this->metadata); } /** * Service-specific metadata associated with the operation. It typically * contains progress information and common metadata such as create time. * Some services might not provide such metadata. Any method that returns a * long-running operation should document the metadata type, if any. * * Generated from protobuf field .google.protobuf.Any metadata = 2; * @param \Google\Protobuf\Any $var * @return $this */ public function setMetadata($var) { GPBUtil::checkMessage($var, \Google\Protobuf\Any::class); $this->metadata = $var; return $this; } /** * If the value is `false`, it means the operation is still in progress. * If `true`, the operation is completed, and either `error` or `response` is * available. * * Generated from protobuf field bool done = 3; * @return bool */ public function getDone() { return $this->done; } /** * If the value is `false`, it means the operation is still in progress. * If `true`, the operation is completed, and either `error` or `response` is * available. * * Generated from protobuf field bool done = 3; * @param bool $var * @return $this */ public function setDone($var) { GPBUtil::checkBool($var); $this->done = $var; return $this; } /** * The error result of the operation in case of failure or cancellation. * * Generated from protobuf field .google.rpc.Status error = 4; * @return \Google\Rpc\Status|null */ public function getError() { return $this->readOneof(4); } public function hasError() { return $this->hasOneof(4); } /** * The error result of the operation in case of failure or cancellation. * * Generated from protobuf field .google.rpc.Status error = 4; * @param \Google\Rpc\Status $var * @return $this */ public function setError($var) { GPBUtil::checkMessage($var, \Google\Rpc\Status::class); $this->writeOneof(4, $var); return $this; } /** * The normal response of the operation in case of success. If the original * method returns no data on success, such as `Delete`, the response is * `google.protobuf.Empty`. If the original method is standard * `Get`/`Create`/`Update`, the response should be the resource. For other * methods, the response should have the type `XxxResponse`, where `Xxx` * is the original method name. For example, if the original method name * is `TakeSnapshot()`, the inferred response type is * `TakeSnapshotResponse`. * * Generated from protobuf field .google.protobuf.Any response = 5; * @return \Google\Protobuf\Any|null */ public function getResponse() { return $this->readOneof(5); } public function hasResponse() { return $this->hasOneof(5); } /** * The normal response of the operation in case of success. If the original * method returns no data on success, such as `Delete`, the response is * `google.protobuf.Empty`. If the original method is standard * `Get`/`Create`/`Update`, the response should be the resource. For other * methods, the response should have the type `XxxResponse`, where `Xxx` * is the original method name. For example, if the original method name * is `TakeSnapshot()`, the inferred response type is * `TakeSnapshotResponse`. * * Generated from protobuf field .google.protobuf.Any response = 5; * @param \Google\Protobuf\Any $var * @return $this */ public function setResponse($var) { GPBUtil::checkMessage($var, \Google\Protobuf\Any::class); $this->writeOneof(5, $var); return $this; } /** * @return string */ public function getResult() { return $this->whichOneof("result"); } } src/LongRunning/OperationInfo.php000064400000012303151742734620013072 0ustar00google.longrunning.OperationInfo */ class OperationInfo extends \Google\Protobuf\Internal\Message { /** * Required. The message name of the primary return type for this * long-running operation. * This type will be used to deserialize the LRO's response. * If the response is in a different package from the rpc, a fully-qualified * message name must be used (e.g. `google.protobuf.Struct`). * Note: Altering this value constitutes a breaking change. * * Generated from protobuf field string response_type = 1; */ private $response_type = ''; /** * Required. The message name of the metadata type for this long-running * operation. * If the response is in a different package from the rpc, a fully-qualified * message name must be used (e.g. `google.protobuf.Struct`). * Note: Altering this value constitutes a breaking change. * * Generated from protobuf field string metadata_type = 2; */ private $metadata_type = ''; /** * Constructor. * * @param array $data { * Optional. Data for populating the Message object. * * @type string $response_type * Required. The message name of the primary return type for this * long-running operation. * This type will be used to deserialize the LRO's response. * If the response is in a different package from the rpc, a fully-qualified * message name must be used (e.g. `google.protobuf.Struct`). * Note: Altering this value constitutes a breaking change. * @type string $metadata_type * Required. The message name of the metadata type for this long-running * operation. * If the response is in a different package from the rpc, a fully-qualified * message name must be used (e.g. `google.protobuf.Struct`). * Note: Altering this value constitutes a breaking change. * } */ public function __construct($data = NULL) { \GPBMetadata\Google\Longrunning\Operations::initOnce(); parent::__construct($data); } /** * Required. The message name of the primary return type for this * long-running operation. * This type will be used to deserialize the LRO's response. * If the response is in a different package from the rpc, a fully-qualified * message name must be used (e.g. `google.protobuf.Struct`). * Note: Altering this value constitutes a breaking change. * * Generated from protobuf field string response_type = 1; * @return string */ public function getResponseType() { return $this->response_type; } /** * Required. The message name of the primary return type for this * long-running operation. * This type will be used to deserialize the LRO's response. * If the response is in a different package from the rpc, a fully-qualified * message name must be used (e.g. `google.protobuf.Struct`). * Note: Altering this value constitutes a breaking change. * * Generated from protobuf field string response_type = 1; * @param string $var * @return $this */ public function setResponseType($var) { GPBUtil::checkString($var, True); $this->response_type = $var; return $this; } /** * Required. The message name of the metadata type for this long-running * operation. * If the response is in a different package from the rpc, a fully-qualified * message name must be used (e.g. `google.protobuf.Struct`). * Note: Altering this value constitutes a breaking change. * * Generated from protobuf field string metadata_type = 2; * @return string */ public function getMetadataType() { return $this->metadata_type; } /** * Required. The message name of the metadata type for this long-running * operation. * If the response is in a different package from the rpc, a fully-qualified * message name must be used (e.g. `google.protobuf.Struct`). * Note: Altering this value constitutes a breaking change. * * Generated from protobuf field string metadata_type = 2; * @param string $var * @return $this */ public function setMetadataType($var) { GPBUtil::checkString($var, True); $this->metadata_type = $var; return $this; } } src/LongRunning/OperationsGrpcClient.php000064400000015333151742734620014422 0ustar00_simpleRequest('/google.longrunning.Operations/ListOperations', $argument, ['\Google\LongRunning\ListOperationsResponse', 'decode'], $metadata, $options); } /** * Gets the latest state of a long-running operation. Clients can use this * method to poll the operation result at intervals as recommended by the API * service. * @param \Google\LongRunning\GetOperationRequest $argument input argument * @param array $metadata metadata * @param array $options call options * @return \Grpc\UnaryCall */ public function GetOperation(\Google\LongRunning\GetOperationRequest $argument, $metadata = [], $options = []) { return $this->_simpleRequest('/google.longrunning.Operations/GetOperation', $argument, ['\Google\LongRunning\Operation', 'decode'], $metadata, $options); } /** * Deletes a long-running operation. This method indicates that the client is * no longer interested in the operation result. It does not cancel the * operation. If the server doesn't support this method, it returns * `google.rpc.Code.UNIMPLEMENTED`. * @param \Google\LongRunning\DeleteOperationRequest $argument input argument * @param array $metadata metadata * @param array $options call options * @return \Grpc\UnaryCall */ public function DeleteOperation(\Google\LongRunning\DeleteOperationRequest $argument, $metadata = [], $options = []) { return $this->_simpleRequest('/google.longrunning.Operations/DeleteOperation', $argument, ['\Google\Protobuf\GPBEmpty', 'decode'], $metadata, $options); } /** * Starts asynchronous cancellation on a long-running operation. The server * makes a best effort to cancel the operation, but success is not * guaranteed. If the server doesn't support this method, it returns * `google.rpc.Code.UNIMPLEMENTED`. Clients can use * [Operations.GetOperation][google.longrunning.Operations.GetOperation] or * other methods to check whether the cancellation succeeded or whether the * operation completed despite cancellation. On successful cancellation, * the operation is not deleted; instead, it becomes an operation with * an [Operation.error][google.longrunning.Operation.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, * corresponding to `Code.CANCELLED`. * @param \Google\LongRunning\CancelOperationRequest $argument input argument * @param array $metadata metadata * @param array $options call options * @return \Grpc\UnaryCall */ public function CancelOperation(\Google\LongRunning\CancelOperationRequest $argument, $metadata = [], $options = []) { return $this->_simpleRequest('/google.longrunning.Operations/CancelOperation', $argument, ['\Google\Protobuf\GPBEmpty', 'decode'], $metadata, $options); } /** * Waits until the specified long-running operation is done or reaches at most * a specified timeout, returning the latest state. If the operation is * already done, the latest state is immediately returned. If the timeout * specified is greater than the default HTTP/RPC timeout, the HTTP/RPC * timeout is used. If the server does not support this method, it returns * `google.rpc.Code.UNIMPLEMENTED`. * Note that this method is on a best-effort basis. It may return the latest * state before the specified timeout (including immediately), meaning even an * immediate response is no guarantee that the operation is done. * @param \Google\LongRunning\WaitOperationRequest $argument input argument * @param array $metadata metadata * @param array $options call options * @return \Grpc\UnaryCall */ public function WaitOperation(\Google\LongRunning\WaitOperationRequest $argument, $metadata = [], $options = []) { return $this->_simpleRequest('/google.longrunning.Operations/WaitOperation', $argument, ['\Google\LongRunning\Operation', 'decode'], $metadata, $options); } } src/LongRunning/WaitOperationRequest.php000064400000007015151742734620014460 0ustar00google.longrunning.WaitOperationRequest */ class WaitOperationRequest extends \Google\Protobuf\Internal\Message { /** * The name of the operation resource to wait on. * * Generated from protobuf field string name = 1; */ private $name = ''; /** * The maximum duration to wait before timing out. If left blank, the wait * will be at most the time permitted by the underlying HTTP/RPC protocol. * If RPC context deadline is also specified, the shorter one will be used. * * Generated from protobuf field .google.protobuf.Duration timeout = 2; */ private $timeout = null; /** * Constructor. * * @param array $data { * Optional. Data for populating the Message object. * * @type string $name * The name of the operation resource to wait on. * @type \Google\Protobuf\Duration $timeout * The maximum duration to wait before timing out. If left blank, the wait * will be at most the time permitted by the underlying HTTP/RPC protocol. * If RPC context deadline is also specified, the shorter one will be used. * } */ public function __construct($data = NULL) { \GPBMetadata\Google\Longrunning\Operations::initOnce(); parent::__construct($data); } /** * The name of the operation resource to wait on. * * Generated from protobuf field string name = 1; * @return string */ public function getName() { return $this->name; } /** * The name of the operation resource to wait on. * * Generated from protobuf field string name = 1; * @param string $var * @return $this */ public function setName($var) { GPBUtil::checkString($var, True); $this->name = $var; return $this; } /** * The maximum duration to wait before timing out. If left blank, the wait * will be at most the time permitted by the underlying HTTP/RPC protocol. * If RPC context deadline is also specified, the shorter one will be used. * * Generated from protobuf field .google.protobuf.Duration timeout = 2; * @return \Google\Protobuf\Duration|null */ public function getTimeout() { return $this->timeout; } public function hasTimeout() { return isset($this->timeout); } public function clearTimeout() { unset($this->timeout); } /** * The maximum duration to wait before timing out. If left blank, the wait * will be at most the time permitted by the underlying HTTP/RPC protocol. * If RPC context deadline is also specified, the shorter one will be used. * * Generated from protobuf field .google.protobuf.Duration timeout = 2; * @param \Google\Protobuf\Duration $var * @return $this */ public function setTimeout($var) { GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); $this->timeout = $var; return $this; } }