diff --git a/clients/GitHub/README.md b/clients/GitHub/README.md index 4c96524f35e..4095c96cae2 100644 --- a/clients/GitHub/README.md +++ b/clients/GitHub/README.md @@ -13915,6 +13915,30 @@ $client->operations()->codeScanning()->getCodeqlDatabase( owner: 'generat You can find more about this operation over at the [API method documentation](https://docs.github.com/rest/code-scanning/code-scanning#get-a-codeql-database-for-a-repository). +### code-scanning/delete-codeql-database + +Delete a CodeQL database + +Using the `call` method: +```php +$client->call('DELETE /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}', [ + 'owner' => 'generated', + 'repo' => 'generated', + 'language' => 'generated', +]); +``` + +Operations method: +```php +$client->operations()->codeScanning()->deleteCodeqlDatabase( owner: 'generated', + repo: 'generated', + language: 'generated', +); +``` + +You can find more about this operation over at the [API method documentation](https://docs.github.com/rest/code-scanning/code-scanning#delete-a-codeql-database). + + ### code-scanning/create-variant-analysis Create a CodeQL variant analysis diff --git a/clients/GitHub/etc/openapi-client-generator.state b/clients/GitHub/etc/openapi-client-generator.state index 7f9a0b6d89d..b5e649bd512 100644 --- a/clients/GitHub/etc/openapi-client-generator.state +++ b/clients/GitHub/etc/openapi-client-generator.state @@ -1,5 +1,5 @@ { - "specHash": "4befd63c20b175c975d8d0d17534c658", + "specHash": "5758ce6a93c789209abf3a01ab532091", "generatedFiles": { "files": [ { @@ -5572,7 +5572,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Operation\/CodeScanning.php", - "hash": "74a5460ad4d26c7340b86cb11329899d" + "hash": "b44a19071df22912d5b1612756134a44" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Operation\/Codespaces.php", @@ -11632,7 +11632,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Operation\/Copilot.php", - "hash": "6ade6b422ebb9bea2565934472391a0c" + "hash": "6688825af95a583a9a52e8a4d4cd4366" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/CheckAutomatedSecurityFixes.php", @@ -24436,7 +24436,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Copilot.php", - "hash": "0659af6cea81d05da85721e8288a2f95" + "hash": "ecf745142ae57eef3eefcb60dbd25986" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Pulls.php", @@ -24752,7 +24752,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Delete\/CodeScanning.php", - "hash": "71ccf8a652e624bfdd747b3d7b17e195" + "hash": "84753ee31cc8bb9c8a149af182252cde" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Delete\/Dependabot.php", @@ -24872,7 +24872,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Five.php", - "hash": "a59507c14867ec757a540569fd6b2046" + "hash": "1ce432fd322550bce04d7db17e97a08e" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Six.php", @@ -24880,7 +24880,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Seven.php", - "hash": "7dcff0ea5a9034872b56f76ab8678ef0" + "hash": "cdab06537a7f98fdf3c5ed86ada2f5f4" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Eight.php", @@ -24976,7 +24976,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/List\/Five.php", - "hash": "37adf0b0c605ed4b34da57553d40612a" + "hash": "123f6a936ba8096442dac832830411c2" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/List\/Six.php", @@ -24984,7 +24984,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/List\/Seven.php", - "hash": "c955792e85ba9471e9a8eca2796c599b" + "hash": "d2b285c7b7a3494366fd113b6d5c5ac5" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/List\/Eight.php", @@ -25020,7 +25020,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Delete\/Eight.php", - "hash": "0f72420727cf7aa4c93b006ed06fe1ad" + "hash": "8a56724d85ab9ee985cdfd8c1f36c8b7" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Delete\/Nine.php", @@ -25080,7 +25080,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operators.php", - "hash": "73bddde1d49a446e360798671c62f0d1" + "hash": "0d4ee71e090bd30719d02f88808fff0d" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Hydrator\/Operation\/Root.php", @@ -27656,11 +27656,11 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/PHPStan\/ClientCallReturnTypes.php", - "hash": "6d60fc896e49c812335d4df8359d7a6d" + "hash": "52f53add13f4dd9b4a254971b986fd4a" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Types\/ClientCallReturnTypes.php", - "hash": "d509d66ebb56bf9cb33ba8f6415a27a3" + "hash": "fd59bd2d3fcf851e7f60f4dd482837d1" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/..\/etc\/phpstan-extension.neon", @@ -28700,7 +28700,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/List\/Copilot.php", - "hash": "c481d55963d10b120edcfa7f38ce045c" + "hash": "93e6fb8747f9710c81901b8efd39acc9" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Hydrator\/Operation\/Enterprises\/Enterprise\/Copilot\/Usage.php", @@ -30652,7 +30652,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operator\/Copilot\/CopilotMetricsForEnterprise.php", - "hash": "399a6aa023a04ea00bd3f67d476c1470" + "hash": "ec49ebea2f9735ac8b509bb49be98fba" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Internal\/Operation\/Copilot\/CopilotMetricsForEnterpriseTest.php", @@ -30664,7 +30664,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operator\/Copilot\/CopilotMetricsForEnterpriseListing.php", - "hash": "2ce9f340b29fd008da29cc42965a0793" + "hash": "c10dd90716f736a5c0e90f665ae9e43c" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Internal\/Operation\/Copilot\/CopilotMetricsForEnterpriseListingTest.php", @@ -30676,7 +30676,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operator\/Copilot\/CopilotMetricsForEnterpriseTeam.php", - "hash": "079572f2c14ba2251377966d5cb0f495" + "hash": "23dd121269a9f8f0025d70a3322deb04" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Internal\/Operation\/Copilot\/CopilotMetricsForEnterpriseTeamTest.php", @@ -30688,7 +30688,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operator\/Copilot\/CopilotMetricsForEnterpriseTeamListing.php", - "hash": "e27d1d3e0589130b81f0ffb0ff2ac456" + "hash": "a589e8b4b8a468806859f357e221c0fe" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Internal\/Operation\/Copilot\/CopilotMetricsForEnterpriseTeamListingTest.php", @@ -30700,7 +30700,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operator\/Copilot\/CopilotMetricsForOrganization.php", - "hash": "9dba5bb250e3b77d8a0ec7e8a126a2a6" + "hash": "8d05c840c6f75664f36b2d91a67a7e4a" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Internal\/Operation\/Copilot\/CopilotMetricsForOrganizationTest.php", @@ -30712,7 +30712,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operator\/Copilot\/CopilotMetricsForOrganizationListing.php", - "hash": "7a6ccd80e4b684213f121e7d9e8bf094" + "hash": "fc63b306462051abb3cdf1c9e567ef01" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Internal\/Operation\/Copilot\/CopilotMetricsForOrganizationListingTest.php", @@ -30724,7 +30724,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operator\/Copilot\/CopilotMetricsForTeam.php", - "hash": "6bd86aa3e8852b527319d04049f2011c" + "hash": "d6e69a42ec401cb00d20e1fe5a8d02a5" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Internal\/Operation\/Copilot\/CopilotMetricsForTeamTest.php", @@ -30736,7 +30736,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operator\/Copilot\/CopilotMetricsForTeamListing.php", - "hash": "40043b868a899e74f4f8e23427ba5ecb" + "hash": "47bd4878bff236a51fe151fd772990cd" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Internal\/Operation\/Copilot\/CopilotMetricsForTeamListingTest.php", @@ -30813,6 +30813,18 @@ { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Hydrator\/Operation\/Orgs\/Org\/Team\/TeamSlug\/Copilot\/Metrics.php", "hash": "e86a62d972b96c0dfef1bb5449415923" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operation\/CodeScanning\/DeleteCodeqlDatabase.php", + "hash": "41c58cb3fb29e55f122e249c9938b04e" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operator\/CodeScanning\/DeleteCodeqlDatabase.php", + "hash": "df190827fcd4219473ecf7999d93d76e" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Internal\/Operation\/CodeScanning\/DeleteCodeqlDatabaseTest.php", + "hash": "6f499eeba97d368253c2b5eb406630fa" } ] }, @@ -30832,7 +30844,7 @@ }, { "name": "..\/..\/composer.lock", - "hash": "9ed7ffbea5b997bda1a2ac835aa0787b" + "hash": "57a58662b6da9a7cae285c7edb32d15d" } ] } diff --git a/clients/GitHub/src/Internal/Operation/CodeScanning/DeleteCodeqlDatabase.php b/clients/GitHub/src/Internal/Operation/CodeScanning/DeleteCodeqlDatabase.php new file mode 100644 index 00000000000..6e448685f89 --- /dev/null +++ b/clients/GitHub/src/Internal/Operation/CodeScanning/DeleteCodeqlDatabase.php @@ -0,0 +1,91 @@ +owner = $owner; + $this->repo = $repo; + $this->language = $language; + } + + public function createRequest(): RequestInterface + { + return new Request('DELETE', str_replace(['{owner}', '{repo}', '{language}'], [$this->owner, $this->repo, $this->language], '/repos/{owner}/{repo}/code-scanning/codeql/databases/{language}')); + } + + public function createResponse(ResponseInterface $response): WithoutBody + { + $code = $response->getStatusCode(); + [$contentType] = explode(';', $response->getHeaderLine('Content-Type')); + switch ($contentType) { + case 'application/json': + $body = json_decode($response->getBody()->getContents(), true); + switch ($code) { + /** + * Response if the repository is archived or if GitHub Advanced Security is not enabled for this repository + **/ + case 403: + $this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\BasicError::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + + throw new ErrorSchemas\BasicError(403, $this->hydrator->hydrateObject(Schema\BasicError::class, $body)); + /** + * Resource not found + **/ + + case 404: + $this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\BasicError::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + + throw new ErrorSchemas\BasicError(404, $this->hydrator->hydrateObject(Schema\BasicError::class, $body)); + /** + * Service unavailable + **/ + + case 503: + $this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\Operations\SecretScanning\ListAlertsForEnterprise\Response\ApplicationJson\ServiceUnavailable::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + + throw new ErrorSchemas\Operations\SecretScanning\ListAlertsForEnterprise\Response\ApplicationJson\ServiceUnavailable(503, $this->hydrator->hydrateObject(Schema\Operations\SecretScanning\ListAlertsForEnterprise\Response\ApplicationJson\ServiceUnavailable::class, $body)); + } + + break; + } + + switch ($code) { + /** + * Response + **/ + case 204: + return new WithoutBody(204, []); + } + + throw new RuntimeException('Unable to find matching response code and content type'); + } +} diff --git a/clients/GitHub/src/Internal/Operator/CodeScanning/DeleteCodeqlDatabase.php b/clients/GitHub/src/Internal/Operator/CodeScanning/DeleteCodeqlDatabase.php new file mode 100644 index 00000000000..43dd348d062 --- /dev/null +++ b/clients/GitHub/src/Internal/Operator/CodeScanning/DeleteCodeqlDatabase.php @@ -0,0 +1,40 @@ +responseSchemaValidator, $this->hydrator, $owner, $repo, $language); + $request = $operation->createRequest(); + $result = await($this->browser->request($request->getMethod(), (string) $request->getUri(), $request->withHeader('Authorization', $this->authentication->authHeader())->getHeaders(), (string) $request->getBody())->then(static function (ResponseInterface $response) use ($operation): WithoutBody { + return $operation->createResponse($response); + })); + if ($result instanceof Observable) { + $result = awaitObservable($result); + } + + return $result; + } +} diff --git a/clients/GitHub/src/Internal/Operator/Copilot/CopilotMetricsForEnterprise.php b/clients/GitHub/src/Internal/Operator/Copilot/CopilotMetricsForEnterprise.php index 50f7a7c8d99..b8f6b31ba5a 100644 --- a/clients/GitHub/src/Internal/Operator/Copilot/CopilotMetricsForEnterprise.php +++ b/clients/GitHub/src/Internal/Operator/Copilot/CopilotMetricsForEnterprise.php @@ -24,7 +24,7 @@ public function __construct(private Browser $browser, private AuthenticationInte { } - /** @return iterable */ + /** @return Observable */ public function call(string $enterprise, string $since, string $until, int $page = 1, int $perPage = 28): iterable { $operation = new \ApiClients\Client\GitHub\Internal\Operation\Copilot\CopilotMetricsForEnterprise($this->responseSchemaValidator, $this->hydrator, $enterprise, $since, $until, $page, $perPage); diff --git a/clients/GitHub/src/Internal/Operator/Copilot/CopilotMetricsForEnterpriseListing.php b/clients/GitHub/src/Internal/Operator/Copilot/CopilotMetricsForEnterpriseListing.php index ea8407d5b9e..8528c0b56df 100644 --- a/clients/GitHub/src/Internal/Operator/Copilot/CopilotMetricsForEnterpriseListing.php +++ b/clients/GitHub/src/Internal/Operator/Copilot/CopilotMetricsForEnterpriseListing.php @@ -24,7 +24,7 @@ public function __construct(private Browser $browser, private AuthenticationInte { } - /** @return iterable */ + /** @return Observable */ public function call(string $enterprise, string $since, string $until, int $page = 1, int $perPage = 28): iterable { $operation = new \ApiClients\Client\GitHub\Internal\Operation\Copilot\CopilotMetricsForEnterpriseListing($this->responseSchemaValidator, $this->hydrator, $enterprise, $since, $until, $page, $perPage); diff --git a/clients/GitHub/src/Internal/Operator/Copilot/CopilotMetricsForEnterpriseTeam.php b/clients/GitHub/src/Internal/Operator/Copilot/CopilotMetricsForEnterpriseTeam.php index 4dbc76f12c5..d945e17c05d 100644 --- a/clients/GitHub/src/Internal/Operator/Copilot/CopilotMetricsForEnterpriseTeam.php +++ b/clients/GitHub/src/Internal/Operator/Copilot/CopilotMetricsForEnterpriseTeam.php @@ -24,7 +24,7 @@ public function __construct(private Browser $browser, private AuthenticationInte { } - /** @return iterable */ + /** @return Observable */ public function call(string $enterprise, string $teamSlug, string $since, string $until, int $page = 1, int $perPage = 28): iterable { $operation = new \ApiClients\Client\GitHub\Internal\Operation\Copilot\CopilotMetricsForEnterpriseTeam($this->responseSchemaValidator, $this->hydrator, $enterprise, $teamSlug, $since, $until, $page, $perPage); diff --git a/clients/GitHub/src/Internal/Operator/Copilot/CopilotMetricsForEnterpriseTeamListing.php b/clients/GitHub/src/Internal/Operator/Copilot/CopilotMetricsForEnterpriseTeamListing.php index e5614e4cd01..1bee8b7abf1 100644 --- a/clients/GitHub/src/Internal/Operator/Copilot/CopilotMetricsForEnterpriseTeamListing.php +++ b/clients/GitHub/src/Internal/Operator/Copilot/CopilotMetricsForEnterpriseTeamListing.php @@ -24,7 +24,7 @@ public function __construct(private Browser $browser, private AuthenticationInte { } - /** @return iterable */ + /** @return Observable */ public function call(string $enterprise, string $teamSlug, string $since, string $until, int $page = 1, int $perPage = 28): iterable { $operation = new \ApiClients\Client\GitHub\Internal\Operation\Copilot\CopilotMetricsForEnterpriseTeamListing($this->responseSchemaValidator, $this->hydrator, $enterprise, $teamSlug, $since, $until, $page, $perPage); diff --git a/clients/GitHub/src/Internal/Operator/Copilot/CopilotMetricsForOrganization.php b/clients/GitHub/src/Internal/Operator/Copilot/CopilotMetricsForOrganization.php index 37849872812..286469ca097 100644 --- a/clients/GitHub/src/Internal/Operator/Copilot/CopilotMetricsForOrganization.php +++ b/clients/GitHub/src/Internal/Operator/Copilot/CopilotMetricsForOrganization.php @@ -24,7 +24,7 @@ public function __construct(private Browser $browser, private AuthenticationInte { } - /** @return iterable */ + /** @return Observable */ public function call(string $org, string $since, string $until, int $page = 1, int $perPage = 28): iterable { $operation = new \ApiClients\Client\GitHub\Internal\Operation\Copilot\CopilotMetricsForOrganization($this->responseSchemaValidator, $this->hydrator, $org, $since, $until, $page, $perPage); diff --git a/clients/GitHub/src/Internal/Operator/Copilot/CopilotMetricsForOrganizationListing.php b/clients/GitHub/src/Internal/Operator/Copilot/CopilotMetricsForOrganizationListing.php index 8aa9ce3c799..38c88e5fb82 100644 --- a/clients/GitHub/src/Internal/Operator/Copilot/CopilotMetricsForOrganizationListing.php +++ b/clients/GitHub/src/Internal/Operator/Copilot/CopilotMetricsForOrganizationListing.php @@ -24,7 +24,7 @@ public function __construct(private Browser $browser, private AuthenticationInte { } - /** @return iterable */ + /** @return Observable */ public function call(string $org, string $since, string $until, int $page = 1, int $perPage = 28): iterable { $operation = new \ApiClients\Client\GitHub\Internal\Operation\Copilot\CopilotMetricsForOrganizationListing($this->responseSchemaValidator, $this->hydrator, $org, $since, $until, $page, $perPage); diff --git a/clients/GitHub/src/Internal/Operator/Copilot/CopilotMetricsForTeam.php b/clients/GitHub/src/Internal/Operator/Copilot/CopilotMetricsForTeam.php index 8ae24c12209..220770d3d13 100644 --- a/clients/GitHub/src/Internal/Operator/Copilot/CopilotMetricsForTeam.php +++ b/clients/GitHub/src/Internal/Operator/Copilot/CopilotMetricsForTeam.php @@ -24,7 +24,7 @@ public function __construct(private Browser $browser, private AuthenticationInte { } - /** @return iterable */ + /** @return Observable */ public function call(string $org, string $teamSlug, string $since, string $until, int $page = 1, int $perPage = 28): iterable { $operation = new \ApiClients\Client\GitHub\Internal\Operation\Copilot\CopilotMetricsForTeam($this->responseSchemaValidator, $this->hydrator, $org, $teamSlug, $since, $until, $page, $perPage); diff --git a/clients/GitHub/src/Internal/Operator/Copilot/CopilotMetricsForTeamListing.php b/clients/GitHub/src/Internal/Operator/Copilot/CopilotMetricsForTeamListing.php index ac6b15a35cc..cfa26706f19 100644 --- a/clients/GitHub/src/Internal/Operator/Copilot/CopilotMetricsForTeamListing.php +++ b/clients/GitHub/src/Internal/Operator/Copilot/CopilotMetricsForTeamListing.php @@ -24,7 +24,7 @@ public function __construct(private Browser $browser, private AuthenticationInte { } - /** @return iterable */ + /** @return Observable */ public function call(string $org, string $teamSlug, string $since, string $until, int $page = 1, int $perPage = 28): iterable { $operation = new \ApiClients\Client\GitHub\Internal\Operation\Copilot\CopilotMetricsForTeamListing($this->responseSchemaValidator, $this->hydrator, $org, $teamSlug, $since, $until, $page, $perPage); diff --git a/clients/GitHub/src/Internal/Operators.php b/clients/GitHub/src/Internal/Operators.php index 3a4afe0f921..ed2709c4ad2 100644 --- a/clients/GitHub/src/Internal/Operators.php +++ b/clients/GitHub/src/Internal/Operators.php @@ -584,6 +584,7 @@ final class Operators private Internal\Operator\CodeScanning\DeleteAnalysis|null $codeScanning👷DeleteAnalysis = null; private Internal\Operator\CodeScanning\ListCodeqlDatabases|null $codeScanning👷ListCodeqlDatabases = null; private Internal\Operator\CodeScanning\GetCodeqlDatabase|null $codeScanning👷GetCodeqlDatabase = null; + private Internal\Operator\CodeScanning\DeleteCodeqlDatabase|null $codeScanning👷DeleteCodeqlDatabase = null; private Internal\Operator\CodeScanning\CreateVariantAnalysis|null $codeScanning👷CreateVariantAnalysis = null; private Internal\Operator\CodeScanning\GetVariantAnalysis|null $codeScanning👷GetVariantAnalysis = null; private Internal\Operator\CodeScanning\GetVariantAnalysisRepoTask|null $codeScanning👷GetVariantAnalysisRepoTask = null; @@ -6322,6 +6323,15 @@ public function codeScanning👷GetCodeqlDatabase(): Internal\Operator\CodeScann return $this->codeScanning👷GetCodeqlDatabase; } + public function codeScanning👷DeleteCodeqlDatabase(): Internal\Operator\CodeScanning\DeleteCodeqlDatabase + { + if ($this->codeScanning👷DeleteCodeqlDatabase instanceof Internal\Operator\CodeScanning\DeleteCodeqlDatabase === false) { + $this->codeScanning👷DeleteCodeqlDatabase = new Internal\Operator\CodeScanning\DeleteCodeqlDatabase($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Repos🌀Owner🌀Repo🌀CodeScanning🌀Codeql🌀Databases🌀Language()); + } + + return $this->codeScanning👷DeleteCodeqlDatabase; + } + public function codeScanning👷CreateVariantAnalysis(): Internal\Operator\CodeScanning\CreateVariantAnalysis { if ($this->codeScanning👷CreateVariantAnalysis instanceof Internal\Operator\CodeScanning\CreateVariantAnalysis === false) { diff --git a/clients/GitHub/src/Internal/Router/Delete/CodeScanning.php b/clients/GitHub/src/Internal/Router/Delete/CodeScanning.php index 094cb88a43b..94897dbe137 100644 --- a/clients/GitHub/src/Internal/Router/Delete/CodeScanning.php +++ b/clients/GitHub/src/Internal/Router/Delete/CodeScanning.php @@ -7,6 +7,7 @@ use ApiClients\Client\GitHub\Internal; use ApiClients\Client\GitHub\Schema\CodeScanningAnalysisDeletion; use ApiClients\Contracts\HTTP\Headers\AuthenticationInterface; +use ApiClients\Tools\OpenApiClient\Utils\Response\WithoutBody; use InvalidArgumentException; use League\OpenAPIValidation\Schema\SchemaValidator; use React\Http\Browser; @@ -51,4 +52,30 @@ public function deleteAnalysis(array $params): CodeScanningAnalysisDeletion return $operator->call($arguments['owner'], $arguments['repo'], $arguments['analysis_id'], $arguments['confirm_delete']); } + + public function deleteCodeqlDatabase(array $params): WithoutBody + { + $arguments = []; + if (array_key_exists('owner', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: owner'); + } + + $arguments['owner'] = $params['owner']; + unset($params['owner']); + if (array_key_exists('repo', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: repo'); + } + + $arguments['repo'] = $params['repo']; + unset($params['repo']); + if (array_key_exists('language', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: language'); + } + + $arguments['language'] = $params['language']; + unset($params['language']); + $operator = new Internal\Operator\CodeScanning\DeleteCodeqlDatabase($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Repos🌀Owner🌀Repo🌀CodeScanning🌀Codeql🌀Databases🌀Language()); + + return $operator->call($arguments['owner'], $arguments['repo'], $arguments['language']); + } } diff --git a/clients/GitHub/src/Internal/Router/Delete/Eight.php b/clients/GitHub/src/Internal/Router/Delete/Eight.php index 12ad30a7c4c..8dc1d6a2630 100644 --- a/clients/GitHub/src/Internal/Router/Delete/Eight.php +++ b/clients/GitHub/src/Internal/Router/Delete/Eight.php @@ -18,7 +18,7 @@ public function __construct(private Routers $routers) { } - /** @return |Observable|Schema\BasicError */ + /** @return |\ApiClients\Tools\OpenApiClient\Utils\Response\WithoutBody|Observable|Schema\BasicError */ public function call(string $call, array $params, array $pathChunks): WithoutBody|Ok|Json|iterable|BasicError|PullRequestReview { if ($pathChunks[0] === '') { @@ -181,6 +181,16 @@ public function call(string $call, array $params, array $pathChunks): WithoutBod } } } + } elseif ($pathChunks[4] === 'code-scanning') { + if ($pathChunks[5] === 'codeql') { + if ($pathChunks[6] === 'databases') { + if ($pathChunks[7] === '{language}') { + if ($call === 'DELETE /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}') { + return $this->routers->internal🔀Router🔀Delete🔀CodeScanning()->deleteCodeqlDatabase($params); + } + } + } + } } elseif ($pathChunks[4] === 'comments') { if ($pathChunks[5] === '{comment_id}') { if ($pathChunks[6] === 'reactions') { diff --git a/clients/GitHub/src/Internal/Router/Get/Copilot.php b/clients/GitHub/src/Internal/Router/Get/Copilot.php index d71c4cb03b8..bb1e7ad9976 100644 --- a/clients/GitHub/src/Internal/Router/Get/Copilot.php +++ b/clients/GitHub/src/Internal/Router/Get/Copilot.php @@ -23,7 +23,7 @@ public function __construct(private SchemaValidator $requestSchemaValidator, pri { } - /** @return iterable */ + /** @return Observable */ public function copilotMetricsForEnterprise(array $params): iterable { $arguments = []; @@ -116,7 +116,7 @@ public function getCopilotOrganizationDetails(array $params): CopilotOrganizatio return $operator->call($arguments['org']); } - /** @return iterable */ + /** @return Observable */ public function copilotMetricsForOrganization(array $params): iterable { $arguments = []; @@ -269,7 +269,7 @@ public function getCopilotSeatDetailsForUser(array $params): CopilotSeatDetails| return $operator->call($arguments['org'], $arguments['username']); } - /** @return iterable */ + /** @return Observable */ public function copilotMetricsForEnterpriseTeam(array $params): iterable { $arguments = []; @@ -359,7 +359,7 @@ public function usageMetricsForEnterpriseTeam(array $params): iterable return $operator->call($arguments['enterprise'], $arguments['team_slug'], $arguments['since'], $arguments['until'], $arguments['page'], $arguments['per_page']); } - /** @return iterable */ + /** @return Observable */ public function copilotMetricsForTeam(array $params): iterable { $arguments = []; diff --git a/clients/GitHub/src/Internal/Router/Get/Five.php b/clients/GitHub/src/Internal/Router/Get/Five.php index 8d2b0f1acab..4ac4c3b22e0 100644 --- a/clients/GitHub/src/Internal/Router/Get/Five.php +++ b/clients/GitHub/src/Internal/Router/Get/Five.php @@ -51,7 +51,7 @@ public function __construct(private Routers $routers) { } - /** @return |iterable|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 */ + /** @return |Observable|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 */ public function call(string $call, array $params, array $pathChunks): HookDelivery|iterable|WithoutBody|GistComment|MarketplacePurchase|BasicError|ThreadSubscription|ActionsOrganizationPermissions|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|RepositoryRuleset|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|EmptyObject { if ($pathChunks[0] === '') { diff --git a/clients/GitHub/src/Internal/Router/Get/Seven.php b/clients/GitHub/src/Internal/Router/Get/Seven.php index 2836539e34a..08b0b4d1404 100644 --- a/clients/GitHub/src/Internal/Router/Get/Seven.php +++ b/clients/GitHub/src/Internal/Router/Get/Seven.php @@ -63,7 +63,7 @@ public function __construct(private Routers $routers) { } - /** @return iterable|Observable||Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Schema\BasicError|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Schema\ConvertedNoteToIssueIssueEvent|Schema\TimelineCommentEvent|Schema\TimelineCrossReferencedEvent|Schema\TimelineCommittedEvent|Schema\TimelineReviewedEvent|Schema\TimelineLineCommentedEvent|Schema\TimelineCommitCommentedEvent|Schema\TimelineAssignedIssueEvent|Schema\TimelineUnassignedIssueEvent|Schema\StateChangeIssueEvent>|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable */ + /** @return Observable|Observable||Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Schema\BasicError|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Schema\ConvertedNoteToIssueIssueEvent|Schema\TimelineCommentEvent|Schema\TimelineCrossReferencedEvent|Schema\TimelineCommittedEvent|Schema\TimelineReviewedEvent|Schema\TimelineLineCommentedEvent|Schema\TimelineCommitCommentedEvent|Schema\TimelineAssignedIssueEvent|Schema\TimelineUnassignedIssueEvent|Schema\StateChangeIssueEvent>|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable */ public function call(string $call, array $params, array $pathChunks): iterable|OidcCustomSub|Ok|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListSelfHostedRunnersInGroupForOrg\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListLabelsForSelfHostedRunnerForOrg\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListSelectedReposForOrgSecret\Response\ApplicationJson\Ok|Json|WithoutBody|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\ListSelectedReposForOrgSecret\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Dependabot\ListSelectedReposForOrgSecret\Response\ApplicationJson\Ok\Application\Json|HookDelivery|TeamDiscussion|TeamMembership|TeamProject|Artifact|ActionsCacheUsageByRepository|Job|ActionsWorkflowAccessToRepository|SelectedActions|ActionsGetDefaultWorkflowPermissions|Runner|WorkflowRun|ActionsPublicKey|ActionsSecret|ActionsVariable|Workflow|BranchProtection|\ApiClients\Client\GitHub\Schema\Operations\Checks\ListForSuite\Response\ApplicationJson\Ok|CodeScanningAlert|CodeScanningAnalysis|CodeScanningSarifsStatus|CodespacesPublicKey|RepoCodespacesSecret|RepositoryCollaboratorPermission|\ApiClients\Client\GitHub\Schema\Operations\Checks\ListForRef\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Checks\ListSuitesForRef\Response\ApplicationJson\Ok|CombinedCommitStatus|BasicError|DependabotAlert|DependabotPublicKey|DependabotSecret|\ApiClients\Client\GitHub\Schema\Operations\Repos\ListDeploymentBranchPolicies\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Repos\GetAllDeploymentProtectionRules\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListEnvironmentSecrets\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListEnvironmentVariables\Response\ApplicationJson\Ok\Application\Json|Blob|GitCommit|GitRef|GitTag|GitTree|WebhookConfig|IssueComment|IssueEvent|PageBuild|PagesDeploymentStatus|PullRequestReviewComment|PullRequestReviewRequest|ReleaseAsset|Release|RuleSuite|SecretScanningAlert|TeamDiscussionComment|PackageVersion { if ($pathChunks[0] === '') { diff --git a/clients/GitHub/src/Internal/Router/List/Copilot.php b/clients/GitHub/src/Internal/Router/List/Copilot.php index e334059e353..638701d08a3 100644 --- a/clients/GitHub/src/Internal/Router/List/Copilot.php +++ b/clients/GitHub/src/Internal/Router/List/Copilot.php @@ -20,7 +20,7 @@ public function __construct(private SchemaValidator $requestSchemaValidator, pri { } - /** @return iterable */ + /** @return Observable */ public function copilotMetricsForEnterpriseListing(array $params): iterable { $arguments = []; @@ -110,7 +110,7 @@ public function usageMetricsForEnterpriseListing(array $params): iterable } while (count($items) > 0); } - /** @return iterable */ + /** @return Observable */ public function copilotMetricsForOrganizationListing(array $params): iterable { $arguments = []; @@ -200,7 +200,7 @@ public function usageMetricsForOrgListing(array $params): iterable } while (count($items) > 0); } - /** @return iterable */ + /** @return Observable */ public function copilotMetricsForEnterpriseTeamListing(array $params): iterable { $arguments = []; @@ -302,7 +302,7 @@ public function usageMetricsForEnterpriseTeamListing(array $params): iterable } while (count($items) > 0); } - /** @return iterable */ + /** @return Observable */ public function copilotMetricsForTeamListing(array $params): iterable { $arguments = []; diff --git a/clients/GitHub/src/Internal/Router/List/Five.php b/clients/GitHub/src/Internal/Router/List/Five.php index a345c3ae29b..fb1ba1d4709 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 iterable|Observable|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 */ + /** @return Observable|Observable|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 */ public function call(string $call, array $params, array $pathChunks): iterable|BasicError|WithoutBody { if ($pathChunks[0] === '') { diff --git a/clients/GitHub/src/Internal/Router/List/Seven.php b/clients/GitHub/src/Internal/Router/List/Seven.php index d2c0eee1934..ed7aa79b717 100644 --- a/clients/GitHub/src/Internal/Router/List/Seven.php +++ b/clients/GitHub/src/Internal/Router/List/Seven.php @@ -14,7 +14,7 @@ public function __construct(private Routers $routers) { } - /** @return iterable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Schema\BasicError|Observable|Observable|Observable|Observable|Schema\ConvertedNoteToIssueIssueEvent|Schema\TimelineCommentEvent|Schema\TimelineCrossReferencedEvent|Schema\TimelineCommittedEvent|Schema\TimelineReviewedEvent|Schema\TimelineLineCommentedEvent|Schema\TimelineCommitCommentedEvent|Schema\TimelineAssignedIssueEvent|Schema\TimelineUnassignedIssueEvent|Schema\StateChangeIssueEvent>|Observable|Observable|Observable|Observable|Observable|Observable */ + /** @return Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Schema\BasicError|Observable|Observable|Observable|Observable|Schema\ConvertedNoteToIssueIssueEvent|Schema\TimelineCommentEvent|Schema\TimelineCrossReferencedEvent|Schema\TimelineCommittedEvent|Schema\TimelineReviewedEvent|Schema\TimelineLineCommentedEvent|Schema\TimelineCommitCommentedEvent|Schema\TimelineAssignedIssueEvent|Schema\TimelineUnassignedIssueEvent|Schema\StateChangeIssueEvent>|Observable|Observable|Observable|Observable|Observable|Observable */ public function call(string $call, array $params, array $pathChunks): iterable|BasicError { if ($pathChunks[0] === '') { diff --git a/clients/GitHub/src/Operation/CodeScanning.php b/clients/GitHub/src/Operation/CodeScanning.php index 7433034ae60..7842c672c87 100644 --- a/clients/GitHub/src/Operation/CodeScanning.php +++ b/clients/GitHub/src/Operation/CodeScanning.php @@ -109,6 +109,11 @@ public function getCodeqlDatabase(string $owner, string $repo, string $language) return $this->operators->codeScanning👷GetCodeqlDatabase()->call($owner, $repo, $language); } + public function deleteCodeqlDatabase(string $owner, string $repo, string $language): WithoutBody + { + return $this->operators->codeScanning👷DeleteCodeqlDatabase()->call($owner, $repo, $language); + } + /** @return */ public function createVariantAnalysis(string $owner, string $repo, array $params): CodeScanningVariantAnalysis { diff --git a/clients/GitHub/src/Operation/Copilot.php b/clients/GitHub/src/Operation/Copilot.php index fc14d0edb28..28bf8bb512c 100644 --- a/clients/GitHub/src/Operation/Copilot.php +++ b/clients/GitHub/src/Operation/Copilot.php @@ -25,13 +25,13 @@ public function listCopilotSeatsForEnterprise(string $enterprise, int $page, int return $this->operators->copilot👷ListCopilotSeatsForEnterprise()->call($enterprise, $page, $perPage); } - /** @return iterable */ + /** @return Observable */ public function copilotMetricsForEnterprise(string $enterprise, string $since, string $until, int $page, int $perPage): iterable { return $this->operators->copilot👷CopilotMetricsForEnterprise()->call($enterprise, $since, $until, $page, $perPage); } - /** @return iterable */ + /** @return Observable */ public function copilotMetricsForEnterpriseListing(string $enterprise, string $since, string $until, int $page, int $perPage): iterable { return $this->operators->copilot👷CopilotMetricsForEnterpriseListing()->call($enterprise, $since, $until, $page, $perPage); @@ -49,13 +49,13 @@ public function usageMetricsForEnterpriseListing(string $enterprise, string $sin return $this->operators->copilot👷UsageMetricsForEnterpriseListing()->call($enterprise, $since, $until, $page, $perPage); } - /** @return iterable */ + /** @return Observable */ public function copilotMetricsForEnterpriseTeam(string $enterprise, string $teamSlug, string $since, string $until, int $page, int $perPage): iterable { return $this->operators->copilot👷CopilotMetricsForEnterpriseTeam()->call($enterprise, $teamSlug, $since, $until, $page, $perPage); } - /** @return iterable */ + /** @return Observable */ public function copilotMetricsForEnterpriseTeamListing(string $enterprise, string $teamSlug, string $since, string $until, int $page, int $perPage): iterable { return $this->operators->copilot👷CopilotMetricsForEnterpriseTeamListing()->call($enterprise, $teamSlug, $since, $until, $page, $perPage); @@ -109,13 +109,13 @@ public function cancelCopilotSeatAssignmentForUsers(string $org, array $params): return $this->operators->copilot👷CancelCopilotSeatAssignmentForUsers()->call($org, $params); } - /** @return iterable */ + /** @return Observable */ public function copilotMetricsForOrganization(string $org, string $since, string $until, int $page, int $perPage): iterable { return $this->operators->copilot👷CopilotMetricsForOrganization()->call($org, $since, $until, $page, $perPage); } - /** @return iterable */ + /** @return Observable */ public function copilotMetricsForOrganizationListing(string $org, string $since, string $until, int $page, int $perPage): iterable { return $this->operators->copilot👷CopilotMetricsForOrganizationListing()->call($org, $since, $until, $page, $perPage); @@ -139,13 +139,13 @@ public function getCopilotSeatDetailsForUser(string $org, string $username): Cop return $this->operators->copilot👷GetCopilotSeatDetailsForUser()->call($org, $username); } - /** @return iterable */ + /** @return Observable */ public function copilotMetricsForTeam(string $org, string $teamSlug, string $since, string $until, int $page, int $perPage): iterable { return $this->operators->copilot👷CopilotMetricsForTeam()->call($org, $teamSlug, $since, $until, $page, $perPage); } - /** @return iterable */ + /** @return Observable */ public function copilotMetricsForTeamListing(string $org, string $teamSlug, string $since, string $until, int $page, int $perPage): iterable { return $this->operators->copilot👷CopilotMetricsForTeamListing()->call($org, $teamSlug, $since, $until, $page, $perPage); diff --git a/clients/GitHub/src/PHPStan/ClientCallReturnTypes.php b/clients/GitHub/src/PHPStan/ClientCallReturnTypes.php index cfe868fdd18..3e3300fb39d 100644 --- a/clients/GitHub/src/PHPStan/ClientCallReturnTypes.php +++ b/clients/GitHub/src/PHPStan/ClientCallReturnTypes.php @@ -196,11 +196,11 @@ public function getTypeFromMethodCall(MethodReflection $methodReflection, Method } if ($call === 'GET /enterprises/{enterprise}/copilot/metrics') { - return $this->typeResolver->resolve('iterable'); + return $this->typeResolver->resolve('Observable'); } if ($call === 'LIST /enterprises/{enterprise}/copilot/metrics') { - return $this->typeResolver->resolve('iterable'); + return $this->typeResolver->resolve('Observable'); } if ($call === 'GET /enterprises/{enterprise}/copilot/usage') { @@ -220,11 +220,11 @@ public function getTypeFromMethodCall(MethodReflection $methodReflection, Method } if ($call === 'GET /enterprises/{enterprise}/team/{team_slug}/copilot/metrics') { - return $this->typeResolver->resolve('iterable'); + return $this->typeResolver->resolve('Observable'); } if ($call === 'LIST /enterprises/{enterprise}/team/{team_slug}/copilot/metrics') { - return $this->typeResolver->resolve('iterable'); + return $this->typeResolver->resolve('Observable'); } if ($call === 'GET /enterprises/{enterprise}/team/{team_slug}/copilot/usage') { @@ -876,11 +876,11 @@ public function getTypeFromMethodCall(MethodReflection $methodReflection, Method } if ($call === 'GET /orgs/{org}/copilot/metrics') { - return $this->typeResolver->resolve('iterable'); + return $this->typeResolver->resolve('Observable'); } if ($call === 'LIST /orgs/{org}/copilot/metrics') { - return $this->typeResolver->resolve('iterable'); + return $this->typeResolver->resolve('Observable'); } if ($call === 'GET /orgs/{org}/copilot/usage') { @@ -1436,11 +1436,11 @@ public function getTypeFromMethodCall(MethodReflection $methodReflection, Method } if ($call === 'GET /orgs/{org}/team/{team_slug}/copilot/metrics') { - return $this->typeResolver->resolve('iterable'); + return $this->typeResolver->resolve('Observable'); } if ($call === 'LIST /orgs/{org}/team/{team_slug}/copilot/metrics') { - return $this->typeResolver->resolve('iterable'); + return $this->typeResolver->resolve('Observable'); } if ($call === 'GET /orgs/{org}/team/{team_slug}/copilot/usage') { @@ -2335,6 +2335,10 @@ public function getTypeFromMethodCall(MethodReflection $methodReflection, Method return $this->typeResolver->resolve(''); } + if ($call === 'DELETE /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}') { + return $this->typeResolver->resolve('\\ApiClients\\Tools\\OpenApiClient\\Utils\\Response\\WithoutBody'); + } + if ($call === 'POST /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses') { return $this->typeResolver->resolve(''); } diff --git a/clients/GitHub/tests/Internal/Operation/CodeScanning/DeleteCodeqlDatabaseTest.php b/clients/GitHub/tests/Internal/Operation/CodeScanning/DeleteCodeqlDatabaseTest.php new file mode 100644 index 00000000000..32a52ab97b2 --- /dev/null +++ b/clients/GitHub/tests/Internal/Operation/CodeScanning/DeleteCodeqlDatabaseTest.php @@ -0,0 +1,167 @@ + '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('DELETE', '/repos/generated/generated/code-scanning/codeql/databases/generated', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->call(Internal\Operation\CodeScanning\DeleteCodeqlDatabase::OPERATION_MATCH, (static function (array $data): array { + $data['owner'] = 'generated'; + $data['repo'] = 'generated'; + $data['language'] = 'generated'; + + return $data; + })([])); + } + + /** @test */ + public function operations_httpCode_403_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\BasicError::class); + $response = new Response(403, ['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('DELETE', '/repos/generated/generated/code-scanning/codeql/databases/generated', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->codeScanning()->deleteCodeqlDatabase('generated', 'generated', 'generated'); + } + + /** @test */ + public function call_httpCode_404_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\BasicError::class); + $response = new Response(404, ['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('DELETE', '/repos/generated/generated/code-scanning/codeql/databases/generated', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->call(Internal\Operation\CodeScanning\DeleteCodeqlDatabase::OPERATION_MATCH, (static function (array $data): array { + $data['owner'] = 'generated'; + $data['repo'] = 'generated'; + $data['language'] = 'generated'; + + return $data; + })([])); + } + + /** @test */ + public function operations_httpCode_404_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\BasicError::class); + $response = new Response(404, ['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('DELETE', '/repos/generated/generated/code-scanning/codeql/databases/generated', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->codeScanning()->deleteCodeqlDatabase('generated', 'generated', 'generated'); + } + + /** @test */ + public function call_httpCode_503_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\Operations\SecretScanning\ListAlertsForEnterprise\Response\ApplicationJson\ServiceUnavailable::class); + $response = new Response(503, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\Operations\SecretScanning\ListAlertsForEnterprise\Response\ApplicationJson\ServiceUnavailable::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('DELETE', '/repos/generated/generated/code-scanning/codeql/databases/generated', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->call(Internal\Operation\CodeScanning\DeleteCodeqlDatabase::OPERATION_MATCH, (static function (array $data): array { + $data['owner'] = 'generated'; + $data['repo'] = 'generated'; + $data['language'] = 'generated'; + + return $data; + })([])); + } + + /** @test */ + public function operations_httpCode_503_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\Operations\SecretScanning\ListAlertsForEnterprise\Response\ApplicationJson\ServiceUnavailable::class); + $response = new Response(503, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\Operations\SecretScanning\ListAlertsForEnterprise\Response\ApplicationJson\ServiceUnavailable::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('DELETE', '/repos/generated/generated/code-scanning/codeql/databases/generated', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->codeScanning()->deleteCodeqlDatabase('generated', 'generated', 'generated'); + } + + /** @test */ + public function call_httpCode_204_empty(): void + { + $response = new Response(204, []); + $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('DELETE', '/repos/generated/generated/code-scanning/codeql/databases/generated', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->call(Internal\Operation\CodeScanning\DeleteCodeqlDatabase::OPERATION_MATCH, (static function (array $data): array { + $data['owner'] = 'generated'; + $data['repo'] = 'generated'; + $data['language'] = 'generated'; + + return $data; + })([])); + } + + /** @test */ + public function operations_httpCode_204_empty(): void + { + $response = new Response(204, []); + $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('DELETE', '/repos/generated/generated/code-scanning/codeql/databases/generated', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->codeScanning()->deleteCodeqlDatabase('generated', 'generated', 'generated'); + self::assertArrayHasKey('code', $result); + self::assertSame(204, $result['code']); + } +} diff --git a/clients/GitHub/tests/Types/ClientCallReturnTypes.php b/clients/GitHub/tests/Types/ClientCallReturnTypes.php index 1fbd658ff25..fe1726270f7 100644 --- a/clients/GitHub/tests/Types/ClientCallReturnTypes.php +++ b/clients/GitHub/tests/Types/ClientCallReturnTypes.php @@ -55,14 +55,14 @@ function authHeader(): string assertType('', $client->call('GET /codes_of_conduct/{key}')); assertType('', $client->call('GET /emojis')); assertType('', $client->call('GET /enterprises/{enterprise}/copilot/billing/seats')); -assertType('iterable', $client->call('GET /enterprises/{enterprise}/copilot/metrics')); -assertType('iterable', $client->call('LIST /enterprises/{enterprise}/copilot/metrics')); +assertType('Observable', $client->call('GET /enterprises/{enterprise}/copilot/metrics')); +assertType('Observable', $client->call('LIST /enterprises/{enterprise}/copilot/metrics')); assertType('Observable', $client->call('GET /enterprises/{enterprise}/copilot/usage')); assertType('Observable', $client->call('LIST /enterprises/{enterprise}/copilot/usage')); 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}/team/{team_slug}/copilot/metrics')); -assertType('iterable', $client->call('LIST /enterprises/{enterprise}/team/{team_slug}/copilot/metrics')); +assertType('Observable', $client->call('GET /enterprises/{enterprise}/team/{team_slug}/copilot/metrics')); +assertType('Observable', $client->call('LIST /enterprises/{enterprise}/team/{team_slug}/copilot/metrics')); assertType('Observable', $client->call('GET /enterprises/{enterprise}/team/{team_slug}/copilot/usage')); assertType('Observable', $client->call('LIST /enterprises/{enterprise}/team/{team_slug}/copilot/usage')); assertType('Observable|WithoutBody', $client->call('GET /events')); @@ -225,8 +225,8 @@ function authHeader(): string assertType('', $client->call('DELETE /orgs/{org}/copilot/billing/selected_teams')); assertType('', $client->call('POST /orgs/{org}/copilot/billing/selected_users')); assertType('', $client->call('DELETE /orgs/{org}/copilot/billing/selected_users')); -assertType('iterable', $client->call('GET /orgs/{org}/copilot/metrics')); -assertType('iterable', $client->call('LIST /orgs/{org}/copilot/metrics')); +assertType('Observable', $client->call('GET /orgs/{org}/copilot/metrics')); +assertType('Observable', $client->call('LIST /orgs/{org}/copilot/metrics')); assertType('Observable', $client->call('GET /orgs/{org}/copilot/usage')); assertType('Observable', $client->call('LIST /orgs/{org}/copilot/usage')); assertType('Observable|WithoutBody', $client->call('GET /orgs/{org}/dependabot/alerts')); @@ -365,8 +365,8 @@ function authHeader(): string assertType('', $client->call('GET /orgs/{org}/settings/billing/actions')); assertType('', $client->call('GET /orgs/{org}/settings/billing/packages')); assertType('', $client->call('GET /orgs/{org}/settings/billing/shared-storage')); -assertType('iterable', $client->call('GET /orgs/{org}/team/{team_slug}/copilot/metrics')); -assertType('iterable', $client->call('LIST /orgs/{org}/team/{team_slug}/copilot/metrics')); +assertType('Observable', $client->call('GET /orgs/{org}/team/{team_slug}/copilot/metrics')); +assertType('Observable', $client->call('LIST /orgs/{org}/team/{team_slug}/copilot/metrics')); assertType('Observable', $client->call('GET /orgs/{org}/team/{team_slug}/copilot/usage')); assertType('Observable', $client->call('LIST /orgs/{org}/team/{team_slug}/copilot/usage')); assertType('Observable', $client->call('GET /orgs/{org}/teams')); @@ -590,6 +590,7 @@ function authHeader(): string assertType('', $client->call('DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}')); assertType('Observable', $client->call('GET /repos/{owner}/{repo}/code-scanning/codeql/databases')); assertType('', $client->call('GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}')); +assertType('\\ApiClients\\Tools\\OpenApiClient\\Utils\\Response\\WithoutBody', $client->call('DELETE /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}')); assertType('', $client->call('POST /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses')); assertType('', $client->call('GET /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses/{codeql_variant_analysis_id}')); assertType('', $client->call('GET /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses/{codeql_variant_analysis_id}/repos/{repo_owner}/{repo_name}')); diff --git a/etc/specs/GitHub/current.spec.yaml b/etc/specs/GitHub/current.spec.yaml index 8f4e76c4229..749fd4fd1f5 100644 --- a/etc/specs/GitHub/current.spec.yaml +++ b/etc/specs/GitHub/current.spec.yaml @@ -24208,7 +24208,7 @@ paths: description: |- Lists the CodeQL databases that are available in a repository. - OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. + OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. tags: - code-scanning operationId: code-scanning/list-codeql-databases @@ -24254,7 +24254,7 @@ paths: your HTTP client is configured to follow redirects or use the `Location` header to make a second request to get the redirect URL. - OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. + OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. tags: - code-scanning operationId: code-scanning/get-codeql-database @@ -24294,6 +24294,42 @@ paths: previews: [] category: code-scanning subcategory: code-scanning + delete: + summary: Delete a CodeQL database + description: |- + Deletes a CodeQL database for a language in a repository. + + OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. + tags: + - code-scanning + operationId: code-scanning/delete-codeql-database + externalDocs: + description: API method documentation + url: https://docs.github.com/rest/code-scanning/code-scanning#delete-a-codeql-database + parameters: + - "$ref": "#/components/parameters/owner" + - "$ref": "#/components/parameters/repo" + - name: language + in: path + description: The language of the CodeQL database. + schema: + type: string + required: true + responses: + '204': + description: Response + '403': + "$ref": "#/components/responses/code_scanning_forbidden_write" + '404': + "$ref": "#/components/responses/not_found" + '503': + "$ref": "#/components/responses/service_unavailable" + x-github: + githubCloudOnly: false + enabledForGitHubApps: true + previews: [] + category: code-scanning + subcategory: code-scanning "/repos/{owner}/{repo}/code-scanning/codeql/variant-analyses": post: summary: Create a CodeQL variant analysis