diff --git a/clients/GitHubEnterpriseCloud/README.md b/clients/GitHubEnterpriseCloud/README.md index c37d966a5e6..f23b841c083 100644 --- a/clients/GitHubEnterpriseCloud/README.md +++ b/clients/GitHubEnterpriseCloud/README.md @@ -15957,6 +15957,30 @@ $client->operations()->codeScanning()->getCodeqlDatabase( owner: 'generat You can find more about this operation over at the [API method documentation](https://docs.github.com/enterprise-cloud@latest//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/enterprise-cloud@latest//rest/code-scanning/code-scanning#delete-a-codeql-database). + + ### code-scanning/create-variant-analysis Create a CodeQL variant analysis diff --git a/clients/GitHubEnterpriseCloud/etc/openapi-client-generator.state b/clients/GitHubEnterpriseCloud/etc/openapi-client-generator.state index 01664858008..972ad7cd102 100644 --- a/clients/GitHubEnterpriseCloud/etc/openapi-client-generator.state +++ b/clients/GitHubEnterpriseCloud/etc/openapi-client-generator.state @@ -1,5 +1,5 @@ { - "specHash": "fedf0d71c08f1b559e2c2e12a07bcb84", + "specHash": "09be262377cbbbe8917c66c1d01da07c", "generatedFiles": { "files": [ { @@ -5892,7 +5892,7 @@ }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Operation\/CodeScanning.php", - "hash": "0384545e7e1b3f73b106042d267eed72" + "hash": "58601a484d7de1bf91de1604bb929066" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Operation\/SecretScanning.php", @@ -12104,7 +12104,7 @@ }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Operation\/Copilot.php", - "hash": "aed1e41f26356ebb08a5216efc0238fa" + "hash": "b9c6a45bbe925c6bcebdcd125c897ad2" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Schema\/CheckAutomatedSecurityFixes.php", @@ -26072,7 +26072,7 @@ }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Copilot.php", - "hash": "460d6fd9d96b86c5d5b9b4741898de53" + "hash": "63a3be14fb1725c07a25cc70e4f31ae0" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Pulls.php", @@ -26428,7 +26428,7 @@ }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Router\/Delete\/CodeScanning.php", - "hash": "25a6bee584c6d6d516ec327c2484d4cd" + "hash": "c29d62152192087250bb531506ef865a" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Router\/Delete\/Dependabot.php", @@ -26560,7 +26560,7 @@ }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Five.php", - "hash": "185301118cc1712e30f1edfee14db654" + "hash": "32132353c07f536308f8b2a130e869a4" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Six.php", @@ -26568,7 +26568,7 @@ }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Seven.php", - "hash": "1a7c8bb261e194035b3b6c279452b4e2" + "hash": "db30d8b72a1cbd735e1336ee83f1d4ba" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Eight.php", @@ -26660,7 +26660,7 @@ }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Router\/List\/Five.php", - "hash": "1de17086c95a8637b744bd2e2fee3db5" + "hash": "381b412abe49fd76e8e7e3fabc5978d8" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Router\/List\/Two.php", @@ -26672,7 +26672,7 @@ }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Router\/List\/Seven.php", - "hash": "ce83f84d79bef7edb2a68862bc4f812d" + "hash": "bc242c26c12709c84b10be958a6843b6" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Router\/List\/Eight.php", @@ -26704,7 +26704,7 @@ }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Router\/Delete\/Eight.php", - "hash": "b3ca37b67ac3b9455789674e0de6ceb3" + "hash": "373f92e055424898f30979087e3c64d0" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Router\/Delete\/Three.php", @@ -26768,7 +26768,7 @@ }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Operators.php", - "hash": "78ce0b46035a1e1871adaaa7f4600b1e" + "hash": "b33f3f32f93232be2c2eb91b86e60b14" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Hydrator\/Operation\/Root.php", @@ -29740,11 +29740,11 @@ }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/PHPStan\/ClientCallReturnTypes.php", - "hash": "6bbcf54e3374f3804ad8abc42f0a303f" + "hash": "6dda1e3ef8dc53f142eaba92686ddb48" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/tests\/\/Types\/ClientCallReturnTypes.php", - "hash": "638af93e91b1611aaad95aee48a38294" + "hash": "34d2168ae585ead7e06e68792fbcd180" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/..\/etc\/phpstan-extension.neon", @@ -30860,7 +30860,7 @@ }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Router\/List\/Copilot.php", - "hash": "1afb0f463ab213b53f2b0c04f44fcf3a" + "hash": "a3d79de7364e415086ca20e98eaf2a8c" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Hydrator\/Operation\/Enterprises\/Enterprise\/Copilot\/Usage.php", @@ -32828,7 +32828,7 @@ }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Operator\/Copilot\/CopilotMetricsForEnterprise.php", - "hash": "cebcf4e7ae4df2dddd6180ab175a4dc4" + "hash": "296116d6e3e61e48a4640dc82a394625" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/tests\/\/Internal\/Operation\/Copilot\/CopilotMetricsForEnterpriseTest.php", @@ -32840,7 +32840,7 @@ }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Operator\/Copilot\/CopilotMetricsForEnterpriseListing.php", - "hash": "f94d06f5a4e35edd820e98e7aefbff49" + "hash": "81fc79cd5074dccab49358ce0563c6d4" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/tests\/\/Internal\/Operation\/Copilot\/CopilotMetricsForEnterpriseListingTest.php", @@ -32852,7 +32852,7 @@ }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Operator\/Copilot\/CopilotMetricsForEnterpriseTeam.php", - "hash": "8eef6e54734c220ad24a82da07b5ba66" + "hash": "9fdb29a0996180b0f56a940aa169243a" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/tests\/\/Internal\/Operation\/Copilot\/CopilotMetricsForEnterpriseTeamTest.php", @@ -32864,7 +32864,7 @@ }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Operator\/Copilot\/CopilotMetricsForEnterpriseTeamListing.php", - "hash": "dc8742055a09ba8eb7ab1f7e3e7b5bd5" + "hash": "435a346e5923b060018d79670c30f388" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/tests\/\/Internal\/Operation\/Copilot\/CopilotMetricsForEnterpriseTeamListingTest.php", @@ -32876,7 +32876,7 @@ }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Operator\/Copilot\/CopilotMetricsForOrganization.php", - "hash": "6aad600b542d0c1205369ebd803fe80e" + "hash": "02bc5e012daa638a25e4b513464f54c9" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/tests\/\/Internal\/Operation\/Copilot\/CopilotMetricsForOrganizationTest.php", @@ -32888,7 +32888,7 @@ }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Operator\/Copilot\/CopilotMetricsForOrganizationListing.php", - "hash": "d489d84b0e1cb734c4f86614bd52596e" + "hash": "1145747f159b8395ea35a8038cb873ee" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/tests\/\/Internal\/Operation\/Copilot\/CopilotMetricsForOrganizationListingTest.php", @@ -32900,7 +32900,7 @@ }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Operator\/Copilot\/CopilotMetricsForTeam.php", - "hash": "f54a280beafca10361540b4375428870" + "hash": "0d04feb1619561d536c91311f0e372df" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/tests\/\/Internal\/Operation\/Copilot\/CopilotMetricsForTeamTest.php", @@ -32912,7 +32912,7 @@ }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Operator\/Copilot\/CopilotMetricsForTeamListing.php", - "hash": "a93e85a960eecee24066d7df98972918" + "hash": "b1bb83685b01617d89c6d62c693e9689" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/tests\/\/Internal\/Operation\/Copilot\/CopilotMetricsForTeamListingTest.php", @@ -32989,6 +32989,18 @@ { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Hydrator\/Operation\/Orgs\/Org\/Team\/TeamSlug\/Copilot\/Metrics.php", "hash": "4ee33e9f889360c744665482b9bd1dcd" + }, + { + "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Operation\/CodeScanning\/DeleteCodeqlDatabase.php", + "hash": "c75769521566b6a79993f470910ab3dc" + }, + { + "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Operator\/CodeScanning\/DeleteCodeqlDatabase.php", + "hash": "71d317cae8d11785750c73ff31941116" + }, + { + "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/tests\/\/Internal\/Operation\/CodeScanning\/DeleteCodeqlDatabaseTest.php", + "hash": "9a0b1d9f6a1b6fcc12264c3b3459885e" } ] }, @@ -33008,7 +33020,7 @@ }, { "name": "..\/..\/composer.lock", - "hash": "9ed7ffbea5b997bda1a2ac835aa0787b" + "hash": "57a58662b6da9a7cae285c7edb32d15d" } ] } diff --git a/clients/GitHubEnterpriseCloud/src/Internal/Operation/CodeScanning/DeleteCodeqlDatabase.php b/clients/GitHubEnterpriseCloud/src/Internal/Operation/CodeScanning/DeleteCodeqlDatabase.php new file mode 100644 index 00000000000..7c2e3386f36 --- /dev/null +++ b/clients/GitHubEnterpriseCloud/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\CodeScanning\ListAlertsForEnterprise\Response\ApplicationJson\ServiceUnavailable::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + + throw new ErrorSchemas\Operations\CodeScanning\ListAlertsForEnterprise\Response\ApplicationJson\ServiceUnavailable(503, $this->hydrator->hydrateObject(Schema\Operations\CodeScanning\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/GitHubEnterpriseCloud/src/Internal/Operator/CodeScanning/DeleteCodeqlDatabase.php b/clients/GitHubEnterpriseCloud/src/Internal/Operator/CodeScanning/DeleteCodeqlDatabase.php new file mode 100644 index 00000000000..d2feb9f9738 --- /dev/null +++ b/clients/GitHubEnterpriseCloud/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/GitHubEnterpriseCloud/src/Internal/Operator/Copilot/CopilotMetricsForEnterprise.php b/clients/GitHubEnterpriseCloud/src/Internal/Operator/Copilot/CopilotMetricsForEnterprise.php index d4ef1df3e5e..66edf04f4b7 100644 --- a/clients/GitHubEnterpriseCloud/src/Internal/Operator/Copilot/CopilotMetricsForEnterprise.php +++ b/clients/GitHubEnterpriseCloud/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\GitHubEnterpriseCloud\Internal\Operation\Copilot\CopilotMetricsForEnterprise($this->responseSchemaValidator, $this->hydrator, $enterprise, $since, $until, $page, $perPage); diff --git a/clients/GitHubEnterpriseCloud/src/Internal/Operator/Copilot/CopilotMetricsForEnterpriseListing.php b/clients/GitHubEnterpriseCloud/src/Internal/Operator/Copilot/CopilotMetricsForEnterpriseListing.php index ecb91173ec6..b7647f09a66 100644 --- a/clients/GitHubEnterpriseCloud/src/Internal/Operator/Copilot/CopilotMetricsForEnterpriseListing.php +++ b/clients/GitHubEnterpriseCloud/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\GitHubEnterpriseCloud\Internal\Operation\Copilot\CopilotMetricsForEnterpriseListing($this->responseSchemaValidator, $this->hydrator, $enterprise, $since, $until, $page, $perPage); diff --git a/clients/GitHubEnterpriseCloud/src/Internal/Operator/Copilot/CopilotMetricsForEnterpriseTeam.php b/clients/GitHubEnterpriseCloud/src/Internal/Operator/Copilot/CopilotMetricsForEnterpriseTeam.php index 15c7c67b36e..95925490576 100644 --- a/clients/GitHubEnterpriseCloud/src/Internal/Operator/Copilot/CopilotMetricsForEnterpriseTeam.php +++ b/clients/GitHubEnterpriseCloud/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\GitHubEnterpriseCloud\Internal\Operation\Copilot\CopilotMetricsForEnterpriseTeam($this->responseSchemaValidator, $this->hydrator, $enterprise, $teamSlug, $since, $until, $page, $perPage); diff --git a/clients/GitHubEnterpriseCloud/src/Internal/Operator/Copilot/CopilotMetricsForEnterpriseTeamListing.php b/clients/GitHubEnterpriseCloud/src/Internal/Operator/Copilot/CopilotMetricsForEnterpriseTeamListing.php index d122d82d8d5..0eba51d5b20 100644 --- a/clients/GitHubEnterpriseCloud/src/Internal/Operator/Copilot/CopilotMetricsForEnterpriseTeamListing.php +++ b/clients/GitHubEnterpriseCloud/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\GitHubEnterpriseCloud\Internal\Operation\Copilot\CopilotMetricsForEnterpriseTeamListing($this->responseSchemaValidator, $this->hydrator, $enterprise, $teamSlug, $since, $until, $page, $perPage); diff --git a/clients/GitHubEnterpriseCloud/src/Internal/Operator/Copilot/CopilotMetricsForOrganization.php b/clients/GitHubEnterpriseCloud/src/Internal/Operator/Copilot/CopilotMetricsForOrganization.php index b77708f600c..bd3647fd03f 100644 --- a/clients/GitHubEnterpriseCloud/src/Internal/Operator/Copilot/CopilotMetricsForOrganization.php +++ b/clients/GitHubEnterpriseCloud/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\GitHubEnterpriseCloud\Internal\Operation\Copilot\CopilotMetricsForOrganization($this->responseSchemaValidator, $this->hydrator, $org, $since, $until, $page, $perPage); diff --git a/clients/GitHubEnterpriseCloud/src/Internal/Operator/Copilot/CopilotMetricsForOrganizationListing.php b/clients/GitHubEnterpriseCloud/src/Internal/Operator/Copilot/CopilotMetricsForOrganizationListing.php index 96dfb50f3b3..935693386b0 100644 --- a/clients/GitHubEnterpriseCloud/src/Internal/Operator/Copilot/CopilotMetricsForOrganizationListing.php +++ b/clients/GitHubEnterpriseCloud/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\GitHubEnterpriseCloud\Internal\Operation\Copilot\CopilotMetricsForOrganizationListing($this->responseSchemaValidator, $this->hydrator, $org, $since, $until, $page, $perPage); diff --git a/clients/GitHubEnterpriseCloud/src/Internal/Operator/Copilot/CopilotMetricsForTeam.php b/clients/GitHubEnterpriseCloud/src/Internal/Operator/Copilot/CopilotMetricsForTeam.php index b272748eaf8..83c29704f6f 100644 --- a/clients/GitHubEnterpriseCloud/src/Internal/Operator/Copilot/CopilotMetricsForTeam.php +++ b/clients/GitHubEnterpriseCloud/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\GitHubEnterpriseCloud\Internal\Operation\Copilot\CopilotMetricsForTeam($this->responseSchemaValidator, $this->hydrator, $org, $teamSlug, $since, $until, $page, $perPage); diff --git a/clients/GitHubEnterpriseCloud/src/Internal/Operator/Copilot/CopilotMetricsForTeamListing.php b/clients/GitHubEnterpriseCloud/src/Internal/Operator/Copilot/CopilotMetricsForTeamListing.php index 08da2465e95..40943d9b558 100644 --- a/clients/GitHubEnterpriseCloud/src/Internal/Operator/Copilot/CopilotMetricsForTeamListing.php +++ b/clients/GitHubEnterpriseCloud/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\GitHubEnterpriseCloud\Internal\Operation\Copilot\CopilotMetricsForTeamListing($this->responseSchemaValidator, $this->hydrator, $org, $teamSlug, $since, $until, $page, $perPage); diff --git a/clients/GitHubEnterpriseCloud/src/Internal/Operators.php b/clients/GitHubEnterpriseCloud/src/Internal/Operators.php index e73e7b0fec4..43d6cf05571 100644 --- a/clients/GitHubEnterpriseCloud/src/Internal/Operators.php +++ b/clients/GitHubEnterpriseCloud/src/Internal/Operators.php @@ -674,6 +674,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; @@ -7244,6 +7245,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/GitHubEnterpriseCloud/src/Internal/Router/Delete/CodeScanning.php b/clients/GitHubEnterpriseCloud/src/Internal/Router/Delete/CodeScanning.php index e4358f8b9fb..43d1419ea60 100644 --- a/clients/GitHubEnterpriseCloud/src/Internal/Router/Delete/CodeScanning.php +++ b/clients/GitHubEnterpriseCloud/src/Internal/Router/Delete/CodeScanning.php @@ -7,6 +7,7 @@ use ApiClients\Client\GitHubEnterpriseCloud\Internal; use ApiClients\Client\GitHubEnterpriseCloud\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/GitHubEnterpriseCloud/src/Internal/Router/Delete/Eight.php b/clients/GitHubEnterpriseCloud/src/Internal/Router/Delete/Eight.php index 328ceda7678..040e0c3b99a 100644 --- a/clients/GitHubEnterpriseCloud/src/Internal/Router/Delete/Eight.php +++ b/clients/GitHubEnterpriseCloud/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|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Actions\RemoveAllCustomLabelsFromSelfHostedRunnerForRepo\Response\ApplicationJson\Ok\Application\Json|iterable|BasicError|PullRequestReview { if ($pathChunks[0] === '') { @@ -225,6 +225,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/GitHubEnterpriseCloud/src/Internal/Router/Get/Copilot.php b/clients/GitHubEnterpriseCloud/src/Internal/Router/Get/Copilot.php index f5dd6c7bf1a..55dd1121ea8 100644 --- a/clients/GitHubEnterpriseCloud/src/Internal/Router/Get/Copilot.php +++ b/clients/GitHubEnterpriseCloud/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/GitHubEnterpriseCloud/src/Internal/Router/Get/Five.php b/clients/GitHubEnterpriseCloud/src/Internal/Router/Get/Five.php index 7c7557df8e9..48570b4f94c 100644 --- a/clients/GitHubEnterpriseCloud/src/Internal/Router/Get/Five.php +++ b/clients/GitHubEnterpriseCloud/src/Internal/Router/Get/Five.php @@ -55,7 +55,7 @@ public function __construct(private Routers $routers) { } - /** @return |Observable|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 */ + /** @return |Observable|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 */ public function call(string $call, array $params, array $pathChunks): HookDelivery|ActionsEnterprisePermissions|Ok|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\EnterpriseAdmin\ListSelfHostedRunnersForEnterprise\Response\ApplicationJson\Ok|iterable|WithoutBody|GistComment|MarketplacePurchase|BasicError|ThreadSubscription|ActionsOrganizationPermissions|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Actions\ListSelfHostedRunnerGroupsForOrg\Response\ApplicationJson\Ok|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Actions\ListSelfHostedRunnersForOrg\Response\ApplicationJson\Ok|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Actions\ListOrgSecrets\Response\ApplicationJson\Ok|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Actions\ListOrgVariables\Response\ApplicationJson\Ok|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Orgs\ListAttestations\Response\ApplicationJson\Ok|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Codespaces\ListOrgSecrets\Response\ApplicationJson\Ok|CopilotOrganizationDetails|OrganizationCustomRepositoryRole|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Dependabot\ListOrgSecrets\Response\ApplicationJson\Ok|ExternalGroup|OrgHook|OrgMembership|Migration|OrganizationRole|RepositoryRuleset|GroupMapping|TeamFull|ProjectCard|CheckAutomatedSecurityFixes|CodeSecurityConfigurationForRepository|Json|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Repos\GetAllEnvironments\Response\ApplicationJson\Ok|Import|Installation|InteractionLimitResponse|One|Language|LicenseContent|Page|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Repos\CheckPrivateVulnerabilityReporting\Response\ApplicationJson\Ok|ContentFile|SimpleUser|Stargazer|RepositorySubscription|Topic|TeamDiscussion|TeamMembership|TeamProject|CodespacesUserPublicKey|CodespacesSecret|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Codespaces\CodespaceMachinesForAuthenticatedUser\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Apps\ListInstallationReposForAuthenticatedUser\Response\ApplicationJson\Ok|Package|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Users\ListAttestations\Response\ApplicationJson\Ok|EmptyObject { if ($pathChunks[0] === '') { diff --git a/clients/GitHubEnterpriseCloud/src/Internal/Router/Get/Seven.php b/clients/GitHubEnterpriseCloud/src/Internal/Router/Get/Seven.php index 4df41800bb8..44d5c55d679 100644 --- a/clients/GitHubEnterpriseCloud/src/Internal/Router/Get/Seven.php +++ b/clients/GitHubEnterpriseCloud/src/Internal/Router/Get/Seven.php @@ -67,7 +67,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): Json|Ok|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\EnterpriseAdmin\ListLabelsForSelfHostedRunnerForEnterprise\Response\ApplicationJson\Ok|iterable|OidcCustomSub|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Actions\ListRepoAccessToSelfHostedRunnerGroupInOrg\Response\ApplicationJson\Ok|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Actions\ListSelfHostedRunnersInGroupForOrg\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Actions\ListSelectedReposForOrgSecret\Response\ApplicationJson\Ok|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Actions\ListSelectedReposForOrgVariable\Response\ApplicationJson\Ok\Application\Json|WithoutBody|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Codespaces\ListSelectedReposForOrgSecret\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Dependabot\ListSelectedReposForOrgSecret\Response\ApplicationJson\Ok\Application\Json|HookDelivery|TeamDiscussion|TeamMembership|TeamProject|GroupMapping|Artifact|ActionsCacheUsageByRepository|Job|ActionsWorkflowAccessToRepository|SelectedActions|ActionsGetDefaultWorkflowPermissions|Runner|WorkflowRun|ActionsPublicKey|ActionsSecret|ActionsVariable|Workflow|BranchProtection|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Checks\ListForSuite\Response\ApplicationJson\Ok|CodeScanningAlert|CodeScanningAnalysis|CodeScanningSarifsStatus|CodespacesPublicKey|RepoCodespacesSecret|RepositoryCollaboratorPermission|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Checks\ListForRef\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Checks\ListSuitesForRef\Response\ApplicationJson\Ok|CombinedCommitStatus|BasicError|DependabotAlert|DependabotPublicKey|DependabotSecret|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Repos\ListDeploymentBranchPolicies\Response\ApplicationJson\Ok|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Repos\GetAllDeploymentProtectionRules\Response\ApplicationJson\Ok|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Actions\ListEnvironmentSecrets\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHubEnterpriseCloud\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|GroupResponse|UserResponse|ScimUser|TeamDiscussionComment|PackageVersion { if ($pathChunks[0] === '') { diff --git a/clients/GitHubEnterpriseCloud/src/Internal/Router/List/Copilot.php b/clients/GitHubEnterpriseCloud/src/Internal/Router/List/Copilot.php index 89286b8b4ba..1870106dcc8 100644 --- a/clients/GitHubEnterpriseCloud/src/Internal/Router/List/Copilot.php +++ b/clients/GitHubEnterpriseCloud/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/GitHubEnterpriseCloud/src/Internal/Router/List/Five.php b/clients/GitHubEnterpriseCloud/src/Internal/Router/List/Five.php index af6fc356b2d..83c51755a6d 100644 --- a/clients/GitHubEnterpriseCloud/src/Internal/Router/List/Five.php +++ b/clients/GitHubEnterpriseCloud/src/Internal/Router/List/Five.php @@ -16,7 +16,7 @@ public function __construct(private Routers $routers) { } - /** @return Observable|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 */ + /** @return Observable|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 */ public function call(string $call, array $params, array $pathChunks): iterable|BasicError|WithoutBody { if ($pathChunks[0] === '') { diff --git a/clients/GitHubEnterpriseCloud/src/Internal/Router/List/Seven.php b/clients/GitHubEnterpriseCloud/src/Internal/Router/List/Seven.php index 980c20f3d1c..f4e18d5aeec 100644 --- a/clients/GitHubEnterpriseCloud/src/Internal/Router/List/Seven.php +++ b/clients/GitHubEnterpriseCloud/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/GitHubEnterpriseCloud/src/Operation/CodeScanning.php b/clients/GitHubEnterpriseCloud/src/Operation/CodeScanning.php index 5bc06297420..6c41b6af0f0 100644 --- a/clients/GitHubEnterpriseCloud/src/Operation/CodeScanning.php +++ b/clients/GitHubEnterpriseCloud/src/Operation/CodeScanning.php @@ -121,6 +121,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/GitHubEnterpriseCloud/src/Operation/Copilot.php b/clients/GitHubEnterpriseCloud/src/Operation/Copilot.php index 6d8199019e5..3e06aa84389 100644 --- a/clients/GitHubEnterpriseCloud/src/Operation/Copilot.php +++ b/clients/GitHubEnterpriseCloud/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/GitHubEnterpriseCloud/src/PHPStan/ClientCallReturnTypes.php b/clients/GitHubEnterpriseCloud/src/PHPStan/ClientCallReturnTypes.php index cbcd5d9c475..e1de91c1507 100644 --- a/clients/GitHubEnterpriseCloud/src/PHPStan/ClientCallReturnTypes.php +++ b/clients/GitHubEnterpriseCloud/src/PHPStan/ClientCallReturnTypes.php @@ -388,11 +388,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') { @@ -448,11 +448,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') { @@ -1128,11 +1128,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') { @@ -1776,11 +1776,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') { @@ -2695,6 +2695,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/GitHubEnterpriseCloud/tests/Internal/Operation/CodeScanning/DeleteCodeqlDatabaseTest.php b/clients/GitHubEnterpriseCloud/tests/Internal/Operation/CodeScanning/DeleteCodeqlDatabaseTest.php new file mode 100644 index 00000000000..3fa0e04f11e --- /dev/null +++ b/clients/GitHubEnterpriseCloud/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\CodeScanning\ListAlertsForEnterprise\Response\ApplicationJson\ServiceUnavailable::class); + $response = new Response(503, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\Operations\CodeScanning\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\CodeScanning\ListAlertsForEnterprise\Response\ApplicationJson\ServiceUnavailable::class); + $response = new Response(503, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\Operations\CodeScanning\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/GitHubEnterpriseCloud/tests/Types/ClientCallReturnTypes.php b/clients/GitHubEnterpriseCloud/tests/Types/ClientCallReturnTypes.php index 4a669d865a4..f5c753a2c75 100644 --- a/clients/GitHubEnterpriseCloud/tests/Types/ClientCallReturnTypes.php +++ b/clients/GitHubEnterpriseCloud/tests/Types/ClientCallReturnTypes.php @@ -103,8 +103,8 @@ function authHeader(): string assertType('', $client->call('PATCH /enterprises/{enterprise}/code_security_and_analysis')); assertType('', $client->call('GET /enterprises/{enterprise}/consumed-licenses')); 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')); @@ -118,8 +118,8 @@ function authHeader(): string assertType('', $client->call('GET /enterprises/{enterprise}/settings/billing/packages')); assertType('', $client->call('GET /enterprises/{enterprise}/settings/billing/shared-storage')); assertType('', $client->call('GET /enterprises/{enterprise}/settings/billing/usage')); -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('', $client->call('POST /enterprises/{enterprise}/{security_product}/{enablement}')); @@ -288,8 +288,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', $client->call('GET /orgs/{org}/credential-authorizations')); @@ -450,8 +450,8 @@ function authHeader(): string assertType('', $client->call('GET /orgs/{org}/settings/billing/packages')); assertType('', $client->call('GET /orgs/{org}/settings/billing/shared-storage')); assertType('', $client->call('GET /orgs/{org}/team-sync/groups')); -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')); @@ -680,6 +680,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/GitHubEnterpriseCloud/current.spec.yaml b/etc/specs/GitHubEnterpriseCloud/current.spec.yaml index ca58aab60db..9c505a5bc56 100644 --- a/etc/specs/GitHubEnterpriseCloud/current.spec.yaml +++ b/etc/specs/GitHubEnterpriseCloud/current.spec.yaml @@ -27743,7 +27743,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 @@ -27789,7 +27789,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 @@ -27829,6 +27829,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/enterprise-cloud@latest//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