Skip to content

[GitHub] Update to 1.1.4-5758ce6a93c789209abf3a01ab532091 from 1.1.4-4befd63c20b175c975d8d0d17534c658 #1336

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions clients/GitHub/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
58 changes: 35 additions & 23 deletions clients/GitHub/etc/openapi-client-generator.state
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"specHash": "4befd63c20b175c975d8d0d17534c658",
"specHash": "5758ce6a93c789209abf3a01ab532091",
"generatedFiles": {
"files": [
{
Expand Down Expand Up @@ -5572,7 +5572,7 @@
},
{
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Operation\/CodeScanning.php",
"hash": "74a5460ad4d26c7340b86cb11329899d"
"hash": "b44a19071df22912d5b1612756134a44"
},
{
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Operation\/Codespaces.php",
Expand Down Expand Up @@ -11632,7 +11632,7 @@
},
{
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Operation\/Copilot.php",
"hash": "6ade6b422ebb9bea2565934472391a0c"
"hash": "6688825af95a583a9a52e8a4d4cd4366"
},
{
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/CheckAutomatedSecurityFixes.php",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -24872,15 +24872,15 @@
},
{
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Five.php",
"hash": "a59507c14867ec757a540569fd6b2046"
"hash": "1ce432fd322550bce04d7db17e97a08e"
},
{
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Six.php",
"hash": "b53d08b40a82186d3b569bde679af197"
},
{
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Seven.php",
"hash": "7dcff0ea5a9034872b56f76ab8678ef0"
"hash": "cdab06537a7f98fdf3c5ed86ada2f5f4"
},
{
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Eight.php",
Expand Down Expand Up @@ -24976,15 +24976,15 @@
},
{
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/List\/Five.php",
"hash": "37adf0b0c605ed4b34da57553d40612a"
"hash": "123f6a936ba8096442dac832830411c2"
},
{
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/List\/Six.php",
"hash": "308c392e37c1750ea31302f83f39951f"
},
{
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/List\/Seven.php",
"hash": "c955792e85ba9471e9a8eca2796c599b"
"hash": "d2b285c7b7a3494366fd113b6d5c5ac5"
},
{
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/List\/Eight.php",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -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"
}
]
},
Expand All @@ -30832,7 +30844,7 @@
},
{
"name": "..\/..\/composer.lock",
"hash": "9ed7ffbea5b997bda1a2ac835aa0787b"
"hash": "57a58662b6da9a7cae285c7edb32d15d"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
<?php

declare(strict_types=1);

namespace ApiClients\Client\GitHub\Internal\Operation\CodeScanning;

use ApiClients\Client\GitHub\Error as ErrorSchemas;
use ApiClients\Client\GitHub\Internal;
use ApiClients\Client\GitHub\Schema;
use ApiClients\Tools\OpenApiClient\Utils\Response\WithoutBody;
use cebe\openapi\Reader;
use League\OpenAPIValidation\Schema\SchemaValidator;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
use RingCentral\Psr7\Request;
use RuntimeException;

use function explode;
use function json_decode;
use function str_replace;

final class DeleteCodeqlDatabase
{
public const OPERATION_ID = 'code-scanning/delete-codeql-database';
public const OPERATION_MATCH = 'DELETE /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}';
/**The account owner of the repository. The name is not case sensitive. **/
private string $owner;
/**The name of the repository without the `.git` extension. The name is not case sensitive. **/
private string $repo;
/**The language of the CodeQL database. **/
private string $language;

public function __construct(private readonly SchemaValidator $responseSchemaValidator, private readonly Internal\Hydrator\Operation\Repos\Owner\Repo\CodeScanning\Codeql\Databases\Language $hydrator, string $owner, string $repo, string $language)
{
$this->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');
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php

declare(strict_types=1);

namespace ApiClients\Client\GitHub\Internal\Operator\CodeScanning;

use ApiClients\Client\GitHub\Internal;
use ApiClients\Contracts\HTTP\Headers\AuthenticationInterface;
use ApiClients\Tools\OpenApiClient\Utils\Response\WithoutBody;
use League\OpenAPIValidation\Schema\SchemaValidator;
use Psr\Http\Message\ResponseInterface;
use React\Http\Browser;
use Rx\Observable;

use function React\Async\await;
use function WyriHaximus\React\awaitObservable;

final readonly class DeleteCodeqlDatabase
{
public const OPERATION_ID = 'code-scanning/delete-codeql-database';
public const OPERATION_MATCH = 'DELETE /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}';

public function __construct(private Browser $browser, private AuthenticationInterface $authentication, private SchemaValidator $responseSchemaValidator, private Internal\Hydrator\Operation\Repos\Owner\Repo\CodeScanning\Codeql\Databases\Language $hydrator)
{
}

public function call(string $owner, string $repo, string $language): WithoutBody
{
$operation = new \ApiClients\Client\GitHub\Internal\Operation\CodeScanning\DeleteCodeqlDatabase($this->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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function __construct(private Browser $browser, private AuthenticationInte
{
}

/** @return iterable<int,Schema\CopilotUsageMetricsDay> */
/** @return Observable<Schema\CopilotUsageMetricsDay> */
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);
Expand Down
Loading
Loading