Skip to content

Commit ae4cce0

Browse files
authored
Merge pull request #1205 from php-api-clients/GitHub/from-1.1.4-d2d01395df29a6b406754b59eca9b64e-from-1.1.4-d2d01395df29a6b406754b59eca9b64e
2 parents 84b8900 + ce8dea7 commit ae4cce0

File tree

26 files changed

+762
-419
lines changed

26 files changed

+762
-419
lines changed

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

Lines changed: 31 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"specHash": "49e6f9eda2f9b53adb152deaeefd9f73",
2+
"specHash": "d2d01395df29a6b406754b59eca9b64e",
33
"generatedFiles": {
44
"files": [
55
{
@@ -5612,7 +5612,7 @@
56125612
},
56135613
{
56145614
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Operation\/Repos.php",
5615-
"hash": "a21819b5b3b7a443062a4e276dc644bd"
5615+
"hash": "b74e6ee7b2f5433a82d81322bbf61f55"
56165616
},
56175617
{
56185618
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Operation\/Billing.php",
@@ -11736,15 +11736,15 @@
1173611736
},
1173711737
{
1173811738
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/CopilotSeatDetails.php",
11739-
"hash": "b4f5c046eb575da3e9a34bfb0e4fe203"
11739+
"hash": "0baceb0b67e31067c394dd3b086ab5fb"
1174011740
},
1174111741
{
1174211742
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/Organization\/Plan.php",
1174311743
"hash": "2c844af6f534301f4c76567e51769f88"
1174411744
},
1174511745
{
1174611746
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/Operations\/Copilot\/ListCopilotSeats\/Response\/ApplicationJson\/Ok.php",
11747-
"hash": "c14e9f5b8a8320ca1972d0db3203467c"
11747+
"hash": "1bbb0c213411cedd60d1974bb0bd5bf5"
1174811748
},
1174911749
{
1175011750
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/AliasAbstract\/TietF5944C0A\/TietAA99D7D8\/Tiet9AE1F544\/TietA28F869C.php",
@@ -18192,23 +18192,23 @@
1819218192
},
1819318193
{
1819418194
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operation\/Repos\/ListCommits.php",
18195-
"hash": "70ff1547a18819490551a5269d60934c"
18195+
"hash": "94b5da0296f2c22126f860fbf88ed5b8"
1819618196
},
1819718197
{
1819818198
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operator\/Repos\/ListCommits.php",
18199-
"hash": "4458e4274c60575975efe776eb875881"
18199+
"hash": "f355ab3ab72be2f524e829422aa6d684"
1820018200
},
1820118201
{
1820218202
"name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Internal\/Operation\/Repos\/ListCommitsTest.php",
1820318203
"hash": "dec79558c09491fb76950b477c935c7e"
1820418204
},
1820518205
{
1820618206
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operation\/Repos\/ListCommitsListing.php",
18207-
"hash": "31499dfa82c978cbd853588917c56cd2"
18207+
"hash": "fd37b77dffef4dd32771c2fbb3b6aee6"
1820818208
},
1820918209
{
1821018210
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operator\/Repos\/ListCommitsListing.php",
18211-
"hash": "287c2b6b3d55959e287d286ba8aac6a9"
18211+
"hash": "7a38bc52eb26c82f0c3640d3ca409583"
1821218212
},
1821318213
{
1821418214
"name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Internal\/Operation\/Repos\/ListCommitsListingTest.php",
@@ -18388,7 +18388,7 @@
1838818388
},
1838918389
{
1839018390
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operator\/Repos\/GetContent.php",
18391-
"hash": "6dda1eee9e286a64daa647503cb8d778"
18391+
"hash": "41dafdf79ff5731e202003c50cd33ed5"
1839218392
},
1839318393
{
1839418394
"name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Internal\/Operation\/Repos\/GetContentTest.php",
@@ -24404,7 +24404,7 @@
2440424404
},
2440524405
{
2440624406
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Attribute\/CastUnionToType\/Schema\/CopilotSeatDetails\/AssigningTeam.php",
24407-
"hash": "983414e80783623aa5a8fc74969b72fd"
24407+
"hash": "86b25b1c2530248be880cee5d37b0759"
2440824408
},
2440924409
{
2441024410
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Attribute\/CastUnionToType\/Schema\/RepositoryRuleset\/Conditions.php",
@@ -24540,7 +24540,7 @@
2454024540
},
2454124541
{
2454224542
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Repos.php",
24543-
"hash": "22fa28ba8fe25cb0fc8ec0213e0a29f0"
24543+
"hash": "9626ac37bfc5b213733c7725590b0f10"
2454424544
},
2454524545
{
2454624546
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Users.php",
@@ -24816,7 +24816,7 @@
2481624816
},
2481724817
{
2481824818
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/List\/Repos.php",
24819-
"hash": "91846cea69243c2f2d085dfecc115551"
24819+
"hash": "47d873adafe8144a6abcd1a5f99bad64"
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": "4e1280a9e1f8f0b03f90ce4bb54930c1"
25035+
"hash": "015bbcc6cb245b33fb432fce715542a2"
2503625036
},
2503725037
{
2503825038
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Six.php",
25039-
"hash": "dfffd0f26a3f969d8d937bb6b3ddb983"
25039+
"hash": "147555754780b5408e6bdfb6561e2110"
2504025040
},
2504125041
{
2504225042
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Seven.php",
@@ -25136,7 +25136,7 @@
2513625136
},
2513725137
{
2513825138
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/List\/Five.php",
25139-
"hash": "847f3fb360c2b185cfe50d6fb2ad225b"
25139+
"hash": "91a000b623c924e4346535c91dfe61b2"
2514025140
},
2514125141
{
2514225142
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/List\/Six.php",
@@ -25684,7 +25684,7 @@
2568425684
},
2568525685
{
2568625686
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Hydrator\/Operation\/Orgs\/Org\/Members\/Username\/Copilot.php",
25687-
"hash": "71652a955b8ce4b9e0275361983bf2e4"
25687+
"hash": "f8ac03c8d91928df010947fd46f09c52"
2568825688
},
2568925689
{
2569025690
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Hydrator\/Operation\/Orgs\/Org\/Memberships\/Username.php",
@@ -27720,7 +27720,7 @@
2772027720
},
2772127721
{
2772227722
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/OrgCustomProperty.php",
27723-
"hash": "346a2591793d92ffd067dd78f1b32daa"
27723+
"hash": "65a33ee5e648a5ba6e1d05efeb490ae0"
2772427724
},
2772527725
{
2772627726
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/CustomPropertyValue.php",
@@ -27732,11 +27732,11 @@
2773227732
},
2773327733
{
2773427734
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/Orgs\/CreateOrUpdateCustomProperties\/Request\/ApplicationJson.php",
27735-
"hash": "2cf296fc3394bbb6c98cf2f3d3b996b7"
27735+
"hash": "7e4c0e350553bd7fa97e17c254300089"
2773627736
},
2773727737
{
2773827738
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/Orgs\/CreateOrUpdateCustomProperty\/Request\/ApplicationJson.php",
27739-
"hash": "4f93053bc6b09f3cff18e512d6586d22"
27739+
"hash": "0e9216cc4ebcd6496c7a61917240f35a"
2774027740
},
2774127741
{
2774227742
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/Orgs\/CreateOrUpdateCustomPropertiesValuesForRepos\/Request\/ApplicationJson.php",
@@ -27760,15 +27760,15 @@
2776027760
},
2776127761
{
2776227762
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/WebhookCustomPropertyCreated.php",
27763-
"hash": "9cca145c9c9666d4b2a65cc5cbb6d463"
27763+
"hash": "2a6559dd8af8eb77f03772a4ecf0f9f8"
2776427764
},
2776527765
{
2776627766
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/WebhookCustomPropertyDeleted.php",
2776727767
"hash": "1ad943228cde8e04a98bc01bd4c9cfc5"
2776827768
},
2776927769
{
2777027770
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/WebhookCustomPropertyUpdated.php",
27771-
"hash": "3f6a58bbe7b47887398df894d5a954db"
27771+
"hash": "7c512bd8491eee84272b51a40f32006f"
2777227772
},
2777327773
{
2777427774
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/WebhookCustomPropertyValuesUpdated.php",
@@ -27860,11 +27860,11 @@
2786027860
},
2786127861
{
2786227862
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/PHPStan\/ClientCallReturnTypes.php",
27863-
"hash": "8aa5147af69d96895d72bc4d79b341d5"
27863+
"hash": "b002443ae2a60a793a714747e3ac2495"
2786427864
},
2786527865
{
2786627866
"name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Types\/ClientCallReturnTypes.php",
27867-
"hash": "194e4e5eaf64a8812d232273edd2eec8"
27867+
"hash": "445316701971ab3363c5357452971db4"
2786827868
},
2786927869
{
2787027870
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/..\/etc\/phpstan-extension.neon",
@@ -29745,6 +29745,14 @@
2974529745
{
2974629746
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Hydrator\/Operation\/Repos\/Owner\/Repo\/CodeScanning\/Codeql\/VariantAnalyses\/CodeqlVariantAnalysisId\/Repos\/RepoOwner\/RepoName.php",
2974729747
"hash": "d70667855a951ed18a4a300b51e2c76c"
29748+
},
29749+
{
29750+
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/EnterpriseTeam.php",
29751+
"hash": "51e5783bc5a7386bf224c3f287495da8"
29752+
},
29753+
{
29754+
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Attribute\/CastUnionToType\/Schema\/CopilotSeatDetails\/Organization.php",
29755+
"hash": "49df666bb0c15c4980d06323fd5a13ee"
2974829756
}
2974929757
]
2975029758
},

clients/GitHub/src/Internal/Attribute/CastUnionToType/Schema/CopilotSeatDetails/AssigningTeam.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ public function cast(mixed $value, ObjectMapper $hydrator): mixed
3131
} catch (Throwable) {
3232
}
3333
}
34+
35+
if ($signature === 'created_at|group_id|html_url|id|members_url|name|slug|sync_to_organizations|updated_at|url') {
36+
try {
37+
return $hydrator->hydrateObject(Schema\EnterpriseTeam::class, $value);
38+
} catch (Throwable) {
39+
}
40+
}
3441
}
3542

3643
return $value;
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace ApiClients\Client\GitHub\Internal\Attribute\CastUnionToType\Schema\CopilotSeatDetails;
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 Organization 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 === 'avatar_url|description|events_url|hooks_url|id|issues_url|login|members_url|node_id|public_members_url|repos_url|url') {
29+
try {
30+
return $hydrator->hydrateObject(Schema\OrganizationSimple::class, $value);
31+
} catch (Throwable) {
32+
}
33+
}
34+
}
35+
36+
return $value;
37+
}
38+
}

0 commit comments

Comments
 (0)