diff --git a/clients/GitHub/etc/openapi-client-generator.state b/clients/GitHub/etc/openapi-client-generator.state index 7221ea0454f..484c497a582 100644 --- a/clients/GitHub/etc/openapi-client-generator.state +++ b/clients/GitHub/etc/openapi-client-generator.state @@ -1,5 +1,5 @@ { - "specHash": "7d381dcec5cc31f738fdd8a803bade45", + "specHash": "864f215bcb7fda8ed79c1295fb5a81d2", "generatedFiles": { "files": [ { @@ -4904,7 +4904,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/CodeScanning\/UpdateAlert\/Request\/ApplicationJson.php", - "hash": "ca69cd47caca3aa345abf30533f2c38a" + "hash": "b4b29ef0b28a1553577703ac785d9b48" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/CodeScanning\/UploadSarif\/Request\/ApplicationJson.php", @@ -5532,7 +5532,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Operation\/SecretScanning.php", - "hash": "9bb033435eaa98d866efe71eb1e4ddbd" + "hash": "7f50cc5ea564fc5d7844ba24209d3e63" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Operation\/Activity.php", @@ -5572,7 +5572,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Operation\/CodeScanning.php", - "hash": "8afe9ac6d0e3ea7cf988c7adcd3de78f" + "hash": "bff68a3edb7a8c46c33716e7f56300f3" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Operation\/Codespaces.php", @@ -12328,11 +12328,11 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operation\/SecretScanning\/ListAlertsForEnterprise.php", - "hash": "af66fb7841bb4e907081073aafb9b3ba" + "hash": "64c22ed00ee612e94a6b9e6e360a873a" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operator\/SecretScanning\/ListAlertsForEnterprise.php", - "hash": "6ff1f101a2fc2ce58e347d095c27a591" + "hash": "41c927430ffa2540ebe7f835cdc98cc1" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Internal\/Operation\/SecretScanning\/ListAlertsForEnterpriseTest.php", @@ -15068,11 +15068,11 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operation\/SecretScanning\/ListAlertsForOrg.php", - "hash": "e12e7df947efaa5143b80633dc732691" + "hash": "b621695f8ccb7ab5d0b4a6e101408b33" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operator\/SecretScanning\/ListAlertsForOrg.php", - "hash": "5055095bcefa6d8312f2b28a20b22686" + "hash": "616f754cc16989b17a971e7ece5f94b8" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Internal\/Operation\/SecretScanning\/ListAlertsForOrgTest.php", @@ -15080,11 +15080,11 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operation\/SecretScanning\/ListAlertsForOrgListing.php", - "hash": "2c037d4bd513cd1ca96a6823618bbc60" + "hash": "ce580883ade5b31fa9aa8c50dbdc14d2" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operator\/SecretScanning\/ListAlertsForOrgListing.php", - "hash": "5d481946b23b0bacfcd8a582de4047cd" + "hash": "5c95a871bce5ad2b98fbf050cf1f528e" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Internal\/Operation\/SecretScanning\/ListAlertsForOrgListingTest.php", @@ -17536,15 +17536,15 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operation\/CodeScanning\/UpdateAlert.php", - "hash": "79847094debeeee5e499095bdc832d27" + "hash": "0772cd4f3943d1c166ba88b67cf0e906" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operator\/CodeScanning\/UpdateAlert.php", - "hash": "49bdc4726a22d56e4eb37e74f53b6872" + "hash": "ad03cff54583a7524b8e0142621329c8" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Internal\/Operation\/CodeScanning\/UpdateAlertTest.php", - "hash": "a874f0cd175039a1b934f65805663938" + "hash": "595783c00e06b86b0fa6b7f0001ff972" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operation\/CodeScanning\/ListAlertInstances.php", @@ -20964,11 +20964,11 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operation\/SecretScanning\/ListAlertsForRepo.php", - "hash": "f7fc73b0f53290772f790be58df20312" + "hash": "af51cf9e6fb234ed814bb352fa56ceb0" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operator\/SecretScanning\/ListAlertsForRepo.php", - "hash": "fd02451b5ef91af3c0ae767a378e9c63" + "hash": "3aac065ae25320bd3a6bf79d75ee4d36" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Internal\/Operation\/SecretScanning\/ListAlertsForRepoTest.php", @@ -20976,11 +20976,11 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operation\/SecretScanning\/ListAlertsForRepoListing.php", - "hash": "5b4871445b736c8d332aa0947b005f78" + "hash": "2a4cdd8d4f0708019a86b97aa0ab76e2" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operator\/SecretScanning\/ListAlertsForRepoListing.php", - "hash": "f2fbe0a1dbdad5a5a36888c369afed43" + "hash": "a17f9b8afc868944a6a494b8caeaaf3b" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Internal\/Operation\/SecretScanning\/ListAlertsForRepoListingTest.php", @@ -24384,7 +24384,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Get\/SecretScanning.php", - "hash": "dffa3ec1289d153acc0a8324215d4ec5" + "hash": "8e825afdbf25f991a93494a8fa7289ac" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Actions.php", @@ -24560,7 +24560,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Patch\/CodeScanning.php", - "hash": "006bc67df112b0d0f5d2b91c59cae38c" + "hash": "c5c5ec0dfc0b0f2fe4999d671afcc071" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Patch\/Issues.php", @@ -24640,7 +24640,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/List\/SecretScanning.php", - "hash": "972ff5051c257536310f274406ba0ec1" + "hash": "d6748a3281d1140c626e6f4f1858de30" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/List\/Pulls.php", @@ -24832,11 +24832,11 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Five.php", - "hash": "f5ec8d2962554a8e1637fe776cd73689" + "hash": "fd7918dfc4ecf521698e287b0abd1e41" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Six.php", - "hash": "1f657d72925483e30400b4d03125ecaa" + "hash": "f441783f2cf7cce11cc619f974772c8c" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Seven.php", @@ -24908,7 +24908,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Patch\/Seven.php", - "hash": "65d699bf86ed52845ce7befdef35c421" + "hash": "769b9d953ada4cf572f9a4915c0e9b3b" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Patch\/Nine.php", @@ -24936,11 +24936,11 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/List\/Five.php", - "hash": "7516af6b41f8a9d3b475684f306347be" + "hash": "c41274c51f0be3c276a995d5583aeceb" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/List\/Six.php", - "hash": "a5061ea4823a62a9b695f2069666686c" + "hash": "f1757875ca543b4c0bbb51eb471a518d" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/List\/Seven.php", @@ -25976,7 +25976,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Hydrator\/Operation\/Repos\/Owner\/Repo\/CodeScanning\/Alerts\/AlertNumber.php", - "hash": "d3d328d9566c5a2a8937d46d4f5343b8" + "hash": "99850d422f658ab868fa7c20c902909c" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Hydrator\/Operation\/Repos\/Owner\/Repo\/CodeScanning\/Alerts\/AlertNumber\/Instances.php", @@ -27612,11 +27612,11 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/PHPStan\/ClientCallReturnTypes.php", - "hash": "0d3db6688c9fae3081f04b53c53152cc" + "hash": "5dc346406dd56d37bfa4e119b03c895d" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Types\/ClientCallReturnTypes.php", - "hash": "5c629eef52f39ab563b41d080fb37095" + "hash": "4087c0a3207a4644727a24448548daa4" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/..\/etc\/phpstan-extension.neon", @@ -31929,6 +31929,10 @@ { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/AliasAbstract\/Tiet754DB2AE\/TietE5139940\/TietE72CE13C\/TietD3BE351E.php", "hash": "274ed1345c9ce3ce86361dcf9dee238e" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/CodeScanningAlertCreateRequest.php", + "hash": "7a383b040ad94615701c1cee540ab3e0" } ] }, diff --git a/clients/GitHub/src/Internal/Hydrator/Operation/Repos/Owner/Repo/CodeScanning/Alerts/AlertNumber.php b/clients/GitHub/src/Internal/Hydrator/Operation/Repos/Owner/Repo/CodeScanning/Alerts/AlertNumber.php index 7cc473187c2..a9407350661 100644 --- a/clients/GitHub/src/Internal/Hydrator/Operation/Repos/Owner/Repo/CodeScanning/Alerts/AlertNumber.php +++ b/clients/GitHub/src/Internal/Hydrator/Operation/Repos/Owner/Repo/CodeScanning/Alerts/AlertNumber.php @@ -12,6 +12,7 @@ use ApiClients\Client\GitHub\Schema\CodeScanningAlertRule; use ApiClients\Client\GitHub\Schema\CodeScanningAnalysisTool; use ApiClients\Client\GitHub\Schema\Operations\SecretScanning\ListAlertsForEnterprise\Response\ApplicationJson\ServiceUnavailable; +use ApiClients\Client\GitHub\Schema\ScimError; use ApiClients\Client\GitHub\Schema\SimpleUser; use EventSauce\ObjectHydrator\IterableList; use EventSauce\ObjectHydrator\ObjectMapper; @@ -57,6 +58,7 @@ public function hydrateObject(string $className, array $payload): object 'ApiClients\Client\GitHub\Schema\CodeScanningAlertLocation' => $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeScanningAlertLocation($payload), 'ApiClients\Client\GitHub\Schema\BasicError' => $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️BasicError($payload), 'ApiClients\Client\GitHub\Schema\Operations\SecretScanning\ListAlertsForEnterprise\Response\ApplicationJson\ServiceUnavailable' => $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️Operations⚡️SecretScanning⚡️ListAlertsForEnterprise⚡️Response⚡️ApplicationJson⚡️ServiceUnavailable($payload), + 'ApiClients\Client\GitHub\Schema\ScimError' => $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️ScimError($payload), default => throw UnableToHydrateObject::noHydrationDefined($className, $this->hydrationStack), }; } @@ -1098,6 +1100,91 @@ private function hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️Oper } } + private function hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️ScimError(array $payload): ScimError + { + $properties = []; + $missingFields = []; + try { + $value = $payload['message'] ?? null; + + if ($value === null) { + $properties['message'] = null; + goto after_message; + } + + $properties['message'] = $value; + + after_message: + + $value = $payload['documentation_url'] ?? null; + + if ($value === null) { + $properties['documentationUrl'] = null; + goto after_documentationUrl; + } + + $properties['documentationUrl'] = $value; + + after_documentationUrl: + + $value = $payload['detail'] ?? null; + + if ($value === null) { + $properties['detail'] = null; + goto after_detail; + } + + $properties['detail'] = $value; + + after_detail: + + $value = $payload['status'] ?? null; + + if ($value === null) { + $properties['status'] = null; + goto after_status; + } + + $properties['status'] = $value; + + after_status: + + $value = $payload['scim_type'] ?? null; + + if ($value === null) { + $properties['scimType'] = null; + goto after_scimType; + } + + $properties['scimType'] = $value; + + after_scimType: + + $value = $payload['schemas'] ?? null; + + if ($value === null) { + $properties['schemas'] = null; + goto after_schemas; + } + + $properties['schemas'] = $value; + + after_schemas: + } catch (Throwable $exception) { + throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\ScimError', $exception, stack: $this->hydrationStack); + } + + if (count($missingFields) > 0) { + throw UnableToHydrateObject::dueToMissingFields(ScimError::class, $missingFields, stack: $this->hydrationStack); + } + + try { + return new ScimError(...$properties); + } catch (Throwable $exception) { + throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\ScimError', $exception, stack: $this->hydrationStack); + } + } + private function serializeViaTypeMap(string $accessor, object $object, array $payloadToTypeMap): array { foreach ($payloadToTypeMap as $payloadType => [$valueType, $method]) { @@ -1138,6 +1225,7 @@ public function serializeObjectOfType(object $object, string $className): mixed 'ApiClients\Client\GitHub\Schema\CodeScanningAlertLocation' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeScanningAlertLocation($object), 'ApiClients\Client\GitHub\Schema\BasicError' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️BasicError($object), 'ApiClients\Client\GitHub\Schema\Operations\SecretScanning\ListAlertsForEnterprise\Response\ApplicationJson\ServiceUnavailable' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️Operations⚡️SecretScanning⚡️ListAlertsForEnterprise⚡️Response⚡️ApplicationJson⚡️ServiceUnavailable($object), + 'ApiClients\Client\GitHub\Schema\ScimError' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️ScimError($object), default => throw new LogicException("No serialization defined for $className"), }; } catch (Throwable $exception) { @@ -1752,6 +1840,69 @@ private function serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema return $result; } + private function serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️ScimError(mixed $object): mixed + { + assert($object instanceof ScimError); + $result = []; + + $message = $object->message; + + if ($message === null) { + goto after_message; + } + + after_message: $result['message'] = $message; + + $documentationUrl = $object->documentationUrl; + + if ($documentationUrl === null) { + goto after_documentationUrl; + } + + after_documentationUrl: $result['documentation_url'] = $documentationUrl; + + $detail = $object->detail; + + if ($detail === null) { + goto after_detail; + } + + after_detail: $result['detail'] = $detail; + + $status = $object->status; + + if ($status === null) { + goto after_status; + } + + after_status: $result['status'] = $status; + + $scimType = $object->scimType; + + if ($scimType === null) { + goto after_scimType; + } + + after_scimType: $result['scim_type'] = $scimType; + + $schemas = $object->schemas; + + if ($schemas === null) { + goto after_schemas; + } + + static $schemasSerializer0; + + if ($schemasSerializer0 === null) { + $schemasSerializer0 = new SerializeArrayItems(...[]); + } + + $schemas = $schemasSerializer0->serialize($schemas, $this); + after_schemas: $result['schemas'] = $schemas; + + return $result; + } + /** * @param class-string $className * @param iterable $payloads; diff --git a/clients/GitHub/src/Internal/Operation/CodeScanning/UpdateAlert.php b/clients/GitHub/src/Internal/Operation/CodeScanning/UpdateAlert.php index c7bb106b707..32dd86f9689 100644 --- a/clients/GitHub/src/Internal/Operation/CodeScanning/UpdateAlert.php +++ b/clients/GitHub/src/Internal/Operation/CodeScanning/UpdateAlert.php @@ -59,6 +59,14 @@ public function createResponse(ResponseInterface $response): Schema\CodeScanning $this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\CodeScanningAlert::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); return $this->hydrator->hydrateObject(Schema\CodeScanningAlert::class, $body); + /** + * Bad Request + **/ + + case 400: + $this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\BasicError::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + + throw new ErrorSchemas\BasicError(400, $this->hydrator->hydrateObject(Schema\BasicError::class, $body)); /** * Response if the repository is archived or if GitHub Advanced Security is not enabled for this repository **/ @@ -85,6 +93,19 @@ public function createResponse(ResponseInterface $response): Schema\CodeScanning throw new ErrorSchemas\Operations\SecretScanning\ListAlertsForEnterprise\Response\ApplicationJson\ServiceUnavailable(503, $this->hydrator->hydrateObject(Schema\Operations\SecretScanning\ListAlertsForEnterprise\Response\ApplicationJson\ServiceUnavailable::class, $body)); } + break; + case 'application/scim+json': + $body = json_decode($response->getBody()->getContents(), true); + switch ($code) { + /** + * Bad Request + **/ + case 400: + $this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\ScimError::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + + throw new ErrorSchemas\ScimError(400, $this->hydrator->hydrateObject(Schema\ScimError::class, $body)); + } + break; } diff --git a/clients/GitHub/src/Internal/Operation/SecretScanning/ListAlertsForEnterprise.php b/clients/GitHub/src/Internal/Operation/SecretScanning/ListAlertsForEnterprise.php index b4a59f1c777..2332559cc38 100644 --- a/clients/GitHub/src/Internal/Operation/SecretScanning/ListAlertsForEnterprise.php +++ b/clients/GitHub/src/Internal/Operation/SecretScanning/ListAlertsForEnterprise.php @@ -29,7 +29,7 @@ final class ListAlertsForEnterprise private string $enterprise; /**Set to `open` or `resolved` to only list secret scanning alerts in a specific state. **/ private string $state; - /**A comma-separated list of secret types to return. All default secret patterns are returned. To return experimental patterns, pass the token name(s) in the parameter. See "[Supported secret scanning patterns](https://docs.github.com/enterprise-cloud@latest/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)" for a complete list of secret types. **/ + /**A comma-separated list of secret types to return. All default secret patterns are returned. To return generic patterns, pass the token name(s) in the parameter. See "[Supported secret scanning patterns](https://docs.github.com/enterprise-cloud@latest/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)" for a complete list of secret types. **/ private string $secretType; /**A comma-separated list of resolutions. Only secret scanning alerts with one of these resolutions are listed. Valid resolutions are `false_positive`, `wont_fix`, `revoked`, `pattern_edited`, `pattern_deleted` or `used_in_tests`. **/ private string $resolution; diff --git a/clients/GitHub/src/Internal/Operation/SecretScanning/ListAlertsForOrg.php b/clients/GitHub/src/Internal/Operation/SecretScanning/ListAlertsForOrg.php index c07b3991cc8..0f6d2c7230c 100644 --- a/clients/GitHub/src/Internal/Operation/SecretScanning/ListAlertsForOrg.php +++ b/clients/GitHub/src/Internal/Operation/SecretScanning/ListAlertsForOrg.php @@ -29,7 +29,7 @@ final class ListAlertsForOrg private string $org; /**Set to `open` or `resolved` to only list secret scanning alerts in a specific state. **/ private string $state; - /**A comma-separated list of secret types to return. All default secret patterns are returned. To return experimental patterns, pass the token name(s) in the parameter. See "[Supported secret scanning patterns](https://docs.github.com/enterprise-cloud@latest/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)" for a complete list of secret types. **/ + /**A comma-separated list of secret types to return. All default secret patterns are returned. To return generic patterns, pass the token name(s) in the parameter. See "[Supported secret scanning patterns](https://docs.github.com/enterprise-cloud@latest/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)" for a complete list of secret types. **/ private string $secretType; /**A comma-separated list of resolutions. Only secret scanning alerts with one of these resolutions are listed. Valid resolutions are `false_positive`, `wont_fix`, `revoked`, `pattern_edited`, `pattern_deleted` or `used_in_tests`. **/ private string $resolution; diff --git a/clients/GitHub/src/Internal/Operation/SecretScanning/ListAlertsForOrgListing.php b/clients/GitHub/src/Internal/Operation/SecretScanning/ListAlertsForOrgListing.php index 4a278d7724b..4469e781d80 100644 --- a/clients/GitHub/src/Internal/Operation/SecretScanning/ListAlertsForOrgListing.php +++ b/clients/GitHub/src/Internal/Operation/SecretScanning/ListAlertsForOrgListing.php @@ -29,7 +29,7 @@ final class ListAlertsForOrgListing private string $org; /**Set to `open` or `resolved` to only list secret scanning alerts in a specific state. **/ private string $state; - /**A comma-separated list of secret types to return. All default secret patterns are returned. To return experimental patterns, pass the token name(s) in the parameter. See "[Supported secret scanning patterns](https://docs.github.com/enterprise-cloud@latest/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)" for a complete list of secret types. **/ + /**A comma-separated list of secret types to return. All default secret patterns are returned. To return generic patterns, pass the token name(s) in the parameter. See "[Supported secret scanning patterns](https://docs.github.com/enterprise-cloud@latest/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)" for a complete list of secret types. **/ private string $secretType; /**A comma-separated list of resolutions. Only secret scanning alerts with one of these resolutions are listed. Valid resolutions are `false_positive`, `wont_fix`, `revoked`, `pattern_edited`, `pattern_deleted` or `used_in_tests`. **/ private string $resolution; diff --git a/clients/GitHub/src/Internal/Operation/SecretScanning/ListAlertsForRepo.php b/clients/GitHub/src/Internal/Operation/SecretScanning/ListAlertsForRepo.php index 0997549e8c2..59ed03e95de 100644 --- a/clients/GitHub/src/Internal/Operation/SecretScanning/ListAlertsForRepo.php +++ b/clients/GitHub/src/Internal/Operation/SecretScanning/ListAlertsForRepo.php @@ -32,7 +32,7 @@ final class ListAlertsForRepo private string $repo; /**Set to `open` or `resolved` to only list secret scanning alerts in a specific state. **/ private string $state; - /**A comma-separated list of secret types to return. All default secret patterns are returned. To return experimental patterns, pass the token name(s) in the parameter. See "[Supported secret scanning patterns](https://docs.github.com/enterprise-cloud@latest/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)" for a complete list of secret types. **/ + /**A comma-separated list of secret types to return. All default secret patterns are returned. To return generic patterns, pass the token name(s) in the parameter. See "[Supported secret scanning patterns](https://docs.github.com/enterprise-cloud@latest/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)" for a complete list of secret types. **/ private string $secretType; /**A comma-separated list of resolutions. Only secret scanning alerts with one of these resolutions are listed. Valid resolutions are `false_positive`, `wont_fix`, `revoked`, `pattern_edited`, `pattern_deleted` or `used_in_tests`. **/ private string $resolution; diff --git a/clients/GitHub/src/Internal/Operation/SecretScanning/ListAlertsForRepoListing.php b/clients/GitHub/src/Internal/Operation/SecretScanning/ListAlertsForRepoListing.php index 20f1c5da2b8..d3a042d474a 100644 --- a/clients/GitHub/src/Internal/Operation/SecretScanning/ListAlertsForRepoListing.php +++ b/clients/GitHub/src/Internal/Operation/SecretScanning/ListAlertsForRepoListing.php @@ -32,7 +32,7 @@ final class ListAlertsForRepoListing private string $repo; /**Set to `open` or `resolved` to only list secret scanning alerts in a specific state. **/ private string $state; - /**A comma-separated list of secret types to return. All default secret patterns are returned. To return experimental patterns, pass the token name(s) in the parameter. See "[Supported secret scanning patterns](https://docs.github.com/enterprise-cloud@latest/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)" for a complete list of secret types. **/ + /**A comma-separated list of secret types to return. All default secret patterns are returned. To return generic patterns, pass the token name(s) in the parameter. See "[Supported secret scanning patterns](https://docs.github.com/enterprise-cloud@latest/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)" for a complete list of secret types. **/ private string $secretType; /**A comma-separated list of resolutions. Only secret scanning alerts with one of these resolutions are listed. Valid resolutions are `false_positive`, `wont_fix`, `revoked`, `pattern_edited`, `pattern_deleted` or `used_in_tests`. **/ private string $resolution; diff --git a/clients/GitHub/src/Internal/Operator/CodeScanning/UpdateAlert.php b/clients/GitHub/src/Internal/Operator/CodeScanning/UpdateAlert.php index 24bb34fd219..8aabde7f6c7 100644 --- a/clients/GitHub/src/Internal/Operator/CodeScanning/UpdateAlert.php +++ b/clients/GitHub/src/Internal/Operator/CodeScanning/UpdateAlert.php @@ -24,7 +24,6 @@ public function __construct(private Browser $browser, private AuthenticationInte { } - /** @return */ public function call(string $owner, string $repo, int $alertNumber, array $params): CodeScanningAlert { $operation = new \ApiClients\Client\GitHub\Internal\Operation\CodeScanning\UpdateAlert($this->requestSchemaValidator, $this->responseSchemaValidator, $this->hydrator, $owner, $repo, $alertNumber); diff --git a/clients/GitHub/src/Internal/Operator/SecretScanning/ListAlertsForEnterprise.php b/clients/GitHub/src/Internal/Operator/SecretScanning/ListAlertsForEnterprise.php index b6ec6c98ca0..2f2ca81b1be 100644 --- a/clients/GitHub/src/Internal/Operator/SecretScanning/ListAlertsForEnterprise.php +++ b/clients/GitHub/src/Internal/Operator/SecretScanning/ListAlertsForEnterprise.php @@ -24,7 +24,7 @@ public function __construct(private Browser $browser, private AuthenticationInte { } - /** @return Observable */ + /** @return iterable */ public function call(string $enterprise, string $state, string $secretType, string $resolution, string $before, string $after, string $validity, string $sort = 'created', string $direction = 'desc', int $perPage = 30, bool $isPubliclyLeaked = false, bool $isMultiRepo = false): iterable { $operation = new \ApiClients\Client\GitHub\Internal\Operation\SecretScanning\ListAlertsForEnterprise($this->responseSchemaValidator, $this->hydrator, $enterprise, $state, $secretType, $resolution, $before, $after, $validity, $sort, $direction, $perPage, $isPubliclyLeaked, $isMultiRepo); diff --git a/clients/GitHub/src/Internal/Operator/SecretScanning/ListAlertsForOrg.php b/clients/GitHub/src/Internal/Operator/SecretScanning/ListAlertsForOrg.php index c31b1ebfaeb..12b10d3523a 100644 --- a/clients/GitHub/src/Internal/Operator/SecretScanning/ListAlertsForOrg.php +++ b/clients/GitHub/src/Internal/Operator/SecretScanning/ListAlertsForOrg.php @@ -24,7 +24,7 @@ public function __construct(private Browser $browser, private AuthenticationInte { } - /** @return Observable */ + /** @return iterable */ public function call(string $org, string $state, string $secretType, string $resolution, string $before, string $after, string $validity, string $sort = 'created', string $direction = 'desc', int $page = 1, int $perPage = 30, bool $isPubliclyLeaked = false, bool $isMultiRepo = false): iterable { $operation = new \ApiClients\Client\GitHub\Internal\Operation\SecretScanning\ListAlertsForOrg($this->responseSchemaValidator, $this->hydrator, $org, $state, $secretType, $resolution, $before, $after, $validity, $sort, $direction, $page, $perPage, $isPubliclyLeaked, $isMultiRepo); diff --git a/clients/GitHub/src/Internal/Operator/SecretScanning/ListAlertsForOrgListing.php b/clients/GitHub/src/Internal/Operator/SecretScanning/ListAlertsForOrgListing.php index 9b08aaf7f16..88cac738b96 100644 --- a/clients/GitHub/src/Internal/Operator/SecretScanning/ListAlertsForOrgListing.php +++ b/clients/GitHub/src/Internal/Operator/SecretScanning/ListAlertsForOrgListing.php @@ -24,7 +24,7 @@ public function __construct(private Browser $browser, private AuthenticationInte { } - /** @return Observable */ + /** @return iterable */ public function call(string $org, string $state, string $secretType, string $resolution, string $before, string $after, string $validity, string $sort = 'created', string $direction = 'desc', int $page = 1, int $perPage = 30, bool $isPubliclyLeaked = false, bool $isMultiRepo = false): iterable { $operation = new \ApiClients\Client\GitHub\Internal\Operation\SecretScanning\ListAlertsForOrgListing($this->responseSchemaValidator, $this->hydrator, $org, $state, $secretType, $resolution, $before, $after, $validity, $sort, $direction, $page, $perPage, $isPubliclyLeaked, $isMultiRepo); diff --git a/clients/GitHub/src/Internal/Operator/SecretScanning/ListAlertsForRepo.php b/clients/GitHub/src/Internal/Operator/SecretScanning/ListAlertsForRepo.php index 4feda3e89cd..811d14759ef 100644 --- a/clients/GitHub/src/Internal/Operator/SecretScanning/ListAlertsForRepo.php +++ b/clients/GitHub/src/Internal/Operator/SecretScanning/ListAlertsForRepo.php @@ -25,7 +25,7 @@ public function __construct(private Browser $browser, private AuthenticationInte { } - /** @return Observable|WithoutBody */ + /** @return iterable|WithoutBody */ public function call(string $owner, string $repo, string $state, string $secretType, string $resolution, string $before, string $after, string $validity, string $sort = 'created', string $direction = 'desc', int $page = 1, int $perPage = 30, bool $isPubliclyLeaked = false, bool $isMultiRepo = false): iterable|WithoutBody { $operation = new \ApiClients\Client\GitHub\Internal\Operation\SecretScanning\ListAlertsForRepo($this->responseSchemaValidator, $this->hydrator, $owner, $repo, $state, $secretType, $resolution, $before, $after, $validity, $sort, $direction, $page, $perPage, $isPubliclyLeaked, $isMultiRepo); diff --git a/clients/GitHub/src/Internal/Operator/SecretScanning/ListAlertsForRepoListing.php b/clients/GitHub/src/Internal/Operator/SecretScanning/ListAlertsForRepoListing.php index a851502c2cf..bd74b38cde8 100644 --- a/clients/GitHub/src/Internal/Operator/SecretScanning/ListAlertsForRepoListing.php +++ b/clients/GitHub/src/Internal/Operator/SecretScanning/ListAlertsForRepoListing.php @@ -25,7 +25,7 @@ public function __construct(private Browser $browser, private AuthenticationInte { } - /** @return Observable|WithoutBody */ + /** @return iterable|WithoutBody */ public function call(string $owner, string $repo, string $state, string $secretType, string $resolution, string $before, string $after, string $validity, string $sort = 'created', string $direction = 'desc', int $page = 1, int $perPage = 30, bool $isPubliclyLeaked = false, bool $isMultiRepo = false): iterable|WithoutBody { $operation = new \ApiClients\Client\GitHub\Internal\Operation\SecretScanning\ListAlertsForRepoListing($this->responseSchemaValidator, $this->hydrator, $owner, $repo, $state, $secretType, $resolution, $before, $after, $validity, $sort, $direction, $page, $perPage, $isPubliclyLeaked, $isMultiRepo); diff --git a/clients/GitHub/src/Internal/Router/Get/Five.php b/clients/GitHub/src/Internal/Router/Get/Five.php index ce6e9d9bba2..fd8c075c88d 100644 --- a/clients/GitHub/src/Internal/Router/Get/Five.php +++ b/clients/GitHub/src/Internal/Router/Get/Five.php @@ -52,7 +52,7 @@ public function __construct(private Routers $routers) { } - /** @return |Observable|Observable|WithoutBody|Observable|Observable|Observable|Schema\BasicError|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|Observable|Observable|Observable */ + /** @return |Observable|Observable|WithoutBody|iterable|Observable|Observable|Schema\BasicError|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|Observable|Observable|Observable */ public function call(string $call, array $params, array $pathChunks): HookDelivery|iterable|WithoutBody|GistComment|MarketplacePurchase|BasicError|ThreadSubscription|Ok|ActionsOrganizationPermissions|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListSelfHostedRunnerGroupsForOrg\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListSelfHostedRunnersForOrg\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListOrgSecrets\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListOrgVariables\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Orgs\ListAttestations\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\ListOrgSecrets\Response\ApplicationJson\Ok|CopilotOrganizationDetails|\ApiClients\Client\GitHub\Schema\Operations\Dependabot\ListOrgSecrets\Response\ApplicationJson\Ok|OrgHook|OrgMembership|Migration|OrganizationRole|\ApiClients\Client\GitHub\Schema\Operations\PrivateRegistries\GetOrgPublicKey\Response\ApplicationJson\Ok|OrgPrivateRegistryConfiguration|RepositoryRuleset|\ApiClients\Client\GitHub\Schema\Operations\HostedCompute\ListNetworkConfigurationsForOrg\Response\ApplicationJson\Ok|TeamFull|ProjectCard|CheckAutomatedSecurityFixes|CodeSecurityConfigurationForRepository|Json|\ApiClients\Client\GitHub\Schema\Operations\Repos\GetAllEnvironments\Response\ApplicationJson\Ok|Import|Installation|InteractionLimitResponse|One|Language|LicenseContent|Page|\ApiClients\Client\GitHub\Schema\Operations\Repos\CheckPrivateVulnerabilityReporting\Response\ApplicationJson\Ok|ContentFile|SimpleUser|Stargazer|RepositorySubscription|Topic|TeamDiscussion|TeamMembership|TeamProject|CodespacesUserPublicKey|CodespacesSecret|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\CodespaceMachinesForAuthenticatedUser\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Apps\ListInstallationReposForAuthenticatedUser\Response\ApplicationJson\Ok|Package|\ApiClients\Client\GitHub\Schema\Operations\Users\ListAttestations\Response\ApplicationJson\Ok\Application\Json|EmptyObject { if ($pathChunks[0] === '') { diff --git a/clients/GitHub/src/Internal/Router/Get/SecretScanning.php b/clients/GitHub/src/Internal/Router/Get/SecretScanning.php index c6abaf69736..db61c452f06 100644 --- a/clients/GitHub/src/Internal/Router/Get/SecretScanning.php +++ b/clients/GitHub/src/Internal/Router/Get/SecretScanning.php @@ -22,7 +22,7 @@ public function __construct(private SchemaValidator $requestSchemaValidator, pri { } - /** @return Observable */ + /** @return iterable */ public function listAlertsForEnterprise(array $params): iterable { $arguments = []; @@ -103,7 +103,7 @@ public function listAlertsForEnterprise(array $params): iterable return $operator->call($arguments['enterprise'], $arguments['state'], $arguments['secret_type'], $arguments['resolution'], $arguments['before'], $arguments['after'], $arguments['validity'], $arguments['sort'], $arguments['direction'], $arguments['per_page'], $arguments['is_publicly_leaked'], $arguments['is_multi_repo']); } - /** @return Observable */ + /** @return iterable */ public function listAlertsForOrg(array $params): iterable { $arguments = []; @@ -190,7 +190,7 @@ public function listAlertsForOrg(array $params): iterable return $operator->call($arguments['org'], $arguments['state'], $arguments['secret_type'], $arguments['resolution'], $arguments['before'], $arguments['after'], $arguments['validity'], $arguments['sort'], $arguments['direction'], $arguments['page'], $arguments['per_page'], $arguments['is_publicly_leaked'], $arguments['is_multi_repo']); } - /** @return Observable|WithoutBody */ + /** @return iterable|WithoutBody */ public function listAlertsForRepo(array $params): iterable|WithoutBody { $arguments = []; diff --git a/clients/GitHub/src/Internal/Router/Get/Six.php b/clients/GitHub/src/Internal/Router/Get/Six.php index 336d0318838..ff39c55b0dc 100644 --- a/clients/GitHub/src/Internal/Router/Get/Six.php +++ b/clients/GitHub/src/Internal/Router/Get/Six.php @@ -82,7 +82,7 @@ public function __construct(private Routers $routers) { } - /** @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|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|iterable|\ApiClients\Tools\OpenApiClient\Utils\Response\WithoutBody|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): iterable|CodeSecurityConfiguration|WithoutBody|BillingUsageReport|ActionsCacheUsageOrgEnterprise|Ok|ActionsHostedRunnerLimits|\ApiClients\Client\GitHub\Schema\Operations\Actions\GetHostedRunnersMachineSpecsForOrg\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Actions\GetHostedRunnersPlatformsForOrg\Response\ApplicationJson\Ok|ActionsHostedRunner|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListSelectedRepositoriesEnabledGithubActionsOrganization\Response\ApplicationJson\Ok|SelectedActions|ActionsGetDefaultWorkflowPermissions|RunnerGroupsOrg|Runner|ActionsPublicKey|OrganizationActionsSecret|OrganizationActionsVariable|CodespacesPublicKey|CodespacesOrgSecret|\ApiClients\Client\GitHub\Schema\Operations\Copilot\ListCopilotSeats\Response\ApplicationJson\Ok|DependabotPublicKey|OrganizationDependabotSecret|WebhookConfig|ApiInsightsSummaryStats|Json|CopilotSeatDetails|Package|CustomProperty|RuleSuite|ActionsBillingUsage|PackagesBillingUsage|CombinedBillingUsage|NetworkConfiguration|NetworkSettings|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|SecretScanningScanHistory|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/Five.php b/clients/GitHub/src/Internal/Router/List/Five.php index 8da240fa0c8..ab3a78b2407 100644 --- a/clients/GitHub/src/Internal/Router/List/Five.php +++ b/clients/GitHub/src/Internal/Router/List/Five.php @@ -16,7 +16,7 @@ public function __construct(private Routers $routers) { } - /** @return Observable|Observable|Schema\BasicError|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 */ + /** @return Observable|Observable|Schema\BasicError|WithoutBody|Observable|Observable|Observable|Observable|Observable|iterable|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): iterable|BasicError|WithoutBody { if ($pathChunks[0] === '') { diff --git a/clients/GitHub/src/Internal/Router/List/SecretScanning.php b/clients/GitHub/src/Internal/Router/List/SecretScanning.php index b75c466b2ef..7064bf8e9f7 100644 --- a/clients/GitHub/src/Internal/Router/List/SecretScanning.php +++ b/clients/GitHub/src/Internal/Router/List/SecretScanning.php @@ -21,7 +21,7 @@ public function __construct(private SchemaValidator $requestSchemaValidator, pri { } - /** @return Observable */ + /** @return iterable */ public function listAlertsForOrgListing(array $params): iterable { $arguments = []; @@ -114,7 +114,7 @@ public function listAlertsForOrgListing(array $params): iterable } while (count($items) > 0); } - /** @return Observable|WithoutBody */ + /** @return iterable|WithoutBody */ public function listAlertsForRepoListing(array $params): iterable|WithoutBody { $arguments = []; diff --git a/clients/GitHub/src/Internal/Router/List/Six.php b/clients/GitHub/src/Internal/Router/List/Six.php index ae0a19daabf..f4ec071a849 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|Observable|Observable|Observable|Observable|WithoutBody|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|iterable|WithoutBody|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/Patch/CodeScanning.php b/clients/GitHub/src/Internal/Router/Patch/CodeScanning.php index 272cafd28ca..5954086c757 100644 --- a/clients/GitHub/src/Internal/Router/Patch/CodeScanning.php +++ b/clients/GitHub/src/Internal/Router/Patch/CodeScanning.php @@ -42,7 +42,6 @@ public function updateDefaultSetup(array $params): EmptyObject|CodeScanningDefau return $operator->call($arguments['owner'], $arguments['repo'], $params); } - /** @return */ public function updateAlert(array $params): CodeScanningAlert { $arguments = []; diff --git a/clients/GitHub/src/Internal/Router/Patch/Seven.php b/clients/GitHub/src/Internal/Router/Patch/Seven.php index 14c8dafb551..6cc2520673f 100644 --- a/clients/GitHub/src/Internal/Router/Patch/Seven.php +++ b/clients/GitHub/src/Internal/Router/Patch/Seven.php @@ -25,6 +25,7 @@ public function __construct(private Routers $routers) { } + /** @return |Schema\CodeScanningAlert */ public function call(string $call, array $params, array $pathChunks): TeamDiscussion|WithoutBody|CodeScanningAlert|DependabotAlert|GitRef|WebhookConfig|PorterAuthor|IssueComment|PullRequestReviewComment|ReleaseAsset|SecretScanningAlert|TeamDiscussionComment { if ($pathChunks[0] === '') { diff --git a/clients/GitHub/src/Operation/CodeScanning.php b/clients/GitHub/src/Operation/CodeScanning.php index dabf87b1f8d..30d8db1e210 100644 --- a/clients/GitHub/src/Operation/CodeScanning.php +++ b/clients/GitHub/src/Operation/CodeScanning.php @@ -57,7 +57,6 @@ public function getAlert(string $owner, string $repo, int $alertNumber): CodeSca return $this->operators->codeScanning👷GetAlert()->call($owner, $repo, $alertNumber); } - /** @return */ public function updateAlert(string $owner, string $repo, int $alertNumber, array $params): CodeScanningAlert { return $this->operators->codeScanning👷UpdateAlert()->call($owner, $repo, $alertNumber, $params); diff --git a/clients/GitHub/src/Operation/SecretScanning.php b/clients/GitHub/src/Operation/SecretScanning.php index fe593fd18b0..c2b3776417c 100644 --- a/clients/GitHub/src/Operation/SecretScanning.php +++ b/clients/GitHub/src/Operation/SecretScanning.php @@ -17,31 +17,31 @@ public function __construct(private Internal\Operators $operators) { } - /** @return Observable */ + /** @return iterable */ public function listAlertsForEnterprise(string $enterprise, string $state, string $secretType, string $resolution, string $before, string $after, string $validity, string $sort, string $direction, int $perPage, bool $isPubliclyLeaked, bool $isMultiRepo): iterable { return $this->operators->secretScanning👷ListAlertsForEnterprise()->call($enterprise, $state, $secretType, $resolution, $before, $after, $validity, $sort, $direction, $perPage, $isPubliclyLeaked, $isMultiRepo); } - /** @return Observable */ + /** @return iterable */ public function listAlertsForOrg(string $org, string $state, string $secretType, string $resolution, string $before, string $after, string $validity, string $sort, string $direction, int $page, int $perPage, bool $isPubliclyLeaked, bool $isMultiRepo): iterable { return $this->operators->secretScanning👷ListAlertsForOrg()->call($org, $state, $secretType, $resolution, $before, $after, $validity, $sort, $direction, $page, $perPage, $isPubliclyLeaked, $isMultiRepo); } - /** @return Observable */ + /** @return iterable */ public function listAlertsForOrgListing(string $org, string $state, string $secretType, string $resolution, string $before, string $after, string $validity, string $sort, string $direction, int $page, int $perPage, bool $isPubliclyLeaked, bool $isMultiRepo): iterable { return $this->operators->secretScanning👷ListAlertsForOrgListing()->call($org, $state, $secretType, $resolution, $before, $after, $validity, $sort, $direction, $page, $perPage, $isPubliclyLeaked, $isMultiRepo); } - /** @return Observable|WithoutBody */ + /** @return iterable|WithoutBody */ public function listAlertsForRepo(string $owner, string $repo, string $state, string $secretType, string $resolution, string $before, string $after, string $validity, string $sort, string $direction, int $page, int $perPage, bool $isPubliclyLeaked, bool $isMultiRepo): iterable|WithoutBody { return $this->operators->secretScanning👷ListAlertsForRepo()->call($owner, $repo, $state, $secretType, $resolution, $before, $after, $validity, $sort, $direction, $page, $perPage, $isPubliclyLeaked, $isMultiRepo); } - /** @return Observable|WithoutBody */ + /** @return iterable|WithoutBody */ public function listAlertsForRepoListing(string $owner, string $repo, string $state, string $secretType, string $resolution, string $before, string $after, string $validity, string $sort, string $direction, int $page, int $perPage, bool $isPubliclyLeaked, bool $isMultiRepo): iterable|WithoutBody { return $this->operators->secretScanning👷ListAlertsForRepoListing()->call($owner, $repo, $state, $secretType, $resolution, $before, $after, $validity, $sort, $direction, $page, $perPage, $isPubliclyLeaked, $isMultiRepo); diff --git a/clients/GitHub/src/PHPStan/ClientCallReturnTypes.php b/clients/GitHub/src/PHPStan/ClientCallReturnTypes.php index 1ce8d6c82ed..1b5cfefbf3a 100644 --- a/clients/GitHub/src/PHPStan/ClientCallReturnTypes.php +++ b/clients/GitHub/src/PHPStan/ClientCallReturnTypes.php @@ -232,7 +232,7 @@ public function getTypeFromMethodCall(MethodReflection $methodReflection, Method } if ($call === 'GET /enterprises/{enterprise}/secret-scanning/alerts') { - return $this->typeResolver->resolve('Observable'); + return $this->typeResolver->resolve('iterable'); } if ($call === 'GET /events') { @@ -1532,11 +1532,11 @@ public function getTypeFromMethodCall(MethodReflection $methodReflection, Method } if ($call === 'GET /orgs/{org}/secret-scanning/alerts') { - return $this->typeResolver->resolve('Observable'); + return $this->typeResolver->resolve('iterable'); } if ($call === 'LIST /orgs/{org}/secret-scanning/alerts') { - return $this->typeResolver->resolve('Observable'); + return $this->typeResolver->resolve('iterable'); } if ($call === 'GET /orgs/{org}/security-advisories') { @@ -2456,7 +2456,7 @@ public function getTypeFromMethodCall(MethodReflection $methodReflection, Method } if ($call === 'PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}') { - return $this->typeResolver->resolve(''); + return $this->typeResolver->resolve('Schema\\CodeScanningAlert'); } if ($call === 'GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix') { @@ -3764,11 +3764,11 @@ public function getTypeFromMethodCall(MethodReflection $methodReflection, Method } if ($call === 'GET /repos/{owner}/{repo}/secret-scanning/alerts') { - return $this->typeResolver->resolve('Observable|WithoutBody'); + return $this->typeResolver->resolve('iterable|\\ApiClients\\Tools\\OpenApiClient\\Utils\\Response\\WithoutBody'); } if ($call === 'LIST /repos/{owner}/{repo}/secret-scanning/alerts') { - return $this->typeResolver->resolve('Observable|WithoutBody'); + return $this->typeResolver->resolve('iterable|\\ApiClients\\Tools\\OpenApiClient\\Utils\\Response\\WithoutBody'); } if ($call === 'GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}') { diff --git a/clients/GitHub/src/Schema/CodeScanning/UpdateAlert/Request/ApplicationJson.php b/clients/GitHub/src/Schema/CodeScanning/UpdateAlert/Request/ApplicationJson.php index 7bb01e6b544..ac0dc6ad69b 100644 --- a/clients/GitHub/src/Schema/CodeScanning/UpdateAlert/Request/ApplicationJson.php +++ b/clients/GitHub/src/Schema/CodeScanning/UpdateAlert/Request/ApplicationJson.php @@ -42,6 +42,10 @@ "null" ], "description": "The dismissal comment associated with the dismissal of the alert." + }, + "create_request": { + "type": "boolean", + "description": "If `true`, attempt to create an alert dismissal request." } } }'; @@ -50,17 +54,20 @@ public const SCHEMA_EXAMPLE_DATA = '{ "state": "open", "dismissed_reason": "used in tests", - "dismissed_comment": "generated" + "dismissed_comment": "generated", + "create_request": false }'; /** * state: Sets the state of the code scanning alert. You must provide `dismissed_reason` when you set the state to `dismissed`. * dismissedReason: **Required when the state is dismissed.** The reason for dismissing or closing the alert. * dismissedComment: The dismissal comment associated with the dismissal of the alert. + * createRequest: If `true`, attempt to create an alert dismissal request. */ public function __construct(public string $state, #[MapFrom('dismissed_reason')] public string|null $dismissedReason, #[MapFrom('dismissed_comment')] - public string|null $dismissedComment,) + public string|null $dismissedComment, #[MapFrom('create_request')] + public bool|null $createRequest,) { } } diff --git a/clients/GitHub/src/Schema/CodeScanningAlertCreateRequest.php b/clients/GitHub/src/Schema/CodeScanningAlertCreateRequest.php new file mode 100644 index 00000000000..9c385b184f5 --- /dev/null +++ b/clients/GitHub/src/Schema/CodeScanningAlertCreateRequest.php @@ -0,0 +1,20 @@ +operations()->codeScanning()->updateAlert('generated', 'generated', 12, json_decode(Schema\CodeScanning\UpdateAlert\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)); } + /** @test */ + public function call_httpCode_400_requestContentType_application_json_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\BasicError::class); + $response = new Response(400, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\BasicError::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('PATCH', '/repos/generated/generated/code-scanning/alerts/12', Argument::type('array'), json_encode(json_decode(Schema\CodeScanning\UpdateAlert\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)))->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->call(Internal\Operation\CodeScanning\UpdateAlert::OPERATION_MATCH, (static function (array $data): array { + $data['owner'] = 'generated'; + $data['repo'] = 'generated'; + $data['alert_number'] = 12; + + return $data; + })(json_decode(Schema\CodeScanning\UpdateAlert\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true))); + } + + /** @test */ + public function operations_httpCode_400_requestContentType_application_json_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\BasicError::class); + $response = new Response(400, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\BasicError::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('PATCH', '/repos/generated/generated/code-scanning/alerts/12', Argument::type('array'), json_encode(json_decode(Schema\CodeScanning\UpdateAlert\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)))->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->codeScanning()->updateAlert('generated', 'generated', 12, json_decode(Schema\CodeScanning\UpdateAlert\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)); + } + + /** @test */ + public function call_httpCode_400_requestContentType_application_json_responseContentType_application_scim_json_zero(): void + { + self::expectException(ErrorSchemas\ScimError::class); + $response = new Response(400, ['Content-Type' => 'application/scim+json'], json_encode(json_decode(Schema\ScimError::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('PATCH', '/repos/generated/generated/code-scanning/alerts/12', Argument::type('array'), json_encode(json_decode(Schema\CodeScanning\UpdateAlert\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)))->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->call(Internal\Operation\CodeScanning\UpdateAlert::OPERATION_MATCH, (static function (array $data): array { + $data['owner'] = 'generated'; + $data['repo'] = 'generated'; + $data['alert_number'] = 12; + + return $data; + })(json_decode(Schema\CodeScanning\UpdateAlert\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true))); + } + + /** @test */ + public function operations_httpCode_400_requestContentType_application_json_responseContentType_application_scim_json_zero(): void + { + self::expectException(ErrorSchemas\ScimError::class); + $response = new Response(400, ['Content-Type' => 'application/scim+json'], json_encode(json_decode(Schema\ScimError::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('PATCH', '/repos/generated/generated/code-scanning/alerts/12', Argument::type('array'), json_encode(json_decode(Schema\CodeScanning\UpdateAlert\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)))->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->codeScanning()->updateAlert('generated', 'generated', 12, json_decode(Schema\CodeScanning\UpdateAlert\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)); + } + /** @test */ public function call_httpCode_403_requestContentType_application_json_responseContentType_application_json_zero(): void { diff --git a/clients/GitHub/tests/Types/ClientCallReturnTypes.php b/clients/GitHub/tests/Types/ClientCallReturnTypes.php index eb38a4b0582..cb9d66ac57b 100644 --- a/clients/GitHub/tests/Types/ClientCallReturnTypes.php +++ b/clients/GitHub/tests/Types/ClientCallReturnTypes.php @@ -64,7 +64,7 @@ function authHeader(): string assertType('', $client->call('PUT /enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults')); assertType('Observable', $client->call('GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories')); assertType('Observable|WithoutBody', $client->call('GET /enterprises/{enterprise}/dependabot/alerts')); -assertType('Observable', $client->call('GET /enterprises/{enterprise}/secret-scanning/alerts')); +assertType('iterable', $client->call('GET /enterprises/{enterprise}/secret-scanning/alerts')); assertType('Observable|WithoutBody', $client->call('GET /events')); assertType('Observable|WithoutBody', $client->call('LIST /events')); assertType('', $client->call('GET /feeds')); @@ -389,8 +389,8 @@ function authHeader(): string assertType('Observable', $client->call('GET /orgs/{org}/rulesets/{ruleset_id}/history')); assertType('Observable', $client->call('LIST /orgs/{org}/rulesets/{ruleset_id}/history')); assertType('', $client->call('GET /orgs/{org}/rulesets/{ruleset_id}/history/{version_id}')); -assertType('Observable', $client->call('GET /orgs/{org}/secret-scanning/alerts')); -assertType('Observable', $client->call('LIST /orgs/{org}/secret-scanning/alerts')); +assertType('iterable', $client->call('GET /orgs/{org}/secret-scanning/alerts')); +assertType('iterable', $client->call('LIST /orgs/{org}/secret-scanning/alerts')); assertType('Observable', $client->call('GET /orgs/{org}/security-advisories')); assertType('Observable', $client->call('GET /orgs/{org}/security-managers')); assertType('', $client->call('PUT /orgs/{org}/security-managers/teams/{team_slug}')); @@ -620,7 +620,7 @@ function authHeader(): string assertType('Observable|WithoutBody', $client->call('GET /repos/{owner}/{repo}/code-scanning/alerts')); assertType('Observable|WithoutBody', $client->call('LIST /repos/{owner}/{repo}/code-scanning/alerts')); assertType('', $client->call('GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}')); -assertType('', $client->call('PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}')); +assertType('Schema\\CodeScanningAlert', $client->call('PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}')); assertType('', $client->call('GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix')); assertType('', $client->call('POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix')); assertType('', $client->call('POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/commits')); @@ -947,8 +947,8 @@ function authHeader(): string assertType('Observable', $client->call('GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history')); assertType('Observable', $client->call('LIST /repos/{owner}/{repo}/rulesets/{ruleset_id}/history')); assertType('', $client->call('GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history/{version_id}')); -assertType('Observable|WithoutBody', $client->call('GET /repos/{owner}/{repo}/secret-scanning/alerts')); -assertType('Observable|WithoutBody', $client->call('LIST /repos/{owner}/{repo}/secret-scanning/alerts')); +assertType('iterable|\\ApiClients\\Tools\\OpenApiClient\\Utils\\Response\\WithoutBody', $client->call('GET /repos/{owner}/{repo}/secret-scanning/alerts')); +assertType('iterable|\\ApiClients\\Tools\\OpenApiClient\\Utils\\Response\\WithoutBody', $client->call('LIST /repos/{owner}/{repo}/secret-scanning/alerts')); assertType('', $client->call('GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}')); assertType('', $client->call('PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}')); assertType('Observable|WithoutBody', $client->call('GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations')); diff --git a/etc/specs/GitHub/current.spec.yaml b/etc/specs/GitHub/current.spec.yaml index 360155e734c..67913984705 100644 --- a/etc/specs/GitHub/current.spec.yaml +++ b/etc/specs/GitHub/current.spec.yaml @@ -25947,6 +25947,8 @@ paths: "$ref": "#/components/schemas/code-scanning-alert-dismissed-reason" dismissed_comment: "$ref": "#/components/schemas/code-scanning-alert-dismissed-comment" + create_request: + "$ref": "#/components/schemas/code-scanning-alert-create-request" required: - state examples: @@ -25956,6 +25958,7 @@ paths: dismissed_reason: false positive dismissed_comment: This alert is not actually correct, because there's a sanitizer included in the library. + create_request: true responses: '200': description: Response @@ -25966,6 +25969,8 @@ paths: examples: default: "$ref": "#/components/examples/code-scanning-alert-dismissed" + '400': + "$ref": "#/components/responses/bad_request" '403': "$ref": "#/components/responses/code_scanning_forbidden_write" '404': @@ -84945,6 +84950,9 @@ components: enum: - open - dismissed + code-scanning-alert-create-request: + type: boolean + description: If `true`, attempt to create an alert dismissal request. code-scanning-autofix-status: type: string description: The status of an autofix. @@ -229926,7 +229934,7 @@ components: name: secret_type in: query description: A comma-separated list of secret types to return. All default secret - patterns are returned. To return experimental patterns, pass the token name(s) + patterns are returned. To return generic patterns, pass the token name(s) in the parameter. See "[Supported secret scanning patterns](https://docs.github.com/enterprise-cloud@latest/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)" for a complete list of secret types. required: false