Skip to content

Commit 0682150

Browse files
committed
Update to latest generated client bringing all schemas and making requests
1 parent e8455ea commit 0682150

File tree

5,314 files changed

+183370
-18586
lines changed

Some content is hidden

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

5,314 files changed

+183370
-18586
lines changed

composer.lock

Lines changed: 1417 additions & 617 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/OpenAPI/ApiGitHubCom/Client.php

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

src/OpenAPI/ApiGitHubCom/Operation/Actions.php

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

src/OpenAPI/ApiGitHubCom/Operation/Actions/AddCustomLabelsToSelfHostedRunnerForOrg_.php

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
final class AddCustomLabelsToSelfHostedRunnerForOrg_
66
{
77
private const OPERATION_ID = 'actions/add-custom-labels-to-self-hosted-runner-for-org';
8+
public const OPERATION_MATCH = 'POST /orgs/{org}/actions/runners/{runner_id}/labels';
9+
private readonly \League\OpenAPIValidation\Schema\SchemaValidator $requestSchemaValidator;
10+
private readonly \League\OpenAPIValidation\Schema\SchemaValidator $responseSchemaValidator;
811
/**The organization name. The name is not case sensitive.**/
912
private readonly string $org;
1013
/**Unique identifier of the self-hosted runner.**/
@@ -13,16 +16,49 @@ public function operationId() : string
1316
{
1417
return self::OPERATION_ID;
1518
}
16-
function __construct(string $org, int $runner_id)
19+
public function __construct(\League\OpenAPIValidation\Schema\SchemaValidator $requestSchemaValidator, \League\OpenAPIValidation\Schema\SchemaValidator $responseSchemaValidator, string $org, int $runner_id)
1720
{
21+
$this->requestSchemaValidator = $requestSchemaValidator;
22+
$this->responseSchemaValidator = $responseSchemaValidator;
1823
$this->org = $org;
1924
$this->runner_id = $runner_id;
2025
}
21-
function createRequest() : \Psr\Http\Message\RequestInterface
26+
function createRequest(array $data = array()) : \Psr\Http\Message\RequestInterface
2227
{
23-
return new \RingCentral\Psr7\Request('post', \str_replace(array('{org}', '{runner_id}'), array($this->org, $this->runner_id), '/orgs/{org}/actions/runners/{runner_id}/labels'));
28+
$this->requestSchemaValidator->validate($data, \cebe\openapi\Reader::readFromJson(\ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Schema\Unknown\CCd5D02C54E256C1F61Acea463E527414::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema'));
29+
return new \RingCentral\Psr7\Request('post', \str_replace(array('{org}', '{runner_id}'), array($this->org, $this->runner_id), '/orgs/{org}/actions/runners/{runner_id}/labels'), array('Content-Type' => 'application/json'), json_encode($data));
2430
}
25-
function validateResponse()
31+
function createResponse(\Psr\Http\Message\ResponseInterface $response) : \ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Schema\Unknown\C465Ffe2283692C35B7E35Cd3F31B8C6B|\ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Schema\BasicError|\ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Schema\ValidationErrorSimple
2632
{
33+
$contentType = $response->getHeaderLine('Content-Type');
34+
$body = json_decode($response->getBody()->getContents(), true);
35+
$hydrator = new \WyriHaximus\Hydrator\Hydrator();
36+
switch ($response->getStatusCode()) {
37+
/**Response**/
38+
case 200:
39+
switch ($contentType) {
40+
case 'application/json':
41+
$this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(\ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Schema\Unknown\C465Ffe2283692C35B7E35Cd3F31B8C6B::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema'));
42+
return $hydrator->hydrate('\\ApiClients\\Client\\Github\\OpenAPI\\ApiGitHubCom\\Schema\\Unknown\\C465Ffe2283692C35B7E35Cd3F31B8C6B', $body);
43+
}
44+
break;
45+
/**Resource not found**/
46+
case 404:
47+
switch ($contentType) {
48+
case 'application/json':
49+
$this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(\ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Schema\BasicError::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema'));
50+
return $hydrator->hydrate('\\ApiClients\\Client\\Github\\OpenAPI\\ApiGitHubCom\\Schema\\BasicError', $body);
51+
}
52+
break;
53+
/**Validation failed, or the endpoint has been spammed.**/
54+
case 422:
55+
switch ($contentType) {
56+
case 'application/json':
57+
$this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(\ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Schema\ValidationErrorSimple::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema'));
58+
return $hydrator->hydrate('\\ApiClients\\Client\\Github\\OpenAPI\\ApiGitHubCom\\Schema\\ValidationErrorSimple', $body);
59+
}
60+
break;
61+
}
62+
throw new \RuntimeException('Unable to find matching reponse code and content type');
2763
}
2864
}

src/OpenAPI/ApiGitHubCom/Operation/Actions/AddCustomLabelsToSelfHostedRunnerForRepo_.php

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
final class AddCustomLabelsToSelfHostedRunnerForRepo_
66
{
77
private const OPERATION_ID = 'actions/add-custom-labels-to-self-hosted-runner-for-repo';
8+
public const OPERATION_MATCH = 'POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels';
9+
private readonly \League\OpenAPIValidation\Schema\SchemaValidator $requestSchemaValidator;
10+
private readonly \League\OpenAPIValidation\Schema\SchemaValidator $responseSchemaValidator;
811
/**The account owner of the repository. The name is not case sensitive.**/
912
private readonly string $owner;
1013
/**The name of the repository. The name is not case sensitive.**/
@@ -15,17 +18,50 @@ public function operationId() : string
1518
{
1619
return self::OPERATION_ID;
1720
}
18-
function __construct(string $owner, string $repo, int $runner_id)
21+
public function __construct(\League\OpenAPIValidation\Schema\SchemaValidator $requestSchemaValidator, \League\OpenAPIValidation\Schema\SchemaValidator $responseSchemaValidator, string $owner, string $repo, int $runner_id)
1922
{
23+
$this->requestSchemaValidator = $requestSchemaValidator;
24+
$this->responseSchemaValidator = $responseSchemaValidator;
2025
$this->owner = $owner;
2126
$this->repo = $repo;
2227
$this->runner_id = $runner_id;
2328
}
24-
function createRequest() : \Psr\Http\Message\RequestInterface
29+
function createRequest(array $data = array()) : \Psr\Http\Message\RequestInterface
2530
{
26-
return new \RingCentral\Psr7\Request('post', \str_replace(array('{owner}', '{repo}', '{runner_id}'), array($this->owner, $this->repo, $this->runner_id), '/repos/{owner}/{repo}/actions/runners/{runner_id}/labels'));
31+
$this->requestSchemaValidator->validate($data, \cebe\openapi\Reader::readFromJson(\ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Schema\Unknown\CCd5D02C54E256C1F61Acea463E527414::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema'));
32+
return new \RingCentral\Psr7\Request('post', \str_replace(array('{owner}', '{repo}', '{runner_id}'), array($this->owner, $this->repo, $this->runner_id), '/repos/{owner}/{repo}/actions/runners/{runner_id}/labels'), array('Content-Type' => 'application/json'), json_encode($data));
2733
}
28-
function validateResponse()
34+
function createResponse(\Psr\Http\Message\ResponseInterface $response) : \ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Schema\Unknown\C465Ffe2283692C35B7E35Cd3F31B8C6B|\ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Schema\BasicError|\ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Schema\ValidationErrorSimple
2935
{
36+
$contentType = $response->getHeaderLine('Content-Type');
37+
$body = json_decode($response->getBody()->getContents(), true);
38+
$hydrator = new \WyriHaximus\Hydrator\Hydrator();
39+
switch ($response->getStatusCode()) {
40+
/**Response**/
41+
case 200:
42+
switch ($contentType) {
43+
case 'application/json':
44+
$this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(\ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Schema\Unknown\C465Ffe2283692C35B7E35Cd3F31B8C6B::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema'));
45+
return $hydrator->hydrate('\\ApiClients\\Client\\Github\\OpenAPI\\ApiGitHubCom\\Schema\\Unknown\\C465Ffe2283692C35B7E35Cd3F31B8C6B', $body);
46+
}
47+
break;
48+
/**Resource not found**/
49+
case 404:
50+
switch ($contentType) {
51+
case 'application/json':
52+
$this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(\ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Schema\BasicError::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema'));
53+
return $hydrator->hydrate('\\ApiClients\\Client\\Github\\OpenAPI\\ApiGitHubCom\\Schema\\BasicError', $body);
54+
}
55+
break;
56+
/**Validation failed, or the endpoint has been spammed.**/
57+
case 422:
58+
switch ($contentType) {
59+
case 'application/json':
60+
$this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(\ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Schema\ValidationErrorSimple::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema'));
61+
return $hydrator->hydrate('\\ApiClients\\Client\\Github\\OpenAPI\\ApiGitHubCom\\Schema\\ValidationErrorSimple', $body);
62+
}
63+
break;
64+
}
65+
throw new \RuntimeException('Unable to find matching reponse code and content type');
3066
}
3167
}

src/OpenAPI/ApiGitHubCom/Operation/Actions/AddSelectedRepoToOrgSecret_.php

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
final class AddSelectedRepoToOrgSecret_
66
{
77
private const OPERATION_ID = 'actions/add-selected-repo-to-org-secret';
8+
public const OPERATION_MATCH = 'PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}';
9+
private readonly \League\OpenAPIValidation\Schema\SchemaValidator $requestSchemaValidator;
10+
private readonly \League\OpenAPIValidation\Schema\SchemaValidator $responseSchemaValidator;
811
/**The organization name. The name is not case sensitive.**/
912
private readonly string $org;
1013
/**The name of the secret.**/
@@ -14,17 +17,35 @@ public function operationId() : string
1417
{
1518
return self::OPERATION_ID;
1619
}
17-
function __construct(string $org, string $secret_name, int $repository_id)
20+
public function __construct(\League\OpenAPIValidation\Schema\SchemaValidator $requestSchemaValidator, \League\OpenAPIValidation\Schema\SchemaValidator $responseSchemaValidator, string $org, string $secret_name, int $repository_id)
1821
{
22+
$this->requestSchemaValidator = $requestSchemaValidator;
23+
$this->responseSchemaValidator = $responseSchemaValidator;
1924
$this->org = $org;
2025
$this->secret_name = $secret_name;
2126
$this->repository_id = $repository_id;
2227
}
23-
function createRequest() : \Psr\Http\Message\RequestInterface
28+
function createRequest(array $data = array()) : \Psr\Http\Message\RequestInterface
2429
{
2530
return new \RingCentral\Psr7\Request('put', \str_replace(array('{org}', '{secret_name}', '{repository_id}'), array($this->org, $this->secret_name, $this->repository_id), '/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}'));
2631
}
27-
function validateResponse()
32+
function createResponse(\Psr\Http\Message\ResponseInterface $response) :
2833
{
34+
$contentType = $response->getHeaderLine('Content-Type');
35+
$body = json_decode($response->getBody()->getContents(), true);
36+
$hydrator = new \WyriHaximus\Hydrator\Hydrator();
37+
switch ($response->getStatusCode()) {
38+
/**No Content when repository was added to the selected list**/
39+
case 204:
40+
switch ($contentType) {
41+
}
42+
break;
43+
/**Conflict when visibility type is not set to selected**/
44+
case 409:
45+
switch ($contentType) {
46+
}
47+
break;
48+
}
49+
throw new \RuntimeException('Unable to find matching reponse code and content type');
2950
}
3051
}

src/OpenAPI/ApiGitHubCom/Operation/Actions/AddSelfHostedRunnerToGroupForOrg_.php

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
final class AddSelfHostedRunnerToGroupForOrg_
66
{
77
private const OPERATION_ID = 'actions/add-self-hosted-runner-to-group-for-org';
8+
public const OPERATION_MATCH = 'PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}';
9+
private readonly \League\OpenAPIValidation\Schema\SchemaValidator $requestSchemaValidator;
10+
private readonly \League\OpenAPIValidation\Schema\SchemaValidator $responseSchemaValidator;
811
/**The organization name. The name is not case sensitive.**/
912
private readonly string $org;
1013
/**Unique identifier of the self-hosted runner group.**/
@@ -15,17 +18,30 @@ public function operationId() : string
1518
{
1619
return self::OPERATION_ID;
1720
}
18-
function __construct(string $org, int $runner_group_id, int $runner_id)
21+
public function __construct(\League\OpenAPIValidation\Schema\SchemaValidator $requestSchemaValidator, \League\OpenAPIValidation\Schema\SchemaValidator $responseSchemaValidator, string $org, int $runner_group_id, int $runner_id)
1922
{
23+
$this->requestSchemaValidator = $requestSchemaValidator;
24+
$this->responseSchemaValidator = $responseSchemaValidator;
2025
$this->org = $org;
2126
$this->runner_group_id = $runner_group_id;
2227
$this->runner_id = $runner_id;
2328
}
24-
function createRequest() : \Psr\Http\Message\RequestInterface
29+
function createRequest(array $data = array()) : \Psr\Http\Message\RequestInterface
2530
{
2631
return new \RingCentral\Psr7\Request('put', \str_replace(array('{org}', '{runner_group_id}', '{runner_id}'), array($this->org, $this->runner_group_id, $this->runner_id), '/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}'));
2732
}
28-
function validateResponse()
33+
function createResponse(\Psr\Http\Message\ResponseInterface $response) :
2934
{
35+
$contentType = $response->getHeaderLine('Content-Type');
36+
$body = json_decode($response->getBody()->getContents(), true);
37+
$hydrator = new \WyriHaximus\Hydrator\Hydrator();
38+
switch ($response->getStatusCode()) {
39+
/**Response**/
40+
case 204:
41+
switch ($contentType) {
42+
}
43+
break;
44+
}
45+
throw new \RuntimeException('Unable to find matching reponse code and content type');
3046
}
3147
}

src/OpenAPI/ApiGitHubCom/Operation/Actions/ApproveWorkflowRun_.php

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
final class ApproveWorkflowRun_
66
{
77
private const OPERATION_ID = 'actions/approve-workflow-run';
8+
public const OPERATION_MATCH = 'POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve';
9+
private readonly \League\OpenAPIValidation\Schema\SchemaValidator $requestSchemaValidator;
10+
private readonly \League\OpenAPIValidation\Schema\SchemaValidator $responseSchemaValidator;
811
/**The account owner of the repository. The name is not case sensitive.**/
912
private readonly string $owner;
1013
/**The name of the repository. The name is not case sensitive.**/
@@ -15,17 +18,49 @@ public function operationId() : string
1518
{
1619
return self::OPERATION_ID;
1720
}
18-
function __construct(string $owner, string $repo, int $run_id)
21+
public function __construct(\League\OpenAPIValidation\Schema\SchemaValidator $requestSchemaValidator, \League\OpenAPIValidation\Schema\SchemaValidator $responseSchemaValidator, string $owner, string $repo, int $run_id)
1922
{
23+
$this->requestSchemaValidator = $requestSchemaValidator;
24+
$this->responseSchemaValidator = $responseSchemaValidator;
2025
$this->owner = $owner;
2126
$this->repo = $repo;
2227
$this->run_id = $run_id;
2328
}
24-
function createRequest() : \Psr\Http\Message\RequestInterface
29+
function createRequest(array $data = array()) : \Psr\Http\Message\RequestInterface
2530
{
2631
return new \RingCentral\Psr7\Request('post', \str_replace(array('{owner}', '{repo}', '{run_id}'), array($this->owner, $this->repo, $this->run_id), '/repos/{owner}/{repo}/actions/runs/{run_id}/approve'));
2732
}
28-
function validateResponse()
33+
function createResponse(\Psr\Http\Message\ResponseInterface $response) : \ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Schema\EmptyObject|\ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Schema\BasicError
2934
{
35+
$contentType = $response->getHeaderLine('Content-Type');
36+
$body = json_decode($response->getBody()->getContents(), true);
37+
$hydrator = new \WyriHaximus\Hydrator\Hydrator();
38+
switch ($response->getStatusCode()) {
39+
/**Response**/
40+
case 201:
41+
switch ($contentType) {
42+
case 'application/json':
43+
$this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(\ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Schema\EmptyObject::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema'));
44+
return $hydrator->hydrate('\\ApiClients\\Client\\Github\\OpenAPI\\ApiGitHubCom\\Schema\\EmptyObject', $body);
45+
}
46+
break;
47+
/**Resource not found**/
48+
case 404:
49+
switch ($contentType) {
50+
case 'application/json':
51+
$this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(\ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Schema\BasicError::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema'));
52+
return $hydrator->hydrate('\\ApiClients\\Client\\Github\\OpenAPI\\ApiGitHubCom\\Schema\\BasicError', $body);
53+
}
54+
break;
55+
/**Forbidden**/
56+
case 403:
57+
switch ($contentType) {
58+
case 'application/json':
59+
$this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(\ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Schema\BasicError::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema'));
60+
return $hydrator->hydrate('\\ApiClients\\Client\\Github\\OpenAPI\\ApiGitHubCom\\Schema\\BasicError', $body);
61+
}
62+
break;
63+
}
64+
throw new \RuntimeException('Unable to find matching reponse code and content type');
3065
}
3166
}

0 commit comments

Comments
 (0)