Skip to content

Commit 90437b8

Browse files
authored
Merge pull request #1553 from php-api-clients/GitHubEnterprise-3.13/from-1.1.4-ffac604ed0c1f24261dd953b32c2fba3-from-1.1.4-ffac604ed0c1f24261dd953b32c2fba3
2 parents 28ea4b5 + 890b50f commit 90437b8

File tree

13 files changed

+302
-21
lines changed

13 files changed

+302
-21
lines changed

clients/GitHubEnterprise-3.13/etc/openapi-client-generator.state

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"specHash": "802a0cd5a04204e42ef5ea0492e36a70",
2+
"specHash": "ffac604ed0c1f24261dd953b32c2fba3",
33
"generatedFiles": {
44
"files": [
55
{
@@ -6948,15 +6948,15 @@
69486948
},
69496949
{
69506950
"name": ".\/clients\/GitHubEnterprise-3.13\/etc\/..\/\/src\/\/Internal\/Operation\/CodeScanning\/UpdateAlert.php",
6951-
"hash": "4414595983724d58e1cdf5c09e8f409f"
6951+
"hash": "b7b8c2aaaf47299f09adbb2b88b5daf5"
69526952
},
69536953
{
69546954
"name": ".\/clients\/GitHubEnterprise-3.13\/etc\/..\/\/src\/\/Internal\/Operator\/CodeScanning\/UpdateAlert.php",
6955-
"hash": "0d58379475f7ab773df9ae4b3b7d84c5"
6955+
"hash": "fd3b96fa7070fd31d1490b2ae4861c54"
69566956
},
69576957
{
69586958
"name": ".\/clients\/GitHubEnterprise-3.13\/etc\/..\/\/tests\/\/Internal\/Operation\/CodeScanning\/UpdateAlertTest.php",
6959-
"hash": "5e18056057b185cf3a4348a8b97f093c"
6959+
"hash": "78119db7046be60d7d867ad3af28c6fa"
69606960
},
69616961
{
69626962
"name": ".\/clients\/GitHubEnterprise-3.13\/etc\/..\/\/src\/\/Internal\/Operation\/CodeScanning\/ListAlertInstances.php",
@@ -25776,7 +25776,7 @@
2577625776
},
2577725777
{
2577825778
"name": ".\/clients\/GitHubEnterprise-3.13\/etc\/..\/\/src\/\/Schema\/CodeScanning\/UpdateAlert\/Request\/ApplicationJson.php",
25779-
"hash": "ffbb63d8bfc655b760e73bb0a84b41b7"
25779+
"hash": "ef09173d8d817efd8e1e4e81d9f0edcc"
2578025780
},
2578125781
{
2578225782
"name": ".\/clients\/GitHubEnterprise-3.13\/etc\/..\/\/src\/\/Schema\/CodeScanning\/UploadSarif\/Request\/ApplicationJson.php",
@@ -26812,7 +26812,7 @@
2681226812
},
2681326813
{
2681426814
"name": ".\/clients\/GitHubEnterprise-3.13\/etc\/..\/\/src\/\/Internal\/Router\/Patch\/CodeScanning.php",
26815-
"hash": "f4eded73dbc98d19cc03cd2545bc0a44"
26815+
"hash": "b169946b91470cd53c5ec292b35ad780"
2681626816
},
2681726817
{
2681826818
"name": ".\/clients\/GitHubEnterprise-3.13\/etc\/..\/\/src\/\/Internal\/Router\/Patch\/Issues.php",
@@ -27080,7 +27080,7 @@
2708027080
},
2708127081
{
2708227082
"name": ".\/clients\/GitHubEnterprise-3.13\/etc\/..\/\/src\/\/Internal\/Router\/Patch\/Seven.php",
27083-
"hash": "619ee85831f1ccf3b4aa9570bc701fb6"
27083+
"hash": "e6af182f8222fb648cfc3c789507197c"
2708427084
},
2708527085
{
2708627086
"name": ".\/clients\/GitHubEnterprise-3.13\/etc\/..\/\/src\/\/Internal\/Router\/Patch\/Nine.php",
@@ -27144,11 +27144,11 @@
2714427144
},
2714527145
{
2714627146
"name": ".\/clients\/GitHubEnterprise-3.13\/etc\/..\/\/src\/\/PHPStan\/ClientCallReturnTypes.php",
27147-
"hash": "2fb5474325448bccbcb22bb7d1158ea1"
27147+
"hash": "6e5907cbb91f9f456405e81c70a308bb"
2714827148
},
2714927149
{
2715027150
"name": ".\/clients\/GitHubEnterprise-3.13\/etc\/..\/\/tests\/\/Types\/ClientCallReturnTypes.php",
27151-
"hash": "54beea339c8099994a522e19c9c55b8c"
27151+
"hash": "5b04e61e38fb830021cb4372f584f019"
2715227152
},
2715327153
{
2715427154
"name": ".\/clients\/GitHubEnterprise-3.13\/etc\/..\/\/src\/\/..\/etc\/phpstan-extension.neon",
@@ -27160,7 +27160,7 @@
2716027160
},
2716127161
{
2716227162
"name": ".\/clients\/GitHubEnterprise-3.13\/etc\/..\/\/src\/\/Operation\/Meta.php",
27163-
"hash": "efb7434a503625c23355172c4638e6bb"
27163+
"hash": "41cc72ff89d01e5b48be965d9a5b63fd"
2716427164
},
2716527165
{
2716627166
"name": ".\/clients\/GitHubEnterprise-3.13\/etc\/..\/\/src\/\/Operation\/EnterpriseAdmin.php",
@@ -27192,7 +27192,7 @@
2719227192
},
2719327193
{
2719427194
"name": ".\/clients\/GitHubEnterprise-3.13\/etc\/..\/\/src\/\/Operation\/CodeScanning.php",
27195-
"hash": "035196723d9518e17e7f016fa71af9c8"
27195+
"hash": "254f6e3c029935a79e15b051e78e67ba"
2719627196
},
2719727197
{
2719827198
"name": ".\/clients\/GitHubEnterprise-3.13\/etc\/..\/\/src\/\/Operation\/SecretScanning.php",
@@ -27276,7 +27276,7 @@
2727627276
},
2727727277
{
2727827278
"name": ".\/clients\/GitHubEnterprise-3.13\/etc\/..\/\/src\/\/Operation\/DependencyGraph.php",
27279-
"hash": "a69f445c74c4b7b7c28abe4e750cc769"
27279+
"hash": "a638452f9411a0fc738141835c32327d"
2728027280
},
2728127281
{
2728227282
"name": ".\/clients\/GitHubEnterprise-3.13\/etc\/..\/\/src\/\/Operation\/Git.php",
@@ -27288,7 +27288,7 @@
2728827288
},
2728927289
{
2729027290
"name": ".\/clients\/GitHubEnterprise-3.13\/etc\/..\/\/src\/\/Operation\/Search.php",
27291-
"hash": "6e92f41ff9de1bd3067e80b3f3da380d"
27291+
"hash": "522fda33c8ae6024675365cb3775c1f1"
2729227292
},
2729327293
{
2729427294
"name": ".\/clients\/GitHubEnterprise-3.13\/etc\/..\/\/src\/\/Operation\/Users.php",
@@ -28716,7 +28716,7 @@
2871628716
},
2871728717
{
2871828718
"name": ".\/clients\/GitHubEnterprise-3.13\/etc\/..\/\/src\/\/Internal\/Hydrator\/Operation\/Repos\/Owner\/Repo\/CodeScanning\/Alerts\/AlertNumber.php",
28719-
"hash": "b9452bc32629313c2650579a65f77f38"
28719+
"hash": "a926bd101b56e9d2fa2d26b4ba0ef2d2"
2872028720
},
2872128721
{
2872228722
"name": ".\/clients\/GitHubEnterprise-3.13\/etc\/..\/\/src\/\/Internal\/Hydrator\/Operation\/Repos\/Owner\/Repo\/CodeScanning\/Alerts\/AlertNumber\/Instances.php",
@@ -29969,6 +29969,10 @@
2996929969
{
2997029970
"name": ".\/clients\/GitHubEnterprise-3.13\/etc\/..\/\/src\/\/Schema\/WebhookReleaseEdited\/Changes\/TagName.php",
2997129971
"hash": "918a75e1fc3897bd242cdd1f3516cd1a"
29972+
},
29973+
{
29974+
"name": ".\/clients\/GitHubEnterprise-3.13\/etc\/..\/\/src\/\/Schema\/CodeScanningAlertCreateRequest.php",
29975+
"hash": "b1c32113d0944e1335325145d49ced03"
2997229976
}
2997329977
]
2997429978
},

clients/GitHubEnterprise-3.13/src/Internal/Hydrator/Operation/Repos/Owner/Repo/CodeScanning/Alerts/AlertNumber.php

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use ApiClients\Client\GitHubEnterprise\Schema\CodeScanningAlertRule;
1313
use ApiClients\Client\GitHubEnterprise\Schema\CodeScanningAnalysisTool;
1414
use ApiClients\Client\GitHubEnterprise\Schema\Operations\CodeScanning\ListAlertsForEnterprise\Response\ApplicationJson\ServiceUnavailable;
15+
use ApiClients\Client\GitHubEnterprise\Schema\ScimError;
1516
use ApiClients\Client\GitHubEnterprise\Schema\SimpleUser;
1617
use EventSauce\ObjectHydrator\IterableList;
1718
use EventSauce\ObjectHydrator\ObjectMapper;
@@ -57,6 +58,7 @@ public function hydrateObject(string $className, array $payload): object
5758
'ApiClients\Client\GitHubEnterprise\Schema\CodeScanningAlertLocation' => $this->hydrateApiClients⚡️Client⚡️GitHubEnterprise⚡️Schema⚡️CodeScanningAlertLocation($payload),
5859
'ApiClients\Client\GitHubEnterprise\Schema\BasicError' => $this->hydrateApiClients⚡️Client⚡️GitHubEnterprise⚡️Schema⚡️BasicError($payload),
5960
'ApiClients\Client\GitHubEnterprise\Schema\Operations\CodeScanning\ListAlertsForEnterprise\Response\ApplicationJson\ServiceUnavailable' => $this->hydrateApiClients⚡️Client⚡️GitHubEnterprise⚡️Schema⚡️Operations⚡️CodeScanning⚡️ListAlertsForEnterprise⚡️Response⚡️ApplicationJson⚡️ServiceUnavailable($payload),
61+
'ApiClients\Client\GitHubEnterprise\Schema\ScimError' => $this->hydrateApiClients⚡️Client⚡️GitHubEnterprise⚡️Schema⚡️ScimError($payload),
6062
default => throw UnableToHydrateObject::noHydrationDefined($className, $this->hydrationStack),
6163
};
6264
}
@@ -1098,6 +1100,91 @@ private function hydrateApiClients⚡️Client⚡️GitHubEnterprise⚡️Schema
10981100
}
10991101
}
11001102

1103+
private function hydrateApiClients⚡️Client⚡️GitHubEnterprise⚡️Schema⚡️ScimError(array $payload): ScimError
1104+
{
1105+
$properties = [];
1106+
$missingFields = [];
1107+
try {
1108+
$value = $payload['message'] ?? null;
1109+
1110+
if ($value === null) {
1111+
$properties['message'] = null;
1112+
goto after_message;
1113+
}
1114+
1115+
$properties['message'] = $value;
1116+
1117+
after_message:
1118+
1119+
$value = $payload['documentation_url'] ?? null;
1120+
1121+
if ($value === null) {
1122+
$properties['documentationUrl'] = null;
1123+
goto after_documentationUrl;
1124+
}
1125+
1126+
$properties['documentationUrl'] = $value;
1127+
1128+
after_documentationUrl:
1129+
1130+
$value = $payload['detail'] ?? null;
1131+
1132+
if ($value === null) {
1133+
$properties['detail'] = null;
1134+
goto after_detail;
1135+
}
1136+
1137+
$properties['detail'] = $value;
1138+
1139+
after_detail:
1140+
1141+
$value = $payload['status'] ?? null;
1142+
1143+
if ($value === null) {
1144+
$properties['status'] = null;
1145+
goto after_status;
1146+
}
1147+
1148+
$properties['status'] = $value;
1149+
1150+
after_status:
1151+
1152+
$value = $payload['scim_type'] ?? null;
1153+
1154+
if ($value === null) {
1155+
$properties['scimType'] = null;
1156+
goto after_scimType;
1157+
}
1158+
1159+
$properties['scimType'] = $value;
1160+
1161+
after_scimType:
1162+
1163+
$value = $payload['schemas'] ?? null;
1164+
1165+
if ($value === null) {
1166+
$properties['schemas'] = null;
1167+
goto after_schemas;
1168+
}
1169+
1170+
$properties['schemas'] = $value;
1171+
1172+
after_schemas:
1173+
} catch (Throwable $exception) {
1174+
throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHubEnterprise\Schema\ScimError', $exception, stack: $this->hydrationStack);
1175+
}
1176+
1177+
if (count($missingFields) > 0) {
1178+
throw UnableToHydrateObject::dueToMissingFields(ScimError::class, $missingFields, stack: $this->hydrationStack);
1179+
}
1180+
1181+
try {
1182+
return new ScimError(...$properties);
1183+
} catch (Throwable $exception) {
1184+
throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHubEnterprise\Schema\ScimError', $exception, stack: $this->hydrationStack);
1185+
}
1186+
}
1187+
11011188
private function serializeViaTypeMap(string $accessor, object $object, array $payloadToTypeMap): array
11021189
{
11031190
foreach ($payloadToTypeMap as $payloadType => [$valueType, $method]) {
@@ -1138,6 +1225,7 @@ public function serializeObjectOfType(object $object, string $className): mixed
11381225
'ApiClients\Client\GitHubEnterprise\Schema\CodeScanningAlertLocation' => $this->serializeObjectApiClients⚡️Client⚡️GitHubEnterprise⚡️Schema⚡️CodeScanningAlertLocation($object),
11391226
'ApiClients\Client\GitHubEnterprise\Schema\BasicError' => $this->serializeObjectApiClients⚡️Client⚡️GitHubEnterprise⚡️Schema⚡️BasicError($object),
11401227
'ApiClients\Client\GitHubEnterprise\Schema\Operations\CodeScanning\ListAlertsForEnterprise\Response\ApplicationJson\ServiceUnavailable' => $this->serializeObjectApiClients⚡️Client⚡️GitHubEnterprise⚡️Schema⚡️Operations⚡️CodeScanning⚡️ListAlertsForEnterprise⚡️Response⚡️ApplicationJson⚡️ServiceUnavailable($object),
1228+
'ApiClients\Client\GitHubEnterprise\Schema\ScimError' => $this->serializeObjectApiClients⚡️Client⚡️GitHubEnterprise⚡️Schema⚡️ScimError($object),
11411229
default => throw new LogicException("No serialization defined for $className"),
11421230
};
11431231
} catch (Throwable $exception) {
@@ -1752,6 +1840,69 @@ private function serializeObjectApiClients⚡️Client⚡️GitHubEnterprise⚡
17521840
return $result;
17531841
}
17541842

1843+
private function serializeObjectApiClients⚡️Client⚡️GitHubEnterprise⚡️Schema⚡️ScimError(mixed $object): mixed
1844+
{
1845+
assert($object instanceof ScimError);
1846+
$result = [];
1847+
1848+
$message = $object->message;
1849+
1850+
if ($message === null) {
1851+
goto after_message;
1852+
}
1853+
1854+
after_message: $result['message'] = $message;
1855+
1856+
$documentationUrl = $object->documentationUrl;
1857+
1858+
if ($documentationUrl === null) {
1859+
goto after_documentationUrl;
1860+
}
1861+
1862+
after_documentationUrl: $result['documentation_url'] = $documentationUrl;
1863+
1864+
$detail = $object->detail;
1865+
1866+
if ($detail === null) {
1867+
goto after_detail;
1868+
}
1869+
1870+
after_detail: $result['detail'] = $detail;
1871+
1872+
$status = $object->status;
1873+
1874+
if ($status === null) {
1875+
goto after_status;
1876+
}
1877+
1878+
after_status: $result['status'] = $status;
1879+
1880+
$scimType = $object->scimType;
1881+
1882+
if ($scimType === null) {
1883+
goto after_scimType;
1884+
}
1885+
1886+
after_scimType: $result['scim_type'] = $scimType;
1887+
1888+
$schemas = $object->schemas;
1889+
1890+
if ($schemas === null) {
1891+
goto after_schemas;
1892+
}
1893+
1894+
static $schemasSerializer0;
1895+
1896+
if ($schemasSerializer0 === null) {
1897+
$schemasSerializer0 = new SerializeArrayItems(...[]);
1898+
}
1899+
1900+
$schemas = $schemasSerializer0->serialize($schemas, $this);
1901+
after_schemas: $result['schemas'] = $schemas;
1902+
1903+
return $result;
1904+
}
1905+
17551906
/**
17561907
* @param class-string<T> $className
17571908
* @param iterable<array> $payloads;

clients/GitHubEnterprise-3.13/src/Internal/Operation/CodeScanning/UpdateAlert.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,14 @@ public function createResponse(ResponseInterface $response): Schema\CodeScanning
5959
$this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\CodeScanningAlert::SCHEMA_JSON, \cebe\openapi\spec\Schema::class));
6060

6161
return $this->hydrator->hydrateObject(Schema\CodeScanningAlert::class, $body);
62+
/**
63+
* Bad Request
64+
**/
65+
66+
case 400:
67+
$this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\BasicError::SCHEMA_JSON, \cebe\openapi\spec\Schema::class));
68+
69+
throw new ErrorSchemas\BasicError(400, $this->hydrator->hydrateObject(Schema\BasicError::class, $body));
6270
/**
6371
* Response if the repository is archived or if GitHub Advanced Security is not enabled for this repository
6472
**/
@@ -85,6 +93,19 @@ public function createResponse(ResponseInterface $response): Schema\CodeScanning
8593
throw new ErrorSchemas\Operations\CodeScanning\ListAlertsForEnterprise\Response\ApplicationJson\ServiceUnavailable(503, $this->hydrator->hydrateObject(Schema\Operations\CodeScanning\ListAlertsForEnterprise\Response\ApplicationJson\ServiceUnavailable::class, $body));
8694
}
8795

96+
break;
97+
case 'application/scim+json':
98+
$body = json_decode($response->getBody()->getContents(), true);
99+
switch ($code) {
100+
/**
101+
* Bad Request
102+
**/
103+
case 400:
104+
$this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\ScimError::SCHEMA_JSON, \cebe\openapi\spec\Schema::class));
105+
106+
throw new ErrorSchemas\ScimError(400, $this->hydrator->hydrateObject(Schema\ScimError::class, $body));
107+
}
108+
88109
break;
89110
}
90111

clients/GitHubEnterprise-3.13/src/Internal/Operator/CodeScanning/UpdateAlert.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ public function __construct(private Browser $browser, private AuthenticationInte
2424
{
2525
}
2626

27-
/** @return */
2827
public function call(string $owner, string $repo, int $alertNumber, array $params): CodeScanningAlert
2928
{
3029
$operation = new \ApiClients\Client\GitHubEnterprise\Internal\Operation\CodeScanning\UpdateAlert($this->requestSchemaValidator, $this->responseSchemaValidator, $this->hydrator, $owner, $repo, $alertNumber);

clients/GitHubEnterprise-3.13/src/Internal/Router/Patch/CodeScanning.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ public function updateDefaultSetup(array $params): EmptyObject|CodeScanningDefau
4242
return $operator->call($arguments['owner'], $arguments['repo'], $params);
4343
}
4444

45-
/** @return */
4645
public function updateAlert(array $params): CodeScanningAlert
4746
{
4847
$arguments = [];

clients/GitHubEnterprise-3.13/src/Internal/Router/Patch/Seven.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public function __construct(private Routers $routers)
2626
{
2727
}
2828

29+
/** @return |Schema\CodeScanningAlert */
2930
public function call(string $call, array $params, array $pathChunks): TeamDiscussion|WithoutBody|CodeScanningAlert|DependabotAlert|GitRef|WebhookConfig|IssueComment|PullRequestReviewComment|ReleaseAsset|SecretScanningAlert|GroupResponse|UserResponse|TeamDiscussionComment
3031
{
3132
if ($pathChunks[0] === '') {

clients/GitHubEnterprise-3.13/src/Operation/CodeScanning.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ public function getAlert(string $owner, string $repo, int $alertNumber): CodeSca
6464
return $this->operators->codeScanning👷GetAlert()->call($owner, $repo, $alertNumber);
6565
}
6666

67-
/** @return */
6867
public function updateAlert(string $owner, string $repo, int $alertNumber, array $params): CodeScanningAlert
6968
{
7069
return $this->operators->codeScanning👷UpdateAlert()->call($owner, $repo, $alertNumber, $params);

clients/GitHubEnterprise-3.13/src/PHPStan/ClientCallReturnTypes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2488,7 +2488,7 @@ public function getTypeFromMethodCall(MethodReflection $methodReflection, Method
24882488
}
24892489

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

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

0 commit comments

Comments
 (0)