Skip to content

Commit 5fd6b43

Browse files
authored
Merge pull request #1124 from php-api-clients/GitHub/from-1.1.4-2839c344a181beeed5f86fd4195f3b9a-from-1.1.4-2839c344a181beeed5f86fd4195f3b9a
2 parents e8515c1 + c119e7b commit 5fd6b43

File tree

19 files changed

+559
-188
lines changed

19 files changed

+559
-188
lines changed

clients/GitHub/etc/openapi-client-generator.state

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"specHash": "9e7e2e65e12422c057cdc580ad81b2d1",
2+
"specHash": "2839c344a181beeed5f86fd4195f3b9a",
33
"generatedFiles": {
44
"files": [
55
{
@@ -1352,7 +1352,7 @@
13521352
},
13531353
{
13541354
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/SecretScanningLocation.php",
1355-
"hash": "6a29ce5ff09c2fe858ddeb8decd54cf6"
1355+
"hash": "1e47b6a5fac65805a970a60a6068b802"
13561356
},
13571357
{
13581358
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/SecurityAdvisoryEcosystems.php",
@@ -2332,7 +2332,7 @@
23322332
},
23332333
{
23342334
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/WebhookRepositoryDispatchSample.php",
2335-
"hash": "322b051c9b53215bd767fb65c5c6123c"
2335+
"hash": "0d040b43583520cced9d3f999fa667c1"
23362336
},
23372337
{
23382338
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/WebhookRepositoryEdited.php",
@@ -2384,7 +2384,7 @@
23842384
},
23852385
{
23862386
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/WebhookSecretScanningAlertLocationCreated.php",
2387-
"hash": "9c7146d7a857f8c425f672a26a5da3ad"
2387+
"hash": "c1c7b32e35015a0ffb138c972ab0f5e1"
23882388
},
23892389
{
23902390
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/WebhookSecretScanningAlertLocationCreatedFormEncoded.php",
@@ -4324,7 +4324,7 @@
43244324
},
43254325
{
43264326
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/WebhookRepositoryDispatchSample\/ClientPayload.php",
4327-
"hash": "548f0447a976300975656231d389e665"
4327+
"hash": "cb0c635dbc73f159311d58b63d75d377"
43284328
},
43294329
{
43304330
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/WebhookRepositoryEdited\/Changes.php",
@@ -5768,7 +5768,7 @@
57685768
},
57695769
{
57705770
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Operation\/Actions.php",
5771-
"hash": "1e378efc1a7e42ccf36c7fc474dcc68d"
5771+
"hash": "277e40b19d896803fe34e8e94f5afbaf"
57725772
},
57735773
{
57745774
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Operation\/Oidc.php",
@@ -5800,7 +5800,7 @@
58005800
},
58015801
{
58025802
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Operation\/Repos.php",
5803-
"hash": "e47c376a147571cf59df4d012070321c"
5803+
"hash": "2bda5f4297ca2c437fbf084c85c6bac2"
58045804
},
58055805
{
58065806
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Operation\/Billing.php",
@@ -12502,13 +12502,9 @@
1250212502
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/WebhookReleaseUnpublished\/Release\/Assets.php",
1250312503
"hash": "722b25a3f26dce84f87b8b09e271c195"
1250412504
},
12505-
{
12506-
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/AliasAbstract\/Tiet76B5D9AD\/Tiet3F1D0B82\/Tiet9290F302\/Tiet5AB2627C.php",
12507-
"hash": "b19ece60d9734703549e73aecd3a2f78"
12508-
},
1250912505
{
1251012506
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/WebhookWorkflowDispatch\/Inputs.php",
12511-
"hash": "6824a77731b3eb31a6cef83fb63a6661"
12507+
"hash": "6dec46cf6a90b1a84d8d03a29561325f"
1251212508
},
1251312509
{
1251412510
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/AliasAbstract\/Tiet1CF91DE0\/Tiet4DB5DE15\/Tiet56410125\/Tiet72117C37.php",
@@ -20512,7 +20508,7 @@
2051220508
},
2051320509
{
2051420510
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operator\/Repos\/CreateDispatchEvent.php",
20515-
"hash": "e086f2571757b950c4962083a9950678"
20511+
"hash": "f7a373df35321f19f5491a3a5b304b22"
2051620512
},
2051720513
{
2051820514
"name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Internal\/Operation\/Repos\/CreateDispatchEventTest.php",
@@ -26232,7 +26228,7 @@
2623226228
},
2623326229
{
2623426230
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Attribute\/CastUnionToType\/Schema\/SecretScanningLocation\/Details.php",
26235-
"hash": "1f6aa546bfa4b382031ccd4f6a768ced"
26231+
"hash": "e4778edfeea8b1ce9b057d0c80e2f38a"
2623626232
},
2623726233
{
2623826234
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Attribute\/CastUnionToType\/Schema\/WebhookProjectsV2ItemEdited\/Changes.php",
@@ -26464,7 +26460,7 @@
2646426460
},
2646526461
{
2646626462
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Post\/Repos.php",
26467-
"hash": "4ea89d1a30c4fce239808bcd504e1d3d"
26463+
"hash": "4d7d65332adeda6510ba08f915e44db4"
2646826464
},
2646926465
{
2647026466
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Post\/Teams.php",
@@ -26880,7 +26876,7 @@
2688026876
},
2688126877
{
2688226878
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Post\/Five.php",
26883-
"hash": "a2c0ad344490b984666e4206f31dd7d5"
26879+
"hash": "4d4aa638bc984e3ccf904011736dd0e5"
2688426880
},
2688526881
{
2688626882
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Post\/Two.php",
@@ -29680,11 +29676,11 @@
2968029676
},
2968129677
{
2968229678
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/PHPStan\/ClientCallReturnTypes.php",
29683-
"hash": "694653df53e7827c151062c70c385960"
29679+
"hash": "9408a4fb50e75c12f4b05aa107e8928a"
2968429680
},
2968529681
{
2968629682
"name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Types\/ClientCallReturnTypes.php",
29687-
"hash": "a2755fdaf852b95ef51cc28449837af8"
29683+
"hash": "036db8bcfe296b31facfe15f66d870a5"
2968829684
},
2968929685
{
2969029686
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/..\/etc\/phpstan-extension.neon",
@@ -30212,7 +30208,7 @@
3021230208
},
3021330209
{
3021430210
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Hydrator\/WebHook\/SecretScanningAlertLocation.php",
30215-
"hash": "c761d75b1524fd0837944343f32a7d5f"
30211+
"hash": "87ee7faafaae791c9fda7b56e11e5f54"
3021630212
},
3021730213
{
3021830214
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Hydrator\/WebHook\/SecurityAdvisory.php",
@@ -30658,10 +30654,6 @@
3065830654
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/Copilot\/AddCopilotSeatsForUsers\/Request\/ApplicationJson.php",
3065930655
"hash": "8bb0403f932894bc6bf2e4f52ff13c20"
3066030656
},
30661-
{
30662-
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/RepositoryRuleParamsThresholds.php",
30663-
"hash": "aef97e07e2dec1cd49a155c053ac64a3"
30664-
},
3066530657
{
3066630658
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Hydrator\/Operation\/Repos\/Owner\/Repo\/Environments\/EnvironmentName\/Secrets.php",
3066730659
"hash": "bcbfd501e9a304e95f56d2803bc25122"
@@ -30717,6 +30709,14 @@
3071730709
{
3071830710
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/AliasAbstract\/Tiet59467073\/Tiet58CE2E2F\/Tiet6601455F\/TietF3A22DF2.php",
3071930711
"hash": "fff74a4f9a26ba7d86f13900cca2f8b2"
30712+
},
30713+
{
30714+
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/RepositoryRuleParamsCodeScanningThreshold.php",
30715+
"hash": "76ddecf8737d006bea293713ec257ae4"
30716+
},
30717+
{
30718+
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/SecretScanningLocationWikiCommit.php",
30719+
"hash": "36b01c6e0bf80cafea1c17fab895c2af"
3072030720
}
3072130721
]
3072230722
},

clients/GitHub/src/Internal/Attribute/CastUnionToType/Schema/SecretScanningLocation/Details.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@ public function cast(mixed $value, ObjectMapper $hydrator): mixed
3232
}
3333
}
3434

35+
if ($signature === 'blob_sha|commit_sha|commit_url|end_column|end_line|page_url|path|start_column|start_line') {
36+
try {
37+
return $hydrator->hydrateObject(Schema\SecretScanningLocationWikiCommit::class, $value);
38+
} catch (Throwable) {
39+
}
40+
}
41+
3542
if ($signature === 'issue_title_url') {
3643
try {
3744
return $hydrator->hydrateObject(Schema\SecretScanningLocationIssueTitle::class, $value);

clients/GitHub/src/Internal/Hydrator/WebHook/SecretScanningAlertLocation.php

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
use function count;
3636
use function is_a;
3737
use function is_array;
38+
use function is_object;
3839

3940
class SecretScanningAlertLocation implements ObjectMapper
4041
{
@@ -724,7 +725,7 @@ private function hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️Secr
724725
$value = $payload['type'] ?? null;
725726

726727
if ($value === null) {
727-
$missingFields[] = 'type';
728+
$properties['type'] = null;
728729
goto after_type;
729730
}
730731

@@ -735,7 +736,7 @@ private function hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️Secr
735736
$value = $payload['details'] ?? null;
736737

737738
if ($value === null) {
738-
$missingFields[] = 'details';
739+
$properties['details'] = null;
739740
goto after_details;
740741
}
741742

@@ -748,7 +749,7 @@ private function hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️Secr
748749
$value = $detailsCaster1->cast($value, $this);
749750

750751
if ($value === null) {
751-
$missingFields[] = 'details';
752+
$properties['details'] = null;
752753
goto after_details;
753754
}
754755

@@ -4235,24 +4236,24 @@ private function serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema
42354236
assert($object instanceof SecretScanningLocation);
42364237
$result = [];
42374238

4238-
$type = $object->type;
4239+
$type = $object->type;
4240+
4241+
if ($type === null) {
4242+
goto after_type;
4243+
}
4244+
42394245
after_type: $result['type'] = $type;
42404246

42414247
$details = $object->details;
4242-
$details = match ($details::class) {
4243-
'ApiClients\Client\GitHub\Schema\SecretScanningLocationCommit' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️SecretScanningLocationCommit($details),
4244-
'ApiClients\Client\GitHub\Schema\SecretScanningLocationIssueTitle' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️SecretScanningLocationIssueTitle($details),
4245-
'ApiClients\Client\GitHub\Schema\SecretScanningLocationIssueBody' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️SecretScanningLocationIssueBody($details),
4246-
'ApiClients\Client\GitHub\Schema\SecretScanningLocationIssueComment' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️SecretScanningLocationIssueComment($details),
4247-
'ApiClients\Client\GitHub\Schema\SecretScanningLocationDiscussionTitle' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️SecretScanningLocationDiscussionTitle($details),
4248-
'ApiClients\Client\GitHub\Schema\SecretScanningLocationDiscussionBody' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️SecretScanningLocationDiscussionBody($details),
4249-
'ApiClients\Client\GitHub\Schema\SecretScanningLocationDiscussionComment' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️SecretScanningLocationDiscussionComment($details),
4250-
'ApiClients\Client\GitHub\Schema\SecretScanningLocationPullRequestTitle' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️SecretScanningLocationPullRequestTitle($details),
4251-
'ApiClients\Client\GitHub\Schema\SecretScanningLocationPullRequestBody' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️SecretScanningLocationPullRequestBody($details),
4252-
'ApiClients\Client\GitHub\Schema\SecretScanningLocationPullRequestComment' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️SecretScanningLocationPullRequestComment($details),
4253-
'ApiClients\Client\GitHub\Schema\SecretScanningLocationPullRequestReview' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️SecretScanningLocationPullRequestReview($details),
4254-
'ApiClients\Client\GitHub\Schema\SecretScanningLocationPullRequestReviewComment' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️SecretScanningLocationPullRequestReviewComment($details),
4255-
};
4248+
4249+
if ($details === null) {
4250+
goto after_details;
4251+
}
4252+
4253+
if (is_object($details)) {
4254+
$details = $this->serializeObject($details);
4255+
}
4256+
42564257
after_details: $result['details'] = $details;
42574258

42584259
return $result;

clients/GitHub/src/Internal/Operator/Repos/CreateDispatchEvent.php

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

27+
/** @return */
2728
public function call(string $owner, string $repo, array $params): WithoutBody
2829
{
2930
$operation = new \ApiClients\Client\GitHub\Internal\Operation\Repos\CreateDispatchEvent($this->requestSchemaValidator, $this->responseSchemaValidator, $this->hydrator, $owner, $repo);

clients/GitHub/src/Internal/Router/Post/Five.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ public function __construct(private Routers $routers)
4141
{
4242
}
4343

44-
/** @return |\ApiClients\Tools\OpenApiClient\Utils\Response\WithoutBody */
4544
public function call(string $call, array $params, array $pathChunks): InstallationToken|Authorization|EmptyObject|WithoutBody|ProjectCard|Json|Autolink|CheckRun|CheckSuite|Codespace|Deployment|\ApiClients\Client\GitHub\Schema\Operations\Repos\CreateDeployment\Response\ApplicationJson\Accepted\Application\Json|FullRepository|Hook|Issue|DeployKey|Label|MergedUpstream|Commit|Milestone|Page|Project|PullRequest|Release|RepositoryRuleset|RepositoryAdvisory|MinimalRepository|CodespaceExportDetails|CodespaceWithFullRepository
4645
{
4746
if ($pathChunks[0] === '') {

clients/GitHub/src/Internal/Router/Post/Repos.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ public function createDeployment(array $params): Deployment|Json|WithoutBody
227227
return $operator->call($arguments['owner'], $arguments['repo'], $params);
228228
}
229229

230+
/** @return */
230231
public function createDispatchEvent(array $params): WithoutBody
231232
{
232233
$arguments = [];

clients/GitHub/src/Operation/Repos.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -670,6 +670,7 @@ public function getDeploymentStatus(string $owner, string $repo, int $deployment
670670
return $this->operators->repos👷GetDeploymentStatus()->call($owner, $repo, $deploymentId, $statusId);
671671
}
672672

673+
/** @return */
673674
public function createDispatchEvent(string $owner, string $repo, array $params): WithoutBody
674675
{
675676
return $this->operators->repos👷CreateDispatchEvent()->call($owner, $repo, $params);

clients/GitHub/src/PHPStan/ClientCallReturnTypes.php

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

24742474
if ($call === 'POST /repos/{owner}/{repo}/dispatches') {
2475-
return $this->typeResolver->resolve('\\ApiClients\\Tools\\OpenApiClient\\Utils\\Response\\WithoutBody');
2475+
return $this->typeResolver->resolve('');
24762476
}
24772477

24782478
if ($call === 'GET /repos/{owner}/{repo}/environments') {

clients/GitHub/src/Schema/AliasAbstract/Tiet76B5D9AD/Tiet3F1D0B82/Tiet9290F302/Tiet5AB2627C.php

Lines changed: 0 additions & 23 deletions
This file was deleted.
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace ApiClients\Client\GitHub\Schema;
6+
7+
use EventSauce\ObjectHydrator\MapFrom;
8+
9+
final readonly class RepositoryRuleParamsCodeScanningThreshold
10+
{
11+
public const SCHEMA_JSON = '{
12+
"title": "CodeScanningThreshold",
13+
"required": [
14+
"alerts",
15+
"security_alerts",
16+
"tool"
17+
],
18+
"type": "object",
19+
"properties": {
20+
"alerts": {
21+
"enum": [
22+
"none",
23+
"errors",
24+
"errors_and_warnings",
25+
"all"
26+
],
27+
"type": "string",
28+
"description": "Code scanning alert threshold"
29+
},
30+
"security_alerts": {
31+
"enum": [
32+
"none",
33+
"critical",
34+
"high_or_higher",
35+
"medium_or_higher",
36+
"all"
37+
],
38+
"type": "string",
39+
"description": "Code scanning security alert threshold."
40+
},
41+
"tool": {
42+
"type": "string",
43+
"description": "The name of a code scanning tool"
44+
}
45+
},
46+
"description": "A tool and its thresholds."
47+
}';
48+
public const SCHEMA_TITLE = 'CodeScanningThreshold';
49+
public const SCHEMA_DESCRIPTION = 'A tool and its thresholds.';
50+
public const SCHEMA_EXAMPLE_DATA = '{
51+
"alerts": "all",
52+
"security_alerts": "none",
53+
"tool": "generated"
54+
}';
55+
56+
/**
57+
* alerts: Code scanning alert threshold
58+
* securityAlerts: Code scanning security alert threshold.
59+
* tool: The name of a code scanning tool
60+
*/
61+
public function __construct(public string $alerts, #[MapFrom('security_alerts')]
62+
public string $securityAlerts, public string $tool,)
63+
{
64+
}
65+
}

0 commit comments

Comments
 (0)