From 38373cb3df3e4ff959a342f18ae2dafd46f9afff Mon Sep 17 00:00:00 2001 From: WyriHaximus <147145+WyriHaximus@users.noreply.github.com> Date: Fri, 7 Jun 2024 10:04:11 +0000 Subject: [PATCH] [GitHub] Update to 1.1.4-90291aa8f69083a3b160c871835515fc from 1.1.4-30445c941a97be3bcb4ba3b3bae9e8f3 Detected Schema changes: starting work. Building original model for commit 6af5d7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SPEC: extracted 2 commits from history ``` ├──[➕] webhooks (60530:5) ├─┬Paths │ ├─┬/applications/{client_id}/grant │ │ └─┬DELETE │ │ └──[🔀] description (840:20) │ ├─┬/applications/{client_id}/token │ │ ├─┬POST │ │ │ └──[🔀] description (881:20) │ │ ├─┬DELETE │ │ │ └──[🔀] description (981:20) │ │ └─┬PATCH │ │ └──[🔀] description (932:20) │ ├─┬/applications/{client_id}/token/scoped │ │ └─┬POST │ │ └──[🔀] description (1024:20) │ └─┬/user/installations/{installation_id}/repositories/{repository_id} │ ├─┬PUT │ │ └──[🔀] description (42559:20) │ └─┬DELETE │ └──[🔀] description (42586:20) └─┬Components └──[➕] schemas (186376:7) ``` | Document Element | Total Changes | Breaking Changes | |------------------|---------------|------------------| | paths | 7 | 0 | | components | 1 | 0 | Date: 06/07/24 | Commit: New: etc/specs/GitHub/previous.spec.yaml, Original: etc/specs/GitHub/current.spec.yaml - **Total Changes**: _8_ - **Modifications**: _7_ - **Additions**: _2_ DONE: completed --- .../GitHub/etc/openapi-client-generator.state | 16 +- .../Hydrator/WebHook/SecretScanningAlert.php | 208 -- clients/GitHub/src/Internal/Hydrators.php | 4 +- .../Internal/WebHook/SecretScanningAlert.php | 24 +- .../WebhookSecretScanningAlertRevoked.php | 2733 ----------------- clients/GitHub/src/WebHooks.php | 2 +- etc/specs/GitHub/current.spec.yaml | 117 +- 7 files changed, 21 insertions(+), 3083 deletions(-) delete mode 100644 clients/GitHub/src/Schema/WebhookSecretScanningAlertRevoked.php diff --git a/clients/GitHub/etc/openapi-client-generator.state b/clients/GitHub/etc/openapi-client-generator.state index 4c7e825d2c8..4a5b7254084 100644 --- a/clients/GitHub/etc/openapi-client-generator.state +++ b/clients/GitHub/etc/openapi-client-generator.state @@ -1,5 +1,5 @@ { - "specHash": "30445c941a97be3bcb4ba3b3bae9e8f3", + "specHash": "90291aa8f69083a3b160c871835515fc", "generatedFiles": { "files": [ { @@ -2398,10 +2398,6 @@ "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/WebhookSecretScanningAlertResolved.php", "hash": "a7318c11f4f8eebbf3da10aba0624516" }, - { - "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/WebhookSecretScanningAlertRevoked.php", - "hash": "c45f03d885ee4705b069d3fe165f2be7" - }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/WebhookSecurityAdvisoryPublished.php", "hash": "7dbd7cc12b666acd3b9332048c807de6" @@ -5668,7 +5664,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/WebHooks.php", - "hash": "3b8513aeb1b3d6895427fe3e03325435" + "hash": "f7c6ac32c80159d1420bf43843340bad" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/AliasAbstract\/TietEB301A03\/Tiet504AADCF\/Tiet2FEB0C19\/TietF58BE94A.php", @@ -27236,7 +27232,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Hydrators.php", - "hash": "f8a62fdffbd42820e452155cf51ca62f" + "hash": "a56ba7b9df5fbe1b7453f77e6ba6fd2c" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/OrganizationSimpleWebhooks.php", @@ -28108,7 +28104,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/WebHook\/SecretScanningAlert.php", - "hash": "f5b4a68d18fa73bd6db6c300bc6d2119" + "hash": "8594714076741ae50b0b792ff068abf5" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/WebHook\/SecretScanningAlertLocation.php", @@ -28392,7 +28388,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Hydrator\/WebHook\/SecretScanningAlert.php", - "hash": "a4eb94e252a7fc2a08d9a635a134cc68" + "hash": "1621b9c57c53b43ddaebc74fc442ae0b" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Hydrator\/WebHook\/SecretScanningAlertLocation.php", @@ -29768,7 +29764,7 @@ }, { "name": "..\/..\/composer.lock", - "hash": "896c1363277f60ac64a6288682a2713a" + "hash": "87ff545c771fcddd769df42fa210ed40" } ] } diff --git a/clients/GitHub/src/Internal/Hydrator/WebHook/SecretScanningAlert.php b/clients/GitHub/src/Internal/Hydrator/WebHook/SecretScanningAlert.php index 53f6cbdee94..8652914ce0c 100644 --- a/clients/GitHub/src/Internal/Hydrator/WebHook/SecretScanningAlert.php +++ b/clients/GitHub/src/Internal/Hydrator/WebHook/SecretScanningAlert.php @@ -19,7 +19,6 @@ use ApiClients\Client\GitHub\Schema\WebhookSecretScanningAlertCreated; use ApiClients\Client\GitHub\Schema\WebhookSecretScanningAlertReopened; use ApiClients\Client\GitHub\Schema\WebhookSecretScanningAlertResolved; -use ApiClients\Client\GitHub\Schema\WebhookSecretScanningAlertRevoked; use ApiClients\Client\GitHub\Schema\WebhookSecretScanningAlertValidated; use EventSauce\ObjectHydrator\IterableList; use EventSauce\ObjectHydrator\ObjectMapper; @@ -71,7 +70,6 @@ public function hydrateObject(string $className, array $payload): object 'ApiClients\Client\GitHub\Schema\SimpleUserWebhooks' => $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️SimpleUserWebhooks($payload), 'ApiClients\Client\GitHub\Schema\WebhookSecretScanningAlertReopened' => $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️WebhookSecretScanningAlertReopened($payload), 'ApiClients\Client\GitHub\Schema\WebhookSecretScanningAlertResolved' => $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️WebhookSecretScanningAlertResolved($payload), - 'ApiClients\Client\GitHub\Schema\WebhookSecretScanningAlertRevoked' => $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️WebhookSecretScanningAlertRevoked($payload), 'ApiClients\Client\GitHub\Schema\WebhookSecretScanningAlertValidated' => $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️WebhookSecretScanningAlertValidated($payload), 'ApiClients\Client\GitHub\Schema\RepositoryWebhooks\CustomProperties' => $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️RepositoryWebhooks⚡️CustomProperties($payload), default => throw UnableToHydrateObject::noHydrationDefined($className, $this->hydrationStack), @@ -4168,156 +4166,6 @@ private function hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️Webh } } - private function hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️WebhookSecretScanningAlertRevoked(array $payload): WebhookSecretScanningAlertRevoked - { - $properties = []; - $missingFields = []; - try { - $value = $payload['action'] ?? null; - - if ($value === null) { - $missingFields[] = 'action'; - goto after_action; - } - - $properties['action'] = $value; - - after_action: - - $value = $payload['alert'] ?? null; - - if ($value === null) { - $missingFields[] = 'alert'; - goto after_alert; - } - - if (is_array($value)) { - try { - $this->hydrationStack[] = 'alert'; - $value = $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️SecretScanningAlertWebhook($value); - } finally { - array_pop($this->hydrationStack); - } - } - - $properties['alert'] = $value; - - after_alert: - - $value = $payload['enterprise'] ?? null; - - if ($value === null) { - $properties['enterprise'] = null; - goto after_enterprise; - } - - if (is_array($value)) { - try { - $this->hydrationStack[] = 'enterprise'; - $value = $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️EnterpriseWebhooks($value); - } finally { - array_pop($this->hydrationStack); - } - } - - $properties['enterprise'] = $value; - - after_enterprise: - - $value = $payload['installation'] ?? null; - - if ($value === null) { - $properties['installation'] = null; - goto after_installation; - } - - if (is_array($value)) { - try { - $this->hydrationStack[] = 'installation'; - $value = $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️SimpleInstallation($value); - } finally { - array_pop($this->hydrationStack); - } - } - - $properties['installation'] = $value; - - after_installation: - - $value = $payload['organization'] ?? null; - - if ($value === null) { - $properties['organization'] = null; - goto after_organization; - } - - if (is_array($value)) { - try { - $this->hydrationStack[] = 'organization'; - $value = $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️OrganizationSimpleWebhooks($value); - } finally { - array_pop($this->hydrationStack); - } - } - - $properties['organization'] = $value; - - after_organization: - - $value = $payload['repository'] ?? null; - - if ($value === null) { - $missingFields[] = 'repository'; - goto after_repository; - } - - if (is_array($value)) { - try { - $this->hydrationStack[] = 'repository'; - $value = $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️RepositoryWebhooks($value); - } finally { - array_pop($this->hydrationStack); - } - } - - $properties['repository'] = $value; - - after_repository: - - $value = $payload['sender'] ?? null; - - if ($value === null) { - $properties['sender'] = null; - goto after_sender; - } - - if (is_array($value)) { - try { - $this->hydrationStack[] = 'sender'; - $value = $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️SimpleUserWebhooks($value); - } finally { - array_pop($this->hydrationStack); - } - } - - $properties['sender'] = $value; - - after_sender: - } catch (Throwable $exception) { - throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\WebhookSecretScanningAlertRevoked', $exception, stack: $this->hydrationStack); - } - - if (count($missingFields) > 0) { - throw UnableToHydrateObject::dueToMissingFields(WebhookSecretScanningAlertRevoked::class, $missingFields, stack: $this->hydrationStack); - } - - try { - return new WebhookSecretScanningAlertRevoked(...$properties); - } catch (Throwable $exception) { - throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\WebhookSecretScanningAlertRevoked', $exception, stack: $this->hydrationStack); - } - } - private function hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️WebhookSecretScanningAlertValidated(array $payload): WebhookSecretScanningAlertValidated { $properties = []; @@ -4534,7 +4382,6 @@ public function serializeObjectOfType(object $object, string $className): mixed 'ApiClients\Client\GitHub\Schema\SimpleUserWebhooks' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️SimpleUserWebhooks($object), 'ApiClients\Client\GitHub\Schema\WebhookSecretScanningAlertReopened' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️WebhookSecretScanningAlertReopened($object), 'ApiClients\Client\GitHub\Schema\WebhookSecretScanningAlertResolved' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️WebhookSecretScanningAlertResolved($object), - 'ApiClients\Client\GitHub\Schema\WebhookSecretScanningAlertRevoked' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️WebhookSecretScanningAlertRevoked($object), 'ApiClients\Client\GitHub\Schema\WebhookSecretScanningAlertValidated' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️WebhookSecretScanningAlertValidated($object), default => throw new LogicException('No serialization defined for $className'), }; @@ -6679,61 +6526,6 @@ private function serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema return $result; } - private function serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️WebhookSecretScanningAlertRevoked(mixed $object): mixed - { - assert($object instanceof WebhookSecretScanningAlertRevoked); - $result = []; - - $action = $object->action; - after_action: $result['action'] = $action; - - $alert = $object->alert; - $alert = $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️SecretScanningAlertWebhook($alert); - after_alert: $result['alert'] = $alert; - - $enterprise = $object->enterprise; - - if ($enterprise === null) { - goto after_enterprise; - } - - $enterprise = $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️EnterpriseWebhooks($enterprise); - after_enterprise: $result['enterprise'] = $enterprise; - - $installation = $object->installation; - - if ($installation === null) { - goto after_installation; - } - - $installation = $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️SimpleInstallation($installation); - after_installation: $result['installation'] = $installation; - - $organization = $object->organization; - - if ($organization === null) { - goto after_organization; - } - - $organization = $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️OrganizationSimpleWebhooks($organization); - after_organization: $result['organization'] = $organization; - - $repository = $object->repository; - $repository = $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️RepositoryWebhooks($repository); - after_repository: $result['repository'] = $repository; - - $sender = $object->sender; - - if ($sender === null) { - goto after_sender; - } - - $sender = $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️SimpleUserWebhooks($sender); - after_sender: $result['sender'] = $sender; - - return $result; - } - private function serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️WebhookSecretScanningAlertValidated(mixed $object): mixed { assert($object instanceof WebhookSecretScanningAlertValidated); diff --git a/clients/GitHub/src/Internal/Hydrators.php b/clients/GitHub/src/Internal/Hydrators.php index e3a359f3386..71aefa35eec 100644 --- a/clients/GitHub/src/Internal/Hydrators.php +++ b/clients/GitHub/src/Internal/Hydrators.php @@ -1008,7 +1008,7 @@ public function hydrateObject(string $className, array $payload): object '\\ApiClients\\Client\\GitHub\\Schema\\WebhookRepositoryImport' => $this->getObjectMapperWebHook🪝RepositoryImport()->hydrateObject($className, $payload), '\\ApiClients\\Client\\GitHub\\Schema\\WebhookRepositoryRulesetCreated', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookRepositoryRulesetDeleted', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookRepositoryRulesetEdited', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookRepositoryRulesetEdited\\Changes', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookRepositoryRulesetEdited\\Changes\\Name', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookRepositoryRulesetEdited\\Changes\\Enforcement', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookRepositoryRulesetEdited\\Changes\\Conditions', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookRepositoryRulesetEdited\\Changes\\Rules' => $this->getObjectMapperWebHook🪝RepositoryRuleset()->hydrateObject($className, $payload), '\\ApiClients\\Client\\GitHub\\Schema\\WebhookRepositoryVulnerabilityAlertCreate', '\\ApiClients\\Client\\GitHub\\Schema\\WebhooksAlert', '\\ApiClients\\Client\\GitHub\\Schema\\WebhooksAlert\\Dismisser', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookRepositoryVulnerabilityAlertDismiss', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookRepositoryVulnerabilityAlertDismiss\\Alert', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookRepositoryVulnerabilityAlertDismiss\\Alert\\Dismisser', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookRepositoryVulnerabilityAlertReopen', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookRepositoryVulnerabilityAlertResolve', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookRepositoryVulnerabilityAlertResolve\\Alert', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookRepositoryVulnerabilityAlertResolve\\Alert\\Dismisser' => $this->getObjectMapperWebHook🪝RepositoryVulnerabilityAlert()->hydrateObject($className, $payload), - '\\ApiClients\\Client\\GitHub\\Schema\\WebhookSecretScanningAlertCreated', '\\ApiClients\\Client\\GitHub\\Schema\\SecretScanningAlertWebhook', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookSecretScanningAlertReopened', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookSecretScanningAlertResolved', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookSecretScanningAlertRevoked', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookSecretScanningAlertValidated' => $this->getObjectMapperWebHook🪝SecretScanningAlert()->hydrateObject($className, $payload), + '\\ApiClients\\Client\\GitHub\\Schema\\WebhookSecretScanningAlertCreated', '\\ApiClients\\Client\\GitHub\\Schema\\SecretScanningAlertWebhook', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookSecretScanningAlertReopened', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookSecretScanningAlertResolved', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookSecretScanningAlertValidated' => $this->getObjectMapperWebHook🪝SecretScanningAlert()->hydrateObject($className, $payload), '\\ApiClients\\Client\\GitHub\\Schema\\WebhookSecretScanningAlertLocationCreated', '\\ApiClients\\Client\\GitHub\\Schema\\SecretScanningLocation', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookSecretScanningAlertLocationCreatedFormEncoded' => $this->getObjectMapperWebHook🪝SecretScanningAlertLocation()->hydrateObject($className, $payload), '\\ApiClients\\Client\\GitHub\\Schema\\WebhookSecurityAdvisoryPublished', '\\ApiClients\\Client\\GitHub\\Schema\\WebhooksSecurityAdvisory', '\\ApiClients\\Client\\GitHub\\Schema\\WebhooksSecurityAdvisory\\Cvss', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookSecurityAdvisoryUpdated', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookSecurityAdvisoryWithdrawn', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookSecurityAdvisoryWithdrawn\\SecurityAdvisory', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookSecurityAdvisoryWithdrawn\\SecurityAdvisory\\Cvss' => $this->getObjectMapperWebHook🪝SecurityAdvisory()->hydrateObject($className, $payload), '\\ApiClients\\Client\\GitHub\\Schema\\WebhookSecurityAndAnalysis', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookSecurityAndAnalysis\\Changes', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookSecurityAndAnalysis\\Changes\\From' => $this->getObjectMapperWebHook🪝SecurityAndAnalysis()->hydrateObject($className, $payload), @@ -1350,7 +1350,7 @@ public function serializeObjectOfType(object $object, string $className): mixed '\\ApiClients\\Client\\GitHub\\Schema\\WebhookRepositoryImport' => $this->getObjectMapperWebHook🪝RepositoryImport()->serializeObject($object), '\\ApiClients\\Client\\GitHub\\Schema\\WebhookRepositoryRulesetCreated', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookRepositoryRulesetDeleted', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookRepositoryRulesetEdited', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookRepositoryRulesetEdited\\Changes', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookRepositoryRulesetEdited\\Changes\\Name', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookRepositoryRulesetEdited\\Changes\\Enforcement', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookRepositoryRulesetEdited\\Changes\\Conditions', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookRepositoryRulesetEdited\\Changes\\Rules' => $this->getObjectMapperWebHook🪝RepositoryRuleset()->serializeObject($object), '\\ApiClients\\Client\\GitHub\\Schema\\WebhookRepositoryVulnerabilityAlertCreate', '\\ApiClients\\Client\\GitHub\\Schema\\WebhooksAlert', '\\ApiClients\\Client\\GitHub\\Schema\\WebhooksAlert\\Dismisser', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookRepositoryVulnerabilityAlertDismiss', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookRepositoryVulnerabilityAlertDismiss\\Alert', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookRepositoryVulnerabilityAlertDismiss\\Alert\\Dismisser', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookRepositoryVulnerabilityAlertReopen', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookRepositoryVulnerabilityAlertResolve', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookRepositoryVulnerabilityAlertResolve\\Alert', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookRepositoryVulnerabilityAlertResolve\\Alert\\Dismisser' => $this->getObjectMapperWebHook🪝RepositoryVulnerabilityAlert()->serializeObject($object), - '\\ApiClients\\Client\\GitHub\\Schema\\WebhookSecretScanningAlertCreated', '\\ApiClients\\Client\\GitHub\\Schema\\SecretScanningAlertWebhook', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookSecretScanningAlertReopened', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookSecretScanningAlertResolved', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookSecretScanningAlertRevoked', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookSecretScanningAlertValidated' => $this->getObjectMapperWebHook🪝SecretScanningAlert()->serializeObject($object), + '\\ApiClients\\Client\\GitHub\\Schema\\WebhookSecretScanningAlertCreated', '\\ApiClients\\Client\\GitHub\\Schema\\SecretScanningAlertWebhook', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookSecretScanningAlertReopened', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookSecretScanningAlertResolved', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookSecretScanningAlertValidated' => $this->getObjectMapperWebHook🪝SecretScanningAlert()->serializeObject($object), '\\ApiClients\\Client\\GitHub\\Schema\\WebhookSecretScanningAlertLocationCreated', '\\ApiClients\\Client\\GitHub\\Schema\\SecretScanningLocation', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookSecretScanningAlertLocationCreatedFormEncoded' => $this->getObjectMapperWebHook🪝SecretScanningAlertLocation()->serializeObject($object), '\\ApiClients\\Client\\GitHub\\Schema\\WebhookSecurityAdvisoryPublished', '\\ApiClients\\Client\\GitHub\\Schema\\WebhooksSecurityAdvisory', '\\ApiClients\\Client\\GitHub\\Schema\\WebhooksSecurityAdvisory\\Cvss', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookSecurityAdvisoryUpdated', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookSecurityAdvisoryWithdrawn', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookSecurityAdvisoryWithdrawn\\SecurityAdvisory', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookSecurityAdvisoryWithdrawn\\SecurityAdvisory\\Cvss' => $this->getObjectMapperWebHook🪝SecurityAdvisory()->serializeObject($object), '\\ApiClients\\Client\\GitHub\\Schema\\WebhookSecurityAndAnalysis', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookSecurityAndAnalysis\\Changes', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookSecurityAndAnalysis\\Changes\\From' => $this->getObjectMapperWebHook🪝SecurityAndAnalysis()->serializeObject($object), diff --git a/clients/GitHub/src/Internal/WebHook/SecretScanningAlert.php b/clients/GitHub/src/Internal/WebHook/SecretScanningAlert.php index 0f7056e7031..7e4611188d6 100644 --- a/clients/GitHub/src/Internal/WebHook/SecretScanningAlert.php +++ b/clients/GitHub/src/Internal/WebHook/SecretScanningAlert.php @@ -19,7 +19,7 @@ public function __construct(private readonly SchemaValidator $requestSchemaValid { } - public function resolve(array $headers, array $data): Schema\WebhookSecretScanningAlertCreated|Schema\WebhookSecretScanningAlertReopened|Schema\WebhookSecretScanningAlertResolved|Schema\WebhookSecretScanningAlertRevoked|Schema\WebhookSecretScanningAlertValidated + public function resolve(array $headers, array $data): Schema\WebhookSecretScanningAlertCreated|Schema\WebhookSecretScanningAlertReopened|Schema\WebhookSecretScanningAlertResolved|Schema\WebhookSecretScanningAlertValidated { $error = new RuntimeException('No action matching given headers and data'); if ($headers['content-type'] === 'application/json') { @@ -76,24 +76,6 @@ public function resolve(array $headers, array $data): Schema\WebhookSecretScanni } actions_aaaac: - if ($headers['content-type'] === 'application/json') { - try { - $this->requestSchemaValidator->validate($headers['user-agent'], Reader::readFromJson(Schema\WebHookHeader\UserAgent::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema')); - $this->requestSchemaValidator->validate($headers['x-github-hook-id'], Reader::readFromJson(Schema\WebHookHeader\XGithubHookId::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema')); - $this->requestSchemaValidator->validate($headers['x-github-event'], Reader::readFromJson(Schema\WebHookHeader\XGithubEvent::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema')); - $this->requestSchemaValidator->validate($headers['x-github-hook-installation-target-id'], Reader::readFromJson(Schema\WebHookHeader\XGithubHookInstallationTargetId::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema')); - $this->requestSchemaValidator->validate($headers['x-github-hook-installation-target-type'], Reader::readFromJson(Schema\WebHookHeader\XGithubHookInstallationTargetType::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema')); - $this->requestSchemaValidator->validate($headers['x-github-delivery'], Reader::readFromJson(Schema\WebHookHeader\XGitHubDelivery::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema')); - $this->requestSchemaValidator->validate($headers['x-hub-signature-256'], Reader::readFromJson(Schema\WebHookHeader\XHubSignature::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema')); - $this->requestSchemaValidator->validate($data, Reader::readFromJson(Schema\WebhookSecretScanningAlertRevoked::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema')); - - return $this->hydrator->hydrateObject(Schema\WebhookSecretScanningAlertRevoked::class, $data); - } catch (Throwable) { - goto actions_aaaad; - } - } - - actions_aaaad: if ($headers['content-type'] === 'application/json') { try { $this->requestSchemaValidator->validate($headers['user-agent'], Reader::readFromJson(Schema\WebHookHeader\UserAgent::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema')); @@ -107,11 +89,11 @@ public function resolve(array $headers, array $data): Schema\WebhookSecretScanni return $this->hydrator->hydrateObject(Schema\WebhookSecretScanningAlertValidated::class, $data); } catch (Throwable) { - goto actions_aaaae; + goto actions_aaaad; } } - actions_aaaae: + actions_aaaad: throw $error; } } diff --git a/clients/GitHub/src/Schema/WebhookSecretScanningAlertRevoked.php b/clients/GitHub/src/Schema/WebhookSecretScanningAlertRevoked.php deleted file mode 100644 index 7bc8f79d877..00000000000 --- a/clients/GitHub/src/Schema/WebhookSecretScanningAlertRevoked.php +++ /dev/null @@ -1,2733 +0,0 @@ - $object::class, 'data' => $this->hydrator->serializeObject($object)]; } - /** @return Schema\WebhookBranchProtectionConfigurationDisabled|Schema\WebhookBranchProtectionConfigurationEnabled|Schema\WebhookBranchProtectionRuleCreated|Schema\WebhookBranchProtectionRuleDeleted|Schema\WebhookBranchProtectionRuleEdited|Schema\WebhookCheckRunCompleted|Schema\WebhookCheckRunCompletedFormEncoded|Schema\WebhookCheckRunCreated|Schema\WebhookCheckRunCreatedFormEncoded|Schema\WebhookCheckRunRequestedAction|Schema\WebhookCheckRunRequestedActionFormEncoded|Schema\WebhookCheckRunRerequested|Schema\WebhookCheckRunRerequestedFormEncoded|Schema\WebhookCheckSuiteCompleted|Schema\WebhookCheckSuiteRequested|Schema\WebhookCheckSuiteRerequested|Schema\WebhookCodeScanningAlertAppearedInBranch|Schema\WebhookCodeScanningAlertClosedByUser|Schema\WebhookCodeScanningAlertCreated|Schema\WebhookCodeScanningAlertFixed|Schema\WebhookCodeScanningAlertReopened|Schema\WebhookCodeScanningAlertReopenedByUser|Schema\WebhookCommitCommentCreated|Schema\WebhookCreate|Schema\WebhookCustomPropertyCreated|Schema\WebhookCustomPropertyDeleted|Schema\WebhookCustomPropertyUpdated|Schema\WebhookCustomPropertyValuesUpdated|Schema\WebhookDelete|Schema\WebhookDependabotAlertAutoDismissed|Schema\WebhookDependabotAlertAutoReopened|Schema\WebhookDependabotAlertCreated|Schema\WebhookDependabotAlertDismissed|Schema\WebhookDependabotAlertFixed|Schema\WebhookDependabotAlertReintroduced|Schema\WebhookDependabotAlertReopened|Schema\WebhookDeployKeyCreated|Schema\WebhookDeployKeyDeleted|Schema\WebhookDeploymentCreated|Schema\WebhookDeploymentProtectionRuleRequested|Schema\WebhookDeploymentReviewApproved|Schema\WebhookDeploymentReviewRejected|Schema\WebhookDeploymentReviewRequested|Schema\WebhookDeploymentStatusCreated|Schema\WebhookDiscussionAnswered|Schema\WebhookDiscussionCategoryChanged|Schema\WebhookDiscussionClosed|Schema\WebhookDiscussionCreated|Schema\WebhookDiscussionDeleted|Schema\WebhookDiscussionEdited|Schema\WebhookDiscussionLabeled|Schema\WebhookDiscussionLocked|Schema\WebhookDiscussionPinned|Schema\WebhookDiscussionReopened|Schema\WebhookDiscussionTransferred|Schema\WebhookDiscussionUnanswered|Schema\WebhookDiscussionUnlabeled|Schema\WebhookDiscussionUnlocked|Schema\WebhookDiscussionUnpinned|Schema\WebhookDiscussionCommentCreated|Schema\WebhookDiscussionCommentDeleted|Schema\WebhookDiscussionCommentEdited|Schema\WebhookFork|Schema\WebhookGithubAppAuthorizationRevoked|Schema\WebhookGollum|Schema\WebhookInstallationCreated|Schema\WebhookInstallationDeleted|Schema\WebhookInstallationNewPermissionsAccepted|Schema\WebhookInstallationSuspend|Schema\WebhookInstallationUnsuspend|Schema\WebhookInstallationRepositoriesAdded|Schema\WebhookInstallationRepositoriesRemoved|Schema\WebhookInstallationTargetRenamed|Schema\WebhookIssueCommentCreated|Schema\WebhookIssueCommentDeleted|Schema\WebhookIssueCommentEdited|Schema\WebhookIssuesAssigned|Schema\WebhookIssuesClosed|Schema\WebhookIssuesDeleted|Schema\WebhookIssuesDemilestoned|Schema\WebhookIssuesEdited|Schema\WebhookIssuesLabeled|Schema\WebhookIssuesLocked|Schema\WebhookIssuesMilestoned|Schema\WebhookIssuesOpened|Schema\WebhookIssuesPinned|Schema\WebhookIssuesReopened|Schema\WebhookIssuesTransferred|Schema\WebhookIssuesUnassigned|Schema\WebhookIssuesUnlabeled|Schema\WebhookIssuesUnlocked|Schema\WebhookIssuesUnpinned|Schema\WebhookLabelCreated|Schema\WebhookLabelDeleted|Schema\WebhookLabelEdited|Schema\WebhookMarketplacePurchaseCancelled|Schema\WebhookMarketplacePurchaseChanged|Schema\WebhookMarketplacePurchasePendingChange|Schema\WebhookMarketplacePurchasePendingChangeCancelled|Schema\WebhookMarketplacePurchasePurchased|Schema\WebhookMemberAdded|Schema\WebhookMemberEdited|Schema\WebhookMemberRemoved|Schema\WebhookMembershipAdded|Schema\WebhookMembershipRemoved|Schema\WebhookMergeGroupChecksRequested|Schema\WebhookMergeGroupDestroyed|Schema\WebhookMetaDeleted|Schema\WebhookMilestoneClosed|Schema\WebhookMilestoneCreated|Schema\WebhookMilestoneDeleted|Schema\WebhookMilestoneEdited|Schema\WebhookMilestoneOpened|Schema\WebhookOrgBlockBlocked|Schema\WebhookOrgBlockUnblocked|Schema\WebhookOrganizationDeleted|Schema\WebhookOrganizationMemberAdded|Schema\WebhookOrganizationMemberInvited|Schema\WebhookOrganizationMemberRemoved|Schema\WebhookOrganizationRenamed|Schema\WebhookPackagePublished|Schema\WebhookPackageUpdated|Schema\WebhookPageBuild|Schema\WebhookPersonalAccessTokenRequestApproved|Schema\WebhookPersonalAccessTokenRequestCancelled|Schema\WebhookPersonalAccessTokenRequestCreated|Schema\WebhookPersonalAccessTokenRequestDenied|Schema\WebhookPing|Schema\WebhookPingFormEncoded|Schema\WebhookProjectCardConverted|Schema\WebhookProjectCardCreated|Schema\WebhookProjectCardDeleted|Schema\WebhookProjectCardEdited|Schema\WebhookProjectCardMoved|Schema\WebhookProjectClosed|Schema\WebhookProjectCreated|Schema\WebhookProjectDeleted|Schema\WebhookProjectEdited|Schema\WebhookProjectReopened|Schema\WebhookProjectColumnCreated|Schema\WebhookProjectColumnDeleted|Schema\WebhookProjectColumnEdited|Schema\WebhookProjectColumnMoved|Schema\WebhookProjectsV2ProjectClosed|Schema\WebhookProjectsV2ProjectCreated|Schema\WebhookProjectsV2ProjectDeleted|Schema\WebhookProjectsV2ProjectEdited|Schema\WebhookProjectsV2ProjectReopened|Schema\WebhookProjectsV2ItemArchived|Schema\WebhookProjectsV2ItemConverted|Schema\WebhookProjectsV2ItemCreated|Schema\WebhookProjectsV2ItemDeleted|Schema\WebhookProjectsV2ItemEdited|Schema\WebhookProjectsV2ItemReordered|Schema\WebhookProjectsV2ItemRestored|Schema\WebhookPublic|Schema\WebhookPullRequestAssigned|Schema\WebhookPullRequestAutoMergeDisabled|Schema\WebhookPullRequestAutoMergeEnabled|Schema\WebhookPullRequestClosed|Schema\WebhookPullRequestConvertedToDraft|Schema\WebhookPullRequestDemilestoned|Schema\WebhookPullRequestDequeued|Schema\WebhookPullRequestEdited|Schema\WebhookPullRequestEnqueued|Schema\WebhookPullRequestLabeled|Schema\WebhookPullRequestLocked|Schema\WebhookPullRequestMilestoned|Schema\WebhookPullRequestOpened|Schema\WebhookPullRequestReadyForReview|Schema\WebhookPullRequestReopened|Schema\WebhookPullRequestReviewRequestRemoved|Schema\WebhookPullRequestReviewRequested|Schema\WebhookPullRequestSynchronize|Schema\WebhookPullRequestUnassigned|Schema\WebhookPullRequestUnlabeled|Schema\WebhookPullRequestUnlocked|Schema\WebhookPullRequestReviewCommentCreated|Schema\WebhookPullRequestReviewCommentDeleted|Schema\WebhookPullRequestReviewCommentEdited|Schema\WebhookPullRequestReviewDismissed|Schema\WebhookPullRequestReviewEdited|Schema\WebhookPullRequestReviewSubmitted|Schema\WebhookPullRequestReviewThreadResolved|Schema\WebhookPullRequestReviewThreadUnresolved|Schema\WebhookPush|Schema\WebhookRegistryPackagePublished|Schema\WebhookRegistryPackageUpdated|Schema\WebhookReleaseCreated|Schema\WebhookReleaseDeleted|Schema\WebhookReleaseEdited|Schema\WebhookReleasePrereleased|Schema\WebhookReleasePublished|Schema\WebhookReleaseReleased|Schema\WebhookReleaseUnpublished|Schema\WebhookRepositoryAdvisoryPublished|Schema\WebhookRepositoryAdvisoryReported|Schema\WebhookRepositoryArchived|Schema\WebhookRepositoryCreated|Schema\WebhookRepositoryDeleted|Schema\WebhookRepositoryEdited|Schema\WebhookRepositoryPrivatized|Schema\WebhookRepositoryPublicized|Schema\WebhookRepositoryRenamed|Schema\WebhookRepositoryTransferred|Schema\WebhookRepositoryUnarchived|Schema\WebhookRepositoryDispatchSample|Schema\WebhookRepositoryImport|Schema\WebhookRepositoryRulesetCreated|Schema\WebhookRepositoryRulesetDeleted|Schema\WebhookRepositoryRulesetEdited|Schema\WebhookRepositoryVulnerabilityAlertCreate|Schema\WebhookRepositoryVulnerabilityAlertDismiss|Schema\WebhookRepositoryVulnerabilityAlertReopen|Schema\WebhookRepositoryVulnerabilityAlertResolve|Schema\WebhookSecretScanningAlertCreated|Schema\WebhookSecretScanningAlertReopened|Schema\WebhookSecretScanningAlertResolved|Schema\WebhookSecretScanningAlertRevoked|Schema\WebhookSecretScanningAlertValidated|Schema\WebhookSecretScanningAlertLocationCreated|Schema\WebhookSecretScanningAlertLocationCreatedFormEncoded|Schema\WebhookSecurityAdvisoryPublished|Schema\WebhookSecurityAdvisoryUpdated|Schema\WebhookSecurityAdvisoryWithdrawn|Schema\WebhookSecurityAndAnalysis|Schema\WebhookSponsorshipCancelled|Schema\WebhookSponsorshipCreated|Schema\WebhookSponsorshipEdited|Schema\WebhookSponsorshipPendingCancellation|Schema\WebhookSponsorshipPendingTierChange|Schema\WebhookSponsorshipTierChanged|Schema\WebhookStarCreated|Schema\WebhookStarDeleted|Schema\WebhookStatus|Schema\WebhookTeamAdd|Schema\WebhookTeamAddedToRepository|Schema\WebhookTeamCreated|Schema\WebhookTeamDeleted|Schema\WebhookTeamEdited|Schema\WebhookTeamRemovedFromRepository|Schema\WebhookWatchStarted|Schema\WebhookWorkflowDispatch|Schema\WebhookWorkflowJobCompleted|Schema\WebhookWorkflowJobInProgress|Schema\WebhookWorkflowJobQueued|Schema\WebhookWorkflowJobWaiting|Schema\WebhookWorkflowRunCompleted|Schema\WebhookWorkflowRunInProgress|Schema\WebhookWorkflowRunRequested */ + /** @return Schema\WebhookBranchProtectionConfigurationDisabled|Schema\WebhookBranchProtectionConfigurationEnabled|Schema\WebhookBranchProtectionRuleCreated|Schema\WebhookBranchProtectionRuleDeleted|Schema\WebhookBranchProtectionRuleEdited|Schema\WebhookCheckRunCompleted|Schema\WebhookCheckRunCompletedFormEncoded|Schema\WebhookCheckRunCreated|Schema\WebhookCheckRunCreatedFormEncoded|Schema\WebhookCheckRunRequestedAction|Schema\WebhookCheckRunRequestedActionFormEncoded|Schema\WebhookCheckRunRerequested|Schema\WebhookCheckRunRerequestedFormEncoded|Schema\WebhookCheckSuiteCompleted|Schema\WebhookCheckSuiteRequested|Schema\WebhookCheckSuiteRerequested|Schema\WebhookCodeScanningAlertAppearedInBranch|Schema\WebhookCodeScanningAlertClosedByUser|Schema\WebhookCodeScanningAlertCreated|Schema\WebhookCodeScanningAlertFixed|Schema\WebhookCodeScanningAlertReopened|Schema\WebhookCodeScanningAlertReopenedByUser|Schema\WebhookCommitCommentCreated|Schema\WebhookCreate|Schema\WebhookCustomPropertyCreated|Schema\WebhookCustomPropertyDeleted|Schema\WebhookCustomPropertyUpdated|Schema\WebhookCustomPropertyValuesUpdated|Schema\WebhookDelete|Schema\WebhookDependabotAlertAutoDismissed|Schema\WebhookDependabotAlertAutoReopened|Schema\WebhookDependabotAlertCreated|Schema\WebhookDependabotAlertDismissed|Schema\WebhookDependabotAlertFixed|Schema\WebhookDependabotAlertReintroduced|Schema\WebhookDependabotAlertReopened|Schema\WebhookDeployKeyCreated|Schema\WebhookDeployKeyDeleted|Schema\WebhookDeploymentCreated|Schema\WebhookDeploymentProtectionRuleRequested|Schema\WebhookDeploymentReviewApproved|Schema\WebhookDeploymentReviewRejected|Schema\WebhookDeploymentReviewRequested|Schema\WebhookDeploymentStatusCreated|Schema\WebhookDiscussionAnswered|Schema\WebhookDiscussionCategoryChanged|Schema\WebhookDiscussionClosed|Schema\WebhookDiscussionCreated|Schema\WebhookDiscussionDeleted|Schema\WebhookDiscussionEdited|Schema\WebhookDiscussionLabeled|Schema\WebhookDiscussionLocked|Schema\WebhookDiscussionPinned|Schema\WebhookDiscussionReopened|Schema\WebhookDiscussionTransferred|Schema\WebhookDiscussionUnanswered|Schema\WebhookDiscussionUnlabeled|Schema\WebhookDiscussionUnlocked|Schema\WebhookDiscussionUnpinned|Schema\WebhookDiscussionCommentCreated|Schema\WebhookDiscussionCommentDeleted|Schema\WebhookDiscussionCommentEdited|Schema\WebhookFork|Schema\WebhookGithubAppAuthorizationRevoked|Schema\WebhookGollum|Schema\WebhookInstallationCreated|Schema\WebhookInstallationDeleted|Schema\WebhookInstallationNewPermissionsAccepted|Schema\WebhookInstallationSuspend|Schema\WebhookInstallationUnsuspend|Schema\WebhookInstallationRepositoriesAdded|Schema\WebhookInstallationRepositoriesRemoved|Schema\WebhookInstallationTargetRenamed|Schema\WebhookIssueCommentCreated|Schema\WebhookIssueCommentDeleted|Schema\WebhookIssueCommentEdited|Schema\WebhookIssuesAssigned|Schema\WebhookIssuesClosed|Schema\WebhookIssuesDeleted|Schema\WebhookIssuesDemilestoned|Schema\WebhookIssuesEdited|Schema\WebhookIssuesLabeled|Schema\WebhookIssuesLocked|Schema\WebhookIssuesMilestoned|Schema\WebhookIssuesOpened|Schema\WebhookIssuesPinned|Schema\WebhookIssuesReopened|Schema\WebhookIssuesTransferred|Schema\WebhookIssuesUnassigned|Schema\WebhookIssuesUnlabeled|Schema\WebhookIssuesUnlocked|Schema\WebhookIssuesUnpinned|Schema\WebhookLabelCreated|Schema\WebhookLabelDeleted|Schema\WebhookLabelEdited|Schema\WebhookMarketplacePurchaseCancelled|Schema\WebhookMarketplacePurchaseChanged|Schema\WebhookMarketplacePurchasePendingChange|Schema\WebhookMarketplacePurchasePendingChangeCancelled|Schema\WebhookMarketplacePurchasePurchased|Schema\WebhookMemberAdded|Schema\WebhookMemberEdited|Schema\WebhookMemberRemoved|Schema\WebhookMembershipAdded|Schema\WebhookMembershipRemoved|Schema\WebhookMergeGroupChecksRequested|Schema\WebhookMergeGroupDestroyed|Schema\WebhookMetaDeleted|Schema\WebhookMilestoneClosed|Schema\WebhookMilestoneCreated|Schema\WebhookMilestoneDeleted|Schema\WebhookMilestoneEdited|Schema\WebhookMilestoneOpened|Schema\WebhookOrgBlockBlocked|Schema\WebhookOrgBlockUnblocked|Schema\WebhookOrganizationDeleted|Schema\WebhookOrganizationMemberAdded|Schema\WebhookOrganizationMemberInvited|Schema\WebhookOrganizationMemberRemoved|Schema\WebhookOrganizationRenamed|Schema\WebhookPackagePublished|Schema\WebhookPackageUpdated|Schema\WebhookPageBuild|Schema\WebhookPersonalAccessTokenRequestApproved|Schema\WebhookPersonalAccessTokenRequestCancelled|Schema\WebhookPersonalAccessTokenRequestCreated|Schema\WebhookPersonalAccessTokenRequestDenied|Schema\WebhookPing|Schema\WebhookPingFormEncoded|Schema\WebhookProjectCardConverted|Schema\WebhookProjectCardCreated|Schema\WebhookProjectCardDeleted|Schema\WebhookProjectCardEdited|Schema\WebhookProjectCardMoved|Schema\WebhookProjectClosed|Schema\WebhookProjectCreated|Schema\WebhookProjectDeleted|Schema\WebhookProjectEdited|Schema\WebhookProjectReopened|Schema\WebhookProjectColumnCreated|Schema\WebhookProjectColumnDeleted|Schema\WebhookProjectColumnEdited|Schema\WebhookProjectColumnMoved|Schema\WebhookProjectsV2ProjectClosed|Schema\WebhookProjectsV2ProjectCreated|Schema\WebhookProjectsV2ProjectDeleted|Schema\WebhookProjectsV2ProjectEdited|Schema\WebhookProjectsV2ProjectReopened|Schema\WebhookProjectsV2ItemArchived|Schema\WebhookProjectsV2ItemConverted|Schema\WebhookProjectsV2ItemCreated|Schema\WebhookProjectsV2ItemDeleted|Schema\WebhookProjectsV2ItemEdited|Schema\WebhookProjectsV2ItemReordered|Schema\WebhookProjectsV2ItemRestored|Schema\WebhookPublic|Schema\WebhookPullRequestAssigned|Schema\WebhookPullRequestAutoMergeDisabled|Schema\WebhookPullRequestAutoMergeEnabled|Schema\WebhookPullRequestClosed|Schema\WebhookPullRequestConvertedToDraft|Schema\WebhookPullRequestDemilestoned|Schema\WebhookPullRequestDequeued|Schema\WebhookPullRequestEdited|Schema\WebhookPullRequestEnqueued|Schema\WebhookPullRequestLabeled|Schema\WebhookPullRequestLocked|Schema\WebhookPullRequestMilestoned|Schema\WebhookPullRequestOpened|Schema\WebhookPullRequestReadyForReview|Schema\WebhookPullRequestReopened|Schema\WebhookPullRequestReviewRequestRemoved|Schema\WebhookPullRequestReviewRequested|Schema\WebhookPullRequestSynchronize|Schema\WebhookPullRequestUnassigned|Schema\WebhookPullRequestUnlabeled|Schema\WebhookPullRequestUnlocked|Schema\WebhookPullRequestReviewCommentCreated|Schema\WebhookPullRequestReviewCommentDeleted|Schema\WebhookPullRequestReviewCommentEdited|Schema\WebhookPullRequestReviewDismissed|Schema\WebhookPullRequestReviewEdited|Schema\WebhookPullRequestReviewSubmitted|Schema\WebhookPullRequestReviewThreadResolved|Schema\WebhookPullRequestReviewThreadUnresolved|Schema\WebhookPush|Schema\WebhookRegistryPackagePublished|Schema\WebhookRegistryPackageUpdated|Schema\WebhookReleaseCreated|Schema\WebhookReleaseDeleted|Schema\WebhookReleaseEdited|Schema\WebhookReleasePrereleased|Schema\WebhookReleasePublished|Schema\WebhookReleaseReleased|Schema\WebhookReleaseUnpublished|Schema\WebhookRepositoryAdvisoryPublished|Schema\WebhookRepositoryAdvisoryReported|Schema\WebhookRepositoryArchived|Schema\WebhookRepositoryCreated|Schema\WebhookRepositoryDeleted|Schema\WebhookRepositoryEdited|Schema\WebhookRepositoryPrivatized|Schema\WebhookRepositoryPublicized|Schema\WebhookRepositoryRenamed|Schema\WebhookRepositoryTransferred|Schema\WebhookRepositoryUnarchived|Schema\WebhookRepositoryDispatchSample|Schema\WebhookRepositoryImport|Schema\WebhookRepositoryRulesetCreated|Schema\WebhookRepositoryRulesetDeleted|Schema\WebhookRepositoryRulesetEdited|Schema\WebhookRepositoryVulnerabilityAlertCreate|Schema\WebhookRepositoryVulnerabilityAlertDismiss|Schema\WebhookRepositoryVulnerabilityAlertReopen|Schema\WebhookRepositoryVulnerabilityAlertResolve|Schema\WebhookSecretScanningAlertCreated|Schema\WebhookSecretScanningAlertReopened|Schema\WebhookSecretScanningAlertResolved|Schema\WebhookSecretScanningAlertValidated|Schema\WebhookSecretScanningAlertLocationCreated|Schema\WebhookSecretScanningAlertLocationCreatedFormEncoded|Schema\WebhookSecurityAdvisoryPublished|Schema\WebhookSecurityAdvisoryUpdated|Schema\WebhookSecurityAdvisoryWithdrawn|Schema\WebhookSecurityAndAnalysis|Schema\WebhookSponsorshipCancelled|Schema\WebhookSponsorshipCreated|Schema\WebhookSponsorshipEdited|Schema\WebhookSponsorshipPendingCancellation|Schema\WebhookSponsorshipPendingTierChange|Schema\WebhookSponsorshipTierChanged|Schema\WebhookStarCreated|Schema\WebhookStarDeleted|Schema\WebhookStatus|Schema\WebhookTeamAdd|Schema\WebhookTeamAddedToRepository|Schema\WebhookTeamCreated|Schema\WebhookTeamDeleted|Schema\WebhookTeamEdited|Schema\WebhookTeamRemovedFromRepository|Schema\WebhookWatchStarted|Schema\WebhookWorkflowDispatch|Schema\WebhookWorkflowJobCompleted|Schema\WebhookWorkflowJobInProgress|Schema\WebhookWorkflowJobQueued|Schema\WebhookWorkflowJobWaiting|Schema\WebhookWorkflowRunCompleted|Schema\WebhookWorkflowRunInProgress|Schema\WebhookWorkflowRunRequested */ public function resolve(array $headers, array $data): object { $headers = (static function ($headers): array { diff --git a/etc/specs/GitHub/current.spec.yaml b/etc/specs/GitHub/current.spec.yaml index b78c1b34f7e..ab3e66bff6c 100644 --- a/etc/specs/GitHub/current.spec.yaml +++ b/etc/specs/GitHub/current.spec.yaml @@ -838,7 +838,7 @@ paths: delete: summary: Delete an app authorization description: |- - OAuth and GitHub application owners can revoke a grant for their application and a specific user. You must use [Basic Authentication](https://docs.github.com/rest/authentication/authenticating-to-the-rest-api#using-basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. You must also provide a valid OAuth `access_token` as an input parameter and the grant for the token's owner will be deleted. + OAuth and GitHub application owners can revoke a grant for their application and a specific user. You must provide a valid OAuth `access_token` as an input parameter and the grant for the token's owner will be deleted. Deleting an application's grant will also delete all OAuth tokens associated with the application for the user. Once deleted, the application will have no access to the user's account and will no longer be listed on [the application authorizations settings screen within GitHub](https://github.com/settings/applications#authorized). operationId: apps/delete-authorization tags: @@ -881,9 +881,7 @@ paths: description: OAuth applications and GitHub applications with OAuth authorizations can use this API method for checking OAuth token validity without exceeding the normal rate limits for failed login attempts. Authentication works differently - with this particular endpoint. You must use [Basic Authentication](https://docs.github.com/rest/authentication/authenticating-to-the-rest-api#using-basic-authentication) - to use this endpoint, where the username is the application `client_id` and - the password is its `client_secret`. Invalid tokens will return `404 NOT FOUND`. + with this particular endpoint. Invalid tokens will return `404 NOT FOUND`. tags: - apps operationId: apps/check-token @@ -932,9 +930,7 @@ paths: description: OAuth applications and GitHub applications with OAuth authorizations can use this API method to reset a valid OAuth token without end-user involvement. Applications must save the "token" property in the response because changes - take effect immediately. You must use [Basic Authentication](https://docs.github.com/rest/authentication/authenticating-to-the-rest-api#using-basic-authentication) - when accessing this endpoint, using the application's `client_id` and `client_secret` - as the username and password. Invalid tokens will return `404 NOT FOUND`. + take effect immediately. Invalid tokens will return `404 NOT FOUND`. tags: - apps operationId: apps/reset-token @@ -980,9 +976,6 @@ paths: summary: Delete an app token description: OAuth or GitHub application owners can revoke a single token for an OAuth application or a GitHub application with an OAuth authorization. - You must use [Basic Authentication](https://docs.github.com/rest/authentication/authenticating-to-the-rest-api#using-basic-authentication) - when accessing this endpoint, using the application's `client_id` and `client_secret` - as the username and password. tags: - apps operationId: apps/delete-token @@ -1027,10 +1020,6 @@ paths: token. Invalid tokens will return `404 NOT FOUND`. - - You must use [Basic Authentication](https://docs.github.com/rest/authentication/authenticating-to-the-rest-api#using-basic-authentication) - when accessing this endpoint, using the `client_id` and `client_secret` of the GitHub App - as the username and password. tags: - apps operationId: apps/scope-token @@ -42556,8 +42545,9 @@ paths: "/user/installations/{installation_id}/repositories/{repository_id}": put: summary: Add a repository to an app installation - description: Add a single repository to an installation. The authenticated user - must have admin access to the repository. + description: "Add a single repository to an installation. The authenticated + user must have admin access to the repository. \n\nThis endpoint only works + for PATs (classic) with the `repo` scope." tags: - apps operationId: apps/add-repo-to-installation-for-authenticated-user @@ -42583,9 +42573,10 @@ paths: subcategory: installations delete: summary: Remove a repository from an app installation - description: Remove a single repository from an installation. The authenticated + description: "Remove a single repository from an installation. The authenticated user must have admin access to the repository. The installation must have - the `repository_selection` of `selected`. + the `repository_selection` of `selected`. \n\nThis endpoint only works for + PATs (classic) with the `repo` scope." tags: - apps operationId: apps/remove-repo-from-installation-for-authenticated-user @@ -60526,72 +60517,6 @@ webhooks: - repository - organization - app - secret-scanning-alert-revoked: - post: - summary: |- - This event occurs when there is activity relating to a secret scanning alert. For more information about secret scanning, see "[About secret scanning](https://docs.github.com/code-security/secret-scanning/about-secret-scanning)." For information about the API to manage secret scanning alerts, see "[Secret scanning](https://docs.github.com/rest/secret-scanning)" in the REST API documentation. - - For activity relating to secret scanning alert locations, use the `secret_scanning_alert_location` event. - - To subscribe to this event, a GitHub App must have at least read-level access for the "Secret scanning alerts" repository permission. - description: A secret scanning alert was marked as revoked. - operationId: secret-scanning-alert/revoked - externalDocs: - url: https://docs.github.com/webhooks/webhook-events-and-payloads#secret_scanning_alert - parameters: - - name: User-Agent - in: header - example: GitHub-Hookshot/123abc - schema: - type: string - - name: X-Github-Hook-Id - in: header - example: 12312312 - schema: - type: string - - name: X-Github-Event - in: header - example: issues - schema: - type: string - - name: X-Github-Hook-Installation-Target-Id - in: header - example: 123123 - schema: - type: string - - name: X-Github-Hook-Installation-Target-Type - in: header - example: repository - schema: - type: string - - name: X-GitHub-Delivery - in: header - example: 0b989ba4-242f-11e5-81e1-c7b6966d2516 - schema: - type: string - - name: X-Hub-Signature-256 - in: header - example: sha256=6dcb09b5b57875f334f61aebed695e2e4193db5e - schema: - type: string - requestBody: - required: true - content: - application/json: - schema: - "$ref": "#/components/schemas/webhook-secret-scanning-alert-revoked" - responses: - '200': - description: Return a 200 status to indicate that the data was received - successfully - x-github: - githubCloudOnly: false - category: webhooks - subcategory: secret_scanning_alert - supported-webhook-types: - - repository - - organization - - app secret-scanning-alert-validated: post: summary: |- @@ -186372,30 +186297,6 @@ components: - action - alert - repository - webhook-secret-scanning-alert-revoked: - title: secret_scanning_alert revoked event - type: object - properties: - action: - type: string - enum: - - revoked - alert: - "$ref": "#/components/schemas/secret-scanning-alert-webhook" - enterprise: - "$ref": "#/components/schemas/enterprise-webhooks" - installation: - "$ref": "#/components/schemas/simple-installation" - organization: - "$ref": "#/components/schemas/organization-simple-webhooks" - repository: - "$ref": "#/components/schemas/repository-webhooks" - sender: - "$ref": "#/components/schemas/simple-user-webhooks" - required: - - action - - alert - - repository webhook-secret-scanning-alert-validated: title: secret_scanning_alert validated event type: object