Skip to content

Commit 242c909

Browse files
committed
Add streaming handler support
1 parent 91b5c11 commit 242c909

File tree

507 files changed

+1722
-1037
lines changed

Some content is hidden

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

507 files changed

+1722
-1037
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
"api-clients/contracts": "dev-main",
1414
"cebe/php-openapi": "dev-openapi-31 as 1.6.0",
1515
"eventsauce/object-hydrator": "^1.1",
16-
"react/async": "^4.0"
16+
"react/async": "^4.0",
17+
"wyrihaximus/react-awaitable-observable": "^1.0"
1718
},
1819
"autoload": {
1920
"psr-4": {

etc/openapi-generator-config.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
spec: https://raw.githubusercontent.com/github/rest-api-description/main/descriptions-next/ghec/ghec.yaml
22
namespace: ApiClients\Client\GitHubEnterpriseCloud
33
destination: ../src
4+
voter:
5+
streamOperation:
6+
- ApiClients\Tools\OpenApiClientGenerator\Voter\StreamOperation\DownloadInOperationId

src/Client.php

Lines changed: 180 additions & 4 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/Operation/Actions/AddCustomLabelsToSelfHostedRunnerForOrg.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ function createResponse(\Psr\Http\Message\ResponseInterface $response) : Schema\
4242
$contentType = $response->getHeaderLine('Content-Type');
4343
$body = json_decode($response->getBody()->getContents(), true);
4444
switch ($response->getStatusCode()) {
45-
/**Validation failed, or the endpoint has been spammed.**/
45+
/**Response**/
4646
case 200:
4747
switch ($contentType) {
4848
case 'application/json':
4949
$this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(Schema\Operation\EnterpriseAdmin\ListLabelsForSelfHostedRunnerForEnterprise\Response\Applicationjson\H200::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema'));
5050
return $this->hydrator->hydrateObject(Schema\Operation\EnterpriseAdmin\ListLabelsForSelfHostedRunnerForEnterprise\Response\Applicationjson\H200::class, $body);
5151
}
5252
break;
53-
/**Validation failed, or the endpoint has been spammed.**/
53+
/**Resource not found**/
5454
case 404:
5555
switch ($contentType) {
5656
case 'application/json':

src/Operation/Actions/AddCustomLabelsToSelfHostedRunnerForRepo.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ function createResponse(\Psr\Http\Message\ResponseInterface $response) : Schema\
4545
$contentType = $response->getHeaderLine('Content-Type');
4646
$body = json_decode($response->getBody()->getContents(), true);
4747
switch ($response->getStatusCode()) {
48-
/**Validation failed, or the endpoint has been spammed.**/
48+
/**Response**/
4949
case 200:
5050
switch ($contentType) {
5151
case 'application/json':
5252
$this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(Schema\Operation\EnterpriseAdmin\ListLabelsForSelfHostedRunnerForEnterprise\Response\Applicationjson\H200::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema'));
5353
return $this->hydrator->hydrateObject(Schema\Operation\EnterpriseAdmin\ListLabelsForSelfHostedRunnerForEnterprise\Response\Applicationjson\H200::class, $body);
5454
}
5555
break;
56-
/**Validation failed, or the endpoint has been spammed.**/
56+
/**Resource not found**/
5757
case 404:
5858
switch ($contentType) {
5959
case 'application/json':

src/Operation/Actions/ApproveWorkflowRun.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ function createResponse(\Psr\Http\Message\ResponseInterface $response) : Schema\
4242
$contentType = $response->getHeaderLine('Content-Type');
4343
$body = json_decode($response->getBody()->getContents(), true);
4444
switch ($response->getStatusCode()) {
45-
/**Forbidden**/
45+
/**Response**/
4646
case 201:
4747
switch ($contentType) {
4848
case 'application/json':
4949
$this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(Schema\EmptyObject::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema'));
5050
return $this->hydrator->hydrateObject(Schema\EmptyObject::class, $body);
5151
}
5252
break;
53-
/**Forbidden**/
53+
/**Resource not found**/
5454
case 404:
5555
switch ($contentType) {
5656
case 'application/json':

src/Operation/Actions/CancelWorkflowRun.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function createResponse(\Psr\Http\Message\ResponseInterface $response) : Schema\
4242
$contentType = $response->getHeaderLine('Content-Type');
4343
$body = json_decode($response->getBody()->getContents(), true);
4444
switch ($response->getStatusCode()) {
45-
/**Conflict**/
45+
/**Response**/
4646
case 202:
4747
switch ($contentType) {
4848
case 'application/json':

src/Operation/Actions/CreateRequiredWorkflow.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function createResponse(\Psr\Http\Message\ResponseInterface $response) : Schema\
3939
$contentType = $response->getHeaderLine('Content-Type');
4040
$body = json_decode($response->getBody()->getContents(), true);
4141
switch ($response->getStatusCode()) {
42-
/**Validation failed, or the endpoint has been spammed.**/
42+
/**Response**/
4343
case 201:
4444
switch ($contentType) {
4545
case 'application/json':

src/Operation/Actions/DeleteWorkflowRunLogs.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function createResponse(\Psr\Http\Message\ResponseInterface $response) : void
3939
$contentType = $response->getHeaderLine('Content-Type');
4040
$body = json_decode($response->getBody()->getContents(), true);
4141
switch ($response->getStatusCode()) {
42-
/**Internal Error**/
42+
/**Forbidden**/
4343
case 403:
4444
switch ($contentType) {
4545
case 'application/json':

0 commit comments

Comments
 (0)