diff --git a/clients/GitHub/README.md b/clients/GitHub/README.md index 70cc8484575..7d4d9ce394f 100644 --- a/clients/GitHub/README.md +++ b/clients/GitHub/README.md @@ -7334,6 +7334,7 @@ Using the `call` method: ```php $client->call('GET /orgs/{org}/rulesets', [ 'org' => 'generated', + 'targets' => 'generated', 'per_page' => 8, 'page' => 1, ]); @@ -7342,6 +7343,7 @@ $client->call('GET /orgs/{org}/rulesets', [ Operations method: ```php $client->operations()->repos()->getOrgRulesets( org: 'generated', + targets: 'generated', per_page: 8, page: 1, ); @@ -7358,6 +7360,7 @@ Using the `call` method: ```php $client->call('LIST /orgs/{org}/rulesets', [ 'org' => 'generated', + 'targets' => 'generated', 'per_page' => 8, 'page' => 1, ]); @@ -7366,6 +7369,7 @@ $client->call('LIST /orgs/{org}/rulesets', [ Operations method: ```php $client->operations()->repos()->getOrgRulesetsListing( org: 'generated', + targets: 'generated', per_page: 8, page: 1, ); @@ -21034,6 +21038,7 @@ Using the `call` method: $client->call('GET /repos/{owner}/{repo}/rulesets', [ 'owner' => 'generated', 'repo' => 'generated', + 'targets' => 'generated', 'per_page' => 8, 'page' => 1, 'includes_parents' => , @@ -21044,6 +21049,7 @@ Operations method: ```php $client->operations()->repos()->getRepoRulesets( owner: 'generated', repo: 'generated', + targets: 'generated', per_page: 8, page: 1, includes_parents: , @@ -21062,6 +21068,7 @@ Using the `call` method: $client->call('LIST /repos/{owner}/{repo}/rulesets', [ 'owner' => 'generated', 'repo' => 'generated', + 'targets' => 'generated', 'per_page' => 8, 'page' => 1, 'includes_parents' => , @@ -21072,6 +21079,7 @@ Operations method: ```php $client->operations()->repos()->getRepoRulesetsListing( owner: 'generated', repo: 'generated', + targets: 'generated', per_page: 8, page: 1, includes_parents: , diff --git a/clients/GitHub/etc/openapi-client-generator.state b/clients/GitHub/etc/openapi-client-generator.state index 3e47cfbe420..059b7d5cf68 100644 --- a/clients/GitHub/etc/openapi-client-generator.state +++ b/clients/GitHub/etc/openapi-client-generator.state @@ -1,5 +1,5 @@ { - "specHash": "c6249831ad99957f8d160f21b8d426dd", + "specHash": "f0ef821141c0585bc8759f53f482f086", "generatedFiles": { "files": [ { @@ -288,7 +288,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/OrganizationFull.php", - "hash": "3a018ac7ea2387bbc8405cb2b90dfd3f" + "hash": "407d381923a1ad0d6ed16069bc371c77" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/ActionsCacheUsageOrgEnterprise.php", @@ -5576,7 +5576,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Operation\/Orgs.php", - "hash": "969f2d59467f854edc18a940b109cab4" + "hash": "5779931bdcabc12f26dbc4d46b041ffe" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Operation\/Actions.php", @@ -5612,7 +5612,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Operation\/Repos.php", - "hash": "af3d3a3094434c46deb56bfd146053fc" + "hash": "051cd6393628919848d5bab73f4446bb" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Operation\/Billing.php", @@ -15116,27 +15116,27 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operation\/Repos\/GetOrgRulesets.php", - "hash": "f186bcef71e86804eca024d292b3f811" + "hash": "8a06356935685c3befad838f68cf6849" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operator\/Repos\/GetOrgRulesets.php", - "hash": "26eea37b783100bfda2c29351adc1cb6" + "hash": "c1b9491afbbfeb0c1780da092ed219dd" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Internal\/Operation\/Repos\/GetOrgRulesetsTest.php", - "hash": "0900e8f755084825ae335e59da5c1017" + "hash": "1fae6216bc3e0072feba73cf1a75431e" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operation\/Repos\/GetOrgRulesetsListing.php", - "hash": "67f8d50e1626a28e8db866bfdc095513" + "hash": "afb9dd110759316873c1e25291edfd0f" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operator\/Repos\/GetOrgRulesetsListing.php", - "hash": "f6664c53f15770ed2bbab743c4bafdb5" + "hash": "48dbf3810af9d5cfda666701a04716a4" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Internal\/Operation\/Repos\/GetOrgRulesetsListingTest.php", - "hash": "3e3696aafc3fe4dcf9243303476b31ce" + "hash": "4c4546290cd5fa5d6d41f9d6af966889" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operation\/Repos\/CreateOrgRuleset.php", @@ -21012,27 +21012,27 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operation\/Repos\/GetRepoRulesets.php", - "hash": "248c27baa5290c79dd31cf4e3b2879a9" + "hash": "b0791c7385174babd0fd9c9294c2ead3" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operator\/Repos\/GetRepoRulesets.php", - "hash": "3714305a7f4eb1977ac508836a2c734a" + "hash": "63f54855c1abc54938d3e76f0022b157" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Internal\/Operation\/Repos\/GetRepoRulesetsTest.php", - "hash": "e8a1b6d538839ad4447ee0aa5e423f96" + "hash": "6a1625f17e937caa40926301788c0161" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operation\/Repos\/GetRepoRulesetsListing.php", - "hash": "084e7d414e7f4cde5b5dd3bafe2fe1df" + "hash": "a18f754a9185a5a17c89dde8a620a89d" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operator\/Repos\/GetRepoRulesetsListing.php", - "hash": "615441c1ad2844708d22ed1267360cf9" + "hash": "1c0658faa66ba7e8e843ccd03c453b03" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Internal\/Operation\/Repos\/GetRepoRulesetsListingTest.php", - "hash": "01ecefa538da9b0f5a71064fe9001a19" + "hash": "3a8838ca28a9c779716466668566efa8" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operation\/Repos\/CreateRepoRuleset.php", @@ -24460,7 +24460,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Repos.php", - "hash": "15b6c3b26b0222befe543a77d1d425dc" + "hash": "f6fc5c47a25e0c7aa3830069f5c6b15b" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Users.php", @@ -24736,7 +24736,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/List\/Repos.php", - "hash": "58feacbb3f5aceff6543f0db3e7d382f" + "hash": "8ac3762840b7518082ff0791571013ac" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/List\/Activity.php", @@ -24948,11 +24948,11 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Four.php", - "hash": "f248e13197b434832a0cbb6e3c9f1df4" + "hash": "47b25cd3d28cc3944541a5100a44428b" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Five.php", - "hash": "0846a936eb0a3e31a24ddb21a9bf9124" + "hash": "75ae89c5b320acc265942e34810063d8" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Six.php", @@ -25052,11 +25052,11 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/List\/Four.php", - "hash": "0bd1bbcad8e6f0a66a2ee13388a836ac" + "hash": "d884362f660768c44ec3cb877273ea4f" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/List\/Five.php", - "hash": "847f3fb360c2b185cfe50d6fb2ad225b" + "hash": "089c23b82d3036be6791c77247892fa4" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/List\/Six.php", @@ -25356,7 +25356,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Hydrator\/Operation\/Orgs\/Org.php", - "hash": "961e57d26030b87464ac3a800d853129" + "hash": "7669d3f60474dfb61465e812ecc0d630" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Hydrator\/Operation\/Orgs\/Org\/Actions\/Cache\/Usage.php", @@ -27736,11 +27736,11 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/PHPStan\/ClientCallReturnTypes.php", - "hash": "b279bfe420072ca3881b316b41cde25a" + "hash": "f5c81d72072dc36f546288473c6cef6a" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Types\/ClientCallReturnTypes.php", - "hash": "a3cd037b10acacb7fbfa8165f0c08dac" + "hash": "09d3f81ea6b7302920dbb397f2c52bd5" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/..\/etc\/phpstan-extension.neon", diff --git a/clients/GitHub/src/Internal/Hydrator/Operation/Orgs/Org.php b/clients/GitHub/src/Internal/Hydrator/Operation/Orgs/Org.php index 0a0d17aac5a..c62acd9bca2 100644 --- a/clients/GitHub/src/Internal/Hydrator/Operation/Orgs/Org.php +++ b/clients/GitHub/src/Internal/Hydrator/Operation/Orgs/Org.php @@ -395,17 +395,6 @@ private function hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️Orga after_diskUsage: - $value = $payload['collaborators'] ?? null; - - if ($value === null) { - $properties['collaborators'] = null; - goto after_collaborators; - } - - $properties['collaborators'] = $value; - - after_collaborators: - $value = $payload['billing_email'] ?? null; if ($value === null) { @@ -1095,14 +1084,6 @@ private function serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema after_diskUsage: $result['disk_usage'] = $diskUsage; - $collaborators = $object->collaborators; - - if ($collaborators === null) { - goto after_collaborators; - } - - after_collaborators: $result['collaborators'] = $collaborators; - $billingEmail = $object->billingEmail; if ($billingEmail === null) { diff --git a/clients/GitHub/src/Internal/Operation/Repos/GetOrgRulesets.php b/clients/GitHub/src/Internal/Operation/Repos/GetOrgRulesets.php index ac97e24e112..f2372d67846 100644 --- a/clients/GitHub/src/Internal/Operation/Repos/GetOrgRulesets.php +++ b/clients/GitHub/src/Internal/Operation/Repos/GetOrgRulesets.php @@ -27,21 +27,27 @@ final class GetOrgRulesets public const OPERATION_MATCH = 'GET /orgs/{org}/rulesets'; /**The organization name. The name is not case sensitive. **/ private string $org; + /**A comma-separated list of rule targets to filter by. + If provided, only rulesets that apply to the specified targets will be returned. + For example, `branch,tag,push`. + **/ + private string $targets; /**The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." **/ private int $perPage; /**The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." **/ private int $page; - public function __construct(private readonly SchemaValidator $responseSchemaValidator, private readonly Internal\Hydrator\Operation\Orgs\Org\Rulesets $hydrator, string $org, int $perPage = 30, int $page = 1) + public function __construct(private readonly SchemaValidator $responseSchemaValidator, private readonly Internal\Hydrator\Operation\Orgs\Org\Rulesets $hydrator, string $org, string $targets, int $perPage = 30, int $page = 1) { $this->org = $org; + $this->targets = $targets; $this->perPage = $perPage; $this->page = $page; } public function createRequest(): RequestInterface { - return new Request('GET', str_replace(['{org}', '{per_page}', '{page}'], [$this->org, $this->perPage, $this->page], '/orgs/{org}/rulesets' . '?per_page={per_page}&page={page}')); + return new Request('GET', str_replace(['{org}', '{targets}', '{per_page}', '{page}'], [$this->org, $this->targets, $this->perPage, $this->page], '/orgs/{org}/rulesets' . '?targets={targets}&per_page={per_page}&page={page}')); } /** @return Observable */ diff --git a/clients/GitHub/src/Internal/Operation/Repos/GetOrgRulesetsListing.php b/clients/GitHub/src/Internal/Operation/Repos/GetOrgRulesetsListing.php index ea60b39b408..b46bf5a3063 100644 --- a/clients/GitHub/src/Internal/Operation/Repos/GetOrgRulesetsListing.php +++ b/clients/GitHub/src/Internal/Operation/Repos/GetOrgRulesetsListing.php @@ -27,21 +27,27 @@ final class GetOrgRulesetsListing public const OPERATION_MATCH = 'LIST /orgs/{org}/rulesets'; /**The organization name. The name is not case sensitive. **/ private string $org; + /**A comma-separated list of rule targets to filter by. + If provided, only rulesets that apply to the specified targets will be returned. + For example, `branch,tag,push`. + **/ + private string $targets; /**The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." **/ private int $perPage; /**The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." **/ private int $page; - public function __construct(private readonly SchemaValidator $responseSchemaValidator, private readonly Internal\Hydrator\Operation\Orgs\Org\Rulesets $hydrator, string $org, int $perPage = 30, int $page = 1) + public function __construct(private readonly SchemaValidator $responseSchemaValidator, private readonly Internal\Hydrator\Operation\Orgs\Org\Rulesets $hydrator, string $org, string $targets, int $perPage = 30, int $page = 1) { $this->org = $org; + $this->targets = $targets; $this->perPage = $perPage; $this->page = $page; } public function createRequest(): RequestInterface { - return new Request('GET', str_replace(['{org}', '{per_page}', '{page}'], [$this->org, $this->perPage, $this->page], '/orgs/{org}/rulesets' . '?per_page={per_page}&page={page}')); + return new Request('GET', str_replace(['{org}', '{targets}', '{per_page}', '{page}'], [$this->org, $this->targets, $this->perPage, $this->page], '/orgs/{org}/rulesets' . '?targets={targets}&per_page={per_page}&page={page}')); } /** @return Observable */ diff --git a/clients/GitHub/src/Internal/Operation/Repos/GetRepoRulesets.php b/clients/GitHub/src/Internal/Operation/Repos/GetRepoRulesets.php index 2b6cb487f29..354be1d4039 100644 --- a/clients/GitHub/src/Internal/Operation/Repos/GetRepoRulesets.php +++ b/clients/GitHub/src/Internal/Operation/Repos/GetRepoRulesets.php @@ -29,6 +29,11 @@ final class GetRepoRulesets private string $owner; /**The name of the repository without the `.git` extension. The name is not case sensitive. **/ private string $repo; + /**A comma-separated list of rule targets to filter by. + If provided, only rulesets that apply to the specified targets will be returned. + For example, `branch,tag,push`. + **/ + private string $targets; /**The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." **/ private int $perPage; /**The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." **/ @@ -36,10 +41,11 @@ final class GetRepoRulesets /**Include rulesets configured at higher levels that apply to this repository **/ private bool $includesParents; - public function __construct(private readonly SchemaValidator $responseSchemaValidator, private readonly Internal\Hydrator\Operation\Repos\Owner\Repo\Rulesets $hydrator, string $owner, string $repo, int $perPage = 30, int $page = 1, bool $includesParents = true) + public function __construct(private readonly SchemaValidator $responseSchemaValidator, private readonly Internal\Hydrator\Operation\Repos\Owner\Repo\Rulesets $hydrator, string $owner, string $repo, string $targets, int $perPage = 30, int $page = 1, bool $includesParents = true) { $this->owner = $owner; $this->repo = $repo; + $this->targets = $targets; $this->perPage = $perPage; $this->page = $page; $this->includesParents = $includesParents; @@ -47,7 +53,7 @@ public function __construct(private readonly SchemaValidator $responseSchemaVali public function createRequest(): RequestInterface { - return new Request('GET', str_replace(['{owner}', '{repo}', '{per_page}', '{page}', '{includes_parents}'], [$this->owner, $this->repo, $this->perPage, $this->page, $this->includesParents], '/repos/{owner}/{repo}/rulesets' . '?per_page={per_page}&page={page}&includes_parents={includes_parents}')); + return new Request('GET', str_replace(['{owner}', '{repo}', '{targets}', '{per_page}', '{page}', '{includes_parents}'], [$this->owner, $this->repo, $this->targets, $this->perPage, $this->page, $this->includesParents], '/repos/{owner}/{repo}/rulesets' . '?targets={targets}&per_page={per_page}&page={page}&includes_parents={includes_parents}')); } /** @return Observable */ diff --git a/clients/GitHub/src/Internal/Operation/Repos/GetRepoRulesetsListing.php b/clients/GitHub/src/Internal/Operation/Repos/GetRepoRulesetsListing.php index 98a85603d73..5bc84be17ae 100644 --- a/clients/GitHub/src/Internal/Operation/Repos/GetRepoRulesetsListing.php +++ b/clients/GitHub/src/Internal/Operation/Repos/GetRepoRulesetsListing.php @@ -29,6 +29,11 @@ final class GetRepoRulesetsListing private string $owner; /**The name of the repository without the `.git` extension. The name is not case sensitive. **/ private string $repo; + /**A comma-separated list of rule targets to filter by. + If provided, only rulesets that apply to the specified targets will be returned. + For example, `branch,tag,push`. + **/ + private string $targets; /**The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." **/ private int $perPage; /**The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." **/ @@ -36,10 +41,11 @@ final class GetRepoRulesetsListing /**Include rulesets configured at higher levels that apply to this repository **/ private bool $includesParents; - public function __construct(private readonly SchemaValidator $responseSchemaValidator, private readonly Internal\Hydrator\Operation\Repos\Owner\Repo\Rulesets $hydrator, string $owner, string $repo, int $perPage = 30, int $page = 1, bool $includesParents = true) + public function __construct(private readonly SchemaValidator $responseSchemaValidator, private readonly Internal\Hydrator\Operation\Repos\Owner\Repo\Rulesets $hydrator, string $owner, string $repo, string $targets, int $perPage = 30, int $page = 1, bool $includesParents = true) { $this->owner = $owner; $this->repo = $repo; + $this->targets = $targets; $this->perPage = $perPage; $this->page = $page; $this->includesParents = $includesParents; @@ -47,7 +53,7 @@ public function __construct(private readonly SchemaValidator $responseSchemaVali public function createRequest(): RequestInterface { - return new Request('GET', str_replace(['{owner}', '{repo}', '{per_page}', '{page}', '{includes_parents}'], [$this->owner, $this->repo, $this->perPage, $this->page, $this->includesParents], '/repos/{owner}/{repo}/rulesets' . '?per_page={per_page}&page={page}&includes_parents={includes_parents}')); + return new Request('GET', str_replace(['{owner}', '{repo}', '{targets}', '{per_page}', '{page}', '{includes_parents}'], [$this->owner, $this->repo, $this->targets, $this->perPage, $this->page, $this->includesParents], '/repos/{owner}/{repo}/rulesets' . '?targets={targets}&per_page={per_page}&page={page}&includes_parents={includes_parents}')); } /** @return Observable */ diff --git a/clients/GitHub/src/Internal/Operator/Repos/GetOrgRulesets.php b/clients/GitHub/src/Internal/Operator/Repos/GetOrgRulesets.php index 11fa0fbff04..8109fb8e877 100644 --- a/clients/GitHub/src/Internal/Operator/Repos/GetOrgRulesets.php +++ b/clients/GitHub/src/Internal/Operator/Repos/GetOrgRulesets.php @@ -24,10 +24,10 @@ public function __construct(private Browser $browser, private AuthenticationInte { } - /** @return Observable */ - public function call(string $org, int $perPage = 30, int $page = 1): iterable + /** @return iterable */ + public function call(string $org, string $targets, int $perPage = 30, int $page = 1): iterable { - $operation = new \ApiClients\Client\GitHub\Internal\Operation\Repos\GetOrgRulesets($this->responseSchemaValidator, $this->hydrator, $org, $perPage, $page); + $operation = new \ApiClients\Client\GitHub\Internal\Operation\Repos\GetOrgRulesets($this->responseSchemaValidator, $this->hydrator, $org, $targets, $perPage, $page); $request = $operation->createRequest(); $result = await($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): Observable { return $operation->createResponse($response); diff --git a/clients/GitHub/src/Internal/Operator/Repos/GetOrgRulesetsListing.php b/clients/GitHub/src/Internal/Operator/Repos/GetOrgRulesetsListing.php index e4db3327528..0d7fa30106c 100644 --- a/clients/GitHub/src/Internal/Operator/Repos/GetOrgRulesetsListing.php +++ b/clients/GitHub/src/Internal/Operator/Repos/GetOrgRulesetsListing.php @@ -24,10 +24,10 @@ public function __construct(private Browser $browser, private AuthenticationInte { } - /** @return Observable */ - public function call(string $org, int $perPage = 30, int $page = 1): iterable + /** @return iterable */ + public function call(string $org, string $targets, int $perPage = 30, int $page = 1): iterable { - $operation = new \ApiClients\Client\GitHub\Internal\Operation\Repos\GetOrgRulesetsListing($this->responseSchemaValidator, $this->hydrator, $org, $perPage, $page); + $operation = new \ApiClients\Client\GitHub\Internal\Operation\Repos\GetOrgRulesetsListing($this->responseSchemaValidator, $this->hydrator, $org, $targets, $perPage, $page); $request = $operation->createRequest(); $result = await($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): Observable { return $operation->createResponse($response); diff --git a/clients/GitHub/src/Internal/Operator/Repos/GetRepoRulesets.php b/clients/GitHub/src/Internal/Operator/Repos/GetRepoRulesets.php index ab0fb6c5f4a..2f5144cc916 100644 --- a/clients/GitHub/src/Internal/Operator/Repos/GetRepoRulesets.php +++ b/clients/GitHub/src/Internal/Operator/Repos/GetRepoRulesets.php @@ -24,10 +24,10 @@ public function __construct(private Browser $browser, private AuthenticationInte { } - /** @return Observable */ - public function call(string $owner, string $repo, int $perPage = 30, int $page = 1, bool $includesParents = true): iterable + /** @return iterable */ + public function call(string $owner, string $repo, string $targets, int $perPage = 30, int $page = 1, bool $includesParents = true): iterable { - $operation = new \ApiClients\Client\GitHub\Internal\Operation\Repos\GetRepoRulesets($this->responseSchemaValidator, $this->hydrator, $owner, $repo, $perPage, $page, $includesParents); + $operation = new \ApiClients\Client\GitHub\Internal\Operation\Repos\GetRepoRulesets($this->responseSchemaValidator, $this->hydrator, $owner, $repo, $targets, $perPage, $page, $includesParents); $request = $operation->createRequest(); $result = await($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): Observable { return $operation->createResponse($response); diff --git a/clients/GitHub/src/Internal/Operator/Repos/GetRepoRulesetsListing.php b/clients/GitHub/src/Internal/Operator/Repos/GetRepoRulesetsListing.php index b1b444657b5..dcb4f75f5f5 100644 --- a/clients/GitHub/src/Internal/Operator/Repos/GetRepoRulesetsListing.php +++ b/clients/GitHub/src/Internal/Operator/Repos/GetRepoRulesetsListing.php @@ -24,10 +24,10 @@ public function __construct(private Browser $browser, private AuthenticationInte { } - /** @return Observable */ - public function call(string $owner, string $repo, int $perPage = 30, int $page = 1, bool $includesParents = true): iterable + /** @return iterable */ + public function call(string $owner, string $repo, string $targets, int $perPage = 30, int $page = 1, bool $includesParents = true): iterable { - $operation = new \ApiClients\Client\GitHub\Internal\Operation\Repos\GetRepoRulesetsListing($this->responseSchemaValidator, $this->hydrator, $owner, $repo, $perPage, $page, $includesParents); + $operation = new \ApiClients\Client\GitHub\Internal\Operation\Repos\GetRepoRulesetsListing($this->responseSchemaValidator, $this->hydrator, $owner, $repo, $targets, $perPage, $page, $includesParents); $request = $operation->createRequest(); $result = await($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): Observable { return $operation->createResponse($response); diff --git a/clients/GitHub/src/Internal/Router/Get/Five.php b/clients/GitHub/src/Internal/Router/Get/Five.php index eb8ff68cb4f..db2561f9412 100644 --- a/clients/GitHub/src/Internal/Router/Get/Five.php +++ b/clients/GitHub/src/Internal/Router/Get/Five.php @@ -51,7 +51,7 @@ public function __construct(private Routers $routers) { } - /** @return |Observable|Observable|WithoutBody|Observable|Observable|Observable|Schema\BasicError|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable */ + /** @return |Observable|Observable|WithoutBody|Observable|Observable|Observable|Schema\BasicError|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|iterable|Observable|Observable|Observable */ public function call(string $call, array $params, array $pathChunks): HookDelivery|iterable|WithoutBody|GistComment|MarketplacePurchase|BasicError|ThreadSubscription|ActionsOrganizationPermissions|Ok|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListOrgSecrets\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListOrgVariables\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Orgs\ListAttestations\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\ListOrgSecrets\Response\ApplicationJson\Ok|CopilotOrganizationDetails|\ApiClients\Client\GitHub\Schema\Operations\Dependabot\ListOrgSecrets\Response\ApplicationJson\Ok|OrgHook|OrgMembership|Migration|OrganizationRole|RepositoryRuleset|TeamFull|ProjectCard|CheckAutomatedSecurityFixes|CodeSecurityConfigurationForRepository|Json|\ApiClients\Client\GitHub\Schema\Operations\Repos\GetAllEnvironments\Response\ApplicationJson\Ok|Import|Installation|InteractionLimitResponse|One|Language|LicenseContent|Page|\ApiClients\Client\GitHub\Schema\Operations\Repos\CheckPrivateVulnerabilityReporting\Response\ApplicationJson\Ok|ContentFile|SimpleUser|Stargazer|RepositorySubscription|Topic|TeamDiscussion|TeamMembership|TeamProject|CodespacesUserPublicKey|CodespacesSecret|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\CodespaceMachinesForAuthenticatedUser\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Apps\ListInstallationReposForAuthenticatedUser\Response\ApplicationJson\Ok|Package|\ApiClients\Client\GitHub\Schema\Operations\Users\ListAttestations\Response\ApplicationJson\Ok|EmptyObject { if ($pathChunks[0] === '') { diff --git a/clients/GitHub/src/Internal/Router/Get/Four.php b/clients/GitHub/src/Internal/Router/Get/Four.php index 7c40facd4ed..e9fddd1a861 100644 --- a/clients/GitHub/src/Internal/Router/Get/Four.php +++ b/clients/GitHub/src/Internal/Router/Get/Four.php @@ -34,7 +34,7 @@ public function __construct(private Routers $routers) { } - /** @return |Observable|Observable|Observable|Observable|Observable|WithoutBody|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable */ + /** @return |Observable|Observable|Observable|Observable|Observable|WithoutBody|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|iterable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable */ public function call(string $call, array $params, array $pathChunks): WebhookConfig|iterable|Installation|WithoutBody|GistSimple|GitignoreTemplate|MarketplacePurchase|Thread|Ok|\ApiClients\Client\GitHub\Schema\Operations\Orgs\ListAppInstallations\Response\ApplicationJson\Ok|InteractionLimitResponse|One|\ApiClients\Client\GitHub\Schema\Operations\Orgs\ListOrgRoles\Response\ApplicationJson\Ok|ProjectColumn|FullRepository|BasicError|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\ListSecretsForAuthenticatedUser\Response\ApplicationJson\Ok|Codespace|GpgKey|Key|Migration|SshSigningKey|Hovercard|StarredRepository|Repository { if ($pathChunks[0] === '') { diff --git a/clients/GitHub/src/Internal/Router/Get/Repos.php b/clients/GitHub/src/Internal/Router/Get/Repos.php index df938421704..90da80cd645 100644 --- a/clients/GitHub/src/Internal/Router/Get/Repos.php +++ b/clients/GitHub/src/Internal/Router/Get/Repos.php @@ -210,7 +210,7 @@ public function listForOrg(array $params): iterable return $operator->call($arguments['org'], $arguments['direction'], $arguments['type'], $arguments['sort'], $arguments['per_page'], $arguments['page']); } - /** @return Observable */ + /** @return iterable */ public function getOrgRulesets(array $params): iterable { $arguments = []; @@ -220,6 +220,12 @@ public function getOrgRulesets(array $params): iterable $arguments['org'] = $params['org']; unset($params['org']); + if (array_key_exists('targets', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: targets'); + } + + $arguments['targets'] = $params['targets']; + unset($params['targets']); if (array_key_exists('per_page', $params) === false) { throw new InvalidArgumentException('Missing mandatory field: per_page'); } @@ -234,7 +240,7 @@ public function getOrgRulesets(array $params): iterable unset($params['page']); $operator = new Internal\Operator\Repos\GetOrgRulesets($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Orgs🌀Org🌀Rulesets()); - return $operator->call($arguments['org'], $arguments['per_page'], $arguments['page']); + return $operator->call($arguments['org'], $arguments['targets'], $arguments['per_page'], $arguments['page']); } /** @return */ @@ -1068,7 +1074,7 @@ public function listReleases(array $params): iterable return $operator->call($arguments['owner'], $arguments['repo'], $arguments['per_page'], $arguments['page']); } - /** @return Observable */ + /** @return iterable */ public function getRepoRulesets(array $params): iterable { $arguments = []; @@ -1084,6 +1090,12 @@ public function getRepoRulesets(array $params): iterable $arguments['repo'] = $params['repo']; unset($params['repo']); + if (array_key_exists('targets', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: targets'); + } + + $arguments['targets'] = $params['targets']; + unset($params['targets']); if (array_key_exists('per_page', $params) === false) { throw new InvalidArgumentException('Missing mandatory field: per_page'); } @@ -1104,7 +1116,7 @@ public function getRepoRulesets(array $params): iterable unset($params['includes_parents']); $operator = new Internal\Operator\Repos\GetRepoRulesets($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Repos🌀Owner🌀Repo🌀Rulesets()); - return $operator->call($arguments['owner'], $arguments['repo'], $arguments['per_page'], $arguments['page'], $arguments['includes_parents']); + return $operator->call($arguments['owner'], $arguments['repo'], $arguments['targets'], $arguments['per_page'], $arguments['page'], $arguments['includes_parents']); } /** @return Observable */ diff --git a/clients/GitHub/src/Internal/Router/List/Five.php b/clients/GitHub/src/Internal/Router/List/Five.php index 54dd93858a9..5f89d759c70 100644 --- a/clients/GitHub/src/Internal/Router/List/Five.php +++ b/clients/GitHub/src/Internal/Router/List/Five.php @@ -16,7 +16,7 @@ public function __construct(private Routers $routers) { } - /** @return Observable|Observable|Observable|Schema\BasicError|WithoutBody|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable */ + /** @return Observable|Observable|Observable|Schema\BasicError|WithoutBody|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|iterable|Observable|Observable */ public function call(string $call, array $params, array $pathChunks): iterable|BasicError|WithoutBody { if ($pathChunks[0] === '') { diff --git a/clients/GitHub/src/Internal/Router/List/Four.php b/clients/GitHub/src/Internal/Router/List/Four.php index 45048521c93..5deb70e437d 100644 --- a/clients/GitHub/src/Internal/Router/List/Four.php +++ b/clients/GitHub/src/Internal/Router/List/Four.php @@ -15,7 +15,7 @@ public function __construct(private Routers $routers) { } - /** @return Observable|Observable|Observable|WithoutBody|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable */ + /** @return Observable|Observable|Observable|WithoutBody|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|iterable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable */ public function call(string $call, array $params, array $pathChunks): iterable|WithoutBody { if ($pathChunks[0] === '') { diff --git a/clients/GitHub/src/Internal/Router/List/Repos.php b/clients/GitHub/src/Internal/Router/List/Repos.php index 01e0d9c68f5..24408d450ce 100644 --- a/clients/GitHub/src/Internal/Router/List/Repos.php +++ b/clients/GitHub/src/Internal/Router/List/Repos.php @@ -169,7 +169,7 @@ public function listForOrgListing(array $params): iterable } while (count($items) > 0); } - /** @return Observable */ + /** @return iterable */ public function getOrgRulesetsListing(array $params): iterable { $arguments = []; @@ -179,6 +179,12 @@ public function getOrgRulesetsListing(array $params): iterable $arguments['org'] = $params['org']; unset($params['org']); + if (array_key_exists('targets', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: targets'); + } + + $arguments['targets'] = $params['targets']; + unset($params['targets']); if (array_key_exists('per_page', $params) === false) { throw new InvalidArgumentException('Missing mandatory field: per_page'); } @@ -194,7 +200,7 @@ public function getOrgRulesetsListing(array $params): iterable $arguments['page'] = 1; do { $operator = new Internal\Operator\Repos\GetOrgRulesetsListing($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Orgs🌀Org🌀Rulesets()); - $items = [...$operator->call($arguments['org'], $arguments['per_page'], $arguments['page'])]; + $items = [...$operator->call($arguments['org'], $arguments['targets'], $arguments['per_page'], $arguments['page'])]; yield from $items; @@ -835,7 +841,7 @@ public function listReleasesListing(array $params): iterable } while (count($items) > 0); } - /** @return Observable */ + /** @return iterable */ public function getRepoRulesetsListing(array $params): iterable { $arguments = []; @@ -851,6 +857,12 @@ public function getRepoRulesetsListing(array $params): iterable $arguments['repo'] = $params['repo']; unset($params['repo']); + if (array_key_exists('targets', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: targets'); + } + + $arguments['targets'] = $params['targets']; + unset($params['targets']); if (array_key_exists('per_page', $params) === false) { throw new InvalidArgumentException('Missing mandatory field: per_page'); } @@ -872,7 +884,7 @@ public function getRepoRulesetsListing(array $params): iterable $arguments['page'] = 1; do { $operator = new Internal\Operator\Repos\GetRepoRulesetsListing($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Repos🌀Owner🌀Repo🌀Rulesets()); - $items = [...$operator->call($arguments['owner'], $arguments['repo'], $arguments['per_page'], $arguments['page'], $arguments['includes_parents'])]; + $items = [...$operator->call($arguments['owner'], $arguments['repo'], $arguments['targets'], $arguments['per_page'], $arguments['page'], $arguments['includes_parents'])]; yield from $items; diff --git a/clients/GitHub/src/Operation/Repos.php b/clients/GitHub/src/Operation/Repos.php index 26fa3f0f357..07d8a5aac4d 100644 --- a/clients/GitHub/src/Operation/Repos.php +++ b/clients/GitHub/src/Operation/Repos.php @@ -89,16 +89,16 @@ public function createInOrg(string $org, array $params): FullRepository return $this->operators->repos👷CreateInOrg()->call($org, $params); } - /** @return Observable */ - public function getOrgRulesets(string $org, int $perPage, int $page): iterable + /** @return iterable */ + public function getOrgRulesets(string $org, string $targets, int $perPage, int $page): iterable { - return $this->operators->repos👷GetOrgRulesets()->call($org, $perPage, $page); + return $this->operators->repos👷GetOrgRulesets()->call($org, $targets, $perPage, $page); } - /** @return Observable */ - public function getOrgRulesetsListing(string $org, int $perPage, int $page): iterable + /** @return iterable */ + public function getOrgRulesetsListing(string $org, string $targets, int $perPage, int $page): iterable { - return $this->operators->repos👷GetOrgRulesetsListing()->call($org, $perPage, $page); + return $this->operators->repos👷GetOrgRulesetsListing()->call($org, $targets, $perPage, $page); } /** @return */ @@ -1163,16 +1163,16 @@ public function getBranchRulesListing(string $owner, string $repo, string $branc return $this->operators->repos👷GetBranchRulesListing()->call($owner, $repo, $branch, $perPage, $page); } - /** @return Observable */ - public function getRepoRulesets(string $owner, string $repo, int $perPage, int $page, bool $includesParents): iterable + /** @return iterable */ + public function getRepoRulesets(string $owner, string $repo, string $targets, int $perPage, int $page, bool $includesParents): iterable { - return $this->operators->repos👷GetRepoRulesets()->call($owner, $repo, $perPage, $page, $includesParents); + return $this->operators->repos👷GetRepoRulesets()->call($owner, $repo, $targets, $perPage, $page, $includesParents); } - /** @return Observable */ - public function getRepoRulesetsListing(string $owner, string $repo, int $perPage, int $page, bool $includesParents): iterable + /** @return iterable */ + public function getRepoRulesetsListing(string $owner, string $repo, string $targets, int $perPage, int $page, bool $includesParents): iterable { - return $this->operators->repos👷GetRepoRulesetsListing()->call($owner, $repo, $perPage, $page, $includesParents); + return $this->operators->repos👷GetRepoRulesetsListing()->call($owner, $repo, $targets, $perPage, $page, $includesParents); } /** @return */ diff --git a/clients/GitHub/src/PHPStan/ClientCallReturnTypes.php b/clients/GitHub/src/PHPStan/ClientCallReturnTypes.php index 87997385669..2661ae7ad58 100644 --- a/clients/GitHub/src/PHPStan/ClientCallReturnTypes.php +++ b/clients/GitHub/src/PHPStan/ClientCallReturnTypes.php @@ -1288,11 +1288,11 @@ public function getTypeFromMethodCall(MethodReflection $methodReflection, Method } if ($call === 'GET /orgs/{org}/rulesets') { - return $this->typeResolver->resolve('Observable'); + return $this->typeResolver->resolve('iterable'); } if ($call === 'LIST /orgs/{org}/rulesets') { - return $this->typeResolver->resolve('Observable'); + return $this->typeResolver->resolve('iterable'); } if ($call === 'POST /orgs/{org}/rulesets') { @@ -3440,11 +3440,11 @@ public function getTypeFromMethodCall(MethodReflection $methodReflection, Method } if ($call === 'GET /repos/{owner}/{repo}/rulesets') { - return $this->typeResolver->resolve('Observable'); + return $this->typeResolver->resolve('iterable'); } if ($call === 'LIST /repos/{owner}/{repo}/rulesets') { - return $this->typeResolver->resolve('Observable'); + return $this->typeResolver->resolve('iterable'); } if ($call === 'POST /repos/{owner}/{repo}/rulesets') { diff --git a/clients/GitHub/src/Schema/OrganizationFull.php b/clients/GitHub/src/Schema/OrganizationFull.php index cad3ee8898e..146acbafda6 100644 --- a/clients/GitHub/src/Schema/OrganizationFull.php +++ b/clients/GitHub/src/Schema/OrganizationFull.php @@ -242,15 +242,6 @@ 10000 ] }, - "collaborators": { - "type": [ - "integer", - "null" - ], - "examples": [ - 8 - ] - }, "billing_email": { "type": [ "string", @@ -487,7 +478,6 @@ "owned_private_repos": 100, "private_gists": 81, "disk_usage": 10000, - "collaborators": 8, "billing_email": "org@example.com", "plan": { "name": "generated", @@ -574,7 +564,7 @@ public function __construct(public string $login, public int $id, #[MapFrom('nod public int|null $totalPrivateRepos, #[MapFrom('owned_private_repos')] public int|null $ownedPrivateRepos, #[MapFrom('private_gists')] public int|null $privateGists, #[MapFrom('disk_usage')] - public int|null $diskUsage, public int|null $collaborators, #[MapFrom('billing_email')] + public int|null $diskUsage, #[MapFrom('billing_email')] public string|null $billingEmail, public Schema\OrganizationFull\Plan|null $plan, #[MapFrom('default_repository_permission')] public string|null $defaultRepositoryPermission, #[MapFrom('members_can_create_repositories')] public bool|null $membersCanCreateRepositories, #[MapFrom('two_factor_requirement_enabled')] diff --git a/clients/GitHub/tests/Internal/Operation/Repos/GetOrgRulesetsListingTest.php b/clients/GitHub/tests/Internal/Operation/Repos/GetOrgRulesetsListingTest.php index 67f3d522242..be6444c8689 100644 --- a/clients/GitHub/tests/Internal/Operation/Repos/GetOrgRulesetsListingTest.php +++ b/clients/GitHub/tests/Internal/Operation/Repos/GetOrgRulesetsListingTest.php @@ -31,10 +31,11 @@ public function call_httpCode_404_responseContentType_application_json_zero(): v $browser = $this->prophesize(Browser::class); $browser->withBase(Argument::any())->willReturn($browser->reveal()); $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); - $browser->request('GET', '/orgs/generated/rulesets?per_page=8&page=1', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $browser->request('GET', '/orgs/generated/rulesets?targets=generated&per_page=8&page=1', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); $client = new Client($auth->reveal(), $browser->reveal()); $result = $client->call(Internal\Operation\Repos\GetOrgRulesetsListing::OPERATION_MATCH, (static function (array $data): array { $data['org'] = 'generated'; + $data['targets'] = 'generated'; $data['per_page'] = 8; $data['page'] = 1; @@ -54,9 +55,9 @@ public function operations_httpCode_404_responseContentType_application_json_zer $browser = $this->prophesize(Browser::class); $browser->withBase(Argument::any())->willReturn($browser->reveal()); $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); - $browser->request('GET', '/orgs/generated/rulesets?per_page=8&page=1', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $browser->request('GET', '/orgs/generated/rulesets?targets=generated&per_page=8&page=1', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); $client = new Client($auth->reveal(), $browser->reveal()); - $result = $client->operations()->repos()->getOrgRulesetsListing('generated', 8, 1); + $result = $client->operations()->repos()->getOrgRulesetsListing('generated', 'generated', 8, 1); foreach ($result as $item) { } } @@ -71,10 +72,11 @@ public function call_httpCode_500_responseContentType_application_json_zero(): v $browser = $this->prophesize(Browser::class); $browser->withBase(Argument::any())->willReturn($browser->reveal()); $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); - $browser->request('GET', '/orgs/generated/rulesets?per_page=8&page=1', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $browser->request('GET', '/orgs/generated/rulesets?targets=generated&per_page=8&page=1', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); $client = new Client($auth->reveal(), $browser->reveal()); $result = $client->call(Internal\Operation\Repos\GetOrgRulesetsListing::OPERATION_MATCH, (static function (array $data): array { $data['org'] = 'generated'; + $data['targets'] = 'generated'; $data['per_page'] = 8; $data['page'] = 1; @@ -94,9 +96,9 @@ public function operations_httpCode_500_responseContentType_application_json_zer $browser = $this->prophesize(Browser::class); $browser->withBase(Argument::any())->willReturn($browser->reveal()); $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); - $browser->request('GET', '/orgs/generated/rulesets?per_page=8&page=1', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $browser->request('GET', '/orgs/generated/rulesets?targets=generated&per_page=8&page=1', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); $client = new Client($auth->reveal(), $browser->reveal()); - $result = $client->operations()->repos()->getOrgRulesetsListing('generated', 8, 1); + $result = $client->operations()->repos()->getOrgRulesetsListing('generated', 'generated', 8, 1); foreach ($result as $item) { } } diff --git a/clients/GitHub/tests/Internal/Operation/Repos/GetOrgRulesetsTest.php b/clients/GitHub/tests/Internal/Operation/Repos/GetOrgRulesetsTest.php index 71b0d84ca47..fd0cb90a67f 100644 --- a/clients/GitHub/tests/Internal/Operation/Repos/GetOrgRulesetsTest.php +++ b/clients/GitHub/tests/Internal/Operation/Repos/GetOrgRulesetsTest.php @@ -31,10 +31,11 @@ public function call_httpCode_404_responseContentType_application_json_zero(): v $browser = $this->prophesize(Browser::class); $browser->withBase(Argument::any())->willReturn($browser->reveal()); $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); - $browser->request('GET', '/orgs/generated/rulesets?per_page=8&page=1', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $browser->request('GET', '/orgs/generated/rulesets?targets=generated&per_page=8&page=1', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); $client = new Client($auth->reveal(), $browser->reveal()); $result = $client->call(Internal\Operation\Repos\GetOrgRulesets::OPERATION_MATCH, (static function (array $data): array { $data['org'] = 'generated'; + $data['targets'] = 'generated'; $data['per_page'] = 8; $data['page'] = 1; @@ -52,9 +53,9 @@ public function operations_httpCode_404_responseContentType_application_json_zer $browser = $this->prophesize(Browser::class); $browser->withBase(Argument::any())->willReturn($browser->reveal()); $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); - $browser->request('GET', '/orgs/generated/rulesets?per_page=8&page=1', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $browser->request('GET', '/orgs/generated/rulesets?targets=generated&per_page=8&page=1', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); $client = new Client($auth->reveal(), $browser->reveal()); - $result = $client->operations()->repos()->getOrgRulesets('generated', 8, 1); + $result = $client->operations()->repos()->getOrgRulesets('generated', 'generated', 8, 1); } /** @test */ @@ -67,10 +68,11 @@ public function call_httpCode_500_responseContentType_application_json_zero(): v $browser = $this->prophesize(Browser::class); $browser->withBase(Argument::any())->willReturn($browser->reveal()); $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); - $browser->request('GET', '/orgs/generated/rulesets?per_page=8&page=1', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $browser->request('GET', '/orgs/generated/rulesets?targets=generated&per_page=8&page=1', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); $client = new Client($auth->reveal(), $browser->reveal()); $result = $client->call(Internal\Operation\Repos\GetOrgRulesets::OPERATION_MATCH, (static function (array $data): array { $data['org'] = 'generated'; + $data['targets'] = 'generated'; $data['per_page'] = 8; $data['page'] = 1; @@ -88,8 +90,8 @@ public function operations_httpCode_500_responseContentType_application_json_zer $browser = $this->prophesize(Browser::class); $browser->withBase(Argument::any())->willReturn($browser->reveal()); $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); - $browser->request('GET', '/orgs/generated/rulesets?per_page=8&page=1', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $browser->request('GET', '/orgs/generated/rulesets?targets=generated&per_page=8&page=1', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); $client = new Client($auth->reveal(), $browser->reveal()); - $result = $client->operations()->repos()->getOrgRulesets('generated', 8, 1); + $result = $client->operations()->repos()->getOrgRulesets('generated', 'generated', 8, 1); } } diff --git a/clients/GitHub/tests/Internal/Operation/Repos/GetRepoRulesetsListingTest.php b/clients/GitHub/tests/Internal/Operation/Repos/GetRepoRulesetsListingTest.php index 8f0f899ec8b..18964be8512 100644 --- a/clients/GitHub/tests/Internal/Operation/Repos/GetRepoRulesetsListingTest.php +++ b/clients/GitHub/tests/Internal/Operation/Repos/GetRepoRulesetsListingTest.php @@ -31,11 +31,12 @@ public function call_httpCode_404_responseContentType_application_json_zero(): v $browser = $this->prophesize(Browser::class); $browser->withBase(Argument::any())->willReturn($browser->reveal()); $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); - $browser->request('GET', '/repos/generated/generated/rulesets?per_page=8&page=1&includes_parents=', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $browser->request('GET', '/repos/generated/generated/rulesets?targets=generated&per_page=8&page=1&includes_parents=', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); $client = new Client($auth->reveal(), $browser->reveal()); $result = $client->call(Internal\Operation\Repos\GetRepoRulesetsListing::OPERATION_MATCH, (static function (array $data): array { $data['owner'] = 'generated'; $data['repo'] = 'generated'; + $data['targets'] = 'generated'; $data['per_page'] = 8; $data['page'] = 1; $data['includes_parents'] = false; @@ -56,9 +57,9 @@ public function operations_httpCode_404_responseContentType_application_json_zer $browser = $this->prophesize(Browser::class); $browser->withBase(Argument::any())->willReturn($browser->reveal()); $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); - $browser->request('GET', '/repos/generated/generated/rulesets?per_page=8&page=1&includes_parents=', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $browser->request('GET', '/repos/generated/generated/rulesets?targets=generated&per_page=8&page=1&includes_parents=', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); $client = new Client($auth->reveal(), $browser->reveal()); - $result = $client->operations()->repos()->getRepoRulesetsListing('generated', 'generated', 8, 1, false); + $result = $client->operations()->repos()->getRepoRulesetsListing('generated', 'generated', 'generated', 8, 1, false); foreach ($result as $item) { } } @@ -73,11 +74,12 @@ public function call_httpCode_500_responseContentType_application_json_zero(): v $browser = $this->prophesize(Browser::class); $browser->withBase(Argument::any())->willReturn($browser->reveal()); $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); - $browser->request('GET', '/repos/generated/generated/rulesets?per_page=8&page=1&includes_parents=', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $browser->request('GET', '/repos/generated/generated/rulesets?targets=generated&per_page=8&page=1&includes_parents=', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); $client = new Client($auth->reveal(), $browser->reveal()); $result = $client->call(Internal\Operation\Repos\GetRepoRulesetsListing::OPERATION_MATCH, (static function (array $data): array { $data['owner'] = 'generated'; $data['repo'] = 'generated'; + $data['targets'] = 'generated'; $data['per_page'] = 8; $data['page'] = 1; $data['includes_parents'] = false; @@ -98,9 +100,9 @@ public function operations_httpCode_500_responseContentType_application_json_zer $browser = $this->prophesize(Browser::class); $browser->withBase(Argument::any())->willReturn($browser->reveal()); $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); - $browser->request('GET', '/repos/generated/generated/rulesets?per_page=8&page=1&includes_parents=', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $browser->request('GET', '/repos/generated/generated/rulesets?targets=generated&per_page=8&page=1&includes_parents=', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); $client = new Client($auth->reveal(), $browser->reveal()); - $result = $client->operations()->repos()->getRepoRulesetsListing('generated', 'generated', 8, 1, false); + $result = $client->operations()->repos()->getRepoRulesetsListing('generated', 'generated', 'generated', 8, 1, false); foreach ($result as $item) { } } diff --git a/clients/GitHub/tests/Internal/Operation/Repos/GetRepoRulesetsTest.php b/clients/GitHub/tests/Internal/Operation/Repos/GetRepoRulesetsTest.php index 7a03e2fbac1..fd2089de92d 100644 --- a/clients/GitHub/tests/Internal/Operation/Repos/GetRepoRulesetsTest.php +++ b/clients/GitHub/tests/Internal/Operation/Repos/GetRepoRulesetsTest.php @@ -31,11 +31,12 @@ public function call_httpCode_404_responseContentType_application_json_zero(): v $browser = $this->prophesize(Browser::class); $browser->withBase(Argument::any())->willReturn($browser->reveal()); $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); - $browser->request('GET', '/repos/generated/generated/rulesets?per_page=8&page=1&includes_parents=', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $browser->request('GET', '/repos/generated/generated/rulesets?targets=generated&per_page=8&page=1&includes_parents=', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); $client = new Client($auth->reveal(), $browser->reveal()); $result = $client->call(Internal\Operation\Repos\GetRepoRulesets::OPERATION_MATCH, (static function (array $data): array { $data['owner'] = 'generated'; $data['repo'] = 'generated'; + $data['targets'] = 'generated'; $data['per_page'] = 8; $data['page'] = 1; $data['includes_parents'] = false; @@ -54,9 +55,9 @@ public function operations_httpCode_404_responseContentType_application_json_zer $browser = $this->prophesize(Browser::class); $browser->withBase(Argument::any())->willReturn($browser->reveal()); $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); - $browser->request('GET', '/repos/generated/generated/rulesets?per_page=8&page=1&includes_parents=', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $browser->request('GET', '/repos/generated/generated/rulesets?targets=generated&per_page=8&page=1&includes_parents=', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); $client = new Client($auth->reveal(), $browser->reveal()); - $result = $client->operations()->repos()->getRepoRulesets('generated', 'generated', 8, 1, false); + $result = $client->operations()->repos()->getRepoRulesets('generated', 'generated', 'generated', 8, 1, false); } /** @test */ @@ -69,11 +70,12 @@ public function call_httpCode_500_responseContentType_application_json_zero(): v $browser = $this->prophesize(Browser::class); $browser->withBase(Argument::any())->willReturn($browser->reveal()); $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); - $browser->request('GET', '/repos/generated/generated/rulesets?per_page=8&page=1&includes_parents=', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $browser->request('GET', '/repos/generated/generated/rulesets?targets=generated&per_page=8&page=1&includes_parents=', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); $client = new Client($auth->reveal(), $browser->reveal()); $result = $client->call(Internal\Operation\Repos\GetRepoRulesets::OPERATION_MATCH, (static function (array $data): array { $data['owner'] = 'generated'; $data['repo'] = 'generated'; + $data['targets'] = 'generated'; $data['per_page'] = 8; $data['page'] = 1; $data['includes_parents'] = false; @@ -92,8 +94,8 @@ public function operations_httpCode_500_responseContentType_application_json_zer $browser = $this->prophesize(Browser::class); $browser->withBase(Argument::any())->willReturn($browser->reveal()); $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); - $browser->request('GET', '/repos/generated/generated/rulesets?per_page=8&page=1&includes_parents=', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $browser->request('GET', '/repos/generated/generated/rulesets?targets=generated&per_page=8&page=1&includes_parents=', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); $client = new Client($auth->reveal(), $browser->reveal()); - $result = $client->operations()->repos()->getRepoRulesets('generated', 'generated', 8, 1, false); + $result = $client->operations()->repos()->getRepoRulesets('generated', 'generated', 'generated', 8, 1, false); } } diff --git a/clients/GitHub/tests/Types/ClientCallReturnTypes.php b/clients/GitHub/tests/Types/ClientCallReturnTypes.php index 7d6cb950726..e8791199230 100644 --- a/clients/GitHub/tests/Types/ClientCallReturnTypes.php +++ b/clients/GitHub/tests/Types/ClientCallReturnTypes.php @@ -328,8 +328,8 @@ function authHeader(): string assertType('Observable', $client->call('GET /orgs/{org}/repos')); assertType('Observable', $client->call('LIST /orgs/{org}/repos')); assertType('', $client->call('POST /orgs/{org}/repos')); -assertType('Observable', $client->call('GET /orgs/{org}/rulesets')); -assertType('Observable', $client->call('LIST /orgs/{org}/rulesets')); +assertType('iterable', $client->call('GET /orgs/{org}/rulesets')); +assertType('iterable', $client->call('LIST /orgs/{org}/rulesets')); assertType('', $client->call('POST /orgs/{org}/rulesets')); assertType('Observable', $client->call('GET /orgs/{org}/rulesets/rule-suites')); assertType('Observable', $client->call('LIST /orgs/{org}/rulesets/rule-suites')); @@ -866,8 +866,8 @@ function authHeader(): string assertType('', $client->call('DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}')); assertType('Observable', $client->call('GET /repos/{owner}/{repo}/rules/branches/{branch}')); assertType('Observable', $client->call('LIST /repos/{owner}/{repo}/rules/branches/{branch}')); -assertType('Observable', $client->call('GET /repos/{owner}/{repo}/rulesets')); -assertType('Observable', $client->call('LIST /repos/{owner}/{repo}/rulesets')); +assertType('iterable', $client->call('GET /repos/{owner}/{repo}/rulesets')); +assertType('iterable', $client->call('LIST /repos/{owner}/{repo}/rulesets')); assertType('', $client->call('POST /repos/{owner}/{repo}/rulesets')); assertType('Observable', $client->call('GET /repos/{owner}/{repo}/rulesets/rule-suites')); assertType('Observable', $client->call('LIST /repos/{owner}/{repo}/rulesets/rule-suites')); diff --git a/etc/specs/GitHub/current.spec.yaml b/etc/specs/GitHub/current.spec.yaml index 1f9520a634e..8d75bc65c29 100644 --- a/etc/specs/GitHub/current.spec.yaml +++ b/etc/specs/GitHub/current.spec.yaml @@ -12569,6 +12569,7 @@ paths: - "$ref": "#/components/parameters/org" - "$ref": "#/components/parameters/per-page" - "$ref": "#/components/parameters/page" + - "$ref": "#/components/parameters/ruleset-targets" responses: '200': description: Response @@ -37251,6 +37252,7 @@ paths: schema: type: boolean default: true + - "$ref": "#/components/parameters/ruleset-targets" responses: '200': description: Response @@ -70752,12 +70754,6 @@ components: - 'null' examples: - 10000 - collaborators: - type: - - integer - - 'null' - examples: - - 8 billing_email: type: - string @@ -223775,6 +223771,18 @@ components: required: true schema: type: string + ruleset-targets: + name: targets + description: | + A comma-separated list of rule targets to filter by. + If provided, only rulesets that apply to the specified targets will be returned. + For example, `branch,tag,push`. + in: query + required: false + schema: + type: string + examples: + - branch,tag,push ref-in-query: name: ref description: The name of the ref. Cannot contain wildcard characters. Optionally