Skip to content

Commit 45b6f6c

Browse files
authored
[GitHubAE] Update to 1.1.4-ace9f7cb37c72ef370f972e57f690f88 from 1.1.4-74b23f69ab43292c32beada294158c1f
Detected Schema changes: ├─┬Paths │ ├──[-] path (12359:3)❌ │ ├─┬/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts │ │ └─┬POST │ │ └─┬Parameters │ │ └──[M] description (200502:20) │ ├─┬/repos/{owner}/{repo}/environments │ │ └─┬GET │ │ └─┬Responses │ │ └─┬200 │ │ └─┬application/json │ │ └─┬default │ │ └──[M] value (192133:9) │ ├─┬/repos/{owner}/{repo}/environments/{environment_name} │ │ ├─┬GET │ │ │ └─┬Responses │ │ │ └─┬200 │ │ │ └─┬application/json │ │ │ └─┬default │ │ │ └──[M] value (192194:9) │ │ └─┬PUT │ │ └─┬Responses │ │ └─┬200 │ │ └─┬application/json │ │ └─┬default │ │ └──[M] value (192194:9) │ ├─┬/orgs/{org}/hooks/{hook_id}/config │ │ ├─┬GET │ │ │ └─┬Parameters │ │ │ └──[M] description (200502:20) │ │ └─┬PATCH │ │ └─┬Parameters │ │ └──[M] description (200502:20) │ ├─┬/orgs/{org}/hooks/{hook_id}/deliveries │ │ └─┬GET │ │ └─┬Parameters │ │ └──[M] description (200502:20) │ ├─┬/repos/{owner}/{repo}/actions/runners │ │ └─┬GET │ │ └──[M] description (11824:20) │ ├─┬/repos/{owner}/{repo}/actions/runners/downloads │ │ └─┬GET │ │ └──[M] description (11873:20) │ ├─┬/orgs/{org}/hooks/{hook_id}/pings │ │ └─┬POST │ │ └─┬Parameters │ │ └──[M] description (200502:20) │ ├─┬/repos/{owner}/{repo}/actions/runners/{runner_id} │ │ ├─┬GET │ │ │ └──[M] description (11989:20) │ │ └─┬DELETE │ │ └──[M] description (12023:20) │ ├─┬/repos/{owner}/{repo}/hooks/{hook_id} │ │ ├─┬GET │ │ │ └─┬Parameters │ │ │ └──[M] description (200502:20) │ │ ├─┬DELETE │ │ │ └─┬Parameters │ │ │ └──[M] description (200502:20) │ │ └─┬PATCH │ │ └─┬Parameters │ │ └──[M] description (200502:20) │ ├─┬/orgs/{org}/hooks/{hook_id} │ │ ├─┬GET │ │ │ └─┬Parameters │ │ │ └──[M] description (200502:20) │ │ ├─┬DELETE │ │ │ └─┬Parameters │ │ │ └──[M] description (200502:20) │ │ └─┬PATCH │ │ └─┬Parameters │ │ └──[M] description (200502:20) │ ├─┬/admin/hooks/{hook_id} │ │ ├─┬GET │ │ │ └─┬Parameters │ │ │ └──[M] description (200502:20) │ │ ├─┬DELETE │ │ │ └─┬Parameters │ │ │ └──[M] description (200502:20) │ │ └─┬PATCH │ │ └─┬Parameters │ │ └──[M] description (200502:20) │ ├─┬/repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id} │ │ └─┬GET │ │ └─┬Parameters │ │ └──[M] description (200502:20) │ ├─┬/admin/hooks/{hook_id}/pings │ │ └─┬POST │ │ └─┬Parameters │ │ └──[M] description (200502:20) │ ├─┬/repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts │ │ └─┬POST │ │ └─┬Parameters │ │ └──[M] description (200502:20) │ ├─┬/repos/{owner}/{repo}/actions/runs/{run_id}/cancel │ │ └─┬POST │ │ └──[M] description (12329:20) │ ├─┬/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id} │ │ └─┬GET │ │ └─┬Parameters │ │ └──[M] description (200502:20) │ ├─┬/repos/{owner}/{repo}/actions/runners/remove-token │ │ └─┬POST │ │ └──[M] description (11947:20) │ ├─┬/repos/{owner}/{repo}/hooks/{hook_id}/tests │ │ └─┬POST │ │ └─┬Parameters │ │ └──[M] description (200502:20) │ ├─┬/repos/{owner}/{repo}/hooks/{hook_id}/config │ │ ├─┬GET │ │ │ └─┬Parameters │ │ │ └──[M] description (200502:20) │ │ └─┬PATCH │ │ └─┬Parameters │ │ └──[M] description (200502:20) │ ├─┬/repos/{owner}/{repo}/hooks/{hook_id}/pings │ │ └─┬POST │ │ └─┬Parameters │ │ └──[M] description (200502:20) │ ├─┬/repos/{owner}/{repo}/hooks/{hook_id}/deliveries │ │ └─┬GET │ │ └─┬Parameters │ │ └──[M] description (200502:20) │ └─┬/repos/{owner}/{repo}/actions/runners/registration-token │ └─┬POST │ └──[M] description (11909:20) ├──check-run-requested-action ├──check-run-created └─┬Components └─┬environment └─┬protection_rules └─┬Schema └─┬ANYOF └──[-] properties (58714:17)❌ Date: 09/25/23 | Commit: New: etc/specs/GitHubAE/previous.spec.yaml, Original: etc/specs/GitHubAE/current.spec.yaml Document Element | Total Changes | Breaking Changes paths | 34 | 1 components | 1 | 1 ❌ 2 Breaking changes out of 35 INFO: Modifications: 33 INFO: Removals: 2 INFO: Breaking Removals: 2 ERROR: breaking changes discovered
1 parent 0340506 commit 45b6f6c

File tree

76 files changed

+793
-155
lines changed

Some content is hidden

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

76 files changed

+793
-155
lines changed

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7451,6 +7451,30 @@ $client->operations()->actions()->cancelWorkflowRun( owner: 'generated',
74517451
You can find more about this operation over at the [API method documentation](https://docs.github.com/github-ae@latest/rest/actions/workflow-runs#cancel-a-workflow-run).
74527452

74537453

7454+
### actions/force-cancel-workflow-run
7455+
7456+
Force cancel a workflow run
7457+
7458+
Using the `call` method:
7459+
```php
7460+
$client->call('POST /repos/{owner}/{repo}/actions/runs/{run_id}/force-cancel', [
7461+
'owner' => 'generated',
7462+
'repo' => 'generated',
7463+
'run_id' => 6,
7464+
]);
7465+
```
7466+
7467+
Operations method:
7468+
```php
7469+
$client->operations()->actions()->forceCancelWorkflowRun( owner: 'generated',
7470+
repo: 'generated',
7471+
run_id: 6,
7472+
);
7473+
```
7474+
7475+
You can find more about this operation over at the [API method documentation](https://docs.github.com/github-ae@latest/rest/actions/workflow-runs#force-cancel-a-workflow-run).
7476+
7477+
74547478
### actions/list-jobs-for-workflow-run
74557479

74567480
List jobs for a workflow run

etc/openapi-client-generator.state

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

src/Client.php

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

src/ClientInterface.php

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
Lines changed: 286 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,286 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace ApiClients\Client\GitHubAE\Internal\Hydrator\Operation\Repos\Owner\Repo\Actions\Runs\RunId;
6+
7+
use ApiClients\Client\GitHubAE\Schema\BasicError;
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 ForceCancel 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\GitHubAE\Schema\BasicError' => $this->hydrateApiClients⚡️Client⚡️GitHubAE⚡️Schema⚡️BasicError($payload),
42+
default => throw UnableToHydrateObject::noHydrationDefined($className, $this->hydrationStack),
43+
};
44+
}
45+
46+
private function hydrateApiClients⚡️Client⚡️GitHubAE⚡️Schema⚡️BasicError(array $payload): BasicError
47+
{
48+
$properties = [];
49+
$missingFields = [];
50+
try {
51+
$value = $payload['message'] ?? null;
52+
53+
if ($value === null) {
54+
$properties['message'] = null;
55+
goto after_message;
56+
}
57+
58+
$properties['message'] = $value;
59+
60+
after_message:
61+
62+
$value = $payload['documentation_url'] ?? null;
63+
64+
if ($value === null) {
65+
$properties['documentationUrl'] = null;
66+
goto after_documentationUrl;
67+
}
68+
69+
$properties['documentationUrl'] = $value;
70+
71+
after_documentationUrl:
72+
73+
$value = $payload['url'] ?? null;
74+
75+
if ($value === null) {
76+
$properties['url'] = null;
77+
goto after_url;
78+
}
79+
80+
$properties['url'] = $value;
81+
82+
after_url:
83+
84+
$value = $payload['status'] ?? null;
85+
86+
if ($value === null) {
87+
$properties['status'] = null;
88+
goto after_status;
89+
}
90+
91+
$properties['status'] = $value;
92+
93+
after_status:
94+
} catch (Throwable $exception) {
95+
throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHubAE\Schema\BasicError', $exception, stack: $this->hydrationStack);
96+
}
97+
98+
if (count($missingFields) > 0) {
99+
throw UnableToHydrateObject::dueToMissingFields(BasicError::class, $missingFields, stack: $this->hydrationStack);
100+
}
101+
102+
try {
103+
return new BasicError(...$properties);
104+
} catch (Throwable $exception) {
105+
throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHubAE\Schema\BasicError', $exception, stack: $this->hydrationStack);
106+
}
107+
}
108+
109+
private function serializeViaTypeMap(string $accessor, object $object, array $payloadToTypeMap): array
110+
{
111+
foreach ($payloadToTypeMap as $payloadType => [$valueType, $method]) {
112+
if (is_a($object, $valueType)) {
113+
return [$accessor => $payloadType] + $this->{$method}($object);
114+
}
115+
}
116+
117+
throw new LogicException('No type mapped for object of class: ' . $object::class);
118+
}
119+
120+
public function serializeObject(object $object): mixed
121+
{
122+
return $this->serializeObjectOfType($object, $object::class);
123+
}
124+
125+
/**
126+
* @param T $object
127+
* @param class-string<T> $className
128+
*
129+
* @template T
130+
*/
131+
public function serializeObjectOfType(object $object, string $className): mixed
132+
{
133+
try {
134+
return match ($className) {
135+
'array' => $this->serializeValuearray($object),
136+
'Ramsey\Uuid\UuidInterface' => $this->serializeValueRamsey⚡️Uuid⚡️UuidInterface($object),
137+
'DateTime' => $this->serializeValueDateTime($object),
138+
'DateTimeImmutable' => $this->serializeValueDateTimeImmutable($object),
139+
'DateTimeInterface' => $this->serializeValueDateTimeInterface($object),
140+
'ApiClients\Client\GitHubAE\Schema\BasicError' => $this->serializeObjectApiClients⚡️Client⚡️GitHubAE⚡️Schema⚡️BasicError($object),
141+
default => throw new LogicException('No serialization defined for $className'),
142+
};
143+
} catch (Throwable $exception) {
144+
throw UnableToSerializeObject::dueToError($className, $exception);
145+
}
146+
}
147+
148+
private function serializeValuearray(mixed $value): mixed
149+
{
150+
static $serializer;
151+
152+
if ($serializer === null) {
153+
$serializer = new SerializeArrayItems(...[]);
154+
}
155+
156+
return $serializer->serialize($value, $this);
157+
}
158+
159+
private function serializeValueRamsey⚡️Uuid⚡️UuidInterface(mixed $value): mixed
160+
{
161+
static $serializer;
162+
163+
if ($serializer === null) {
164+
$serializer = new SerializeUuidToString(...[]);
165+
}
166+
167+
return $serializer->serialize($value, $this);
168+
}
169+
170+
private function serializeValueDateTime(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 serializeValueDateTimeImmutable(mixed $value): mixed
182+
{
183+
static $serializer;
184+
185+
if ($serializer === null) {
186+
$serializer = new SerializeDateTime(...[]);
187+
}
188+
189+
return $serializer->serialize($value, $this);
190+
}
191+
192+
private function serializeValueDateTimeInterface(mixed $value): mixed
193+
{
194+
static $serializer;
195+
196+
if ($serializer === null) {
197+
$serializer = new SerializeDateTime(...[]);
198+
}
199+
200+
return $serializer->serialize($value, $this);
201+
}
202+
203+
private function serializeObjectApiClients⚡️Client⚡️GitHubAE⚡️Schema⚡️BasicError(mixed $object): mixed
204+
{
205+
assert($object instanceof BasicError);
206+
$result = [];
207+
208+
$message = $object->message;
209+
210+
if ($message === null) {
211+
goto after_message;
212+
}
213+
214+
after_message: $result['message'] = $message;
215+
216+
$documentationUrl = $object->documentationUrl;
217+
218+
if ($documentationUrl === null) {
219+
goto after_documentationUrl;
220+
}
221+
222+
after_documentationUrl: $result['documentation_url'] = $documentationUrl;
223+
224+
$url = $object->url;
225+
226+
if ($url === null) {
227+
goto after_url;
228+
}
229+
230+
after_url: $result['url'] = $url;
231+
232+
$status = $object->status;
233+
234+
if ($status === null) {
235+
goto after_status;
236+
}
237+
238+
after_status: $result['status'] = $status;
239+
240+
return $result;
241+
}
242+
243+
/**
244+
* @param class-string<T> $className
245+
* @param iterable<array> $payloads;
246+
*
247+
* @return IterableList<T>
248+
*
249+
* @throws UnableToHydrateObject
250+
*
251+
* @template T
252+
*/
253+
public function hydrateObjects(string $className, iterable $payloads): IterableList
254+
{
255+
return new IterableList($this->doHydrateObjects($className, $payloads));
256+
}
257+
258+
private function doHydrateObjects(string $className, iterable $payloads): Generator
259+
{
260+
foreach ($payloads as $index => $payload) {
261+
yield $index => $this->hydrateObject($className, $payload);
262+
}
263+
}
264+
265+
/**
266+
* @param class-string<T> $className
267+
* @param iterable<array> $payloads;
268+
*
269+
* @return IterableList<T>
270+
*
271+
* @throws UnableToSerializeObject
272+
*
273+
* @template T
274+
*/
275+
public function serializeObjects(iterable $payloads): IterableList
276+
{
277+
return new IterableList($this->doSerializeObjects($payloads));
278+
}
279+
280+
private function doSerializeObjects(iterable $objects): Generator
281+
{
282+
foreach ($objects as $index => $object) {
283+
yield $index => $this->serializeObject($object);
284+
}
285+
}
286+
}

src/Internal/Hydrators.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ final class Hydrators implements ObjectMapper
194194
private Internal\Hydrator\Operation\Repos\Owner\Repo\Actions\Runs\RunId\Attempts\AttemptNumber\Jobs|null $operation🌀Repos🌀Owner🌀Repo🌀Actions🌀Runs🌀RunId🌀Attempts🌀AttemptNumber🌀Jobs = null;
195195
private Internal\Hydrator\Operation\Repos\Owner\Repo\Actions\Runs\RunId\Attempts\AttemptNumber\Logs|null $operation🌀Repos🌀Owner🌀Repo🌀Actions🌀Runs🌀RunId🌀Attempts🌀AttemptNumber🌀Logs = null;
196196
private Internal\Hydrator\Operation\Repos\Owner\Repo\Actions\Runs\RunId\Cancel|null $operation🌀Repos🌀Owner🌀Repo🌀Actions🌀Runs🌀RunId🌀Cancel = null;
197+
private Internal\Hydrator\Operation\Repos\Owner\Repo\Actions\Runs\RunId\ForceCancel|null $operation🌀Repos🌀Owner🌀Repo🌀Actions🌀Runs🌀RunId🌀ForceCancel = null;
197198
private Internal\Hydrator\Operation\Repos\Owner\Repo\Actions\Runs\RunId\Jobs|null $operation🌀Repos🌀Owner🌀Repo🌀Actions🌀Runs🌀RunId🌀Jobs = null;
198199
private Internal\Hydrator\Operation\Repos\Owner\Repo\Actions\Runs\RunId\Logs|null $operation🌀Repos🌀Owner🌀Repo🌀Actions🌀Runs🌀RunId🌀Logs = null;
199200
private Internal\Hydrator\Operation\Repos\Owner\Repo\Actions\Runs\RunId\Rerun|null $operation🌀Repos🌀Owner🌀Repo🌀Actions🌀Runs🌀RunId🌀Rerun = null;
@@ -2483,6 +2484,15 @@ public function getObjectMapperOperation🌀Repos🌀Owner🌀Repo🌀Actions
24832484
return $this->operation🌀Repos🌀Owner🌀Repo🌀Actions🌀Runs🌀RunId🌀Cancel;
24842485
}
24852486

2487+
public function getObjectMapperOperation🌀Repos🌀Owner🌀Repo🌀Actions🌀Runs🌀RunId🌀ForceCancel(): Internal\Hydrator\Operation\Repos\Owner\Repo\Actions\Runs\RunId\ForceCancel
2488+
{
2489+
if ($this->operation🌀Repos🌀Owner🌀Repo🌀Actions🌀Runs🌀RunId🌀ForceCancel instanceof Internal\Hydrator\Operation\Repos\Owner\Repo\Actions\Runs\RunId\ForceCancel === false) {
2490+
$this->operation🌀Repos🌀Owner🌀Repo🌀Actions🌀Runs🌀RunId🌀ForceCancel = new Internal\Hydrator\Operation\Repos\Owner\Repo\Actions\Runs\RunId\ForceCancel();
2491+
}
2492+
2493+
return $this->operation🌀Repos🌀Owner🌀Repo🌀Actions🌀Runs🌀RunId🌀ForceCancel;
2494+
}
2495+
24862496
public function getObjectMapperOperation🌀Repos🌀Owner🌀Repo🌀Actions🌀Runs🌀RunId🌀Jobs(): Internal\Hydrator\Operation\Repos\Owner\Repo\Actions\Runs\RunId\Jobs
24872497
{
24882498
if ($this->operation🌀Repos🌀Owner🌀Repo🌀Actions🌀Runs🌀RunId🌀Jobs instanceof Internal\Hydrator\Operation\Repos\Owner\Repo\Actions\Runs\RunId\Jobs === false) {

0 commit comments

Comments
 (0)