Skip to content

Commit 4f18df0

Browse files
authored
[GitHubEnterpriseCloud] Update to 1.1.4 (hash: 5a3b2217d0f5c4cd6c6a55bb66f09657) from 1.1.4 (hash: 6d9045e85589a36f37fe1eecd4338b2b)
Detected Schema changes: ERROR: error: Error thrown when comparing: local lookups are not permitted, please set AllowFileLookup to true in the configuration component 'server-statistics-actions.yaml' does not exist in the specification local lookups are not permitted, please set AllowFileLookup to true in the configuration component 'server-statistics-packages.yaml' does not exist in the specification cannot resolve reference `server-statistics-actions.yaml`, it's missing: [210120:11] cannot resolve reference `server-statistics-packages.yaml`, it's missing: [210122:11] local lookups are not permitted, please set AllowFileLookup to true in the configuration component 'server-statistics-actions.yaml' does not exist in the specification local lookups are not permitted, please set AllowFileLookup to true in the configuration component 'server-statistics-packages.yaml' does not exist in the specification cannot resolve reference `server-statistics-actions.yaml`, it's missing: [210054:11] cannot resolve reference `server-statistics-packages.yaml`, it's missing: [210056:11] ERROR: local lookups are not permitted, please set AllowFileLookup to true in the configuration ERROR: component 'server-statistics-actions.yaml' does not exist in the specification ERROR: local lookups are not permitted, please set AllowFileLookup to true in the configuration ERROR: component 'server-statistics-packages.yaml' does not exist in the specification ERROR: cannot resolve reference `server-statistics-actions.yaml`, it's missing: [210120:11] ERROR: cannot resolve reference `server-statistics-packages.yaml`, it's missing: [210122:11] ERROR: local lookups are not permitted, please set AllowFileLookup to true in the configuration ERROR: component 'server-statistics-actions.yaml' does not exist in the specification ERROR: local lookups are not permitted, please set AllowFileLookup to true in the configuration ERROR: component 'server-statistics-packages.yaml' does not exist in the specification ERROR: cannot resolve reference `server-statistics-actions.yaml`, it's missing: [210054:11] ERROR: cannot resolve reference `server-statistics-packages.yaml`, it's missing: [210056:11]
1 parent 21ac8fc commit 4f18df0

38 files changed

+961
-443
lines changed

README.md

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

etc/openapi-client-generator.state

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

src/Client.php

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

src/ClientInterface.php

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

src/Hydrator/Operation/Organizations/Org/Copilot/Billing.php renamed to src/Hydrator/Operation/Orgs/Org/Copilot/Billing.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace ApiClients\Client\GitHubEnterpriseCloud\Hydrator\Operation\Organizations\Org\Copilot;
5+
namespace ApiClients\Client\GitHubEnterpriseCloud\Hydrator\Operation\Orgs\Org\Copilot;
66

77
use EventSauce\ObjectHydrator\IterableList;
88
use EventSauce\ObjectHydrator\ObjectMapper;

src/Hydrator/Operation/Organizations/Org/Copilot/Billing/Seats.php renamed to src/Hydrator/Operation/Orgs/Org/Copilot/Billing/Seats.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace ApiClients\Client\GitHubEnterpriseCloud\Hydrator\Operation\Organizations\Org\Copilot\Billing;
5+
namespace ApiClients\Client\GitHubEnterpriseCloud\Hydrator\Operation\Orgs\Org\Copilot\Billing;
66

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

0 commit comments

Comments
 (0)