Skip to content

Commit ad74d39

Browse files
authored
[GitHubEnterpriseCloud] Update to 1.1.4 (hash: 6ce177c12eeaa6eef68f684846108439) from 1.1.4 (hash: c1d23f276b94058b71c5f697bacbd4cf)
Detected Schema changes: ERROR: error: Error thrown when comparing: local lookups are not permitted, please set AllowFileLookup to true in the configuration 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: [210497:11] ERROR: cannot resolve reference `server-statistics-packages.yaml`, it's missing: [210499: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: [210146:11] ERROR: cannot resolve reference `server-statistics-packages.yaml`, it's missing: [210148:11]
1 parent e9337b4 commit ad74d39

File tree

15 files changed

+744
-117
lines changed

15 files changed

+744
-117
lines changed

README.md

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

src/Hydrators.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,7 @@ final class Hydrators implements ObjectMapper
306306
private Hydrator\Operation\Repos\Owner\Repo\Actions\Workflows\WorkflowId\Enable|null $operation🌀Repos🌀Owner🌀Repo🌀Actions🌀Workflows🌀WorkflowId🌀Enable = null;
307307
private Hydrator\Operation\Repos\Owner\Repo\Actions\Workflows\WorkflowId\Runs|null $operation🌀Repos🌀Owner🌀Repo🌀Actions🌀Workflows🌀WorkflowId🌀Runs = null;
308308
private Hydrator\Operation\Repos\Owner\Repo\Actions\Workflows\WorkflowId\Timing|null $operation🌀Repos🌀Owner🌀Repo🌀Actions🌀Workflows🌀WorkflowId🌀Timing = null;
309+
private Hydrator\Operation\Repos\Owner\Repo\Activity|null $operation🌀Repos🌀Owner🌀Repo🌀Activity = null;
309310
private Hydrator\Operation\Repos\Owner\Repo\Assignees|null $operation🌀Repos🌀Owner🌀Repo🌀Assignees = null;
310311
private Hydrator\Operation\Repos\Owner\Repo\Assignees\Assignee|null $operation🌀Repos🌀Owner🌀Repo🌀Assignees🌀Assignee = null;
311312
private Hydrator\Operation\Repos\Owner\Repo\Autolinks|null $operation🌀Repos🌀Owner🌀Repo🌀Autolinks = null;
@@ -3867,6 +3868,15 @@ public function getObjectMapperOperation🌀Repos🌀Owner🌀Repo🌀Actions
38673868
return $this->operation🌀Repos🌀Owner🌀Repo🌀Actions🌀Workflows🌀WorkflowId🌀Timing;
38683869
}
38693870

3871+
public function getObjectMapperOperation🌀Repos🌀Owner🌀Repo🌀Activity(): Hydrator\Operation\Repos\Owner\Repo\Activity
3872+
{
3873+
if ($this->operation🌀Repos🌀Owner🌀Repo🌀Activity instanceof Hydrator\Operation\Repos\Owner\Repo\Activity === false) {
3874+
$this->operation🌀Repos🌀Owner🌀Repo🌀Activity = new Hydrator\Operation\Repos\Owner\Repo\Activity();
3875+
}
3876+
3877+
return $this->operation🌀Repos🌀Owner🌀Repo🌀Activity;
3878+
}
3879+
38703880
public function getObjectMapperOperation🌀Repos🌀Owner🌀Repo🌀Assignees(): Hydrator\Operation\Repos\Owner\Repo\Assignees
38713881
{
38723882
if ($this->operation🌀Repos🌀Owner🌀Repo🌀Assignees instanceof Hydrator\Operation\Repos\Owner\Repo\Assignees === false) {

src/Operation/DependencyGraph/DiffRange.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function createResponse(ResponseInterface $response): mixed
6262

6363
throw new ErrorSchemas\BasicError(404, $this->hydrator->hydrateObject(Schema\BasicError::class, $body));
6464
/**
65-
* Forbidden
65+
* Response if GitHub Advanced Security is not enabled for this repository
6666
**/
6767

6868
case 403:

src/Operation/Repos.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,15 @@ public function update(string $owner, string $repo, array $params): PromiseInter
111111
return $this->operator[Operator\Repos\Update::class]->call($owner, $repo, $params);
112112
}
113113

114+
public function listActivities(string $owner, string $repo, string $before, string $after, string $ref, string $actor, string $timePeriod, string $activityType, string $direction, int $perPage): PromiseInterface
115+
{
116+
if (array_key_exists(Operator\Repos\ListActivities::class, $this->operator) === false) {
117+
$this->operator[Operator\Repos\ListActivities::class] = new Operator\Repos\ListActivities($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Repos🌀Owner🌀Repo🌀Activity());
118+
}
119+
120+
return $this->operator[Operator\Repos\ListActivities::class]->call($owner, $repo, $before, $after, $ref, $actor, $timePeriod, $activityType, $direction, $perPage);
121+
}
122+
114123
public function listAutolinks(string $owner, string $repo, int $page): PromiseInterface
115124
{
116125
if (array_key_exists(Operator\Repos\ListAutolinks::class, $this->operator) === false) {

0 commit comments

Comments
 (0)