Skip to content

Commit 61580aa

Browse files
committed
Introduce list for paging calls
1 parent 5d7672b commit 61580aa

File tree

1,908 files changed

+540228
-591513
lines changed

Some content is hidden

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

1,908 files changed

+540228
-591513
lines changed

src/Client.php

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

src/Hydrator/Operation/Admin/Hooks.php

Lines changed: 196 additions & 178 deletions
Large diffs are not rendered by default.

src/Hydrator/Operation/Admin/Hooks/CbHookIdRcb.php

Lines changed: 358 additions & 342 deletions
Large diffs are not rendered by default.

src/Hydrator/Operation/Admin/Keys.php

Lines changed: 125 additions & 134 deletions
Original file line numberDiff line numberDiff line change
@@ -29,138 +29,157 @@ public function hydrateObject(string $className, array $payload): object
2929
}
3030

3131

32-
private function hydrateApiClients⚡️Client⚡️GitHubAE⚡️Schema⚡️PublicKeyFull(array $payload): \ApiClients\Client\GitHubAE\Schema\PublicKeyFull
33-
{
34-
$properties = [];
35-
$missingFields = [];
36-
try {
37-
38-
$value = $payload['id'] ?? null;
39-
40-
if ($value === null) {
41-
$properties['id'] = null;
42-
goto after_id;
43-
}
32+
private function hydrateApiClients⚡️Client⚡️GitHubAE⚡️Schema⚡️PublicKeyFull(array $payload): \ApiClients\Client\GitHubAE\Schema\PublicKeyFull
33+
{
34+
$properties = [];
35+
$missingFields = [];
36+
try {
37+
$value = $payload['id'] ?? null;
4438

45-
$properties['id'] = $value;
46-
47-
after_id:
39+
if ($value === null) {
40+
$missingFields[] = 'id';
41+
goto after_id;
42+
}
4843

49-
$value = $payload['key'] ?? null;
50-
51-
if ($value === null) {
52-
$properties['key'] = null;
53-
goto after_key;
54-
}
44+
$properties['id'] = $value;
5545

56-
$properties['key'] = $value;
57-
58-
after_key:
46+
after_id:
5947

60-
$value = $payload['user_id'] ?? null;
61-
62-
if ($value === null) {
63-
$properties['user_id'] = null;
64-
goto after_user_id;
65-
}
48+
$value = $payload['key'] ?? null;
6649

67-
$properties['user_id'] = $value;
68-
69-
after_user_id:
50+
if ($value === null) {
51+
$missingFields[] = 'key';
52+
goto after_key;
53+
}
7054

71-
$value = $payload['repository_id'] ?? null;
72-
73-
if ($value === null) {
74-
$properties['repository_id'] = null;
75-
goto after_repository_id;
76-
}
55+
$properties['key'] = $value;
7756

78-
$properties['repository_id'] = $value;
79-
80-
after_repository_id:
57+
after_key:
8158

82-
$value = $payload['url'] ?? null;
83-
84-
if ($value === null) {
85-
$properties['url'] = null;
86-
goto after_url;
87-
}
59+
$value = $payload['user_id'] ?? null;
8860

89-
$properties['url'] = $value;
90-
91-
after_url:
61+
if ($value === null) {
62+
$properties['user_id'] = null;
63+
goto after_user_id;
64+
}
9265

93-
$value = $payload['title'] ?? null;
94-
95-
if ($value === null) {
96-
$properties['title'] = null;
97-
goto after_title;
98-
}
66+
$properties['user_id'] = $value;
9967

100-
$properties['title'] = $value;
101-
102-
after_title:
68+
after_user_id:
10369

104-
$value = $payload['read_only'] ?? null;
105-
106-
if ($value === null) {
107-
$properties['read_only'] = null;
108-
goto after_read_only;
109-
}
70+
$value = $payload['repository_id'] ?? null;
11071

111-
$properties['read_only'] = $value;
112-
113-
after_read_only:
72+
if ($value === null) {
73+
$properties['repository_id'] = null;
74+
goto after_repository_id;
75+
}
11476

115-
$value = $payload['verified'] ?? null;
116-
117-
if ($value === null) {
118-
$properties['verified'] = null;
119-
goto after_verified;
120-
}
77+
$properties['repository_id'] = $value;
12178

122-
$properties['verified'] = $value;
123-
124-
after_verified:
79+
after_repository_id:
12580

126-
$value = $payload['created_at'] ?? null;
127-
128-
if ($value === null) {
129-
$properties['created_at'] = null;
130-
goto after_created_at;
131-
}
81+
$value = $payload['url'] ?? null;
13282

133-
$properties['created_at'] = $value;
134-
135-
after_created_at:
83+
if ($value === null) {
84+
$missingFields[] = 'url';
85+
goto after_url;
86+
}
87+
88+
$properties['url'] = $value;
89+
90+
after_url:
91+
92+
$value = $payload['title'] ?? null;
13693

137-
} catch (\Throwable $exception) {
138-
throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHubAE\Schema\PublicKeyFull', $exception, stack: $this->hydrationStack);
94+
if ($value === null) {
95+
$missingFields[] = 'title';
96+
goto after_title;
13997
}
140-
141-
if (count($missingFields) > 0) {
142-
throw UnableToHydrateObject::dueToMissingFields(\ApiClients\Client\GitHubAE\Schema\PublicKeyFull::class, $missingFields, stack: $this->hydrationStack);
98+
99+
$properties['title'] = $value;
100+
101+
after_title:
102+
103+
$value = $payload['read_only'] ?? null;
104+
105+
if ($value === null) {
106+
$missingFields[] = 'read_only';
107+
goto after_read_only;
143108
}
144-
145-
try {
146-
return new \ApiClients\Client\GitHubAE\Schema\PublicKeyFull(...$properties);
147-
} catch (\Throwable $exception) {
148-
throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHubAE\Schema\PublicKeyFull', $exception, stack: $this->hydrationStack);
109+
110+
$properties['read_only'] = $value;
111+
112+
after_read_only:
113+
114+
$value = $payload['verified'] ?? null;
115+
116+
if ($value === null) {
117+
$missingFields[] = 'verified';
118+
goto after_verified;
149119
}
120+
121+
$properties['verified'] = $value;
122+
123+
after_verified:
124+
125+
$value = $payload['created_at'] ?? null;
126+
127+
if ($value === null) {
128+
$missingFields[] = 'created_at';
129+
goto after_created_at;
130+
}
131+
132+
$properties['created_at'] = $value;
133+
134+
after_created_at:
135+
136+
} catch (\Throwable $exception) {
137+
throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHubAE\Schema\PublicKeyFull', $exception, stack: $this->hydrationStack);
150138
}
139+
140+
if (count($missingFields) > 0) {
141+
throw UnableToHydrateObject::dueToMissingFields(\ApiClients\Client\GitHubAE\Schema\PublicKeyFull::class, $missingFields, stack: $this->hydrationStack);
142+
}
143+
144+
try {
145+
return new \ApiClients\Client\GitHubAE\Schema\PublicKeyFull(...$properties);
146+
} catch (\Throwable $exception) {
147+
throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHubAE\Schema\PublicKeyFull', $exception, stack: $this->hydrationStack);
148+
}
149+
}
151150

151+
private function serializeViaTypeMap(string $accessor, object $object, array $payloadToTypeMap): array
152+
{
153+
foreach ($payloadToTypeMap as $payloadType => [$valueType, $method]) {
154+
if (is_a($object, $valueType)) {
155+
return [$accessor => $payloadType] + $this->{$method}($object);
156+
}
157+
}
158+
159+
throw new \LogicException('No type mapped for object of class: ' . get_class($object));
160+
}
161+
152162
public function serializeObject(object $object): mixed
153163
{
154-
try {
155-
$className = get_class($object);
164+
return $this->serializeObjectOfType($object, get_class($object));
165+
}
156166

167+
/**
168+
* @template T
169+
*
170+
* @param T $object
171+
* @param class-string<T> $className
172+
*/
173+
public function serializeObjectOfType(object $object, string $className): mixed
174+
{
175+
try {
157176
return match($className) {
158177
'array' => $this->serializeValuearray($object),
159-
'Ramsey\Uuid\UuidInterface' => $this->serializeValueRamsey⚡️Uuid⚡️UuidInterface($object),
160-
'DateTime' => $this->serializeValueDateTime($object),
161-
'DateTimeImmutable' => $this->serializeValueDateTimeImmutable($object),
162-
'DateTimeInterface' => $this->serializeValueDateTimeInterface($object),
163-
'ApiClients\Client\GitHubAE\Schema\PublicKeyFull' => $this->serializeObjectApiClients⚡️Client⚡️GitHubAE⚡️Schema⚡️PublicKeyFull($object),
178+
'Ramsey\Uuid\UuidInterface' => $this->serializeValueRamsey⚡️Uuid⚡️UuidInterface($object),
179+
'DateTime' => $this->serializeValueDateTime($object),
180+
'DateTimeImmutable' => $this->serializeValueDateTimeImmutable($object),
181+
'DateTimeInterface' => $this->serializeValueDateTimeInterface($object),
182+
'ApiClients\Client\GitHubAE\Schema\PublicKeyFull' => $this->serializeObjectApiClients⚡️Client⚡️GitHubAE⚡️Schema⚡️PublicKeyFull($object),
164183
default => throw new \LogicException('No serialization defined for $className'),
165184
};
166185
} catch (\Throwable $exception) {
@@ -233,25 +252,17 @@ private function serializeValueDateTimeInterface(mixed $value): mixed
233252
return $serializer->serialize($value, $this);
234253
}
235254

236-
255+
237256
private function serializeObjectApiClients⚡️Client⚡️GitHubAE⚡️Schema⚡️PublicKeyFull(mixed $object): mixed
238257
{
239258
\assert($object instanceof \ApiClients\Client\GitHubAE\Schema\PublicKeyFull);
240259
$result = [];
241-
242-
$id = $object->id;
243260

244-
if ($id === null) {
245-
goto after_id;
246-
}
261+
$id = $object->id;
247262
after_id: $result['id'] = $id;
248263

249264

250265
$key = $object->key;
251-
252-
if ($key === null) {
253-
goto after_key;
254-
}
255266
after_key: $result['key'] = $key;
256267

257268

@@ -272,42 +283,22 @@ private function serializeObjectApiClients⚡️Client⚡️GitHubAE⚡️Schema
272283

273284

274285
$url = $object->url;
275-
276-
if ($url === null) {
277-
goto after_url;
278-
}
279286
after_url: $result['url'] = $url;
280287

281288

282289
$title = $object->title;
283-
284-
if ($title === null) {
285-
goto after_title;
286-
}
287290
after_title: $result['title'] = $title;
288291

289292

290293
$read_only = $object->read_only;
291-
292-
if ($read_only === null) {
293-
goto after_read_only;
294-
}
295294
after_read_only: $result['read_only'] = $read_only;
296295

297296

298297
$verified = $object->verified;
299-
300-
if ($verified === null) {
301-
goto after_verified;
302-
}
303298
after_verified: $result['verified'] = $verified;
304299

305300

306301
$created_at = $object->created_at;
307-
308-
if ($created_at === null) {
309-
goto after_created_at;
310-
}
311302
after_created_at: $result['created_at'] = $created_at;
312303

313304

0 commit comments

Comments
 (0)