Skip to content

Commit d05bed8

Browse files
committed
Better naming conventions
1 parent 3f3c394 commit d05bed8

File tree

1,779 files changed

+55828
-55828
lines changed

Some content is hidden

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

1,779 files changed

+55828
-55828
lines changed

composer.lock

Lines changed: 10 additions & 10 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: 1738 additions & 1738 deletions
Large diffs are not rendered by default.

src/OpenAPI/ApiGitHubCom/Operation/Actions.php

Lines changed: 228 additions & 228 deletions
Large diffs are not rendered by default.
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
<?php
2+
3+
namespace ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Operation\Actions;
4+
5+
final class AddCustomLabelsToSelfHostedRunnerForOrg
6+
{
7+
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;
11+
/**The organization name. The name is not case sensitive.**/
12+
private readonly string $org;
13+
/**Unique identifier of the self-hosted runner.**/
14+
private readonly int $runner_id;
15+
public function operationId() : string
16+
{
17+
return self::OPERATION_ID;
18+
}
19+
public function __construct(\League\OpenAPIValidation\Schema\SchemaValidator $requestSchemaValidator, \League\OpenAPIValidation\Schema\SchemaValidator $responseSchemaValidator, string $org, int $runner_id)
20+
{
21+
$this->requestSchemaValidator = $requestSchemaValidator;
22+
$this->responseSchemaValidator = $responseSchemaValidator;
23+
$this->org = $org;
24+
$this->runner_id = $runner_id;
25+
}
26+
function createRequest(array $data = array()) : \Psr\Http\Message\RequestInterface
27+
{
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));
30+
}
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
32+
{
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');
63+
}
64+
}

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

Lines changed: 0 additions & 64 deletions
This file was deleted.
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<?php
2+
3+
namespace ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Operation\Actions;
4+
5+
final class AddCustomLabelsToSelfHostedRunnerForRepo
6+
{
7+
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;
11+
/**The account owner of the repository. The name is not case sensitive.**/
12+
private readonly string $owner;
13+
/**The name of the repository. The name is not case sensitive.**/
14+
private readonly string $repo;
15+
/**Unique identifier of the self-hosted runner.**/
16+
private readonly int $runner_id;
17+
public function operationId() : string
18+
{
19+
return self::OPERATION_ID;
20+
}
21+
public function __construct(\League\OpenAPIValidation\Schema\SchemaValidator $requestSchemaValidator, \League\OpenAPIValidation\Schema\SchemaValidator $responseSchemaValidator, string $owner, string $repo, int $runner_id)
22+
{
23+
$this->requestSchemaValidator = $requestSchemaValidator;
24+
$this->responseSchemaValidator = $responseSchemaValidator;
25+
$this->owner = $owner;
26+
$this->repo = $repo;
27+
$this->runner_id = $runner_id;
28+
}
29+
function createRequest(array $data = array()) : \Psr\Http\Message\RequestInterface
30+
{
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));
33+
}
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
35+
{
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');
66+
}
67+
}

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

Lines changed: 0 additions & 67 deletions
This file was deleted.

0 commit comments

Comments
 (0)