From 4cef930bfa2779e584b331fbf503c384ed70e1d5 Mon Sep 17 00:00:00 2001 From: WyriHaximus <147145+WyriHaximus@users.noreply.github.com> Date: Mon, 4 Nov 2024 17:00:42 +0000 Subject: [PATCH] [GitHub] Update to 1.1.4-2b790a7412799c3a2996ba936824dd7d from 1.1.4-f1a89aa5fb6ef3d7a6d77044c06b8756 Detected Schema changes: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ``` └─┬Paths └─┬/user/following/{username} └─┬PUT └─┬Responses └──[➖] codes (226708:7)❌ ``` | Document Element | Total Changes | Breaking Changes | |------------------|---------------|------------------| | paths | 1 | 1 | Date: 11/04/24 | Commit: New: etc/specs/GitHub/previous.spec.yaml, Original: etc/specs/GitHub/current.spec.yaml - ❌ **BREAKING Changes**: _1_ out of _1_ - **Removals**: _1_ - **Breaking Removals**: _1_ ERROR: breaking changes discovered --- .../GitHub/etc/openapi-client-generator.state | 84 +++++++++---------- .../Operation/User/Following/Username.php | 84 +++++++++++++++++++ .../src/Internal/Operation/Users/Follow.php | 8 ++ .../ApiInsights/GetRouteStatsByActor.php | 2 +- .../GetRouteStatsByActorListing.php | 2 +- .../Operator/ApiInsights/GetSubjectStats.php | 2 +- .../ApiInsights/GetSubjectStatsListing.php | 2 +- .../Operator/ApiInsights/GetSummaryStats.php | 1 + .../ApiInsights/GetSummaryStatsByActor.php | 1 + .../ApiInsights/GetSummaryStatsByUser.php | 1 + .../Operator/ApiInsights/GetTimeStats.php | 2 +- .../ApiInsights/GetTimeStatsByActor.php | 2 +- .../ApiInsights/GetTimeStatsByUser.php | 2 +- .../Operator/ApiInsights/GetUserStats.php | 2 +- .../ApiInsights/GetUserStatsListing.php | 2 +- .../Operator/Apps/ListWebhookDeliveries.php | 2 +- .../Operator/Orgs/ListWebhookDeliveries.php | 2 +- .../Operator/Repos/ListWebhookDeliveries.php | 2 +- .../src/Internal/Operator/Users/Follow.php | 1 - .../src/Internal/Router/Get/ApiInsights.php | 15 ++-- .../GitHub/src/Internal/Router/Get/Apps.php | 2 +- .../GitHub/src/Internal/Router/Get/Eight.php | 2 +- .../GitHub/src/Internal/Router/Get/Four.php | 2 +- .../GitHub/src/Internal/Router/Get/Orgs.php | 2 +- .../GitHub/src/Internal/Router/Get/Repos.php | 2 +- .../GitHub/src/Internal/Router/Get/Seven.php | 2 +- .../GitHub/src/Internal/Router/Get/Six.php | 2 +- .../src/Internal/Router/List/ApiInsights.php | 6 +- .../GitHub/src/Internal/Router/List/Eight.php | 2 +- .../GitHub/src/Internal/Router/List/Seven.php | 2 +- .../GitHub/src/Internal/Router/List/Six.php | 2 +- .../GitHub/src/Internal/Router/Put/Four.php | 1 + .../GitHub/src/Internal/Router/Put/Users.php | 1 - clients/GitHub/src/Operation/ApiInsights.php | 21 +++-- clients/GitHub/src/Operation/Apps.php | 2 +- clients/GitHub/src/Operation/Orgs.php | 2 +- clients/GitHub/src/Operation/Repos.php | 2 +- clients/GitHub/src/Operation/Users.php | 1 - .../src/PHPStan/ClientCallReturnTypes.php | 32 +++---- .../Internal/Operation/Users/FollowTest.php | 34 ++++++++ .../tests/Types/ClientCallReturnTypes.php | 32 +++---- etc/specs/GitHub/current.spec.yaml | 2 + 42 files changed, 255 insertions(+), 120 deletions(-) diff --git a/clients/GitHub/etc/openapi-client-generator.state b/clients/GitHub/etc/openapi-client-generator.state index abcb0f08584..fc7a807430c 100644 --- a/clients/GitHub/etc/openapi-client-generator.state +++ b/clients/GitHub/etc/openapi-client-generator.state @@ -1,5 +1,5 @@ { - "specHash": "f1a89aa5fb6ef3d7a6d77044c06b8756", + "specHash": "2b790a7412799c3a2996ba936824dd7d", "generatedFiles": { "files": [ { @@ -5516,7 +5516,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Operation\/Apps.php", - "hash": "dd485689128bff8ec0a7f8982a41dd10" + "hash": "d71736940ecb41851459aba05a5ad0b7" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Operation\/CodesOfConduct.php", @@ -5560,7 +5560,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Operation\/Orgs.php", - "hash": "5d374f0be56b72fb33b8aa678182b9ca" + "hash": "90e89d84c2b5cdab0560cfa50aba2147" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Operation\/Actions.php", @@ -5572,7 +5572,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Operation\/CodeScanning.php", - "hash": "f9715ddc7681e31dc8bef4da37fc1618" + "hash": "1022aefe8ce8640ec7fe0d5de39fefe7" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Operation\/Codespaces.php", @@ -5596,7 +5596,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Operation\/Repos.php", - "hash": "0aef6a4eccc9f76a73c638b2fd7e1e48" + "hash": "7c05f1c91bef0c16fd3eedc1090e6553" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Operation\/Billing.php", @@ -5640,7 +5640,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Operation\/Users.php", - "hash": "3dbce1b405bb6506b17dffb6b89b814f" + "hash": "cc1558ba222950c3e8ef099c2342137c" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Operations.php", @@ -12108,7 +12108,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operator\/Apps\/ListWebhookDeliveries.php", - "hash": "165bd5253ffd304c266367d671f2aa1a" + "hash": "84c763e67b3fdff30f8024598aaf2534" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Internal\/Operation\/Apps\/ListWebhookDeliveriesTest.php", @@ -14168,7 +14168,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operator\/Orgs\/ListWebhookDeliveries.php", - "hash": "382d9831dc2a5b3ba253d35ac2c865bf" + "hash": "96efa998f4fa46e3668581bd49ef1e17" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Internal\/Operation\/Orgs\/ListWebhookDeliveriesTest.php", @@ -19016,7 +19016,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operator\/Repos\/ListWebhookDeliveries.php", - "hash": "1f4d28f6fbc2ccec69b88f9b5f18bcfa" + "hash": "bb0f3138eeca80d9a0bf5ab73a13d434" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Internal\/Operation\/Repos\/ListWebhookDeliveriesTest.php", @@ -22672,15 +22672,15 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operation\/Users\/Follow.php", - "hash": "efe378614e4e17b2b23efbd88be585c0" + "hash": "c5b7aa19851b9b00af0ada2d190a3b6a" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operator\/Users\/Follow.php", - "hash": "be251e01c1e72c0e0f6de0c54e252285" + "hash": "d55145ed8f3b10926a8cc3c99146a899" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Internal\/Operation\/Users\/FollowTest.php", - "hash": "a9668be9fb4b0799df54363bacccdab2" + "hash": "d8bade4c1c1cb5ce458a148077196dad" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operation\/Users\/Unfollow.php", @@ -24344,7 +24344,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Apps.php", - "hash": "1d337c4237c48432ebbcba0c595fc24f" + "hash": "e407489bdf3e230ab66b8abd76d483a5" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Get\/CodesOfConduct.php", @@ -24372,7 +24372,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Orgs.php", - "hash": "78b8a36998d1ce19e62b3390208baf03" + "hash": "41a7cff5ee99b680da17998af407ec1e" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Get\/RateLimit.php", @@ -24380,7 +24380,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Repos.php", - "hash": "9699969ac16cddac9d962470e5d167a4" + "hash": "aba5e648fd688e82d05fc311741523d4" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Users.php", @@ -24824,7 +24824,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Put\/Users.php", - "hash": "36abf1edeab3c8f3a9fdb8fc527a4cb8" + "hash": "893addc3668bca9c03ea04b87dd67c5c" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Put\/Oidc.php", @@ -24868,7 +24868,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Four.php", - "hash": "3cd759ecadd9f1ef98cbdecf23f1ddd9" + "hash": "f248e13197b434832a0cbb6e3c9f1df4" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Five.php", @@ -24876,15 +24876,15 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Six.php", - "hash": "6ed1ecb55f4ae8cf04acc1c475c90200" + "hash": "cad4365ea623b91d71b65377504095d1" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Seven.php", - "hash": "a14526043881620651ac452b3d5b34ef" + "hash": "025bbc0a0f6449b998880d880eb2fed5" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Eight.php", - "hash": "37094f76fdeaa04646bab6135a8f7bdb" + "hash": "3dca95be52846097223409b2f9926606" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Nine.php", @@ -24980,15 +24980,15 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/List\/Six.php", - "hash": "9812269e81564353be3fc1d6da6f2fba" + "hash": "71625fca086e278619781593e380e8fb" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/List\/Seven.php", - "hash": "67751622c45a52cdc05fc38bc3fbb6fd" + "hash": "8d182326244702f6bb410dd6fb0ac9b1" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/List\/Eight.php", - "hash": "50b0aae5cf5d664d36f0080f508b4ac2" + "hash": "9aca9c730a1e32ff37bb817fb1db5454" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/List\/Ten.php", @@ -25036,7 +25036,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Put\/Four.php", - "hash": "40bdfcdd241df5585c8d9f941b09429b" + "hash": "2a3dda0d4b301e491cc71836fcbc88c5" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Put\/Two.php", @@ -26860,7 +26860,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Hydrator\/Operation\/User\/Following\/Username.php", - "hash": "04ae30a4843906dbead3f2962000d2dc" + "hash": "e0ceb88cc752392cf8575cd0d50338db" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Hydrator\/Operation\/User\/GpgKeys.php", @@ -27656,11 +27656,11 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/PHPStan\/ClientCallReturnTypes.php", - "hash": "98fc6c50cc51f6f7c274b33dc27f8bd0" + "hash": "673d74cc6110fa6dbf3fed642b423f7f" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Types\/ClientCallReturnTypes.php", - "hash": "91968b37bd6f4b77283d4262ef47fd56" + "hash": "0ebe0cea4e0261c8e6a52f8aabe2cd21" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/..\/etc\/phpstan-extension.neon", @@ -30832,7 +30832,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operator\/ApiInsights\/GetRouteStatsByActor.php", - "hash": "d4c268f744b5ae9132327889ee93da57" + "hash": "9cd55e081f90294fa66bedc3a8e624af" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Internal\/Operation\/ApiInsights\/GetRouteStatsByActorTest.php", @@ -30844,7 +30844,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operator\/ApiInsights\/GetRouteStatsByActorListing.php", - "hash": "81db61911d3da3073f923d5b0a8f01b0" + "hash": "e55c6f8caeed3455d0e65d784742a9c2" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Internal\/Operation\/ApiInsights\/GetRouteStatsByActorListingTest.php", @@ -30856,7 +30856,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operator\/ApiInsights\/GetSubjectStats.php", - "hash": "bb856ed9f9548dd1b047ed3366411ac3" + "hash": "8f82f7bbdbd9c4d1c2c301f6b0f2fbe3" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Internal\/Operation\/ApiInsights\/GetSubjectStatsTest.php", @@ -30868,7 +30868,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operator\/ApiInsights\/GetSubjectStatsListing.php", - "hash": "4ff547c393a644a463ff6c00d034a23f" + "hash": "6e215466323d2e9913c6d1edcc43a819" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Internal\/Operation\/ApiInsights\/GetSubjectStatsListingTest.php", @@ -30880,7 +30880,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operator\/ApiInsights\/GetSummaryStats.php", - "hash": "52f2accff993f35ee26675d0a80f2f92" + "hash": "ca9036b6f98f4e1a110f99f6aacfdd42" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Internal\/Operation\/ApiInsights\/GetSummaryStatsTest.php", @@ -30892,7 +30892,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operator\/ApiInsights\/GetSummaryStatsByUser.php", - "hash": "d297ee62008f3108fd68b680a812ca5c" + "hash": "37a2c9808021f2ced7b540affd767b6e" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Internal\/Operation\/ApiInsights\/GetSummaryStatsByUserTest.php", @@ -30904,7 +30904,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operator\/ApiInsights\/GetSummaryStatsByActor.php", - "hash": "ba0ad561745834d9a78cedbc87c730ea" + "hash": "fb817fdf2f908d0a5d69bba62ac3df57" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Internal\/Operation\/ApiInsights\/GetSummaryStatsByActorTest.php", @@ -30916,7 +30916,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operator\/ApiInsights\/GetTimeStats.php", - "hash": "de7c1babf39d22d3fd4f1555905fc960" + "hash": "b46dcf0b1f9b1f0c5bc60d42eb1e2a24" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Internal\/Operation\/ApiInsights\/GetTimeStatsTest.php", @@ -30928,7 +30928,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operator\/ApiInsights\/GetTimeStatsByUser.php", - "hash": "8045d95d4024779268593210dcc838d7" + "hash": "84ae4564cefc8c1823d04b08e31abc28" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Internal\/Operation\/ApiInsights\/GetTimeStatsByUserTest.php", @@ -30940,7 +30940,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operator\/ApiInsights\/GetTimeStatsByActor.php", - "hash": "70377d40f16d66dd091b93395cb310a6" + "hash": "e5770136e9e0378f6e1c7cefc5b113e1" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Internal\/Operation\/ApiInsights\/GetTimeStatsByActorTest.php", @@ -30952,7 +30952,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operator\/ApiInsights\/GetUserStats.php", - "hash": "133fcd00ebbe58d2379338f1e1bf2f6f" + "hash": "34e57c1778587180890c7817c1777d33" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Internal\/Operation\/ApiInsights\/GetUserStatsTest.php", @@ -30964,7 +30964,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operator\/ApiInsights\/GetUserStatsListing.php", - "hash": "bc3094654aa3f14ef788e6253d0172e6" + "hash": "a677f87cb5586815f71bb7e6ca33531a" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Internal\/Operation\/ApiInsights\/GetUserStatsListingTest.php", @@ -30992,15 +30992,15 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Get\/ApiInsights.php", - "hash": "1fca596246826889b43466dfaa65ca5d" + "hash": "6d5a962542daa2df7d7260c85a7a2d13" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/List\/ApiInsights.php", - "hash": "133cab72347c3bcdd48daba79337dde6" + "hash": "23a52212777a55d49faa33c1cbf8932e" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Operation\/ApiInsights.php", - "hash": "abf376a1022c40e61b1a4156232f7680" + "hash": "05e5c4043312005083706112aca5a8c5" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Hydrator\/Operation\/Orgs\/Org\/Insights\/Api\/SummaryStats.php", diff --git a/clients/GitHub/src/Internal/Hydrator/Operation/User/Following/Username.php b/clients/GitHub/src/Internal/Hydrator/Operation/User/Following/Username.php index e6025e7df90..78c2a06433b 100644 --- a/clients/GitHub/src/Internal/Hydrator/Operation/User/Following/Username.php +++ b/clients/GitHub/src/Internal/Hydrator/Operation/User/Following/Username.php @@ -5,6 +5,7 @@ namespace ApiClients\Client\GitHub\Internal\Hydrator\Operation\User\Following; use ApiClients\Client\GitHub\Schema\BasicError; +use ApiClients\Client\GitHub\Schema\ValidationError; use EventSauce\ObjectHydrator\IterableList; use EventSauce\ObjectHydrator\ObjectMapper; use EventSauce\ObjectHydrator\PropertySerializers\SerializeArrayItems; @@ -39,6 +40,7 @@ public function hydrateObject(string $className, array $payload): object { return match ($className) { 'ApiClients\Client\GitHub\Schema\BasicError' => $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️BasicError($payload), + 'ApiClients\Client\GitHub\Schema\ValidationError' => $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️ValidationError($payload), default => throw UnableToHydrateObject::noHydrationDefined($className, $this->hydrationStack), }; } @@ -106,6 +108,58 @@ private function hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️Basi } } + private function hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️ValidationError(array $payload): ValidationError + { + $properties = []; + $missingFields = []; + try { + $value = $payload['message'] ?? null; + + if ($value === null) { + $missingFields[] = 'message'; + goto after_message; + } + + $properties['message'] = $value; + + after_message: + + $value = $payload['documentation_url'] ?? null; + + if ($value === null) { + $missingFields[] = 'documentation_url'; + goto after_documentationUrl; + } + + $properties['documentationUrl'] = $value; + + after_documentationUrl: + + $value = $payload['errors'] ?? null; + + if ($value === null) { + $properties['errors'] = null; + goto after_errors; + } + + $properties['errors'] = $value; + + after_errors: + } catch (Throwable $exception) { + throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\ValidationError', $exception, stack: $this->hydrationStack); + } + + if (count($missingFields) > 0) { + throw UnableToHydrateObject::dueToMissingFields(ValidationError::class, $missingFields, stack: $this->hydrationStack); + } + + try { + return new ValidationError(...$properties); + } catch (Throwable $exception) { + throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\ValidationError', $exception, stack: $this->hydrationStack); + } + } + private function serializeViaTypeMap(string $accessor, object $object, array $payloadToTypeMap): array { foreach ($payloadToTypeMap as $payloadType => [$valueType, $method]) { @@ -138,6 +192,7 @@ public function serializeObjectOfType(object $object, string $className): mixed 'DateTimeImmutable' => $this->serializeValueDateTimeImmutable($object), 'DateTimeInterface' => $this->serializeValueDateTimeInterface($object), 'ApiClients\Client\GitHub\Schema\BasicError' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️BasicError($object), + 'ApiClients\Client\GitHub\Schema\ValidationError' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️ValidationError($object), default => throw new LogicException("No serialization defined for $className"), }; } catch (Throwable $exception) { @@ -240,6 +295,35 @@ private function serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema return $result; } + private function serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️ValidationError(mixed $object): mixed + { + assert($object instanceof ValidationError); + $result = []; + + $message = $object->message; + after_message: $result['message'] = $message; + + $documentationUrl = $object->documentationUrl; + after_documentationUrl: $result['documentation_url'] = $documentationUrl; + + $errors = $object->errors; + + if ($errors === null) { + goto after_errors; + } + + static $errorsSerializer0; + + if ($errorsSerializer0 === null) { + $errorsSerializer0 = new SerializeArrayItems(...[]); + } + + $errors = $errorsSerializer0->serialize($errors, $this); + after_errors: $result['errors'] = $errors; + + return $result; + } + /** * @param class-string $className * @param iterable $payloads; diff --git a/clients/GitHub/src/Internal/Operation/Users/Follow.php b/clients/GitHub/src/Internal/Operation/Users/Follow.php index 55ae436aef7..7a18961f9f0 100644 --- a/clients/GitHub/src/Internal/Operation/Users/Follow.php +++ b/clients/GitHub/src/Internal/Operation/Users/Follow.php @@ -67,6 +67,14 @@ public function createResponse(ResponseInterface $response): WithoutBody $this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\BasicError::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); throw new ErrorSchemas\BasicError(401, $this->hydrator->hydrateObject(Schema\BasicError::class, $body)); + /** + * Validation failed, or the endpoint has been spammed. + **/ + + case 422: + $this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\ValidationError::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + + throw new ErrorSchemas\ValidationError(422, $this->hydrator->hydrateObject(Schema\ValidationError::class, $body)); } break; diff --git a/clients/GitHub/src/Internal/Operator/ApiInsights/GetRouteStatsByActor.php b/clients/GitHub/src/Internal/Operator/ApiInsights/GetRouteStatsByActor.php index 6895758d6f3..7269b79d3c0 100644 --- a/clients/GitHub/src/Internal/Operator/ApiInsights/GetRouteStatsByActor.php +++ b/clients/GitHub/src/Internal/Operator/ApiInsights/GetRouteStatsByActor.php @@ -24,7 +24,7 @@ public function __construct(private Browser $browser, private AuthenticationInte { } - /** @return iterable */ + /** @return Observable */ public function call(string $org, string $actorType, int $actorId, string $minTimestamp, string $maxTimestamp, array $sort, int $page = 1, int $perPage = 30, string $direction = 'desc'): iterable { $operation = new \ApiClients\Client\GitHub\Internal\Operation\ApiInsights\GetRouteStatsByActor($this->responseSchemaValidator, $this->hydrator, $org, $actorType, $actorId, $minTimestamp, $maxTimestamp, $sort, $page, $perPage, $direction); diff --git a/clients/GitHub/src/Internal/Operator/ApiInsights/GetRouteStatsByActorListing.php b/clients/GitHub/src/Internal/Operator/ApiInsights/GetRouteStatsByActorListing.php index 4f9d4c83f13..2815e0d203c 100644 --- a/clients/GitHub/src/Internal/Operator/ApiInsights/GetRouteStatsByActorListing.php +++ b/clients/GitHub/src/Internal/Operator/ApiInsights/GetRouteStatsByActorListing.php @@ -24,7 +24,7 @@ public function __construct(private Browser $browser, private AuthenticationInte { } - /** @return iterable */ + /** @return Observable */ public function call(string $org, string $actorType, int $actorId, string $minTimestamp, string $maxTimestamp, array $sort, int $page = 1, int $perPage = 30, string $direction = 'desc'): iterable { $operation = new \ApiClients\Client\GitHub\Internal\Operation\ApiInsights\GetRouteStatsByActorListing($this->responseSchemaValidator, $this->hydrator, $org, $actorType, $actorId, $minTimestamp, $maxTimestamp, $sort, $page, $perPage, $direction); diff --git a/clients/GitHub/src/Internal/Operator/ApiInsights/GetSubjectStats.php b/clients/GitHub/src/Internal/Operator/ApiInsights/GetSubjectStats.php index 58a610bcd85..c89c02da68b 100644 --- a/clients/GitHub/src/Internal/Operator/ApiInsights/GetSubjectStats.php +++ b/clients/GitHub/src/Internal/Operator/ApiInsights/GetSubjectStats.php @@ -24,7 +24,7 @@ public function __construct(private Browser $browser, private AuthenticationInte { } - /** @return iterable */ + /** @return Observable */ public function call(string $org, string $minTimestamp, string $maxTimestamp, array $sort, int $page = 1, int $perPage = 30, string $direction = 'desc'): iterable { $operation = new \ApiClients\Client\GitHub\Internal\Operation\ApiInsights\GetSubjectStats($this->responseSchemaValidator, $this->hydrator, $org, $minTimestamp, $maxTimestamp, $sort, $page, $perPage, $direction); diff --git a/clients/GitHub/src/Internal/Operator/ApiInsights/GetSubjectStatsListing.php b/clients/GitHub/src/Internal/Operator/ApiInsights/GetSubjectStatsListing.php index 32b12e4ad07..f226ccddf15 100644 --- a/clients/GitHub/src/Internal/Operator/ApiInsights/GetSubjectStatsListing.php +++ b/clients/GitHub/src/Internal/Operator/ApiInsights/GetSubjectStatsListing.php @@ -24,7 +24,7 @@ public function __construct(private Browser $browser, private AuthenticationInte { } - /** @return iterable */ + /** @return Observable */ public function call(string $org, string $minTimestamp, string $maxTimestamp, array $sort, int $page = 1, int $perPage = 30, string $direction = 'desc'): iterable { $operation = new \ApiClients\Client\GitHub\Internal\Operation\ApiInsights\GetSubjectStatsListing($this->responseSchemaValidator, $this->hydrator, $org, $minTimestamp, $maxTimestamp, $sort, $page, $perPage, $direction); diff --git a/clients/GitHub/src/Internal/Operator/ApiInsights/GetSummaryStats.php b/clients/GitHub/src/Internal/Operator/ApiInsights/GetSummaryStats.php index 771d6bbe69a..c966608250e 100644 --- a/clients/GitHub/src/Internal/Operator/ApiInsights/GetSummaryStats.php +++ b/clients/GitHub/src/Internal/Operator/ApiInsights/GetSummaryStats.php @@ -24,6 +24,7 @@ public function __construct(private Browser $browser, private AuthenticationInte { } + /** @return */ public function call(string $org, string $minTimestamp, string $maxTimestamp): ApiInsightsSummaryStats { $operation = new \ApiClients\Client\GitHub\Internal\Operation\ApiInsights\GetSummaryStats($this->responseSchemaValidator, $this->hydrator, $org, $minTimestamp, $maxTimestamp); diff --git a/clients/GitHub/src/Internal/Operator/ApiInsights/GetSummaryStatsByActor.php b/clients/GitHub/src/Internal/Operator/ApiInsights/GetSummaryStatsByActor.php index f980b3aa240..09fc1163501 100644 --- a/clients/GitHub/src/Internal/Operator/ApiInsights/GetSummaryStatsByActor.php +++ b/clients/GitHub/src/Internal/Operator/ApiInsights/GetSummaryStatsByActor.php @@ -24,6 +24,7 @@ public function __construct(private Browser $browser, private AuthenticationInte { } + /** @return */ public function call(string $org, string $minTimestamp, string $maxTimestamp, string $actorType, int $actorId): ApiInsightsSummaryStats { $operation = new \ApiClients\Client\GitHub\Internal\Operation\ApiInsights\GetSummaryStatsByActor($this->responseSchemaValidator, $this->hydrator, $org, $minTimestamp, $maxTimestamp, $actorType, $actorId); diff --git a/clients/GitHub/src/Internal/Operator/ApiInsights/GetSummaryStatsByUser.php b/clients/GitHub/src/Internal/Operator/ApiInsights/GetSummaryStatsByUser.php index ab9b5057fc8..36add2b82aa 100644 --- a/clients/GitHub/src/Internal/Operator/ApiInsights/GetSummaryStatsByUser.php +++ b/clients/GitHub/src/Internal/Operator/ApiInsights/GetSummaryStatsByUser.php @@ -24,6 +24,7 @@ public function __construct(private Browser $browser, private AuthenticationInte { } + /** @return */ public function call(string $org, string $userId, string $minTimestamp, string $maxTimestamp): ApiInsightsSummaryStats { $operation = new \ApiClients\Client\GitHub\Internal\Operation\ApiInsights\GetSummaryStatsByUser($this->responseSchemaValidator, $this->hydrator, $org, $userId, $minTimestamp, $maxTimestamp); diff --git a/clients/GitHub/src/Internal/Operator/ApiInsights/GetTimeStats.php b/clients/GitHub/src/Internal/Operator/ApiInsights/GetTimeStats.php index e667da11274..0f185c2be17 100644 --- a/clients/GitHub/src/Internal/Operator/ApiInsights/GetTimeStats.php +++ b/clients/GitHub/src/Internal/Operator/ApiInsights/GetTimeStats.php @@ -24,7 +24,7 @@ public function __construct(private Browser $browser, private AuthenticationInte { } - /** @return iterable */ + /** @return Observable */ public function call(string $org, string $minTimestamp, string $maxTimestamp, string $timestampIncrement): iterable { $operation = new \ApiClients\Client\GitHub\Internal\Operation\ApiInsights\GetTimeStats($this->responseSchemaValidator, $this->hydrator, $org, $minTimestamp, $maxTimestamp, $timestampIncrement); diff --git a/clients/GitHub/src/Internal/Operator/ApiInsights/GetTimeStatsByActor.php b/clients/GitHub/src/Internal/Operator/ApiInsights/GetTimeStatsByActor.php index b3b2b36d739..c270d9f8de2 100644 --- a/clients/GitHub/src/Internal/Operator/ApiInsights/GetTimeStatsByActor.php +++ b/clients/GitHub/src/Internal/Operator/ApiInsights/GetTimeStatsByActor.php @@ -24,7 +24,7 @@ public function __construct(private Browser $browser, private AuthenticationInte { } - /** @return iterable */ + /** @return Observable */ public function call(string $org, string $actorType, int $actorId, string $minTimestamp, string $maxTimestamp, string $timestampIncrement): iterable { $operation = new \ApiClients\Client\GitHub\Internal\Operation\ApiInsights\GetTimeStatsByActor($this->responseSchemaValidator, $this->hydrator, $org, $actorType, $actorId, $minTimestamp, $maxTimestamp, $timestampIncrement); diff --git a/clients/GitHub/src/Internal/Operator/ApiInsights/GetTimeStatsByUser.php b/clients/GitHub/src/Internal/Operator/ApiInsights/GetTimeStatsByUser.php index 2482b975da0..adf16bef235 100644 --- a/clients/GitHub/src/Internal/Operator/ApiInsights/GetTimeStatsByUser.php +++ b/clients/GitHub/src/Internal/Operator/ApiInsights/GetTimeStatsByUser.php @@ -24,7 +24,7 @@ public function __construct(private Browser $browser, private AuthenticationInte { } - /** @return iterable */ + /** @return Observable */ public function call(string $org, string $userId, string $minTimestamp, string $maxTimestamp, string $timestampIncrement): iterable { $operation = new \ApiClients\Client\GitHub\Internal\Operation\ApiInsights\GetTimeStatsByUser($this->responseSchemaValidator, $this->hydrator, $org, $userId, $minTimestamp, $maxTimestamp, $timestampIncrement); diff --git a/clients/GitHub/src/Internal/Operator/ApiInsights/GetUserStats.php b/clients/GitHub/src/Internal/Operator/ApiInsights/GetUserStats.php index 5e1f331b334..41d83e08275 100644 --- a/clients/GitHub/src/Internal/Operator/ApiInsights/GetUserStats.php +++ b/clients/GitHub/src/Internal/Operator/ApiInsights/GetUserStats.php @@ -24,7 +24,7 @@ public function __construct(private Browser $browser, private AuthenticationInte { } - /** @return iterable */ + /** @return Observable */ public function call(string $org, string $userId, string $minTimestamp, string $maxTimestamp, array $sort, int $page = 1, int $perPage = 30, string $direction = 'desc'): iterable { $operation = new \ApiClients\Client\GitHub\Internal\Operation\ApiInsights\GetUserStats($this->responseSchemaValidator, $this->hydrator, $org, $userId, $minTimestamp, $maxTimestamp, $sort, $page, $perPage, $direction); diff --git a/clients/GitHub/src/Internal/Operator/ApiInsights/GetUserStatsListing.php b/clients/GitHub/src/Internal/Operator/ApiInsights/GetUserStatsListing.php index 3564910caa9..87ff53b8aae 100644 --- a/clients/GitHub/src/Internal/Operator/ApiInsights/GetUserStatsListing.php +++ b/clients/GitHub/src/Internal/Operator/ApiInsights/GetUserStatsListing.php @@ -24,7 +24,7 @@ public function __construct(private Browser $browser, private AuthenticationInte { } - /** @return iterable */ + /** @return Observable */ public function call(string $org, string $userId, string $minTimestamp, string $maxTimestamp, array $sort, int $page = 1, int $perPage = 30, string $direction = 'desc'): iterable { $operation = new \ApiClients\Client\GitHub\Internal\Operation\ApiInsights\GetUserStatsListing($this->responseSchemaValidator, $this->hydrator, $org, $userId, $minTimestamp, $maxTimestamp, $sort, $page, $perPage, $direction); diff --git a/clients/GitHub/src/Internal/Operator/Apps/ListWebhookDeliveries.php b/clients/GitHub/src/Internal/Operator/Apps/ListWebhookDeliveries.php index 80ccb3de539..0e93730f606 100644 --- a/clients/GitHub/src/Internal/Operator/Apps/ListWebhookDeliveries.php +++ b/clients/GitHub/src/Internal/Operator/Apps/ListWebhookDeliveries.php @@ -24,7 +24,7 @@ public function __construct(private Browser $browser, private AuthenticationInte { } - /** @return iterable */ + /** @return Observable */ public function call(string $cursor, int $perPage = 30): iterable { $operation = new \ApiClients\Client\GitHub\Internal\Operation\Apps\ListWebhookDeliveries($this->responseSchemaValidator, $this->hydrator, $cursor, $perPage); diff --git a/clients/GitHub/src/Internal/Operator/Orgs/ListWebhookDeliveries.php b/clients/GitHub/src/Internal/Operator/Orgs/ListWebhookDeliveries.php index 2497ea0a905..c68d3371047 100644 --- a/clients/GitHub/src/Internal/Operator/Orgs/ListWebhookDeliveries.php +++ b/clients/GitHub/src/Internal/Operator/Orgs/ListWebhookDeliveries.php @@ -24,7 +24,7 @@ public function __construct(private Browser $browser, private AuthenticationInte { } - /** @return iterable */ + /** @return Observable */ public function call(string $org, int $hookId, string $cursor, int $perPage = 30): iterable { $operation = new \ApiClients\Client\GitHub\Internal\Operation\Orgs\ListWebhookDeliveries($this->responseSchemaValidator, $this->hydrator, $org, $hookId, $cursor, $perPage); diff --git a/clients/GitHub/src/Internal/Operator/Repos/ListWebhookDeliveries.php b/clients/GitHub/src/Internal/Operator/Repos/ListWebhookDeliveries.php index dc402e5ced0..8cdbf046749 100644 --- a/clients/GitHub/src/Internal/Operator/Repos/ListWebhookDeliveries.php +++ b/clients/GitHub/src/Internal/Operator/Repos/ListWebhookDeliveries.php @@ -24,7 +24,7 @@ public function __construct(private Browser $browser, private AuthenticationInte { } - /** @return iterable */ + /** @return Observable */ public function call(string $owner, string $repo, int $hookId, string $cursor, int $perPage = 30): iterable { $operation = new \ApiClients\Client\GitHub\Internal\Operation\Repos\ListWebhookDeliveries($this->responseSchemaValidator, $this->hydrator, $owner, $repo, $hookId, $cursor, $perPage); diff --git a/clients/GitHub/src/Internal/Operator/Users/Follow.php b/clients/GitHub/src/Internal/Operator/Users/Follow.php index 42bdd1316dc..1e1665cfac0 100644 --- a/clients/GitHub/src/Internal/Operator/Users/Follow.php +++ b/clients/GitHub/src/Internal/Operator/Users/Follow.php @@ -24,7 +24,6 @@ public function __construct(private Browser $browser, private AuthenticationInte { } - /** @return */ public function call(string $username): WithoutBody { $operation = new \ApiClients\Client\GitHub\Internal\Operation\Users\Follow($this->responseSchemaValidator, $this->hydrator, $username); diff --git a/clients/GitHub/src/Internal/Router/Get/ApiInsights.php b/clients/GitHub/src/Internal/Router/Get/ApiInsights.php index 27718c848bd..375cecc668c 100644 --- a/clients/GitHub/src/Internal/Router/Get/ApiInsights.php +++ b/clients/GitHub/src/Internal/Router/Get/ApiInsights.php @@ -20,7 +20,7 @@ public function __construct(private SchemaValidator $requestSchemaValidator, pri { } - /** @return iterable */ + /** @return Observable */ public function getSubjectStats(array $params): iterable { $arguments = []; @@ -71,6 +71,7 @@ public function getSubjectStats(array $params): iterable return $operator->call($arguments['org'], $arguments['min_timestamp'], $arguments['max_timestamp'], $arguments['sort'], $arguments['page'], $arguments['per_page'], $arguments['direction']); } + /** @return */ public function getSummaryStats(array $params): ApiInsightsSummaryStats { $arguments = []; @@ -97,7 +98,7 @@ public function getSummaryStats(array $params): ApiInsightsSummaryStats return $operator->call($arguments['org'], $arguments['min_timestamp'], $arguments['max_timestamp']); } - /** @return iterable */ + /** @return Observable */ public function getTimeStats(array $params): iterable { $arguments = []; @@ -130,7 +131,7 @@ public function getTimeStats(array $params): iterable return $operator->call($arguments['org'], $arguments['min_timestamp'], $arguments['max_timestamp'], $arguments['timestamp_increment']); } - /** @return iterable */ + /** @return Observable */ public function getUserStats(array $params): iterable { $arguments = []; @@ -187,7 +188,7 @@ public function getUserStats(array $params): iterable return $operator->call($arguments['org'], $arguments['user_id'], $arguments['min_timestamp'], $arguments['max_timestamp'], $arguments['sort'], $arguments['page'], $arguments['per_page'], $arguments['direction']); } - /** @return iterable */ + /** @return Observable */ public function getRouteStatsByActor(array $params): iterable { $arguments = []; @@ -250,6 +251,7 @@ public function getRouteStatsByActor(array $params): iterable return $operator->call($arguments['org'], $arguments['actor_type'], $arguments['actor_id'], $arguments['min_timestamp'], $arguments['max_timestamp'], $arguments['sort'], $arguments['page'], $arguments['per_page'], $arguments['direction']); } + /** @return */ public function getSummaryStatsByUser(array $params): ApiInsightsSummaryStats { $arguments = []; @@ -282,6 +284,7 @@ public function getSummaryStatsByUser(array $params): ApiInsightsSummaryStats return $operator->call($arguments['org'], $arguments['user_id'], $arguments['min_timestamp'], $arguments['max_timestamp']); } + /** @return */ public function getSummaryStatsByActor(array $params): ApiInsightsSummaryStats { $arguments = []; @@ -320,7 +323,7 @@ public function getSummaryStatsByActor(array $params): ApiInsightsSummaryStats return $operator->call($arguments['org'], $arguments['min_timestamp'], $arguments['max_timestamp'], $arguments['actor_type'], $arguments['actor_id']); } - /** @return iterable */ + /** @return Observable */ public function getTimeStatsByUser(array $params): iterable { $arguments = []; @@ -359,7 +362,7 @@ public function getTimeStatsByUser(array $params): iterable return $operator->call($arguments['org'], $arguments['user_id'], $arguments['min_timestamp'], $arguments['max_timestamp'], $arguments['timestamp_increment']); } - /** @return iterable */ + /** @return Observable */ public function getTimeStatsByActor(array $params): iterable { $arguments = []; diff --git a/clients/GitHub/src/Internal/Router/Get/Apps.php b/clients/GitHub/src/Internal/Router/Get/Apps.php index 87911d4fd36..433e693a398 100644 --- a/clients/GitHub/src/Internal/Router/Get/Apps.php +++ b/clients/GitHub/src/Internal/Router/Get/Apps.php @@ -197,7 +197,7 @@ public function getWebhookConfigForApp(array $params): WebhookConfig return $operator->call(); } - /** @return iterable */ + /** @return Observable */ public function listWebhookDeliveries(array $params): iterable { $arguments = []; diff --git a/clients/GitHub/src/Internal/Router/Get/Eight.php b/clients/GitHub/src/Internal/Router/Get/Eight.php index a627e6d28fc..5c5d697bcde 100644 --- a/clients/GitHub/src/Internal/Router/Get/Eight.php +++ b/clients/GitHub/src/Internal/Router/Get/Eight.php @@ -36,7 +36,7 @@ public function __construct(private Routers $routers) { } - /** @return iterable|Schema\ApiInsightsSummaryStats|iterable||Observable|Observable|Observable|Observable|Observable|Observable|WithoutBody */ + /** @return Observable||Observable|Observable|Observable|Observable|Observable|Observable|Observable|WithoutBody */ public function call(string $call, array $params, array $pathChunks): iterable|ApiInsightsSummaryStats|PackageVersion|TeamRepository|WithoutBody|OidcCustomSubRepo|Ok|Json|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListJobsForWorkflowRun\Response\ApplicationJson\Ok\Application\Json|WorkflowRunUsage|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListWorkflowRuns\Response\ApplicationJson\Ok\Application\Json|WorkflowUsage|ProtectedBranchAdminEnforced|ProtectedBranchPullRequestReview|StatusCheckPolicy|BranchRestrictionPolicy|CodeScanningCodeqlDatabase|CodeScanningVariantAnalysis|DeploymentStatus|DeploymentBranchPolicy|\ApiClients\Client\GitHub\Schema\Operations\Repos\ListCustomDeploymentRuleIntegrations\Response\ApplicationJson\Ok|DeploymentProtectionRule|ActionsPublicKey|ActionsSecret|ActionsVariable|HookDelivery|PullRequestReview { if ($pathChunks[0] === '') { diff --git a/clients/GitHub/src/Internal/Router/Get/Four.php b/clients/GitHub/src/Internal/Router/Get/Four.php index 39800ca6f31..7c40facd4ed 100644 --- a/clients/GitHub/src/Internal/Router/Get/Four.php +++ b/clients/GitHub/src/Internal/Router/Get/Four.php @@ -34,7 +34,7 @@ public function __construct(private Routers $routers) { } - /** @return |iterable|Observable|Observable|Observable|Observable|WithoutBody|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable */ + /** @return |Observable|Observable|Observable|Observable|Observable|WithoutBody|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable */ public function call(string $call, array $params, array $pathChunks): WebhookConfig|iterable|Installation|WithoutBody|GistSimple|GitignoreTemplate|MarketplacePurchase|Thread|Ok|\ApiClients\Client\GitHub\Schema\Operations\Orgs\ListAppInstallations\Response\ApplicationJson\Ok|InteractionLimitResponse|One|\ApiClients\Client\GitHub\Schema\Operations\Orgs\ListOrgRoles\Response\ApplicationJson\Ok|ProjectColumn|FullRepository|BasicError|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\ListSecretsForAuthenticatedUser\Response\ApplicationJson\Ok|Codespace|GpgKey|Key|Migration|SshSigningKey|Hovercard|StarredRepository|Repository { if ($pathChunks[0] === '') { diff --git a/clients/GitHub/src/Internal/Router/Get/Orgs.php b/clients/GitHub/src/Internal/Router/Get/Orgs.php index f5bc78a4dad..d076190d35a 100644 --- a/clients/GitHub/src/Internal/Router/Get/Orgs.php +++ b/clients/GitHub/src/Internal/Router/Get/Orgs.php @@ -802,7 +802,7 @@ public function getWebhookConfigForOrg(array $params): WebhookConfig return $operator->call($arguments['org'], $arguments['hook_id']); } - /** @return iterable */ + /** @return Observable */ public function listWebhookDeliveries(array $params): iterable { $arguments = []; diff --git a/clients/GitHub/src/Internal/Router/Get/Repos.php b/clients/GitHub/src/Internal/Router/Get/Repos.php index 51ba75e6516..f30529c7a7e 100644 --- a/clients/GitHub/src/Internal/Router/Get/Repos.php +++ b/clients/GitHub/src/Internal/Router/Get/Repos.php @@ -2529,7 +2529,7 @@ public function getWebhookConfigForRepo(array $params): WebhookConfig return $operator->call($arguments['owner'], $arguments['repo'], $arguments['hook_id']); } - /** @return iterable */ + /** @return Observable */ public function listWebhookDeliveries(array $params): iterable { $arguments = []; diff --git a/clients/GitHub/src/Internal/Router/Get/Seven.php b/clients/GitHub/src/Internal/Router/Get/Seven.php index f186e6bde2a..a8637e9b33c 100644 --- a/clients/GitHub/src/Internal/Router/Get/Seven.php +++ b/clients/GitHub/src/Internal/Router/Get/Seven.php @@ -63,7 +63,7 @@ public function __construct(private Routers $routers) { } - /** @return Observable|Observable||Observable|iterable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Schema\BasicError|Observable|Observable|Observable|iterable|Observable|Observable|Observable|Schema\ConvertedNoteToIssueIssueEvent|Schema\TimelineCommentEvent|Schema\TimelineCrossReferencedEvent|Schema\TimelineCommittedEvent|Schema\TimelineReviewedEvent|Schema\TimelineLineCommentedEvent|Schema\TimelineCommitCommentedEvent|Schema\TimelineAssignedIssueEvent|Schema\TimelineUnassignedIssueEvent|Schema\StateChangeIssueEvent>|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable */ + /** @return Observable|Observable||Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Schema\BasicError|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Schema\ConvertedNoteToIssueIssueEvent|Schema\TimelineCommentEvent|Schema\TimelineCrossReferencedEvent|Schema\TimelineCommittedEvent|Schema\TimelineReviewedEvent|Schema\TimelineLineCommentedEvent|Schema\TimelineCommitCommentedEvent|Schema\TimelineAssignedIssueEvent|Schema\TimelineUnassignedIssueEvent|Schema\StateChangeIssueEvent>|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable */ public function call(string $call, array $params, array $pathChunks): iterable|OidcCustomSub|Ok|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListSelfHostedRunnersInGroupForOrg\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListLabelsForSelfHostedRunnerForOrg\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListSelectedReposForOrgSecret\Response\ApplicationJson\Ok|Json|WithoutBody|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\ListSelectedReposForOrgSecret\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Dependabot\ListSelectedReposForOrgSecret\Response\ApplicationJson\Ok\Application\Json|HookDelivery|TeamDiscussion|TeamMembership|TeamProject|Artifact|ActionsCacheUsageByRepository|Job|ActionsWorkflowAccessToRepository|SelectedActions|ActionsGetDefaultWorkflowPermissions|Runner|WorkflowRun|ActionsPublicKey|ActionsSecret|ActionsVariable|Workflow|BranchProtection|\ApiClients\Client\GitHub\Schema\Operations\Checks\ListForSuite\Response\ApplicationJson\Ok|CodeScanningAlert|CodeScanningAnalysis|CodeScanningSarifsStatus|CodespacesPublicKey|RepoCodespacesSecret|RepositoryCollaboratorPermission|\ApiClients\Client\GitHub\Schema\Operations\Checks\ListForRef\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Checks\ListSuitesForRef\Response\ApplicationJson\Ok|CombinedCommitStatus|BasicError|DependabotAlert|DependabotPublicKey|DependabotSecret|\ApiClients\Client\GitHub\Schema\Operations\Repos\ListDeploymentBranchPolicies\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Repos\GetAllDeploymentProtectionRules\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListEnvironmentSecrets\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListEnvironmentVariables\Response\ApplicationJson\Ok\Application\Json|Blob|GitCommit|GitRef|GitTag|GitTree|WebhookConfig|IssueComment|IssueEvent|PageBuild|PagesDeploymentStatus|PullRequestReviewComment|PullRequestReviewRequest|ReleaseAsset|Release|RuleSuite|SecretScanningAlert|TeamDiscussionComment|PackageVersion { if ($pathChunks[0] === '') { diff --git a/clients/GitHub/src/Internal/Router/Get/Six.php b/clients/GitHub/src/Internal/Router/Get/Six.php index c57c4d3860c..950df511505 100644 --- a/clients/GitHub/src/Internal/Router/Get/Six.php +++ b/clients/GitHub/src/Internal/Router/Get/Six.php @@ -76,7 +76,7 @@ public function __construct(private Routers $routers) { } - /** @return |Observable|Observable|Observable|WithoutBody|iterable|iterable|Schema\ApiInsightsSummaryStats|iterable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Schema\Operations\Repos\GetCodeFrequencyStats\Response\ApplicationJson\Accepted\Application\Json|Observable|Schema\Operations\Repos\GetCommitActivityStats\Response\ApplicationJson\Accepted\Application\Json|Observable|Schema\Operations\Repos\GetContributorsStats\Response\ApplicationJson\Accepted\Application\Json|Observable|Observable|Observable|Observable|Observable */ + /** @return |Observable|Observable|Observable|WithoutBody|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Schema\Operations\Repos\GetCodeFrequencyStats\Response\ApplicationJson\Accepted\Application\Json|Observable|Schema\Operations\Repos\GetCommitActivityStats\Response\ApplicationJson\Accepted\Application\Json|Observable|Schema\Operations\Repos\GetContributorsStats\Response\ApplicationJson\Accepted\Application\Json|Observable|Observable|Observable|Observable|Observable */ public function call(string $call, array $params, array $pathChunks): Ok|iterable|ActionsCacheUsageOrgEnterprise|\ApiClients\Client\GitHub\Schema\Operations\Actions\GetActionsCacheUsageByRepoForOrg\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListSelectedRepositoriesEnabledGithubActionsOrganization\Response\ApplicationJson\Ok|SelectedActions|ActionsGetDefaultWorkflowPermissions|RunnerGroupsOrg|Runner|ActionsPublicKey|OrganizationActionsSecret|OrganizationActionsVariable|WithoutBody|CodeSecurityConfiguration|CodespacesPublicKey|CodespacesOrgSecret|\ApiClients\Client\GitHub\Schema\Operations\Copilot\ListCopilotSeats\Response\ApplicationJson\Ok|DependabotPublicKey|OrganizationDependabotSecret|WebhookConfig|ApiInsightsSummaryStats|Json|CopilotSeatDetails|Package|CustomProperty|RuleSuite|ActionsBillingUsage|PackagesBillingUsage|CombinedBillingUsage|ProjectCollaboratorPermission|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListArtifactsForRepo\Response\ApplicationJson\Ok|ActionsCacheList|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListRepoOrganizationSecrets\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListRepoOrganizationVariables\Response\ApplicationJson\Ok|ActionsRepositoryPermissions|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListSelfHostedRunnersForRepo\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListWorkflowRunsForRepo\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListRepoSecrets\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListRepoVariables\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListRepoWorkflows\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Repos\ListAttestations\Response\ApplicationJson\Ok\Application\Json|Autolink|BranchWithProtection|BasicError|CheckRun|CheckSuite|CodeScanningDefaultSetup|CodeownersErrors|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\ListDevcontainersInRepositoryForAuthenticatedUser\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\RepoMachinesForAuthenticatedUser\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\PreFlightWithRepoForAuthenticatedUser\Response\ApplicationJson\Ok|CodespacesPermissionsCheckForDevcontainer|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\ListRepoSecrets\Response\ApplicationJson\Ok|CommitComment|Commit|CommunityProfile|CommitComparison|ContentDirectory|ContentFile|ContentSymlink|ContentSubmodule|\ApiClients\Client\GitHub\Schema\Operations\Dependabot\ListRepoSecrets\Response\ApplicationJson\Ok|DependencyGraphSpdxSbom|Deployment|Environment|Hook|Issue|DeployKey|Label|Milestone|PagesHealthCheck|EmptyObject|PullRequest|Release|RepositoryRuleset|RepositoryAdvisory|\ApiClients\Client\GitHub\Schema\Operations\Repos\GetCodeFrequencyStats\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Repos\GetCommitActivityStats\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Repos\GetContributorsStats\Response\ApplicationJson\Accepted\Application\Json|ParticipationStats|CloneTraffic|ViewTraffic|TeamRepository|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\ListRepositoriesForSecretForAuthenticatedUser\Response\ApplicationJson\Ok\Application\Json|CodespaceExportDetails { if ($pathChunks[0] === '') { diff --git a/clients/GitHub/src/Internal/Router/List/ApiInsights.php b/clients/GitHub/src/Internal/Router/List/ApiInsights.php index 0fc8038500e..bdbbf8740f8 100644 --- a/clients/GitHub/src/Internal/Router/List/ApiInsights.php +++ b/clients/GitHub/src/Internal/Router/List/ApiInsights.php @@ -20,7 +20,7 @@ public function __construct(private SchemaValidator $requestSchemaValidator, pri { } - /** @return iterable */ + /** @return Observable */ public function getUserStatsListing(array $params): iterable { $arguments = []; @@ -83,7 +83,7 @@ public function getUserStatsListing(array $params): iterable } while (count($items) > 0); } - /** @return iterable */ + /** @return Observable */ public function getSubjectStatsListing(array $params): iterable { $arguments = []; @@ -140,7 +140,7 @@ public function getSubjectStatsListing(array $params): iterable } while (count($items) > 0); } - /** @return iterable */ + /** @return Observable */ public function getRouteStatsByActorListing(array $params): iterable { $arguments = []; diff --git a/clients/GitHub/src/Internal/Router/List/Eight.php b/clients/GitHub/src/Internal/Router/List/Eight.php index 5843a2ee94c..9292bfd92c4 100644 --- a/clients/GitHub/src/Internal/Router/List/Eight.php +++ b/clients/GitHub/src/Internal/Router/List/Eight.php @@ -15,7 +15,7 @@ public function __construct(private Routers $routers) { } - /** @return iterable|Observable|Observable|Observable|Observable|WithoutBody */ + /** @return Observable|Observable|Observable|Observable|Observable|WithoutBody */ public function call(string $call, array $params, array $pathChunks): iterable|WithoutBody { if ($pathChunks[0] === '') { diff --git a/clients/GitHub/src/Internal/Router/List/Seven.php b/clients/GitHub/src/Internal/Router/List/Seven.php index 8077b5bec4a..4fe1f14988d 100644 --- a/clients/GitHub/src/Internal/Router/List/Seven.php +++ b/clients/GitHub/src/Internal/Router/List/Seven.php @@ -14,7 +14,7 @@ public function __construct(private Routers $routers) { } - /** @return Observable|Observable|iterable|Observable|Observable|Observable|Observable|Observable|Observable|Schema\BasicError|Observable|Observable|Observable|Observable|Schema\ConvertedNoteToIssueIssueEvent|Schema\TimelineCommentEvent|Schema\TimelineCrossReferencedEvent|Schema\TimelineCommittedEvent|Schema\TimelineReviewedEvent|Schema\TimelineLineCommentedEvent|Schema\TimelineCommitCommentedEvent|Schema\TimelineAssignedIssueEvent|Schema\TimelineUnassignedIssueEvent|Schema\StateChangeIssueEvent>|Observable|Observable|Observable|Observable|Observable|Observable */ + /** @return Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Schema\BasicError|Observable|Observable|Observable|Observable|Schema\ConvertedNoteToIssueIssueEvent|Schema\TimelineCommentEvent|Schema\TimelineCrossReferencedEvent|Schema\TimelineCommittedEvent|Schema\TimelineReviewedEvent|Schema\TimelineLineCommentedEvent|Schema\TimelineCommitCommentedEvent|Schema\TimelineAssignedIssueEvent|Schema\TimelineUnassignedIssueEvent|Schema\StateChangeIssueEvent>|Observable|Observable|Observable|Observable|Observable|Observable */ public function call(string $call, array $params, array $pathChunks): iterable|BasicError { if ($pathChunks[0] === '') { diff --git a/clients/GitHub/src/Internal/Router/List/Six.php b/clients/GitHub/src/Internal/Router/List/Six.php index ab1b6ca29b2..15771a2e3fb 100644 --- a/clients/GitHub/src/Internal/Router/List/Six.php +++ b/clients/GitHub/src/Internal/Router/List/Six.php @@ -15,7 +15,7 @@ public function __construct(private Routers $routers) { } - /** @return Observable|iterable|Observable|Observable|Observable|WithoutBody|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable */ + /** @return Observable|Observable|Observable|Observable|Observable|WithoutBody|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable */ public function call(string $call, array $params, array $pathChunks): iterable|WithoutBody { if ($pathChunks[0] === '') { diff --git a/clients/GitHub/src/Internal/Router/Put/Four.php b/clients/GitHub/src/Internal/Router/Put/Four.php index fffaf5c10eb..2d01daced0a 100644 --- a/clients/GitHub/src/Internal/Router/Put/Four.php +++ b/clients/GitHub/src/Internal/Router/Put/Four.php @@ -15,6 +15,7 @@ public function __construct(private Routers $routers) { } + /** @return |\ApiClients\Tools\OpenApiClient\Utils\Response\WithoutBody */ public function call(string $call, array $params, array $pathChunks): WithoutBody|InteractionLimitResponse { if ($pathChunks[0] === '') { diff --git a/clients/GitHub/src/Internal/Router/Put/Users.php b/clients/GitHub/src/Internal/Router/Put/Users.php index 39b6b04a5ba..3992a515467 100644 --- a/clients/GitHub/src/Internal/Router/Put/Users.php +++ b/clients/GitHub/src/Internal/Router/Put/Users.php @@ -34,7 +34,6 @@ public function block(array $params): WithoutBody return $operator->call($arguments['username']); } - /** @return */ public function follow(array $params): WithoutBody { $arguments = []; diff --git a/clients/GitHub/src/Operation/ApiInsights.php b/clients/GitHub/src/Operation/ApiInsights.php index 68ffed28f43..8244973b634 100644 --- a/clients/GitHub/src/Operation/ApiInsights.php +++ b/clients/GitHub/src/Operation/ApiInsights.php @@ -14,70 +14,73 @@ public function __construct(private Internal\Operators $operators) { } - /** @return iterable */ + /** @return Observable */ public function getRouteStatsByActor(string $org, string $actorType, int $actorId, string $minTimestamp, string $maxTimestamp, array $sort, int $page, int $perPage, string $direction): iterable { return $this->operators->apiInsights👷GetRouteStatsByActor()->call($org, $actorType, $actorId, $minTimestamp, $maxTimestamp, $sort, $page, $perPage, $direction); } - /** @return iterable */ + /** @return Observable */ public function getRouteStatsByActorListing(string $org, string $actorType, int $actorId, string $minTimestamp, string $maxTimestamp, array $sort, int $page, int $perPage, string $direction): iterable { return $this->operators->apiInsights👷GetRouteStatsByActorListing()->call($org, $actorType, $actorId, $minTimestamp, $maxTimestamp, $sort, $page, $perPage, $direction); } - /** @return iterable */ + /** @return Observable */ public function getSubjectStats(string $org, string $minTimestamp, string $maxTimestamp, array $sort, int $page, int $perPage, string $direction): iterable { return $this->operators->apiInsights👷GetSubjectStats()->call($org, $minTimestamp, $maxTimestamp, $sort, $page, $perPage, $direction); } - /** @return iterable */ + /** @return Observable */ public function getSubjectStatsListing(string $org, string $minTimestamp, string $maxTimestamp, array $sort, int $page, int $perPage, string $direction): iterable { return $this->operators->apiInsights👷GetSubjectStatsListing()->call($org, $minTimestamp, $maxTimestamp, $sort, $page, $perPage, $direction); } + /** @return */ public function getSummaryStats(string $org, string $minTimestamp, string $maxTimestamp): ApiInsightsSummaryStats { return $this->operators->apiInsights👷GetSummaryStats()->call($org, $minTimestamp, $maxTimestamp); } + /** @return */ public function getSummaryStatsByUser(string $org, string $userId, string $minTimestamp, string $maxTimestamp): ApiInsightsSummaryStats { return $this->operators->apiInsights👷GetSummaryStatsByUser()->call($org, $userId, $minTimestamp, $maxTimestamp); } + /** @return */ public function getSummaryStatsByActor(string $org, string $minTimestamp, string $maxTimestamp, string $actorType, int $actorId): ApiInsightsSummaryStats { return $this->operators->apiInsights👷GetSummaryStatsByActor()->call($org, $minTimestamp, $maxTimestamp, $actorType, $actorId); } - /** @return iterable */ + /** @return Observable */ public function getTimeStats(string $org, string $minTimestamp, string $maxTimestamp, string $timestampIncrement): iterable { return $this->operators->apiInsights👷GetTimeStats()->call($org, $minTimestamp, $maxTimestamp, $timestampIncrement); } - /** @return iterable */ + /** @return Observable */ public function getTimeStatsByUser(string $org, string $userId, string $minTimestamp, string $maxTimestamp, string $timestampIncrement): iterable { return $this->operators->apiInsights👷GetTimeStatsByUser()->call($org, $userId, $minTimestamp, $maxTimestamp, $timestampIncrement); } - /** @return iterable */ + /** @return Observable */ public function getTimeStatsByActor(string $org, string $actorType, int $actorId, string $minTimestamp, string $maxTimestamp, string $timestampIncrement): iterable { return $this->operators->apiInsights👷GetTimeStatsByActor()->call($org, $actorType, $actorId, $minTimestamp, $maxTimestamp, $timestampIncrement); } - /** @return iterable */ + /** @return Observable */ public function getUserStats(string $org, string $userId, string $minTimestamp, string $maxTimestamp, array $sort, int $page, int $perPage, string $direction): iterable { return $this->operators->apiInsights👷GetUserStats()->call($org, $userId, $minTimestamp, $maxTimestamp, $sort, $page, $perPage, $direction); } - /** @return iterable */ + /** @return Observable */ public function getUserStatsListing(string $org, string $userId, string $minTimestamp, string $maxTimestamp, array $sort, int $page, int $perPage, string $direction): iterable { return $this->operators->apiInsights👷GetUserStatsListing()->call($org, $userId, $minTimestamp, $maxTimestamp, $sort, $page, $perPage, $direction); diff --git a/clients/GitHub/src/Operation/Apps.php b/clients/GitHub/src/Operation/Apps.php index c52c89e6cb2..bf5550cf8fc 100644 --- a/clients/GitHub/src/Operation/Apps.php +++ b/clients/GitHub/src/Operation/Apps.php @@ -48,7 +48,7 @@ public function updateWebhookConfigForApp(array $params): WebhookConfig return $this->operators->apps👷UpdateWebhookConfigForApp()->call($params); } - /** @return iterable */ + /** @return Observable */ public function listWebhookDeliveries(string $cursor, int $perPage): iterable { return $this->operators->apps👷ListWebhookDeliveries()->call($cursor, $perPage); diff --git a/clients/GitHub/src/Operation/Orgs.php b/clients/GitHub/src/Operation/Orgs.php index 0601e127b87..b525b619030 100644 --- a/clients/GitHub/src/Operation/Orgs.php +++ b/clients/GitHub/src/Operation/Orgs.php @@ -144,7 +144,7 @@ public function updateWebhookConfigForOrg(string $org, int $hookId, array $param return $this->operators->orgs👷UpdateWebhookConfigForOrg()->call($org, $hookId, $params); } - /** @return iterable */ + /** @return Observable */ public function listWebhookDeliveries(string $org, int $hookId, string $cursor, int $perPage): iterable { return $this->operators->orgs👷ListWebhookDeliveries()->call($org, $hookId, $cursor, $perPage); diff --git a/clients/GitHub/src/Operation/Repos.php b/clients/GitHub/src/Operation/Repos.php index 6e7b7f53e16..03c72e52576 100644 --- a/clients/GitHub/src/Operation/Repos.php +++ b/clients/GitHub/src/Operation/Repos.php @@ -839,7 +839,7 @@ public function updateWebhookConfigForRepo(string $owner, string $repo, int $hoo return $this->operators->repos👷UpdateWebhookConfigForRepo()->call($owner, $repo, $hookId, $params); } - /** @return iterable */ + /** @return Observable */ public function listWebhookDeliveries(string $owner, string $repo, int $hookId, string $cursor, int $perPage): iterable { return $this->operators->repos👷ListWebhookDeliveries()->call($owner, $repo, $hookId, $cursor, $perPage); diff --git a/clients/GitHub/src/Operation/Users.php b/clients/GitHub/src/Operation/Users.php index 469f092a37d..c90c2cba0a7 100644 --- a/clients/GitHub/src/Operation/Users.php +++ b/clients/GitHub/src/Operation/Users.php @@ -124,7 +124,6 @@ public function checkPersonIsFollowedByAuthenticated(string $username): WithoutB return $this->operators->users👷CheckPersonIsFollowedByAuthenticated()->call($username); } - /** @return */ public function follow(string $username): WithoutBody { return $this->operators->users👷Follow()->call($username); diff --git a/clients/GitHub/src/PHPStan/ClientCallReturnTypes.php b/clients/GitHub/src/PHPStan/ClientCallReturnTypes.php index db44b618544..b01b927e61c 100644 --- a/clients/GitHub/src/PHPStan/ClientCallReturnTypes.php +++ b/clients/GitHub/src/PHPStan/ClientCallReturnTypes.php @@ -72,7 +72,7 @@ public function getTypeFromMethodCall(MethodReflection $methodReflection, Method } if ($call === 'GET /app/hook/deliveries') { - return $this->typeResolver->resolve('iterable'); + return $this->typeResolver->resolve('Observable'); } if ($call === 'GET /app/hook/deliveries/{delivery_id}') { @@ -984,7 +984,7 @@ public function getTypeFromMethodCall(MethodReflection $methodReflection, Method } if ($call === 'GET /orgs/{org}/hooks/{hook_id}/deliveries') { - return $this->typeResolver->resolve('iterable'); + return $this->typeResolver->resolve('Observable'); } if ($call === 'GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}') { @@ -1000,51 +1000,51 @@ public function getTypeFromMethodCall(MethodReflection $methodReflection, Method } if ($call === 'GET /orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}') { - return $this->typeResolver->resolve('iterable'); + return $this->typeResolver->resolve('Observable'); } if ($call === 'LIST /orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}') { - return $this->typeResolver->resolve('iterable'); + return $this->typeResolver->resolve('Observable'); } if ($call === 'GET /orgs/{org}/insights/api/subject-stats') { - return $this->typeResolver->resolve('iterable'); + return $this->typeResolver->resolve('Observable'); } if ($call === 'LIST /orgs/{org}/insights/api/subject-stats') { - return $this->typeResolver->resolve('iterable'); + return $this->typeResolver->resolve('Observable'); } if ($call === 'GET /orgs/{org}/insights/api/summary-stats') { - return $this->typeResolver->resolve('Schema\\ApiInsightsSummaryStats'); + return $this->typeResolver->resolve(''); } if ($call === 'GET /orgs/{org}/insights/api/summary-stats/users/{user_id}') { - return $this->typeResolver->resolve('Schema\\ApiInsightsSummaryStats'); + return $this->typeResolver->resolve(''); } if ($call === 'GET /orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}') { - return $this->typeResolver->resolve('Schema\\ApiInsightsSummaryStats'); + return $this->typeResolver->resolve(''); } if ($call === 'GET /orgs/{org}/insights/api/time-stats') { - return $this->typeResolver->resolve('iterable'); + return $this->typeResolver->resolve('Observable'); } if ($call === 'GET /orgs/{org}/insights/api/time-stats/users/{user_id}') { - return $this->typeResolver->resolve('iterable'); + return $this->typeResolver->resolve('Observable'); } if ($call === 'GET /orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}') { - return $this->typeResolver->resolve('iterable'); + return $this->typeResolver->resolve('Observable'); } if ($call === 'GET /orgs/{org}/insights/api/user-stats/{user_id}') { - return $this->typeResolver->resolve('iterable'); + return $this->typeResolver->resolve('Observable'); } if ($call === 'LIST /orgs/{org}/insights/api/user-stats/{user_id}') { - return $this->typeResolver->resolve('iterable'); + return $this->typeResolver->resolve('Observable'); } if ($call === 'GET /orgs/{org}/installation') { @@ -2900,7 +2900,7 @@ public function getTypeFromMethodCall(MethodReflection $methodReflection, Method } if ($call === 'GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries') { - return $this->typeResolver->resolve('iterable'); + return $this->typeResolver->resolve('Observable'); } if ($call === 'GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}') { @@ -4160,7 +4160,7 @@ public function getTypeFromMethodCall(MethodReflection $methodReflection, Method } if ($call === 'PUT /user/following/{username}') { - return $this->typeResolver->resolve(''); + return $this->typeResolver->resolve('\\ApiClients\\Tools\\OpenApiClient\\Utils\\Response\\WithoutBody'); } if ($call === 'DELETE /user/following/{username}') { diff --git a/clients/GitHub/tests/Internal/Operation/Users/FollowTest.php b/clients/GitHub/tests/Internal/Operation/Users/FollowTest.php index db6779c40c6..d5d2c2570b1 100644 --- a/clients/GitHub/tests/Internal/Operation/Users/FollowTest.php +++ b/clients/GitHub/tests/Internal/Operation/Users/FollowTest.php @@ -123,6 +123,40 @@ public function operations_httpCode_401_responseContentType_application_json_zer $result = $client->operations()->users()->follow('generated'); } + /** @test */ + public function call_httpCode_422_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\ValidationError::class); + $response = new Response(422, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\ValidationError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('PUT', '/user/following/generated', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->call(Internal\Operation\Users\Follow::OPERATION_MATCH, (static function (array $data): array { + $data['username'] = 'generated'; + + return $data; + })([])); + } + + /** @test */ + public function operations_httpCode_422_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\ValidationError::class); + $response = new Response(422, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\ValidationError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('PUT', '/user/following/generated', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->users()->follow('generated'); + } + /** @test */ public function call_httpCode_204_empty(): void { diff --git a/clients/GitHub/tests/Types/ClientCallReturnTypes.php b/clients/GitHub/tests/Types/ClientCallReturnTypes.php index 78cf659d72d..f947005127f 100644 --- a/clients/GitHub/tests/Types/ClientCallReturnTypes.php +++ b/clients/GitHub/tests/Types/ClientCallReturnTypes.php @@ -24,7 +24,7 @@ function authHeader(): string assertType('', $client->call('POST /app-manifests/{code}/conversions')); assertType('', $client->call('GET /app/hook/config')); assertType('', $client->call('PATCH /app/hook/config')); -assertType('iterable', $client->call('GET /app/hook/deliveries')); +assertType('Observable', $client->call('GET /app/hook/deliveries')); assertType('', $client->call('GET /app/hook/deliveries/{delivery_id}')); assertType('', $client->call('POST /app/hook/deliveries/{delivery_id}/attempts')); assertType('Observable|WithoutBody', $client->call('GET /app/installation-requests')); @@ -252,22 +252,22 @@ function authHeader(): string assertType('', $client->call('PATCH /orgs/{org}/hooks/{hook_id}')); assertType('', $client->call('GET /orgs/{org}/hooks/{hook_id}/config')); assertType('', $client->call('PATCH /orgs/{org}/hooks/{hook_id}/config')); -assertType('iterable', $client->call('GET /orgs/{org}/hooks/{hook_id}/deliveries')); +assertType('Observable', $client->call('GET /orgs/{org}/hooks/{hook_id}/deliveries')); assertType('', $client->call('GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}')); assertType('', $client->call('POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts')); assertType('', $client->call('POST /orgs/{org}/hooks/{hook_id}/pings')); -assertType('iterable', $client->call('GET /orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}')); -assertType('iterable', $client->call('LIST /orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}')); -assertType('iterable', $client->call('GET /orgs/{org}/insights/api/subject-stats')); -assertType('iterable', $client->call('LIST /orgs/{org}/insights/api/subject-stats')); -assertType('Schema\\ApiInsightsSummaryStats', $client->call('GET /orgs/{org}/insights/api/summary-stats')); -assertType('Schema\\ApiInsightsSummaryStats', $client->call('GET /orgs/{org}/insights/api/summary-stats/users/{user_id}')); -assertType('Schema\\ApiInsightsSummaryStats', $client->call('GET /orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}')); -assertType('iterable', $client->call('GET /orgs/{org}/insights/api/time-stats')); -assertType('iterable', $client->call('GET /orgs/{org}/insights/api/time-stats/users/{user_id}')); -assertType('iterable', $client->call('GET /orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}')); -assertType('iterable', $client->call('GET /orgs/{org}/insights/api/user-stats/{user_id}')); -assertType('iterable', $client->call('LIST /orgs/{org}/insights/api/user-stats/{user_id}')); +assertType('Observable', $client->call('GET /orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}')); +assertType('Observable', $client->call('LIST /orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}')); +assertType('Observable', $client->call('GET /orgs/{org}/insights/api/subject-stats')); +assertType('Observable', $client->call('LIST /orgs/{org}/insights/api/subject-stats')); +assertType('', $client->call('GET /orgs/{org}/insights/api/summary-stats')); +assertType('', $client->call('GET /orgs/{org}/insights/api/summary-stats/users/{user_id}')); +assertType('', $client->call('GET /orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}')); +assertType('Observable', $client->call('GET /orgs/{org}/insights/api/time-stats')); +assertType('Observable', $client->call('GET /orgs/{org}/insights/api/time-stats/users/{user_id}')); +assertType('Observable', $client->call('GET /orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}')); +assertType('Observable', $client->call('GET /orgs/{org}/insights/api/user-stats/{user_id}')); +assertType('Observable', $client->call('LIST /orgs/{org}/insights/api/user-stats/{user_id}')); assertType('', $client->call('GET /orgs/{org}/installation')); assertType('', $client->call('GET /orgs/{org}/installations')); assertType('', $client->call('GET /orgs/{org}/interaction-limits')); @@ -731,7 +731,7 @@ function authHeader(): string assertType('', $client->call('PATCH /repos/{owner}/{repo}/hooks/{hook_id}')); assertType('', $client->call('GET /repos/{owner}/{repo}/hooks/{hook_id}/config')); assertType('', $client->call('PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config')); -assertType('iterable', $client->call('GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries')); +assertType('Observable', $client->call('GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries')); assertType('', $client->call('GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}')); assertType('', $client->call('POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts')); assertType('', $client->call('POST /repos/{owner}/{repo}/hooks/{hook_id}/pings')); @@ -1046,7 +1046,7 @@ function authHeader(): string assertType('Observable|WithoutBody', $client->call('GET /user/following')); assertType('Observable|WithoutBody', $client->call('LIST /user/following')); assertType('', $client->call('GET /user/following/{username}')); -assertType('', $client->call('PUT /user/following/{username}')); +assertType('\\ApiClients\\Tools\\OpenApiClient\\Utils\\Response\\WithoutBody', $client->call('PUT /user/following/{username}')); assertType('', $client->call('DELETE /user/following/{username}')); assertType('Observable|WithoutBody', $client->call('GET /user/gpg_keys')); assertType('Observable|WithoutBody', $client->call('LIST /user/gpg_keys')); diff --git a/etc/specs/GitHub/current.spec.yaml b/etc/specs/GitHub/current.spec.yaml index cd3043cc833..f37eeb362de 100644 --- a/etc/specs/GitHub/current.spec.yaml +++ b/etc/specs/GitHub/current.spec.yaml @@ -44664,6 +44664,8 @@ paths: "$ref": "#/components/responses/forbidden" '401': "$ref": "#/components/responses/requires_authentication" + '422': + "$ref": "#/components/responses/validation_failed" x-github: githubCloudOnly: false enabledForGitHubApps: false