Skip to content

[GitHubEnterprise-3.13] Update to 1.1.4-ffac604ed0c1f24261dd953b32c2fba3 from 1.1.4-802a0cd5a04204e42ef5ea0492e36a70 #1553

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
32 changes: 18 additions & 14 deletions clients/GitHubEnterprise-3.13/etc/openapi-client-generator.state
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"specHash": "802a0cd5a04204e42ef5ea0492e36a70",
"specHash": "ffac604ed0c1f24261dd953b32c2fba3",
"generatedFiles": {
"files": [
{
Expand Down Expand Up @@ -6948,15 +6948,15 @@
},
{
"name": ".\/clients\/GitHubEnterprise-3.13\/etc\/..\/\/src\/\/Internal\/Operation\/CodeScanning\/UpdateAlert.php",
"hash": "4414595983724d58e1cdf5c09e8f409f"
"hash": "b7b8c2aaaf47299f09adbb2b88b5daf5"
},
{
"name": ".\/clients\/GitHubEnterprise-3.13\/etc\/..\/\/src\/\/Internal\/Operator\/CodeScanning\/UpdateAlert.php",
"hash": "0d58379475f7ab773df9ae4b3b7d84c5"
"hash": "fd3b96fa7070fd31d1490b2ae4861c54"
},
{
"name": ".\/clients\/GitHubEnterprise-3.13\/etc\/..\/\/tests\/\/Internal\/Operation\/CodeScanning\/UpdateAlertTest.php",
"hash": "5e18056057b185cf3a4348a8b97f093c"
"hash": "78119db7046be60d7d867ad3af28c6fa"
},
{
"name": ".\/clients\/GitHubEnterprise-3.13\/etc\/..\/\/src\/\/Internal\/Operation\/CodeScanning\/ListAlertInstances.php",
Expand Down Expand Up @@ -25776,7 +25776,7 @@
},
{
"name": ".\/clients\/GitHubEnterprise-3.13\/etc\/..\/\/src\/\/Schema\/CodeScanning\/UpdateAlert\/Request\/ApplicationJson.php",
"hash": "ffbb63d8bfc655b760e73bb0a84b41b7"
"hash": "ef09173d8d817efd8e1e4e81d9f0edcc"
},
{
"name": ".\/clients\/GitHubEnterprise-3.13\/etc\/..\/\/src\/\/Schema\/CodeScanning\/UploadSarif\/Request\/ApplicationJson.php",
Expand Down Expand Up @@ -26812,7 +26812,7 @@
},
{
"name": ".\/clients\/GitHubEnterprise-3.13\/etc\/..\/\/src\/\/Internal\/Router\/Patch\/CodeScanning.php",
"hash": "f4eded73dbc98d19cc03cd2545bc0a44"
"hash": "b169946b91470cd53c5ec292b35ad780"
},
{
"name": ".\/clients\/GitHubEnterprise-3.13\/etc\/..\/\/src\/\/Internal\/Router\/Patch\/Issues.php",
Expand Down Expand Up @@ -27080,7 +27080,7 @@
},
{
"name": ".\/clients\/GitHubEnterprise-3.13\/etc\/..\/\/src\/\/Internal\/Router\/Patch\/Seven.php",
"hash": "619ee85831f1ccf3b4aa9570bc701fb6"
"hash": "e6af182f8222fb648cfc3c789507197c"
},
{
"name": ".\/clients\/GitHubEnterprise-3.13\/etc\/..\/\/src\/\/Internal\/Router\/Patch\/Nine.php",
Expand Down Expand Up @@ -27144,11 +27144,11 @@
},
{
"name": ".\/clients\/GitHubEnterprise-3.13\/etc\/..\/\/src\/\/PHPStan\/ClientCallReturnTypes.php",
"hash": "2fb5474325448bccbcb22bb7d1158ea1"
"hash": "6e5907cbb91f9f456405e81c70a308bb"
},
{
"name": ".\/clients\/GitHubEnterprise-3.13\/etc\/..\/\/tests\/\/Types\/ClientCallReturnTypes.php",
"hash": "54beea339c8099994a522e19c9c55b8c"
"hash": "5b04e61e38fb830021cb4372f584f019"
},
{
"name": ".\/clients\/GitHubEnterprise-3.13\/etc\/..\/\/src\/\/..\/etc\/phpstan-extension.neon",
Expand All @@ -27160,7 +27160,7 @@
},
{
"name": ".\/clients\/GitHubEnterprise-3.13\/etc\/..\/\/src\/\/Operation\/Meta.php",
"hash": "efb7434a503625c23355172c4638e6bb"
"hash": "41cc72ff89d01e5b48be965d9a5b63fd"
},
{
"name": ".\/clients\/GitHubEnterprise-3.13\/etc\/..\/\/src\/\/Operation\/EnterpriseAdmin.php",
Expand Down Expand Up @@ -27192,7 +27192,7 @@
},
{
"name": ".\/clients\/GitHubEnterprise-3.13\/etc\/..\/\/src\/\/Operation\/CodeScanning.php",
"hash": "035196723d9518e17e7f016fa71af9c8"
"hash": "254f6e3c029935a79e15b051e78e67ba"
},
{
"name": ".\/clients\/GitHubEnterprise-3.13\/etc\/..\/\/src\/\/Operation\/SecretScanning.php",
Expand Down Expand Up @@ -27276,7 +27276,7 @@
},
{
"name": ".\/clients\/GitHubEnterprise-3.13\/etc\/..\/\/src\/\/Operation\/DependencyGraph.php",
"hash": "a69f445c74c4b7b7c28abe4e750cc769"
"hash": "a638452f9411a0fc738141835c32327d"
},
{
"name": ".\/clients\/GitHubEnterprise-3.13\/etc\/..\/\/src\/\/Operation\/Git.php",
Expand All @@ -27288,7 +27288,7 @@
},
{
"name": ".\/clients\/GitHubEnterprise-3.13\/etc\/..\/\/src\/\/Operation\/Search.php",
"hash": "6e92f41ff9de1bd3067e80b3f3da380d"
"hash": "522fda33c8ae6024675365cb3775c1f1"
},
{
"name": ".\/clients\/GitHubEnterprise-3.13\/etc\/..\/\/src\/\/Operation\/Users.php",
Expand Down Expand Up @@ -28716,7 +28716,7 @@
},
{
"name": ".\/clients\/GitHubEnterprise-3.13\/etc\/..\/\/src\/\/Internal\/Hydrator\/Operation\/Repos\/Owner\/Repo\/CodeScanning\/Alerts\/AlertNumber.php",
"hash": "b9452bc32629313c2650579a65f77f38"
"hash": "a926bd101b56e9d2fa2d26b4ba0ef2d2"
},
{
"name": ".\/clients\/GitHubEnterprise-3.13\/etc\/..\/\/src\/\/Internal\/Hydrator\/Operation\/Repos\/Owner\/Repo\/CodeScanning\/Alerts\/AlertNumber\/Instances.php",
Expand Down Expand Up @@ -29969,6 +29969,10 @@
{
"name": ".\/clients\/GitHubEnterprise-3.13\/etc\/..\/\/src\/\/Schema\/WebhookReleaseEdited\/Changes\/TagName.php",
"hash": "918a75e1fc3897bd242cdd1f3516cd1a"
},
{
"name": ".\/clients\/GitHubEnterprise-3.13\/etc\/..\/\/src\/\/Schema\/CodeScanningAlertCreateRequest.php",
"hash": "b1c32113d0944e1335325145d49ced03"
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use ApiClients\Client\GitHubEnterprise\Schema\CodeScanningAlertRule;
use ApiClients\Client\GitHubEnterprise\Schema\CodeScanningAnalysisTool;
use ApiClients\Client\GitHubEnterprise\Schema\Operations\CodeScanning\ListAlertsForEnterprise\Response\ApplicationJson\ServiceUnavailable;
use ApiClients\Client\GitHubEnterprise\Schema\ScimError;
use ApiClients\Client\GitHubEnterprise\Schema\SimpleUser;
use EventSauce\ObjectHydrator\IterableList;
use EventSauce\ObjectHydrator\ObjectMapper;
Expand Down Expand Up @@ -57,6 +58,7 @@ public function hydrateObject(string $className, array $payload): object
'ApiClients\Client\GitHubEnterprise\Schema\CodeScanningAlertLocation' => $this->hydrateApiClients⚡️Client⚡️GitHubEnterprise⚡️Schema⚡️CodeScanningAlertLocation($payload),
'ApiClients\Client\GitHubEnterprise\Schema\BasicError' => $this->hydrateApiClients⚡️Client⚡️GitHubEnterprise⚡️Schema⚡️BasicError($payload),
'ApiClients\Client\GitHubEnterprise\Schema\Operations\CodeScanning\ListAlertsForEnterprise\Response\ApplicationJson\ServiceUnavailable' => $this->hydrateApiClients⚡️Client⚡️GitHubEnterprise⚡️Schema⚡️Operations⚡️CodeScanning⚡️ListAlertsForEnterprise⚡️Response⚡️ApplicationJson⚡️ServiceUnavailable($payload),
'ApiClients\Client\GitHubEnterprise\Schema\ScimError' => $this->hydrateApiClients⚡️Client⚡️GitHubEnterprise⚡️Schema⚡️ScimError($payload),
default => throw UnableToHydrateObject::noHydrationDefined($className, $this->hydrationStack),
};
}
Expand Down Expand Up @@ -1098,6 +1100,91 @@ private function hydrateApiClients⚡️Client⚡️GitHubEnterprise⚡️Schema
}
}

private function hydrateApiClients⚡️Client⚡️GitHubEnterprise⚡️Schema⚡️ScimError(array $payload): ScimError
{
$properties = [];
$missingFields = [];
try {
$value = $payload['message'] ?? null;

if ($value === null) {
$properties['message'] = null;
goto after_message;
}

$properties['message'] = $value;

after_message:

$value = $payload['documentation_url'] ?? null;

if ($value === null) {
$properties['documentationUrl'] = null;
goto after_documentationUrl;
}

$properties['documentationUrl'] = $value;

after_documentationUrl:

$value = $payload['detail'] ?? null;

if ($value === null) {
$properties['detail'] = null;
goto after_detail;
}

$properties['detail'] = $value;

after_detail:

$value = $payload['status'] ?? null;

if ($value === null) {
$properties['status'] = null;
goto after_status;
}

$properties['status'] = $value;

after_status:

$value = $payload['scim_type'] ?? null;

if ($value === null) {
$properties['scimType'] = null;
goto after_scimType;
}

$properties['scimType'] = $value;

after_scimType:

$value = $payload['schemas'] ?? null;

if ($value === null) {
$properties['schemas'] = null;
goto after_schemas;
}

$properties['schemas'] = $value;

after_schemas:
} catch (Throwable $exception) {
throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHubEnterprise\Schema\ScimError', $exception, stack: $this->hydrationStack);
}

if (count($missingFields) > 0) {
throw UnableToHydrateObject::dueToMissingFields(ScimError::class, $missingFields, stack: $this->hydrationStack);
}

try {
return new ScimError(...$properties);
} catch (Throwable $exception) {
throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHubEnterprise\Schema\ScimError', $exception, stack: $this->hydrationStack);
}
}

private function serializeViaTypeMap(string $accessor, object $object, array $payloadToTypeMap): array
{
foreach ($payloadToTypeMap as $payloadType => [$valueType, $method]) {
Expand Down Expand Up @@ -1138,6 +1225,7 @@ public function serializeObjectOfType(object $object, string $className): mixed
'ApiClients\Client\GitHubEnterprise\Schema\CodeScanningAlertLocation' => $this->serializeObjectApiClients⚡️Client⚡️GitHubEnterprise⚡️Schema⚡️CodeScanningAlertLocation($object),
'ApiClients\Client\GitHubEnterprise\Schema\BasicError' => $this->serializeObjectApiClients⚡️Client⚡️GitHubEnterprise⚡️Schema⚡️BasicError($object),
'ApiClients\Client\GitHubEnterprise\Schema\Operations\CodeScanning\ListAlertsForEnterprise\Response\ApplicationJson\ServiceUnavailable' => $this->serializeObjectApiClients⚡️Client⚡️GitHubEnterprise⚡️Schema⚡️Operations⚡️CodeScanning⚡️ListAlertsForEnterprise⚡️Response⚡️ApplicationJson⚡️ServiceUnavailable($object),
'ApiClients\Client\GitHubEnterprise\Schema\ScimError' => $this->serializeObjectApiClients⚡️Client⚡️GitHubEnterprise⚡️Schema⚡️ScimError($object),
default => throw new LogicException("No serialization defined for $className"),
};
} catch (Throwable $exception) {
Expand Down Expand Up @@ -1752,6 +1840,69 @@ private function serializeObjectApiClients⚡️Client⚡️GitHubEnterprise⚡
return $result;
}

private function serializeObjectApiClients⚡️Client⚡️GitHubEnterprise⚡️Schema⚡️ScimError(mixed $object): mixed
{
assert($object instanceof ScimError);
$result = [];

$message = $object->message;

if ($message === null) {
goto after_message;
}

after_message: $result['message'] = $message;

$documentationUrl = $object->documentationUrl;

if ($documentationUrl === null) {
goto after_documentationUrl;
}

after_documentationUrl: $result['documentation_url'] = $documentationUrl;

$detail = $object->detail;

if ($detail === null) {
goto after_detail;
}

after_detail: $result['detail'] = $detail;

$status = $object->status;

if ($status === null) {
goto after_status;
}

after_status: $result['status'] = $status;

$scimType = $object->scimType;

if ($scimType === null) {
goto after_scimType;
}

after_scimType: $result['scim_type'] = $scimType;

$schemas = $object->schemas;

if ($schemas === null) {
goto after_schemas;
}

static $schemasSerializer0;

if ($schemasSerializer0 === null) {
$schemasSerializer0 = new SerializeArrayItems(...[]);
}

$schemas = $schemasSerializer0->serialize($schemas, $this);
after_schemas: $result['schemas'] = $schemas;

return $result;
}

/**
* @param class-string<T> $className
* @param iterable<array> $payloads;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@ public function createResponse(ResponseInterface $response): Schema\CodeScanning
$this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\CodeScanningAlert::SCHEMA_JSON, \cebe\openapi\spec\Schema::class));

return $this->hydrator->hydrateObject(Schema\CodeScanningAlert::class, $body);
/**
* Bad Request
**/

case 400:
$this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\BasicError::SCHEMA_JSON, \cebe\openapi\spec\Schema::class));

throw new ErrorSchemas\BasicError(400, $this->hydrator->hydrateObject(Schema\BasicError::class, $body));
/**
* Response if the repository is archived or if GitHub Advanced Security is not enabled for this repository
**/
Expand All @@ -85,6 +93,19 @@ public function createResponse(ResponseInterface $response): Schema\CodeScanning
throw new ErrorSchemas\Operations\CodeScanning\ListAlertsForEnterprise\Response\ApplicationJson\ServiceUnavailable(503, $this->hydrator->hydrateObject(Schema\Operations\CodeScanning\ListAlertsForEnterprise\Response\ApplicationJson\ServiceUnavailable::class, $body));
}

break;
case 'application/scim+json':
$body = json_decode($response->getBody()->getContents(), true);
switch ($code) {
/**
* Bad Request
**/
case 400:
$this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\ScimError::SCHEMA_JSON, \cebe\openapi\spec\Schema::class));

throw new ErrorSchemas\ScimError(400, $this->hydrator->hydrateObject(Schema\ScimError::class, $body));
}

break;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ public function __construct(private Browser $browser, private AuthenticationInte
{
}

/** @return */
public function call(string $owner, string $repo, int $alertNumber, array $params): CodeScanningAlert
{
$operation = new \ApiClients\Client\GitHubEnterprise\Internal\Operation\CodeScanning\UpdateAlert($this->requestSchemaValidator, $this->responseSchemaValidator, $this->hydrator, $owner, $repo, $alertNumber);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ public function updateDefaultSetup(array $params): EmptyObject|CodeScanningDefau
return $operator->call($arguments['owner'], $arguments['repo'], $params);
}

/** @return */
public function updateAlert(array $params): CodeScanningAlert
{
$arguments = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public function __construct(private Routers $routers)
{
}

/** @return |Schema\CodeScanningAlert */
public function call(string $call, array $params, array $pathChunks): TeamDiscussion|WithoutBody|CodeScanningAlert|DependabotAlert|GitRef|WebhookConfig|IssueComment|PullRequestReviewComment|ReleaseAsset|SecretScanningAlert|GroupResponse|UserResponse|TeamDiscussionComment
{
if ($pathChunks[0] === '') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ public function getAlert(string $owner, string $repo, int $alertNumber): CodeSca
return $this->operators->codeScanning👷GetAlert()->call($owner, $repo, $alertNumber);
}

/** @return */
public function updateAlert(string $owner, string $repo, int $alertNumber, array $params): CodeScanningAlert
{
return $this->operators->codeScanning👷UpdateAlert()->call($owner, $repo, $alertNumber, $params);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2488,7 +2488,7 @@ public function getTypeFromMethodCall(MethodReflection $methodReflection, Method
}

if ($call === 'PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}') {
return $this->typeResolver->resolve('');
return $this->typeResolver->resolve('Schema\\CodeScanningAlert');
}

if ($call === 'GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances') {
Expand Down
Loading
Loading