Skip to content

Commit e9337b4

Browse files
authored
[GitHubEnterpriseCloud] Update to 1.1.4 (hash: c1d23f276b94058b71c5f697bacbd4cf) from 1.1.4 (hash: 5a3b2217d0f5c4cd6c6a55bb66f09657)
Detected Schema changes: ERROR: error: Error thrown when comparing: local lookups are not permitted, please set AllowFileLookup to true in the configuration component 'server-statistics-actions.yaml' does not exist in the specification local lookups are not permitted, please set AllowFileLookup to true in the configuration component 'server-statistics-packages.yaml' does not exist in the specification cannot resolve reference `server-statistics-actions.yaml`, it's missing: [210146:11] cannot resolve reference `server-statistics-packages.yaml`, it's missing: [210148:11] local lookups are not permitted, please set AllowFileLookup to true in the configuration component 'server-statistics-actions.yaml' does not exist in the specification local lookups are not permitted, please set AllowFileLookup to true in the configuration component 'server-statistics-packages.yaml' does not exist in the specification cannot resolve reference `server-statistics-actions.yaml`, it's missing: [210120:11] cannot resolve reference `server-statistics-packages.yaml`, it's missing: [210122:11] ERROR: local lookups are not permitted, please set AllowFileLookup to true in the configuration ERROR: component 'server-statistics-actions.yaml' does not exist in the specification ERROR: local lookups are not permitted, please set AllowFileLookup to true in the configuration ERROR: component 'server-statistics-packages.yaml' does not exist in the specification ERROR: cannot resolve reference `server-statistics-actions.yaml`, it's missing: [210146:11] ERROR: cannot resolve reference `server-statistics-packages.yaml`, it's missing: [210148:11] ERROR: local lookups are not permitted, please set AllowFileLookup to true in the configuration ERROR: component 'server-statistics-actions.yaml' does not exist in the specification ERROR: local lookups are not permitted, please set AllowFileLookup to true in the configuration ERROR: component 'server-statistics-packages.yaml' does not exist in the specification ERROR: cannot resolve reference `server-statistics-actions.yaml`, it's missing: [210120:11] ERROR: cannot resolve reference `server-statistics-packages.yaml`, it's missing: [210122:11]
1 parent 4f18df0 commit e9337b4

File tree

14 files changed

+223
-209
lines changed

14 files changed

+223
-209
lines changed

README.md

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

etc/openapi-client-generator.state

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

src/Operation/Orgs.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -597,13 +597,13 @@ public function removeSecurityManagerTeam(string $org, string $teamSlug): Promis
597597
return $this->operator[Operator\Orgs\RemoveSecurityManagerTeam::class]->call($org, $teamSlug);
598598
}
599599

600-
public function enableOrDisableSecurityProductOnAllOrgRepos(string $org, string $securityProduct, string $enablement): PromiseInterface
600+
public function enableOrDisableSecurityProductOnAllOrgRepos(string $org, string $securityProduct, string $enablement, array $params): PromiseInterface
601601
{
602602
if (array_key_exists(Operator\Orgs\EnableOrDisableSecurityProductOnAllOrgRepos::class, $this->operator) === false) {
603-
$this->operator[Operator\Orgs\EnableOrDisableSecurityProductOnAllOrgRepos::class] = new Operator\Orgs\EnableOrDisableSecurityProductOnAllOrgRepos($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Orgs🌀Org🌀SecurityProduct🌀Enablement());
603+
$this->operator[Operator\Orgs\EnableOrDisableSecurityProductOnAllOrgRepos::class] = new Operator\Orgs\EnableOrDisableSecurityProductOnAllOrgRepos($this->browser, $this->authentication, $this->requestSchemaValidator, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Orgs🌀Org🌀SecurityProduct🌀Enablement());
604604
}
605605

606-
return $this->operator[Operator\Orgs\EnableOrDisableSecurityProductOnAllOrgRepos::class]->call($org, $securityProduct, $enablement);
606+
return $this->operator[Operator\Orgs\EnableOrDisableSecurityProductOnAllOrgRepos::class]->call($org, $securityProduct, $enablement, $params);
607607
}
608608

609609
public function listMembershipsForAuthenticatedUser(string $state, int $perPage, int $page): PromiseInterface

src/Operation/Orgs/EnableOrDisableSecurityProductOnAllOrgRepos.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,15 @@
44

55
namespace ApiClients\Client\GitHubEnterpriseCloud\Operation\Orgs;
66

7+
use ApiClients\Client\GitHubEnterpriseCloud\Schema;
8+
use cebe\openapi\Reader;
9+
use League\OpenAPIValidation\Schema\SchemaValidator;
710
use Psr\Http\Message\RequestInterface;
811
use Psr\Http\Message\ResponseInterface;
912
use RingCentral\Psr7\Request;
1013
use RuntimeException;
1114

15+
use function json_encode;
1216
use function str_replace;
1317

1418
final class EnableOrDisableSecurityProductOnAllOrgRepos
@@ -27,16 +31,18 @@ final class EnableOrDisableSecurityProductOnAllOrgRepos
2731
`disable_all` means to disable the specified security feature for all repositories in the organization. **/
2832
private string $enablement;
2933

30-
public function __construct(string $org, string $securityProduct, string $enablement)
34+
public function __construct(private readonly SchemaValidator $requestSchemaValidator, string $org, string $securityProduct, string $enablement)
3135
{
3236
$this->org = $org;
3337
$this->securityProduct = $securityProduct;
3438
$this->enablement = $enablement;
3539
}
3640

37-
public function createRequest(): RequestInterface
41+
public function createRequest(array $data): RequestInterface
3842
{
39-
return new Request(self::METHOD, str_replace(['{org}', '{security_product}', '{enablement}'], [$this->org, $this->securityProduct, $this->enablement], self::PATH));
43+
$this->requestSchemaValidator->validate($data, Reader::readFromJson(Schema\Orgs\EnableOrDisableSecurityProductOnAllOrgRepos\Request\ApplicationJson::SCHEMA_JSON, \cebe\openapi\spec\Schema::class));
44+
45+
return new Request(self::METHOD, str_replace(['{org}', '{security_product}', '{enablement}'], [$this->org, $this->securityProduct, $this->enablement], self::PATH), ['Content-Type' => 'application/json'], json_encode($data));
4046
}
4147

4248
/** @return array{code: int} */

src/Operator/Orgs/EnableOrDisableSecurityProductOnAllOrgRepos.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
namespace ApiClients\Client\GitHubEnterpriseCloud\Operator\Orgs;
66

77
use ApiClients\Contracts\HTTP\Headers\AuthenticationInterface;
8+
use League\OpenAPIValidation\Schema\SchemaValidator;
89
use Psr\Http\Message\ResponseInterface;
910
use React\Http\Browser;
1011
use React\Promise\PromiseInterface;
@@ -16,15 +17,15 @@
1617
private const METHOD = 'POST';
1718
private const PATH = '/orgs/{org}/{security_product}/{enablement}';
1819

19-
public function __construct(private Browser $browser, private AuthenticationInterface $authentication)
20+
public function __construct(private Browser $browser, private AuthenticationInterface $authentication, private SchemaValidator $requestSchemaValidator)
2021
{
2122
}
2223

2324
/** @return PromiseInterface<array> **/
24-
public function call(string $org, string $securityProduct, string $enablement): PromiseInterface
25+
public function call(string $org, string $securityProduct, string $enablement, array $params): PromiseInterface
2526
{
26-
$operation = new \ApiClients\Client\GitHubEnterpriseCloud\Operation\Orgs\EnableOrDisableSecurityProductOnAllOrgRepos($org, $securityProduct, $enablement);
27-
$request = $operation->createRequest();
27+
$operation = new \ApiClients\Client\GitHubEnterpriseCloud\Operation\Orgs\EnableOrDisableSecurityProductOnAllOrgRepos($this->requestSchemaValidator, $org, $securityProduct, $enablement);
28+
$request = $operation->createRequest($params);
2829

2930
return $this->browser->request($request->getMethod(), (string) $request->getUri(), $request->withHeader('Authorization', $this->authentication->authHeader())->getHeaders(), (string) $request->getBody())->then(static function (ResponseInterface $response) use ($operation): array {
3031
return $operation->createResponse($response);

src/Router/Post/Orgs.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,9 +225,9 @@ public function enableOrDisableSecurityProductOnAllOrgRepos(array $params)
225225

226226
$arguments['enablement'] = $params['enablement'];
227227
unset($params['enablement']);
228-
$operator = new Operator\Orgs\EnableOrDisableSecurityProductOnAllOrgRepos($this->browser, $this->authentication);
228+
$operator = new Operator\Orgs\EnableOrDisableSecurityProductOnAllOrgRepos($this->browser, $this->authentication, $this->requestSchemaValidator);
229229

230-
return $operator->call($arguments['org'], $arguments['security_product'], $arguments['enablement']);
230+
return $operator->call($arguments['org'], $arguments['security_product'], $arguments['enablement'], $params);
231231
}
232232

233233
public function redeliverWebhookDelivery(array $params)

src/Schema/CodeScanningDefaultSetupUpdate.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88

99
final readonly class CodeScanningDefaultSetupUpdate
1010
{
11-
public const SCHEMA_JSON = '{"required":["state"],"type":"object","properties":{"state":{"enum":["configured","not-configured"],"type":"string","description":"Whether code scanning default setup has been configured or not."},"query_suite":{"enum":["default","extended"],"type":"string","description":"The CodeQL query suite to use."},"languages":{"type":"array","items":{"enum":["c-cpp","csharp","go","java-kotlin","javascript-typescript","python","ruby","swift"],"type":"string"},"description":"CodeQL languages to be analyzed. Supported values are: `c-cpp`, `csharp`, `go`, `java-kotlin`, `javascript-typescript`, `python`, and `ruby`."}},"description":"Configuration for code scanning default setup."}';
11+
public const SCHEMA_JSON = '{"required":["state"],"type":"object","properties":{"state":{"enum":["configured","not-configured"],"type":"string","description":"Whether code scanning default setup has been configured or not."},"query_suite":{"enum":["default","extended"],"type":"string","description":"CodeQL query suite to be used."},"languages":{"type":"array","items":{"enum":["c-cpp","csharp","go","java-kotlin","javascript-typescript","python","ruby","swift"],"type":"string"},"description":"CodeQL languages to be analyzed. Supported values are: `c-cpp`, `csharp`, `go`, `java-kotlin`, `javascript-typescript`, `python`, and `ruby`."}},"description":"Configuration for code scanning default setup."}';
1212
public const SCHEMA_TITLE = '';
1313
public const SCHEMA_DESCRIPTION = 'Configuration for code scanning default setup.';
1414
public const SCHEMA_EXAMPLE_DATA = '{"state":"configured","query_suite":"default","languages":["generated","generated"]}';
1515

1616
/**
1717
* state: Whether code scanning default setup has been configured or not.
18-
* querySuite: The CodeQL query suite to use.
18+
* querySuite: CodeQL query suite to be used.
1919
* languages: CodeQL languages to be analyzed. Supported values are: `c-cpp`, `csharp`, `go`, `java-kotlin`, `javascript-typescript`, `python`, and `ruby`.
2020
*/
2121
public function __construct(public string $state, #[MapFrom('query_suite')]

src/Schema/CodeScanningQuerySuite.php

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

src/Schema/OrgRulesetConditions.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66

77
final readonly class OrgRulesetConditions
88
{
9-
public const SCHEMA_JSON = '{"title":"Organization ruleset conditions","type":"object","oneOf":[{"allOf":[{"title":"Repository ruleset conditions for ref names","type":"object","properties":{"ref_name":{"type":"object","properties":{"include":{"type":"array","items":{"type":"string"},"description":"Array of ref names or patterns to include. One of these patterns must match for the condition to pass. Also accepts `~DEFAULT_BRANCH` to include the default branch or `~ALL` to include all branches."},"exclude":{"type":"array","items":{"type":"string"},"description":"Array of ref names or patterns to exclude. The condition will not pass if any of these patterns match."}}}},"description":"Parameters for a repository ruleset ref name condition"},{"title":"Repository ruleset conditions for repository names","required":["repository_name"],"type":"object","properties":{"repository_name":{"type":"object","properties":{"include":{"type":"array","items":{"type":"string"},"description":"Array of repository names or patterns to include. One of these patterns must match for the condition to pass. Also accepts `~ALL` to include all repositories."},"exclude":{"type":"array","items":{"type":"string"},"description":"Array of repository names or patterns to exclude. The condition will not pass if any of these patterns match."},"protected":{"type":"boolean","description":"Whether renaming of target repositories is prevented."}}}},"description":"Parameters for a repository name condition"}]},{"allOf":[{"title":"Repository ruleset conditions for ref names","type":"object","properties":{"ref_name":{"type":"object","properties":{"include":{"type":"array","items":{"type":"string"},"description":"Array of ref names or patterns to include. One of these patterns must match for the condition to pass. Also accepts `~DEFAULT_BRANCH` to include the default branch or `~ALL` to include all branches."},"exclude":{"type":"array","items":{"type":"string"},"description":"Array of ref names or patterns to exclude. The condition will not pass if any of these patterns match."}}}},"description":"Parameters for a repository ruleset ref name condition"},{"title":"Repository ruleset conditions for repository IDs","required":["repository_id"],"type":"object","properties":{"repository_id":{"type":"object","properties":{"repository_ids":{"type":"array","items":{"type":"integer"},"description":"The repository IDs that the ruleset applies to. One of these IDs must match for the condition to pass."}}}},"description":"Parameters for a repository ID condition"}]}],"description":"Conditions for a organization ruleset"}';
9+
public const SCHEMA_JSON = '{"title":"Organization ruleset conditions","type":"object","oneOf":[{"title":"repository_name_and_ref_name","type":"object","allOf":[{"title":"Repository ruleset conditions for ref names","type":"object","properties":{"ref_name":{"type":"object","properties":{"include":{"type":"array","items":{"type":"string"},"description":"Array of ref names or patterns to include. One of these patterns must match for the condition to pass. Also accepts `~DEFAULT_BRANCH` to include the default branch or `~ALL` to include all branches."},"exclude":{"type":"array","items":{"type":"string"},"description":"Array of ref names or patterns to exclude. The condition will not pass if any of these patterns match."}}}},"description":"Parameters for a repository ruleset ref name condition"},{"title":"Repository ruleset conditions for repository names","required":["repository_name"],"type":"object","properties":{"repository_name":{"type":"object","properties":{"include":{"type":"array","items":{"type":"string"},"description":"Array of repository names or patterns to include. One of these patterns must match for the condition to pass. Also accepts `~ALL` to include all repositories."},"exclude":{"type":"array","items":{"type":"string"},"description":"Array of repository names or patterns to exclude. The condition will not pass if any of these patterns match."},"protected":{"type":"boolean","description":"Whether renaming of target repositories is prevented."}}}},"description":"Parameters for a repository name condition"}],"description":"Conditions to target repositories by name and refs by name"},{"title":"repository_id_and_ref_name","type":"object","allOf":[{"title":"Repository ruleset conditions for ref names","type":"object","properties":{"ref_name":{"type":"object","properties":{"include":{"type":"array","items":{"type":"string"},"description":"Array of ref names or patterns to include. One of these patterns must match for the condition to pass. Also accepts `~DEFAULT_BRANCH` to include the default branch or `~ALL` to include all branches."},"exclude":{"type":"array","items":{"type":"string"},"description":"Array of ref names or patterns to exclude. The condition will not pass if any of these patterns match."}}}},"description":"Parameters for a repository ruleset ref name condition"},{"title":"Repository ruleset conditions for repository IDs","required":["repository_id"],"type":"object","properties":{"repository_id":{"type":"object","properties":{"repository_ids":{"type":"array","items":{"type":"integer"},"description":"The repository IDs that the ruleset applies to. One of these IDs must match for the condition to pass."}}}},"description":"Parameters for a repository ID condition"}],"description":"Conditions to target repositories by id and refs by name"}],"description":"Conditions for an organization ruleset"}';
1010
public const SCHEMA_TITLE = 'Organization ruleset conditions';
11-
public const SCHEMA_DESCRIPTION = 'Conditions for a organization ruleset';
11+
public const SCHEMA_DESCRIPTION = 'Conditions for an organization ruleset';
1212
public const SCHEMA_EXAMPLE_DATA = '[]';
1313

1414
public function __construct()
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace ApiClients\Client\GitHubEnterpriseCloud\Schema\Orgs\EnableOrDisableSecurityProductOnAllOrgRepos\Request;
6+
7+
use EventSauce\ObjectHydrator\MapFrom;
8+
9+
final readonly class ApplicationJson
10+
{
11+
public const SCHEMA_JSON = '{"properties":{"query_suite":{"enum":["default","extended"],"type":"string","description":"CodeQL query suite to be used. If you specify the `query_suite` parameter, the default setup will be configured with this query suite only on all repositories that didn\'t have default setup already configured. It will not change the query suite on repositories that already have default setup configured.\\nIf you don\'t specify any `query_suite` in your request, the preferred query suite of the organization will be applied."}}}';
12+
public const SCHEMA_TITLE = '';
13+
public const SCHEMA_DESCRIPTION = '';
14+
public const SCHEMA_EXAMPLE_DATA = '{"query_suite":"default"}';
15+
16+
/**
17+
* querySuite: CodeQL query suite to be used. If you specify the `query_suite` parameter, the default setup will be configured with this query suite only on all repositories that didn't have default setup already configured. It will not change the query suite on repositories that already have default setup configured.
18+
If you don't specify any `query_suite` in your request, the preferred query suite of the organization will be applied.
19+
*/
20+
public function __construct(#[MapFrom('query_suite')]
21+
public string|null $querySuite,)
22+
{
23+
}
24+
}

0 commit comments

Comments
 (0)