diff --git a/Gax/README.md b/Gax/README.md index 2f5a1d9322c9..59e6d0665b2f 100644 --- a/Gax/README.md +++ b/Gax/README.md @@ -80,6 +80,8 @@ be found for Mac or Windows. > vendor/bin/phpunit ``` + For Showcase Conformance testing and client generation, see [tests/Conformance/README.md](tests/Conformance/README.md). + 4. Run static analysis tools ```sh diff --git a/Gax/tests/Conformance/README.md b/Gax/tests/Conformance/README.md new file mode 100644 index 000000000000..0858b2c77cf6 --- /dev/null +++ b/Gax/tests/Conformance/README.md @@ -0,0 +1,46 @@ +# GAX Showcase Conformance Testing + +This directory contains the integration conformance test suite (`ShowcaseTest.php`) and generated client SDK for `gapic-showcase`. + +## Prerequisites + +- **Protobuf Compiler (`protoc`)**: Ensure `protoc` is installed and available in your `$PATH`. +- **Dev Dependencies**: Ensure dev dependencies are installed: + ```sh + composer install -d dev/ + ``` + +## Generating the Showcase Client + +To generate or update the Showcase client SDK, message classes, and metadata using the PHP CLI tool: + +```sh +# From the repository root, run the console command: +./dev/google-cloud showcase:generate +``` + +Options: +- `-o, --out-dir `: Output directory relative to repository root (defaults to `Gax`). +- `-p, --showcase-path `: Path to local `gapic-showcase` repository (defaults to installed vendor dependency). +- `-g, --generator-path `: Path to local `gapic-generator-php` (defaults to installed vendor dependency). +- `-a, --googleapis-path `: Path to `googleapis` repository (defaults to submodule in `gapic-generator-php`). + +## Running Conformance Tests + +1. Install and launch the matching `gapic-showcase` mock server in the background: + ```sh + # Option 1 (curl) + curl -L https://github.com/googleapis/gapic-showcase/releases/download/v0.41.1/gapic-showcase-0.41.1-linux-amd64.tar.gz | tar -zx + ./gapic-showcase run & + + # Option 2 (go install) + go install github.com/googleapis/gapic-showcase/cmd/gapic-showcase@latest + gapic-showcase run & + ``` + +2. Run the PHPUnit conformance test suite: + ```sh + vendor/bin/phpunit -c Gax/phpunit-conformance.xml.dist + # or from the Gax directory: + cd Gax && vendor/bin/phpunit tests/Conformance/ShowcaseTest.php + ``` diff --git a/Gax/tests/Conformance/metadata/V1Beta1/Compliance.php b/Gax/tests/Conformance/metadata/V1Beta1/Compliance.php index 9dfe4416cf50..3e7df660a7e6 100644 Binary files a/Gax/tests/Conformance/metadata/V1Beta1/Compliance.php and b/Gax/tests/Conformance/metadata/V1Beta1/Compliance.php differ diff --git a/Gax/tests/Conformance/metadata/V1Beta1/Identity.php b/Gax/tests/Conformance/metadata/V1Beta1/Identity.php index 8637df482fcc..4952b1958f7c 100644 Binary files a/Gax/tests/Conformance/metadata/V1Beta1/Identity.php and b/Gax/tests/Conformance/metadata/V1Beta1/Identity.php differ diff --git a/Gax/tests/Conformance/metadata/V1Beta1/Messaging.php b/Gax/tests/Conformance/metadata/V1Beta1/Messaging.php index 3b8b801a1b3f..be5135fe24d5 100644 Binary files a/Gax/tests/Conformance/metadata/V1Beta1/Messaging.php and b/Gax/tests/Conformance/metadata/V1Beta1/Messaging.php differ diff --git a/Gax/tests/Conformance/metadata/V1Beta1/PBEcho.php b/Gax/tests/Conformance/metadata/V1Beta1/PBEcho.php index a3ace5c606f4..c2d7fecc9e24 100644 Binary files a/Gax/tests/Conformance/metadata/V1Beta1/PBEcho.php and b/Gax/tests/Conformance/metadata/V1Beta1/PBEcho.php differ diff --git a/Gax/tests/Conformance/metadata/V1Beta1/RestError.php b/Gax/tests/Conformance/metadata/V1Beta1/RestError.php index e5b5923dd3c5..2bb1aa62df87 100644 --- a/Gax/tests/Conformance/metadata/V1Beta1/RestError.php +++ b/Gax/tests/Conformance/metadata/V1Beta1/RestError.php @@ -1,5 +1,6 @@ internalAddGeneratedFile( - ' - -(google/showcase/v1beta1/rest_error.protogoogle.showcase.v1beta1google/rpc/code.proto"· - RestError8 -error ( 2).google.showcase.v1beta1.RestError.Statusp -Status -code ( -message (  -status (2.google.rpc.Code% -details ( 2.google.protobuf.AnyBq -com.google.showcase.v1beta1PZ4github.com/googleapis/gapic-showcase/server/genprotoêGoogle::Showcase::V1beta1bproto3' + "\x0A\x8F\x03\x0A(google/showcase/v1beta1/rest_error.proto\x12\x17google.showcase.v1beta1\x1A\x15google/rpc/code.proto\"\xB7\x01\x0A\x09RestError\x128\x0A\x05error\x18\x01 \x01(\x0B2).google.showcase.v1beta1.RestError.Status\x1Ap\x0A\x06Status\x12\x0C\x0A\x04code\x18\x01 \x01(\x05\x12\x0F\x0A\x07message\x18\x02 \x01(\x09\x12 \x0A\x06status\x18\x04 \x01(\x0E2\x10.google.rpc.Code\x12%\x0A\x07details\x18\x05 \x03(\x0B2\x14.google.protobuf.AnyBq\x0A\x1Bcom.google.showcase.v1beta1P\x01Z4github.com/googleapis/gapic-showcase/server/genproto\xEA\x02\x19Google::Showcase::V1beta1b\x06proto3" , true); static::$is_initialized = true; diff --git a/Gax/tests/Conformance/metadata/V1Beta1/Sequence.php b/Gax/tests/Conformance/metadata/V1Beta1/Sequence.php index d2f1e57bc591..3fdee94ffaa6 100644 --- a/Gax/tests/Conformance/metadata/V1Beta1/Sequence.php +++ b/Gax/tests/Conformance/metadata/V1Beta1/Sequence.php @@ -1,5 +1,6 @@ internalAddGeneratedFile( - ' -¹ -&google/showcase/v1beta1/sequence.protogoogle.showcase.v1beta1google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.protogoogle/protobuf/duration.protogoogle/protobuf/empty.protogoogle/protobuf/timestamp.protogoogle/rpc/status.proto"ó -Sequence -name ( BàA= - responses ( 2*.google.showcase.v1beta1.Sequence.ResponseX -Response" -status ( 2.google.rpc.Status( -delay ( 2.google.protobuf.Duration:;êA8 - showcase.googleapis.com/Sequencesequences/{sequence}"Ê -StreamingSequence -name ( BàA -content ( F - responses ( 23.google.showcase.v1beta1.StreamingSequence.Responsep -Response" -status ( 2.google.rpc.Status( -delay ( 2.google.protobuf.Duration -response_index (:WêAT -)showcase.googleapis.com/StreamingSequence\'streamingSequences/{streaming_sequence}"Ò -StreamingSequenceReport -name ( BàAJ -attempts ( 28.google.showcase.v1beta1.StreamingSequenceReport.Attemptà -Attempt -attempt_number (4 -attempt_deadline ( 2.google.protobuf.Timestamp1 - response_time ( 2.google.protobuf.Timestamp0 - attempt_delay ( 2.google.protobuf.Duration" -status ( 2.google.rpc.Status:uêAr -/showcase.googleapis.com/StreamingSequenceReport?streamingSequences/{streaming_sequence}/streamingSequenceReport"› -SequenceReport -name ( BàAA -attempts ( 2/.google.showcase.v1beta1.SequenceReport.Attemptà -Attempt -attempt_number (4 -attempt_deadline ( 2.google.protobuf.Timestamp1 - response_time ( 2.google.protobuf.Timestamp0 - attempt_delay ( 2.google.protobuf.Duration" -status ( 2.google.rpc.Status:PêAM -&showcase.googleapis.com/SequenceReport#sequences/{sequence}/sequenceReport"L -CreateSequenceRequest3 -sequence ( 2!.google.showcase.v1beta1.Sequence"h -CreateStreamingSequenceRequestF -streaming_sequence ( 2*.google.showcase.v1beta1.StreamingSequence"P -AttemptSequenceRequest6 -name ( B(àAúA" - showcase.googleapis.com/Sequence"€ -AttemptStreamingSequenceRequest? -name ( B1àAúA+ -)showcase.googleapis.com/StreamingSequence -last_fail_index (BàA"3 - AttemptStreamingSequenceResponse -content ( "X -GetSequenceReportRequest< -name ( B.àAúA( -&showcase.googleapis.com/SequenceReport"j -!GetStreamingSequenceReportRequestE -name ( B7àAúA1 -/showcase.googleapis.com/StreamingSequenceReport2ð -SequenceService” -CreateSequence..google.showcase.v1beta1.CreateSequenceRequest!.google.showcase.v1beta1.Sequence"/ÚAsequence‚Óä“"/v1beta1/sequences:sequenceÌ -CreateStreamingSequence7.google.showcase.v1beta1.CreateStreamingSequenceRequest*.google.showcase.v1beta1.StreamingSequence"LÚAstreaming_sequence‚Óä“1"/v1beta1/streamingSequences:streaming_sequenceª -GetSequenceReport1.google.showcase.v1beta1.GetSequenceReportRequest\'.google.showcase.v1beta1.SequenceReport"9ÚAname‚Óä“,*/v1beta1/{name=sequences/*/sequenceReport}× -GetStreamingSequenceReport:.google.showcase.v1beta1.GetStreamingSequenceReportRequest0.google.showcase.v1beta1.StreamingSequenceReport"KÚAname‚Óä“>\x12google.showcase.v1beta1.AttemptSequenceRequest */ class AttemptSequenceRequest extends \Google\Protobuf\Internal\Message @@ -18,19 +21,6 @@ class AttemptSequenceRequest extends \Google\Protobuf\Internal\Message */ protected $name = ''; - /** - * @param string $name Please see {@see SequenceServiceClient::sequenceName()} for help formatting this field. - * - * @return \Google\Showcase\V1beta1\AttemptSequenceRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - /** * Constructor. * @@ -59,9 +49,9 @@ public function getName() * @param string $var * @return $this */ - public function setName($var) + public function setName(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->name = $var; return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/AttemptStreamingSequenceRequest.php b/Gax/tests/Conformance/src/V1beta1/AttemptStreamingSequenceRequest.php index 9d9c65e5bb47..9146ce18dd16 100644 --- a/Gax/tests/Conformance/src/V1beta1/AttemptStreamingSequenceRequest.php +++ b/Gax/tests/Conformance/src/V1beta1/AttemptStreamingSequenceRequest.php @@ -1,14 +1,17 @@ google.showcase.v1beta1.AttemptStreamingSequenceRequest */ class AttemptStreamingSequenceRequest extends \Google\Protobuf\Internal\Message @@ -26,19 +29,6 @@ class AttemptStreamingSequenceRequest extends \Google\Protobuf\Internal\Message */ protected $last_fail_index = 0; - /** - * @param string $name Please see {@see SequenceServiceClient::streamingSequenceName()} for help formatting this field. - * - * @return \Google\Showcase\V1beta1\AttemptStreamingSequenceRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - /** * Constructor. * @@ -71,9 +61,9 @@ public function getName() * @param string $var * @return $this */ - public function setName($var) + public function setName(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->name = $var; return $this; @@ -101,7 +91,7 @@ public function getLastFailIndex() * @param int $var * @return $this */ - public function setLastFailIndex($var) + public function setLastFailIndex(int $var) { GPBUtil::checkInt32($var); $this->last_fail_index = $var; diff --git a/Gax/tests/Conformance/src/V1beta1/AttemptStreamingSequenceResponse.php b/Gax/tests/Conformance/src/V1beta1/AttemptStreamingSequenceResponse.php index 87caa59a51f1..19b5bb7a184c 100644 --- a/Gax/tests/Conformance/src/V1beta1/AttemptStreamingSequenceResponse.php +++ b/Gax/tests/Conformance/src/V1beta1/AttemptStreamingSequenceResponse.php @@ -1,15 +1,16 @@ google.showcase.v1beta1.AttemptStreamingSequenceResponse */ @@ -55,9 +56,9 @@ public function getContent() * @param string $var * @return $this */ - public function setContent($var) + public function setContent(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->content = $var; return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/BlockRequest.php b/Gax/tests/Conformance/src/V1beta1/BlockRequest.php index 15a41c87f523..88b0ca925679 100644 --- a/Gax/tests/Conformance/src/V1beta1/BlockRequest.php +++ b/Gax/tests/Conformance/src/V1beta1/BlockRequest.php @@ -1,12 +1,13 @@ response_delay = $var; return $this; @@ -104,9 +104,8 @@ public function hasError() * @param \Google\Rpc\Status $var * @return $this */ - public function setError($var) + public function setError(\Google\Rpc\Status|null $var) { - GPBUtil::checkMessage($var, \Google\Rpc\Status::class); $this->writeOneof(2, $var); return $this; @@ -135,9 +134,8 @@ public function hasSuccess() * @param \Google\Showcase\V1beta1\BlockResponse $var * @return $this */ - public function setSuccess($var) + public function setSuccess(\Google\Showcase\V1beta1\BlockResponse|null $var) { - GPBUtil::checkMessage($var, \Google\Showcase\V1beta1\BlockResponse::class); $this->writeOneof(3, $var); return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/BlockResponse.php b/Gax/tests/Conformance/src/V1beta1/BlockResponse.php index 4e0d4285db3b..86e29da73684 100644 --- a/Gax/tests/Conformance/src/V1beta1/BlockResponse.php +++ b/Gax/tests/Conformance/src/V1beta1/BlockResponse.php @@ -1,12 +1,13 @@ content = $var; return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/Blurb.php b/Gax/tests/Conformance/src/V1beta1/Blurb.php index b901092c60d2..b5afd3cfb27d 100644 --- a/Gax/tests/Conformance/src/V1beta1/Blurb.php +++ b/Gax/tests/Conformance/src/V1beta1/Blurb.php @@ -1,12 +1,13 @@ name = $var; return $this; @@ -120,9 +121,9 @@ public function getUser() * @param string $var * @return $this */ - public function setUser($var) + public function setUser(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->user = $var; return $this; @@ -151,9 +152,9 @@ public function hasText() * @param string $var * @return $this */ - public function setText($var) + public function setText(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->writeOneof(3, $var); return $this; @@ -182,9 +183,9 @@ public function hasImage() * @param string $var * @return $this */ - public function setImage($var) + public function setImage(string $var) { - GPBUtil::checkString($var, False); + GPBUtil::checkString($var, false); $this->writeOneof(4, $var); return $this; @@ -218,9 +219,8 @@ public function clearCreateTime() * @param \Google\Protobuf\Timestamp $var * @return $this */ - public function setCreateTime($var) + public function setCreateTime(\Google\Protobuf\Timestamp|null $var) { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); $this->create_time = $var; return $this; @@ -254,9 +254,8 @@ public function clearUpdateTime() * @param \Google\Protobuf\Timestamp $var * @return $this */ - public function setUpdateTime($var) + public function setUpdateTime(\Google\Protobuf\Timestamp|null $var) { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); $this->update_time = $var; return $this; @@ -289,9 +288,9 @@ public function hasLegacyRoomId() * @param string $var * @return $this */ - public function setLegacyRoomId($var) + public function setLegacyRoomId(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->writeOneof(7, $var); return $this; @@ -324,9 +323,9 @@ public function hasLegacyUserId() * @param string $var * @return $this */ - public function setLegacyUserId($var) + public function setLegacyUserId(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->writeOneof(8, $var); return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/Client/ComplianceClient.php b/Gax/tests/Conformance/src/V1beta1/Client/ComplianceClient.php index 913c3456efec..90829232eaa3 100644 --- a/Gax/tests/Conformance/src/V1beta1/Client/ComplianceClient.php +++ b/Gax/tests/Conformance/src/V1beta1/Client/ComplianceClient.php @@ -1,6 +1,6 @@ :". Default 'localhost:7469: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. - * *Important*: If you accept a credential configuration (credential - * JSON/File/Stream) from an external source for authentication to Google Cloud - * Platform, you must validate it before providing it to any Google API or library. - * Providing an unvalidated credential configuration to Google APIs can compromise - * the security of your systems and data. For more information {@see + * @type FetchAuthTokenInterface|CredentialsWrapper $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. + * **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 + * of your systems and data. It is recommended to create the credentials explicitly + * ``` + * use Google\Auth\Credentials\ServiceAccountCredentials; + * use Google\Showcase\V1beta1\ComplianceClient; + * $creds = new ServiceAccountCredentials($scopes, $json); + * $options = new ComplianceClient(['credentials' => $creds]); + * ``` + * {@see * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} * @type array $credentialsConfig * Options used to configure credentials, including auth token caching, for the @@ -158,13 +166,15 @@ private static function getClientDefaults() * @type false|LoggerInterface $logger * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * @type string $universeDomain + * The service domain for the client. Defaults to 'googleapis.com'. * } * * @throws ValidationException * * @experimental */ - public function __construct(array $options = []) + public function __construct(array|ClientOptions $options = []) { $clientOptions = $this->buildClientOptions($options); $this->setClientOptions($clientOptions); @@ -191,8 +201,6 @@ public function __call($method, $args) * * The async variant is {@see ComplianceClient::getEnumAsync()} . * - * @example samples/V1beta1/ComplianceClient/get_enum.php - * * @param EnumRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -220,8 +228,6 @@ public function getEnum(EnumRequest $request, array $callOptions = []): EnumResp * * The async variant is {@see ComplianceClient::repeatDataBodyAsync()} . * - * @example samples/V1beta1/ComplianceClient/repeat_data_body.php - * * @param RepeatRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -250,8 +256,6 @@ public function repeatDataBody(RepeatRequest $request, array $callOptions = []): * * The async variant is {@see ComplianceClient::repeatDataBodyInfoAsync()} . * - * @example samples/V1beta1/ComplianceClient/repeat_data_body_info.php - * * @param RepeatRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -278,8 +282,6 @@ public function repeatDataBodyInfo(RepeatRequest $request, array $callOptions = * * The async variant is {@see ComplianceClient::repeatDataBodyPatchAsync()} . * - * @example samples/V1beta1/ComplianceClient/repeat_data_body_patch.php - * * @param RepeatRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -306,8 +308,6 @@ public function repeatDataBodyPatch(RepeatRequest $request, array $callOptions = * * The async variant is {@see ComplianceClient::repeatDataBodyPutAsync()} . * - * @example samples/V1beta1/ComplianceClient/repeat_data_body_put.php - * * @param RepeatRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -334,8 +334,6 @@ public function repeatDataBodyPut(RepeatRequest $request, array $callOptions = [ * * The async variant is {@see ComplianceClient::repeatDataPathResourceAsync()} . * - * @example samples/V1beta1/ComplianceClient/repeat_data_path_resource.php - * * @param RepeatRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -363,8 +361,6 @@ public function repeatDataPathResource(RepeatRequest $request, array $callOption * The async variant is * {@see ComplianceClient::repeatDataPathTrailingResourceAsync()} . * - * @example samples/V1beta1/ComplianceClient/repeat_data_path_trailing_resource.php - * * @param RepeatRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -392,8 +388,6 @@ public function repeatDataPathTrailingResource(RepeatRequest $request, array $ca * * The async variant is {@see ComplianceClient::repeatDataQueryAsync()} . * - * @example samples/V1beta1/ComplianceClient/repeat_data_query.php - * * @param RepeatRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -422,8 +416,6 @@ public function repeatDataQuery(RepeatRequest $request, array $callOptions = []) * * The async variant is {@see ComplianceClient::repeatDataSimplePathAsync()} . * - * @example samples/V1beta1/ComplianceClient/repeat_data_simple_path.php - * * @param RepeatRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -455,8 +447,6 @@ public function repeatDataSimplePath(RepeatRequest $request, array $callOptions * * The async variant is {@see ComplianceClient::verifyEnumAsync()} . * - * @example samples/V1beta1/ComplianceClient/verify_enum.php - * * @param EnumResponse $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Gax/tests/Conformance/src/V1beta1/Client/EchoClient.php b/Gax/tests/Conformance/src/V1beta1/Client/EchoClient.php index eab8a8bc2fd5..9cdd598311a0 100644 --- a/Gax/tests/Conformance/src/V1beta1/Client/EchoClient.php +++ b/Gax/tests/Conformance/src/V1beta1/Client/EchoClient.php @@ -1,6 +1,6 @@ failEchoWithDetailsAsync(FailEchoWithDetailsRequest $request, array $optionalArgs = []) * @method PromiseInterface pagedExpandAsync(PagedExpandRequest $request, array $optionalArgs = []) * @method PromiseInterface pagedExpandLegacyAsync(PagedExpandLegacyRequest $request, array $optionalArgs = []) - * @method PromiseInterface pagedExpandLegacyMappedAsync(PagedExpandRequest $request, array $optionalArgs = []) + * @method PromiseInterface pagedExpandLegacyMappedAsync(PagedExpandRequest $request, array $optionalArgs = []) * @method PromiseInterface waitAsync(WaitRequest $request, array $optionalArgs = []) */ final class EchoClient @@ -98,7 +103,11 @@ final class EchoClient /** The api version of the service */ private string $apiVersion = 'v1_20240408'; - /** The default scopes required by the service. */ + /** + * The default scopes required by the service. + * + * @internal + */ public static $serviceScopes = []; private $operationsClient; @@ -149,7 +158,7 @@ public function getOperationsClient() */ public function resumeOperation($operationName, $methodName = null) { - $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $options = $this->descriptors[$methodName]['longRunning'] ?? []; $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); $operation->reload(); return $operation; @@ -177,25 +186,28 @@ private function createOperationsClient(array $options) /** * Constructor. * - * @param array $options { + * @param array|ClientOptions $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 'localhost:7469: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. - * *Important*: If you accept a credential configuration (credential - * JSON/File/Stream) from an external source for authentication to Google Cloud - * Platform, you must validate it before providing it to any Google API or library. - * Providing an unvalidated credential configuration to Google APIs can compromise - * the security of your systems and data. For more information {@see + * @type FetchAuthTokenInterface|CredentialsWrapper $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. + * **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 + * of your systems and data. It is recommended to create the credentials explicitly + * ``` + * use Google\Auth\Credentials\ServiceAccountCredentials; + * use Google\Showcase\V1beta1\EchoClient; + * $creds = new ServiceAccountCredentials($scopes, $json); + * $options = new EchoClient(['credentials' => $creds]); + * ``` + * {@see * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} * @type array $credentialsConfig * Options used to configure credentials, including auth token caching, for the @@ -233,13 +245,15 @@ private function createOperationsClient(array $options) * @type false|LoggerInterface $logger * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * @type string $universeDomain + * The service domain for the client. Defaults to 'googleapis.com'. * } * * @throws ValidationException * * @experimental */ - public function __construct(array $options = []) + public function __construct(array|ClientOptions $options = []) { $clientOptions = $this->buildClientOptions($options); $this->setClientOptions($clientOptions); @@ -264,8 +278,6 @@ public function __call($method, $args) * * The async variant is {@see EchoClient::blockAsync()} . * - * @example samples/V1beta1/EchoClient/block.php - * * @param BlockRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -292,8 +304,6 @@ public function block(BlockRequest $request, array $callOptions = []): BlockResp * content back on the stream. This method showcases bidirectional * streaming RPCs. * - * @example samples/V1beta1/EchoClient/chat.php - * * @param array $callOptions { * Optional. * @@ -317,8 +327,6 @@ public function chat(array $callOptions = []): BidiStream * by the client, this method will return the a concatenation of the strings * passed to it. This method showcases client-side streaming RPCs. * - * @example samples/V1beta1/EchoClient/collect.php - * * @param array $callOptions { * Optional. * @@ -342,8 +350,6 @@ public function collect(array $callOptions = []): ClientStream * * The async variant is {@see EchoClient::echoAsync()} . * - * @example samples/V1beta1/EchoClient/echo.php - * * @param EchoRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -375,8 +381,6 @@ public function echo(EchoRequest $request, array $callOptions = []): EchoRespons * * The async variant is {@see EchoClient::echoErrorDetailsAsync()} . * - * @example samples/V1beta1/EchoClient/echo_error_details.php - * * @param EchoErrorDetailsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -402,8 +406,6 @@ public function echoErrorDetails(EchoErrorDetailsRequest $request, array $callOp * This method splits the given content into words and will pass each word back * through the stream. This method showcases server-side streaming RPCs. * - * @example samples/V1beta1/EchoClient/expand.php - * * @param ExpandRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -412,7 +414,7 @@ public function echoErrorDetails(EchoErrorDetailsRequest $request, array $callOp * Timeout to use for this call. * } * - * @return ServerStream + * @return ServerStream * * @throws ApiException Thrown if the API call fails. * @@ -434,8 +436,6 @@ public function expand(ExpandRequest $request, array $callOptions = []): ServerS * * The async variant is {@see EchoClient::failEchoWithDetailsAsync()} . * - * @example samples/V1beta1/EchoClient/fail_echo_with_details.php - * * @param FailEchoWithDetailsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -463,8 +463,6 @@ public function failEchoWithDetails(FailEchoWithDetailsRequest $request, array $ * * The async variant is {@see EchoClient::pagedExpandAsync()} . * - * @example samples/V1beta1/EchoClient/paged_expand.php - * * @param PagedExpandRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -493,8 +491,6 @@ public function pagedExpand(PagedExpandRequest $request, array $callOptions = [] * * The async variant is {@see EchoClient::pagedExpandLegacyAsync()} . * - * @example samples/V1beta1/EchoClient/paged_expand_legacy.php - * * @param PagedExpandLegacyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -525,8 +521,6 @@ public function pagedExpandLegacy(PagedExpandLegacyRequest $request, array $call * * The async variant is {@see EchoClient::pagedExpandLegacyMappedAsync()} . * - * @example samples/V1beta1/EchoClient/paged_expand_legacy_mapped.php - * * @param PagedExpandRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -537,15 +531,15 @@ public function pagedExpandLegacy(PagedExpandLegacyRequest $request, array $call * {@see RetrySettings} for example usage. * } * - * @return PagedListResponse + * @return PagedExpandLegacyMappedResponse * * @throws ApiException Thrown if the API call fails. * * @experimental */ - public function pagedExpandLegacyMapped(PagedExpandRequest $request, array $callOptions = []): PagedListResponse + public function pagedExpandLegacyMapped(PagedExpandRequest $request, array $callOptions = []): PagedExpandLegacyMappedResponse { - return $this->startApiCall('PagedExpandLegacyMapped', $request, $callOptions); + return $this->startApiCall('PagedExpandLegacyMapped', $request, $callOptions)->wait(); } /** @@ -554,8 +548,6 @@ public function pagedExpandLegacyMapped(PagedExpandRequest $request, array $call * * The async variant is {@see EchoClient::waitAsync()} . * - * @example samples/V1beta1/EchoClient/wait.php - * * @param WaitRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -566,7 +558,7 @@ public function pagedExpandLegacyMapped(PagedExpandRequest $request, array $call * {@see RetrySettings} for example usage. * } * - * @return OperationResponse + * @return OperationResponse * * @throws ApiException Thrown if the API call fails. * diff --git a/Gax/tests/Conformance/src/V1beta1/Client/IdentityClient.php b/Gax/tests/Conformance/src/V1beta1/Client/IdentityClient.php index 01c047823a4c..34e35374484c 100644 --- a/Gax/tests/Conformance/src/V1beta1/Client/IdentityClient.php +++ b/Gax/tests/Conformance/src/V1beta1/Client/IdentityClient.php @@ -1,6 +1,6 @@ :". Default 'localhost:7469: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. - * *Important*: If you accept a credential configuration (credential - * JSON/File/Stream) from an external source for authentication to Google Cloud - * Platform, you must validate it before providing it to any Google API or library. - * Providing an unvalidated credential configuration to Google APIs can compromise - * the security of your systems and data. For more information {@see + * @type FetchAuthTokenInterface|CredentialsWrapper $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. + * **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 + * of your systems and data. It is recommended to create the credentials explicitly + * ``` + * use Google\Auth\Credentials\ServiceAccountCredentials; + * use Google\Showcase\V1beta1\IdentityClient; + * $creds = new ServiceAccountCredentials($scopes, $json); + * $options = new IdentityClient(['credentials' => $creds]); + * ``` + * {@see * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} * @type array $credentialsConfig * Options used to configure credentials, including auth token caching, for the @@ -204,13 +212,15 @@ public static function parseName(string $formattedName, ?string $template = null * @type false|LoggerInterface $logger * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * @type string $universeDomain + * The service domain for the client. Defaults to 'googleapis.com'. * } * * @throws ValidationException * * @experimental */ - public function __construct(array $options = []) + public function __construct(array|ClientOptions $options = []) { $clientOptions = $this->buildClientOptions($options); $this->setClientOptions($clientOptions); @@ -232,8 +242,6 @@ public function __call($method, $args) * * The async variant is {@see IdentityClient::createUserAsync()} . * - * @example samples/V1beta1/IdentityClient/create_user.php - * * @param CreateUserRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -260,8 +268,6 @@ public function createUser(CreateUserRequest $request, array $callOptions = []): * * The async variant is {@see IdentityClient::deleteUserAsync()} . * - * @example samples/V1beta1/IdentityClient/delete_user.php - * * @param DeleteUserRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -286,8 +292,6 @@ public function deleteUser(DeleteUserRequest $request, array $callOptions = []): * * The async variant is {@see IdentityClient::getUserAsync()} . * - * @example samples/V1beta1/IdentityClient/get_user.php - * * @param GetUserRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -314,8 +318,6 @@ public function getUser(GetUserRequest $request, array $callOptions = []): User * * The async variant is {@see IdentityClient::listUsersAsync()} . * - * @example samples/V1beta1/IdentityClient/list_users.php - * * @param ListUsersRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -342,8 +344,6 @@ public function listUsers(ListUsersRequest $request, array $callOptions = []): P * * The async variant is {@see IdentityClient::updateUserAsync()} . * - * @example samples/V1beta1/IdentityClient/update_user.php - * * @param UpdateUserRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Gax/tests/Conformance/src/V1beta1/Client/MessagingClient.php b/Gax/tests/Conformance/src/V1beta1/Client/MessagingClient.php index 6acea6553826..cdec8b538508 100644 --- a/Gax/tests/Conformance/src/V1beta1/Client/MessagingClient.php +++ b/Gax/tests/Conformance/src/V1beta1/Client/MessagingClient.php @@ -1,6 +1,6 @@ descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $options = $this->descriptors[$methodName]['longRunning'] ?? []; $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); $operation->reload(); return $operation; @@ -184,16 +191,18 @@ private function createOperationsClient(array $options) * resource. * * @param string $user + * @param string $legacyUser * @param string $blurb * * @return string The formatted blurb resource. * * @experimental */ - public static function blurbName(string $user, string $blurb): string + public static function blurbName(string $user, string $legacyUser, string $blurb): string { return self::getPathTemplate('blurb')->render([ 'user' => $user, + 'legacy_user' => $legacyUser, 'blurb' => $blurb, ]); } @@ -234,25 +243,6 @@ public static function roomBlurbName(string $room, string $blurb): string ]); } - /** - * Formats a string containing the fully-qualified path to represent a - * room_legacy_room resource. - * - * @param string $room - * @param string $legacyRoom - * - * @return string The formatted room_legacy_room resource. - * - * @experimental - */ - public static function roomLegacyRoomName(string $room, string $legacyRoom): string - { - return self::getPathTemplate('roomLegacyRoom')->render([ - 'room' => $room, - 'legacy_room' => $legacyRoom, - ]); - } - /** * Formats a string containing the fully-qualified path to represent a * room_legacy_room_blurb resource. @@ -312,22 +302,22 @@ public static function userBlurbName(string $user, string $blurb): string /** * Formats a string containing the fully-qualified path to represent a - * user_blurb_legacy_user resource. + * user_legacy_user_blurb resource. * * @param string $user - * @param string $blurb * @param string $legacyUser + * @param string $blurb * - * @return string The formatted user_blurb_legacy_user resource. + * @return string The formatted user_legacy_user_blurb resource. * * @experimental */ - public static function userBlurbLegacyUserName(string $user, string $blurb, string $legacyUser): string + public static function userLegacyUserBlurbName(string $user, string $legacyUser, string $blurb): string { - return self::getPathTemplate('userBlurbLegacyUser')->render([ + return self::getPathTemplate('userLegacyUserBlurb')->render([ 'user' => $user, - 'blurb' => $blurb, 'legacy_user' => $legacyUser, + 'blurb' => $blurb, ]); } @@ -335,14 +325,13 @@ public static function userBlurbLegacyUserName(string $user, string $blurb, stri * Parses a formatted name string and returns an associative array of the components in the name. * The following name formats are supported: * Template: Pattern - * - blurb: users/{user}/blurbs/{blurb} + * - blurb: users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb} * - room: rooms/{room} * - roomBlurb: rooms/{room}/blurbs/{blurb} - * - roomLegacyRoom: rooms/{room}/legacy_room/{legacy_room} - * - roomLegacyRoomBlurb: rooms/{room}/legacy_room/{legacy_room}/blurbs/{blurb} + * - roomLegacyRoomBlurb: rooms/{room}/blurbs/legacy/{legacy_room}.{blurb} * - user: users/{user} - * - userBlurb: users/{user}/blurbs/{blurb} - * - userBlurbLegacyUser: users/{user}/blurbs/{blurb}/legacy/{legacy_user} + * - userBlurb: users/{user}/profile/blurbs/{blurb} + * - userLegacyUserBlurb: users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb} * * The optional $template argument can be supplied to specify a particular pattern, * and must match one of the templates listed above. If no $template argument is @@ -367,25 +356,28 @@ public static function parseName(string $formattedName, ?string $template = null /** * Constructor. * - * @param array $options { + * @param array|ClientOptions $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 'localhost:7469: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. - * *Important*: If you accept a credential configuration (credential - * JSON/File/Stream) from an external source for authentication to Google Cloud - * Platform, you must validate it before providing it to any Google API or library. - * Providing an unvalidated credential configuration to Google APIs can compromise - * the security of your systems and data. For more information {@see + * @type FetchAuthTokenInterface|CredentialsWrapper $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. + * **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 + * of your systems and data. It is recommended to create the credentials explicitly + * ``` + * use Google\Auth\Credentials\ServiceAccountCredentials; + * use Google\Showcase\V1beta1\MessagingClient; + * $creds = new ServiceAccountCredentials($scopes, $json); + * $options = new MessagingClient(['credentials' => $creds]); + * ``` + * {@see * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} * @type array $credentialsConfig * Options used to configure credentials, including auth token caching, for the @@ -423,13 +415,15 @@ public static function parseName(string $formattedName, ?string $template = null * @type false|LoggerInterface $logger * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * @type string $universeDomain + * The service domain for the client. Defaults to 'googleapis.com'. * } * * @throws ValidationException * * @experimental */ - public function __construct(array $options = []) + public function __construct(array|ClientOptions $options = []) { $clientOptions = $this->buildClientOptions($options); $this->setClientOptions($clientOptions); @@ -453,8 +447,6 @@ public function __call($method, $args) * blurbs. If an invalid blurb is requested to be created, the stream will * close with an error. * - * @example samples/V1beta1/MessagingClient/connect.php - * * @param array $callOptions { * Optional. * @@ -480,8 +472,6 @@ public function connect(array $callOptions = []): BidiStream * * The async variant is {@see MessagingClient::createBlurbAsync()} . * - * @example samples/V1beta1/MessagingClient/create_blurb.php - * * @param CreateBlurbRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -508,8 +498,6 @@ public function createBlurb(CreateBlurbRequest $request, array $callOptions = [] * * The async variant is {@see MessagingClient::createRoomAsync()} . * - * @example samples/V1beta1/MessagingClient/create_room.php - * * @param CreateRoomRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -536,8 +524,6 @@ public function createRoom(CreateRoomRequest $request, array $callOptions = []): * * The async variant is {@see MessagingClient::deleteBlurbAsync()} . * - * @example samples/V1beta1/MessagingClient/delete_blurb.php - * * @param DeleteBlurbRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -562,8 +548,6 @@ public function deleteBlurb(DeleteBlurbRequest $request, array $callOptions = [] * * The async variant is {@see MessagingClient::deleteRoomAsync()} . * - * @example samples/V1beta1/MessagingClient/delete_room.php - * * @param DeleteRoomRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -588,8 +572,6 @@ public function deleteRoom(DeleteRoomRequest $request, array $callOptions = []): * * The async variant is {@see MessagingClient::getBlurbAsync()} . * - * @example samples/V1beta1/MessagingClient/get_blurb.php - * * @param GetBlurbRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -616,8 +598,6 @@ public function getBlurb(GetBlurbRequest $request, array $callOptions = []): Blu * * The async variant is {@see MessagingClient::getRoomAsync()} . * - * @example samples/V1beta1/MessagingClient/get_room.php - * * @param GetRoomRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -645,8 +625,6 @@ public function getRoom(GetRoomRequest $request, array $callOptions = []): Room * * The async variant is {@see MessagingClient::listBlurbsAsync()} . * - * @example samples/V1beta1/MessagingClient/list_blurbs.php - * * @param ListBlurbsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -673,8 +651,6 @@ public function listBlurbs(ListBlurbsRequest $request, array $callOptions = []): * * The async variant is {@see MessagingClient::listRoomsAsync()} . * - * @example samples/V1beta1/MessagingClient/list_rooms.php - * * @param ListRoomsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -703,8 +679,6 @@ public function listRooms(ListRoomsRequest $request, array $callOptions = []): P * * The async variant is {@see MessagingClient::searchBlurbsAsync()} . * - * @example samples/V1beta1/MessagingClient/search_blurbs.php - * * @param SearchBlurbsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -715,7 +689,7 @@ public function listRooms(ListRoomsRequest $request, array $callOptions = []): P * {@see RetrySettings} for example usage. * } * - * @return OperationResponse + * @return OperationResponse * * @throws ApiException Thrown if the API call fails. * @@ -730,8 +704,6 @@ public function searchBlurbs(SearchBlurbsRequest $request, array $callOptions = * This is a stream to create multiple blurbs. If an invalid blurb is * requested to be created, the stream will close with an error. * - * @example samples/V1beta1/MessagingClient/send_blurbs.php - * * @param array $callOptions { * Optional. * @@ -754,8 +726,6 @@ public function sendBlurbs(array $callOptions = []): ClientStream * This returns a stream that emits the blurbs that are created for a * particular chat room or user profile. * - * @example samples/V1beta1/MessagingClient/stream_blurbs.php - * * @param StreamBlurbsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -764,7 +734,7 @@ public function sendBlurbs(array $callOptions = []): ClientStream * Timeout to use for this call. * } * - * @return ServerStream + * @return ServerStream * * @throws ApiException Thrown if the API call fails. * @@ -780,8 +750,6 @@ public function streamBlurbs(StreamBlurbsRequest $request, array $callOptions = * * The async variant is {@see MessagingClient::updateBlurbAsync()} . * - * @example samples/V1beta1/MessagingClient/update_blurb.php - * * @param UpdateBlurbRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -808,8 +776,6 @@ public function updateBlurb(UpdateBlurbRequest $request, array $callOptions = [] * * The async variant is {@see MessagingClient::updateRoomAsync()} . * - * @example samples/V1beta1/MessagingClient/update_room.php - * * @param UpdateRoomRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Gax/tests/Conformance/src/V1beta1/Client/SequenceServiceClient.php b/Gax/tests/Conformance/src/V1beta1/Client/SequenceServiceClient.php index f5f8681d1c76..1021c5153a22 100644 --- a/Gax/tests/Conformance/src/V1beta1/Client/SequenceServiceClient.php +++ b/Gax/tests/Conformance/src/V1beta1/Client/SequenceServiceClient.php @@ -1,6 +1,6 @@ :". Default 'localhost:7469: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. - * *Important*: If you accept a credential configuration (credential - * JSON/File/Stream) from an external source for authentication to Google Cloud - * Platform, you must validate it before providing it to any Google API or library. - * Providing an unvalidated credential configuration to Google APIs can compromise - * the security of your systems and data. For more information {@see + * @type FetchAuthTokenInterface|CredentialsWrapper $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. + * **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 + * of your systems and data. It is recommended to create the credentials explicitly + * ``` + * use Google\Auth\Credentials\ServiceAccountCredentials; + * use Google\Showcase\V1beta1\SequenceServiceClient; + * $creds = new ServiceAccountCredentials($scopes, $json); + * $options = new SequenceServiceClient(['credentials' => $creds]); + * ``` + * {@see * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} * @type array $credentialsConfig * Options used to configure credentials, including auth token caching, for the @@ -262,13 +272,15 @@ public static function parseName(string $formattedName, ?string $template = null * @type false|LoggerInterface $logger * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * @type string $universeDomain + * The service domain for the client. Defaults to 'googleapis.com'. * } * * @throws ValidationException * * @experimental */ - public function __construct(array $options = []) + public function __construct(array|ClientOptions $options = []) { $clientOptions = $this->buildClientOptions($options); $this->setClientOptions($clientOptions); @@ -286,12 +298,10 @@ public function __call($method, $args) } /** - * Attempts a sequence. + * Attempts a sequence of unary responses. * * The async variant is {@see SequenceServiceClient::attemptSequenceAsync()} . * - * @example samples/V1beta1/SequenceServiceClient/attempt_sequence.php - * * @param AttemptSequenceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -312,12 +322,11 @@ public function attemptSequence(AttemptSequenceRequest $request, array $callOpti } /** - * Attempts a streaming sequence. + * Attempts a server streaming call with a sequence of responses + * Can be used to test retries and stream resumption logic * May not function as expected in HTTP mode due to when http statuses are sent * See https://github.com/googleapis/gapic-showcase/issues/1377 for more details * - * @example samples/V1beta1/SequenceServiceClient/attempt_streaming_sequence.php - * * @param AttemptStreamingSequenceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -326,7 +335,7 @@ public function attemptSequence(AttemptSequenceRequest $request, array $callOpti * Timeout to use for this call. * } * - * @return ServerStream + * @return ServerStream * * @throws ApiException Thrown if the API call fails. * @@ -338,12 +347,10 @@ public function attemptStreamingSequence(AttemptStreamingSequenceRequest $reques } /** - * Creates a sequence. + * Create a sequence of responses to be returned as unary calls * * The async variant is {@see SequenceServiceClient::createSequenceAsync()} . * - * @example samples/V1beta1/SequenceServiceClient/create_sequence.php - * * @param CreateSequenceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -366,13 +373,11 @@ public function createSequence(CreateSequenceRequest $request, array $callOption } /** - * Creates a sequence. + * Creates a sequence of responses to be returned in a server streaming call * * The async variant is * {@see SequenceServiceClient::createStreamingSequenceAsync()} . * - * @example samples/V1beta1/SequenceServiceClient/create_streaming_sequence.php - * * @param CreateStreamingSequenceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -395,12 +400,11 @@ public function createStreamingSequence(CreateStreamingSequenceRequest $request, } /** - * Retrieves a sequence. + * Retrieves a sequence report which can be used to retrieve information about a + * sequence of unary calls. * * The async variant is {@see SequenceServiceClient::getSequenceReportAsync()} . * - * @example samples/V1beta1/SequenceServiceClient/get_sequence_report.php - * * @param GetSequenceReportRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -423,13 +427,12 @@ public function getSequenceReport(GetSequenceReportRequest $request, array $call } /** - * Retrieves a sequence. + * Retrieves a sequence report which can be used to retrieve information + * about a sequences of responses in a server streaming call. * * The async variant is * {@see SequenceServiceClient::getStreamingSequenceReportAsync()} . * - * @example samples/V1beta1/SequenceServiceClient/get_streaming_sequence_report.php - * * @param GetStreamingSequenceReportRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Gax/tests/Conformance/src/V1beta1/Client/TestingClient.php b/Gax/tests/Conformance/src/V1beta1/Client/TestingClient.php index 27f0778416a8..00b8ff916569 100644 --- a/Gax/tests/Conformance/src/V1beta1/Client/TestingClient.php +++ b/Gax/tests/Conformance/src/V1beta1/Client/TestingClient.php @@ -1,6 +1,6 @@ :". Default 'localhost:7469: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. - * *Important*: If you accept a credential configuration (credential - * JSON/File/Stream) from an external source for authentication to Google Cloud - * Platform, you must validate it before providing it to any Google API or library. - * Providing an unvalidated credential configuration to Google APIs can compromise - * the security of your systems and data. For more information {@see + * @type FetchAuthTokenInterface|CredentialsWrapper $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. + * **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 + * of your systems and data. It is recommended to create the credentials explicitly + * ``` + * use Google\Auth\Credentials\ServiceAccountCredentials; + * use Google\Showcase\V1beta1\TestingClient; + * $creds = new ServiceAccountCredentials($scopes, $json); + * $options = new TestingClient(['credentials' => $creds]); + * ``` + * {@see * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} * @type array $credentialsConfig * Options used to configure credentials, including auth token caching, for the @@ -236,13 +244,15 @@ public static function parseName(string $formattedName, ?string $template = null * @type false|LoggerInterface $logger * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * @type string $universeDomain + * The service domain for the client. Defaults to 'googleapis.com'. * } * * @throws ValidationException * * @experimental */ - public function __construct(array $options = []) + public function __construct(array|ClientOptions $options = []) { $clientOptions = $this->buildClientOptions($options); $this->setClientOptions($clientOptions); @@ -267,8 +277,6 @@ public function __call($method, $args) * * The async variant is {@see TestingClient::createSessionAsync()} . * - * @example samples/V1beta1/TestingClient/create_session.php - * * @param CreateSessionRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -295,8 +303,6 @@ public function createSession(CreateSessionRequest $request, array $callOptions * * The async variant is {@see TestingClient::deleteSessionAsync()} . * - * @example samples/V1beta1/TestingClient/delete_session.php - * * @param DeleteSessionRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -326,8 +332,6 @@ public function deleteSession(DeleteSessionRequest $request, array $callOptions * * The async variant is {@see TestingClient::deleteTestAsync()} . * - * @example samples/V1beta1/TestingClient/delete_test.php - * * @param DeleteTestRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -352,8 +356,6 @@ public function deleteTest(DeleteTestRequest $request, array $callOptions = []): * * The async variant is {@see TestingClient::getSessionAsync()} . * - * @example samples/V1beta1/TestingClient/get_session.php - * * @param GetSessionRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -380,8 +382,6 @@ public function getSession(GetSessionRequest $request, array $callOptions = []): * * The async variant is {@see TestingClient::listSessionsAsync()} . * - * @example samples/V1beta1/TestingClient/list_sessions.php - * * @param ListSessionsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -408,8 +408,6 @@ public function listSessions(ListSessionsRequest $request, array $callOptions = * * The async variant is {@see TestingClient::listTestsAsync()} . * - * @example samples/V1beta1/TestingClient/list_tests.php - * * @param ListTestsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -438,8 +436,6 @@ public function listTests(ListTestsRequest $request, array $callOptions = []): P * * The async variant is {@see TestingClient::reportSessionAsync()} . * - * @example samples/V1beta1/TestingClient/report_session.php - * * @param ReportSessionRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -469,8 +465,6 @@ public function reportSession(ReportSessionRequest $request, array $callOptions * * The async variant is {@see TestingClient::verifyTestAsync()} . * - * @example samples/V1beta1/TestingClient/verify_test.php - * * @param VerifyTestRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Gax/tests/Conformance/src/V1beta1/ComplianceData.php b/Gax/tests/Conformance/src/V1beta1/ComplianceData.php index 68891e78a876..18dce8f90154 100644 --- a/Gax/tests/Conformance/src/V1beta1/ComplianceData.php +++ b/Gax/tests/Conformance/src/V1beta1/ComplianceData.php @@ -1,12 +1,13 @@ optional int32 p_int32 = 18; */ protected $p_int32 = null; + /** + * Generated from protobuf field optional sint32 p_sint32 = 39; + */ + protected $p_sint32 = null; + /** + * Generated from protobuf field optional sfixed32 p_sfixed32 = 40; + */ + protected $p_sfixed32 = null; + /** + * Generated from protobuf field optional uint32 p_uint32 = 41; + */ + protected $p_uint32 = null; + /** + * Generated from protobuf field optional fixed32 p_fixed32 = 42; + */ + protected $p_fixed32 = null; + /** + * Generated from protobuf field optional int64 p_int64 = 43; + */ + protected $p_int64 = null; + /** + * Generated from protobuf field optional sint64 p_sint64 = 44; + */ + protected $p_sint64 = null; + /** + * Generated from protobuf field optional sfixed64 p_sfixed64 = 45; + */ + protected $p_sfixed64 = null; + /** + * Generated from protobuf field optional uint64 p_uint64 = 46; + */ + protected $p_uint64 = null; + /** + * Generated from protobuf field optional fixed64 p_fixed64 = 47; + */ + protected $p_fixed64 = null; + /** + * Generated from protobuf field optional float p_float = 48; + */ + protected $p_float = null; /** * Generated from protobuf field optional double p_double = 19; */ @@ -134,6 +175,16 @@ class ComplianceData extends \Google\Protobuf\Internal\Message * @type \Google\Showcase\V1beta1\ComplianceDataChild $f_child * @type string $p_string * @type int $p_int32 + * @type int $p_sint32 + * @type int $p_sfixed32 + * @type int $p_uint32 + * @type int $p_fixed32 + * @type int|string $p_int64 + * @type int|string $p_sint64 + * @type int|string $p_sfixed64 + * @type int|string $p_uint64 + * @type int|string $p_fixed64 + * @type float $p_float * @type float $p_double * @type bool $p_bool * @type int $p_kingdom @@ -159,9 +210,9 @@ public function getFString() * @param string $var * @return $this */ - public function setFString($var) + public function setFString(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->f_string = $var; return $this; @@ -181,7 +232,7 @@ public function getFInt32() * @param int $var * @return $this */ - public function setFInt32($var) + public function setFInt32(int $var) { GPBUtil::checkInt32($var); $this->f_int32 = $var; @@ -203,7 +254,7 @@ public function getFSint32() * @param int $var * @return $this */ - public function setFSint32($var) + public function setFSint32(int $var) { GPBUtil::checkInt32($var); $this->f_sint32 = $var; @@ -225,7 +276,7 @@ public function getFSfixed32() * @param int $var * @return $this */ - public function setFSfixed32($var) + public function setFSfixed32(int $var) { GPBUtil::checkInt32($var); $this->f_sfixed32 = $var; @@ -247,7 +298,7 @@ public function getFUint32() * @param int $var * @return $this */ - public function setFUint32($var) + public function setFUint32(int $var) { GPBUtil::checkUint32($var); $this->f_uint32 = $var; @@ -269,7 +320,7 @@ public function getFFixed32() * @param int $var * @return $this */ - public function setFFixed32($var) + public function setFFixed32(int $var) { GPBUtil::checkUint32($var); $this->f_fixed32 = $var; @@ -291,7 +342,7 @@ public function getFInt64() * @param int|string $var * @return $this */ - public function setFInt64($var) + public function setFInt64(int|string $var) { GPBUtil::checkInt64($var); $this->f_int64 = $var; @@ -313,7 +364,7 @@ public function getFSint64() * @param int|string $var * @return $this */ - public function setFSint64($var) + public function setFSint64(int|string $var) { GPBUtil::checkInt64($var); $this->f_sint64 = $var; @@ -335,7 +386,7 @@ public function getFSfixed64() * @param int|string $var * @return $this */ - public function setFSfixed64($var) + public function setFSfixed64(int|string $var) { GPBUtil::checkInt64($var); $this->f_sfixed64 = $var; @@ -357,7 +408,7 @@ public function getFUint64() * @param int|string $var * @return $this */ - public function setFUint64($var) + public function setFUint64(int|string $var) { GPBUtil::checkUint64($var); $this->f_uint64 = $var; @@ -379,7 +430,7 @@ public function getFFixed64() * @param int|string $var * @return $this */ - public function setFFixed64($var) + public function setFFixed64(int|string $var) { GPBUtil::checkUint64($var); $this->f_fixed64 = $var; @@ -401,9 +452,8 @@ public function getFDouble() * @param float $var * @return $this */ - public function setFDouble($var) + public function setFDouble(float $var) { - GPBUtil::checkDouble($var); $this->f_double = $var; return $this; @@ -423,9 +473,8 @@ public function getFFloat() * @param float $var * @return $this */ - public function setFFloat($var) + public function setFFloat(float $var) { - GPBUtil::checkFloat($var); $this->f_float = $var; return $this; @@ -445,9 +494,8 @@ public function getFBool() * @param bool $var * @return $this */ - public function setFBool($var) + public function setFBool(bool $var) { - GPBUtil::checkBool($var); $this->f_bool = $var; return $this; @@ -467,9 +515,9 @@ public function getFBytes() * @param string $var * @return $this */ - public function setFBytes($var) + public function setFBytes(string $var) { - GPBUtil::checkString($var, False); + GPBUtil::checkString($var, false); $this->f_bytes = $var; return $this; @@ -477,7 +525,7 @@ public function setFBytes($var) /** * Generated from protobuf field .google.showcase.v1beta1.ComplianceData.LifeKingdom f_kingdom = 22; - * @return int + * @return int one of the values in {@see \Google\Showcase\V1beta1\ComplianceData\LifeKingdom} */ public function getFKingdom() { @@ -486,10 +534,10 @@ public function getFKingdom() /** * Generated from protobuf field .google.showcase.v1beta1.ComplianceData.LifeKingdom f_kingdom = 22; - * @param int $var + * @param int $var one of the values in {@see \Google\Showcase\V1beta1\ComplianceData\LifeKingdom} * @return $this */ - public function setFKingdom($var) + public function setFKingdom(int $var) { GPBUtil::checkEnum($var, \Google\Showcase\V1beta1\ComplianceData\LifeKingdom::class); $this->f_kingdom = $var; @@ -521,9 +569,8 @@ public function clearFChild() * @param \Google\Showcase\V1beta1\ComplianceDataChild $var * @return $this */ - public function setFChild($var) + public function setFChild(\Google\Showcase\V1beta1\ComplianceDataChild|null $var) { - GPBUtil::checkMessage($var, \Google\Showcase\V1beta1\ComplianceDataChild::class); $this->f_child = $var; return $this; @@ -553,9 +600,9 @@ public function clearPString() * @param string $var * @return $this */ - public function setPString($var) + public function setPString(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->p_string = $var; return $this; @@ -585,7 +632,7 @@ public function clearPInt32() * @param int $var * @return $this */ - public function setPInt32($var) + public function setPInt32(int $var) { GPBUtil::checkInt32($var); $this->p_int32 = $var; @@ -593,6 +640,325 @@ public function setPInt32($var) return $this; } + /** + * Generated from protobuf field optional sint32 p_sint32 = 39; + * @return int + */ + public function getPSint32() + { + return isset($this->p_sint32) ? $this->p_sint32 : 0; + } + + public function hasPSint32() + { + return isset($this->p_sint32); + } + + public function clearPSint32() + { + unset($this->p_sint32); + } + + /** + * Generated from protobuf field optional sint32 p_sint32 = 39; + * @param int $var + * @return $this + */ + public function setPSint32(int $var) + { + GPBUtil::checkInt32($var); + $this->p_sint32 = $var; + + return $this; + } + + /** + * Generated from protobuf field optional sfixed32 p_sfixed32 = 40; + * @return int + */ + public function getPSfixed32() + { + return isset($this->p_sfixed32) ? $this->p_sfixed32 : 0; + } + + public function hasPSfixed32() + { + return isset($this->p_sfixed32); + } + + public function clearPSfixed32() + { + unset($this->p_sfixed32); + } + + /** + * Generated from protobuf field optional sfixed32 p_sfixed32 = 40; + * @param int $var + * @return $this + */ + public function setPSfixed32(int $var) + { + GPBUtil::checkInt32($var); + $this->p_sfixed32 = $var; + + return $this; + } + + /** + * Generated from protobuf field optional uint32 p_uint32 = 41; + * @return int + */ + public function getPUint32() + { + return isset($this->p_uint32) ? $this->p_uint32 : 0; + } + + public function hasPUint32() + { + return isset($this->p_uint32); + } + + public function clearPUint32() + { + unset($this->p_uint32); + } + + /** + * Generated from protobuf field optional uint32 p_uint32 = 41; + * @param int $var + * @return $this + */ + public function setPUint32(int $var) + { + GPBUtil::checkUint32($var); + $this->p_uint32 = $var; + + return $this; + } + + /** + * Generated from protobuf field optional fixed32 p_fixed32 = 42; + * @return int + */ + public function getPFixed32() + { + return isset($this->p_fixed32) ? $this->p_fixed32 : 0; + } + + public function hasPFixed32() + { + return isset($this->p_fixed32); + } + + public function clearPFixed32() + { + unset($this->p_fixed32); + } + + /** + * Generated from protobuf field optional fixed32 p_fixed32 = 42; + * @param int $var + * @return $this + */ + public function setPFixed32(int $var) + { + GPBUtil::checkUint32($var); + $this->p_fixed32 = $var; + + return $this; + } + + /** + * Generated from protobuf field optional int64 p_int64 = 43; + * @return int|string + */ + public function getPInt64() + { + return isset($this->p_int64) ? $this->p_int64 : GPBUtil::compatibleInt64(0, '0'); + } + + public function hasPInt64() + { + return isset($this->p_int64); + } + + public function clearPInt64() + { + unset($this->p_int64); + } + + /** + * Generated from protobuf field optional int64 p_int64 = 43; + * @param int|string $var + * @return $this + */ + public function setPInt64(int|string $var) + { + GPBUtil::checkInt64($var); + $this->p_int64 = $var; + + return $this; + } + + /** + * Generated from protobuf field optional sint64 p_sint64 = 44; + * @return int|string + */ + public function getPSint64() + { + return isset($this->p_sint64) ? $this->p_sint64 : GPBUtil::compatibleInt64(0, '0'); + } + + public function hasPSint64() + { + return isset($this->p_sint64); + } + + public function clearPSint64() + { + unset($this->p_sint64); + } + + /** + * Generated from protobuf field optional sint64 p_sint64 = 44; + * @param int|string $var + * @return $this + */ + public function setPSint64(int|string $var) + { + GPBUtil::checkInt64($var); + $this->p_sint64 = $var; + + return $this; + } + + /** + * Generated from protobuf field optional sfixed64 p_sfixed64 = 45; + * @return int|string + */ + public function getPSfixed64() + { + return isset($this->p_sfixed64) ? $this->p_sfixed64 : GPBUtil::compatibleInt64(0, '0'); + } + + public function hasPSfixed64() + { + return isset($this->p_sfixed64); + } + + public function clearPSfixed64() + { + unset($this->p_sfixed64); + } + + /** + * Generated from protobuf field optional sfixed64 p_sfixed64 = 45; + * @param int|string $var + * @return $this + */ + public function setPSfixed64(int|string $var) + { + GPBUtil::checkInt64($var); + $this->p_sfixed64 = $var; + + return $this; + } + + /** + * Generated from protobuf field optional uint64 p_uint64 = 46; + * @return int|string + */ + public function getPUint64() + { + return isset($this->p_uint64) ? $this->p_uint64 : GPBUtil::compatibleInt64(0, '0'); + } + + public function hasPUint64() + { + return isset($this->p_uint64); + } + + public function clearPUint64() + { + unset($this->p_uint64); + } + + /** + * Generated from protobuf field optional uint64 p_uint64 = 46; + * @param int|string $var + * @return $this + */ + public function setPUint64(int|string $var) + { + GPBUtil::checkUint64($var); + $this->p_uint64 = $var; + + return $this; + } + + /** + * Generated from protobuf field optional fixed64 p_fixed64 = 47; + * @return int|string + */ + public function getPFixed64() + { + return isset($this->p_fixed64) ? $this->p_fixed64 : GPBUtil::compatibleInt64(0, '0'); + } + + public function hasPFixed64() + { + return isset($this->p_fixed64); + } + + public function clearPFixed64() + { + unset($this->p_fixed64); + } + + /** + * Generated from protobuf field optional fixed64 p_fixed64 = 47; + * @param int|string $var + * @return $this + */ + public function setPFixed64(int|string $var) + { + GPBUtil::checkUint64($var); + $this->p_fixed64 = $var; + + return $this; + } + + /** + * Generated from protobuf field optional float p_float = 48; + * @return float + */ + public function getPFloat() + { + return isset($this->p_float) ? $this->p_float : 0.0; + } + + public function hasPFloat() + { + return isset($this->p_float); + } + + public function clearPFloat() + { + unset($this->p_float); + } + + /** + * Generated from protobuf field optional float p_float = 48; + * @param float $var + * @return $this + */ + public function setPFloat(float $var) + { + $this->p_float = $var; + + return $this; + } + /** * Generated from protobuf field optional double p_double = 19; * @return float @@ -617,9 +983,8 @@ public function clearPDouble() * @param float $var * @return $this */ - public function setPDouble($var) + public function setPDouble(float $var) { - GPBUtil::checkDouble($var); $this->p_double = $var; return $this; @@ -649,9 +1014,8 @@ public function clearPBool() * @param bool $var * @return $this */ - public function setPBool($var) + public function setPBool(bool $var) { - GPBUtil::checkBool($var); $this->p_bool = $var; return $this; @@ -659,7 +1023,7 @@ public function setPBool($var) /** * Generated from protobuf field optional .google.showcase.v1beta1.ComplianceData.LifeKingdom p_kingdom = 23; - * @return int + * @return int one of the values in {@see \Google\Showcase\V1beta1\ComplianceData\LifeKingdom} */ public function getPKingdom() { @@ -678,10 +1042,10 @@ public function clearPKingdom() /** * Generated from protobuf field optional .google.showcase.v1beta1.ComplianceData.LifeKingdom p_kingdom = 23; - * @param int $var + * @param int $var one of the values in {@see \Google\Showcase\V1beta1\ComplianceData\LifeKingdom} * @return $this */ - public function setPKingdom($var) + public function setPKingdom(int $var) { GPBUtil::checkEnum($var, \Google\Showcase\V1beta1\ComplianceData\LifeKingdom::class); $this->p_kingdom = $var; @@ -713,9 +1077,8 @@ public function clearPChild() * @param \Google\Showcase\V1beta1\ComplianceDataChild $var * @return $this */ - public function setPChild($var) + public function setPChild(\Google\Showcase\V1beta1\ComplianceDataChild|null $var) { - GPBUtil::checkMessage($var, \Google\Showcase\V1beta1\ComplianceDataChild::class); $this->p_child = $var; return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/ComplianceData/LifeKingdom.php b/Gax/tests/Conformance/src/V1beta1/ComplianceData/LifeKingdom.php index 3a9ad08eebaf..ec5684eb9c4f 100644 --- a/Gax/tests/Conformance/src/V1beta1/ComplianceData/LifeKingdom.php +++ b/Gax/tests/Conformance/src/V1beta1/ComplianceData/LifeKingdom.php @@ -1,5 +1,6 @@ google.showcase.v1beta1.ComplianceDataChild @@ -101,9 +102,9 @@ public function getFString() * @param string $var * @return $this */ - public function setFString($var) + public function setFString(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->f_string = $var; return $this; @@ -123,9 +124,8 @@ public function getFFloat() * @param float $var * @return $this */ - public function setFFloat($var) + public function setFFloat(float $var) { - GPBUtil::checkFloat($var); $this->f_float = $var; return $this; @@ -145,9 +145,8 @@ public function getFDouble() * @param float $var * @return $this */ - public function setFDouble($var) + public function setFDouble(float $var) { - GPBUtil::checkDouble($var); $this->f_double = $var; return $this; @@ -167,9 +166,8 @@ public function getFBool() * @param bool $var * @return $this */ - public function setFBool($var) + public function setFBool(bool $var) { - GPBUtil::checkBool($var); $this->f_bool = $var; return $this; @@ -177,7 +175,7 @@ public function setFBool($var) /** * Generated from protobuf field .google.showcase.v1beta1.Continent f_continent = 11; - * @return int + * @return int one of the values in {@see \Google\Showcase\V1beta1\Continent} */ public function getFContinent() { @@ -186,10 +184,10 @@ public function getFContinent() /** * Generated from protobuf field .google.showcase.v1beta1.Continent f_continent = 11; - * @param int $var + * @param int $var one of the values in {@see \Google\Showcase\V1beta1\Continent} * @return $this */ - public function setFContinent($var) + public function setFContinent(int $var) { GPBUtil::checkEnum($var, \Google\Showcase\V1beta1\Continent::class); $this->f_continent = $var; @@ -221,9 +219,8 @@ public function clearFChild() * @param \Google\Showcase\V1beta1\ComplianceDataGrandchild $var * @return $this */ - public function setFChild($var) + public function setFChild(\Google\Showcase\V1beta1\ComplianceDataGrandchild|null $var) { - GPBUtil::checkMessage($var, \Google\Showcase\V1beta1\ComplianceDataGrandchild::class); $this->f_child = $var; return $this; @@ -253,9 +250,9 @@ public function clearPString() * @param string $var * @return $this */ - public function setPString($var) + public function setPString(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->p_string = $var; return $this; @@ -285,9 +282,8 @@ public function clearPFloat() * @param float $var * @return $this */ - public function setPFloat($var) + public function setPFloat(float $var) { - GPBUtil::checkFloat($var); $this->p_float = $var; return $this; @@ -317,9 +313,8 @@ public function clearPDouble() * @param float $var * @return $this */ - public function setPDouble($var) + public function setPDouble(float $var) { - GPBUtil::checkDouble($var); $this->p_double = $var; return $this; @@ -349,9 +344,8 @@ public function clearPBool() * @param bool $var * @return $this */ - public function setPBool($var) + public function setPBool(bool $var) { - GPBUtil::checkBool($var); $this->p_bool = $var; return $this; @@ -359,7 +353,7 @@ public function setPBool($var) /** * Generated from protobuf field .google.showcase.v1beta1.Continent p_continent = 12; - * @return int + * @return int one of the values in {@see \Google\Showcase\V1beta1\Continent} */ public function getPContinent() { @@ -368,10 +362,10 @@ public function getPContinent() /** * Generated from protobuf field .google.showcase.v1beta1.Continent p_continent = 12; - * @param int $var + * @param int $var one of the values in {@see \Google\Showcase\V1beta1\Continent} * @return $this */ - public function setPContinent($var) + public function setPContinent(int $var) { GPBUtil::checkEnum($var, \Google\Showcase\V1beta1\Continent::class); $this->p_continent = $var; @@ -403,9 +397,8 @@ public function clearPChild() * @param \Google\Showcase\V1beta1\ComplianceDataGrandchild $var * @return $this */ - public function setPChild($var) + public function setPChild(\Google\Showcase\V1beta1\ComplianceDataGrandchild|null $var) { - GPBUtil::checkMessage($var, \Google\Showcase\V1beta1\ComplianceDataGrandchild::class); $this->p_child = $var; return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/ComplianceDataGrandchild.php b/Gax/tests/Conformance/src/V1beta1/ComplianceDataGrandchild.php index d0a12353e381..29e4922bd581 100644 --- a/Gax/tests/Conformance/src/V1beta1/ComplianceDataGrandchild.php +++ b/Gax/tests/Conformance/src/V1beta1/ComplianceDataGrandchild.php @@ -1,12 +1,13 @@ google.showcase.v1beta1.ComplianceDataGrandchild @@ -56,9 +57,9 @@ public function getFString() * @param string $var * @return $this */ - public function setFString($var) + public function setFString(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->f_string = $var; return $this; @@ -78,9 +79,8 @@ public function getFDouble() * @param float $var * @return $this */ - public function setFDouble($var) + public function setFDouble(float $var) { - GPBUtil::checkDouble($var); $this->f_double = $var; return $this; @@ -100,9 +100,8 @@ public function getFBool() * @param bool $var * @return $this */ - public function setFBool($var) + public function setFBool(bool $var) { - GPBUtil::checkBool($var); $this->f_bool = $var; return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/ComplianceGroup.php b/Gax/tests/Conformance/src/V1beta1/ComplianceGroup.php index 90c88454c74c..9231556228b5 100644 --- a/Gax/tests/Conformance/src/V1beta1/ComplianceGroup.php +++ b/Gax/tests/Conformance/src/V1beta1/ComplianceGroup.php @@ -1,12 +1,13 @@ |\Google\Protobuf\Internal\RepeatedField $rpcs - * @type array<\Google\Showcase\V1beta1\RepeatRequest>|\Google\Protobuf\Internal\RepeatedField $requests + * @type string[] $rpcs + * @type \Google\Showcase\V1beta1\RepeatRequest[] $requests * } */ public function __construct($data = NULL) { @@ -60,9 +61,9 @@ public function getName() * @param string $var * @return $this */ - public function setName($var) + public function setName(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->name = $var; return $this; @@ -70,7 +71,7 @@ public function setName($var) /** * Generated from protobuf field repeated string rpcs = 2; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField */ public function getRpcs() { @@ -79,10 +80,10 @@ public function getRpcs() /** * Generated from protobuf field repeated string rpcs = 2; - * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @param string[] $var * @return $this */ - public function setRpcs($var) + public function setRpcs(array|RepeatedField $var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); $this->rpcs = $arr; @@ -92,7 +93,7 @@ public function setRpcs($var) /** * Generated from protobuf field repeated .google.showcase.v1beta1.RepeatRequest requests = 3; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField<\Google\Showcase\V1beta1\RepeatRequest> */ public function getRequests() { @@ -101,10 +102,10 @@ public function getRequests() /** * Generated from protobuf field repeated .google.showcase.v1beta1.RepeatRequest requests = 3; - * @param array<\Google\Showcase\V1beta1\RepeatRequest>|\Google\Protobuf\Internal\RepeatedField $var + * @param \Google\Showcase\V1beta1\RepeatRequest[] $var * @return $this */ - public function setRequests($var) + public function setRequests(array|RepeatedField $var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Showcase\V1beta1\RepeatRequest::class); $this->requests = $arr; diff --git a/Gax/tests/Conformance/src/V1beta1/ComplianceSuite.php b/Gax/tests/Conformance/src/V1beta1/ComplianceSuite.php index eb7f3841151d..af58c4872daa 100644 --- a/Gax/tests/Conformance/src/V1beta1/ComplianceSuite.php +++ b/Gax/tests/Conformance/src/V1beta1/ComplianceSuite.php @@ -1,12 +1,13 @@ |\Google\Protobuf\Internal\RepeatedField $group + * @type \Google\Showcase\V1beta1\ComplianceGroup[] $group * } */ public function __construct($data = NULL) { @@ -38,7 +39,7 @@ public function __construct($data = NULL) { /** * Generated from protobuf field repeated .google.showcase.v1beta1.ComplianceGroup group = 1; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField<\Google\Showcase\V1beta1\ComplianceGroup> */ public function getGroup() { @@ -47,10 +48,10 @@ public function getGroup() /** * Generated from protobuf field repeated .google.showcase.v1beta1.ComplianceGroup group = 1; - * @param array<\Google\Showcase\V1beta1\ComplianceGroup>|\Google\Protobuf\Internal\RepeatedField $var + * @param \Google\Showcase\V1beta1\ComplianceGroup[] $var * @return $this */ - public function setGroup($var) + public function setGroup(array|RepeatedField $var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Showcase\V1beta1\ComplianceGroup::class); $this->group = $arr; diff --git a/Gax/tests/Conformance/src/V1beta1/ConnectRequest.php b/Gax/tests/Conformance/src/V1beta1/ConnectRequest.php index 1b5275e023c1..91b53be375f2 100644 --- a/Gax/tests/Conformance/src/V1beta1/ConnectRequest.php +++ b/Gax/tests/Conformance/src/V1beta1/ConnectRequest.php @@ -1,12 +1,13 @@ writeOneof(1, $var); return $this; @@ -92,9 +92,8 @@ public function hasBlurb() * @param \Google\Showcase\V1beta1\Blurb $var * @return $this */ - public function setBlurb($var) + public function setBlurb(\Google\Showcase\V1beta1\Blurb|null $var) { - GPBUtil::checkMessage($var, \Google\Showcase\V1beta1\Blurb::class); $this->writeOneof(2, $var); return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/ConnectRequest/ConnectConfig.php b/Gax/tests/Conformance/src/V1beta1/ConnectRequest/ConnectConfig.php index db6dd4cd8de3..e83f1cd82322 100644 --- a/Gax/tests/Conformance/src/V1beta1/ConnectRequest/ConnectConfig.php +++ b/Gax/tests/Conformance/src/V1beta1/ConnectRequest/ConnectConfig.php @@ -1,12 +1,13 @@ google.showcase.v1beta1.ConnectRequest.ConnectConfig @@ -53,9 +54,9 @@ public function getParent() * @param string $var * @return $this */ - public function setParent($var) + public function setParent(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->parent = $var; return $this; @@ -63,6 +64,3 @@ public function setParent($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ConnectConfig::class, \Google\Showcase\V1beta1\ConnectRequest_ConnectConfig::class); - diff --git a/Gax/tests/Conformance/src/V1beta1/Continent.php b/Gax/tests/Conformance/src/V1beta1/Continent.php index ca1acaf104f5..6a951a67e2ec 100644 --- a/Gax/tests/Conformance/src/V1beta1/Continent.php +++ b/Gax/tests/Conformance/src/V1beta1/Continent.php @@ -1,5 +1,6 @@ setParent($parent) - ->setBlurb($blurb); - } - /** * Constructor. * @@ -85,9 +69,9 @@ public function getParent() * @param string $var * @return $this */ - public function setParent($var) + public function setParent(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->parent = $var; return $this; @@ -121,9 +105,8 @@ public function clearBlurb() * @param \Google\Showcase\V1beta1\Blurb $var * @return $this */ - public function setBlurb($var) + public function setBlurb(\Google\Showcase\V1beta1\Blurb|null $var) { - GPBUtil::checkMessage($var, \Google\Showcase\V1beta1\Blurb::class); $this->blurb = $var; return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/CreateRoomRequest.php b/Gax/tests/Conformance/src/V1beta1/CreateRoomRequest.php index e06b41262b2f..91c003633d05 100644 --- a/Gax/tests/Conformance/src/V1beta1/CreateRoomRequest.php +++ b/Gax/tests/Conformance/src/V1beta1/CreateRoomRequest.php @@ -1,12 +1,13 @@ setRoom($room); - } - /** * Constructor. * @@ -79,9 +67,8 @@ public function clearRoom() * @param \Google\Showcase\V1beta1\Room $var * @return $this */ - public function setRoom($var) + public function setRoom(\Google\Showcase\V1beta1\Room|null $var) { - GPBUtil::checkMessage($var, \Google\Showcase\V1beta1\Room::class); $this->room = $var; return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/CreateSequenceRequest.php b/Gax/tests/Conformance/src/V1beta1/CreateSequenceRequest.php index 824bb223a633..e9885417fca4 100644 --- a/Gax/tests/Conformance/src/V1beta1/CreateSequenceRequest.php +++ b/Gax/tests/Conformance/src/V1beta1/CreateSequenceRequest.php @@ -1,14 +1,17 @@ google.showcase.v1beta1.CreateSequenceRequest */ class CreateSequenceRequest extends \Google\Protobuf\Internal\Message @@ -18,19 +21,6 @@ class CreateSequenceRequest extends \Google\Protobuf\Internal\Message */ protected $sequence = null; - /** - * @param \Google\Showcase\V1beta1\Sequence $sequence - * - * @return \Google\Showcase\V1beta1\CreateSequenceRequest - * - * @experimental - */ - public static function build(\Google\Showcase\V1beta1\Sequence $sequence): self - { - return (new self()) - ->setSequence($sequence); - } - /** * Constructor. * @@ -69,9 +59,8 @@ public function clearSequence() * @param \Google\Showcase\V1beta1\Sequence $var * @return $this */ - public function setSequence($var) + public function setSequence(\Google\Showcase\V1beta1\Sequence|null $var) { - GPBUtil::checkMessage($var, \Google\Showcase\V1beta1\Sequence::class); $this->sequence = $var; return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/CreateSessionRequest.php b/Gax/tests/Conformance/src/V1beta1/CreateSessionRequest.php index e61ac834e170..47b1cf07c550 100644 --- a/Gax/tests/Conformance/src/V1beta1/CreateSessionRequest.php +++ b/Gax/tests/Conformance/src/V1beta1/CreateSessionRequest.php @@ -1,12 +1,13 @@ session = $var; return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/CreateStreamingSequenceRequest.php b/Gax/tests/Conformance/src/V1beta1/CreateStreamingSequenceRequest.php index 60eaae273f4e..f64e5118f9b2 100644 --- a/Gax/tests/Conformance/src/V1beta1/CreateStreamingSequenceRequest.php +++ b/Gax/tests/Conformance/src/V1beta1/CreateStreamingSequenceRequest.php @@ -1,14 +1,17 @@ google.showcase.v1beta1.CreateStreamingSequenceRequest */ class CreateStreamingSequenceRequest extends \Google\Protobuf\Internal\Message @@ -18,19 +21,6 @@ class CreateStreamingSequenceRequest extends \Google\Protobuf\Internal\Message */ protected $streaming_sequence = null; - /** - * @param \Google\Showcase\V1beta1\StreamingSequence $streamingSequence - * - * @return \Google\Showcase\V1beta1\CreateStreamingSequenceRequest - * - * @experimental - */ - public static function build(\Google\Showcase\V1beta1\StreamingSequence $streamingSequence): self - { - return (new self()) - ->setStreamingSequence($streamingSequence); - } - /** * Constructor. * @@ -69,9 +59,8 @@ public function clearStreamingSequence() * @param \Google\Showcase\V1beta1\StreamingSequence $var * @return $this */ - public function setStreamingSequence($var) + public function setStreamingSequence(\Google\Showcase\V1beta1\StreamingSequence|null $var) { - GPBUtil::checkMessage($var, \Google\Showcase\V1beta1\StreamingSequence::class); $this->streaming_sequence = $var; return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/CreateUserRequest.php b/Gax/tests/Conformance/src/V1beta1/CreateUserRequest.php index 72af5e185bbc..a60cf0557b33 100644 --- a/Gax/tests/Conformance/src/V1beta1/CreateUserRequest.php +++ b/Gax/tests/Conformance/src/V1beta1/CreateUserRequest.php @@ -1,12 +1,13 @@ setUser($user); - } - /** * Constructor. * @@ -79,9 +67,8 @@ public function clearUser() * @param \Google\Showcase\V1beta1\User $var * @return $this */ - public function setUser($var) + public function setUser(\Google\Showcase\V1beta1\User|null $var) { - GPBUtil::checkMessage($var, \Google\Showcase\V1beta1\User::class); $this->user = $var; return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/DeleteBlurbRequest.php b/Gax/tests/Conformance/src/V1beta1/DeleteBlurbRequest.php index 33d021c69a43..d91bffd0a4f9 100644 --- a/Gax/tests/Conformance/src/V1beta1/DeleteBlurbRequest.php +++ b/Gax/tests/Conformance/src/V1beta1/DeleteBlurbRequest.php @@ -1,12 +1,13 @@ setName($name); - } - /** * Constructor. * @@ -70,9 +57,9 @@ public function getName() * @param string $var * @return $this */ - public function setName($var) + public function setName(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->name = $var; return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/DeleteRoomRequest.php b/Gax/tests/Conformance/src/V1beta1/DeleteRoomRequest.php index 7c5f4b83f76e..b05a86bc4605 100644 --- a/Gax/tests/Conformance/src/V1beta1/DeleteRoomRequest.php +++ b/Gax/tests/Conformance/src/V1beta1/DeleteRoomRequest.php @@ -1,12 +1,13 @@ setName($name); - } - /** * Constructor. * @@ -70,9 +57,9 @@ public function getName() * @param string $var * @return $this */ - public function setName($var) + public function setName(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->name = $var; return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/DeleteSessionRequest.php b/Gax/tests/Conformance/src/V1beta1/DeleteSessionRequest.php index 0a2da3f92578..e3a4a7b2608b 100644 --- a/Gax/tests/Conformance/src/V1beta1/DeleteSessionRequest.php +++ b/Gax/tests/Conformance/src/V1beta1/DeleteSessionRequest.php @@ -1,12 +1,13 @@ name = $var; return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/DeleteTestRequest.php b/Gax/tests/Conformance/src/V1beta1/DeleteTestRequest.php index 9be9c9fee37d..6aae9cee811d 100644 --- a/Gax/tests/Conformance/src/V1beta1/DeleteTestRequest.php +++ b/Gax/tests/Conformance/src/V1beta1/DeleteTestRequest.php @@ -1,12 +1,13 @@ name = $var; return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/DeleteUserRequest.php b/Gax/tests/Conformance/src/V1beta1/DeleteUserRequest.php index b0f77bf415f7..ff9064b7e2fc 100644 --- a/Gax/tests/Conformance/src/V1beta1/DeleteUserRequest.php +++ b/Gax/tests/Conformance/src/V1beta1/DeleteUserRequest.php @@ -1,12 +1,13 @@ setName($name); - } - /** * Constructor. * @@ -70,9 +57,9 @@ public function getName() * @param string $var * @return $this */ - public function setName($var) + public function setName(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->name = $var; return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/EchoErrorDetailsRequest.php b/Gax/tests/Conformance/src/V1beta1/EchoErrorDetailsRequest.php index 682a580b49d9..4f82c85a3029 100644 --- a/Gax/tests/Conformance/src/V1beta1/EchoErrorDetailsRequest.php +++ b/Gax/tests/Conformance/src/V1beta1/EchoErrorDetailsRequest.php @@ -1,12 +1,13 @@ |\Google\Protobuf\Internal\RepeatedField $multi_detail_text + * @type string[] $multi_detail_text * Content to return in a repeated `*.error.details` field of type * `google.protobuf.Any` * } @@ -69,9 +70,9 @@ public function getSingleDetailText() * @param string $var * @return $this */ - public function setSingleDetailText($var) + public function setSingleDetailText(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->single_detail_text = $var; return $this; @@ -82,7 +83,7 @@ public function setSingleDetailText($var) * `google.protobuf.Any` * * Generated from protobuf field repeated string multi_detail_text = 2; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField */ public function getMultiDetailText() { @@ -94,10 +95,10 @@ public function getMultiDetailText() * `google.protobuf.Any` * * Generated from protobuf field repeated string multi_detail_text = 2; - * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @param string[] $var * @return $this */ - public function setMultiDetailText($var) + public function setMultiDetailText(array|RepeatedField $var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); $this->multi_detail_text = $arr; diff --git a/Gax/tests/Conformance/src/V1beta1/EchoErrorDetailsResponse.php b/Gax/tests/Conformance/src/V1beta1/EchoErrorDetailsResponse.php index 602daec90811..31d638a039a6 100644 --- a/Gax/tests/Conformance/src/V1beta1/EchoErrorDetailsResponse.php +++ b/Gax/tests/Conformance/src/V1beta1/EchoErrorDetailsResponse.php @@ -1,12 +1,13 @@ single_detail = $var; return $this; @@ -95,9 +95,8 @@ public function clearMultipleDetails() * @param \Google\Showcase\V1beta1\EchoErrorDetailsResponse\MultipleDetails $var * @return $this */ - public function setMultipleDetails($var) + public function setMultipleDetails(\Google\Showcase\V1beta1\EchoErrorDetailsResponse\MultipleDetails|null $var) { - GPBUtil::checkMessage($var, \Google\Showcase\V1beta1\EchoErrorDetailsResponse\MultipleDetails::class); $this->multiple_details = $var; return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/EchoErrorDetailsResponse/MultipleDetails.php b/Gax/tests/Conformance/src/V1beta1/EchoErrorDetailsResponse/MultipleDetails.php index 354dc83201aa..49638592efd3 100644 --- a/Gax/tests/Conformance/src/V1beta1/EchoErrorDetailsResponse/MultipleDetails.php +++ b/Gax/tests/Conformance/src/V1beta1/EchoErrorDetailsResponse/MultipleDetails.php @@ -1,12 +1,13 @@ google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails @@ -56,9 +57,8 @@ public function clearError() * @param \Google\Showcase\V1beta1\ErrorWithMultipleDetails $var * @return $this */ - public function setError($var) + public function setError(\Google\Showcase\V1beta1\ErrorWithMultipleDetails|null $var) { - GPBUtil::checkMessage($var, \Google\Showcase\V1beta1\ErrorWithMultipleDetails::class); $this->error = $var; return $this; @@ -66,6 +66,3 @@ public function setError($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(MultipleDetails::class, \Google\Showcase\V1beta1\EchoErrorDetailsResponse_MultipleDetails::class); - diff --git a/Gax/tests/Conformance/src/V1beta1/EchoErrorDetailsResponse/SingleDetail.php b/Gax/tests/Conformance/src/V1beta1/EchoErrorDetailsResponse/SingleDetail.php index 5ed6b6660faf..0c8664488b51 100644 --- a/Gax/tests/Conformance/src/V1beta1/EchoErrorDetailsResponse/SingleDetail.php +++ b/Gax/tests/Conformance/src/V1beta1/EchoErrorDetailsResponse/SingleDetail.php @@ -1,12 +1,13 @@ google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail @@ -56,9 +57,8 @@ public function clearError() * @param \Google\Showcase\V1beta1\ErrorWithSingleDetail $var * @return $this */ - public function setError($var) + public function setError(\Google\Showcase\V1beta1\ErrorWithSingleDetail|null $var) { - GPBUtil::checkMessage($var, \Google\Showcase\V1beta1\ErrorWithSingleDetail::class); $this->error = $var; return $this; @@ -66,6 +66,3 @@ public function setError($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(SingleDetail::class, \Google\Showcase\V1beta1\EchoErrorDetailsResponse_SingleDetail::class); - diff --git a/Gax/tests/Conformance/src/V1beta1/EchoRequest.php b/Gax/tests/Conformance/src/V1beta1/EchoRequest.php index 036cd7b23a9d..99ac808667f9 100644 --- a/Gax/tests/Conformance/src/V1beta1/EchoRequest.php +++ b/Gax/tests/Conformance/src/V1beta1/EchoRequest.php @@ -1,12 +1,13 @@ writeOneof(1, $var); return $this; @@ -131,9 +132,8 @@ public function hasError() * @param \Google\Rpc\Status $var * @return $this */ - public function setError($var) + public function setError(\Google\Rpc\Status|null $var) { - GPBUtil::checkMessage($var, \Google\Rpc\Status::class); $this->writeOneof(2, $var); return $this; @@ -143,7 +143,7 @@ public function setError($var) * The severity to be echoed by the server. * * Generated from protobuf field .google.showcase.v1beta1.Severity severity = 3; - * @return int + * @return int one of the values in {@see \Google\Showcase\V1beta1\Severity} */ public function getSeverity() { @@ -154,10 +154,10 @@ public function getSeverity() * The severity to be echoed by the server. * * Generated from protobuf field .google.showcase.v1beta1.Severity severity = 3; - * @param int $var + * @param int $var one of the values in {@see \Google\Showcase\V1beta1\Severity} * @return $this */ - public function setSeverity($var) + public function setSeverity(int $var) { GPBUtil::checkEnum($var, \Google\Showcase\V1beta1\Severity::class); $this->severity = $var; @@ -183,9 +183,9 @@ public function getHeader() * @param string $var * @return $this */ - public function setHeader($var) + public function setHeader(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->header = $var; return $this; @@ -209,9 +209,9 @@ public function getOtherHeader() * @param string $var * @return $this */ - public function setOtherHeader($var) + public function setOtherHeader(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->other_header = $var; return $this; @@ -235,9 +235,9 @@ public function getRequestId() * @param string $var * @return $this */ - public function setRequestId($var) + public function setRequestId(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->request_id = $var; return $this; @@ -271,9 +271,9 @@ public function clearOtherRequestId() * @param string $var * @return $this */ - public function setOtherRequestId($var) + public function setOtherRequestId(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->other_request_id = $var; return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/EchoResponse.php b/Gax/tests/Conformance/src/V1beta1/EchoResponse.php index 6376a550329e..2f22276d8cda 100644 --- a/Gax/tests/Conformance/src/V1beta1/EchoResponse.php +++ b/Gax/tests/Conformance/src/V1beta1/EchoResponse.php @@ -1,12 +1,13 @@ content = $var; return $this; @@ -91,7 +92,7 @@ public function setContent($var) * The severity specified in the request. * * Generated from protobuf field .google.showcase.v1beta1.Severity severity = 2; - * @return int + * @return int one of the values in {@see \Google\Showcase\V1beta1\Severity} */ public function getSeverity() { @@ -102,10 +103,10 @@ public function getSeverity() * The severity specified in the request. * * Generated from protobuf field .google.showcase.v1beta1.Severity severity = 2; - * @param int $var + * @param int $var one of the values in {@see \Google\Showcase\V1beta1\Severity} * @return $this */ - public function setSeverity($var) + public function setSeverity(int $var) { GPBUtil::checkEnum($var, \Google\Showcase\V1beta1\Severity::class); $this->severity = $var; @@ -131,9 +132,9 @@ public function getRequestId() * @param string $var * @return $this */ - public function setRequestId($var) + public function setRequestId(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->request_id = $var; return $this; @@ -157,9 +158,9 @@ public function getOtherRequestId() * @param string $var * @return $this */ - public function setOtherRequestId($var) + public function setOtherRequestId(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->other_request_id = $var; return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/EnumRequest.php b/Gax/tests/Conformance/src/V1beta1/EnumRequest.php index 9bcf0f24c6b5..28138fc3b9af 100644 --- a/Gax/tests/Conformance/src/V1beta1/EnumRequest.php +++ b/Gax/tests/Conformance/src/V1beta1/EnumRequest.php @@ -1,12 +1,13 @@ google.showcase.v1beta1.EnumRequest @@ -53,9 +54,8 @@ public function getUnknownEnum() * @param bool $var * @return $this */ - public function setUnknownEnum($var) + public function setUnknownEnum(bool $var) { - GPBUtil::checkBool($var); $this->unknown_enum = $var; return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/EnumResponse.php b/Gax/tests/Conformance/src/V1beta1/EnumResponse.php index 2891e8686ef6..68864212c1fb 100644 --- a/Gax/tests/Conformance/src/V1beta1/EnumResponse.php +++ b/Gax/tests/Conformance/src/V1beta1/EnumResponse.php @@ -1,12 +1,13 @@ google.showcase.v1beta1.EnumResponse @@ -71,9 +72,8 @@ public function clearRequest() * @param \Google\Showcase\V1beta1\EnumRequest $var * @return $this */ - public function setRequest($var) + public function setRequest(\Google\Showcase\V1beta1\EnumRequest|null $var) { - GPBUtil::checkMessage($var, \Google\Showcase\V1beta1\EnumRequest::class); $this->request = $var; return $this; @@ -83,7 +83,7 @@ public function setRequest($var) * The actual enum the server provided. * * Generated from protobuf field .google.showcase.v1beta1.Continent continent = 2; - * @return int + * @return int one of the values in {@see \Google\Showcase\V1beta1\Continent} */ public function getContinent() { @@ -94,10 +94,10 @@ public function getContinent() * The actual enum the server provided. * * Generated from protobuf field .google.showcase.v1beta1.Continent continent = 2; - * @param int $var + * @param int $var one of the values in {@see \Google\Showcase\V1beta1\Continent} * @return $this */ - public function setContinent($var) + public function setContinent(int $var) { GPBUtil::checkEnum($var, \Google\Showcase\V1beta1\Continent::class); $this->continent = $var; diff --git a/Gax/tests/Conformance/src/V1beta1/ErrorWithMultipleDetails.php b/Gax/tests/Conformance/src/V1beta1/ErrorWithMultipleDetails.php index 6a8103073138..d8b07b342a24 100644 --- a/Gax/tests/Conformance/src/V1beta1/ErrorWithMultipleDetails.php +++ b/Gax/tests/Conformance/src/V1beta1/ErrorWithMultipleDetails.php @@ -1,12 +1,13 @@ google.showcase.v1beta1.ErrorWithMultipleDetails @@ -24,7 +25,7 @@ class ErrorWithMultipleDetails extends \Google\Protobuf\Internal\Message * @param array $data { * Optional. Data for populating the Message object. * - * @type array<\Google\Protobuf\Any>|\Google\Protobuf\Internal\RepeatedField $details + * @type \Google\Protobuf\Any[] $details * } */ public function __construct($data = NULL) { @@ -34,7 +35,7 @@ public function __construct($data = NULL) { /** * Generated from protobuf field repeated .google.protobuf.Any details = 1; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField<\Google\Protobuf\Any> */ public function getDetails() { @@ -43,10 +44,10 @@ public function getDetails() /** * Generated from protobuf field repeated .google.protobuf.Any details = 1; - * @param array<\Google\Protobuf\Any>|\Google\Protobuf\Internal\RepeatedField $var + * @param \Google\Protobuf\Any[] $var * @return $this */ - public function setDetails($var) + public function setDetails(array|RepeatedField $var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Any::class); $this->details = $arr; diff --git a/Gax/tests/Conformance/src/V1beta1/ErrorWithSingleDetail.php b/Gax/tests/Conformance/src/V1beta1/ErrorWithSingleDetail.php index 2160690b7ace..76ab6e4b8e7f 100644 --- a/Gax/tests/Conformance/src/V1beta1/ErrorWithSingleDetail.php +++ b/Gax/tests/Conformance/src/V1beta1/ErrorWithSingleDetail.php @@ -1,12 +1,13 @@ google.showcase.v1beta1.ErrorWithSingleDetail @@ -56,9 +57,8 @@ public function clearDetails() * @param \Google\Protobuf\Any $var * @return $this */ - public function setDetails($var) + public function setDetails(\Google\Protobuf\Any|null $var) { - GPBUtil::checkMessage($var, \Google\Protobuf\Any::class); $this->details = $var; return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/ExpandRequest.php b/Gax/tests/Conformance/src/V1beta1/ExpandRequest.php index ff777df17271..5479e15df504 100644 --- a/Gax/tests/Conformance/src/V1beta1/ExpandRequest.php +++ b/Gax/tests/Conformance/src/V1beta1/ExpandRequest.php @@ -1,12 +1,13 @@ setContent($content) - ->setError($error); - } - /** * Constructor. * @@ -86,9 +72,9 @@ public function getContent() * @param string $var * @return $this */ - public function setContent($var) + public function setContent(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->content = $var; return $this; @@ -122,9 +108,8 @@ public function clearError() * @param \Google\Rpc\Status $var * @return $this */ - public function setError($var) + public function setError(\Google\Rpc\Status|null $var) { - GPBUtil::checkMessage($var, \Google\Rpc\Status::class); $this->error = $var; return $this; @@ -158,9 +143,8 @@ public function clearStreamWaitTime() * @param \Google\Protobuf\Duration $var * @return $this */ - public function setStreamWaitTime($var) + public function setStreamWaitTime(\Google\Protobuf\Duration|null $var) { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); $this->stream_wait_time = $var; return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/FailEchoWithDetailsRequest.php b/Gax/tests/Conformance/src/V1beta1/FailEchoWithDetailsRequest.php index bd16d204766a..1b7d7bb16105 100644 --- a/Gax/tests/Conformance/src/V1beta1/FailEchoWithDetailsRequest.php +++ b/Gax/tests/Conformance/src/V1beta1/FailEchoWithDetailsRequest.php @@ -1,12 +1,13 @@ message = $var; return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/FailEchoWithDetailsResponse.php b/Gax/tests/Conformance/src/V1beta1/FailEchoWithDetailsResponse.php index f7ab8fc97a23..c925c9511b05 100644 --- a/Gax/tests/Conformance/src/V1beta1/FailEchoWithDetailsResponse.php +++ b/Gax/tests/Conformance/src/V1beta1/FailEchoWithDetailsResponse.php @@ -1,12 +1,13 @@ setName($name); - } - /** * Constructor. * @@ -70,9 +57,9 @@ public function getName() * @param string $var * @return $this */ - public function setName($var) + public function setName(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->name = $var; return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/GetRoomRequest.php b/Gax/tests/Conformance/src/V1beta1/GetRoomRequest.php index f80ff9f40ea4..12ed71d0ebb8 100644 --- a/Gax/tests/Conformance/src/V1beta1/GetRoomRequest.php +++ b/Gax/tests/Conformance/src/V1beta1/GetRoomRequest.php @@ -1,12 +1,13 @@ setName($name); - } - /** * Constructor. * @@ -70,9 +57,9 @@ public function getName() * @param string $var * @return $this */ - public function setName($var) + public function setName(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->name = $var; return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/GetSequenceReportRequest.php b/Gax/tests/Conformance/src/V1beta1/GetSequenceReportRequest.php index 9cff8d1d607a..88f0ed369871 100644 --- a/Gax/tests/Conformance/src/V1beta1/GetSequenceReportRequest.php +++ b/Gax/tests/Conformance/src/V1beta1/GetSequenceReportRequest.php @@ -1,12 +1,13 @@ google.showcase.v1beta1.GetSequenceReportRequest @@ -18,19 +19,6 @@ class GetSequenceReportRequest extends \Google\Protobuf\Internal\Message */ protected $name = ''; - /** - * @param string $name Please see {@see SequenceServiceClient::sequenceReportName()} for help formatting this field. - * - * @return \Google\Showcase\V1beta1\GetSequenceReportRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - /** * Constructor. * @@ -59,9 +47,9 @@ public function getName() * @param string $var * @return $this */ - public function setName($var) + public function setName(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->name = $var; return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/GetSessionRequest.php b/Gax/tests/Conformance/src/V1beta1/GetSessionRequest.php index 5ef01cb9114e..bc6da2e4e88e 100644 --- a/Gax/tests/Conformance/src/V1beta1/GetSessionRequest.php +++ b/Gax/tests/Conformance/src/V1beta1/GetSessionRequest.php @@ -1,12 +1,13 @@ name = $var; return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/GetStreamingSequenceReportRequest.php b/Gax/tests/Conformance/src/V1beta1/GetStreamingSequenceReportRequest.php index 8817ae7b93ff..ed401060bec6 100644 --- a/Gax/tests/Conformance/src/V1beta1/GetStreamingSequenceReportRequest.php +++ b/Gax/tests/Conformance/src/V1beta1/GetStreamingSequenceReportRequest.php @@ -1,12 +1,13 @@ google.showcase.v1beta1.GetStreamingSequenceReportRequest @@ -18,19 +19,6 @@ class GetStreamingSequenceReportRequest extends \Google\Protobuf\Internal\Messag */ protected $name = ''; - /** - * @param string $name Please see {@see SequenceServiceClient::streamingSequenceReportName()} for help formatting this field. - * - * @return \Google\Showcase\V1beta1\GetStreamingSequenceReportRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - /** * Constructor. * @@ -59,9 +47,9 @@ public function getName() * @param string $var * @return $this */ - public function setName($var) + public function setName(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->name = $var; return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/GetUserRequest.php b/Gax/tests/Conformance/src/V1beta1/GetUserRequest.php index a10d124a1f61..3a0cf2ad5bb9 100644 --- a/Gax/tests/Conformance/src/V1beta1/GetUserRequest.php +++ b/Gax/tests/Conformance/src/V1beta1/GetUserRequest.php @@ -1,12 +1,13 @@ setName($name); - } - /** * Constructor. * @@ -70,9 +57,9 @@ public function getName() * @param string $var * @return $this */ - public function setName($var) + public function setName(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->name = $var; return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/Issue.php b/Gax/tests/Conformance/src/V1beta1/Issue.php index 85a9ba84d14c..f226486d46bf 100644 --- a/Gax/tests/Conformance/src/V1beta1/Issue.php +++ b/Gax/tests/Conformance/src/V1beta1/Issue.php @@ -1,12 +1,13 @@ .google.showcase.v1beta1.Issue.Type type = 1; - * @return int + * @return int one of the values in {@see \Google\Showcase\V1beta1\Issue\Type} */ public function getType() { @@ -68,10 +69,10 @@ public function getType() * The type of the issue. * * Generated from protobuf field .google.showcase.v1beta1.Issue.Type type = 1; - * @param int $var + * @param int $var one of the values in {@see \Google\Showcase\V1beta1\Issue\Type} * @return $this */ - public function setType($var) + public function setType(int $var) { GPBUtil::checkEnum($var, \Google\Showcase\V1beta1\Issue\Type::class); $this->type = $var; @@ -83,7 +84,7 @@ public function setType($var) * The severity of the issue. * * Generated from protobuf field .google.showcase.v1beta1.Issue.Severity severity = 2; - * @return int + * @return int one of the values in {@see \Google\Showcase\V1beta1\Issue\Severity} */ public function getSeverity() { @@ -94,10 +95,10 @@ public function getSeverity() * The severity of the issue. * * Generated from protobuf field .google.showcase.v1beta1.Issue.Severity severity = 2; - * @param int $var + * @param int $var one of the values in {@see \Google\Showcase\V1beta1\Issue\Severity} * @return $this */ - public function setSeverity($var) + public function setSeverity(int $var) { GPBUtil::checkEnum($var, \Google\Showcase\V1beta1\Issue\Severity::class); $this->severity = $var; @@ -123,9 +124,9 @@ public function getDescription() * @param string $var * @return $this */ - public function setDescription($var) + public function setDescription(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->description = $var; return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/Issue/Severity.php b/Gax/tests/Conformance/src/V1beta1/Issue/Severity.php index 2bd33a3a413b..636098de4df8 100644 --- a/Gax/tests/Conformance/src/V1beta1/Issue/Severity.php +++ b/Gax/tests/Conformance/src/V1beta1/Issue/Severity.php @@ -1,5 +1,6 @@ setParent($parent); - } - /** * Constructor. * @@ -94,9 +81,9 @@ public function getParent() * @param string $var * @return $this */ - public function setParent($var) + public function setParent(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->parent = $var; return $this; @@ -124,7 +111,7 @@ public function getPageSize() * @param int $var * @return $this */ - public function setPageSize($var) + public function setPageSize(int $var) { GPBUtil::checkInt32($var); $this->page_size = $var; @@ -154,9 +141,9 @@ public function getPageToken() * @param string $var * @return $this */ - public function setPageToken($var) + public function setPageToken(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->page_token = $var; return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/ListBlurbsResponse.php b/Gax/tests/Conformance/src/V1beta1/ListBlurbsResponse.php index d55589d67ad9..7090d251e9d3 100644 --- a/Gax/tests/Conformance/src/V1beta1/ListBlurbsResponse.php +++ b/Gax/tests/Conformance/src/V1beta1/ListBlurbsResponse.php @@ -1,12 +1,13 @@ |\Google\Protobuf\Internal\RepeatedField $blurbs + * @type \Google\Showcase\V1beta1\Blurb[] $blurbs * The list of blurbs. * @type string $next_page_token * A token to retrieve next page of results. @@ -56,7 +57,7 @@ public function __construct($data = NULL) { * The list of blurbs. * * Generated from protobuf field repeated .google.showcase.v1beta1.Blurb blurbs = 1; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField<\Google\Showcase\V1beta1\Blurb> */ public function getBlurbs() { @@ -67,10 +68,10 @@ public function getBlurbs() * The list of blurbs. * * Generated from protobuf field repeated .google.showcase.v1beta1.Blurb blurbs = 1; - * @param array<\Google\Showcase\V1beta1\Blurb>|\Google\Protobuf\Internal\RepeatedField $var + * @param \Google\Showcase\V1beta1\Blurb[] $var * @return $this */ - public function setBlurbs($var) + public function setBlurbs(array|RepeatedField $var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Showcase\V1beta1\Blurb::class); $this->blurbs = $arr; @@ -102,9 +103,9 @@ public function getNextPageToken() * @param string $var * @return $this */ - public function setNextPageToken($var) + public function setNextPageToken(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->next_page_token = $var; return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/ListRoomsRequest.php b/Gax/tests/Conformance/src/V1beta1/ListRoomsRequest.php index 1146bc5a2b12..d6f51ca321ac 100644 --- a/Gax/tests/Conformance/src/V1beta1/ListRoomsRequest.php +++ b/Gax/tests/Conformance/src/V1beta1/ListRoomsRequest.php @@ -1,12 +1,13 @@ page_size = $var; @@ -102,9 +103,9 @@ public function getPageToken() * @param string $var * @return $this */ - public function setPageToken($var) + public function setPageToken(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->page_token = $var; return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/ListRoomsResponse.php b/Gax/tests/Conformance/src/V1beta1/ListRoomsResponse.php index c626913defbb..d1c575d9ceba 100644 --- a/Gax/tests/Conformance/src/V1beta1/ListRoomsResponse.php +++ b/Gax/tests/Conformance/src/V1beta1/ListRoomsResponse.php @@ -1,12 +1,13 @@ |\Google\Protobuf\Internal\RepeatedField $rooms + * @type \Google\Showcase\V1beta1\Room[] $rooms * The list of rooms. * @type string $next_page_token * A token to retrieve next page of results. @@ -56,7 +57,7 @@ public function __construct($data = NULL) { * The list of rooms. * * Generated from protobuf field repeated .google.showcase.v1beta1.Room rooms = 1; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField<\Google\Showcase\V1beta1\Room> */ public function getRooms() { @@ -67,10 +68,10 @@ public function getRooms() * The list of rooms. * * Generated from protobuf field repeated .google.showcase.v1beta1.Room rooms = 1; - * @param array<\Google\Showcase\V1beta1\Room>|\Google\Protobuf\Internal\RepeatedField $var + * @param \Google\Showcase\V1beta1\Room[] $var * @return $this */ - public function setRooms($var) + public function setRooms(array|RepeatedField $var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Showcase\V1beta1\Room::class); $this->rooms = $arr; @@ -102,9 +103,9 @@ public function getNextPageToken() * @param string $var * @return $this */ - public function setNextPageToken($var) + public function setNextPageToken(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->next_page_token = $var; return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/ListSessionsRequest.php b/Gax/tests/Conformance/src/V1beta1/ListSessionsRequest.php index 83892186d25d..79fe86c861de 100644 --- a/Gax/tests/Conformance/src/V1beta1/ListSessionsRequest.php +++ b/Gax/tests/Conformance/src/V1beta1/ListSessionsRequest.php @@ -1,12 +1,13 @@ page_size = $var; @@ -89,9 +90,9 @@ public function getPageToken() * @param string $var * @return $this */ - public function setPageToken($var) + public function setPageToken(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->page_token = $var; return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/ListSessionsResponse.php b/Gax/tests/Conformance/src/V1beta1/ListSessionsResponse.php index 94d7705eeefd..1ce9f95ad158 100644 --- a/Gax/tests/Conformance/src/V1beta1/ListSessionsResponse.php +++ b/Gax/tests/Conformance/src/V1beta1/ListSessionsResponse.php @@ -1,12 +1,13 @@ |\Google\Protobuf\Internal\RepeatedField $sessions + * @type \Google\Showcase\V1beta1\Session[] $sessions * The sessions being returned. * @type string $next_page_token * The next page token, if any. @@ -51,7 +52,7 @@ public function __construct($data = NULL) { * The sessions being returned. * * Generated from protobuf field repeated .google.showcase.v1beta1.Session sessions = 1; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField<\Google\Showcase\V1beta1\Session> */ public function getSessions() { @@ -62,10 +63,10 @@ public function getSessions() * The sessions being returned. * * Generated from protobuf field repeated .google.showcase.v1beta1.Session sessions = 1; - * @param array<\Google\Showcase\V1beta1\Session>|\Google\Protobuf\Internal\RepeatedField $var + * @param \Google\Showcase\V1beta1\Session[] $var * @return $this */ - public function setSessions($var) + public function setSessions(array|RepeatedField $var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Showcase\V1beta1\Session::class); $this->sessions = $arr; @@ -93,9 +94,9 @@ public function getNextPageToken() * @param string $var * @return $this */ - public function setNextPageToken($var) + public function setNextPageToken(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->next_page_token = $var; return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/ListTestsRequest.php b/Gax/tests/Conformance/src/V1beta1/ListTestsRequest.php index 317cb391a742..0e24598aed6d 100644 --- a/Gax/tests/Conformance/src/V1beta1/ListTestsRequest.php +++ b/Gax/tests/Conformance/src/V1beta1/ListTestsRequest.php @@ -1,12 +1,13 @@ parent = $var; return $this; @@ -97,7 +98,7 @@ public function getPageSize() * @param int $var * @return $this */ - public function setPageSize($var) + public function setPageSize(int $var) { GPBUtil::checkInt32($var); $this->page_size = $var; @@ -123,9 +124,9 @@ public function getPageToken() * @param string $var * @return $this */ - public function setPageToken($var) + public function setPageToken(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->page_token = $var; return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/ListTestsResponse.php b/Gax/tests/Conformance/src/V1beta1/ListTestsResponse.php index b4371f404e04..eabda793998d 100644 --- a/Gax/tests/Conformance/src/V1beta1/ListTestsResponse.php +++ b/Gax/tests/Conformance/src/V1beta1/ListTestsResponse.php @@ -1,12 +1,13 @@ |\Google\Protobuf\Internal\RepeatedField $tests + * @type \Google\Showcase\V1beta1\Test[] $tests * The tests being returned. * @type string $next_page_token * The next page token, if any. @@ -51,7 +52,7 @@ public function __construct($data = NULL) { * The tests being returned. * * Generated from protobuf field repeated .google.showcase.v1beta1.Test tests = 1; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField<\Google\Showcase\V1beta1\Test> */ public function getTests() { @@ -62,10 +63,10 @@ public function getTests() * The tests being returned. * * Generated from protobuf field repeated .google.showcase.v1beta1.Test tests = 1; - * @param array<\Google\Showcase\V1beta1\Test>|\Google\Protobuf\Internal\RepeatedField $var + * @param \Google\Showcase\V1beta1\Test[] $var * @return $this */ - public function setTests($var) + public function setTests(array|RepeatedField $var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Showcase\V1beta1\Test::class); $this->tests = $arr; @@ -93,9 +94,9 @@ public function getNextPageToken() * @param string $var * @return $this */ - public function setNextPageToken($var) + public function setNextPageToken(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->next_page_token = $var; return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/ListUsersRequest.php b/Gax/tests/Conformance/src/V1beta1/ListUsersRequest.php index 74e8ac32b7f3..a9f816d17f3e 100644 --- a/Gax/tests/Conformance/src/V1beta1/ListUsersRequest.php +++ b/Gax/tests/Conformance/src/V1beta1/ListUsersRequest.php @@ -1,12 +1,13 @@ page_size = $var; @@ -102,9 +103,9 @@ public function getPageToken() * @param string $var * @return $this */ - public function setPageToken($var) + public function setPageToken(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->page_token = $var; return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/ListUsersResponse.php b/Gax/tests/Conformance/src/V1beta1/ListUsersResponse.php index 573070619439..b12807e00846 100644 --- a/Gax/tests/Conformance/src/V1beta1/ListUsersResponse.php +++ b/Gax/tests/Conformance/src/V1beta1/ListUsersResponse.php @@ -1,12 +1,13 @@ |\Google\Protobuf\Internal\RepeatedField $users + * @type \Google\Showcase\V1beta1\User[] $users * The list of users. * @type string $next_page_token * A token to retrieve next page of results. @@ -56,7 +57,7 @@ public function __construct($data = NULL) { * The list of users. * * Generated from protobuf field repeated .google.showcase.v1beta1.User users = 1; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField<\Google\Showcase\V1beta1\User> */ public function getUsers() { @@ -67,10 +68,10 @@ public function getUsers() * The list of users. * * Generated from protobuf field repeated .google.showcase.v1beta1.User users = 1; - * @param array<\Google\Showcase\V1beta1\User>|\Google\Protobuf\Internal\RepeatedField $var + * @param \Google\Showcase\V1beta1\User[] $var * @return $this */ - public function setUsers($var) + public function setUsers(array|RepeatedField $var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Showcase\V1beta1\User::class); $this->users = $arr; @@ -102,9 +103,9 @@ public function getNextPageToken() * @param string $var * @return $this */ - public function setNextPageToken($var) + public function setNextPageToken(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->next_page_token = $var; return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/PagedExpandLegacyMappedResponse.php b/Gax/tests/Conformance/src/V1beta1/PagedExpandLegacyMappedResponse.php index 4be88d99a26f..ae1824ac6746 100644 --- a/Gax/tests/Conformance/src/V1beta1/PagedExpandLegacyMappedResponse.php +++ b/Gax/tests/Conformance/src/V1beta1/PagedExpandLegacyMappedResponse.php @@ -1,12 +1,13 @@ google.showcase.v1beta1.PagedExpandLegacyMappedResponse @@ -18,7 +19,7 @@ class PagedExpandLegacyMappedResponse extends \Google\Protobuf\Internal\Message * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates * aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --) * - * Generated from protobuf field repeated .google.showcase.v1beta1.PagedExpandResponseList alphabetized = 1; + * Generated from protobuf field map alphabetized = 1; */ private $alphabetized; /** @@ -34,7 +35,7 @@ class PagedExpandLegacyMappedResponse extends \Google\Protobuf\Internal\Message * @param array $data { * Optional. Data for populating the Message object. * - * @type array<\Google\Showcase\V1beta1\PagedExpandResponseList>|\Google\Protobuf\Internal\RepeatedField $alphabetized + * @type array|\Google\Protobuf\Internal\MapField $alphabetized * The words that were expanded, indexed by their initial character. * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates * aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --) @@ -52,8 +53,8 @@ public function __construct($data = NULL) { * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates * aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --) * - * Generated from protobuf field repeated .google.showcase.v1beta1.PagedExpandResponseList alphabetized = 1; - * @return \Google\Protobuf\Internal\RepeatedField + * Generated from protobuf field map alphabetized = 1; + * @return \Google\Protobuf\Internal\MapField */ public function getAlphabetized() { @@ -65,13 +66,13 @@ public function getAlphabetized() * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates * aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --) * - * Generated from protobuf field repeated .google.showcase.v1beta1.PagedExpandResponseList alphabetized = 1; - * @param array<\Google\Showcase\V1beta1\PagedExpandResponseList>|\Google\Protobuf\Internal\RepeatedField $var + * Generated from protobuf field map alphabetized = 1; + * @param array|\Google\Protobuf\Internal\MapField $var * @return $this */ - public function setAlphabetized($var) + public function setAlphabetized(array|\Google\Protobuf\Internal\MapField $var) { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Showcase\V1beta1\PagedExpandResponseList::class); + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Showcase\V1beta1\PagedExpandResponseList::class); $this->alphabetized = $arr; return $this; @@ -95,9 +96,9 @@ public function getNextPageToken() * @param string $var * @return $this */ - public function setNextPageToken($var) + public function setNextPageToken(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->next_page_token = $var; return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/PagedExpandLegacyRequest.php b/Gax/tests/Conformance/src/V1beta1/PagedExpandLegacyRequest.php index 680f93f2d89c..2b3cedf3d9e6 100644 --- a/Gax/tests/Conformance/src/V1beta1/PagedExpandLegacyRequest.php +++ b/Gax/tests/Conformance/src/V1beta1/PagedExpandLegacyRequest.php @@ -1,12 +1,13 @@ content = $var; return $this; @@ -107,7 +108,7 @@ public function getMaxResults() * @param int $var * @return $this */ - public function setMaxResults($var) + public function setMaxResults(int $var) { GPBUtil::checkInt32($var); $this->max_results = $var; @@ -133,9 +134,9 @@ public function getPageToken() * @param string $var * @return $this */ - public function setPageToken($var) + public function setPageToken(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->page_token = $var; return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/PagedExpandRequest.php b/Gax/tests/Conformance/src/V1beta1/PagedExpandRequest.php index 22297ce3f18f..69625f04ea0b 100644 --- a/Gax/tests/Conformance/src/V1beta1/PagedExpandRequest.php +++ b/Gax/tests/Conformance/src/V1beta1/PagedExpandRequest.php @@ -1,12 +1,13 @@ content = $var; return $this; @@ -97,7 +98,7 @@ public function getPageSize() * @param int $var * @return $this */ - public function setPageSize($var) + public function setPageSize(int $var) { GPBUtil::checkInt32($var); $this->page_size = $var; @@ -123,9 +124,9 @@ public function getPageToken() * @param string $var * @return $this */ - public function setPageToken($var) + public function setPageToken(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->page_token = $var; return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/PagedExpandResponse.php b/Gax/tests/Conformance/src/V1beta1/PagedExpandResponse.php index cb2a2ef7de2c..215c1bae0386 100644 --- a/Gax/tests/Conformance/src/V1beta1/PagedExpandResponse.php +++ b/Gax/tests/Conformance/src/V1beta1/PagedExpandResponse.php @@ -1,12 +1,13 @@ |\Google\Protobuf\Internal\RepeatedField $responses + * @type \Google\Showcase\V1beta1\EchoResponse[] $responses * The words that were expanded. * @type string $next_page_token * The next page token. @@ -49,7 +50,7 @@ public function __construct($data = NULL) { * The words that were expanded. * * Generated from protobuf field repeated .google.showcase.v1beta1.EchoResponse responses = 1; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField<\Google\Showcase\V1beta1\EchoResponse> */ public function getResponses() { @@ -60,10 +61,10 @@ public function getResponses() * The words that were expanded. * * Generated from protobuf field repeated .google.showcase.v1beta1.EchoResponse responses = 1; - * @param array<\Google\Showcase\V1beta1\EchoResponse>|\Google\Protobuf\Internal\RepeatedField $var + * @param \Google\Showcase\V1beta1\EchoResponse[] $var * @return $this */ - public function setResponses($var) + public function setResponses(array|RepeatedField $var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Showcase\V1beta1\EchoResponse::class); $this->responses = $arr; @@ -89,9 +90,9 @@ public function getNextPageToken() * @param string $var * @return $this */ - public function setNextPageToken($var) + public function setNextPageToken(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->next_page_token = $var; return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/PagedExpandResponseList.php b/Gax/tests/Conformance/src/V1beta1/PagedExpandResponseList.php index 75363cc8d631..c63a4b4d831c 100644 --- a/Gax/tests/Conformance/src/V1beta1/PagedExpandResponseList.php +++ b/Gax/tests/Conformance/src/V1beta1/PagedExpandResponseList.php @@ -1,12 +1,13 @@ |\Google\Protobuf\Internal\RepeatedField $words + * @type string[] $words * } */ public function __construct($data = NULL) { @@ -36,7 +37,7 @@ public function __construct($data = NULL) { /** * Generated from protobuf field repeated string words = 1; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField */ public function getWords() { @@ -45,10 +46,10 @@ public function getWords() /** * Generated from protobuf field repeated string words = 1; - * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @param string[] $var * @return $this */ - public function setWords($var) + public function setWords(array|RepeatedField $var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); $this->words = $arr; diff --git a/Gax/tests/Conformance/src/V1beta1/PoetryError.php b/Gax/tests/Conformance/src/V1beta1/PoetryError.php index 9c8384825033..6fdfbaef57fc 100644 --- a/Gax/tests/Conformance/src/V1beta1/PoetryError.php +++ b/Gax/tests/Conformance/src/V1beta1/PoetryError.php @@ -1,12 +1,13 @@ poem = $var; return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/RepeatRequest.php b/Gax/tests/Conformance/src/V1beta1/RepeatRequest.php index 538e302b2198..ee0b80b9990d 100644 --- a/Gax/tests/Conformance/src/V1beta1/RepeatRequest.php +++ b/Gax/tests/Conformance/src/V1beta1/RepeatRequest.php @@ -1,12 +1,13 @@ google.showcase.v1beta1.RepeatRequest @@ -104,9 +105,9 @@ public function getName() * @param string $var * @return $this */ - public function setName($var) + public function setName(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->name = $var; return $this; @@ -136,9 +137,8 @@ public function clearInfo() * @param \Google\Showcase\V1beta1\ComplianceData $var * @return $this */ - public function setInfo($var) + public function setInfo(\Google\Showcase\V1beta1\ComplianceData|null $var) { - GPBUtil::checkMessage($var, \Google\Showcase\V1beta1\ComplianceData::class); $this->info = $var; return $this; @@ -164,9 +164,8 @@ public function getServerVerify() * @param bool $var * @return $this */ - public function setServerVerify($var) + public function setServerVerify(bool $var) { - GPBUtil::checkBool($var); $this->server_verify = $var; return $this; @@ -200,9 +199,9 @@ public function clearIntendedBindingUri() * @param string $var * @return $this */ - public function setIntendedBindingUri($var) + public function setIntendedBindingUri(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->intended_binding_uri = $var; return $this; @@ -228,7 +227,7 @@ public function getFInt32() * @param int $var * @return $this */ - public function setFInt32($var) + public function setFInt32(int $var) { GPBUtil::checkInt32($var); $this->f_int32 = $var; @@ -250,7 +249,7 @@ public function getFInt64() * @param int|string $var * @return $this */ - public function setFInt64($var) + public function setFInt64(int|string $var) { GPBUtil::checkInt64($var); $this->f_int64 = $var; @@ -272,9 +271,8 @@ public function getFDouble() * @param float $var * @return $this */ - public function setFDouble($var) + public function setFDouble(float $var) { - GPBUtil::checkDouble($var); $this->f_double = $var; return $this; @@ -304,7 +302,7 @@ public function clearPInt32() * @param int $var * @return $this */ - public function setPInt32($var) + public function setPInt32(int $var) { GPBUtil::checkInt32($var); $this->p_int32 = $var; @@ -318,7 +316,7 @@ public function setPInt32($var) */ public function getPInt64() { - return isset($this->p_int64) ? $this->p_int64 : 0; + return isset($this->p_int64) ? $this->p_int64 : GPBUtil::compatibleInt64(0, '0'); } public function hasPInt64() @@ -336,7 +334,7 @@ public function clearPInt64() * @param int|string $var * @return $this */ - public function setPInt64($var) + public function setPInt64(int|string $var) { GPBUtil::checkInt64($var); $this->p_int64 = $var; @@ -368,9 +366,8 @@ public function clearPDouble() * @param float $var * @return $this */ - public function setPDouble($var) + public function setPDouble(float $var) { - GPBUtil::checkDouble($var); $this->p_double = $var; return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/RepeatResponse.php b/Gax/tests/Conformance/src/V1beta1/RepeatResponse.php index ea268e11b9a6..c13e8d12d560 100644 --- a/Gax/tests/Conformance/src/V1beta1/RepeatResponse.php +++ b/Gax/tests/Conformance/src/V1beta1/RepeatResponse.php @@ -1,12 +1,13 @@ google.showcase.v1beta1.RepeatResponse @@ -64,9 +65,8 @@ public function clearRequest() * @param \Google\Showcase\V1beta1\RepeatRequest $var * @return $this */ - public function setRequest($var) + public function setRequest(\Google\Showcase\V1beta1\RepeatRequest|null $var) { - GPBUtil::checkMessage($var, \Google\Showcase\V1beta1\RepeatRequest::class); $this->request = $var; return $this; @@ -90,9 +90,9 @@ public function getBindingUri() * @param string $var * @return $this */ - public function setBindingUri($var) + public function setBindingUri(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->binding_uri = $var; return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/ReportSessionRequest.php b/Gax/tests/Conformance/src/V1beta1/ReportSessionRequest.php index 93e9295cde8c..a79b23a4d6a4 100644 --- a/Gax/tests/Conformance/src/V1beta1/ReportSessionRequest.php +++ b/Gax/tests/Conformance/src/V1beta1/ReportSessionRequest.php @@ -1,12 +1,13 @@ name = $var; return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/ReportSessionResponse.php b/Gax/tests/Conformance/src/V1beta1/ReportSessionResponse.php index cb64be765673..7a6a4de46529 100644 --- a/Gax/tests/Conformance/src/V1beta1/ReportSessionResponse.php +++ b/Gax/tests/Conformance/src/V1beta1/ReportSessionResponse.php @@ -1,12 +1,13 @@ |\Google\Protobuf\Internal\RepeatedField $test_runs + * @type \Google\Showcase\V1beta1\TestRun[] $test_runs * The test runs of this session. * } */ @@ -49,7 +50,7 @@ public function __construct($data = NULL) { * The state of the report. * * Generated from protobuf field .google.showcase.v1beta1.ReportSessionResponse.Result result = 1; - * @return int + * @return int one of the values in {@see \Google\Showcase\V1beta1\ReportSessionResponse\Result} */ public function getResult() { @@ -60,10 +61,10 @@ public function getResult() * The state of the report. * * Generated from protobuf field .google.showcase.v1beta1.ReportSessionResponse.Result result = 1; - * @param int $var + * @param int $var one of the values in {@see \Google\Showcase\V1beta1\ReportSessionResponse\Result} * @return $this */ - public function setResult($var) + public function setResult(int $var) { GPBUtil::checkEnum($var, \Google\Showcase\V1beta1\ReportSessionResponse\Result::class); $this->result = $var; @@ -75,7 +76,7 @@ public function setResult($var) * The test runs of this session. * * Generated from protobuf field repeated .google.showcase.v1beta1.TestRun test_runs = 2; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField<\Google\Showcase\V1beta1\TestRun> */ public function getTestRuns() { @@ -86,10 +87,10 @@ public function getTestRuns() * The test runs of this session. * * Generated from protobuf field repeated .google.showcase.v1beta1.TestRun test_runs = 2; - * @param array<\Google\Showcase\V1beta1\TestRun>|\Google\Protobuf\Internal\RepeatedField $var + * @param \Google\Showcase\V1beta1\TestRun[] $var * @return $this */ - public function setTestRuns($var) + public function setTestRuns(array|RepeatedField $var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Showcase\V1beta1\TestRun::class); $this->test_runs = $arr; diff --git a/Gax/tests/Conformance/src/V1beta1/ReportSessionResponse/Result.php b/Gax/tests/Conformance/src/V1beta1/ReportSessionResponse/Result.php index 576b7affe255..aebfe3709e73 100644 --- a/Gax/tests/Conformance/src/V1beta1/ReportSessionResponse/Result.php +++ b/Gax/tests/Conformance/src/V1beta1/ReportSessionResponse/Result.php @@ -1,5 +1,6 @@ error = $var; return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/RestError/Status.php b/Gax/tests/Conformance/src/V1beta1/RestError/Status.php index b0c423c41c29..a9ee42543804 100644 --- a/Gax/tests/Conformance/src/V1beta1/RestError/Status.php +++ b/Gax/tests/Conformance/src/V1beta1/RestError/Status.php @@ -1,12 +1,13 @@ google.showcase.v1beta1.RestError.Status @@ -50,7 +51,7 @@ class Status extends \Google\Protobuf\Internal\Message * This corresponds to `google.rpc.Status.message`. * @type int $status * This is the enum version for `google.rpc.Status.code`. - * @type array<\Google\Protobuf\Any>|\Google\Protobuf\Internal\RepeatedField $details + * @type \Google\Protobuf\Any[] $details * This corresponds to `google.rpc.Status.details`. * } */ @@ -77,7 +78,7 @@ public function getCode() * @param int $var * @return $this */ - public function setCode($var) + public function setCode(int $var) { GPBUtil::checkInt32($var); $this->code = $var; @@ -103,9 +104,9 @@ public function getMessage() * @param string $var * @return $this */ - public function setMessage($var) + public function setMessage(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->message = $var; return $this; @@ -115,7 +116,7 @@ public function setMessage($var) * This is the enum version for `google.rpc.Status.code`. * * Generated from protobuf field .google.rpc.Code status = 4; - * @return int + * @return int one of the values in {@see \Google\Rpc\Code} */ public function getStatus() { @@ -126,10 +127,10 @@ public function getStatus() * This is the enum version for `google.rpc.Status.code`. * * Generated from protobuf field .google.rpc.Code status = 4; - * @param int $var + * @param int $var one of the values in {@see \Google\Rpc\Code} * @return $this */ - public function setStatus($var) + public function setStatus(int $var) { GPBUtil::checkEnum($var, \Google\Rpc\Code::class); $this->status = $var; @@ -141,7 +142,7 @@ public function setStatus($var) * This corresponds to `google.rpc.Status.details`. * * Generated from protobuf field repeated .google.protobuf.Any details = 5; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField<\Google\Protobuf\Any> */ public function getDetails() { @@ -152,10 +153,10 @@ public function getDetails() * This corresponds to `google.rpc.Status.details`. * * Generated from protobuf field repeated .google.protobuf.Any details = 5; - * @param array<\Google\Protobuf\Any>|\Google\Protobuf\Internal\RepeatedField $var + * @param \Google\Protobuf\Any[] $var * @return $this */ - public function setDetails($var) + public function setDetails(array|RepeatedField $var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Any::class); $this->details = $arr; @@ -165,6 +166,3 @@ public function setDetails($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Status::class, \Google\Showcase\V1beta1\RestError_Status::class); - diff --git a/Gax/tests/Conformance/src/V1beta1/Room.php b/Gax/tests/Conformance/src/V1beta1/Room.php index cb105c98b0e9..74b5f4f33ef1 100644 --- a/Gax/tests/Conformance/src/V1beta1/Room.php +++ b/Gax/tests/Conformance/src/V1beta1/Room.php @@ -1,12 +1,13 @@ name = $var; return $this; @@ -113,9 +114,9 @@ public function getDisplayName() * @param string $var * @return $this */ - public function setDisplayName($var) + public function setDisplayName(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->display_name = $var; return $this; @@ -139,9 +140,9 @@ public function getDescription() * @param string $var * @return $this */ - public function setDescription($var) + public function setDescription(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->description = $var; return $this; @@ -175,9 +176,8 @@ public function clearCreateTime() * @param \Google\Protobuf\Timestamp $var * @return $this */ - public function setCreateTime($var) + public function setCreateTime(\Google\Protobuf\Timestamp|null $var) { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); $this->create_time = $var; return $this; @@ -211,9 +211,8 @@ public function clearUpdateTime() * @param \Google\Protobuf\Timestamp $var * @return $this */ - public function setUpdateTime($var) + public function setUpdateTime(\Google\Protobuf\Timestamp|null $var) { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); $this->update_time = $var; return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/SearchBlurbsMetadata.php b/Gax/tests/Conformance/src/V1beta1/SearchBlurbsMetadata.php index ec8ff0507c2f..259a95fd3d7a 100644 --- a/Gax/tests/Conformance/src/V1beta1/SearchBlurbsMetadata.php +++ b/Gax/tests/Conformance/src/V1beta1/SearchBlurbsMetadata.php @@ -1,12 +1,13 @@ retry_info = $var; return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/SearchBlurbsRequest.php b/Gax/tests/Conformance/src/V1beta1/SearchBlurbsRequest.php index 984f508bf4cd..735cba906814 100644 --- a/Gax/tests/Conformance/src/V1beta1/SearchBlurbsRequest.php +++ b/Gax/tests/Conformance/src/V1beta1/SearchBlurbsRequest.php @@ -1,12 +1,13 @@ setParent($parent) - ->setQuery($query); - } - /** * Constructor. * @@ -113,9 +97,9 @@ public function getQuery() * @param string $var * @return $this */ - public function setQuery($var) + public function setQuery(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->query = $var; return $this; @@ -141,9 +125,9 @@ public function getParent() * @param string $var * @return $this */ - public function setParent($var) + public function setParent(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->parent = $var; return $this; @@ -171,7 +155,7 @@ public function getPageSize() * @param int $var * @return $this */ - public function setPageSize($var) + public function setPageSize(int $var) { GPBUtil::checkInt32($var); $this->page_size = $var; @@ -203,9 +187,9 @@ public function getPageToken() * @param string $var * @return $this */ - public function setPageToken($var) + public function setPageToken(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->page_token = $var; return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/SearchBlurbsResponse.php b/Gax/tests/Conformance/src/V1beta1/SearchBlurbsResponse.php index b0fc9b703e16..26a535edd678 100644 --- a/Gax/tests/Conformance/src/V1beta1/SearchBlurbsResponse.php +++ b/Gax/tests/Conformance/src/V1beta1/SearchBlurbsResponse.php @@ -1,12 +1,13 @@ |\Google\Protobuf\Internal\RepeatedField $blurbs + * @type \Google\Showcase\V1beta1\Blurb[] $blurbs * Blurbs that matched the search query. * @type string $next_page_token * A token to retrieve next page of results. @@ -56,7 +57,7 @@ public function __construct($data = NULL) { * Blurbs that matched the search query. * * Generated from protobuf field repeated .google.showcase.v1beta1.Blurb blurbs = 1; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField<\Google\Showcase\V1beta1\Blurb> */ public function getBlurbs() { @@ -67,10 +68,10 @@ public function getBlurbs() * Blurbs that matched the search query. * * Generated from protobuf field repeated .google.showcase.v1beta1.Blurb blurbs = 1; - * @param array<\Google\Showcase\V1beta1\Blurb>|\Google\Protobuf\Internal\RepeatedField $var + * @param \Google\Showcase\V1beta1\Blurb[] $var * @return $this */ - public function setBlurbs($var) + public function setBlurbs(array|RepeatedField $var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Showcase\V1beta1\Blurb::class); $this->blurbs = $arr; @@ -102,9 +103,9 @@ public function getNextPageToken() * @param string $var * @return $this */ - public function setNextPageToken($var) + public function setNextPageToken(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->next_page_token = $var; return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/SendBlurbsResponse.php b/Gax/tests/Conformance/src/V1beta1/SendBlurbsResponse.php index 3fd5a005b8b2..d6cdb619668b 100644 --- a/Gax/tests/Conformance/src/V1beta1/SendBlurbsResponse.php +++ b/Gax/tests/Conformance/src/V1beta1/SendBlurbsResponse.php @@ -1,12 +1,13 @@ |\Google\Protobuf\Internal\RepeatedField $names + * @type string[] $names * The names of successful blurb creations. * } */ @@ -42,7 +43,7 @@ public function __construct($data = NULL) { * The names of successful blurb creations. * * Generated from protobuf field repeated string names = 1; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField */ public function getNames() { @@ -53,10 +54,10 @@ public function getNames() * The names of successful blurb creations. * * Generated from protobuf field repeated string names = 1; - * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @param string[] $var * @return $this */ - public function setNames($var) + public function setNames(array|RepeatedField $var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); $this->names = $arr; diff --git a/Gax/tests/Conformance/src/V1beta1/Sequence.php b/Gax/tests/Conformance/src/V1beta1/Sequence.php index b8565b20374c..ea943aa252b8 100644 --- a/Gax/tests/Conformance/src/V1beta1/Sequence.php +++ b/Gax/tests/Conformance/src/V1beta1/Sequence.php @@ -1,14 +1,17 @@ google.showcase.v1beta1.Sequence */ class Sequence extends \Google\Protobuf\Internal\Message @@ -32,7 +35,7 @@ class Sequence extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $name - * @type array<\Google\Showcase\V1beta1\Sequence\Response>|\Google\Protobuf\Internal\RepeatedField $responses + * @type \Google\Showcase\V1beta1\Sequence\Response[] $responses * Sequence of responses to return in order for each attempt. If empty, the * default response is an immediate OK. * } @@ -56,9 +59,9 @@ public function getName() * @param string $var * @return $this */ - public function setName($var) + public function setName(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->name = $var; return $this; @@ -69,7 +72,7 @@ public function setName($var) * default response is an immediate OK. * * Generated from protobuf field repeated .google.showcase.v1beta1.Sequence.Response responses = 2; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField<\Google\Showcase\V1beta1\Sequence\Response> */ public function getResponses() { @@ -81,10 +84,10 @@ public function getResponses() * default response is an immediate OK. * * Generated from protobuf field repeated .google.showcase.v1beta1.Sequence.Response responses = 2; - * @param array<\Google\Showcase\V1beta1\Sequence\Response>|\Google\Protobuf\Internal\RepeatedField $var + * @param \Google\Showcase\V1beta1\Sequence\Response[] $var * @return $this */ - public function setResponses($var) + public function setResponses(array|RepeatedField $var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Showcase\V1beta1\Sequence\Response::class); $this->responses = $arr; diff --git a/Gax/tests/Conformance/src/V1beta1/Sequence/Response.php b/Gax/tests/Conformance/src/V1beta1/Sequence/Response.php index 5db17b668970..415ffc4d553a 100644 --- a/Gax/tests/Conformance/src/V1beta1/Sequence/Response.php +++ b/Gax/tests/Conformance/src/V1beta1/Sequence/Response.php @@ -1,12 +1,13 @@ status = $var; return $this; @@ -109,9 +109,8 @@ public function clearDelay() * @param \Google\Protobuf\Duration $var * @return $this */ - public function setDelay($var) + public function setDelay(\Google\Protobuf\Duration|null $var) { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); $this->delay = $var; return $this; @@ -119,6 +118,3 @@ public function setDelay($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Response::class, \Google\Showcase\V1beta1\Sequence_Response::class); - diff --git a/Gax/tests/Conformance/src/V1beta1/SequenceReport.php b/Gax/tests/Conformance/src/V1beta1/SequenceReport.php index 990664340637..e7ee91b14805 100644 --- a/Gax/tests/Conformance/src/V1beta1/SequenceReport.php +++ b/Gax/tests/Conformance/src/V1beta1/SequenceReport.php @@ -1,14 +1,17 @@ google.showcase.v1beta1.SequenceReport */ class SequenceReport extends \Google\Protobuf\Internal\Message @@ -31,7 +34,7 @@ class SequenceReport extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $name - * @type array<\Google\Showcase\V1beta1\SequenceReport\Attempt>|\Google\Protobuf\Internal\RepeatedField $attempts + * @type \Google\Showcase\V1beta1\SequenceReport\Attempt[] $attempts * The set of RPC attempts received by the server for a Sequence. * } */ @@ -54,9 +57,9 @@ public function getName() * @param string $var * @return $this */ - public function setName($var) + public function setName(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->name = $var; return $this; @@ -66,7 +69,7 @@ public function setName($var) * The set of RPC attempts received by the server for a Sequence. * * Generated from protobuf field repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField<\Google\Showcase\V1beta1\SequenceReport\Attempt> */ public function getAttempts() { @@ -77,10 +80,10 @@ public function getAttempts() * The set of RPC attempts received by the server for a Sequence. * * Generated from protobuf field repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; - * @param array<\Google\Showcase\V1beta1\SequenceReport\Attempt>|\Google\Protobuf\Internal\RepeatedField $var + * @param \Google\Showcase\V1beta1\SequenceReport\Attempt[] $var * @return $this */ - public function setAttempts($var) + public function setAttempts(array|RepeatedField $var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Showcase\V1beta1\SequenceReport\Attempt::class); $this->attempts = $arr; diff --git a/Gax/tests/Conformance/src/V1beta1/SequenceReport/Attempt.php b/Gax/tests/Conformance/src/V1beta1/SequenceReport/Attempt.php index 9142d4c85ab3..fd7b5f51bfc7 100644 --- a/Gax/tests/Conformance/src/V1beta1/SequenceReport/Attempt.php +++ b/Gax/tests/Conformance/src/V1beta1/SequenceReport/Attempt.php @@ -1,12 +1,13 @@ attempt_number = $var; @@ -127,9 +128,8 @@ public function clearAttemptDeadline() * @param \Google\Protobuf\Timestamp $var * @return $this */ - public function setAttemptDeadline($var) + public function setAttemptDeadline(\Google\Protobuf\Timestamp|null $var) { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); $this->attempt_deadline = $var; return $this; @@ -165,9 +165,8 @@ public function clearResponseTime() * @param \Google\Protobuf\Timestamp $var * @return $this */ - public function setResponseTime($var) + public function setResponseTime(\Google\Protobuf\Timestamp|null $var) { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); $this->response_time = $var; return $this; @@ -203,9 +202,8 @@ public function clearAttemptDelay() * @param \Google\Protobuf\Duration $var * @return $this */ - public function setAttemptDelay($var) + public function setAttemptDelay(\Google\Protobuf\Duration|null $var) { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); $this->attempt_delay = $var; return $this; @@ -239,9 +237,8 @@ public function clearStatus() * @param \Google\Rpc\Status $var * @return $this */ - public function setStatus($var) + public function setStatus(\Google\Rpc\Status|null $var) { - GPBUtil::checkMessage($var, \Google\Rpc\Status::class); $this->status = $var; return $this; @@ -249,6 +246,3 @@ public function setStatus($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Attempt::class, \Google\Showcase\V1beta1\SequenceReport_Attempt::class); - diff --git a/Gax/tests/Conformance/src/V1beta1/Session.php b/Gax/tests/Conformance/src/V1beta1/Session.php index bf4479084084..c5a2c1e728e5 100644 --- a/Gax/tests/Conformance/src/V1beta1/Session.php +++ b/Gax/tests/Conformance/src/V1beta1/Session.php @@ -1,12 +1,13 @@ name = $var; return $this; @@ -82,7 +83,7 @@ public function setName($var) * Required. The version this session is using. * * Generated from protobuf field .google.showcase.v1beta1.Session.Version version = 2; - * @return int + * @return int one of the values in {@see \Google\Showcase\V1beta1\Session\Version} */ public function getVersion() { @@ -93,10 +94,10 @@ public function getVersion() * Required. The version this session is using. * * Generated from protobuf field .google.showcase.v1beta1.Session.Version version = 2; - * @param int $var + * @param int $var one of the values in {@see \Google\Showcase\V1beta1\Session\Version} * @return $this */ - public function setVersion($var) + public function setVersion(int $var) { GPBUtil::checkEnum($var, \Google\Showcase\V1beta1\Session\Version::class); $this->version = $var; diff --git a/Gax/tests/Conformance/src/V1beta1/Session/Version.php b/Gax/tests/Conformance/src/V1beta1/Session/Version.php index 528e966e3078..b91d7521d721 100644 --- a/Gax/tests/Conformance/src/V1beta1/Session/Version.php +++ b/Gax/tests/Conformance/src/V1beta1/Session/Version.php @@ -1,5 +1,6 @@ name = $var; return $this; @@ -100,9 +101,8 @@ public function clearExpireTime() * @param \Google\Protobuf\Timestamp $var * @return $this */ - public function setExpireTime($var) + public function setExpireTime(\Google\Protobuf\Timestamp|null $var) { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); $this->expire_time = $var; return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/StreamBlurbsResponse.php b/Gax/tests/Conformance/src/V1beta1/StreamBlurbsResponse.php index 673ee59d1e78..15f9c330d53c 100644 --- a/Gax/tests/Conformance/src/V1beta1/StreamBlurbsResponse.php +++ b/Gax/tests/Conformance/src/V1beta1/StreamBlurbsResponse.php @@ -1,12 +1,13 @@ blurb = $var; return $this; @@ -86,7 +86,7 @@ public function setBlurb($var) * The action that triggered the blurb to be returned. * * Generated from protobuf field .google.showcase.v1beta1.StreamBlurbsResponse.Action action = 2; - * @return int + * @return int one of the values in {@see \Google\Showcase\V1beta1\StreamBlurbsResponse\Action} */ public function getAction() { @@ -97,10 +97,10 @@ public function getAction() * The action that triggered the blurb to be returned. * * Generated from protobuf field .google.showcase.v1beta1.StreamBlurbsResponse.Action action = 2; - * @param int $var + * @param int $var one of the values in {@see \Google\Showcase\V1beta1\StreamBlurbsResponse\Action} * @return $this */ - public function setAction($var) + public function setAction(int $var) { GPBUtil::checkEnum($var, \Google\Showcase\V1beta1\StreamBlurbsResponse\Action::class); $this->action = $var; diff --git a/Gax/tests/Conformance/src/V1beta1/StreamBlurbsResponse/Action.php b/Gax/tests/Conformance/src/V1beta1/StreamBlurbsResponse/Action.php index d7edf0a6b270..b3f82326dbd5 100644 --- a/Gax/tests/Conformance/src/V1beta1/StreamBlurbsResponse/Action.php +++ b/Gax/tests/Conformance/src/V1beta1/StreamBlurbsResponse/Action.php @@ -1,5 +1,6 @@ google.showcase.v1beta1.StreamingSequence */ class StreamingSequence extends \Google\Protobuf\Internal\Message { /** + * The name of the streaming sequence. + * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ protected $name = ''; /** - * The Content that the stream will send + * The content that the stream will send + * this was specified when the sequence was created * * Generated from protobuf field string content = 2; */ @@ -38,9 +45,11 @@ class StreamingSequence extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $name + * The name of the streaming sequence. * @type string $content - * The Content that the stream will send - * @type array<\Google\Showcase\V1beta1\StreamingSequence\Response>|\Google\Protobuf\Internal\RepeatedField $responses + * The content that the stream will send + * this was specified when the sequence was created + * @type \Google\Showcase\V1beta1\StreamingSequence\Response[] $responses * Sequence of responses to return in order for each attempt. If empty, the * default response is an immediate OK. * } @@ -51,6 +60,8 @@ public function __construct($data = NULL) { } /** + * The name of the streaming sequence. + * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @return string */ @@ -60,20 +71,23 @@ public function getName() } /** + * The name of the streaming sequence. + * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @param string $var * @return $this */ - public function setName($var) + public function setName(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->name = $var; return $this; } /** - * The Content that the stream will send + * The content that the stream will send + * this was specified when the sequence was created * * Generated from protobuf field string content = 2; * @return string @@ -84,15 +98,16 @@ public function getContent() } /** - * The Content that the stream will send + * The content that the stream will send + * this was specified when the sequence was created * * Generated from protobuf field string content = 2; * @param string $var * @return $this */ - public function setContent($var) + public function setContent(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->content = $var; return $this; @@ -103,7 +118,7 @@ public function setContent($var) * default response is an immediate OK. * * Generated from protobuf field repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField<\Google\Showcase\V1beta1\StreamingSequence\Response> */ public function getResponses() { @@ -115,10 +130,10 @@ public function getResponses() * default response is an immediate OK. * * Generated from protobuf field repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; - * @param array<\Google\Showcase\V1beta1\StreamingSequence\Response>|\Google\Protobuf\Internal\RepeatedField $var + * @param \Google\Showcase\V1beta1\StreamingSequence\Response[] $var * @return $this */ - public function setResponses($var) + public function setResponses(array|RepeatedField $var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Showcase\V1beta1\StreamingSequence\Response::class); $this->responses = $arr; diff --git a/Gax/tests/Conformance/src/V1beta1/StreamingSequence/Response.php b/Gax/tests/Conformance/src/V1beta1/StreamingSequence/Response.php index fde26643cd1e..889f676d4157 100644 --- a/Gax/tests/Conformance/src/V1beta1/StreamingSequence/Response.php +++ b/Gax/tests/Conformance/src/V1beta1/StreamingSequence/Response.php @@ -1,12 +1,13 @@ int32 response_index = 3; */ @@ -45,7 +46,7 @@ class Response extends \Google\Protobuf\Internal\Message * @type \Google\Protobuf\Duration $delay * The amount of time to delay sending the response. * @type int $response_index - * The index that the status should be sent + * The index that the status should be sent at * } */ public function __construct($data = NULL) { @@ -81,9 +82,8 @@ public function clearStatus() * @param \Google\Rpc\Status $var * @return $this */ - public function setStatus($var) + public function setStatus(\Google\Rpc\Status|null $var) { - GPBUtil::checkMessage($var, \Google\Rpc\Status::class); $this->status = $var; return $this; @@ -117,16 +117,15 @@ public function clearDelay() * @param \Google\Protobuf\Duration $var * @return $this */ - public function setDelay($var) + public function setDelay(\Google\Protobuf\Duration|null $var) { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); $this->delay = $var; return $this; } /** - * The index that the status should be sent + * The index that the status should be sent at * * Generated from protobuf field int32 response_index = 3; * @return int @@ -137,13 +136,13 @@ public function getResponseIndex() } /** - * The index that the status should be sent + * The index that the status should be sent at * * Generated from protobuf field int32 response_index = 3; * @param int $var * @return $this */ - public function setResponseIndex($var) + public function setResponseIndex(int $var) { GPBUtil::checkInt32($var); $this->response_index = $var; @@ -153,6 +152,3 @@ public function setResponseIndex($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Response::class, \Google\Showcase\V1beta1\StreamingSequence_Response::class); - diff --git a/Gax/tests/Conformance/src/V1beta1/StreamingSequenceReport.php b/Gax/tests/Conformance/src/V1beta1/StreamingSequenceReport.php index 6ed3e26d15e6..386f86b1f0d9 100644 --- a/Gax/tests/Conformance/src/V1beta1/StreamingSequenceReport.php +++ b/Gax/tests/Conformance/src/V1beta1/StreamingSequenceReport.php @@ -1,14 +1,17 @@ google.showcase.v1beta1.StreamingSequenceReport */ class StreamingSequenceReport extends \Google\Protobuf\Internal\Message @@ -31,7 +34,7 @@ class StreamingSequenceReport extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $name - * @type array<\Google\Showcase\V1beta1\StreamingSequenceReport\Attempt>|\Google\Protobuf\Internal\RepeatedField $attempts + * @type \Google\Showcase\V1beta1\StreamingSequenceReport\Attempt[] $attempts * The set of RPC attempts received by the server for a Sequence. * } */ @@ -54,9 +57,9 @@ public function getName() * @param string $var * @return $this */ - public function setName($var) + public function setName(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->name = $var; return $this; @@ -66,7 +69,7 @@ public function setName($var) * The set of RPC attempts received by the server for a Sequence. * * Generated from protobuf field repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField<\Google\Showcase\V1beta1\StreamingSequenceReport\Attempt> */ public function getAttempts() { @@ -77,10 +80,10 @@ public function getAttempts() * The set of RPC attempts received by the server for a Sequence. * * Generated from protobuf field repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; - * @param array<\Google\Showcase\V1beta1\StreamingSequenceReport\Attempt>|\Google\Protobuf\Internal\RepeatedField $var + * @param \Google\Showcase\V1beta1\StreamingSequenceReport\Attempt[] $var * @return $this */ - public function setAttempts($var) + public function setAttempts(array|RepeatedField $var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Showcase\V1beta1\StreamingSequenceReport\Attempt::class); $this->attempts = $arr; diff --git a/Gax/tests/Conformance/src/V1beta1/StreamingSequenceReport/Attempt.php b/Gax/tests/Conformance/src/V1beta1/StreamingSequenceReport/Attempt.php index 605fceee9e66..53ae6fb56656 100644 --- a/Gax/tests/Conformance/src/V1beta1/StreamingSequenceReport/Attempt.php +++ b/Gax/tests/Conformance/src/V1beta1/StreamingSequenceReport/Attempt.php @@ -1,12 +1,13 @@ attempt_number = $var; @@ -127,9 +128,8 @@ public function clearAttemptDeadline() * @param \Google\Protobuf\Timestamp $var * @return $this */ - public function setAttemptDeadline($var) + public function setAttemptDeadline(\Google\Protobuf\Timestamp|null $var) { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); $this->attempt_deadline = $var; return $this; @@ -165,9 +165,8 @@ public function clearResponseTime() * @param \Google\Protobuf\Timestamp $var * @return $this */ - public function setResponseTime($var) + public function setResponseTime(\Google\Protobuf\Timestamp|null $var) { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); $this->response_time = $var; return $this; @@ -203,9 +202,8 @@ public function clearAttemptDelay() * @param \Google\Protobuf\Duration $var * @return $this */ - public function setAttemptDelay($var) + public function setAttemptDelay(\Google\Protobuf\Duration|null $var) { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); $this->attempt_delay = $var; return $this; @@ -239,9 +237,8 @@ public function clearStatus() * @param \Google\Rpc\Status $var * @return $this */ - public function setStatus($var) + public function setStatus(\Google\Rpc\Status|null $var) { - GPBUtil::checkMessage($var, \Google\Rpc\Status::class); $this->status = $var; return $this; @@ -249,6 +246,3 @@ public function setStatus($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Attempt::class, \Google\Showcase\V1beta1\StreamingSequenceReport_Attempt::class); - diff --git a/Gax/tests/Conformance/src/V1beta1/Test.php b/Gax/tests/Conformance/src/V1beta1/Test.php index 40235941a98a..1c6f08e05e12 100644 --- a/Gax/tests/Conformance/src/V1beta1/Test.php +++ b/Gax/tests/Conformance/src/V1beta1/Test.php @@ -1,12 +1,13 @@ google.showcase.v1beta1.Test @@ -15,7 +16,7 @@ class Test extends \Google\Protobuf\Internal\Message { /** * The name of the test. - * The tests/* portion of the names are hard-coded, and do not change + * The tests/* portion of the names are hard-coded, and do not change * from session to session. * * Generated from protobuf field string name = 1; @@ -51,13 +52,13 @@ class Test extends \Google\Protobuf\Internal\Message * * @type string $name * The name of the test. - * The tests/* portion of the names are hard-coded, and do not change + * The tests/* portion of the names are hard-coded, and do not change * from session to session. * @type int $expectation_level * The expectation level for this test. * @type string $description * A description of the test. - * @type array<\Google\Showcase\V1beta1\Test\Blueprint>|\Google\Protobuf\Internal\RepeatedField $blueprints + * @type \Google\Showcase\V1beta1\Test\Blueprint[] $blueprints * The blueprints that will satisfy this test. There may be multiple blueprints * that can signal to the server that this test case is being exercised. Although * multiple blueprints are specified, only a single blueprint needs to be run to @@ -71,7 +72,7 @@ public function __construct($data = NULL) { /** * The name of the test. - * The tests/* portion of the names are hard-coded, and do not change + * The tests/* portion of the names are hard-coded, and do not change * from session to session. * * Generated from protobuf field string name = 1; @@ -84,16 +85,16 @@ public function getName() /** * The name of the test. - * The tests/* portion of the names are hard-coded, and do not change + * The tests/* portion of the names are hard-coded, and do not change * from session to session. * * Generated from protobuf field string name = 1; * @param string $var * @return $this */ - public function setName($var) + public function setName(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->name = $var; return $this; @@ -103,7 +104,7 @@ public function setName($var) * The expectation level for this test. * * Generated from protobuf field .google.showcase.v1beta1.Test.ExpectationLevel expectation_level = 2; - * @return int + * @return int one of the values in {@see \Google\Showcase\V1beta1\Test\ExpectationLevel} */ public function getExpectationLevel() { @@ -114,10 +115,10 @@ public function getExpectationLevel() * The expectation level for this test. * * Generated from protobuf field .google.showcase.v1beta1.Test.ExpectationLevel expectation_level = 2; - * @param int $var + * @param int $var one of the values in {@see \Google\Showcase\V1beta1\Test\ExpectationLevel} * @return $this */ - public function setExpectationLevel($var) + public function setExpectationLevel(int $var) { GPBUtil::checkEnum($var, \Google\Showcase\V1beta1\Test\ExpectationLevel::class); $this->expectation_level = $var; @@ -143,9 +144,9 @@ public function getDescription() * @param string $var * @return $this */ - public function setDescription($var) + public function setDescription(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->description = $var; return $this; @@ -158,7 +159,7 @@ public function setDescription($var) * signal that the test case was exercised. * * Generated from protobuf field repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField<\Google\Showcase\V1beta1\Test\Blueprint> */ public function getBlueprints() { @@ -172,10 +173,10 @@ public function getBlueprints() * signal that the test case was exercised. * * Generated from protobuf field repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; - * @param array<\Google\Showcase\V1beta1\Test\Blueprint>|\Google\Protobuf\Internal\RepeatedField $var + * @param \Google\Showcase\V1beta1\Test\Blueprint[] $var * @return $this */ - public function setBlueprints($var) + public function setBlueprints(array|RepeatedField $var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Showcase\V1beta1\Test\Blueprint::class); $this->blueprints = $arr; diff --git a/Gax/tests/Conformance/src/V1beta1/Test/Blueprint.php b/Gax/tests/Conformance/src/V1beta1/Test/Blueprint.php index fed874389a58..33ffe8fe5612 100644 --- a/Gax/tests/Conformance/src/V1beta1/Test/Blueprint.php +++ b/Gax/tests/Conformance/src/V1beta1/Test/Blueprint.php @@ -1,12 +1,13 @@ |\Google\Protobuf\Internal\RepeatedField $additional_requests + * @type \Google\Showcase\V1beta1\Test\Blueprint\Invocation[] $additional_requests * An ordered list of method calls that can be called to trigger this test. * } */ @@ -82,9 +83,9 @@ public function getName() * @param string $var * @return $this */ - public function setName($var) + public function setName(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->name = $var; return $this; @@ -108,9 +109,9 @@ public function getDescription() * @param string $var * @return $this */ - public function setDescription($var) + public function setDescription(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->description = $var; return $this; @@ -144,9 +145,8 @@ public function clearRequest() * @param \Google\Showcase\V1beta1\Test\Blueprint\Invocation $var * @return $this */ - public function setRequest($var) + public function setRequest(\Google\Showcase\V1beta1\Test\Blueprint\Invocation|null $var) { - GPBUtil::checkMessage($var, \Google\Showcase\V1beta1\Test\Blueprint\Invocation::class); $this->request = $var; return $this; @@ -156,7 +156,7 @@ public function setRequest($var) * An ordered list of method calls that can be called to trigger this test. * * Generated from protobuf field repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField<\Google\Showcase\V1beta1\Test\Blueprint\Invocation> */ public function getAdditionalRequests() { @@ -167,10 +167,10 @@ public function getAdditionalRequests() * An ordered list of method calls that can be called to trigger this test. * * Generated from protobuf field repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; - * @param array<\Google\Showcase\V1beta1\Test\Blueprint\Invocation>|\Google\Protobuf\Internal\RepeatedField $var + * @param \Google\Showcase\V1beta1\Test\Blueprint\Invocation[] $var * @return $this */ - public function setAdditionalRequests($var) + public function setAdditionalRequests(array|RepeatedField $var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Showcase\V1beta1\Test\Blueprint\Invocation::class); $this->additional_requests = $arr; @@ -180,6 +180,3 @@ public function setAdditionalRequests($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Blueprint::class, \Google\Showcase\V1beta1\Test_Blueprint::class); - diff --git a/Gax/tests/Conformance/src/V1beta1/Test/Blueprint/Invocation.php b/Gax/tests/Conformance/src/V1beta1/Test/Blueprint/Invocation.php index 825b65d320e8..0d83a4183ff9 100644 --- a/Gax/tests/Conformance/src/V1beta1/Test/Blueprint/Invocation.php +++ b/Gax/tests/Conformance/src/V1beta1/Test/Blueprint/Invocation.php @@ -1,12 +1,13 @@ method = $var; return $this; @@ -89,9 +90,9 @@ public function getSerializedRequest() * @param string $var * @return $this */ - public function setSerializedRequest($var) + public function setSerializedRequest(string $var) { - GPBUtil::checkString($var, False); + GPBUtil::checkString($var, false); $this->serialized_request = $var; return $this; @@ -99,6 +100,3 @@ public function setSerializedRequest($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Invocation::class, \Google\Showcase\V1beta1\Test_Blueprint_Invocation::class); - diff --git a/Gax/tests/Conformance/src/V1beta1/Test/ExpectationLevel.php b/Gax/tests/Conformance/src/V1beta1/Test/ExpectationLevel.php index 1910c84e8277..70cce12d14d0 100644 --- a/Gax/tests/Conformance/src/V1beta1/Test/ExpectationLevel.php +++ b/Gax/tests/Conformance/src/V1beta1/Test/ExpectationLevel.php @@ -1,5 +1,6 @@ string test = 1 [(.google.api.resource_reference) = { @@ -38,7 +39,7 @@ class TestRun extends \Google\Protobuf\Internal\Message * * @type string $test * The name of the test. - * The tests/* portion of the names are hard-coded, and do not change + * The tests/* portion of the names are hard-coded, and do not change * from session to session. * @type \Google\Showcase\V1beta1\Issue $issue * An issue found with the test run. If empty, this test run was successful. @@ -51,7 +52,7 @@ public function __construct($data = NULL) { /** * The name of the test. - * The tests/* portion of the names are hard-coded, and do not change + * The tests/* portion of the names are hard-coded, and do not change * from session to session. * * Generated from protobuf field string test = 1 [(.google.api.resource_reference) = { @@ -64,16 +65,16 @@ public function getTest() /** * The name of the test. - * The tests/* portion of the names are hard-coded, and do not change + * The tests/* portion of the names are hard-coded, and do not change * from session to session. * * Generated from protobuf field string test = 1 [(.google.api.resource_reference) = { * @param string $var * @return $this */ - public function setTest($var) + public function setTest(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->test = $var; return $this; @@ -107,9 +108,8 @@ public function clearIssue() * @param \Google\Showcase\V1beta1\Issue $var * @return $this */ - public function setIssue($var) + public function setIssue(\Google\Showcase\V1beta1\Issue|null $var) { - GPBUtil::checkMessage($var, \Google\Showcase\V1beta1\Issue::class); $this->issue = $var; return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/UpdateBlurbRequest.php b/Gax/tests/Conformance/src/V1beta1/UpdateBlurbRequest.php index e60ef17a0e28..20789d98c2bc 100644 --- a/Gax/tests/Conformance/src/V1beta1/UpdateBlurbRequest.php +++ b/Gax/tests/Conformance/src/V1beta1/UpdateBlurbRequest.php @@ -1,12 +1,13 @@ blurb = $var; return $this; @@ -114,9 +114,8 @@ public function clearUpdateMask() * @param \Google\Protobuf\FieldMask $var * @return $this */ - public function setUpdateMask($var) + public function setUpdateMask(\Google\Protobuf\FieldMask|null $var) { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); $this->update_mask = $var; return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/UpdateRoomRequest.php b/Gax/tests/Conformance/src/V1beta1/UpdateRoomRequest.php index 647556e88178..0a7954bd20b6 100644 --- a/Gax/tests/Conformance/src/V1beta1/UpdateRoomRequest.php +++ b/Gax/tests/Conformance/src/V1beta1/UpdateRoomRequest.php @@ -1,12 +1,13 @@ room = $var; return $this; @@ -114,9 +114,8 @@ public function clearUpdateMask() * @param \Google\Protobuf\FieldMask $var * @return $this */ - public function setUpdateMask($var) + public function setUpdateMask(\Google\Protobuf\FieldMask|null $var) { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); $this->update_mask = $var; return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/UpdateUserRequest.php b/Gax/tests/Conformance/src/V1beta1/UpdateUserRequest.php index 95b45a4e86a9..11feb9c90e00 100644 --- a/Gax/tests/Conformance/src/V1beta1/UpdateUserRequest.php +++ b/Gax/tests/Conformance/src/V1beta1/UpdateUserRequest.php @@ -1,12 +1,13 @@ user = $var; return $this; @@ -114,9 +114,8 @@ public function clearUpdateMask() * @param \Google\Protobuf\FieldMask $var * @return $this */ - public function setUpdateMask($var) + public function setUpdateMask(\Google\Protobuf\FieldMask|null $var) { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); $this->update_mask = $var; return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/User.php b/Gax/tests/Conformance/src/V1beta1/User.php index e0898a7c3d47..6a55faeeece7 100644 --- a/Gax/tests/Conformance/src/V1beta1/User.php +++ b/Gax/tests/Conformance/src/V1beta1/User.php @@ -1,12 +1,13 @@ name = $var; return $this; @@ -153,9 +154,9 @@ public function getDisplayName() * @param string $var * @return $this */ - public function setDisplayName($var) + public function setDisplayName(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->display_name = $var; return $this; @@ -179,9 +180,9 @@ public function getEmail() * @param string $var * @return $this */ - public function setEmail($var) + public function setEmail(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->email = $var; return $this; @@ -215,9 +216,8 @@ public function clearCreateTime() * @param \Google\Protobuf\Timestamp $var * @return $this */ - public function setCreateTime($var) + public function setCreateTime(\Google\Protobuf\Timestamp|null $var) { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); $this->create_time = $var; return $this; @@ -251,9 +251,8 @@ public function clearUpdateTime() * @param \Google\Protobuf\Timestamp $var * @return $this */ - public function setUpdateTime($var) + public function setUpdateTime(\Google\Protobuf\Timestamp|null $var) { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); $this->update_time = $var; return $this; @@ -287,7 +286,7 @@ public function clearAge() * @param int $var * @return $this */ - public function setAge($var) + public function setAge(int $var) { GPBUtil::checkInt32($var); $this->age = $var; @@ -323,9 +322,8 @@ public function clearHeightFeet() * @param float $var * @return $this */ - public function setHeightFeet($var) + public function setHeightFeet(float $var) { - GPBUtil::checkDouble($var); $this->height_feet = $var; return $this; @@ -363,9 +361,9 @@ public function clearNickname() * @param string $var * @return $this */ - public function setNickname($var) + public function setNickname(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->nickname = $var; return $this; @@ -403,9 +401,8 @@ public function clearEnableNotifications() * @param bool $var * @return $this */ - public function setEnableNotifications($var) + public function setEnableNotifications(bool $var) { - GPBUtil::checkBool($var); $this->enable_notifications = $var; return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/VerifyTestRequest.php b/Gax/tests/Conformance/src/V1beta1/VerifyTestRequest.php index 6e05fcf74ce6..af7912e697b6 100644 --- a/Gax/tests/Conformance/src/V1beta1/VerifyTestRequest.php +++ b/Gax/tests/Conformance/src/V1beta1/VerifyTestRequest.php @@ -1,12 +1,13 @@ google.showcase.v1beta1.VerifyTestRequest @@ -42,7 +43,7 @@ class VerifyTestRequest extends \Google\Protobuf\Internal\Message * The test to have an answer registered to it. * @type string $answer * The answer from the test. - * @type array|\Google\Protobuf\Internal\RepeatedField $answers + * @type string[] $answers * The answers from the test if multiple are to be checked * } */ @@ -69,9 +70,9 @@ public function getName() * @param string $var * @return $this */ - public function setName($var) + public function setName(string $var) { - GPBUtil::checkString($var, True); + GPBUtil::checkString($var, true); $this->name = $var; return $this; @@ -95,9 +96,9 @@ public function getAnswer() * @param string $var * @return $this */ - public function setAnswer($var) + public function setAnswer(string $var) { - GPBUtil::checkString($var, False); + GPBUtil::checkString($var, false); $this->answer = $var; return $this; @@ -107,7 +108,7 @@ public function setAnswer($var) * The answers from the test if multiple are to be checked * * Generated from protobuf field repeated bytes answers = 3; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField */ public function getAnswers() { @@ -118,10 +119,10 @@ public function getAnswers() * The answers from the test if multiple are to be checked * * Generated from protobuf field repeated bytes answers = 3; - * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @param string[] $var * @return $this */ - public function setAnswers($var) + public function setAnswers(array|RepeatedField $var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::BYTES); $this->answers = $arr; diff --git a/Gax/tests/Conformance/src/V1beta1/VerifyTestResponse.php b/Gax/tests/Conformance/src/V1beta1/VerifyTestResponse.php index 80f2d2009c61..beb873698916 100644 --- a/Gax/tests/Conformance/src/V1beta1/VerifyTestResponse.php +++ b/Gax/tests/Conformance/src/V1beta1/VerifyTestResponse.php @@ -1,12 +1,13 @@ google.showcase.v1beta1.VerifyTestResponse @@ -63,9 +64,8 @@ public function clearIssue() * @param \Google\Showcase\V1beta1\Issue $var * @return $this */ - public function setIssue($var) + public function setIssue(\Google\Showcase\V1beta1\Issue|null $var) { - GPBUtil::checkMessage($var, \Google\Showcase\V1beta1\Issue::class); $this->issue = $var; return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/WaitMetadata.php b/Gax/tests/Conformance/src/V1beta1/WaitMetadata.php index 83481a02ec1a..31f1284f2795 100644 --- a/Gax/tests/Conformance/src/V1beta1/WaitMetadata.php +++ b/Gax/tests/Conformance/src/V1beta1/WaitMetadata.php @@ -1,12 +1,13 @@ end_time = $var; return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/WaitRequest.php b/Gax/tests/Conformance/src/V1beta1/WaitRequest.php index d90348d2c9cf..a05b3801e1b9 100644 --- a/Gax/tests/Conformance/src/V1beta1/WaitRequest.php +++ b/Gax/tests/Conformance/src/V1beta1/WaitRequest.php @@ -1,12 +1,13 @@ writeOneof(1, $var); return $this; @@ -94,9 +94,8 @@ public function hasTtl() * @param \Google\Protobuf\Duration $var * @return $this */ - public function setTtl($var) + public function setTtl(\Google\Protobuf\Duration|null $var) { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); $this->writeOneof(4, $var); return $this; @@ -127,9 +126,8 @@ public function hasError() * @param \Google\Rpc\Status $var * @return $this */ - public function setError($var) + public function setError(\Google\Rpc\Status|null $var) { - GPBUtil::checkMessage($var, \Google\Rpc\Status::class); $this->writeOneof(2, $var); return $this; @@ -158,9 +156,8 @@ public function hasSuccess() * @param \Google\Showcase\V1beta1\WaitResponse $var * @return $this */ - public function setSuccess($var) + public function setSuccess(\Google\Showcase\V1beta1\WaitResponse|null $var) { - GPBUtil::checkMessage($var, \Google\Showcase\V1beta1\WaitResponse::class); $this->writeOneof(3, $var); return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/WaitResponse.php b/Gax/tests/Conformance/src/V1beta1/WaitResponse.php index 9d882e3012f9..e565b724520e 100644 --- a/Gax/tests/Conformance/src/V1beta1/WaitResponse.php +++ b/Gax/tests/Conformance/src/V1beta1/WaitResponse.php @@ -1,12 +1,13 @@ content = $var; return $this; diff --git a/Gax/tests/Conformance/src/V1beta1/gapic_metadata.json b/Gax/tests/Conformance/src/V1beta1/gapic_metadata.json index ae1e9b817740..2bedd20aaef0 100644 --- a/Gax/tests/Conformance/src/V1beta1/gapic_metadata.json +++ b/Gax/tests/Conformance/src/V1beta1/gapic_metadata.json @@ -126,7 +126,8 @@ } } } - } + }, + "apiVersion": "v1_20240408" }, "Identity": { "clients": { diff --git a/Gax/tests/Conformance/src/V1beta1/resources/compliance_descriptor_config.php b/Gax/tests/Conformance/src/V1beta1/resources/compliance_descriptor_config.php index e1e9126106fd..963e7dee225e 100644 --- a/Gax/tests/Conformance/src/V1beta1/resources/compliance_descriptor_config.php +++ b/Gax/tests/Conformance/src/V1beta1/resources/compliance_descriptor_config.php @@ -1,6 +1,6 @@ true, ]; diff --git a/Gax/tests/Conformance/src/V1beta1/resources/echo_descriptor_config.php b/Gax/tests/Conformance/src/V1beta1/resources/echo_descriptor_config.php index 63b503e5c1c5..784685cbba7c 100644 --- a/Gax/tests/Conformance/src/V1beta1/resources/echo_descriptor_config.php +++ b/Gax/tests/Conformance/src/V1beta1/resources/echo_descriptor_config.php @@ -1,6 +1,6 @@ [ + 'requestId' => \Google\Api\FieldInfo\Format::UUID4, + 'otherRequestId' => \Google\Api\FieldInfo\Format::UUID4, + ], ], 'EchoErrorDetails' => [ 'callType' => \Google\ApiCore\Call::UNARY_CALL, @@ -145,15 +149,7 @@ 'responseType' => 'Google\Showcase\V1beta1\PagedExpandResponse', ], 'PagedExpandLegacyMapped' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getAlphabetized', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'callType' => \Google\ApiCore\Call::UNARY_CALL, 'responseType' => 'Google\Showcase\V1beta1\PagedExpandLegacyMappedResponse', ], ], diff --git a/Gax/tests/Conformance/src/V1beta1/resources/echo_rest_client_config.php b/Gax/tests/Conformance/src/V1beta1/resources/echo_rest_client_config.php index f1a999b60fbf..70b815644deb 100644 --- a/Gax/tests/Conformance/src/V1beta1/resources/echo_rest_client_config.php +++ b/Gax/tests/Conformance/src/V1beta1/resources/echo_rest_client_config.php @@ -1,6 +1,6 @@ true, ]; diff --git a/Gax/tests/Conformance/src/V1beta1/resources/identity_descriptor_config.php b/Gax/tests/Conformance/src/V1beta1/resources/identity_descriptor_config.php index b544be013f13..73b3f625e43a 100644 --- a/Gax/tests/Conformance/src/V1beta1/resources/identity_descriptor_config.php +++ b/Gax/tests/Conformance/src/V1beta1/resources/identity_descriptor_config.php @@ -1,6 +1,6 @@ true, ]; diff --git a/Gax/tests/Conformance/src/V1beta1/resources/messaging_descriptor_config.php b/Gax/tests/Conformance/src/V1beta1/resources/messaging_descriptor_config.php index f29f84658c63..53691688a46c 100644 --- a/Gax/tests/Conformance/src/V1beta1/resources/messaging_descriptor_config.php +++ b/Gax/tests/Conformance/src/V1beta1/resources/messaging_descriptor_config.php @@ -1,6 +1,6 @@ [ - 'blurb' => 'users/{user}/blurbs/{blurb}', + 'blurb' => 'users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}', 'room' => 'rooms/{room}', 'roomBlurb' => 'rooms/{room}/blurbs/{blurb}', - 'roomLegacyRoom' => 'rooms/{room}/legacy_room/{legacy_room}', - 'roomLegacyRoomBlurb' => 'rooms/{room}/legacy_room/{legacy_room}/blurbs/{blurb}', + 'roomLegacyRoomBlurb' => 'rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}', 'user' => 'users/{user}', - 'userBlurb' => 'users/{user}/blurbs/{blurb}', - 'userBlurbLegacyUser' => 'users/{user}/blurbs/{blurb}/legacy/{legacy_user}', + 'userBlurb' => 'users/{user}/profile/blurbs/{blurb}', + 'userLegacyUserBlurb' => 'users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}', ], ], ], diff --git a/Gax/tests/Conformance/src/V1beta1/resources/messaging_rest_client_config.php b/Gax/tests/Conformance/src/V1beta1/resources/messaging_rest_client_config.php index 4b080078c321..a51ab0b44af9 100644 --- a/Gax/tests/Conformance/src/V1beta1/resources/messaging_rest_client_config.php +++ b/Gax/tests/Conformance/src/V1beta1/resources/messaging_rest_client_config.php @@ -1,6 +1,6 @@ true, ]; diff --git a/Gax/tests/Conformance/src/V1beta1/resources/sequence_service_descriptor_config.php b/Gax/tests/Conformance/src/V1beta1/resources/sequence_service_descriptor_config.php index 64096e0fe8bf..90bbf9d47dea 100644 --- a/Gax/tests/Conformance/src/V1beta1/resources/sequence_service_descriptor_config.php +++ b/Gax/tests/Conformance/src/V1beta1/resources/sequence_service_descriptor_config.php @@ -1,6 +1,6 @@ true, ]; diff --git a/Gax/tests/Conformance/src/V1beta1/resources/testing_descriptor_config.php b/Gax/tests/Conformance/src/V1beta1/resources/testing_descriptor_config.php index 6f62206cbe47..7b604c0134fe 100644 --- a/Gax/tests/Conformance/src/V1beta1/resources/testing_descriptor_config.php +++ b/Gax/tests/Conformance/src/V1beta1/resources/testing_descriptor_config.php @@ -1,6 +1,6 @@ true, ]; diff --git a/dev/composer.json b/dev/composer.json index 6c22b72e72a0..806c2220c8d8 100644 --- a/dev/composer.json +++ b/dev/composer.json @@ -21,6 +21,8 @@ } }, "require-dev": { + "google/gapic-generator": "dev-main", + "google/gapic-showcase": "dev-main", "phpunit/phpunit": "^9.0", "phpspec/prophecy-phpunit": "^2.0", "swaggest/json-schema": "^0.12.0", @@ -37,6 +39,25 @@ "google/cloud": "dev-parent" } } + }, + "gapic-generator": { + "type": "vcs", + "url": "https://github.com/googleapis/gapic-generator-php.git", + "options": { + "submodules": true + } + }, + "gapic-showcase": { + "type": "package", + "package": { + "name": "google/gapic-showcase", + "version": "dev-main", + "source": { + "url": "https://github.com/googleapis/gapic-showcase.git", + "type": "git", + "reference": "main" + } + } } }, "config": { diff --git a/dev/google-cloud b/dev/google-cloud index 9ca23d233153..cf7e68d33daf 100755 --- a/dev/google-cloud +++ b/dev/google-cloud @@ -30,6 +30,7 @@ use Google\Cloud\Dev\Command\ComponentUpdateCommand; use Google\Cloud\Dev\Command\ComponentUpdateReadmeSampleCommand; use Google\Cloud\Dev\Command\ComponentUpdateDepsCommand; use Google\Cloud\Dev\Command\DocFxCommand; +use Google\Cloud\Dev\Command\ShowcaseGenerateCommand; use Google\Cloud\Dev\Command\ReleaseInfoCommand; use Google\Cloud\Dev\Command\ReleaseVerifyCommand; use Google\Cloud\Dev\Command\RepoComplianceCommand; @@ -55,6 +56,7 @@ $app->add(new ComponentUpdateCommand($rootDirectory)); $app->add(new ComponentUpdateReadmeSampleCommand($rootDirectory)); $app->add(new ComponentUpdateDepsCommand()); $app->add(new DocFxCommand()); +$app->add(new ShowcaseGenerateCommand($rootDirectory)); $app->add(new ReleaseInfoCommand()); $app->add(new ReleaseVerifyCommand()); $app->add(new RepoComplianceCommand()); diff --git a/dev/src/Command/ShowcaseGenerateCommand.php b/dev/src/Command/ShowcaseGenerateCommand.php new file mode 100644 index 000000000000..2d74e5605be1 --- /dev/null +++ b/dev/src/Command/ShowcaseGenerateCommand.php @@ -0,0 +1,217 @@ +rootPath = rtrim($rootPath, '/') . '/'; + $this->fs = new Filesystem(); + parent::__construct(); + } + + protected function configure() + { + $this->setName('showcase:generate') + ->setDescription('Generates the GAPIC Showcase client SDK for Conformance tests') + ->addOption( + 'out-dir', + 'o', + InputOption::VALUE_REQUIRED, + 'Output directory relative to root (defaults to Gax/tests/Conformance)', + 'Gax/tests/Conformance' + ) + ->addOption( + 'gapic-generator-path', + null, + InputOption::VALUE_REQUIRED, + 'Path to local gapic-generator repository (defaults to installed vendor dependency)', + $this->rootPath . 'dev/vendor/google/gapic-generator' + ) + ->addOption( + 'showcase-path', + null, + InputOption::VALUE_REQUIRED, + 'Path to local gapic-showcase repository (defaults to installed vendor dependency)', + $this->rootPath . 'dev/vendor/google/gapic-showcase' + ) + ->addOption( + 'googleapis-path', + null, + InputOption::VALUE_REQUIRED, + 'Path to googleapis repository', + $this->rootPath . '../googleapis' + ); + } + + protected function execute(InputInterface $input, OutputInterface $output): int + { + $executableFinder = new ExecutableFinder(); + if (!$executableFinder->find('protoc')) { + $output->writeln('Error: protoc not found. Please install the protobuf compiler.'); + return Command::FAILURE; + } + + $outDir = $input->getOption('out-dir'); + $targetDir = $this->rootPath . trim($outDir, '/'); + $tmpOutputDir = sys_get_temp_dir() . '/showcase_out_' . uniqid(); + $descFile = $tmpOutputDir . '/desc.pb'; + + // 1. Resolve Generator Path (Defaults to vendor dependency) + $generatorPath = $input->getOption('gapic-generator-path'); + if (file_exists($generatorPath . '/vendor/autoload.php')) { + require_once $generatorPath . '/vendor/autoload.php'; + } + $output->writeln("Using gapic-generator from: {$generatorPath}"); + + // 2. Resolve Showcase Path (Defaults to vendor dependency) + $showcasePath = $input->getOption('showcase-path'); + if (!is_dir($showcasePath . '/schema/google/showcase/v1beta1')) { + $output->writeln("Error: gapic-showcase schema directory not found at {$showcasePath}."); + return Command::FAILURE; + } + $schemaDir = $showcasePath . '/schema/google/showcase/v1beta1'; + + // 3. Resolve Googleapis Path (Defaults to ../googleapis or generatorPath/googleapis) + $googleapisPath = $input->getOption('googleapis-path'); + if (!is_dir($googleapisPath . '/google/cloud')) { + if (is_dir($generatorPath . '/googleapis/google/cloud')) { + $googleapisPath = $generatorPath . '/googleapis'; + } else { + $output->writeln("Error: googleapis directory not found at {$googleapisPath}."); + $output->writeln('Please specify the path using --googleapis-path '); + return Command::FAILURE; + } + } + + $output->writeln("Using output directory: {$targetDir}"); + $output->writeln("Using gapic-showcase schemas from: {$schemaDir}"); + $output->writeln("Using googleapis definitions from: {$googleapisPath}"); + + $this->fs->mkdir($tmpOutputDir . '/src'); + + // 5. Compile Proto Descriptor Set (desc.pb) + $output->writeln('2. Compiling proto descriptor set (desc.pb)...'); + $allProtoFiles = glob($schemaDir . '/*.proto'); + + $protocDescCmd = array_merge([ + 'protoc', + '--include_imports', + '--include_source_info', + '-I', $showcasePath . '/schema', + '-I', $googleapisPath, + '--descriptor_set_out=' . $descFile, + $googleapisPath . '/google/cloud/common_resources.proto' + ], $allProtoFiles); + $this->runProcess($protocDescCmd); + + // 6. Generate Showcase PHP Client via CodeGenerator + $output->writeln('3. Generating Showcase PHP client (NEW_SURFACE_ONLY mode)...'); + + $descBytes = file_get_contents($descFile); + $grpcConfig = file_get_contents($schemaDir . '/showcase_grpc_service_config.json'); + + $serviceYaml = file_exists($schemaDir . '/showcase_v1beta1.yaml') ? file_get_contents($schemaDir . '/showcase_v1beta1.yaml') : null; + + $files = CodeGenerator::generateFromDescriptor( + $descBytes, + 'google.showcase.v1beta1', //package + 'grpc+rest', //transport + true, //generateGapicMetadata + $grpcConfig, //grpcServiceConfigJson + null, //gapicYaml + $serviceYaml, //serviceYaml + numericEnums: false, + licenseYear: -1, + generateSnippets: false, + migrationMode: MigrationMode::NEW_SURFACE_ONLY + ); + + foreach ($files as [$relPath, $content]) { + $fullPath = $tmpOutputDir . '/' . $relPath; + $this->fs->dumpFile($fullPath, $content); + } + + // 7. Generate Protobuf Message Classes via protoc --php_out + $output->writeln('4. Generating Protobuf message classes...'); + $protocPhpCmd = array_merge([ + 'protoc', + '-I', $showcasePath . '/schema', + '-I', $googleapisPath, + '--php_out=' . $tmpOutputDir . '/src', + ], $allProtoFiles); + $this->runProcess($protocPhpCmd); + + // 8. Organize output into Conformance directory + $output->writeln('5. Organizing output into Conformance directory...'); + $this->fs->remove([$targetDir . '/src/V1beta1', $targetDir . '/metadata']); + $this->fs->mkdir([$targetDir . '/src/V1beta1/resources', $targetDir . '/metadata']); + + $mappings = [ + '/src/V1beta1' => '/src/V1beta1', // GAPIC clients + '/src/Google/Showcase/V1beta1' => '/src/V1beta1', // protobuf messages + '/resources' => '/src/V1beta1/resources', // REST and GAPIC configs + '/src/GPBMetadata/Google/Showcase' => '/metadata', // protobuf metadata + ]; + foreach ($mappings as $source => $dest) { + $srcDir = $tmpOutputDir . $source; + if (is_dir($srcDir)) { + $this->fs->mirror($srcDir, $outDir . $dest); + } + } + + // Exclude deprecated Protobuf flat alias files matching *_* (ignoring resources) + $deprecatedFinder = (new Finder())->files()->name('*_*.php')->in($targetDir . '/src/V1beta1')->notPath('resources'); + $this->fs->remove($deprecatedFinder); + + // 9. Clean up temporary files + $output->writeln('6. Cleaning up temporary files...'); + $this->fs->remove([$tmpOutputDir]); + + $output->writeln("✅ Showcase Client generation complete! Output saved in: {$targetDir}"); + + return Command::SUCCESS; + } + + private function runProcess(array $command, ?string $cwd = null): void + { + $process = new Process($command, $cwd); + $process->setTimeout(300); + $process->mustRun(); + } +}