diff --git a/.repo-metadata-full.json b/.repo-metadata-full.json index d1a9a618879f..bb904af30292 100644 --- a/.repo-metadata-full.json +++ b/.repo-metadata-full.json @@ -1043,7 +1043,7 @@ "LongRunning": { "language": "php", "distribution_name": "google/longrunning", - "release_level": "preview", + "release_level": "stable", "client_documentation": "https://cloud.google.com/php/docs/reference/longrunning/latest", "library_type": "GAPIC_AUTO", "api_shortname": "longrunning" diff --git a/LongRunning/README.md b/LongRunning/README.md index 2b34d4f2982c..f5d830e3a92c 100644 --- a/LongRunning/README.md +++ b/LongRunning/README.md @@ -35,9 +35,8 @@ for more information about the debugging tools. ### 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. +This component is considered GA (generally available). As such, it will not introduce backwards-incompatible changes in +any minor or patch releases. We will address issues and requests with the highest priority. ### Next Steps diff --git a/LongRunning/composer.json b/LongRunning/composer.json index c35f9b796da0..8e2a38aefb1f 100644 --- a/LongRunning/composer.json +++ b/LongRunning/composer.json @@ -6,7 +6,6 @@ "version": "0.9.1", "autoload": { "psr-4": { - "Google\\ApiCore\\LongRunning\\": "src/ApiCore/LongRunning", "Google\\LongRunning\\": "src/LongRunning", "GPBMetadata\\Google\\Longrunning\\": "metadata/Longrunning" } @@ -20,7 +19,7 @@ } }, "require-dev": { - "google/gax": "^1.38.0", + "google/gax": "^1.38.0||^2.0", "phpunit/phpunit": "^9.0" } } diff --git a/LongRunning/metadata/README.md b/LongRunning/metadata/README.md deleted file mode 100644 index 1bd41550eeaf..000000000000 --- a/LongRunning/metadata/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# Google Protobuf Metadata Classes - -## WARNING! - -These classes are not intended for direct use - they exist only to support -the generated protobuf classes in src/ diff --git a/LongRunning/owlbot.py b/LongRunning/owlbot.py index 658adb91e23b..c5b3247e1506 100644 --- a/LongRunning/owlbot.py +++ b/LongRunning/owlbot.py @@ -54,32 +54,6 @@ if os.path.exists("src/gapic_metadata.json"): os.remove("src/gapic_metadata.json") - -### [START] protoc backwards compatibility fixes - -# roll back to private properties. -s.replace( - "src/**/**/*.php", - r"Generated from protobuf field ([^\n]{0,})\n\s{5}\*/\n\s{4}protected \$", - r"""Generated from protobuf field \1 - */ - private $""") - -# prevent proto messages from being marked final -s.replace( - "src/**/**/*.php", - r"final class", - r"class") - -### [END] protoc backwards compatibility fixes - -# fix relative cloud.google.com links -s.replace( - "src/**/**/*.php", - r"(.{0,})\]\((/.{0,})\)", - r"\1](https://cloud.google.com\2)" -) - # format generated clients subprocess.run([ 'npm', diff --git a/LongRunning/samples/OperationsClient/cancel_operation.php b/LongRunning/samples/OperationsClient/cancel_operation.php new file mode 100644 index 000000000000..8285f56fb34b --- /dev/null +++ b/LongRunning/samples/OperationsClient/cancel_operation.php @@ -0,0 +1,79 @@ +setName($name); + + // Call the API and handle any network failures. + try { + $operationsClient->cancelOperation($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $name = '[NAME]'; + + cancel_operation_sample($name); +} +// [END longrunning_generated_Operations_CancelOperation_sync] diff --git a/LongRunning/samples/OperationsClient/delete_operation.php b/LongRunning/samples/OperationsClient/delete_operation.php new file mode 100644 index 000000000000..bdd26d8df6ea --- /dev/null +++ b/LongRunning/samples/OperationsClient/delete_operation.php @@ -0,0 +1,72 @@ +setName($name); + + // Call the API and handle any network failures. + try { + $operationsClient->deleteOperation($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $name = '[NAME]'; + + delete_operation_sample($name); +} +// [END longrunning_generated_Operations_DeleteOperation_sync] diff --git a/LongRunning/samples/OperationsClient/get_operation.php b/LongRunning/samples/OperationsClient/get_operation.php new file mode 100644 index 000000000000..9f4f85926cbd --- /dev/null +++ b/LongRunning/samples/OperationsClient/get_operation.php @@ -0,0 +1,73 @@ +setName($name); + + // Call the API and handle any network failures. + try { + /** @var Operation $response */ + $response = $operationsClient->getOperation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $name = '[NAME]'; + + get_operation_sample($name); +} +// [END longrunning_generated_Operations_GetOperation_sync] diff --git a/LongRunning/samples/OperationsClient/list_operations.php b/LongRunning/samples/OperationsClient/list_operations.php new file mode 100644 index 000000000000..8cad3848a40c --- /dev/null +++ b/LongRunning/samples/OperationsClient/list_operations.php @@ -0,0 +1,80 @@ +setName($name) + ->setFilter($filter); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $operationsClient->listOperations($request); + + /** @var Operation $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $name = '[NAME]'; + $filter = '[FILTER]'; + + list_operations_sample($name, $filter); +} +// [END longrunning_generated_Operations_ListOperations_sync] diff --git a/LongRunning/samples/OperationsClient/wait_operation.php b/LongRunning/samples/OperationsClient/wait_operation.php new file mode 100644 index 000000000000..86213ccd3a92 --- /dev/null +++ b/LongRunning/samples/OperationsClient/wait_operation.php @@ -0,0 +1,66 @@ +waitOperation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END longrunning_generated_Operations_WaitOperation_sync] diff --git a/LongRunning/src/ApiCore/LongRunning/Gapic/OperationsGapicClient.php b/LongRunning/src/ApiCore/LongRunning/Gapic/OperationsGapicClient.php deleted file mode 100644 index d1eacaa61fc4..000000000000 --- a/LongRunning/src/ApiCore/LongRunning/Gapic/OperationsGapicClient.php +++ /dev/null @@ -1,15 +0,0 @@ -string name = 1; */ - private $name = ''; + protected $name = ''; /** * @param string $name The name of the operation resource to be cancelled. diff --git a/LongRunning/src/LongRunning/Client/OperationsClient.php b/LongRunning/src/LongRunning/Client/OperationsClient.php index b04389e23232..c43fc7214958 100644 --- a/LongRunning/src/LongRunning/Client/OperationsClient.php +++ b/LongRunning/src/LongRunning/Client/OperationsClient.php @@ -22,14 +22,18 @@ * Updates to the above are reflected here through a refresh process. */ +declare(strict_types=1); + namespace Google\LongRunning\Client; use Google\ApiCore\ApiException; -use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\GapicClientTrait; +use Google\ApiCore\HeaderCredentialsInterface; +use Google\ApiCore\OperationsClientInterface; use Google\ApiCore\Options\ClientOptions; use Google\ApiCore\PagedListResponse; use Google\ApiCore\RetrySettings; +use Google\ApiCore\ServiceInterface; use Google\ApiCore\Transport\TransportInterface; use Google\ApiCore\ValidationException; use Google\Auth\FetchAuthTokenInterface; @@ -62,7 +66,7 @@ * @method PromiseInterface listOperationsAsync(ListOperationsRequest $request, array $optionalArgs = []) * @method PromiseInterface waitOperationAsync(WaitOperationRequest $request, array $optionalArgs = []) */ -class OperationsClient +final class OperationsClient implements ServiceInterface, OperationsClientInterface { use GapicClientTrait; @@ -92,14 +96,13 @@ class OperationsClient */ public static $serviceScopes = []; - private static function getClientDefaults() + private static function getClientDefaults(): array { 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, ], @@ -120,11 +123,11 @@ private static function getClientDefaults() * @type string $apiEndpoint * The address of the API remote host. May optionally include the port, formatted * as ":". Default 'longrunning.googleapis.com:443'. - * @type FetchAuthTokenInterface|CredentialsWrapper $credentials + * @type FetchAuthTokenInterface|HeaderCredentialsInterface $credentials * This option should only be used with a pre-constructed - * {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that - * when one of these objects are provided, any settings in $credentialsConfig will - * be ignored. + * {@see FetchAuthTokenInterface} or {@see HeaderCredentialsInterface} object. Note + * that when one of these objects are provided, any settings in $credentialsConfig + * will be ignored. * **Important**: If you are providing a path to a credentials file, or a decoded * credentials file as a PHP array, this usage is now DEPRECATED. Providing an * unvalidated credential configuration to Google APIs can compromise the security @@ -186,7 +189,7 @@ public function __construct(array|ClientOptions $options = []) } /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) + public function __call(string $method, array $args) { if (substr($method, -5) !== 'Async') { trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); diff --git a/LongRunning/src/LongRunning/DeleteOperationRequest.php b/LongRunning/src/LongRunning/DeleteOperationRequest.php index 4688e9f6ecad..59dd77e6b61f 100644 --- a/LongRunning/src/LongRunning/DeleteOperationRequest.php +++ b/LongRunning/src/LongRunning/DeleteOperationRequest.php @@ -21,7 +21,7 @@ class DeleteOperationRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * @param string $name The name of the operation resource to be deleted. diff --git a/LongRunning/src/LongRunning/Gapic/OperationsGapicClient.php b/LongRunning/src/LongRunning/Gapic/OperationsGapicClient.php deleted file mode 100644 index d4ed37a91751..000000000000 --- a/LongRunning/src/LongRunning/Gapic/OperationsGapicClient.php +++ /dev/null @@ -1,452 +0,0 @@ -cancelOperation($name); - * } finally { - * $operationsClient->close(); - * } - * ``` - * - * @deprecated Please use the new service client {@see \Google\LongRunning\Client\OperationsClient}. - */ -class OperationsGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.longrunning.Operations'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'longrunning.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'longrunning.UNIVERSE_DOMAIN'; - - /** 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`. - * - * 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 bool $returnPartialSuccess - * When set to `true`, operations that are reachable are returned as normal, - * and those that are unreachable are returned in the - * [ListOperationsResponse.unreachable] field. - * - * This can only be `true` when reading across collections e.g. when `parent` - * is set to `"projects/example/locations/-"`. - * - * This field is not by default supported and will result in an - * `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - * service or product specific documentation. - * @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']); - } - - if (isset($optionalArgs['returnPartialSuccess'])) { - $request->setReturnPartialSuccess($optionalArgs['returnPartialSuccess']); - } - - $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(); - } -} diff --git a/LongRunning/src/LongRunning/GetOperationRequest.php b/LongRunning/src/LongRunning/GetOperationRequest.php index 3114feae4bf7..53dfb8b5e851 100644 --- a/LongRunning/src/LongRunning/GetOperationRequest.php +++ b/LongRunning/src/LongRunning/GetOperationRequest.php @@ -21,7 +21,7 @@ class GetOperationRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * @param string $name The name of the operation resource. diff --git a/LongRunning/src/LongRunning/ListOperationsRequest.php b/LongRunning/src/LongRunning/ListOperationsRequest.php index f91f63fd5333..6abe7bd540ca 100644 --- a/LongRunning/src/LongRunning/ListOperationsRequest.php +++ b/LongRunning/src/LongRunning/ListOperationsRequest.php @@ -21,25 +21,25 @@ class ListOperationsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 4; */ - private $name = ''; + protected $name = ''; /** * The standard list filter. * * Generated from protobuf field string filter = 1; */ - private $filter = ''; + protected $filter = ''; /** * The standard list page size. * * Generated from protobuf field int32 page_size = 2; */ - private $page_size = 0; + protected $page_size = 0; /** * The standard list page token. * * Generated from protobuf field string page_token = 3; */ - private $page_token = ''; + protected $page_token = ''; /** * When set to `true`, operations that are reachable are returned as normal, * and those that are unreachable are returned in the @@ -52,7 +52,7 @@ class ListOperationsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool return_partial_success = 5; */ - private $return_partial_success = false; + protected $return_partial_success = false; /** * @param string $name The name of the operation's parent resource. diff --git a/LongRunning/src/LongRunning/ListOperationsResponse.php b/LongRunning/src/LongRunning/ListOperationsResponse.php index 73cd6bb0ff5c..7aa1348e9916 100644 --- a/LongRunning/src/LongRunning/ListOperationsResponse.php +++ b/LongRunning/src/LongRunning/ListOperationsResponse.php @@ -27,7 +27,7 @@ class ListOperationsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Unordered list. Unreachable resources. Populated when the request sets * `ListOperationsRequest.return_partial_success` and reads across diff --git a/LongRunning/src/LongRunning/Operation.php b/LongRunning/src/LongRunning/Operation.php index 2bc97a275e0a..4bb21f0edac0 100644 --- a/LongRunning/src/LongRunning/Operation.php +++ b/LongRunning/src/LongRunning/Operation.php @@ -23,7 +23,7 @@ class Operation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * Service-specific metadata associated with the operation. It typically * contains progress information and common metadata such as create time. @@ -32,7 +32,7 @@ class Operation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Any metadata = 2; */ - private $metadata = null; + protected $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 @@ -40,7 +40,7 @@ class Operation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool done = 3; */ - private $done = false; + protected $done = false; protected $result; /** diff --git a/LongRunning/src/LongRunning/OperationInfo.php b/LongRunning/src/LongRunning/OperationInfo.php index f3dc932e5d71..e8d2bb3398a3 100644 --- a/LongRunning/src/LongRunning/OperationInfo.php +++ b/LongRunning/src/LongRunning/OperationInfo.php @@ -32,7 +32,7 @@ class OperationInfo extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string response_type = 1; */ - private $response_type = ''; + protected $response_type = ''; /** * Required. The message name of the metadata type for this long-running * operation. @@ -42,7 +42,7 @@ class OperationInfo extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string metadata_type = 2; */ - private $metadata_type = ''; + protected $metadata_type = ''; /** * Constructor. diff --git a/LongRunning/src/LongRunning/OperationsClient.php b/LongRunning/src/LongRunning/OperationsClient.php deleted file mode 100644 index 9f2886b1ef84..000000000000 --- a/LongRunning/src/LongRunning/OperationsClient.php +++ /dev/null @@ -1,40 +0,0 @@ -_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); - } - -} diff --git a/LongRunning/src/LongRunning/WaitOperationRequest.php b/LongRunning/src/LongRunning/WaitOperationRequest.php index 9baf626e3412..957fff8419e3 100644 --- a/LongRunning/src/LongRunning/WaitOperationRequest.php +++ b/LongRunning/src/LongRunning/WaitOperationRequest.php @@ -21,7 +21,7 @@ class WaitOperationRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $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. @@ -29,7 +29,7 @@ class WaitOperationRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Duration timeout = 2; */ - private $timeout = null; + protected $timeout = null; /** * Constructor. diff --git a/LongRunning/tests/Unit/Client/OperationsClientTest.php b/LongRunning/tests/Unit/Client/OperationsClientTest.php index 1f04cb4ac6ef..1d6b07caf5a9 100644 --- a/LongRunning/tests/Unit/Client/OperationsClientTest.php +++ b/LongRunning/tests/Unit/Client/OperationsClientTest.php @@ -20,10 +20,12 @@ * This file was automatically generated - do not edit! */ +declare(strict_types=1); + namespace Google\LongRunning\Tests\Unit\Client; use Google\ApiCore\ApiException; -use Google\ApiCore\CredentialsWrapper; +use Google\ApiCore\InsecureCredentialsWrapper; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; use Google\LongRunning\CancelOperationRequest; @@ -51,12 +53,10 @@ private function createTransport($deserialize = null) return new MockTransport($deserialize); } - /** @return CredentialsWrapper */ + /** @return InsecureCredentialsWrapper */ private function createCredentials() { - return $this->getMockBuilder(CredentialsWrapper::class) - ->disableOriginalConstructor() - ->getMock(); + return new InsecureCredentialsWrapper(); } /** @return OperationsClient */ diff --git a/LongRunning/tests/Unit/OperationsClientTest.php b/LongRunning/tests/Unit/OperationsClientTest.php deleted file mode 100644 index 8dc24ed49762..000000000000 --- a/LongRunning/tests/Unit/OperationsClientTest.php +++ /dev/null @@ -1,381 +0,0 @@ -getMockBuilder(CredentialsWrapper::class) - ->disableOriginalConstructor() - ->getMock(); - } - - /** @return \Google\LongRunning\OperationsClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new \Google\LongRunning\OperationsClient($options); - } - - /** @test */ - public function cancelOperationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $name = 'name3373707'; - $gapicClient->cancelOperation($name); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/CancelOperation', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function cancelOperationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); - $transport->addResponse(null, $status); - // Mock request - $name = 'name3373707'; - try { - $gapicClient->cancelOperation($name); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteOperationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $name = 'name3373707'; - $gapicClient->deleteOperation($name); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/DeleteOperation', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteOperationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); - $transport->addResponse(null, $status); - // Mock request - $name = 'name3373707'; - try { - $gapicClient->deleteOperation($name); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getOperationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $done = true; - $expectedResponse = new Operation(); - $expectedResponse->setName($name2); - $expectedResponse->setDone($done); - $transport->addResponse($expectedResponse); - // Mock request - $name = 'name3373707'; - $response = $gapicClient->getOperation($name); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getOperationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); - $transport->addResponse(null, $status); - // Mock request - $name = 'name3373707'; - try { - $gapicClient->getOperation($name); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listOperationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $operationsElement = new Operation(); - $operations = [$operationsElement]; - $expectedResponse = new ListOperationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setOperations($operations); - $transport->addResponse($expectedResponse); - // Mock request - $name = 'name3373707'; - $filter = 'filter-1274492040'; - $response = $gapicClient->listOperations($name, $filter); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getOperations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/ListOperations', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); - $actualValue = $actualRequestObject->getFilter(); - $this->assertProtobufEquals($filter, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listOperationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); - $transport->addResponse(null, $status); - // Mock request - $name = 'name3373707'; - $filter = 'filter-1274492040'; - try { - $gapicClient->listOperations($name, $filter); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function waitOperationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $done = true; - $expectedResponse = new Operation(); - $expectedResponse->setName($name2); - $expectedResponse->setDone($done); - $transport->addResponse($expectedResponse); - $response = $gapicClient->waitOperation(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/WaitOperation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function waitOperationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); - $transport->addResponse(null, $status); - try { - $gapicClient->waitOperation(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/composer.json b/composer.json index 3d3024f7b596..1fff7332feef 100644 --- a/composer.json +++ b/composer.json @@ -592,7 +592,6 @@ "Google\\Analytics\\Admin\\": "AnalyticsAdmin/src", "Google\\Analytics\\Data\\": "AnalyticsData/src", "Google\\ApiCore\\": "Gax/src", - "Google\\ApiCore\\LongRunning\\": "LongRunning/src/ApiCore/LongRunning", "Google\\Api\\": "CommonProtos/src/Api", "Google\\Apps\\Card\\": "AppsChat/src/Card", "Google\\Apps\\Chat\\": "AppsChat/src/Chat", diff --git a/dev/tests/fixtures/docfx/Vision/V1.ImportProductSetsResponse.yml b/dev/tests/fixtures/docfx/Vision/V1.ImportProductSetsResponse.yml index 62377d733b45..98d279d90789 100644 --- a/dev/tests/fixtures/docfx/Vision/V1.ImportProductSetsResponse.yml +++ b/dev/tests/fixtures/docfx/Vision/V1.ImportProductSetsResponse.yml @@ -9,7 +9,7 @@ items: Response message for the `ImportProductSets` method. This message is returned by the - google.longrunning.Operations.GetOperation + google.longrunning.Operations.GetOperation method in the returned google.longrunning.Operation.response field. diff --git a/librarian.yaml b/librarian.yaml index 7a19f1748ce8..91dc9a8b3bb2 100644 --- a/librarian.yaml +++ b/librarian.yaml @@ -1194,13 +1194,8 @@ libraries: - path: google/longrunning php: common_resources: false - samples: false staging_subdir: . copyright_year: "2026" - keep: - - src/LongRunning/Gapic/OperationsGapicClient.php - - src/LongRunning/OperationsClient.php - - tests/Unit/OperationsClientTest.php output: LongRunning - name: lustre version: 0.5.1