Skip to content

Commit 59817a1

Browse files
authored
[GitHubAE] Update to 1.1.4-51868c0a30cf979b021c18dc01550582 from 1.1.4-51868c0a30cf979b021c18dc01550582
Detected Schema changes:
1 parent 626dc34 commit 59817a1

File tree

768 files changed

+43769
-3050
lines changed

Some content is hidden

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

768 files changed

+43769
-3050
lines changed

README.md

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

etc/openapi-client-generator.state

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

src/Client.php

Lines changed: 66 additions & 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.

src/Operation/Activity.php

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,15 @@ public function listNotificationsForAuthenticatedUser(string $since, string $bef
4040
return $this->operator[Operator\Activity\ListNotificationsForAuthenticatedUser::class]->call($since, $before, $all, $participating, $page, $perPage);
4141
}
4242

43+
public function listNotificationsForAuthenticatedUserListing(string $since, string $before, bool $all, bool $participating, int $page, int $perPage): Schema\Thread
44+
{
45+
if (array_key_exists(Operator\Activity\ListNotificationsForAuthenticatedUserListing::class, $this->operator) === false) {
46+
$this->operator[Operator\Activity\ListNotificationsForAuthenticatedUserListing::class] = new Operator\Activity\ListNotificationsForAuthenticatedUserListing($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Notifications());
47+
}
48+
49+
return $this->operator[Operator\Activity\ListNotificationsForAuthenticatedUserListing::class]->call($since, $before, $all, $participating, $page, $perPage);
50+
}
51+
4352
public function markNotificationsAsRead(array $params): Schema\Operations\Activity\MarkNotificationsAsRead\Response\ApplicationJson\Accepted
4453
{
4554
if (array_key_exists(Operator\Activity\MarkNotificationsAsRead::class, $this->operator) === false) {
@@ -103,6 +112,15 @@ public function listRepoEvents(string $owner, string $repo, int $perPage, int $p
103112
return $this->operator[Operator\Activity\ListRepoEvents::class]->call($owner, $repo, $perPage, $page);
104113
}
105114

115+
public function listRepoEventsListing(string $owner, string $repo, int $perPage, int $page): Schema\Event
116+
{
117+
if (array_key_exists(Operator\Activity\ListRepoEventsListing::class, $this->operator) === false) {
118+
$this->operator[Operator\Activity\ListRepoEventsListing::class] = new Operator\Activity\ListRepoEventsListing($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Repos🌀Owner🌀Repo🌀Events());
119+
}
120+
121+
return $this->operator[Operator\Activity\ListRepoEventsListing::class]->call($owner, $repo, $perPage, $page);
122+
}
123+
106124
public function listRepoNotificationsForAuthenticatedUser(string $owner, string $repo, string $since, string $before, bool $all, bool $participating, int $perPage, int $page): Schema\Thread
107125
{
108126
if (array_key_exists(Operator\Activity\ListRepoNotificationsForAuthenticatedUser::class, $this->operator) === false) {
@@ -112,6 +130,15 @@ public function listRepoNotificationsForAuthenticatedUser(string $owner, string
112130
return $this->operator[Operator\Activity\ListRepoNotificationsForAuthenticatedUser::class]->call($owner, $repo, $since, $before, $all, $participating, $perPage, $page);
113131
}
114132

133+
public function listRepoNotificationsForAuthenticatedUserListing(string $owner, string $repo, string $since, string $before, bool $all, bool $participating, int $perPage, int $page): Schema\Thread
134+
{
135+
if (array_key_exists(Operator\Activity\ListRepoNotificationsForAuthenticatedUserListing::class, $this->operator) === false) {
136+
$this->operator[Operator\Activity\ListRepoNotificationsForAuthenticatedUserListing::class] = new Operator\Activity\ListRepoNotificationsForAuthenticatedUserListing($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Repos🌀Owner🌀Repo🌀Notifications());
137+
}
138+
139+
return $this->operator[Operator\Activity\ListRepoNotificationsForAuthenticatedUserListing::class]->call($owner, $repo, $since, $before, $all, $participating, $perPage, $page);
140+
}
141+
115142
public function markRepoNotificationsAsRead(string $owner, string $repo, array $params): Schema\Operations\Activity\MarkRepoNotificationsAsRead\Response\ApplicationJson\Accepted
116143
{
117144
if (array_key_exists(Operator\Activity\MarkRepoNotificationsAsRead::class, $this->operator) === false) {
@@ -139,6 +166,15 @@ public function listWatchersForRepo(string $owner, string $repo, int $perPage, i
139166
return $this->operator[Operator\Activity\ListWatchersForRepo::class]->call($owner, $repo, $perPage, $page);
140167
}
141168

169+
public function listWatchersForRepoListing(string $owner, string $repo, int $perPage, int $page): Schema\SimpleUser
170+
{
171+
if (array_key_exists(Operator\Activity\ListWatchersForRepoListing::class, $this->operator) === false) {
172+
$this->operator[Operator\Activity\ListWatchersForRepoListing::class] = new Operator\Activity\ListWatchersForRepoListing($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Repos🌀Owner🌀Repo🌀Subscribers());
173+
}
174+
175+
return $this->operator[Operator\Activity\ListWatchersForRepoListing::class]->call($owner, $repo, $perPage, $page);
176+
}
177+
142178
public function getRepoSubscription(string $owner, string $repo): Schema\RepositorySubscription
143179
{
144180
if (array_key_exists(Operator\Activity\GetRepoSubscription::class, $this->operator) === false) {
@@ -175,6 +211,15 @@ public function listReposStarredByAuthenticatedUser(string $sort, string $direct
175211
return $this->operator[Operator\Activity\ListReposStarredByAuthenticatedUser::class]->call($sort, $direction, $perPage, $page);
176212
}
177213

214+
public function listReposStarredByAuthenticatedUserListing(string $sort, string $direction, int $perPage, int $page): Schema\Repository|Schema\StarredRepository
215+
{
216+
if (array_key_exists(Operator\Activity\ListReposStarredByAuthenticatedUserListing::class, $this->operator) === false) {
217+
$this->operator[Operator\Activity\ListReposStarredByAuthenticatedUserListing::class] = new Operator\Activity\ListReposStarredByAuthenticatedUserListing($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀User🌀Starred());
218+
}
219+
220+
return $this->operator[Operator\Activity\ListReposStarredByAuthenticatedUserListing::class]->call($sort, $direction, $perPage, $page);
221+
}
222+
178223
public function checkRepoIsStarredByAuthenticatedUser(string $owner, string $repo): ResponseInterface
179224
{
180225
if (array_key_exists(Operator\Activity\CheckRepoIsStarredByAuthenticatedUser::class, $this->operator) === false) {
@@ -211,6 +256,15 @@ public function listWatchedReposForAuthenticatedUser(int $perPage, int $page): S
211256
return $this->operator[Operator\Activity\ListWatchedReposForAuthenticatedUser::class]->call($perPage, $page);
212257
}
213258

259+
public function listWatchedReposForAuthenticatedUserListing(int $perPage, int $page): Schema\MinimalRepository
260+
{
261+
if (array_key_exists(Operator\Activity\ListWatchedReposForAuthenticatedUserListing::class, $this->operator) === false) {
262+
$this->operator[Operator\Activity\ListWatchedReposForAuthenticatedUserListing::class] = new Operator\Activity\ListWatchedReposForAuthenticatedUserListing($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀User🌀Subscriptions());
263+
}
264+
265+
return $this->operator[Operator\Activity\ListWatchedReposForAuthenticatedUserListing::class]->call($perPage, $page);
266+
}
267+
214268
public function listEventsForAuthenticatedUser(string $username, int $perPage, int $page): Schema\Event
215269
{
216270
if (array_key_exists(Operator\Activity\ListEventsForAuthenticatedUser::class, $this->operator) === false) {
@@ -220,6 +274,15 @@ public function listEventsForAuthenticatedUser(string $username, int $perPage, i
220274
return $this->operator[Operator\Activity\ListEventsForAuthenticatedUser::class]->call($username, $perPage, $page);
221275
}
222276

277+
public function listEventsForAuthenticatedUserListing(string $username, int $perPage, int $page): Schema\Event
278+
{
279+
if (array_key_exists(Operator\Activity\ListEventsForAuthenticatedUserListing::class, $this->operator) === false) {
280+
$this->operator[Operator\Activity\ListEventsForAuthenticatedUserListing::class] = new Operator\Activity\ListEventsForAuthenticatedUserListing($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Users🌀Username🌀Events());
281+
}
282+
283+
return $this->operator[Operator\Activity\ListEventsForAuthenticatedUserListing::class]->call($username, $perPage, $page);
284+
}
285+
223286
public function listOrgEventsForAuthenticatedUser(string $username, string $org, int $perPage, int $page): Schema\Event
224287
{
225288
if (array_key_exists(Operator\Activity\ListOrgEventsForAuthenticatedUser::class, $this->operator) === false) {
@@ -229,6 +292,15 @@ public function listOrgEventsForAuthenticatedUser(string $username, string $org,
229292
return $this->operator[Operator\Activity\ListOrgEventsForAuthenticatedUser::class]->call($username, $org, $perPage, $page);
230293
}
231294

295+
public function listOrgEventsForAuthenticatedUserListing(string $username, string $org, int $perPage, int $page): Schema\Event
296+
{
297+
if (array_key_exists(Operator\Activity\ListOrgEventsForAuthenticatedUserListing::class, $this->operator) === false) {
298+
$this->operator[Operator\Activity\ListOrgEventsForAuthenticatedUserListing::class] = new Operator\Activity\ListOrgEventsForAuthenticatedUserListing($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Users🌀Username🌀Events🌀Orgs🌀Org());
299+
}
300+
301+
return $this->operator[Operator\Activity\ListOrgEventsForAuthenticatedUserListing::class]->call($username, $org, $perPage, $page);
302+
}
303+
232304
public function listReposStarredByUser(string $username, string $sort, string $direction, int $perPage, int $page): Schema\Operations\Activity\ListReposStarredByUser\Response\ApplicationJson\Ok
233305
{
234306
if (array_key_exists(Operator\Activity\ListReposStarredByUser::class, $this->operator) === false) {
@@ -246,4 +318,13 @@ public function listReposWatchedByUser(string $username, int $perPage, int $page
246318

247319
return $this->operator[Operator\Activity\ListReposWatchedByUser::class]->call($username, $perPage, $page);
248320
}
321+
322+
public function listReposWatchedByUserListing(string $username, int $perPage, int $page): Schema\MinimalRepository
323+
{
324+
if (array_key_exists(Operator\Activity\ListReposWatchedByUserListing::class, $this->operator) === false) {
325+
$this->operator[Operator\Activity\ListReposWatchedByUserListing::class] = new Operator\Activity\ListReposWatchedByUserListing($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Users🌀Username🌀Subscriptions());
326+
}
327+
328+
return $this->operator[Operator\Activity\ListReposWatchedByUserListing::class]->call($username, $perPage, $page);
329+
}
249330
}
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace ApiClients\Client\GitHubAE\Operation\Activity;
6+
7+
use ApiClients\Client\GitHubAE\Hydrator;
8+
use ApiClients\Client\GitHubAE\Schema;
9+
use cebe\openapi\Reader;
10+
use League\OpenAPIValidation\Schema\SchemaValidator;
11+
use Psr\Http\Message\RequestInterface;
12+
use Psr\Http\Message\ResponseInterface;
13+
use RingCentral\Psr7\Request;
14+
use RuntimeException;
15+
use Rx\Observable;
16+
use Rx\Scheduler\ImmediateScheduler;
17+
use Throwable;
18+
19+
use function explode;
20+
use function json_decode;
21+
use function str_replace;
22+
23+
final class ListEventsForAuthenticatedUserListing
24+
{
25+
public const OPERATION_ID = 'activity/list-events-for-authenticated-user';
26+
public const OPERATION_MATCH = 'LIST /users/{username}/events';
27+
private const METHOD = 'GET';
28+
private const PATH = '/users/{username}/events';
29+
/**The handle for the GitHub user account. **/
30+
private string $username;
31+
/**The number of results per page (max 100). **/
32+
private int $perPage;
33+
/**Page number of the results to fetch. **/
34+
private int $page;
35+
36+
public function __construct(private readonly SchemaValidator $responseSchemaValidator, private readonly Hydrator\Operation\Users\Username\Events $hydrator, string $username, int $perPage = 30, int $page = 1)
37+
{
38+
$this->username = $username;
39+
$this->perPage = $perPage;
40+
$this->page = $page;
41+
}
42+
43+
public function createRequest(): RequestInterface
44+
{
45+
return new Request(self::METHOD, str_replace(['{username}', '{per_page}', '{page}'], [$this->username, $this->perPage, $this->page], self::PATH . '?per_page={per_page}&page={page}'));
46+
}
47+
48+
/** @return Observable<Schema\Event> */
49+
public function createResponse(ResponseInterface $response): Observable
50+
{
51+
$code = $response->getStatusCode();
52+
[$contentType] = explode(';', $response->getHeaderLine('Content-Type'));
53+
switch ($contentType) {
54+
case 'application/json':
55+
$body = json_decode($response->getBody()->getContents(), true);
56+
switch ($code) {
57+
/**
58+
* Response
59+
**/
60+
case 200:
61+
return Observable::fromArray($body, new ImmediateScheduler())->map(function (array $body): Schema\Event {
62+
$error = new RuntimeException();
63+
try {
64+
$this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\Event::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema'));
65+
66+
return $this->hydrator->hydrateObject(Schema\Event::class, $body);
67+
} catch (Throwable $error) {
68+
goto items_application_json_two_hundred_aaaaa;
69+
}
70+
71+
items_application_json_two_hundred_aaaaa:
72+
throw $error;
73+
});
74+
}
75+
76+
break;
77+
}
78+
79+
throw new RuntimeException('Unable to find matching response code and content type');
80+
}
81+
}
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace ApiClients\Client\GitHubAE\Operation\Activity;
6+
7+
use ApiClients\Client\GitHubAE\Error as ErrorSchemas;
8+
use ApiClients\Client\GitHubAE\Hydrator;
9+
use ApiClients\Client\GitHubAE\Schema;
10+
use cebe\openapi\Reader;
11+
use League\OpenAPIValidation\Schema\SchemaValidator;
12+
use Psr\Http\Message\RequestInterface;
13+
use Psr\Http\Message\ResponseInterface;
14+
use RingCentral\Psr7\Request;
15+
use RuntimeException;
16+
use Rx\Observable;
17+
use Rx\Scheduler\ImmediateScheduler;
18+
use Throwable;
19+
20+
use function explode;
21+
use function json_decode;
22+
use function str_replace;
23+
24+
final class ListNotificationsForAuthenticatedUserListing
25+
{
26+
public const OPERATION_ID = 'activity/list-notifications-for-authenticated-user';
27+
public const OPERATION_MATCH = 'LIST /notifications';
28+
private const METHOD = 'GET';
29+
private const PATH = '/notifications';
30+
/**Only show results that were last updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. **/
31+
private string $since;
32+
/**Only show notifications updated before the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. **/
33+
private string $before;
34+
/**If `true`, show notifications marked as read. **/
35+
private bool $all;
36+
/**If `true`, only shows notifications in which the user is directly participating or mentioned. **/
37+
private bool $participating;
38+
/**Page number of the results to fetch. **/
39+
private int $page;
40+
/**The number of results per page (max 50). **/
41+
private int $perPage;
42+
43+
public function __construct(private readonly SchemaValidator $responseSchemaValidator, private readonly Hydrator\Operation\Notifications $hydrator, string $since, string $before, bool $all = false, bool $participating = false, int $page = 1, int $perPage = 50)
44+
{
45+
$this->since = $since;
46+
$this->before = $before;
47+
$this->all = $all;
48+
$this->participating = $participating;
49+
$this->page = $page;
50+
$this->perPage = $perPage;
51+
}
52+
53+
public function createRequest(): RequestInterface
54+
{
55+
return new Request(self::METHOD, str_replace(['{since}', '{before}', '{all}', '{participating}', '{page}', '{per_page}'], [$this->since, $this->before, $this->all, $this->participating, $this->page, $this->perPage], self::PATH . '?since={since}&before={before}&all={all}&participating={participating}&page={page}&per_page={per_page}'));
56+
}
57+
58+
/** @return Observable<Schema\Thread>|array{code: int} */
59+
public function createResponse(ResponseInterface $response): Observable|array
60+
{
61+
$code = $response->getStatusCode();
62+
[$contentType] = explode(';', $response->getHeaderLine('Content-Type'));
63+
switch ($contentType) {
64+
case 'application/json':
65+
$body = json_decode($response->getBody()->getContents(), true);
66+
switch ($code) {
67+
/**
68+
* Response
69+
**/
70+
case 200:
71+
return Observable::fromArray($body, new ImmediateScheduler())->map(function (array $body): Schema\Thread {
72+
$error = new RuntimeException();
73+
try {
74+
$this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\Thread::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema'));
75+
76+
return $this->hydrator->hydrateObject(Schema\Thread::class, $body);
77+
} catch (Throwable $error) {
78+
goto items_application_json_two_hundred_aaaaa;
79+
}
80+
81+
items_application_json_two_hundred_aaaaa:
82+
throw $error;
83+
});
84+
/**
85+
* Forbidden
86+
**/
87+
88+
case 403:
89+
$this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\BasicError::SCHEMA_JSON, \cebe\openapi\spec\Schema::class));
90+
91+
throw new ErrorSchemas\BasicError(403, $this->hydrator->hydrateObject(Schema\BasicError::class, $body));
92+
/**
93+
* Requires authentication
94+
**/
95+
96+
case 401:
97+
$this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\BasicError::SCHEMA_JSON, \cebe\openapi\spec\Schema::class));
98+
99+
throw new ErrorSchemas\BasicError(401, $this->hydrator->hydrateObject(Schema\BasicError::class, $body));
100+
/**
101+
* Validation failed, or the endpoint has been spammed.
102+
**/
103+
104+
case 422:
105+
$this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\ValidationError::SCHEMA_JSON, \cebe\openapi\spec\Schema::class));
106+
107+
throw new ErrorSchemas\ValidationError(422, $this->hydrator->hydrateObject(Schema\ValidationError::class, $body));
108+
}
109+
110+
break;
111+
}
112+
113+
switch ($code) {
114+
/**
115+
* Not modified
116+
**/
117+
case 304:
118+
return ['code' => 304];
119+
}
120+
121+
throw new RuntimeException('Unable to find matching response code and content type');
122+
}
123+
}

0 commit comments

Comments
 (0)