diff --git a/clients/GitHubEnterpriseCloud/README.md b/clients/GitHubEnterpriseCloud/README.md index 434c859ab3f..3797da0d552 100644 --- a/clients/GitHubEnterpriseCloud/README.md +++ b/clients/GitHubEnterpriseCloud/README.md @@ -9520,6 +9520,7 @@ Using the `call` method: ```php $client->call('GET /orgs/{org}/rulesets', [ 'org' => 'generated', + 'targets' => 'generated', 'per_page' => 8, 'page' => 1, ]); @@ -9528,6 +9529,7 @@ $client->call('GET /orgs/{org}/rulesets', [ Operations method: ```php $client->operations()->repos()->getOrgRulesets( org: 'generated', + targets: 'generated', per_page: 8, page: 1, ); @@ -9544,6 +9546,7 @@ Using the `call` method: ```php $client->call('LIST /orgs/{org}/rulesets', [ 'org' => 'generated', + 'targets' => 'generated', 'per_page' => 8, 'page' => 1, ]); @@ -9552,6 +9555,7 @@ $client->call('LIST /orgs/{org}/rulesets', [ Operations method: ```php $client->operations()->repos()->getOrgRulesetsListing( org: 'generated', + targets: 'generated', per_page: 8, page: 1, ); @@ -23424,6 +23428,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' => , @@ -23434,6 +23439,7 @@ Operations method: ```php $client->operations()->repos()->getRepoRulesets( owner: 'generated', repo: 'generated', + targets: 'generated', per_page: 8, page: 1, includes_parents: , @@ -23452,6 +23458,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' => , @@ -23462,6 +23469,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/GitHubEnterpriseCloud/etc/openapi-client-generator.state b/clients/GitHubEnterpriseCloud/etc/openapi-client-generator.state index 47b6954581e..262c76771a5 100644 --- a/clients/GitHubEnterpriseCloud/etc/openapi-client-generator.state +++ b/clients/GitHubEnterpriseCloud/etc/openapi-client-generator.state @@ -1,5 +1,5 @@ { - "specHash": "b756a9c2ae79f483113462f9d47c6cbf", + "specHash": "3d6ad7276957d3dd8952df409fac0650", "generatedFiles": { "files": [ { @@ -488,7 +488,7 @@ }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Schema\/OrganizationFull.php", - "hash": "04d76489e932f9f7b21ed78c22f5880a" + "hash": "dd50b637e99b96a649446ab5b58cc42e" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Schema\/ActionsCacheUsageByRepository.php", @@ -5948,7 +5948,7 @@ }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Operation\/Orgs.php", - "hash": "160360639ec84ebfb60d4e4a8483a072" + "hash": "fa6719d3b16d3c7ed97317f8143119da" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Operation\/Oidc.php", @@ -5980,7 +5980,7 @@ }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Operation\/Repos.php", - "hash": "e3d0fb7bf6fdae24d5c77c192f75dddc" + "hash": "b0b431a98a12675610f1f1dc6949bbae" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Operation\/Reactions.php", @@ -16532,27 +16532,27 @@ }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Operation\/Repos\/GetOrgRulesets.php", - "hash": "8455dcda608622ff162deea94c8fa34f" + "hash": "f73ad17b9d45e93d522ceaa1391957c5" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Operator\/Repos\/GetOrgRulesets.php", - "hash": "8b382dcfec8d12101d66242494ef379a" + "hash": "74a543706ece80469496b24e8f95af38" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/tests\/\/Internal\/Operation\/Repos\/GetOrgRulesetsTest.php", - "hash": "a56b53ffc3041464c24e76de0599999f" + "hash": "b68cda945cafadc5151c3409848f6861" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Operation\/Repos\/GetOrgRulesetsListing.php", - "hash": "2a27a8d2390bb7ee3b2aabcfee7ac4c7" + "hash": "ae34d53a90f9b11f58ae2967e3494396" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Operator\/Repos\/GetOrgRulesetsListing.php", - "hash": "8ae7a6d6324a3f78331cb73069e48185" + "hash": "d752495e4ef36119d5706f2bc95d1509" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/tests\/\/Internal\/Operation\/Repos\/GetOrgRulesetsListingTest.php", - "hash": "59c5a34aaa531b6fa7657478c31a48af" + "hash": "55b3ad37153666320738174e11e27ce5" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Operation\/Repos\/CreateOrgRuleset.php", @@ -22528,27 +22528,27 @@ }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Operation\/Repos\/GetRepoRulesets.php", - "hash": "484c0514030654d2d4f7dc2a8fdd6617" + "hash": "2d40749386c5482052e0ed90ca469439" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Operator\/Repos\/GetRepoRulesets.php", - "hash": "3a81fe553f0cef79740ba3be7ce5b90c" + "hash": "89f03bda37028294883ee5896d9a8355" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/tests\/\/Internal\/Operation\/Repos\/GetRepoRulesetsTest.php", - "hash": "8e3e0609de792b2b717d76014a40ce33" + "hash": "4980f54550448912ad4b7c26832568b9" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Operation\/Repos\/GetRepoRulesetsListing.php", - "hash": "9fea24ce37b0f0e879536cbe18d7bd20" + "hash": "6cee22c78bdb32a436bdf842cc9e1c33" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Operator\/Repos\/GetRepoRulesetsListing.php", - "hash": "0f4ef33226c88f6d0fb6f4d718c3c1c6" + "hash": "46eec8393b15165c41395318082b1056" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/tests\/\/Internal\/Operation\/Repos\/GetRepoRulesetsListingTest.php", - "hash": "06a5f48c60a283354502aaf8cfbd6940" + "hash": "28ac9f529b424b773bb9e7459af42f14" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Operation\/Repos\/CreateRepoRuleset.php", @@ -26088,7 +26088,7 @@ }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Repos.php", - "hash": "76b69033138f291aa2775258778751e5" + "hash": "8640078db9651f7aa01b565d4c57671a" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Users.php", @@ -26400,7 +26400,7 @@ }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Router\/List\/Repos.php", - "hash": "623934de7b82e97f0bfb220ac1a80422" + "hash": "e0e5c7d34689989da7c3d7566916e5b4" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Router\/List\/Activity.php", @@ -26636,11 +26636,11 @@ }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Four.php", - "hash": "84baabab6ef8bb8c8b3c3f087fdfd342" + "hash": "5bd0031a3b2f9afae4c837b0244f74dc" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Five.php", - "hash": "cb7d826c43fe180e6b9f6268536b74bc" + "hash": "d2310762aafa9b401ca1fa40ea24d8bf" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Six.php", @@ -26736,11 +26736,11 @@ }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Router\/List\/Four.php", - "hash": "603ef2017db782aa7bb02ff55436588f" + "hash": "9dabdc8620df1aefb28d11c639a05a65" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Router\/List\/Five.php", - "hash": "dc880ef38a537e30963c81bc90d8075f" + "hash": "fcd8e2a8f837d56c56a00a017d923e62" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Router\/List\/Two.php", @@ -27144,7 +27144,7 @@ }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Hydrator\/Operation\/Orgs\/Org.php", - "hash": "b70c69ec5194dc0b1f71240b4854c487" + "hash": "21f8577bb4fa1a65a064addf792ac483" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Hydrator\/Operation\/Orgs\/Org\/Actions\/Cache\/Usage.php", @@ -29820,11 +29820,11 @@ }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/PHPStan\/ClientCallReturnTypes.php", - "hash": "d4327cff15ed6791470ae0084e08653d" + "hash": "1685ffac718c21aa115cb0b39c27c094" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/tests\/\/Types\/ClientCallReturnTypes.php", - "hash": "8b24c3d0b4051f8068328f06fbbc0f44" + "hash": "61a263e8f319b58062089a83140af8f7" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/..\/etc\/phpstan-extension.neon", diff --git a/clients/GitHubEnterpriseCloud/src/Internal/Hydrator/Operation/Orgs/Org.php b/clients/GitHubEnterpriseCloud/src/Internal/Hydrator/Operation/Orgs/Org.php index 82647e9fd84..cae8fbf01b7 100644 --- a/clients/GitHubEnterpriseCloud/src/Internal/Hydrator/Operation/Orgs/Org.php +++ b/clients/GitHubEnterpriseCloud/src/Internal/Hydrator/Operation/Orgs/Org.php @@ -395,17 +395,6 @@ private function hydrateApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️S 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) { @@ -1106,14 +1095,6 @@ private function serializeObjectApiClients⚡️Client⚡️GitHubEnterpriseClou 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/GitHubEnterpriseCloud/src/Internal/Operation/Repos/GetOrgRulesets.php b/clients/GitHubEnterpriseCloud/src/Internal/Operation/Repos/GetOrgRulesets.php index a27d685a66a..8ed7baccf6f 100644 --- a/clients/GitHubEnterpriseCloud/src/Internal/Operation/Repos/GetOrgRulesets.php +++ b/clients/GitHubEnterpriseCloud/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/enterprise-cloud@latest//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/enterprise-cloud@latest//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/GitHubEnterpriseCloud/src/Internal/Operation/Repos/GetOrgRulesetsListing.php b/clients/GitHubEnterpriseCloud/src/Internal/Operation/Repos/GetOrgRulesetsListing.php index 664cca4db9b..93d2cb8d6b0 100644 --- a/clients/GitHubEnterpriseCloud/src/Internal/Operation/Repos/GetOrgRulesetsListing.php +++ b/clients/GitHubEnterpriseCloud/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/enterprise-cloud@latest//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/enterprise-cloud@latest//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/GitHubEnterpriseCloud/src/Internal/Operation/Repos/GetRepoRulesets.php b/clients/GitHubEnterpriseCloud/src/Internal/Operation/Repos/GetRepoRulesets.php index 2b49e0c45a6..9ea5a1180ea 100644 --- a/clients/GitHubEnterpriseCloud/src/Internal/Operation/Repos/GetRepoRulesets.php +++ b/clients/GitHubEnterpriseCloud/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/enterprise-cloud@latest//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/enterprise-cloud@latest//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/GitHubEnterpriseCloud/src/Internal/Operation/Repos/GetRepoRulesetsListing.php b/clients/GitHubEnterpriseCloud/src/Internal/Operation/Repos/GetRepoRulesetsListing.php index e8fac4e52c5..a93b39bcd1a 100644 --- a/clients/GitHubEnterpriseCloud/src/Internal/Operation/Repos/GetRepoRulesetsListing.php +++ b/clients/GitHubEnterpriseCloud/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/enterprise-cloud@latest//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/enterprise-cloud@latest//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/GitHubEnterpriseCloud/src/Internal/Operator/Repos/GetOrgRulesets.php b/clients/GitHubEnterpriseCloud/src/Internal/Operator/Repos/GetOrgRulesets.php index fe11eba6f46..d6dcf6e4930 100644 --- a/clients/GitHubEnterpriseCloud/src/Internal/Operator/Repos/GetOrgRulesets.php +++ b/clients/GitHubEnterpriseCloud/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\GitHubEnterpriseCloud\Internal\Operation\Repos\GetOrgRulesets($this->responseSchemaValidator, $this->hydrator, $org, $perPage, $page); + $operation = new \ApiClients\Client\GitHubEnterpriseCloud\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/GitHubEnterpriseCloud/src/Internal/Operator/Repos/GetOrgRulesetsListing.php b/clients/GitHubEnterpriseCloud/src/Internal/Operator/Repos/GetOrgRulesetsListing.php index d7af13585a1..253b19246dc 100644 --- a/clients/GitHubEnterpriseCloud/src/Internal/Operator/Repos/GetOrgRulesetsListing.php +++ b/clients/GitHubEnterpriseCloud/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\GitHubEnterpriseCloud\Internal\Operation\Repos\GetOrgRulesetsListing($this->responseSchemaValidator, $this->hydrator, $org, $perPage, $page); + $operation = new \ApiClients\Client\GitHubEnterpriseCloud\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/GitHubEnterpriseCloud/src/Internal/Operator/Repos/GetRepoRulesets.php b/clients/GitHubEnterpriseCloud/src/Internal/Operator/Repos/GetRepoRulesets.php index 01f6e629ba0..6edb0465e7d 100644 --- a/clients/GitHubEnterpriseCloud/src/Internal/Operator/Repos/GetRepoRulesets.php +++ b/clients/GitHubEnterpriseCloud/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\GitHubEnterpriseCloud\Internal\Operation\Repos\GetRepoRulesets($this->responseSchemaValidator, $this->hydrator, $owner, $repo, $perPage, $page, $includesParents); + $operation = new \ApiClients\Client\GitHubEnterpriseCloud\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/GitHubEnterpriseCloud/src/Internal/Operator/Repos/GetRepoRulesetsListing.php b/clients/GitHubEnterpriseCloud/src/Internal/Operator/Repos/GetRepoRulesetsListing.php index 2812840f438..a8c393df012 100644 --- a/clients/GitHubEnterpriseCloud/src/Internal/Operator/Repos/GetRepoRulesetsListing.php +++ b/clients/GitHubEnterpriseCloud/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\GitHubEnterpriseCloud\Internal\Operation\Repos\GetRepoRulesetsListing($this->responseSchemaValidator, $this->hydrator, $owner, $repo, $perPage, $page, $includesParents); + $operation = new \ApiClients\Client\GitHubEnterpriseCloud\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/GitHubEnterpriseCloud/src/Internal/Router/Get/Five.php b/clients/GitHubEnterpriseCloud/src/Internal/Router/Get/Five.php index 9868f7d6c94..7185a643e96 100644 --- a/clients/GitHubEnterpriseCloud/src/Internal/Router/Get/Five.php +++ b/clients/GitHubEnterpriseCloud/src/Internal/Router/Get/Five.php @@ -55,7 +55,7 @@ public function __construct(private Routers $routers) { } - /** @return |Observable|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 */ + /** @return |Observable|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|iterable|Observable|Observable|Observable */ public function call(string $call, array $params, array $pathChunks): HookDelivery|ActionsEnterprisePermissions|Ok|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\EnterpriseAdmin\ListSelfHostedRunnersForEnterprise\Response\ApplicationJson\Ok|iterable|WithoutBody|GistComment|MarketplacePurchase|BasicError|ThreadSubscription|ActionsOrganizationPermissions|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Actions\ListSelfHostedRunnerGroupsForOrg\Response\ApplicationJson\Ok|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Actions\ListSelfHostedRunnersForOrg\Response\ApplicationJson\Ok|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Actions\ListOrgSecrets\Response\ApplicationJson\Ok|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Actions\ListOrgVariables\Response\ApplicationJson\Ok|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Orgs\ListAttestations\Response\ApplicationJson\Ok|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Codespaces\ListOrgSecrets\Response\ApplicationJson\Ok|CopilotOrganizationDetails|OrganizationCustomRepositoryRole|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Dependabot\ListOrgSecrets\Response\ApplicationJson\Ok|ExternalGroup|OrgHook|OrgMembership|Migration|OrganizationRole|RepositoryRuleset|GroupMapping|TeamFull|ProjectCard|CheckAutomatedSecurityFixes|CodeSecurityConfigurationForRepository|Json|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Repos\GetAllEnvironments\Response\ApplicationJson\Ok|Import|Installation|InteractionLimitResponse|One|Language|LicenseContent|Page|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Repos\CheckPrivateVulnerabilityReporting\Response\ApplicationJson\Ok|ContentFile|SimpleUser|Stargazer|RepositorySubscription|Topic|TeamDiscussion|TeamMembership|TeamProject|CodespacesUserPublicKey|CodespacesSecret|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Codespaces\CodespaceMachinesForAuthenticatedUser\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Apps\ListInstallationReposForAuthenticatedUser\Response\ApplicationJson\Ok|Package|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Users\ListAttestations\Response\ApplicationJson\Ok|EmptyObject { if ($pathChunks[0] === '') { diff --git a/clients/GitHubEnterpriseCloud/src/Internal/Router/Get/Four.php b/clients/GitHubEnterpriseCloud/src/Internal/Router/Get/Four.php index 6af99b588d0..b0d9af018b7 100644 --- a/clients/GitHubEnterpriseCloud/src/Internal/Router/Get/Four.php +++ b/clients/GitHubEnterpriseCloud/src/Internal/Router/Get/Four.php @@ -38,7 +38,7 @@ public function __construct(private Routers $routers) { } - /** @return |Observable|Observable|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|Observable|Observable|Observable */ + /** @return |Observable|Observable|Observable|Observable|Observable|Observable|Observable|WithoutBody|Observable|Observable|Observable|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|AnnouncementBanner|EnterpriseSecurityAnalysisSettings|string|WithoutBody|GistSimple|GitignoreTemplate|MarketplacePurchase|Thread|Ok|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Codespaces\ListInOrganization\Response\ApplicationJson\Ok|Json|ExternalGroups|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Orgs\ListAppInstallations\Response\ApplicationJson\Ok|InteractionLimitResponse|One|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Orgs\ListOrgRoles\Response\ApplicationJson\Ok|ProjectColumn|FullRepository|BasicError|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Codespaces\ListSecretsForAuthenticatedUser\Response\ApplicationJson\Ok|Codespace|GpgKey|Key|Migration|SshSigningKey|Hovercard|StarredRepository|Repository { if ($pathChunks[0] === '') { diff --git a/clients/GitHubEnterpriseCloud/src/Internal/Router/Get/Repos.php b/clients/GitHubEnterpriseCloud/src/Internal/Router/Get/Repos.php index cf229620cec..d4083262210 100644 --- a/clients/GitHubEnterpriseCloud/src/Internal/Router/Get/Repos.php +++ b/clients/GitHubEnterpriseCloud/src/Internal/Router/Get/Repos.php @@ -210,7 +210,7 @@ public function listForOrg(array $params): iterable return $operator->call($arguments['org'], $arguments['type'], $arguments['direction'], $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/GitHubEnterpriseCloud/src/Internal/Router/List/Five.php b/clients/GitHubEnterpriseCloud/src/Internal/Router/List/Five.php index 386aefc3d36..21680520d54 100644 --- a/clients/GitHubEnterpriseCloud/src/Internal/Router/List/Five.php +++ b/clients/GitHubEnterpriseCloud/src/Internal/Router/List/Five.php @@ -16,7 +16,7 @@ public function __construct(private Routers $routers) { } - /** @return Observable|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 */ + /** @return Observable|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|iterable|Observable|Observable */ public function call(string $call, array $params, array $pathChunks): iterable|BasicError|WithoutBody { if ($pathChunks[0] === '') { diff --git a/clients/GitHubEnterpriseCloud/src/Internal/Router/List/Four.php b/clients/GitHubEnterpriseCloud/src/Internal/Router/List/Four.php index a3a50dea675..acbdfb0bb6c 100644 --- a/clients/GitHubEnterpriseCloud/src/Internal/Router/List/Four.php +++ b/clients/GitHubEnterpriseCloud/src/Internal/Router/List/Four.php @@ -15,7 +15,7 @@ public function __construct(private Routers $routers) { } - /** @return 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 */ + /** @return Observable|Observable|Observable|Observable|WithoutBody|Observable|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/GitHubEnterpriseCloud/src/Internal/Router/List/Repos.php b/clients/GitHubEnterpriseCloud/src/Internal/Router/List/Repos.php index bf86b4e5909..608f38a3466 100644 --- a/clients/GitHubEnterpriseCloud/src/Internal/Router/List/Repos.php +++ b/clients/GitHubEnterpriseCloud/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/GitHubEnterpriseCloud/src/Operation/Repos.php b/clients/GitHubEnterpriseCloud/src/Operation/Repos.php index 1aea6d30de5..bfd46718a64 100644 --- a/clients/GitHubEnterpriseCloud/src/Operation/Repos.php +++ b/clients/GitHubEnterpriseCloud/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 */ @@ -1175,16 +1175,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/GitHubEnterpriseCloud/src/PHPStan/ClientCallReturnTypes.php b/clients/GitHubEnterpriseCloud/src/PHPStan/ClientCallReturnTypes.php index 8c7506efb4e..6bf7784e6bd 100644 --- a/clients/GitHubEnterpriseCloud/src/PHPStan/ClientCallReturnTypes.php +++ b/clients/GitHubEnterpriseCloud/src/PHPStan/ClientCallReturnTypes.php @@ -1672,11 +1672,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') { @@ -3860,11 +3860,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/GitHubEnterpriseCloud/src/Schema/OrganizationFull.php b/clients/GitHubEnterpriseCloud/src/Schema/OrganizationFull.php index 3eac1ee3ceb..1cc45da6c7d 100644 --- a/clients/GitHubEnterpriseCloud/src/Schema/OrganizationFull.php +++ b/clients/GitHubEnterpriseCloud/src/Schema/OrganizationFull.php @@ -242,15 +242,6 @@ 10000 ] }, - "collaborators": { - "type": [ - "integer", - "null" - ], - "examples": [ - 8 - ] - }, "billing_email": { "type": [ "string", @@ -499,7 +490,6 @@ "owned_private_repos": 100, "private_gists": 81, "disk_usage": 10000, - "collaborators": 8, "billing_email": "org@example.com", "plan": { "name": "generated", @@ -590,7 +580,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/GitHubEnterpriseCloud/tests/Internal/Operation/Repos/GetOrgRulesetsListingTest.php b/clients/GitHubEnterpriseCloud/tests/Internal/Operation/Repos/GetOrgRulesetsListingTest.php index 5d9c21c15d5..c38b4bf9f09 100644 --- a/clients/GitHubEnterpriseCloud/tests/Internal/Operation/Repos/GetOrgRulesetsListingTest.php +++ b/clients/GitHubEnterpriseCloud/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/GitHubEnterpriseCloud/tests/Internal/Operation/Repos/GetOrgRulesetsTest.php b/clients/GitHubEnterpriseCloud/tests/Internal/Operation/Repos/GetOrgRulesetsTest.php index 2ad6c8bd935..dd8c8258edf 100644 --- a/clients/GitHubEnterpriseCloud/tests/Internal/Operation/Repos/GetOrgRulesetsTest.php +++ b/clients/GitHubEnterpriseCloud/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/GitHubEnterpriseCloud/tests/Internal/Operation/Repos/GetRepoRulesetsListingTest.php b/clients/GitHubEnterpriseCloud/tests/Internal/Operation/Repos/GetRepoRulesetsListingTest.php index c33794c4a2c..21eaa9583a8 100644 --- a/clients/GitHubEnterpriseCloud/tests/Internal/Operation/Repos/GetRepoRulesetsListingTest.php +++ b/clients/GitHubEnterpriseCloud/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/GitHubEnterpriseCloud/tests/Internal/Operation/Repos/GetRepoRulesetsTest.php b/clients/GitHubEnterpriseCloud/tests/Internal/Operation/Repos/GetRepoRulesetsTest.php index efcb7d13dfc..1b38d29bfb2 100644 --- a/clients/GitHubEnterpriseCloud/tests/Internal/Operation/Repos/GetRepoRulesetsTest.php +++ b/clients/GitHubEnterpriseCloud/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/GitHubEnterpriseCloud/tests/Types/ClientCallReturnTypes.php b/clients/GitHubEnterpriseCloud/tests/Types/ClientCallReturnTypes.php index eb39ed77600..329b637e60e 100644 --- a/clients/GitHubEnterpriseCloud/tests/Types/ClientCallReturnTypes.php +++ b/clients/GitHubEnterpriseCloud/tests/Types/ClientCallReturnTypes.php @@ -424,8 +424,8 @@ function authHeader(): string assertType('Observable', $client->call('LIST /orgs/{org}/repos')); assertType('', $client->call('POST /orgs/{org}/repos')); assertType('Observable', $client->call('GET /orgs/{org}/repository-fine-grained-permissions')); -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')); @@ -971,8 +971,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/GitHubEnterpriseCloud/current.spec.yaml b/etc/specs/GitHubEnterpriseCloud/current.spec.yaml index 52a57d235b6..f9a561e1caf 100644 --- a/etc/specs/GitHubEnterpriseCloud/current.spec.yaml +++ b/etc/specs/GitHubEnterpriseCloud/current.spec.yaml @@ -16338,6 +16338,7 @@ paths: - "$ref": "#/components/parameters/org" - "$ref": "#/components/parameters/per-page" - "$ref": "#/components/parameters/page" + - "$ref": "#/components/parameters/ruleset-targets" responses: '200': description: Response @@ -41389,6 +41390,7 @@ paths: schema: type: boolean default: true + - "$ref": "#/components/parameters/ruleset-targets" responses: '200': description: Response @@ -78331,12 +78333,6 @@ components: - 'null' examples: - 10000 - collaborators: - type: - - integer - - 'null' - examples: - - 8 billing_email: type: - string @@ -233271,6 +233267,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