Skip to content

Commit f44d613

Browse files
WyriHaximusgithub-actions[bot]
authored andcommitted
[GitHub] Update to 1.1.4-f1a89aa5fb6ef3d7a6d77044c06b8756 from 1.1.4-5758ce6a93c789209abf3a01ab532091
Detected Schema changes: ``` ├─┬Paths │ ├──[➖] path (10205:3)❌ │ ├──[➖] path (10053:3)❌ │ ├──[➖] path (10020:3)❌ │ ├──[➖] path (10237:3)❌ │ ├──[➖] path (10112:3)❌ │ ├──[➖] path (10082:3)❌ │ ├──[➖] path (10144:3)❌ │ ├──[➖] path (10174:3)❌ │ ├──[➖] path (9985:3)❌ │ ├─┬/users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id} │ │ ├─┬GET │ │ │ └──[🔀] description (48006:20) │ │ └─┬DELETE │ │ └──[🔀] description (48038:20) │ ├─┬/users/{username}/packages │ │ └─┬GET │ │ └──[🔀] description (47801:20) │ ├─┬/orgs/{org}/hooks/{hook_id}/deliveries │ │ └─┬GET │ │ └──[➕] parameters (9868:15)❌ │ ├─┬/orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore │ │ └─┬POST │ │ └──[🔀] description (12007:20) │ ├─┬/user/packages/{package_type}/{package_name}/restore │ │ └─┬POST │ │ └──[🔀] description (45860:20) │ ├─┬/orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id} │ │ ├─┬GET │ │ │ └──[🔀] description (11941:20) │ │ └─┬DELETE │ │ └──[🔀] description (11973:20) │ ├─┬/user/packages/{package_type}/{package_name}/versions/{package_version_id} │ │ ├─┬GET │ │ │ └──[🔀] description (45951:20) │ │ └─┬DELETE │ │ └──[🔀] description (45982:20) │ ├─┬/orgs/{org}/packages │ │ └─┬GET │ │ └──[🔀] description (11712:20) │ ├─┬/orgs/{org}/packages/{package_type}/{package_name}/versions │ │ └─┬GET │ │ └──[🔀] description (11889:20) │ ├─┬/user/packages/{package_type}/{package_name} │ │ ├─┬GET │ │ │ └──[🔀] description (45800:20) │ │ └─┬DELETE │ │ └──[🔀] description (45830:20) │ ├─┬/orgs/{org}/personal-access-token-requests │ │ └─┬GET │ │ └─┬Responses │ │ └─┬200 │ │ └─┬application/json │ │ └─┬default │ │ └──[🔀] value (206120:7) │ ├─┬/orgs/{org}/personal-access-tokens │ │ └─┬GET │ │ └─┬Responses │ │ └─┬200 │ │ └─┬application/json │ │ └─┬default │ │ └──[🔀] value (206154:7) │ ├─┬/user/packages │ │ └─┬GET │ │ └──[🔀] description (45747:20) │ ├─┬/users/{username}/packages/{package_type}/{package_name}/restore │ │ └─┬POST │ │ └──[🔀] description (47923:20) │ ├─┬/users/{username}/packages/{package_type}/{package_name}/versions │ │ └─┬GET │ │ └──[🔀] description (47966:20) │ ├─┬/app/hook/deliveries │ │ └─┬GET │ │ └──[➕] parameters (508:15)❌ │ ├─┬/repos/{owner}/{repo}/hooks/{hook_id}/deliveries │ │ └─┬GET │ │ └──[➕] parameters (30830:15)❌ │ ├─┬/orgs/{org}/packages/{package_type}/{package_name}/restore │ │ └─┬POST │ │ └──[🔀] description (11846:20) │ ├─┬/user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore │ │ └─┬POST │ │ └──[🔀] description (46015:20) │ ├─┬/orgs/{org}/packages/{package_type}/{package_name} │ │ ├─┬GET │ │ │ └──[🔀] description (11782:20) │ │ └─┬DELETE │ │ └──[🔀] description (11813:20) │ ├─┬/user/packages/{package_type}/{package_name}/versions │ │ └─┬GET │ │ └──[🔀] description (45900:20) │ ├─┬/users/{username}/packages/{package_type}/{package_name} │ │ ├─┬GET │ │ │ └──[🔀] description (47859:20) │ │ └─┬DELETE │ │ └──[🔀] description (47890:20) │ └─┬/users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore │ └─┬POST │ └──[🔀] description (48072:20) └─┬Components ├──[➖] parameters (225782:7)❌ ├──[➖] parameters (225849:7)❌ ├──[➖] parameters (225809:7)❌ ├──[➖] parameters (225795:7)❌ ├──[➖] parameters (225833:7)❌ ├──[➖] parameters (225856:7)❌ ├──[➖] parameters (225816:7)❌ ├──[➖] parameters (225802:7)❌ ├──[➖] examples (205457:7)❌ ├──[➖] examples (205467:7)❌ ├──[➖] examples (205491:7)❌ ├──[➖] examples (205449:7)❌ ├──[➖] examples (205471:7)❌ ├──[➖] schemas (74238:7)❌ ├──[➖] schemas (74210:7)❌ ├──[➖] schemas (74291:7)❌ ├──[➖] schemas (74276:7)❌ ├──[➖] schemas (74262:7)❌ ├─┬organization-programmatic-access-grant │ ├──[➖] required (74997:9)❌ │ ├──[➖] properties (74969:9)❌ │ └─┬id │ └──[🔀] description (74541:24) ├─┬personal-access-token-request │ ├──[➖] required (96964:9)❌ │ └──[➖] properties (96933:9)❌ ├─┬organization-programmatic-access-grant-request │ ├──[➖] required (74921:9)❌ │ └──[➖] properties (74892:9)❌ └─┬check-suite └─┬id └──[➖] format (81351:19)❌ ``` | Document Element | Total Changes | Breaking Changes | |------------------|---------------|------------------| | paths | 38 | 12 | | components | 26 | 25 | Date: 11/01/24 | Commit: New: etc/specs/GitHub/previous.spec.yaml, Original: etc/specs/GitHub/current.spec.yaml - ❌ **BREAKING Changes**: _37_ out of _64_ - **Modifications**: _27_ - **Removals**: _34_ - **Additions**: _3_ - **Breaking Removals**: _34_ - **Breaking Additions**: _3_ ERROR: breaking changes discovered
1 parent c0922fd commit f44d613

File tree

95 files changed

+5301
-241
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+5301
-241
lines changed

clients/GitHub/README.md

Lines changed: 366 additions & 6 deletions
Large diffs are not rendered by default.

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

Lines changed: 235 additions & 47 deletions
Large diffs are not rendered by default.

clients/GitHub/src/Client.php

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

clients/GitHub/src/ClientInterface.php

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
Lines changed: 248 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,248 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace ApiClients\Client\GitHub\Internal\Hydrator\Operation\Orgs\Org\Insights\Api;
6+
7+
use ApiClients\Client\GitHub\Schema\ApiInsightsSummaryStats;
8+
use EventSauce\ObjectHydrator\IterableList;
9+
use EventSauce\ObjectHydrator\ObjectMapper;
10+
use EventSauce\ObjectHydrator\PropertySerializers\SerializeArrayItems;
11+
use EventSauce\ObjectHydrator\PropertySerializers\SerializeDateTime;
12+
use EventSauce\ObjectHydrator\PropertySerializers\SerializeUuidToString;
13+
use EventSauce\ObjectHydrator\UnableToHydrateObject;
14+
use EventSauce\ObjectHydrator\UnableToSerializeObject;
15+
use Generator;
16+
use LogicException;
17+
use Throwable;
18+
19+
use function assert;
20+
use function count;
21+
use function is_a;
22+
23+
class SummaryStats implements ObjectMapper
24+
{
25+
private array $hydrationStack = [];
26+
27+
public function __construct()
28+
{
29+
}
30+
31+
/**
32+
* @param class-string<T> $className
33+
*
34+
* @return T
35+
*
36+
* @template T of object
37+
*/
38+
public function hydrateObject(string $className, array $payload): object
39+
{
40+
return match ($className) {
41+
'ApiClients\Client\GitHub\Schema\ApiInsightsSummaryStats' => $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️ApiInsightsSummaryStats($payload),
42+
default => throw UnableToHydrateObject::noHydrationDefined($className, $this->hydrationStack),
43+
};
44+
}
45+
46+
private function hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️ApiInsightsSummaryStats(array $payload): ApiInsightsSummaryStats
47+
{
48+
$properties = [];
49+
$missingFields = [];
50+
try {
51+
$value = $payload['total_request_count'] ?? null;
52+
53+
if ($value === null) {
54+
$properties['totalRequestCount'] = null;
55+
goto after_totalRequestCount;
56+
}
57+
58+
$properties['totalRequestCount'] = $value;
59+
60+
after_totalRequestCount:
61+
62+
$value = $payload['rate_limited_request_count'] ?? null;
63+
64+
if ($value === null) {
65+
$properties['rateLimitedRequestCount'] = null;
66+
goto after_rateLimitedRequestCount;
67+
}
68+
69+
$properties['rateLimitedRequestCount'] = $value;
70+
71+
after_rateLimitedRequestCount:
72+
} catch (Throwable $exception) {
73+
throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\ApiInsightsSummaryStats', $exception, stack: $this->hydrationStack);
74+
}
75+
76+
if (count($missingFields) > 0) {
77+
throw UnableToHydrateObject::dueToMissingFields(ApiInsightsSummaryStats::class, $missingFields, stack: $this->hydrationStack);
78+
}
79+
80+
try {
81+
return new ApiInsightsSummaryStats(...$properties);
82+
} catch (Throwable $exception) {
83+
throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\ApiInsightsSummaryStats', $exception, stack: $this->hydrationStack);
84+
}
85+
}
86+
87+
private function serializeViaTypeMap(string $accessor, object $object, array $payloadToTypeMap): array
88+
{
89+
foreach ($payloadToTypeMap as $payloadType => [$valueType, $method]) {
90+
if (is_a($object, $valueType)) {
91+
return [$accessor => $payloadType] + $this->{$method}($object);
92+
}
93+
}
94+
95+
throw new LogicException('No type mapped for object of class: ' . $object::class);
96+
}
97+
98+
public function serializeObject(object $object): mixed
99+
{
100+
return $this->serializeObjectOfType($object, $object::class);
101+
}
102+
103+
/**
104+
* @param T $object
105+
* @param class-string<T> $className
106+
*
107+
* @template T
108+
*/
109+
public function serializeObjectOfType(object $object, string $className): mixed
110+
{
111+
try {
112+
return match ($className) {
113+
'array' => $this->serializeValuearray($object),
114+
'Ramsey\Uuid\UuidInterface' => $this->serializeValueRamsey⚡️Uuid⚡️UuidInterface($object),
115+
'DateTime' => $this->serializeValueDateTime($object),
116+
'DateTimeImmutable' => $this->serializeValueDateTimeImmutable($object),
117+
'DateTimeInterface' => $this->serializeValueDateTimeInterface($object),
118+
'ApiClients\Client\GitHub\Schema\ApiInsightsSummaryStats' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️ApiInsightsSummaryStats($object),
119+
default => throw new LogicException("No serialization defined for $className"),
120+
};
121+
} catch (Throwable $exception) {
122+
throw UnableToSerializeObject::dueToError($className, $exception);
123+
}
124+
}
125+
126+
private function serializeValuearray(mixed $value): mixed
127+
{
128+
static $serializer;
129+
130+
if ($serializer === null) {
131+
$serializer = new SerializeArrayItems(...[]);
132+
}
133+
134+
return $serializer->serialize($value, $this);
135+
}
136+
137+
private function serializeValueRamsey⚡️Uuid⚡️UuidInterface(mixed $value): mixed
138+
{
139+
static $serializer;
140+
141+
if ($serializer === null) {
142+
$serializer = new SerializeUuidToString(...[]);
143+
}
144+
145+
return $serializer->serialize($value, $this);
146+
}
147+
148+
private function serializeValueDateTime(mixed $value): mixed
149+
{
150+
static $serializer;
151+
152+
if ($serializer === null) {
153+
$serializer = new SerializeDateTime(...[]);
154+
}
155+
156+
return $serializer->serialize($value, $this);
157+
}
158+
159+
private function serializeValueDateTimeImmutable(mixed $value): mixed
160+
{
161+
static $serializer;
162+
163+
if ($serializer === null) {
164+
$serializer = new SerializeDateTime(...[]);
165+
}
166+
167+
return $serializer->serialize($value, $this);
168+
}
169+
170+
private function serializeValueDateTimeInterface(mixed $value): mixed
171+
{
172+
static $serializer;
173+
174+
if ($serializer === null) {
175+
$serializer = new SerializeDateTime(...[]);
176+
}
177+
178+
return $serializer->serialize($value, $this);
179+
}
180+
181+
private function serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️ApiInsightsSummaryStats(mixed $object): mixed
182+
{
183+
assert($object instanceof ApiInsightsSummaryStats);
184+
$result = [];
185+
186+
$totalRequestCount = $object->totalRequestCount;
187+
188+
if ($totalRequestCount === null) {
189+
goto after_totalRequestCount;
190+
}
191+
192+
after_totalRequestCount: $result['total_request_count'] = $totalRequestCount;
193+
194+
$rateLimitedRequestCount = $object->rateLimitedRequestCount;
195+
196+
if ($rateLimitedRequestCount === null) {
197+
goto after_rateLimitedRequestCount;
198+
}
199+
200+
after_rateLimitedRequestCount: $result['rate_limited_request_count'] = $rateLimitedRequestCount;
201+
202+
return $result;
203+
}
204+
205+
/**
206+
* @param class-string<T> $className
207+
* @param iterable<array> $payloads;
208+
*
209+
* @return IterableList<T>
210+
*
211+
* @throws UnableToHydrateObject
212+
*
213+
* @template T
214+
*/
215+
public function hydrateObjects(string $className, iterable $payloads): IterableList
216+
{
217+
return new IterableList($this->doHydrateObjects($className, $payloads));
218+
}
219+
220+
private function doHydrateObjects(string $className, iterable $payloads): Generator
221+
{
222+
foreach ($payloads as $index => $payload) {
223+
yield $index => $this->hydrateObject($className, $payload);
224+
}
225+
}
226+
227+
/**
228+
* @param class-string<T> $className
229+
* @param iterable<array> $payloads;
230+
*
231+
* @return IterableList<T>
232+
*
233+
* @throws UnableToSerializeObject
234+
*
235+
* @template T
236+
*/
237+
public function serializeObjects(iterable $payloads): IterableList
238+
{
239+
return new IterableList($this->doSerializeObjects($payloads));
240+
}
241+
242+
private function doSerializeObjects(iterable $objects): Generator
243+
{
244+
foreach ($objects as $index => $object) {
245+
yield $index => $this->serializeObject($object);
246+
}
247+
}
248+
}

0 commit comments

Comments
 (0)