Skip to content

Commit 74335b5

Browse files
authored
Merge pull request #1207 from php-api-clients/GitHub/from-1.1.4-c3f89da8f4e736748f0a13e02db3c36d-from-1.1.4-c3f89da8f4e736748f0a13e02db3c36d
2 parents 2f76f72 + 76bc18a commit 74335b5

36 files changed

+1592
-124
lines changed

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

Lines changed: 59 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"specHash": "d2d01395df29a6b406754b59eca9b64e",
2+
"specHash": "c3f89da8f4e736748f0a13e02db3c36d",
33
"generatedFiles": {
44
"files": [
55
{
@@ -2136,7 +2136,7 @@
21362136
},
21372137
{
21382138
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/WebhookProjectsV2ItemEdited.php",
2139-
"hash": "2353c6b51d435461a6ffdf88665ab035"
2139+
"hash": "4e1e4f85e24183e2a55ab1ee2a654813"
21402140
},
21412141
{
21422142
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/WebhookProjectsV2ItemReordered.php",
@@ -2676,7 +2676,7 @@
26762676
},
26772677
{
26782678
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/Team\/Permissions.php",
2679-
"hash": "8c1c8b05ff1c19b73e7fab86ce80ff00"
2679+
"hash": "25861ee6782f5feb5492c836bc232b3b"
26802680
},
26812681
{
26822682
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/OrgMembership\/Permissions.php",
@@ -3868,11 +3868,11 @@
38683868
},
38693869
{
38703870
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/WebhookProjectsV2ItemEdited\/Changes\/Zero.php",
3871-
"hash": "6a70472113a22f7026a17b8637f8bb46"
3871+
"hash": "bc323bbed2aa67a04227d4888daab4e6"
38723872
},
38733873
{
38743874
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/WebhookProjectsV2ItemEdited\/Changes\/Zero\/FieldValue.php",
3875-
"hash": "86ef6698eb5379834682a524e2f78552"
3875+
"hash": "1d47d6cea751aad82aaf163bd23327d4"
38763876
},
38773877
{
38783878
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/WebhookProjectsV2ItemEdited\/Changes\/One.php",
@@ -5576,7 +5576,7 @@
55765576
},
55775577
{
55785578
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Operation\/Orgs.php",
5579-
"hash": "0725ce6d6c3f5c8f8c8a084acf37ea9e"
5579+
"hash": "21d3ce857a4a8fd72a90f0fcc0d3dd82"
55805580
},
55815581
{
55825582
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Operation\/Actions.php",
@@ -5612,7 +5612,7 @@
56125612
},
56135613
{
56145614
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Operation\/Repos.php",
5615-
"hash": "b74e6ee7b2f5433a82d81322bbf61f55"
5615+
"hash": "a4a7d522f173cfb6b3584c6d1e4ab1d1"
56165616
},
56175617
{
56185618
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Operation\/Billing.php",
@@ -18196,7 +18196,7 @@
1819618196
},
1819718197
{
1819818198
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operator\/Repos\/ListCommits.php",
18199-
"hash": "f355ab3ab72be2f524e829422aa6d684"
18199+
"hash": "4458e4274c60575975efe776eb875881"
1820018200
},
1820118201
{
1820218202
"name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Internal\/Operation\/Repos\/ListCommitsTest.php",
@@ -18208,7 +18208,7 @@
1820818208
},
1820918209
{
1821018210
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operator\/Repos\/ListCommitsListing.php",
18211-
"hash": "7a38bc52eb26c82f0c3640d3ca409583"
18211+
"hash": "287c2b6b3d55959e287d286ba8aac6a9"
1821218212
},
1821318213
{
1821418214
"name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Internal\/Operation\/Repos\/ListCommitsListingTest.php",
@@ -24532,15 +24532,15 @@
2453224532
},
2453324533
{
2453424534
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Orgs.php",
24535-
"hash": "96d46743d1ec4745550a93ba77931e6e"
24535+
"hash": "8cfd6655e4de9ea89ec9da9a3174204f"
2453624536
},
2453724537
{
2453824538
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Get\/RateLimit.php",
2453924539
"hash": "ba9a8386126fb4da0bb3d4ee7706553e"
2454024540
},
2454124541
{
2454224542
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Repos.php",
24543-
"hash": "9626ac37bfc5b213733c7725590b0f10"
24543+
"hash": "4d1f695e10a9963cd8f8b2e70d2d11de"
2454424544
},
2454524545
{
2454624546
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Users.php",
@@ -24808,15 +24808,15 @@
2480824808
},
2480924809
{
2481024810
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/List\/Orgs.php",
24811-
"hash": "46841c892a2c83b12c66e40760285cc3"
24811+
"hash": "f86a44a39713da0c180c4d4778f384f1"
2481224812
},
2481324813
{
2481424814
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/List\/Packages.php",
2481524815
"hash": "4ab93017e3894ec5748c61024d8a46d7"
2481624816
},
2481724817
{
2481824818
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/List\/Repos.php",
24819-
"hash": "47d873adafe8144a6abcd1a5f99bad64"
24819+
"hash": "91846cea69243c2f2d085dfecc115551"
2482024820
},
2482124821
{
2482224822
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/List\/Activity.php",
@@ -25032,11 +25032,11 @@
2503225032
},
2503325033
{
2503425034
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Five.php",
25035-
"hash": "015bbcc6cb245b33fb432fce715542a2"
25035+
"hash": "4e1280a9e1f8f0b03f90ce4bb54930c1"
2503625036
},
2503725037
{
2503825038
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Six.php",
25039-
"hash": "147555754780b5408e6bdfb6561e2110"
25039+
"hash": "ff1598f5e9ef5299fab4f2da1b0c776b"
2504025040
},
2504125041
{
2504225042
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Seven.php",
@@ -25136,11 +25136,11 @@
2513625136
},
2513725137
{
2513825138
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/List\/Five.php",
25139-
"hash": "91a000b623c924e4346535c91dfe61b2"
25139+
"hash": "847f3fb360c2b185cfe50d6fb2ad225b"
2514025140
},
2514125141
{
2514225142
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/List\/Six.php",
25143-
"hash": "9087a570dd0a970fb0ee07f49bc3ac87"
25143+
"hash": "a029c63fd72389c900f76512d5417ffc"
2514425144
},
2514525145
{
2514625146
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/List\/Seven.php",
@@ -27860,11 +27860,11 @@
2786027860
},
2786127861
{
2786227862
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/PHPStan\/ClientCallReturnTypes.php",
27863-
"hash": "b002443ae2a60a793a714747e3ac2495"
27863+
"hash": "8e7de1d532cfd6885172eb9cc1d111c8"
2786427864
},
2786527865
{
2786627866
"name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Types\/ClientCallReturnTypes.php",
27867-
"hash": "445316701971ab3363c5357452971db4"
27867+
"hash": "85e1300995ec04a030827e737a4f2c5a"
2786827868
},
2786927869
{
2787027870
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/..\/etc\/phpstan-extension.neon",
@@ -28560,47 +28560,47 @@
2856028560
},
2856128561
{
2856228562
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operation\/Orgs\/ListOrgRoleTeams.php",
28563-
"hash": "90d84395ee361782f63d0e922cdc1022"
28563+
"hash": "ba58781ba12e7cde3a414dda69c2fb1d"
2856428564
},
2856528565
{
2856628566
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operator\/Orgs\/ListOrgRoleTeams.php",
28567-
"hash": "7aadf9acadce853f38a11cb64c80035f"
28567+
"hash": "d3f552dc7ca66dc94503d14a7cbd8b22"
2856828568
},
2856928569
{
2857028570
"name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Internal\/Operation\/Orgs\/ListOrgRoleTeamsTest.php",
2857128571
"hash": "58a452b194f5b07927f2f860ec0f734a"
2857228572
},
2857328573
{
2857428574
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operation\/Orgs\/ListOrgRoleTeamsListing.php",
28575-
"hash": "62d3f39d9646b047547e73a2786a3f64"
28575+
"hash": "6638dd077f6e138cf723ca5e70d5bc01"
2857628576
},
2857728577
{
2857828578
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operator\/Orgs\/ListOrgRoleTeamsListing.php",
28579-
"hash": "425083411ab5cabc9410c7a4c1e4ab6a"
28579+
"hash": "5575a3abd5ee171b6917143c493cedab"
2858028580
},
2858128581
{
2858228582
"name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Internal\/Operation\/Orgs\/ListOrgRoleTeamsListingTest.php",
2858328583
"hash": "ba2b0ff66205bd0f25c49c88aa043974"
2858428584
},
2858528585
{
2858628586
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operation\/Orgs\/ListOrgRoleUsers.php",
28587-
"hash": "c620821e2570d612562c09201bc199aa"
28587+
"hash": "0adb150458efc4a8e0d4bc732598bbf9"
2858828588
},
2858928589
{
2859028590
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operator\/Orgs\/ListOrgRoleUsers.php",
28591-
"hash": "b06611b476267a6a79f8092cf5e690aa"
28591+
"hash": "9e2518bbd00baf3ba088472092654ac7"
2859228592
},
2859328593
{
2859428594
"name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Internal\/Operation\/Orgs\/ListOrgRoleUsersTest.php",
2859528595
"hash": "6f01e4f422330659879c1687afa07d37"
2859628596
},
2859728597
{
2859828598
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operation\/Orgs\/ListOrgRoleUsersListing.php",
28599-
"hash": "14a396b575554917437c642acef05987"
28599+
"hash": "f0e3d70274fb6dbc22797ba8b0b8ca42"
2860028600
},
2860128601
{
2860228602
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operator\/Orgs\/ListOrgRoleUsersListing.php",
28603-
"hash": "ad30f1b2baf527a809f1870a20a38e6f"
28603+
"hash": "41f6bd72a83e49445b51e1d86c375324"
2860428604
},
2860528605
{
2860628606
"name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Internal\/Operation\/Orgs\/ListOrgRoleUsersListingTest.php",
@@ -29753,6 +29753,38 @@
2975329753
{
2975429754
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Attribute\/CastUnionToType\/Schema\/CopilotSeatDetails\/Organization.php",
2975529755
"hash": "49df666bb0c15c4980d06323fd5a13ee"
29756+
},
29757+
{
29758+
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/TeamRoleAssignment.php",
29759+
"hash": "3894b060697253081cbcafe9e322e237"
29760+
},
29761+
{
29762+
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/UserRoleAssignment.php",
29763+
"hash": "606c27abe6027c7738798f59f11bd24b"
29764+
},
29765+
{
29766+
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/ProjectsV2SingleSelectOption.php",
29767+
"hash": "aa9b2f92426238ad81c1bac227ddff2d"
29768+
},
29769+
{
29770+
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/ProjectsV2IterationSetting.php",
29771+
"hash": "a7a3380df9dc010eda864b78b5303067"
29772+
},
29773+
{
29774+
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/AliasAbstract\/Tiet0CB51C69\/TietE939AB7B\/TietD52C4E0A\/Tiet05A5E968.php",
29775+
"hash": "f352d662fde30770f621650fbe2c0d11"
29776+
},
29777+
{
29778+
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/TeamRoleAssignment\/Permissions.php",
29779+
"hash": "746cef9fe02585096b28c85398d37739"
29780+
},
29781+
{
29782+
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Attribute\/CastUnionToType\/Schema\/WebhookProjectsV2ItemEdited\/Changes\/Zero\/FieldValue\/From.php",
29783+
"hash": "b13d16440ceb473bdef332acdcd44ba7"
29784+
},
29785+
{
29786+
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Attribute\/CastUnionToType\/Schema\/WebhookProjectsV2ItemEdited\/Changes\/Zero\/FieldValue\/To.php",
29787+
"hash": "090374ccd4315dad0c1a6ea7e9b8f5c4"
2975629788
}
2975729789
]
2975829790
},
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace ApiClients\Client\GitHub\Internal\Attribute\CastUnionToType\Schema\WebhookProjectsV2ItemEdited\Changes\Zero\FieldValue;
6+
7+
use ApiClients\Client\GitHub\Schema;
8+
use Attribute;
9+
use EventSauce\ObjectHydrator\ObjectMapper;
10+
use EventSauce\ObjectHydrator\PropertyCaster;
11+
use Throwable;
12+
13+
use function array_keys;
14+
use function array_unique;
15+
use function implode;
16+
use function is_array;
17+
use function sort;
18+
19+
#[Attribute(Attribute::TARGET_PARAMETER)]
20+
final class From implements PropertyCaster
21+
{
22+
public function cast(mixed $value, ObjectMapper $hydrator): mixed
23+
{
24+
if (is_array($value)) {
25+
$signatureChunks = array_unique(array_keys($value));
26+
sort($signatureChunks);
27+
$signature = implode('|', $signatureChunks);
28+
if ($signature === 'color|description|id|name') {
29+
try {
30+
return $hydrator->hydrateObject(Schema\ProjectsV2SingleSelectOption::class, $value);
31+
} catch (Throwable) {
32+
}
33+
}
34+
35+
if ($signature === 'duration|id|start_date|title') {
36+
try {
37+
return $hydrator->hydrateObject(Schema\ProjectsV2IterationSetting::class, $value);
38+
} catch (Throwable) {
39+
}
40+
}
41+
}
42+
43+
return $value;
44+
}
45+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace ApiClients\Client\GitHub\Internal\Attribute\CastUnionToType\Schema\WebhookProjectsV2ItemEdited\Changes\Zero\FieldValue;
6+
7+
use ApiClients\Client\GitHub\Schema;
8+
use Attribute;
9+
use EventSauce\ObjectHydrator\ObjectMapper;
10+
use EventSauce\ObjectHydrator\PropertyCaster;
11+
use Throwable;
12+
13+
use function array_keys;
14+
use function array_unique;
15+
use function implode;
16+
use function is_array;
17+
use function sort;
18+
19+
#[Attribute(Attribute::TARGET_PARAMETER)]
20+
final class To implements PropertyCaster
21+
{
22+
public function cast(mixed $value, ObjectMapper $hydrator): mixed
23+
{
24+
if (is_array($value)) {
25+
$signatureChunks = array_unique(array_keys($value));
26+
sort($signatureChunks);
27+
$signature = implode('|', $signatureChunks);
28+
if ($signature === 'color|description|id|name') {
29+
try {
30+
return $hydrator->hydrateObject(Schema\ProjectsV2SingleSelectOption::class, $value);
31+
} catch (Throwable) {
32+
}
33+
}
34+
35+
if ($signature === 'duration|id|start_date|title') {
36+
try {
37+
return $hydrator->hydrateObject(Schema\ProjectsV2IterationSetting::class, $value);
38+
} catch (Throwable) {
39+
}
40+
}
41+
}
42+
43+
return $value;
44+
}
45+
}

clients/GitHub/src/Internal/Operation/Orgs/ListOrgRoleTeams.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function createRequest(): RequestInterface
4747
return new Request('GET', str_replace(['{org}', '{role_id}', '{per_page}', '{page}'], [$this->org, $this->roleId, $this->perPage, $this->page], '/orgs/{org}/organization-roles/{role_id}/teams' . '?per_page={per_page}&page={page}'));
4848
}
4949

50-
/** @return Observable<Schema\Team>|WithoutBody */
50+
/** @return Observable<Schema\TeamRoleAssignment>|WithoutBody */
5151
public function createResponse(ResponseInterface $response): Observable|WithoutBody
5252
{
5353
$code = $response->getStatusCode();
@@ -60,12 +60,12 @@ public function createResponse(ResponseInterface $response): Observable|WithoutB
6060
* Response - List of assigned teams
6161
**/
6262
case 200:
63-
return Observable::fromArray($body, new ImmediateScheduler())->map(function (array $body): Schema\Team {
63+
return Observable::fromArray($body, new ImmediateScheduler())->map(function (array $body): Schema\TeamRoleAssignment {
6464
$error = new RuntimeException();
6565
try {
66-
$this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\Team::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema'));
66+
$this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\TeamRoleAssignment::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema'));
6767

68-
return $this->hydrator->hydrateObject(Schema\Team::class, $body);
68+
return $this->hydrator->hydrateObject(Schema\TeamRoleAssignment::class, $body);
6969
} catch (Throwable $error) {
7070
goto items_application_json_two_hundred_aaaaa;
7171
}

clients/GitHub/src/Internal/Operation/Orgs/ListOrgRoleTeamsListing.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function createRequest(): RequestInterface
4747
return new Request('GET', str_replace(['{org}', '{role_id}', '{per_page}', '{page}'], [$this->org, $this->roleId, $this->perPage, $this->page], '/orgs/{org}/organization-roles/{role_id}/teams' . '?per_page={per_page}&page={page}'));
4848
}
4949

50-
/** @return Observable<Schema\Team>|WithoutBody */
50+
/** @return Observable<Schema\TeamRoleAssignment>|WithoutBody */
5151
public function createResponse(ResponseInterface $response): Observable|WithoutBody
5252
{
5353
$code = $response->getStatusCode();
@@ -60,12 +60,12 @@ public function createResponse(ResponseInterface $response): Observable|WithoutB
6060
* Response - List of assigned teams
6161
**/
6262
case 200:
63-
return Observable::fromArray($body, new ImmediateScheduler())->map(function (array $body): Schema\Team {
63+
return Observable::fromArray($body, new ImmediateScheduler())->map(function (array $body): Schema\TeamRoleAssignment {
6464
$error = new RuntimeException();
6565
try {
66-
$this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\Team::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema'));
66+
$this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\TeamRoleAssignment::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema'));
6767

68-
return $this->hydrator->hydrateObject(Schema\Team::class, $body);
68+
return $this->hydrator->hydrateObject(Schema\TeamRoleAssignment::class, $body);
6969
} catch (Throwable $error) {
7070
goto items_application_json_two_hundred_aaaaa;
7171
}

0 commit comments

Comments
 (0)