diff --git a/clients/GitHub/README.md b/clients/GitHub/README.md index fe8e9ddef0a..4f81f02f2cc 100644 --- a/clients/GitHub/README.md +++ b/clients/GitHub/README.md @@ -830,6 +830,212 @@ $client->operations()->emojis()->get(); You can find more about this operation over at the [API method documentation](https://docs.github.com/rest/emojis/emojis#get-emojis). +### code-security/get-configurations-for-enterprise + +Get code security configurations for an enterprise + +Using the `call` method: +```php +$client->call('GET /enterprises/{enterprise}/code-security/configurations', [ + 'enterprise' => 'generated', + 'before' => 'generated', + 'after' => 'generated', + 'per_page' => 8, +]); +``` + +Operations method: +```php +$client->operations()->codeSecurity()->getConfigurationsForEnterprise( enterprise: 'generated', + before: 'generated', + after: 'generated', + per_page: 8, +); +``` + +You can find more about this operation over at the [API method documentation](https://docs.github.com/rest/code-security/configurations#get-code-security-configurations-for-an-enterprise). + + +### code-security/create-configuration-for-enterprise + +Create a code security configuration for an enterprise + +Using the `call` method: +```php +$client->call('POST /enterprises/{enterprise}/code-security/configurations', [ + 'enterprise' => 'generated', +]); +``` + +Operations method: +```php +$client->operations()->codeSecurity()->createConfigurationForEnterprise( enterprise: 'generated', +); +``` + +You can find more about this operation over at the [API method documentation](https://docs.github.com/rest/code-security/configurations#create-a-code-security-configuration-for-an-enterprise). + + +### code-security/get-default-configurations-for-enterprise + +Get default code security configurations for an enterprise + +Using the `call` method: +```php +$client->call('GET /enterprises/{enterprise}/code-security/configurations/defaults', [ + 'enterprise' => 'generated', +]); +``` + +Operations method: +```php +$client->operations()->codeSecurity()->getDefaultConfigurationsForEnterprise( enterprise: 'generated', +); +``` + +You can find more about this operation over at the [API method documentation](https://docs.github.com/rest/code-security/configurations#get-default-code-security-configurations-for-an-enterprise). + + +### code-security/get-single-configuration-for-enterprise + +Retrieve a code security configuration of an enterprise + +Using the `call` method: +```php +$client->call('GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}', [ + 'enterprise' => 'generated', + 'configuration_id' => 16, +]); +``` + +Operations method: +```php +$client->operations()->codeSecurity()->getSingleConfigurationForEnterprise( enterprise: 'generated', + configuration_id: 16, +); +``` + +You can find more about this operation over at the [API method documentation](https://docs.github.com/rest/code-security/configurations#retrieve-a-code-security-configuration-of-an-enterprise). + + +### code-security/delete-configuration-for-enterprise + +Delete a code security configuration for an enterprise + +Using the `call` method: +```php +$client->call('DELETE /enterprises/{enterprise}/code-security/configurations/{configuration_id}', [ + 'enterprise' => 'generated', + 'configuration_id' => 16, +]); +``` + +Operations method: +```php +$client->operations()->codeSecurity()->deleteConfigurationForEnterprise( enterprise: 'generated', + configuration_id: 16, +); +``` + +You can find more about this operation over at the [API method documentation](https://docs.github.com/rest/code-security/configurations#delete-a-code-security-configuration-for-an-enterprise). + + +### code-security/update-enterprise-configuration + +Update a custom code security configuration for an enterprise + +Using the `call` method: +```php +$client->call('PATCH /enterprises/{enterprise}/code-security/configurations/{configuration_id}', [ + 'enterprise' => 'generated', + 'configuration_id' => 16, +]); +``` + +Operations method: +```php +$client->operations()->codeSecurity()->updateEnterpriseConfiguration( enterprise: 'generated', + configuration_id: 16, +); +``` + +You can find more about this operation over at the [API method documentation](https://docs.github.com/rest/code-security/configurations#update-a-custom-code-security-configuration-for-an-enterprise). + + +### code-security/attach-enterprise-configuration + +Attach an enterprise configuration to repositories + +Using the `call` method: +```php +$client->call('POST /enterprises/{enterprise}/code-security/configurations/{configuration_id}/attach', [ + 'enterprise' => 'generated', + 'configuration_id' => 16, +]); +``` + +Operations method: +```php +$client->operations()->codeSecurity()->attachEnterpriseConfiguration( enterprise: 'generated', + configuration_id: 16, +); +``` + +You can find more about this operation over at the [API method documentation](https://docs.github.com/rest/code-security/configurations#attach-an-enterprise-configuration-to-repositories). + + +### code-security/set-configuration-as-default-for-enterprise + +Set a code security configuration as a default for an enterprise + +Using the `call` method: +```php +$client->call('PUT /enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults', [ + 'enterprise' => 'generated', + 'configuration_id' => 16, +]); +``` + +Operations method: +```php +$client->operations()->codeSecurity()->setConfigurationAsDefaultForEnterprise( enterprise: 'generated', + configuration_id: 16, +); +``` + +You can find more about this operation over at the [API method documentation](https://docs.github.com/rest/code-security/configurations#set-a-code-security-configuration-as-a-default-for-an-enterprise). + + +### code-security/get-repositories-for-enterprise-configuration + +Get repositories associated with an enterprise code security configuration + +Using the `call` method: +```php +$client->call('GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories', [ + 'enterprise' => 'generated', + 'configuration_id' => 16, + 'before' => 'generated', + 'after' => 'generated', + 'per_page' => 8, + 'status' => 'generated', +]); +``` + +Operations method: +```php +$client->operations()->codeSecurity()->getRepositoriesForEnterpriseConfiguration( enterprise: 'generated', + configuration_id: 16, + before: 'generated', + after: 'generated', + per_page: 8, + status: 'generated', +); +``` + +You can find more about this operation over at the [API method documentation](https://docs.github.com/rest/code-security/configurations#get-repositories-associated-with-an-enterprise-code-security-configuration). + + ### dependabot/list-alerts-for-enterprise List Dependabot alerts for an enterprise @@ -13821,6 +14027,78 @@ $client->operations()->codeScanning()->updateAlert( owner: 'generated', You can find more about this operation over at the [API method documentation](https://docs.github.com/rest/code-scanning/code-scanning#update-a-code-scanning-alert). +### code-scanning/get-autofix + +Get the status of an autofix for a code scanning alert + +Using the `call` method: +```php +$client->call('GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix', [ + 'owner' => 'generated', + 'repo' => 'generated', + 'alert_number' => 12, +]); +``` + +Operations method: +```php +$client->operations()->codeScanning()->getAutofix( owner: 'generated', + repo: 'generated', + alert_number: 12, +); +``` + +You can find more about this operation over at the [API method documentation](https://docs.github.com/rest/code-scanning/code-scanning#get-the-status-of-an-autofix-for-a-code-scanning-alert). + + +### code-scanning/create-autofix + +Create an autofix for a code scanning alert + +Using the `call` method: +```php +$client->call('POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix', [ + 'owner' => 'generated', + 'repo' => 'generated', + 'alert_number' => 12, +]); +``` + +Operations method: +```php +$client->operations()->codeScanning()->createAutofix( owner: 'generated', + repo: 'generated', + alert_number: 12, +); +``` + +You can find more about this operation over at the [API method documentation](https://docs.github.com/rest/code-scanning/code-scanning#create-an-autofix-for-a-code-scanning-alert). + + +### code-scanning/commit-autofix + +Commit an autofix for a code scanning alert + +Using the `call` method: +```php +$client->call('POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/commits', [ + 'owner' => 'generated', + 'repo' => 'generated', + 'alert_number' => 12, +]); +``` + +Operations method: +```php +$client->operations()->codeScanning()->commitAutofix( owner: 'generated', + repo: 'generated', + alert_number: 12, +); +``` + +You can find more about this operation over at the [API method documentation](https://docs.github.com/rest/code-scanning/code-scanning#commit-an-autofix-for-a-code-scanning-alert). + + ### code-scanning/list-alert-instances List instances of a code scanning alert diff --git a/clients/GitHub/etc/openapi-client-generator.state b/clients/GitHub/etc/openapi-client-generator.state index 573f0af9a08..269507885cd 100644 --- a/clients/GitHub/etc/openapi-client-generator.state +++ b/clients/GitHub/etc/openapi-client-generator.state @@ -1,5 +1,5 @@ { - "specHash": "4443d2c21890f0b754f9e632d191bd85", + "specHash": "ee410229436a838f44c982a4ed9c9572", "generatedFiles": { "files": [ { @@ -256,7 +256,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/ApiOverview.php", - "hash": "e8ee700a823b492eedf92e7510837906" + "hash": "1e3bcd372c87094092333334169eaaff" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/SecurityAndAnalysis.php", @@ -5500,15 +5500,15 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/ClientInterface.php", - "hash": "def992bdbf4f5d389e831bb60a665604" + "hash": "15f56a6b249baa01e68b3f3952f7cedc" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Client.php", - "hash": "5b9a619451a14adbc44b89889471048a" + "hash": "43d884d5831413eca20fd288f5663716" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/OperationsInterface.php", - "hash": "943cd2c2c11c0082f266a7b5edc0fac4" + "hash": "84d0273a8efbb20c784e52bfc5fd69d5" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Operation\/Meta.php", @@ -5532,7 +5532,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Operation\/SecretScanning.php", - "hash": "91aebb408135c1eeda46c62b1578a527" + "hash": "9bb033435eaa98d866efe71eb1e4ddbd" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Operation\/Activity.php", @@ -5572,7 +5572,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Operation\/CodeScanning.php", - "hash": "1022aefe8ce8640ec7fe0d5de39fefe7" + "hash": "27cc08356fa6979637b91a47e4f42ef3" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Operation\/Codespaces.php", @@ -5644,7 +5644,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Operations.php", - "hash": "cc78e8701d977bbc8772da9354008c97" + "hash": "13f5a4aceb4bf4286339f0c91a69c4b7" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/WebHooks.php", @@ -11532,7 +11532,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/ApiOverview\/Domains.php", - "hash": "500e3d6534a046fb369b494a6ac5b316" + "hash": "b2d9a0b3782b72ae353781c106821dfb" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/SecurityAndAnalysis\/DependabotSecurityUpdates.php", @@ -24412,7 +24412,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Get\/CodeScanning.php", - "hash": "3ccd68e698c7a76e4d4c80ea4308a0a7" + "hash": "13ec6b13116574834984520feba47229" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Copilot.php", @@ -24468,7 +24468,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Post\/Repos.php", - "hash": "342abc76825663ff9896a3708d5bfc8c" + "hash": "b9a07d1739ce4d6c2b51df559d23b002" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Post\/Teams.php", @@ -24480,7 +24480,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Post\/Codespaces.php", - "hash": "93415aad67c1d44c4ecb70d3fcc0f65c" + "hash": "900968a02f3557c5ca0fd49a31394bd5" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Post\/Copilot.php", @@ -24488,7 +24488,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Post\/CodeScanning.php", - "hash": "80ad009cf4674fc756c79790c79554a7" + "hash": "8e5e11d16d1ea03f86aea5d9ac340303" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Post\/DependencyGraph.php", @@ -24560,7 +24560,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Patch\/Orgs.php", - "hash": "b8e43931df33dd807b50288b85e207f1" + "hash": "61c6a207c291ea71cd8efa92e9eb3368" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Patch\/Teams.php", @@ -24568,7 +24568,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Patch\/Migrations.php", - "hash": "e2918eb1723dd86da692e5f98e7d3533" + "hash": "ca0a338beaddbdfcfb9b55f13d0af7eb" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Patch\/Actions.php", @@ -24680,7 +24680,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Delete\/Apps.php", - "hash": "5dfbc82ba7cb6a3c97403cc8a7934093" + "hash": "5469fc716f8beb9365ebf85e9c7f109b" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Delete\/Gists.php", @@ -24696,7 +24696,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Delete\/Repos.php", - "hash": "d0120f2eec80abfd0926c591f055b32b" + "hash": "9cf0dbb767ed30610d38f7083927fb0b" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Delete\/Users.php", @@ -24704,7 +24704,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Delete\/Codespaces.php", - "hash": "81bc944282102914713b963583cc3d1f" + "hash": "9c160912566dcc2ba6f87ecbc3bcac48" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Delete\/Activity.php", @@ -24712,23 +24712,23 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Delete\/Orgs.php", - "hash": "fc2e156a854552a3e4ab12a89471a39c" + "hash": "266c20bdaba2041563f13ed256e63e48" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Delete\/Teams.php", - "hash": "f19173af2fc9967c88e8bcd2651a2df3" + "hash": "b14ceb56f220a74b61aab84e8470fee0" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Delete\/Migrations.php", - "hash": "817af83e055c25550774d32a1791763d" + "hash": "f453583060f4106858a3f52c14716957" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Delete\/Packages.php", - "hash": "883e51eb3aa2fd0396a3fafe66ea72f7" + "hash": "22530e84798bbad27ba9e034f646e13a" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Delete\/Actions.php", - "hash": "b540b066ae396d53557055a030eb152b" + "hash": "5f2e14e545a88672678f066962c3fa34" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Delete\/CodeScanning.php", @@ -24736,7 +24736,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Delete\/Dependabot.php", - "hash": "43749d7798b242976140839e408b8d4b" + "hash": "7d50d57732abbb18c15fb3b5d58976f2" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Delete\/Git.php", @@ -24744,7 +24744,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Delete\/Issues.php", - "hash": "3cac08976533c6e465ba923340c963da" + "hash": "c92bd179fb2af681ab1325587b331fc9" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Delete\/Pulls.php", @@ -24852,19 +24852,19 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Five.php", - "hash": "2ce20ded007385c2c29e4b1324a69efa" + "hash": "0cd01b6c32791b539778f09e8fde628f" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Six.php", - "hash": "962ecbf39f794f3b916ab75b7349566f" + "hash": "6b7fb7b452175ce3732f3558b2c78609" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Seven.php", - "hash": "bbb5119b3640a727f82f3492d785c057" + "hash": "ee31a6aae75fe88c0ed12f128eee6e3e" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Eight.php", - "hash": "3dca95be52846097223409b2f9926606" + "hash": "3a36ab3ab259e7dc908ec0b39b99c64c" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Nine.php", @@ -24884,7 +24884,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Post\/Five.php", - "hash": "a709e69657579b3e0e93c1abcc6fe812" + "hash": "b39fb21a96c2f7bf8f908559dc3cc329" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Post\/Two.php", @@ -24896,15 +24896,15 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Post\/Seven.php", - "hash": "b619e491673f6ed980d9896a97638a0a" + "hash": "60a2086e564b16850a2f1d2590d0bf77" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Post\/Eight.php", - "hash": "f650dd2165c760b4a811d1ad87a6b7b6" + "hash": "c0ceb37b2c9dc579230f1c2e1f07bd86" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Post\/Nine.php", - "hash": "81ef5effe0b827e61dfd2433abd2299c" + "hash": "6f52d70fabbc35398962ac1620252cc2" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Post\/Ten.php", @@ -24924,7 +24924,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Patch\/Six.php", - "hash": "f7d942d066c934a8f948de23d807cd79" + "hash": "081809ebc756453102153c884ad30886" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Patch\/Seven.php", @@ -24996,7 +24996,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Delete\/Six.php", - "hash": "7e5c39735eb9b1f7917a4749cfbf696c" + "hash": "bc86dc3f6976a408165182fe114b08ee" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Delete\/Eight.php", @@ -25024,7 +25024,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Put\/Seven.php", - "hash": "3601c6ed1e8303866e112ee1b072fdac" + "hash": "66f5f35d50528a8ac7cda87d721f9725" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Put\/Six.php", @@ -25056,11 +25056,11 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Routers.php", - "hash": "928b9c47545e98623e0e2fef81f974ea" + "hash": "b23622c06ae1494775bfa54f55a9e400" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operators.php", - "hash": "8b77d9ab4fd3b48f8ca6922e34434bef" + "hash": "75f78b3889b5e1eda9412b0006aaf81d" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Hydrator\/Operation\/Root.php", @@ -25236,7 +25236,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Hydrator\/Operation\/Meta.php", - "hash": "dd4318bfa1103423cde64c2e63aac119" + "hash": "1af8bc6f2826417e2f55a87efbf0862c" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Hydrator\/Operation\/Networks\/Owner\/Repo\/Events.php", @@ -27052,7 +27052,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Hydrators.php", - "hash": "fdb38d7539d02602100cbb730efce40d" + "hash": "a7f89d08f0ad65f1001440d650171739" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/OrganizationSimpleWebhooks.php", @@ -27632,11 +27632,11 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/PHPStan\/ClientCallReturnTypes.php", - "hash": "e89acad0382b10107b48522e7016a0e7" + "hash": "17a7b14d9f7e32aee7f208070568e0bd" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Types\/ClientCallReturnTypes.php", - "hash": "f009931f0e4f071b8ed62a37b54c800f" + "hash": "a023f772ed432232e037464ea7b31582" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/..\/etc\/phpstan-extension.neon", @@ -29512,15 +29512,15 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operation\/CodeSecurity\/SetConfigurationAsDefault.php", - "hash": "109a44315c7d5367d26c887e591924da" + "hash": "1f6d82ff2d60f521c7fe48969f364280" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operator\/CodeSecurity\/SetConfigurationAsDefault.php", - "hash": "65fa61f81dd50f0750919c26f1d6071e" + "hash": "705a37d9bfdce57f87ac8ee0d2c12e94" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Internal\/Operation\/CodeSecurity\/SetConfigurationAsDefaultTest.php", - "hash": "bb4739e795a396e03402c1b39a656832" + "hash": "d4a875bd57b843b5fc962223f4d2dc7e" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operation\/CodeSecurity\/GetRepositoriesForConfiguration.php", @@ -29584,35 +29584,35 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/CodeSecurity\/SetConfigurationAsDefault\/Request\/ApplicationJson.php", - "hash": "408fb6f38c5be7a6197a2bb1d41ea260" + "hash": "68998abb4660b64f31ffb526084efa73" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/Operations\/CodeSecurity\/SetConfigurationAsDefault\/Response\/ApplicationJson\/Ok.php", - "hash": "703585c95188715c4f2d358b90c2cd40" + "hash": "401bb15ba9ecd26315266f556e9fd6f5" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Get\/CodeSecurity.php", - "hash": "760104206bb65a4a1fa10879c0bbd996" + "hash": "cc087dcc97dcb8c1a7cd9543d7aa5ce7" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Post\/CodeSecurity.php", - "hash": "6017c8d2db383d771ef32bbb32ca6166" + "hash": "bddc0f9ea1e83481650eedf038c8069d" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Patch\/CodeSecurity.php", - "hash": "c30fb1886b2e823f0c4499327e6d5492" + "hash": "864c1dac7959caa0deadd620507b3e64" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Delete\/CodeSecurity.php", - "hash": "c6a8dddb7f3240ecfdabf8fb78e3fb92" + "hash": "0ca27bb09ae0365bf175fbe894ebe673" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Put\/CodeSecurity.php", - "hash": "4786c278e8c30964a6826613d1f0c820" + "hash": "cc6e177be8315a8aafe2c8343ed2e1ee" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Operation\/CodeSecurity.php", - "hash": "9903dd8de6d14e06f3410dae5072b561" + "hash": "51d8108becabb9d94ecd82936f3ed7ce" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Hydrator\/Operation\/Orgs\/Org\/CodeSecurity\/Configurations.php", @@ -29632,7 +29632,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Hydrator\/Operation\/Orgs\/Org\/CodeSecurity\/Configurations\/ConfigurationId\/Defaults.php", - "hash": "2f76d4e528093653157c68775f2c18e9" + "hash": "4df9ef3ec9ef33967d9153af91551004" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Hydrator\/Operation\/Orgs\/Org\/CodeSecurity\/Configurations\/ConfigurationId\/Repositories.php", @@ -30016,7 +30016,7 @@ }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/CodeSecurity\/CreateConfiguration\/Request\/ApplicationJson\/DependencyGraphAutosubmitActionOptions.php", - "hash": "b075c0e48ad0a4250554d60a4919265c" + "hash": "15acf1e4ff2cbdb2e4aafcf0d91e7380" }, { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/SecretScanning\/CreatePushProtectionBypass\/Request\/ApplicationJson.php", @@ -31101,6 +31101,258 @@ { "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Hydrator\/WebHook\/SecretScanningScan.php", "hash": "1fa72263a892895d9058feb2b83d8ed7" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operation\/CodeSecurity\/GetConfigurationsForEnterprise.php", + "hash": "23379fe69173935e24309a209f89ef9a" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operator\/CodeSecurity\/GetConfigurationsForEnterprise.php", + "hash": "375c4c9f9f36dd6bda64a9d4f7229e18" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Internal\/Operation\/CodeSecurity\/GetConfigurationsForEnterpriseTest.php", + "hash": "b1fddb16a61756f87991f64254d67efc" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operation\/CodeSecurity\/CreateConfigurationForEnterprise.php", + "hash": "9b4c2996511a6aab4404cc56ed9876bc" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operator\/CodeSecurity\/CreateConfigurationForEnterprise.php", + "hash": "3544b64fc0d047ecb6822482eaad832d" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Internal\/Operation\/CodeSecurity\/CreateConfigurationForEnterpriseTest.php", + "hash": "c5abb953966d74a68aa7760205337011" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operation\/CodeSecurity\/GetDefaultConfigurationsForEnterprise.php", + "hash": "0ebe267bf80a05f8419a1b9326986ba2" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operator\/CodeSecurity\/GetDefaultConfigurationsForEnterprise.php", + "hash": "7c64cf6cef12d59ef23048fe77741770" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Internal\/Operation\/CodeSecurity\/GetDefaultConfigurationsForEnterpriseTest.php", + "hash": "cc8a3ae7458ed7ff992e50d07a5da757" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operation\/CodeSecurity\/GetSingleConfigurationForEnterprise.php", + "hash": "891401bc961865a8e15600cb85632e24" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operator\/CodeSecurity\/GetSingleConfigurationForEnterprise.php", + "hash": "f446e2a84c1c2280ef345b5204c2a129" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Internal\/Operation\/CodeSecurity\/GetSingleConfigurationForEnterpriseTest.php", + "hash": "62653ddae6075beb56d5d2f31d1a05c9" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operation\/CodeSecurity\/DeleteConfigurationForEnterprise.php", + "hash": "b0c7d51ba016df14f850286c58fae8c0" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operator\/CodeSecurity\/DeleteConfigurationForEnterprise.php", + "hash": "c494e65f28adac66863b2b8d24e48660" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Internal\/Operation\/CodeSecurity\/DeleteConfigurationForEnterpriseTest.php", + "hash": "4e5700f28cf19c58d3102c6efff33a4f" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operation\/CodeSecurity\/UpdateEnterpriseConfiguration.php", + "hash": "e27bea86ef4fbbd4bc6f9a55e228471d" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operator\/CodeSecurity\/UpdateEnterpriseConfiguration.php", + "hash": "6f3c24e80d7c2ffaabda3372e93ba87e" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Internal\/Operation\/CodeSecurity\/UpdateEnterpriseConfigurationTest.php", + "hash": "15971c10460e7cf6b21ff53cfe0cea4d" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operation\/CodeSecurity\/AttachEnterpriseConfiguration.php", + "hash": "c77419d4e19f00c945dd2dffe07c5180" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operator\/CodeSecurity\/AttachEnterpriseConfiguration.php", + "hash": "bb763e53c0b74af4adae7af424413432" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Internal\/Operation\/CodeSecurity\/AttachEnterpriseConfigurationTest.php", + "hash": "558108f180d6047c9e49e2422851413f" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operation\/CodeSecurity\/SetConfigurationAsDefaultForEnterprise.php", + "hash": "7d208ac2e905c961341774a8ab985639" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operator\/CodeSecurity\/SetConfigurationAsDefaultForEnterprise.php", + "hash": "a49f74127f10af79bbf4b2b4f1c7df21" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Internal\/Operation\/CodeSecurity\/SetConfigurationAsDefaultForEnterpriseTest.php", + "hash": "d1cd192250c57742eaa1fa4e134e9abb" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operation\/CodeSecurity\/GetRepositoriesForEnterpriseConfiguration.php", + "hash": "9cd4b16ed03fefd2059feb78dd3d87f1" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operator\/CodeSecurity\/GetRepositoriesForEnterpriseConfiguration.php", + "hash": "b65f4882aa3340d551e98798ff0e5dd8" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Internal\/Operation\/CodeSecurity\/GetRepositoriesForEnterpriseConfigurationTest.php", + "hash": "b718211c33499591037cb4752a99ccef" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operation\/CodeScanning\/GetAutofix.php", + "hash": "7732a2c86113de845d8be08a975d2133" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operator\/CodeScanning\/GetAutofix.php", + "hash": "3555987be23bed6a94c4abeb96d719a3" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Internal\/Operation\/CodeScanning\/GetAutofixTest.php", + "hash": "5d701e03e153faaa784f4225edbfff33" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operation\/CodeScanning\/CreateAutofix.php", + "hash": "5faac1ca1be150ac833fb010c6c269cd" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operator\/CodeScanning\/CreateAutofix.php", + "hash": "3296b85590ca1b3e1981c942cbccf6e0" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Internal\/Operation\/CodeScanning\/CreateAutofixTest.php", + "hash": "4c1f88ceed57773ec7d44a683fd6ab31" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operation\/CodeScanning\/CommitAutofix.php", + "hash": "9f2b9a273d58cf62249343c8d9f1a283" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operator\/CodeScanning\/CommitAutofix.php", + "hash": "6bfac28f46e790f1e5f9f34c7dc61074" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Internal\/Operation\/CodeScanning\/CommitAutofixTest.php", + "hash": "81a4daef8a8d90f20282edcf86b77e5b" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/CodeScanningAutofixStatus.php", + "hash": "961f4005cc79feeafc72121401cc3a58" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/CodeScanningAutofixDescription.php", + "hash": "a72f1805bf96bb543a433e4f168677a8" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/CodeScanningAutofixStartedAt.php", + "hash": "054aab5b380225257facedf1a3424bf8" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/CodeScanningAutofix.php", + "hash": "77db9c62b4187ed8b2f2d54cf3b1a689" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/CodeScanningAutofixCommits.php", + "hash": "be35a2e302fe8bdd6e7c13cefc989595" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/CodeScanningAutofixCommitsResponse.php", + "hash": "06522b6395cc328fc9f3245f28b13c85" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/CodeSecurity\/UpdateEnterpriseConfiguration\/Request\/ApplicationJson\/DependencyGraphAutosubmitActionOptions.php", + "hash": "ad33528a4c22dbae26368d77c7b9dc01" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/ApiOverview\/Domains\/ActionsInbound.php", + "hash": "b1ce50fedc0a096260ee9f4d10aa4da6" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/Operations\/CodeSecurity\/AttachEnterpriseConfiguration\/Response\/ApplicationJson\/Accepted.php", + "hash": "a1233ae4857fde0194a8eb479d184597" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/Operations\/CodeSecurity\/AttachEnterpriseConfiguration\/Response\/ApplicationJson\/Accepted\/Application\/Json.php", + "hash": "859b42dd779c28fef6ed913069e01051" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/CodeSecurity\/CreateConfigurationForEnterprise\/Request\/ApplicationJson.php", + "hash": "94d1f472ea14f5d8d86a349d8f5ea2e6" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/AliasAbstract\/Tiet8DAAD835\/Tiet93FE8D1C\/TietAC26D50C\/Tiet27D4E07F.php", + "hash": "427229d6edb8b4d6922d4b07ea476333" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/CodeSecurity\/CreateConfigurationForEnterprise\/Request\/ApplicationJson\/DependencyGraphAutosubmitActionOptions.php", + "hash": "f361c4fa353d3923ebaf138b39164343" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/CodeSecurity\/UpdateEnterpriseConfiguration\/Request\/ApplicationJson.php", + "hash": "04c9df5978efe7aee90280ae4212bae9" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/CodeSecurity\/AttachEnterpriseConfiguration\/Request\/ApplicationJson.php", + "hash": "186604707177f63d5cd43dc269cc681c" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/AliasAbstract\/TietA915022E\/Tiet867AF88E\/Tiet207FA02F\/Tiet074F28B9.php", + "hash": "a33d98a3e0bdec3556e4ad6e17d3871f" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/CodeSecurity\/SetConfigurationAsDefaultForEnterprise\/Request\/ApplicationJson.php", + "hash": "fa57b56a227cece217c1c82933904702" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/AliasAbstract\/Tiet07CEC6F7\/Tiet1DE9A5A0\/Tiet17BD6D01\/Tiet0890CA07.php", + "hash": "c5474fa02271fe9318b0eae417dde533" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/Operations\/CodeSecurity\/SetConfigurationAsDefault\/Response\/ApplicationJson\/Ok\/Application\/Json.php", + "hash": "503551f5cadafa2a8d3375943eeb8c66" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/Operations\/CodeSecurity\/SetConfigurationAsDefaultForEnterprise\/Response\/ApplicationJson\/Ok.php", + "hash": "d0e101f3581f02a87190f173cddf5a5f" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Hydrator\/Operation\/Enterprises\/Enterprise\/CodeSecurity\/Configurations.php", + "hash": "1a34b82a550d63a467510b388a4dc137" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Hydrator\/Operation\/Enterprises\/Enterprise\/CodeSecurity\/Configurations\/ConfigurationId.php", + "hash": "6a3ff5ac2d044e0339d84ec9464b5cea" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Hydrator\/Operation\/Enterprises\/Enterprise\/CodeSecurity\/Configurations\/ConfigurationId\/Attach.php", + "hash": "a88bfd194f73dd6b24dfd0accb035f87" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Hydrator\/Operation\/Enterprises\/Enterprise\/CodeSecurity\/Configurations\/ConfigurationId\/Defaults.php", + "hash": "cd2dc356709f00761b6259f0fb0a88da" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Hydrator\/Operation\/Enterprises\/Enterprise\/CodeSecurity\/Configurations\/ConfigurationId\/Repositories.php", + "hash": "6a7088d3082851b3cff8f4122edb23ba" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Hydrator\/Operation\/Repos\/Owner\/Repo\/CodeScanning\/Alerts\/AlertNumber\/Autofix.php", + "hash": "7cbae9199618220e1e97d5beeba6a04e" + }, + { + "name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Hydrator\/Operation\/Repos\/Owner\/Repo\/CodeScanning\/Alerts\/AlertNumber\/Autofix\/Commits.php", + "hash": "fcb98e54ed39565ecab7ab931aeb71c6" } ] }, diff --git a/clients/GitHub/src/Client.php b/clients/GitHub/src/Client.php index 85d2f736c2d..d8c5431acd0 100644 --- a/clients/GitHub/src/Client.php +++ b/clients/GitHub/src/Client.php @@ -27,7 +27,7 @@ public function __construct(AuthenticationInterface $authentication, Browser $br } // phpcs:disable - public function call(string $call, array $params = []): \ApiClients\Client\GitHub\Schema\Root|iterable|\ApiClients\Client\GitHub\Schema\GlobalAdvisory|\ApiClients\Client\GitHub\Schema\Integration|\ApiClients\Client\GitHub\Schema\WebhookConfig|\ApiClients\Client\GitHub\Schema\HookDelivery|\ApiClients\Client\GitHub\Schema\Operations\Apps\RedeliverWebhookDelivery\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Tools\OpenApiClient\Utils\Response\WithoutBody|\ApiClients\Client\GitHub\Schema\Installation|\ApiClients\Client\GitHub\Schema\InstallationToken|\ApiClients\Client\GitHub\Schema\Authorization|\ApiClients\Client\GitHub\Schema\ClassroomAssignment|\ApiClients\Client\GitHub\Schema\Classroom|\ApiClients\Client\GitHub\Schema\CodeOfConduct|\ApiClients\Client\GitHub\Schema\Operations\Emojis\Get\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Feed|\ApiClients\Client\GitHub\Schema\GistSimple|\ApiClients\Client\GitHub\Schema\GistComment|\ApiClients\Client\GitHub\Schema\BaseGist|\ApiClients\Client\GitHub\Schema\GitignoreTemplate|\ApiClients\Client\GitHub\Schema\Operations\Apps\ListReposAccessibleToInstallation\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\License|string|\ApiClients\Client\GitHub\Schema\MarketplacePurchase|\ApiClients\Client\GitHub\Schema\ApiOverview|\ApiClients\Client\GitHub\Schema\BasicError|\ApiClients\Client\GitHub\Schema\Operations\Activity\MarkNotificationsAsRead\Response\ApplicationJson\Accepted|\ApiClients\Client\GitHub\Schema\Thread|\ApiClients\Client\GitHub\Schema\ThreadSubscription|\Psr\Http\Message\ResponseInterface|\ApiClients\Client\GitHub\Schema\BillingUsageReport|\ApiClients\Client\GitHub\Schema\OrganizationFull|\ApiClients\Client\GitHub\Schema\Operations\Orgs\Delete\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\ActionsCacheUsageOrgEnterprise|\ApiClients\Client\GitHub\Schema\Operations\Actions\GetActionsCacheUsageByRepoForOrg\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\OidcCustomSub|\ApiClients\Client\GitHub\Schema\EmptyObject|\ApiClients\Client\GitHub\Schema\ActionsOrganizationPermissions|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListSelectedRepositoriesEnabledGithubActionsOrganization\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\SelectedActions|\ApiClients\Client\GitHub\Schema\ActionsGetDefaultWorkflowPermissions|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListSelfHostedRunnerGroupsForOrg\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\RunnerGroupsOrg|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListRepoAccessToSelfHostedRunnerGroupInOrg\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListSelfHostedRunnersInGroupForOrg\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListSelfHostedRunnersForOrg\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Actions\GenerateRunnerJitconfigForOrg\Response\ApplicationJson\Created|\ApiClients\Client\GitHub\Schema\AuthenticationToken|\ApiClients\Client\GitHub\Schema\Runner|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListLabelsForSelfHostedRunnerForOrg\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Actions\RemoveAllCustomLabelsFromSelfHostedRunnerForOrg\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListOrgSecrets\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\ActionsPublicKey|\ApiClients\Client\GitHub\Schema\OrganizationActionsSecret|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListSelectedReposForOrgSecret\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListOrgVariables\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\OrganizationActionsVariable|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListSelectedReposForOrgVariable\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Orgs\ListAttestations\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\CodeSecurityConfiguration|\ApiClients\Client\GitHub\Schema\Operations\CodeSecurity\AttachConfiguration\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\CodeSecurity\SetConfigurationAsDefault\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\ListInOrganization\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\ListOrgSecrets\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\CodespacesPublicKey|\ApiClients\Client\GitHub\Schema\CodespacesOrgSecret|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\ListSelectedReposForOrgSecret\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\CopilotOrganizationDetails|\ApiClients\Client\GitHub\Schema\Operations\Copilot\ListCopilotSeats\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Copilot\AddCopilotSeatsForTeams\Response\ApplicationJson\Created|\ApiClients\Client\GitHub\Schema\Operations\Copilot\CancelCopilotSeatAssignmentForTeams\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Copilot\AddCopilotSeatsForUsers\Response\ApplicationJson\Created|\ApiClients\Client\GitHub\Schema\Operations\Copilot\CancelCopilotSeatAssignmentForUsers\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Dependabot\ListOrgSecrets\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\DependabotPublicKey|\ApiClients\Client\GitHub\Schema\OrganizationDependabotSecret|\ApiClients\Client\GitHub\Schema\Operations\Dependabot\ListSelectedReposForOrgSecret\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\OrgHook|\ApiClients\Client\GitHub\Schema\Operations\Orgs\RedeliverWebhookDelivery\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\ApiInsightsSummaryStats|\ApiClients\Client\GitHub\Schema\Operations\Orgs\ListAppInstallations\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\InteractionLimitResponse|\ApiClients\Client\GitHub\Schema\Operations\Interactions\GetRestrictionsForOrg\Response\ApplicationJson\Ok\Application\Json\One|\ApiClients\Client\GitHub\Schema\OrganizationInvitation|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\GetCodespacesForUserInOrg\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\DeleteFromOrganization\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\Codespace|\ApiClients\Client\GitHub\Schema\CopilotSeatDetails|\ApiClients\Client\GitHub\Schema\OrgMembership|\ApiClients\Client\GitHub\Schema\Migration|\ApiClients\Client\GitHub\Schema\Operations\Orgs\ListOrgRoles\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\OrganizationRole|\ApiClients\Client\GitHub\Schema\Operations\Orgs\ConvertMemberToOutsideCollaborator\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\Package|\ApiClients\Client\GitHub\Schema\PackageVersion|\ApiClients\Client\GitHub\Schema\Operations\Orgs\ReviewPatGrantRequestsInBulk\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Orgs\UpdatePatAccesses\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\Project|\ApiClients\Client\GitHub\Schema\CustomProperty|\ApiClients\Client\GitHub\Schema\FullRepository|\ApiClients\Client\GitHub\Schema\RepositoryRuleset|\ApiClients\Client\GitHub\Schema\RuleSuite|\ApiClients\Client\GitHub\Schema\ActionsBillingUsage|\ApiClients\Client\GitHub\Schema\PackagesBillingUsage|\ApiClients\Client\GitHub\Schema\CombinedBillingUsage|\ApiClients\Client\GitHub\Schema\TeamFull|\ApiClients\Client\GitHub\Schema\TeamDiscussion|\ApiClients\Client\GitHub\Schema\TeamDiscussionComment|\ApiClients\Client\GitHub\Schema\Reaction|\ApiClients\Client\GitHub\Schema\TeamMembership|\ApiClients\Client\GitHub\Schema\TeamProject|\ApiClients\Client\GitHub\Schema\TeamRepository|\ApiClients\Client\GitHub\Schema\ProjectCard|\ApiClients\Client\GitHub\Schema\Operations\Projects\MoveCard\Response\ApplicationJson\Created\Application\Json|\ApiClients\Client\GitHub\Schema\ProjectColumn|\ApiClients\Client\GitHub\Schema\Operations\Projects\MoveColumn\Response\ApplicationJson\Created\Application\Json|\ApiClients\Client\GitHub\Schema\ProjectCollaboratorPermission|\ApiClients\Client\GitHub\Schema\RateLimitOverview|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListArtifactsForRepo\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Artifact|\ApiClients\Client\GitHub\Schema\ActionsCacheUsageByRepository|\ApiClients\Client\GitHub\Schema\ActionsCacheList|\ApiClients\Client\GitHub\Schema\Job|\ApiClients\Client\GitHub\Schema\OidcCustomSubRepo|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListRepoOrganizationSecrets\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListRepoOrganizationVariables\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\ActionsRepositoryPermissions|\ApiClients\Client\GitHub\Schema\ActionsWorkflowAccessToRepository|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListSelfHostedRunnersForRepo\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Actions\RemoveAllCustomLabelsFromSelfHostedRunnerForRepo\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListWorkflowRunsForRepo\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\WorkflowRun|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListWorkflowRunArtifacts\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListJobsForWorkflowRunAttempt\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListJobsForWorkflowRun\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\WorkflowRunUsage|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListRepoSecrets\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\ActionsSecret|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListRepoVariables\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\ActionsVariable|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListRepoWorkflows\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Workflow|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListWorkflowRuns\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\WorkflowUsage|\ApiClients\Client\GitHub\Schema\Operations\Repos\CreateAttestation\Response\ApplicationJson\Created|\ApiClients\Client\GitHub\Schema\Operations\Repos\ListAttestations\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Autolink|\ApiClients\Client\GitHub\Schema\CheckAutomatedSecurityFixes|\ApiClients\Client\GitHub\Schema\BranchWithProtection|\ApiClients\Client\GitHub\Schema\BranchProtection|\ApiClients\Client\GitHub\Schema\ProtectedBranch|\ApiClients\Client\GitHub\Schema\ProtectedBranchAdminEnforced|\ApiClients\Client\GitHub\Schema\ProtectedBranchPullRequestReview|\ApiClients\Client\GitHub\Schema\StatusCheckPolicy|\ApiClients\Client\GitHub\Schema\BranchRestrictionPolicy|\ApiClients\Client\GitHub\Schema\CheckRun|\ApiClients\Client\GitHub\Schema\CheckSuite|\ApiClients\Client\GitHub\Schema\CheckSuitePreference|\ApiClients\Client\GitHub\Schema\Operations\Checks\ListForSuite\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\CodeScanningAlert|\ApiClients\Client\GitHub\Schema\CodeScanningAnalysis|\ApiClients\Client\GitHub\Schema\CodeScanningAnalysisDeletion|\ApiClients\Client\GitHub\Schema\CodeScanningCodeqlDatabase|\ApiClients\Client\GitHub\Schema\CodeScanningVariantAnalysis|\ApiClients\Client\GitHub\Schema\CodeScanningVariantAnalysisRepoTask|\ApiClients\Client\GitHub\Schema\CodeScanningDefaultSetup|\ApiClients\Client\GitHub\Schema\CodeScanningDefaultSetupUpdateResponse|\ApiClients\Client\GitHub\Schema\CodeScanningSarifsReceipt|\ApiClients\Client\GitHub\Schema\CodeScanningSarifsStatus|\ApiClients\Client\GitHub\Schema\CodeSecurityConfigurationForRepository|\ApiClients\Client\GitHub\Schema\CodeownersErrors|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\ListInRepositoryForAuthenticatedUser\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\ListDevcontainersInRepositoryForAuthenticatedUser\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\RepoMachinesForAuthenticatedUser\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\PreFlightWithRepoForAuthenticatedUser\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\CodespacesPermissionsCheckForDevcontainer|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\ListRepoSecrets\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\RepoCodespacesSecret|\ApiClients\Client\GitHub\Schema\RepositoryInvitation|\ApiClients\Client\GitHub\Schema\RepositoryCollaboratorPermission|\ApiClients\Client\GitHub\Schema\CommitComment|\ApiClients\Client\GitHub\Schema\Commit|\ApiClients\Client\GitHub\Schema\Operations\Checks\ListForRef\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Checks\ListSuitesForRef\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\CombinedCommitStatus|\ApiClients\Client\GitHub\Schema\CommunityProfile|\ApiClients\Client\GitHub\Schema\CommitComparison|\ApiClients\Client\GitHub\Schema\ContentDirectory|\ApiClients\Client\GitHub\Schema\ContentFile|\ApiClients\Client\GitHub\Schema\ContentSymlink|\ApiClients\Client\GitHub\Schema\ContentSubmodule|\ApiClients\Client\GitHub\Schema\FileCommit|\ApiClients\Client\GitHub\Schema\DependabotAlert|\ApiClients\Client\GitHub\Schema\Operations\Dependabot\ListRepoSecrets\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\DependabotSecret|\ApiClients\Client\GitHub\Schema\DependencyGraphSpdxSbom|\ApiClients\Client\GitHub\Schema\Operations\DependencyGraph\CreateRepositorySnapshot\Response\ApplicationJson\Created|\ApiClients\Client\GitHub\Schema\Deployment|\ApiClients\Client\GitHub\Schema\Operations\Repos\CreateDeployment\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\DeploymentStatus|\ApiClients\Client\GitHub\Schema\Operations\Repos\GetAllEnvironments\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Environment|\ApiClients\Client\GitHub\Schema\Operations\Repos\ListDeploymentBranchPolicies\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\DeploymentBranchPolicy|\ApiClients\Client\GitHub\Schema\Operations\Repos\GetAllDeploymentProtectionRules\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\DeploymentProtectionRule|\ApiClients\Client\GitHub\Schema\Operations\Repos\ListCustomDeploymentRuleIntegrations\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListEnvironmentSecrets\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListEnvironmentVariables\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\ShortBlob|\ApiClients\Client\GitHub\Schema\Blob|\ApiClients\Client\GitHub\Schema\GitCommit|\ApiClients\Client\GitHub\Schema\GitRef|\ApiClients\Client\GitHub\Schema\GitTag|\ApiClients\Client\GitHub\Schema\GitTree|\ApiClients\Client\GitHub\Schema\Hook|\ApiClients\Client\GitHub\Schema\Operations\Repos\RedeliverWebhookDelivery\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\Import|\ApiClients\Client\GitHub\Schema\PorterAuthor|\ApiClients\Client\GitHub\Schema\Operations\Interactions\GetRestrictionsForRepo\Response\ApplicationJson\Ok\Application\Json\One|\ApiClients\Client\GitHub\Schema\Issue|\ApiClients\Client\GitHub\Schema\IssueComment|\ApiClients\Client\GitHub\Schema\IssueEvent|\ApiClients\Client\GitHub\Schema\DeployKey|\ApiClients\Client\GitHub\Schema\Label|\ApiClients\Client\GitHub\Schema\Language|\ApiClients\Client\GitHub\Schema\LicenseContent|\ApiClients\Client\GitHub\Schema\MergedUpstream|\ApiClients\Client\GitHub\Schema\Milestone|\ApiClients\Client\GitHub\Schema\Operations\Activity\MarkRepoNotificationsAsRead\Response\ApplicationJson\Accepted|\ApiClients\Client\GitHub\Schema\Page|\ApiClients\Client\GitHub\Schema\PageBuildStatus|\ApiClients\Client\GitHub\Schema\PageBuild|\ApiClients\Client\GitHub\Schema\PageDeployment|\ApiClients\Client\GitHub\Schema\PagesDeploymentStatus|\ApiClients\Client\GitHub\Schema\PagesHealthCheck|\ApiClients\Client\GitHub\Schema\Operations\Repos\CheckPrivateVulnerabilityReporting\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\PullRequest|\ApiClients\Client\GitHub\Schema\PullRequestReviewComment|\ApiClients\Client\GitHub\Schema\PullRequestMergeResult|\ApiClients\Client\GitHub\Schema\PullRequestReviewRequest|\ApiClients\Client\GitHub\Schema\PullRequestSimple|\ApiClients\Client\GitHub\Schema\PullRequestReview|\ApiClients\Client\GitHub\Schema\Operations\Pulls\UpdateBranch\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\Release|\ApiClients\Client\GitHub\Schema\ReleaseAsset|\ApiClients\Client\GitHub\Schema\ReleaseNotesContent|\ApiClients\Client\GitHub\Schema\SecretScanningAlert|\ApiClients\Client\GitHub\Schema\SecretScanningPushProtectionBypass|\ApiClients\Client\GitHub\Schema\SecretScanningScanHistory|\ApiClients\Client\GitHub\Schema\RepositoryAdvisory|\ApiClients\Client\GitHub\Schema\Operations\SecurityAdvisories\CreateRepositoryAdvisoryCveRequest\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\SimpleUser|\ApiClients\Client\GitHub\Schema\Stargazer|\ApiClients\Client\GitHub\Schema\Operations\Repos\GetCodeFrequencyStats\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Repos\GetCommitActivityStats\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Repos\GetContributorsStats\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\ParticipationStats|\ApiClients\Client\GitHub\Schema\Status|\ApiClients\Client\GitHub\Schema\RepositorySubscription|\ApiClients\Client\GitHub\Schema\TagProtection|\ApiClients\Client\GitHub\Schema\Topic|\ApiClients\Client\GitHub\Schema\CloneTraffic|\ApiClients\Client\GitHub\Schema\ViewTraffic|\ApiClients\Client\GitHub\Schema\MinimalRepository|\ApiClients\Client\GitHub\Schema\Operations\Search\Code\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Search\Commits\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Search\IssuesAndPullRequests\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Search\Labels\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Search\Repos\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Search\Topics\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Search\Users\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\PrivateUser|\ApiClients\Client\GitHub\Schema\PublicUser|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\ListForAuthenticatedUser\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\ListSecretsForAuthenticatedUser\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\CodespacesUserPublicKey|\ApiClients\Client\GitHub\Schema\CodespacesSecret|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\ListRepositoriesForSecretForAuthenticatedUser\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\DeleteForAuthenticatedUser\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\CodespaceExportDetails|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\CodespaceMachinesForAuthenticatedUser\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\CodespaceWithFullRepository|\ApiClients\Client\GitHub\Schema\GpgKey|\ApiClients\Client\GitHub\Schema\Operations\Apps\ListInstallationsForAuthenticatedUser\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Apps\ListInstallationReposForAuthenticatedUser\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Interactions\GetRestrictionsForAuthenticatedUser\Response\ApplicationJson\Ok\Application\Json\One|\ApiClients\Client\GitHub\Schema\Key|\ApiClients\Client\GitHub\Schema\SshSigningKey|\ApiClients\Client\GitHub\Schema\Operations\Users\ListAttestations\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Hovercard|\ApiClients\Client\GitHub\Schema\StarredRepository|\ApiClients\Client\GitHub\Schema\Repository + public function call(string $call, array $params = []): \ApiClients\Client\GitHub\Schema\Root|iterable|\ApiClients\Client\GitHub\Schema\GlobalAdvisory|\ApiClients\Client\GitHub\Schema\Integration|\ApiClients\Client\GitHub\Schema\WebhookConfig|\ApiClients\Client\GitHub\Schema\HookDelivery|\ApiClients\Client\GitHub\Schema\Operations\Apps\RedeliverWebhookDelivery\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Tools\OpenApiClient\Utils\Response\WithoutBody|\ApiClients\Client\GitHub\Schema\Installation|\ApiClients\Client\GitHub\Schema\InstallationToken|\ApiClients\Client\GitHub\Schema\Authorization|\ApiClients\Client\GitHub\Schema\ClassroomAssignment|\ApiClients\Client\GitHub\Schema\Classroom|\ApiClients\Client\GitHub\Schema\CodeOfConduct|\ApiClients\Client\GitHub\Schema\Operations\Emojis\Get\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\CodeSecurityConfiguration|\ApiClients\Client\GitHub\Schema\Operations\CodeSecurity\AttachEnterpriseConfiguration\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\CodeSecurity\SetConfigurationAsDefaultForEnterprise\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Feed|\ApiClients\Client\GitHub\Schema\GistSimple|\ApiClients\Client\GitHub\Schema\GistComment|\ApiClients\Client\GitHub\Schema\BaseGist|\ApiClients\Client\GitHub\Schema\GitignoreTemplate|\ApiClients\Client\GitHub\Schema\Operations\Apps\ListReposAccessibleToInstallation\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\License|string|\ApiClients\Client\GitHub\Schema\MarketplacePurchase|\ApiClients\Client\GitHub\Schema\ApiOverview|\ApiClients\Client\GitHub\Schema\BasicError|\ApiClients\Client\GitHub\Schema\Operations\Activity\MarkNotificationsAsRead\Response\ApplicationJson\Accepted|\ApiClients\Client\GitHub\Schema\Thread|\ApiClients\Client\GitHub\Schema\ThreadSubscription|\Psr\Http\Message\ResponseInterface|\ApiClients\Client\GitHub\Schema\BillingUsageReport|\ApiClients\Client\GitHub\Schema\OrganizationFull|\ApiClients\Client\GitHub\Schema\Operations\Orgs\Delete\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\ActionsCacheUsageOrgEnterprise|\ApiClients\Client\GitHub\Schema\Operations\Actions\GetActionsCacheUsageByRepoForOrg\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\OidcCustomSub|\ApiClients\Client\GitHub\Schema\EmptyObject|\ApiClients\Client\GitHub\Schema\ActionsOrganizationPermissions|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListSelectedRepositoriesEnabledGithubActionsOrganization\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\SelectedActions|\ApiClients\Client\GitHub\Schema\ActionsGetDefaultWorkflowPermissions|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListSelfHostedRunnerGroupsForOrg\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\RunnerGroupsOrg|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListRepoAccessToSelfHostedRunnerGroupInOrg\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListSelfHostedRunnersInGroupForOrg\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListSelfHostedRunnersForOrg\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Actions\GenerateRunnerJitconfigForOrg\Response\ApplicationJson\Created|\ApiClients\Client\GitHub\Schema\AuthenticationToken|\ApiClients\Client\GitHub\Schema\Runner|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListLabelsForSelfHostedRunnerForOrg\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Actions\RemoveAllCustomLabelsFromSelfHostedRunnerForOrg\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListOrgSecrets\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\ActionsPublicKey|\ApiClients\Client\GitHub\Schema\OrganizationActionsSecret|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListSelectedReposForOrgSecret\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListOrgVariables\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\OrganizationActionsVariable|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListSelectedReposForOrgVariable\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Orgs\ListAttestations\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\CodeSecurity\AttachConfiguration\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\CodeSecurity\SetConfigurationAsDefault\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\ListInOrganization\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\ListOrgSecrets\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\CodespacesPublicKey|\ApiClients\Client\GitHub\Schema\CodespacesOrgSecret|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\ListSelectedReposForOrgSecret\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\CopilotOrganizationDetails|\ApiClients\Client\GitHub\Schema\Operations\Copilot\ListCopilotSeats\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Copilot\AddCopilotSeatsForTeams\Response\ApplicationJson\Created|\ApiClients\Client\GitHub\Schema\Operations\Copilot\CancelCopilotSeatAssignmentForTeams\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Copilot\AddCopilotSeatsForUsers\Response\ApplicationJson\Created|\ApiClients\Client\GitHub\Schema\Operations\Copilot\CancelCopilotSeatAssignmentForUsers\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Dependabot\ListOrgSecrets\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\DependabotPublicKey|\ApiClients\Client\GitHub\Schema\OrganizationDependabotSecret|\ApiClients\Client\GitHub\Schema\Operations\Dependabot\ListSelectedReposForOrgSecret\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\OrgHook|\ApiClients\Client\GitHub\Schema\Operations\Orgs\RedeliverWebhookDelivery\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\ApiInsightsSummaryStats|\ApiClients\Client\GitHub\Schema\Operations\Orgs\ListAppInstallations\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\InteractionLimitResponse|\ApiClients\Client\GitHub\Schema\Operations\Interactions\GetRestrictionsForOrg\Response\ApplicationJson\Ok\Application\Json\One|\ApiClients\Client\GitHub\Schema\OrganizationInvitation|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\GetCodespacesForUserInOrg\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\DeleteFromOrganization\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\Codespace|\ApiClients\Client\GitHub\Schema\CopilotSeatDetails|\ApiClients\Client\GitHub\Schema\OrgMembership|\ApiClients\Client\GitHub\Schema\Migration|\ApiClients\Client\GitHub\Schema\Operations\Orgs\ListOrgRoles\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\OrganizationRole|\ApiClients\Client\GitHub\Schema\Operations\Orgs\ConvertMemberToOutsideCollaborator\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\Package|\ApiClients\Client\GitHub\Schema\PackageVersion|\ApiClients\Client\GitHub\Schema\Operations\Orgs\ReviewPatGrantRequestsInBulk\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Orgs\UpdatePatAccesses\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\Project|\ApiClients\Client\GitHub\Schema\CustomProperty|\ApiClients\Client\GitHub\Schema\FullRepository|\ApiClients\Client\GitHub\Schema\RepositoryRuleset|\ApiClients\Client\GitHub\Schema\RuleSuite|\ApiClients\Client\GitHub\Schema\ActionsBillingUsage|\ApiClients\Client\GitHub\Schema\PackagesBillingUsage|\ApiClients\Client\GitHub\Schema\CombinedBillingUsage|\ApiClients\Client\GitHub\Schema\TeamFull|\ApiClients\Client\GitHub\Schema\TeamDiscussion|\ApiClients\Client\GitHub\Schema\TeamDiscussionComment|\ApiClients\Client\GitHub\Schema\Reaction|\ApiClients\Client\GitHub\Schema\TeamMembership|\ApiClients\Client\GitHub\Schema\TeamProject|\ApiClients\Client\GitHub\Schema\TeamRepository|\ApiClients\Client\GitHub\Schema\ProjectCard|\ApiClients\Client\GitHub\Schema\Operations\Projects\MoveCard\Response\ApplicationJson\Created\Application\Json|\ApiClients\Client\GitHub\Schema\ProjectColumn|\ApiClients\Client\GitHub\Schema\Operations\Projects\MoveColumn\Response\ApplicationJson\Created\Application\Json|\ApiClients\Client\GitHub\Schema\ProjectCollaboratorPermission|\ApiClients\Client\GitHub\Schema\RateLimitOverview|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListArtifactsForRepo\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Artifact|\ApiClients\Client\GitHub\Schema\ActionsCacheUsageByRepository|\ApiClients\Client\GitHub\Schema\ActionsCacheList|\ApiClients\Client\GitHub\Schema\Job|\ApiClients\Client\GitHub\Schema\OidcCustomSubRepo|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListRepoOrganizationSecrets\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListRepoOrganizationVariables\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\ActionsRepositoryPermissions|\ApiClients\Client\GitHub\Schema\ActionsWorkflowAccessToRepository|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListSelfHostedRunnersForRepo\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Actions\RemoveAllCustomLabelsFromSelfHostedRunnerForRepo\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListWorkflowRunsForRepo\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\WorkflowRun|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListWorkflowRunArtifacts\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListJobsForWorkflowRunAttempt\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListJobsForWorkflowRun\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\WorkflowRunUsage|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListRepoSecrets\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\ActionsSecret|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListRepoVariables\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\ActionsVariable|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListRepoWorkflows\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Workflow|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListWorkflowRuns\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\WorkflowUsage|\ApiClients\Client\GitHub\Schema\Operations\Repos\CreateAttestation\Response\ApplicationJson\Created|\ApiClients\Client\GitHub\Schema\Operations\Repos\ListAttestations\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Autolink|\ApiClients\Client\GitHub\Schema\CheckAutomatedSecurityFixes|\ApiClients\Client\GitHub\Schema\BranchWithProtection|\ApiClients\Client\GitHub\Schema\BranchProtection|\ApiClients\Client\GitHub\Schema\ProtectedBranch|\ApiClients\Client\GitHub\Schema\ProtectedBranchAdminEnforced|\ApiClients\Client\GitHub\Schema\ProtectedBranchPullRequestReview|\ApiClients\Client\GitHub\Schema\StatusCheckPolicy|\ApiClients\Client\GitHub\Schema\BranchRestrictionPolicy|\ApiClients\Client\GitHub\Schema\CheckRun|\ApiClients\Client\GitHub\Schema\CheckSuite|\ApiClients\Client\GitHub\Schema\CheckSuitePreference|\ApiClients\Client\GitHub\Schema\Operations\Checks\ListForSuite\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\CodeScanningAlert|\ApiClients\Client\GitHub\Schema\CodeScanningAutofix|\ApiClients\Client\GitHub\Schema\CodeScanningAutofixCommitsResponse|\ApiClients\Client\GitHub\Schema\CodeScanningAnalysis|\ApiClients\Client\GitHub\Schema\CodeScanningAnalysisDeletion|\ApiClients\Client\GitHub\Schema\CodeScanningCodeqlDatabase|\ApiClients\Client\GitHub\Schema\CodeScanningVariantAnalysis|\ApiClients\Client\GitHub\Schema\CodeScanningVariantAnalysisRepoTask|\ApiClients\Client\GitHub\Schema\CodeScanningDefaultSetup|\ApiClients\Client\GitHub\Schema\CodeScanningDefaultSetupUpdateResponse|\ApiClients\Client\GitHub\Schema\CodeScanningSarifsReceipt|\ApiClients\Client\GitHub\Schema\CodeScanningSarifsStatus|\ApiClients\Client\GitHub\Schema\CodeSecurityConfigurationForRepository|\ApiClients\Client\GitHub\Schema\CodeownersErrors|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\ListInRepositoryForAuthenticatedUser\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\ListDevcontainersInRepositoryForAuthenticatedUser\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\RepoMachinesForAuthenticatedUser\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\PreFlightWithRepoForAuthenticatedUser\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\CodespacesPermissionsCheckForDevcontainer|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\ListRepoSecrets\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\RepoCodespacesSecret|\ApiClients\Client\GitHub\Schema\RepositoryInvitation|\ApiClients\Client\GitHub\Schema\RepositoryCollaboratorPermission|\ApiClients\Client\GitHub\Schema\CommitComment|\ApiClients\Client\GitHub\Schema\Commit|\ApiClients\Client\GitHub\Schema\Operations\Checks\ListForRef\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Checks\ListSuitesForRef\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\CombinedCommitStatus|\ApiClients\Client\GitHub\Schema\CommunityProfile|\ApiClients\Client\GitHub\Schema\CommitComparison|\ApiClients\Client\GitHub\Schema\ContentDirectory|\ApiClients\Client\GitHub\Schema\ContentFile|\ApiClients\Client\GitHub\Schema\ContentSymlink|\ApiClients\Client\GitHub\Schema\ContentSubmodule|\ApiClients\Client\GitHub\Schema\FileCommit|\ApiClients\Client\GitHub\Schema\DependabotAlert|\ApiClients\Client\GitHub\Schema\Operations\Dependabot\ListRepoSecrets\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\DependabotSecret|\ApiClients\Client\GitHub\Schema\DependencyGraphSpdxSbom|\ApiClients\Client\GitHub\Schema\Operations\DependencyGraph\CreateRepositorySnapshot\Response\ApplicationJson\Created|\ApiClients\Client\GitHub\Schema\Deployment|\ApiClients\Client\GitHub\Schema\Operations\Repos\CreateDeployment\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\DeploymentStatus|\ApiClients\Client\GitHub\Schema\Operations\Repos\GetAllEnvironments\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Environment|\ApiClients\Client\GitHub\Schema\Operations\Repos\ListDeploymentBranchPolicies\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\DeploymentBranchPolicy|\ApiClients\Client\GitHub\Schema\Operations\Repos\GetAllDeploymentProtectionRules\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\DeploymentProtectionRule|\ApiClients\Client\GitHub\Schema\Operations\Repos\ListCustomDeploymentRuleIntegrations\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListEnvironmentSecrets\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListEnvironmentVariables\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\ShortBlob|\ApiClients\Client\GitHub\Schema\Blob|\ApiClients\Client\GitHub\Schema\GitCommit|\ApiClients\Client\GitHub\Schema\GitRef|\ApiClients\Client\GitHub\Schema\GitTag|\ApiClients\Client\GitHub\Schema\GitTree|\ApiClients\Client\GitHub\Schema\Hook|\ApiClients\Client\GitHub\Schema\Operations\Repos\RedeliverWebhookDelivery\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\Import|\ApiClients\Client\GitHub\Schema\PorterAuthor|\ApiClients\Client\GitHub\Schema\Operations\Interactions\GetRestrictionsForRepo\Response\ApplicationJson\Ok\Application\Json\One|\ApiClients\Client\GitHub\Schema\Issue|\ApiClients\Client\GitHub\Schema\IssueComment|\ApiClients\Client\GitHub\Schema\IssueEvent|\ApiClients\Client\GitHub\Schema\DeployKey|\ApiClients\Client\GitHub\Schema\Label|\ApiClients\Client\GitHub\Schema\Language|\ApiClients\Client\GitHub\Schema\LicenseContent|\ApiClients\Client\GitHub\Schema\MergedUpstream|\ApiClients\Client\GitHub\Schema\Milestone|\ApiClients\Client\GitHub\Schema\Operations\Activity\MarkRepoNotificationsAsRead\Response\ApplicationJson\Accepted|\ApiClients\Client\GitHub\Schema\Page|\ApiClients\Client\GitHub\Schema\PageBuildStatus|\ApiClients\Client\GitHub\Schema\PageBuild|\ApiClients\Client\GitHub\Schema\PageDeployment|\ApiClients\Client\GitHub\Schema\PagesDeploymentStatus|\ApiClients\Client\GitHub\Schema\PagesHealthCheck|\ApiClients\Client\GitHub\Schema\Operations\Repos\CheckPrivateVulnerabilityReporting\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\PullRequest|\ApiClients\Client\GitHub\Schema\PullRequestReviewComment|\ApiClients\Client\GitHub\Schema\PullRequestMergeResult|\ApiClients\Client\GitHub\Schema\PullRequestReviewRequest|\ApiClients\Client\GitHub\Schema\PullRequestSimple|\ApiClients\Client\GitHub\Schema\PullRequestReview|\ApiClients\Client\GitHub\Schema\Operations\Pulls\UpdateBranch\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\Release|\ApiClients\Client\GitHub\Schema\ReleaseAsset|\ApiClients\Client\GitHub\Schema\ReleaseNotesContent|\ApiClients\Client\GitHub\Schema\SecretScanningAlert|\ApiClients\Client\GitHub\Schema\SecretScanningPushProtectionBypass|\ApiClients\Client\GitHub\Schema\SecretScanningScanHistory|\ApiClients\Client\GitHub\Schema\RepositoryAdvisory|\ApiClients\Client\GitHub\Schema\Operations\SecurityAdvisories\CreateRepositoryAdvisoryCveRequest\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\SimpleUser|\ApiClients\Client\GitHub\Schema\Stargazer|\ApiClients\Client\GitHub\Schema\Operations\Repos\GetCodeFrequencyStats\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Repos\GetCommitActivityStats\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Repos\GetContributorsStats\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\ParticipationStats|\ApiClients\Client\GitHub\Schema\Status|\ApiClients\Client\GitHub\Schema\RepositorySubscription|\ApiClients\Client\GitHub\Schema\TagProtection|\ApiClients\Client\GitHub\Schema\Topic|\ApiClients\Client\GitHub\Schema\CloneTraffic|\ApiClients\Client\GitHub\Schema\ViewTraffic|\ApiClients\Client\GitHub\Schema\MinimalRepository|\ApiClients\Client\GitHub\Schema\Operations\Search\Code\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Search\Commits\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Search\IssuesAndPullRequests\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Search\Labels\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Search\Repos\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Search\Topics\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Search\Users\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\PrivateUser|\ApiClients\Client\GitHub\Schema\PublicUser|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\ListForAuthenticatedUser\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\ListSecretsForAuthenticatedUser\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\CodespacesUserPublicKey|\ApiClients\Client\GitHub\Schema\CodespacesSecret|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\ListRepositoriesForSecretForAuthenticatedUser\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\DeleteForAuthenticatedUser\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\CodespaceExportDetails|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\CodespaceMachinesForAuthenticatedUser\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\CodespaceWithFullRepository|\ApiClients\Client\GitHub\Schema\GpgKey|\ApiClients\Client\GitHub\Schema\Operations\Apps\ListInstallationsForAuthenticatedUser\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Apps\ListInstallationReposForAuthenticatedUser\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Interactions\GetRestrictionsForAuthenticatedUser\Response\ApplicationJson\Ok\Application\Json\One|\ApiClients\Client\GitHub\Schema\Key|\ApiClients\Client\GitHub\Schema\SshSigningKey|\ApiClients\Client\GitHub\Schema\Operations\Users\ListAttestations\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Hovercard|\ApiClients\Client\GitHub\Schema\StarredRepository|\ApiClients\Client\GitHub\Schema\Repository { [$method, $path] = explode(' ', $call); $pathChunks = explode('/', $path); @@ -119,6 +119,12 @@ public function call(string $call, array $params = []): \ApiClients\Client\GitHu } return $this->router[Internal\Router\Post\Five::class]->call($call, $params, $pathChunks); + } elseif ($pathChunksCount === 7) { + if (\array_key_exists(Internal\Router\Post\Seven::class, $this->router) === false) { + $this->router[Internal\Router\Post\Seven::class] = new Internal\Router\Post\Seven(routers: $this->routers); + } + + return $this->router[Internal\Router\Post\Seven::class]->call($call, $params, $pathChunks); } elseif ($pathChunksCount === 2) { if (\array_key_exists(Internal\Router\Post\Two::class, $this->router) === false) { $this->router[Internal\Router\Post\Two::class] = new Internal\Router\Post\Two(routers: $this->routers); @@ -131,12 +137,6 @@ public function call(string $call, array $params = []): \ApiClients\Client\GitHu } return $this->router[Internal\Router\Post\Three::class]->call($call, $params, $pathChunks); - } elseif ($pathChunksCount === 7) { - if (\array_key_exists(Internal\Router\Post\Seven::class, $this->router) === false) { - $this->router[Internal\Router\Post\Seven::class] = new Internal\Router\Post\Seven(routers: $this->routers); - } - - return $this->router[Internal\Router\Post\Seven::class]->call($call, $params, $pathChunks); } elseif ($pathChunksCount === 8) { if (\array_key_exists(Internal\Router\Post\Eight::class, $this->router) === false) { $this->router[Internal\Router\Post\Eight::class] = new Internal\Router\Post\Eight(routers: $this->routers); @@ -163,6 +163,12 @@ public function call(string $call, array $params = []): \ApiClients\Client\GitHu } return $this->router[Internal\Router\Patch\Four::class]->call($call, $params, $pathChunks); + } elseif ($pathChunksCount === 6) { + if (\array_key_exists(Internal\Router\Patch\Six::class, $this->router) === false) { + $this->router[Internal\Router\Patch\Six::class] = new Internal\Router\Patch\Six(routers: $this->routers); + } + + return $this->router[Internal\Router\Patch\Six::class]->call($call, $params, $pathChunks); } elseif ($pathChunksCount === 3) { if (\array_key_exists(Internal\Router\Patch\Three::class, $this->router) === false) { $this->router[Internal\Router\Patch\Three::class] = new Internal\Router\Patch\Three(routers: $this->routers); @@ -175,12 +181,6 @@ public function call(string $call, array $params = []): \ApiClients\Client\GitHu } return $this->router[Internal\Router\Patch\Five::class]->call($call, $params, $pathChunks); - } elseif ($pathChunksCount === 6) { - if (\array_key_exists(Internal\Router\Patch\Six::class, $this->router) === false) { - $this->router[Internal\Router\Patch\Six::class] = new Internal\Router\Patch\Six(routers: $this->routers); - } - - return $this->router[Internal\Router\Patch\Six::class]->call($call, $params, $pathChunks); } elseif ($pathChunksCount === 7) { if (\array_key_exists(Internal\Router\Patch\Seven::class, $this->router) === false) { $this->router[Internal\Router\Patch\Seven::class] = new Internal\Router\Patch\Seven(routers: $this->routers); @@ -275,6 +275,12 @@ public function call(string $call, array $params = []): \ApiClients\Client\GitHu } return $this->router[Internal\Router\Delete\Five::class]->call($call, $params, $pathChunks); + } elseif ($pathChunksCount === 6) { + if (\array_key_exists(Internal\Router\Delete\Six::class, $this->router) === false) { + $this->router[Internal\Router\Delete\Six::class] = new Internal\Router\Delete\Six(routers: $this->routers); + } + + return $this->router[Internal\Router\Delete\Six::class]->call($call, $params, $pathChunks); } elseif ($pathChunksCount === 3) { if (\array_key_exists(Internal\Router\Delete\Three::class, $this->router) === false) { $this->router[Internal\Router\Delete\Three::class] = new Internal\Router\Delete\Three(routers: $this->routers); @@ -287,12 +293,6 @@ public function call(string $call, array $params = []): \ApiClients\Client\GitHu } return $this->router[Internal\Router\Delete\Seven::class]->call($call, $params, $pathChunks); - } elseif ($pathChunksCount === 6) { - if (\array_key_exists(Internal\Router\Delete\Six::class, $this->router) === false) { - $this->router[Internal\Router\Delete\Six::class] = new Internal\Router\Delete\Six(routers: $this->routers); - } - - return $this->router[Internal\Router\Delete\Six::class]->call($call, $params, $pathChunks); } elseif ($pathChunksCount === 8) { if (\array_key_exists(Internal\Router\Delete\Eight::class, $this->router) === false) { $this->router[Internal\Router\Delete\Eight::class] = new Internal\Router\Delete\Eight(routers: $this->routers); @@ -319,6 +319,12 @@ public function call(string $call, array $params = []): \ApiClients\Client\GitHu } return $this->router[Internal\Router\Put\Five::class]->call($call, $params, $pathChunks); + } elseif ($pathChunksCount === 7) { + if (\array_key_exists(Internal\Router\Put\Seven::class, $this->router) === false) { + $this->router[Internal\Router\Put\Seven::class] = new Internal\Router\Put\Seven(routers: $this->routers); + } + + return $this->router[Internal\Router\Put\Seven::class]->call($call, $params, $pathChunks); } elseif ($pathChunksCount === 4) { if (\array_key_exists(Internal\Router\Put\Four::class, $this->router) === false) { $this->router[Internal\Router\Put\Four::class] = new Internal\Router\Put\Four(routers: $this->routers); @@ -331,12 +337,6 @@ public function call(string $call, array $params = []): \ApiClients\Client\GitHu } return $this->router[Internal\Router\Put\Two::class]->call($call, $params, $pathChunks); - } elseif ($pathChunksCount === 7) { - if (\array_key_exists(Internal\Router\Put\Seven::class, $this->router) === false) { - $this->router[Internal\Router\Put\Seven::class] = new Internal\Router\Put\Seven(routers: $this->routers); - } - - return $this->router[Internal\Router\Put\Seven::class]->call($call, $params, $pathChunks); } elseif ($pathChunksCount === 6) { if (\array_key_exists(Internal\Router\Put\Six::class, $this->router) === false) { $this->router[Internal\Router\Put\Six::class] = new Internal\Router\Put\Six(routers: $this->routers); diff --git a/clients/GitHub/src/ClientInterface.php b/clients/GitHub/src/ClientInterface.php index f4b70440d21..0aa7e5bff83 100644 --- a/clients/GitHub/src/ClientInterface.php +++ b/clients/GitHub/src/ClientInterface.php @@ -7,7 +7,7 @@ interface ClientInterface { // phpcs:disable - public function call(string $call, array $params = []): \ApiClients\Client\GitHub\Schema\Root|iterable|\ApiClients\Client\GitHub\Schema\GlobalAdvisory|\ApiClients\Client\GitHub\Schema\Integration|\ApiClients\Client\GitHub\Schema\WebhookConfig|\ApiClients\Client\GitHub\Schema\HookDelivery|\ApiClients\Client\GitHub\Schema\Operations\Apps\RedeliverWebhookDelivery\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Tools\OpenApiClient\Utils\Response\WithoutBody|\ApiClients\Client\GitHub\Schema\Installation|\ApiClients\Client\GitHub\Schema\InstallationToken|\ApiClients\Client\GitHub\Schema\Authorization|\ApiClients\Client\GitHub\Schema\ClassroomAssignment|\ApiClients\Client\GitHub\Schema\Classroom|\ApiClients\Client\GitHub\Schema\CodeOfConduct|\ApiClients\Client\GitHub\Schema\Operations\Emojis\Get\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Feed|\ApiClients\Client\GitHub\Schema\GistSimple|\ApiClients\Client\GitHub\Schema\GistComment|\ApiClients\Client\GitHub\Schema\BaseGist|\ApiClients\Client\GitHub\Schema\GitignoreTemplate|\ApiClients\Client\GitHub\Schema\Operations\Apps\ListReposAccessibleToInstallation\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\License|string|\ApiClients\Client\GitHub\Schema\MarketplacePurchase|\ApiClients\Client\GitHub\Schema\ApiOverview|\ApiClients\Client\GitHub\Schema\BasicError|\ApiClients\Client\GitHub\Schema\Operations\Activity\MarkNotificationsAsRead\Response\ApplicationJson\Accepted|\ApiClients\Client\GitHub\Schema\Thread|\ApiClients\Client\GitHub\Schema\ThreadSubscription|\Psr\Http\Message\ResponseInterface|\ApiClients\Client\GitHub\Schema\BillingUsageReport|\ApiClients\Client\GitHub\Schema\OrganizationFull|\ApiClients\Client\GitHub\Schema\Operations\Orgs\Delete\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\ActionsCacheUsageOrgEnterprise|\ApiClients\Client\GitHub\Schema\Operations\Actions\GetActionsCacheUsageByRepoForOrg\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\OidcCustomSub|\ApiClients\Client\GitHub\Schema\EmptyObject|\ApiClients\Client\GitHub\Schema\ActionsOrganizationPermissions|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListSelectedRepositoriesEnabledGithubActionsOrganization\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\SelectedActions|\ApiClients\Client\GitHub\Schema\ActionsGetDefaultWorkflowPermissions|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListSelfHostedRunnerGroupsForOrg\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\RunnerGroupsOrg|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListRepoAccessToSelfHostedRunnerGroupInOrg\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListSelfHostedRunnersInGroupForOrg\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListSelfHostedRunnersForOrg\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Actions\GenerateRunnerJitconfigForOrg\Response\ApplicationJson\Created|\ApiClients\Client\GitHub\Schema\AuthenticationToken|\ApiClients\Client\GitHub\Schema\Runner|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListLabelsForSelfHostedRunnerForOrg\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Actions\RemoveAllCustomLabelsFromSelfHostedRunnerForOrg\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListOrgSecrets\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\ActionsPublicKey|\ApiClients\Client\GitHub\Schema\OrganizationActionsSecret|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListSelectedReposForOrgSecret\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListOrgVariables\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\OrganizationActionsVariable|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListSelectedReposForOrgVariable\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Orgs\ListAttestations\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\CodeSecurityConfiguration|\ApiClients\Client\GitHub\Schema\Operations\CodeSecurity\AttachConfiguration\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\CodeSecurity\SetConfigurationAsDefault\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\ListInOrganization\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\ListOrgSecrets\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\CodespacesPublicKey|\ApiClients\Client\GitHub\Schema\CodespacesOrgSecret|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\ListSelectedReposForOrgSecret\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\CopilotOrganizationDetails|\ApiClients\Client\GitHub\Schema\Operations\Copilot\ListCopilotSeats\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Copilot\AddCopilotSeatsForTeams\Response\ApplicationJson\Created|\ApiClients\Client\GitHub\Schema\Operations\Copilot\CancelCopilotSeatAssignmentForTeams\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Copilot\AddCopilotSeatsForUsers\Response\ApplicationJson\Created|\ApiClients\Client\GitHub\Schema\Operations\Copilot\CancelCopilotSeatAssignmentForUsers\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Dependabot\ListOrgSecrets\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\DependabotPublicKey|\ApiClients\Client\GitHub\Schema\OrganizationDependabotSecret|\ApiClients\Client\GitHub\Schema\Operations\Dependabot\ListSelectedReposForOrgSecret\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\OrgHook|\ApiClients\Client\GitHub\Schema\Operations\Orgs\RedeliverWebhookDelivery\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\ApiInsightsSummaryStats|\ApiClients\Client\GitHub\Schema\Operations\Orgs\ListAppInstallations\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\InteractionLimitResponse|\ApiClients\Client\GitHub\Schema\Operations\Interactions\GetRestrictionsForOrg\Response\ApplicationJson\Ok\Application\Json\One|\ApiClients\Client\GitHub\Schema\OrganizationInvitation|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\GetCodespacesForUserInOrg\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\DeleteFromOrganization\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\Codespace|\ApiClients\Client\GitHub\Schema\CopilotSeatDetails|\ApiClients\Client\GitHub\Schema\OrgMembership|\ApiClients\Client\GitHub\Schema\Migration|\ApiClients\Client\GitHub\Schema\Operations\Orgs\ListOrgRoles\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\OrganizationRole|\ApiClients\Client\GitHub\Schema\Operations\Orgs\ConvertMemberToOutsideCollaborator\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\Package|\ApiClients\Client\GitHub\Schema\PackageVersion|\ApiClients\Client\GitHub\Schema\Operations\Orgs\ReviewPatGrantRequestsInBulk\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Orgs\UpdatePatAccesses\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\Project|\ApiClients\Client\GitHub\Schema\CustomProperty|\ApiClients\Client\GitHub\Schema\FullRepository|\ApiClients\Client\GitHub\Schema\RepositoryRuleset|\ApiClients\Client\GitHub\Schema\RuleSuite|\ApiClients\Client\GitHub\Schema\ActionsBillingUsage|\ApiClients\Client\GitHub\Schema\PackagesBillingUsage|\ApiClients\Client\GitHub\Schema\CombinedBillingUsage|\ApiClients\Client\GitHub\Schema\TeamFull|\ApiClients\Client\GitHub\Schema\TeamDiscussion|\ApiClients\Client\GitHub\Schema\TeamDiscussionComment|\ApiClients\Client\GitHub\Schema\Reaction|\ApiClients\Client\GitHub\Schema\TeamMembership|\ApiClients\Client\GitHub\Schema\TeamProject|\ApiClients\Client\GitHub\Schema\TeamRepository|\ApiClients\Client\GitHub\Schema\ProjectCard|\ApiClients\Client\GitHub\Schema\Operations\Projects\MoveCard\Response\ApplicationJson\Created\Application\Json|\ApiClients\Client\GitHub\Schema\ProjectColumn|\ApiClients\Client\GitHub\Schema\Operations\Projects\MoveColumn\Response\ApplicationJson\Created\Application\Json|\ApiClients\Client\GitHub\Schema\ProjectCollaboratorPermission|\ApiClients\Client\GitHub\Schema\RateLimitOverview|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListArtifactsForRepo\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Artifact|\ApiClients\Client\GitHub\Schema\ActionsCacheUsageByRepository|\ApiClients\Client\GitHub\Schema\ActionsCacheList|\ApiClients\Client\GitHub\Schema\Job|\ApiClients\Client\GitHub\Schema\OidcCustomSubRepo|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListRepoOrganizationSecrets\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListRepoOrganizationVariables\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\ActionsRepositoryPermissions|\ApiClients\Client\GitHub\Schema\ActionsWorkflowAccessToRepository|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListSelfHostedRunnersForRepo\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Actions\RemoveAllCustomLabelsFromSelfHostedRunnerForRepo\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListWorkflowRunsForRepo\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\WorkflowRun|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListWorkflowRunArtifacts\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListJobsForWorkflowRunAttempt\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListJobsForWorkflowRun\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\WorkflowRunUsage|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListRepoSecrets\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\ActionsSecret|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListRepoVariables\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\ActionsVariable|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListRepoWorkflows\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Workflow|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListWorkflowRuns\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\WorkflowUsage|\ApiClients\Client\GitHub\Schema\Operations\Repos\CreateAttestation\Response\ApplicationJson\Created|\ApiClients\Client\GitHub\Schema\Operations\Repos\ListAttestations\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Autolink|\ApiClients\Client\GitHub\Schema\CheckAutomatedSecurityFixes|\ApiClients\Client\GitHub\Schema\BranchWithProtection|\ApiClients\Client\GitHub\Schema\BranchProtection|\ApiClients\Client\GitHub\Schema\ProtectedBranch|\ApiClients\Client\GitHub\Schema\ProtectedBranchAdminEnforced|\ApiClients\Client\GitHub\Schema\ProtectedBranchPullRequestReview|\ApiClients\Client\GitHub\Schema\StatusCheckPolicy|\ApiClients\Client\GitHub\Schema\BranchRestrictionPolicy|\ApiClients\Client\GitHub\Schema\CheckRun|\ApiClients\Client\GitHub\Schema\CheckSuite|\ApiClients\Client\GitHub\Schema\CheckSuitePreference|\ApiClients\Client\GitHub\Schema\Operations\Checks\ListForSuite\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\CodeScanningAlert|\ApiClients\Client\GitHub\Schema\CodeScanningAnalysis|\ApiClients\Client\GitHub\Schema\CodeScanningAnalysisDeletion|\ApiClients\Client\GitHub\Schema\CodeScanningCodeqlDatabase|\ApiClients\Client\GitHub\Schema\CodeScanningVariantAnalysis|\ApiClients\Client\GitHub\Schema\CodeScanningVariantAnalysisRepoTask|\ApiClients\Client\GitHub\Schema\CodeScanningDefaultSetup|\ApiClients\Client\GitHub\Schema\CodeScanningDefaultSetupUpdateResponse|\ApiClients\Client\GitHub\Schema\CodeScanningSarifsReceipt|\ApiClients\Client\GitHub\Schema\CodeScanningSarifsStatus|\ApiClients\Client\GitHub\Schema\CodeSecurityConfigurationForRepository|\ApiClients\Client\GitHub\Schema\CodeownersErrors|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\ListInRepositoryForAuthenticatedUser\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\ListDevcontainersInRepositoryForAuthenticatedUser\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\RepoMachinesForAuthenticatedUser\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\PreFlightWithRepoForAuthenticatedUser\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\CodespacesPermissionsCheckForDevcontainer|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\ListRepoSecrets\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\RepoCodespacesSecret|\ApiClients\Client\GitHub\Schema\RepositoryInvitation|\ApiClients\Client\GitHub\Schema\RepositoryCollaboratorPermission|\ApiClients\Client\GitHub\Schema\CommitComment|\ApiClients\Client\GitHub\Schema\Commit|\ApiClients\Client\GitHub\Schema\Operations\Checks\ListForRef\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Checks\ListSuitesForRef\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\CombinedCommitStatus|\ApiClients\Client\GitHub\Schema\CommunityProfile|\ApiClients\Client\GitHub\Schema\CommitComparison|\ApiClients\Client\GitHub\Schema\ContentDirectory|\ApiClients\Client\GitHub\Schema\ContentFile|\ApiClients\Client\GitHub\Schema\ContentSymlink|\ApiClients\Client\GitHub\Schema\ContentSubmodule|\ApiClients\Client\GitHub\Schema\FileCommit|\ApiClients\Client\GitHub\Schema\DependabotAlert|\ApiClients\Client\GitHub\Schema\Operations\Dependabot\ListRepoSecrets\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\DependabotSecret|\ApiClients\Client\GitHub\Schema\DependencyGraphSpdxSbom|\ApiClients\Client\GitHub\Schema\Operations\DependencyGraph\CreateRepositorySnapshot\Response\ApplicationJson\Created|\ApiClients\Client\GitHub\Schema\Deployment|\ApiClients\Client\GitHub\Schema\Operations\Repos\CreateDeployment\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\DeploymentStatus|\ApiClients\Client\GitHub\Schema\Operations\Repos\GetAllEnvironments\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Environment|\ApiClients\Client\GitHub\Schema\Operations\Repos\ListDeploymentBranchPolicies\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\DeploymentBranchPolicy|\ApiClients\Client\GitHub\Schema\Operations\Repos\GetAllDeploymentProtectionRules\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\DeploymentProtectionRule|\ApiClients\Client\GitHub\Schema\Operations\Repos\ListCustomDeploymentRuleIntegrations\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListEnvironmentSecrets\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListEnvironmentVariables\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\ShortBlob|\ApiClients\Client\GitHub\Schema\Blob|\ApiClients\Client\GitHub\Schema\GitCommit|\ApiClients\Client\GitHub\Schema\GitRef|\ApiClients\Client\GitHub\Schema\GitTag|\ApiClients\Client\GitHub\Schema\GitTree|\ApiClients\Client\GitHub\Schema\Hook|\ApiClients\Client\GitHub\Schema\Operations\Repos\RedeliverWebhookDelivery\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\Import|\ApiClients\Client\GitHub\Schema\PorterAuthor|\ApiClients\Client\GitHub\Schema\Operations\Interactions\GetRestrictionsForRepo\Response\ApplicationJson\Ok\Application\Json\One|\ApiClients\Client\GitHub\Schema\Issue|\ApiClients\Client\GitHub\Schema\IssueComment|\ApiClients\Client\GitHub\Schema\IssueEvent|\ApiClients\Client\GitHub\Schema\DeployKey|\ApiClients\Client\GitHub\Schema\Label|\ApiClients\Client\GitHub\Schema\Language|\ApiClients\Client\GitHub\Schema\LicenseContent|\ApiClients\Client\GitHub\Schema\MergedUpstream|\ApiClients\Client\GitHub\Schema\Milestone|\ApiClients\Client\GitHub\Schema\Operations\Activity\MarkRepoNotificationsAsRead\Response\ApplicationJson\Accepted|\ApiClients\Client\GitHub\Schema\Page|\ApiClients\Client\GitHub\Schema\PageBuildStatus|\ApiClients\Client\GitHub\Schema\PageBuild|\ApiClients\Client\GitHub\Schema\PageDeployment|\ApiClients\Client\GitHub\Schema\PagesDeploymentStatus|\ApiClients\Client\GitHub\Schema\PagesHealthCheck|\ApiClients\Client\GitHub\Schema\Operations\Repos\CheckPrivateVulnerabilityReporting\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\PullRequest|\ApiClients\Client\GitHub\Schema\PullRequestReviewComment|\ApiClients\Client\GitHub\Schema\PullRequestMergeResult|\ApiClients\Client\GitHub\Schema\PullRequestReviewRequest|\ApiClients\Client\GitHub\Schema\PullRequestSimple|\ApiClients\Client\GitHub\Schema\PullRequestReview|\ApiClients\Client\GitHub\Schema\Operations\Pulls\UpdateBranch\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\Release|\ApiClients\Client\GitHub\Schema\ReleaseAsset|\ApiClients\Client\GitHub\Schema\ReleaseNotesContent|\ApiClients\Client\GitHub\Schema\SecretScanningAlert|\ApiClients\Client\GitHub\Schema\SecretScanningPushProtectionBypass|\ApiClients\Client\GitHub\Schema\SecretScanningScanHistory|\ApiClients\Client\GitHub\Schema\RepositoryAdvisory|\ApiClients\Client\GitHub\Schema\Operations\SecurityAdvisories\CreateRepositoryAdvisoryCveRequest\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\SimpleUser|\ApiClients\Client\GitHub\Schema\Stargazer|\ApiClients\Client\GitHub\Schema\Operations\Repos\GetCodeFrequencyStats\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Repos\GetCommitActivityStats\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Repos\GetContributorsStats\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\ParticipationStats|\ApiClients\Client\GitHub\Schema\Status|\ApiClients\Client\GitHub\Schema\RepositorySubscription|\ApiClients\Client\GitHub\Schema\TagProtection|\ApiClients\Client\GitHub\Schema\Topic|\ApiClients\Client\GitHub\Schema\CloneTraffic|\ApiClients\Client\GitHub\Schema\ViewTraffic|\ApiClients\Client\GitHub\Schema\MinimalRepository|\ApiClients\Client\GitHub\Schema\Operations\Search\Code\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Search\Commits\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Search\IssuesAndPullRequests\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Search\Labels\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Search\Repos\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Search\Topics\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Search\Users\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\PrivateUser|\ApiClients\Client\GitHub\Schema\PublicUser|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\ListForAuthenticatedUser\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\ListSecretsForAuthenticatedUser\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\CodespacesUserPublicKey|\ApiClients\Client\GitHub\Schema\CodespacesSecret|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\ListRepositoriesForSecretForAuthenticatedUser\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\DeleteForAuthenticatedUser\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\CodespaceExportDetails|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\CodespaceMachinesForAuthenticatedUser\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\CodespaceWithFullRepository|\ApiClients\Client\GitHub\Schema\GpgKey|\ApiClients\Client\GitHub\Schema\Operations\Apps\ListInstallationsForAuthenticatedUser\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Apps\ListInstallationReposForAuthenticatedUser\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Interactions\GetRestrictionsForAuthenticatedUser\Response\ApplicationJson\Ok\Application\Json\One|\ApiClients\Client\GitHub\Schema\Key|\ApiClients\Client\GitHub\Schema\SshSigningKey|\ApiClients\Client\GitHub\Schema\Operations\Users\ListAttestations\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Hovercard|\ApiClients\Client\GitHub\Schema\StarredRepository|\ApiClients\Client\GitHub\Schema\Repository; + public function call(string $call, array $params = []): \ApiClients\Client\GitHub\Schema\Root|iterable|\ApiClients\Client\GitHub\Schema\GlobalAdvisory|\ApiClients\Client\GitHub\Schema\Integration|\ApiClients\Client\GitHub\Schema\WebhookConfig|\ApiClients\Client\GitHub\Schema\HookDelivery|\ApiClients\Client\GitHub\Schema\Operations\Apps\RedeliverWebhookDelivery\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Tools\OpenApiClient\Utils\Response\WithoutBody|\ApiClients\Client\GitHub\Schema\Installation|\ApiClients\Client\GitHub\Schema\InstallationToken|\ApiClients\Client\GitHub\Schema\Authorization|\ApiClients\Client\GitHub\Schema\ClassroomAssignment|\ApiClients\Client\GitHub\Schema\Classroom|\ApiClients\Client\GitHub\Schema\CodeOfConduct|\ApiClients\Client\GitHub\Schema\Operations\Emojis\Get\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\CodeSecurityConfiguration|\ApiClients\Client\GitHub\Schema\Operations\CodeSecurity\AttachEnterpriseConfiguration\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\CodeSecurity\SetConfigurationAsDefaultForEnterprise\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Feed|\ApiClients\Client\GitHub\Schema\GistSimple|\ApiClients\Client\GitHub\Schema\GistComment|\ApiClients\Client\GitHub\Schema\BaseGist|\ApiClients\Client\GitHub\Schema\GitignoreTemplate|\ApiClients\Client\GitHub\Schema\Operations\Apps\ListReposAccessibleToInstallation\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\License|string|\ApiClients\Client\GitHub\Schema\MarketplacePurchase|\ApiClients\Client\GitHub\Schema\ApiOverview|\ApiClients\Client\GitHub\Schema\BasicError|\ApiClients\Client\GitHub\Schema\Operations\Activity\MarkNotificationsAsRead\Response\ApplicationJson\Accepted|\ApiClients\Client\GitHub\Schema\Thread|\ApiClients\Client\GitHub\Schema\ThreadSubscription|\Psr\Http\Message\ResponseInterface|\ApiClients\Client\GitHub\Schema\BillingUsageReport|\ApiClients\Client\GitHub\Schema\OrganizationFull|\ApiClients\Client\GitHub\Schema\Operations\Orgs\Delete\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\ActionsCacheUsageOrgEnterprise|\ApiClients\Client\GitHub\Schema\Operations\Actions\GetActionsCacheUsageByRepoForOrg\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\OidcCustomSub|\ApiClients\Client\GitHub\Schema\EmptyObject|\ApiClients\Client\GitHub\Schema\ActionsOrganizationPermissions|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListSelectedRepositoriesEnabledGithubActionsOrganization\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\SelectedActions|\ApiClients\Client\GitHub\Schema\ActionsGetDefaultWorkflowPermissions|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListSelfHostedRunnerGroupsForOrg\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\RunnerGroupsOrg|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListRepoAccessToSelfHostedRunnerGroupInOrg\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListSelfHostedRunnersInGroupForOrg\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListSelfHostedRunnersForOrg\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Actions\GenerateRunnerJitconfigForOrg\Response\ApplicationJson\Created|\ApiClients\Client\GitHub\Schema\AuthenticationToken|\ApiClients\Client\GitHub\Schema\Runner|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListLabelsForSelfHostedRunnerForOrg\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Actions\RemoveAllCustomLabelsFromSelfHostedRunnerForOrg\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListOrgSecrets\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\ActionsPublicKey|\ApiClients\Client\GitHub\Schema\OrganizationActionsSecret|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListSelectedReposForOrgSecret\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListOrgVariables\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\OrganizationActionsVariable|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListSelectedReposForOrgVariable\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Orgs\ListAttestations\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\CodeSecurity\AttachConfiguration\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\CodeSecurity\SetConfigurationAsDefault\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\ListInOrganization\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\ListOrgSecrets\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\CodespacesPublicKey|\ApiClients\Client\GitHub\Schema\CodespacesOrgSecret|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\ListSelectedReposForOrgSecret\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\CopilotOrganizationDetails|\ApiClients\Client\GitHub\Schema\Operations\Copilot\ListCopilotSeats\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Copilot\AddCopilotSeatsForTeams\Response\ApplicationJson\Created|\ApiClients\Client\GitHub\Schema\Operations\Copilot\CancelCopilotSeatAssignmentForTeams\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Copilot\AddCopilotSeatsForUsers\Response\ApplicationJson\Created|\ApiClients\Client\GitHub\Schema\Operations\Copilot\CancelCopilotSeatAssignmentForUsers\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Dependabot\ListOrgSecrets\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\DependabotPublicKey|\ApiClients\Client\GitHub\Schema\OrganizationDependabotSecret|\ApiClients\Client\GitHub\Schema\Operations\Dependabot\ListSelectedReposForOrgSecret\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\OrgHook|\ApiClients\Client\GitHub\Schema\Operations\Orgs\RedeliverWebhookDelivery\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\ApiInsightsSummaryStats|\ApiClients\Client\GitHub\Schema\Operations\Orgs\ListAppInstallations\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\InteractionLimitResponse|\ApiClients\Client\GitHub\Schema\Operations\Interactions\GetRestrictionsForOrg\Response\ApplicationJson\Ok\Application\Json\One|\ApiClients\Client\GitHub\Schema\OrganizationInvitation|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\GetCodespacesForUserInOrg\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\DeleteFromOrganization\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\Codespace|\ApiClients\Client\GitHub\Schema\CopilotSeatDetails|\ApiClients\Client\GitHub\Schema\OrgMembership|\ApiClients\Client\GitHub\Schema\Migration|\ApiClients\Client\GitHub\Schema\Operations\Orgs\ListOrgRoles\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\OrganizationRole|\ApiClients\Client\GitHub\Schema\Operations\Orgs\ConvertMemberToOutsideCollaborator\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\Package|\ApiClients\Client\GitHub\Schema\PackageVersion|\ApiClients\Client\GitHub\Schema\Operations\Orgs\ReviewPatGrantRequestsInBulk\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Orgs\UpdatePatAccesses\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\Project|\ApiClients\Client\GitHub\Schema\CustomProperty|\ApiClients\Client\GitHub\Schema\FullRepository|\ApiClients\Client\GitHub\Schema\RepositoryRuleset|\ApiClients\Client\GitHub\Schema\RuleSuite|\ApiClients\Client\GitHub\Schema\ActionsBillingUsage|\ApiClients\Client\GitHub\Schema\PackagesBillingUsage|\ApiClients\Client\GitHub\Schema\CombinedBillingUsage|\ApiClients\Client\GitHub\Schema\TeamFull|\ApiClients\Client\GitHub\Schema\TeamDiscussion|\ApiClients\Client\GitHub\Schema\TeamDiscussionComment|\ApiClients\Client\GitHub\Schema\Reaction|\ApiClients\Client\GitHub\Schema\TeamMembership|\ApiClients\Client\GitHub\Schema\TeamProject|\ApiClients\Client\GitHub\Schema\TeamRepository|\ApiClients\Client\GitHub\Schema\ProjectCard|\ApiClients\Client\GitHub\Schema\Operations\Projects\MoveCard\Response\ApplicationJson\Created\Application\Json|\ApiClients\Client\GitHub\Schema\ProjectColumn|\ApiClients\Client\GitHub\Schema\Operations\Projects\MoveColumn\Response\ApplicationJson\Created\Application\Json|\ApiClients\Client\GitHub\Schema\ProjectCollaboratorPermission|\ApiClients\Client\GitHub\Schema\RateLimitOverview|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListArtifactsForRepo\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Artifact|\ApiClients\Client\GitHub\Schema\ActionsCacheUsageByRepository|\ApiClients\Client\GitHub\Schema\ActionsCacheList|\ApiClients\Client\GitHub\Schema\Job|\ApiClients\Client\GitHub\Schema\OidcCustomSubRepo|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListRepoOrganizationSecrets\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListRepoOrganizationVariables\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\ActionsRepositoryPermissions|\ApiClients\Client\GitHub\Schema\ActionsWorkflowAccessToRepository|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListSelfHostedRunnersForRepo\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Actions\RemoveAllCustomLabelsFromSelfHostedRunnerForRepo\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListWorkflowRunsForRepo\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\WorkflowRun|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListWorkflowRunArtifacts\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListJobsForWorkflowRunAttempt\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListJobsForWorkflowRun\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\WorkflowRunUsage|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListRepoSecrets\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\ActionsSecret|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListRepoVariables\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\ActionsVariable|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListRepoWorkflows\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Workflow|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListWorkflowRuns\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\WorkflowUsage|\ApiClients\Client\GitHub\Schema\Operations\Repos\CreateAttestation\Response\ApplicationJson\Created|\ApiClients\Client\GitHub\Schema\Operations\Repos\ListAttestations\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Autolink|\ApiClients\Client\GitHub\Schema\CheckAutomatedSecurityFixes|\ApiClients\Client\GitHub\Schema\BranchWithProtection|\ApiClients\Client\GitHub\Schema\BranchProtection|\ApiClients\Client\GitHub\Schema\ProtectedBranch|\ApiClients\Client\GitHub\Schema\ProtectedBranchAdminEnforced|\ApiClients\Client\GitHub\Schema\ProtectedBranchPullRequestReview|\ApiClients\Client\GitHub\Schema\StatusCheckPolicy|\ApiClients\Client\GitHub\Schema\BranchRestrictionPolicy|\ApiClients\Client\GitHub\Schema\CheckRun|\ApiClients\Client\GitHub\Schema\CheckSuite|\ApiClients\Client\GitHub\Schema\CheckSuitePreference|\ApiClients\Client\GitHub\Schema\Operations\Checks\ListForSuite\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\CodeScanningAlert|\ApiClients\Client\GitHub\Schema\CodeScanningAutofix|\ApiClients\Client\GitHub\Schema\CodeScanningAutofixCommitsResponse|\ApiClients\Client\GitHub\Schema\CodeScanningAnalysis|\ApiClients\Client\GitHub\Schema\CodeScanningAnalysisDeletion|\ApiClients\Client\GitHub\Schema\CodeScanningCodeqlDatabase|\ApiClients\Client\GitHub\Schema\CodeScanningVariantAnalysis|\ApiClients\Client\GitHub\Schema\CodeScanningVariantAnalysisRepoTask|\ApiClients\Client\GitHub\Schema\CodeScanningDefaultSetup|\ApiClients\Client\GitHub\Schema\CodeScanningDefaultSetupUpdateResponse|\ApiClients\Client\GitHub\Schema\CodeScanningSarifsReceipt|\ApiClients\Client\GitHub\Schema\CodeScanningSarifsStatus|\ApiClients\Client\GitHub\Schema\CodeSecurityConfigurationForRepository|\ApiClients\Client\GitHub\Schema\CodeownersErrors|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\ListInRepositoryForAuthenticatedUser\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\ListDevcontainersInRepositoryForAuthenticatedUser\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\RepoMachinesForAuthenticatedUser\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\PreFlightWithRepoForAuthenticatedUser\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\CodespacesPermissionsCheckForDevcontainer|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\ListRepoSecrets\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\RepoCodespacesSecret|\ApiClients\Client\GitHub\Schema\RepositoryInvitation|\ApiClients\Client\GitHub\Schema\RepositoryCollaboratorPermission|\ApiClients\Client\GitHub\Schema\CommitComment|\ApiClients\Client\GitHub\Schema\Commit|\ApiClients\Client\GitHub\Schema\Operations\Checks\ListForRef\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Checks\ListSuitesForRef\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\CombinedCommitStatus|\ApiClients\Client\GitHub\Schema\CommunityProfile|\ApiClients\Client\GitHub\Schema\CommitComparison|\ApiClients\Client\GitHub\Schema\ContentDirectory|\ApiClients\Client\GitHub\Schema\ContentFile|\ApiClients\Client\GitHub\Schema\ContentSymlink|\ApiClients\Client\GitHub\Schema\ContentSubmodule|\ApiClients\Client\GitHub\Schema\FileCommit|\ApiClients\Client\GitHub\Schema\DependabotAlert|\ApiClients\Client\GitHub\Schema\Operations\Dependabot\ListRepoSecrets\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\DependabotSecret|\ApiClients\Client\GitHub\Schema\DependencyGraphSpdxSbom|\ApiClients\Client\GitHub\Schema\Operations\DependencyGraph\CreateRepositorySnapshot\Response\ApplicationJson\Created|\ApiClients\Client\GitHub\Schema\Deployment|\ApiClients\Client\GitHub\Schema\Operations\Repos\CreateDeployment\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\DeploymentStatus|\ApiClients\Client\GitHub\Schema\Operations\Repos\GetAllEnvironments\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Environment|\ApiClients\Client\GitHub\Schema\Operations\Repos\ListDeploymentBranchPolicies\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\DeploymentBranchPolicy|\ApiClients\Client\GitHub\Schema\Operations\Repos\GetAllDeploymentProtectionRules\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\DeploymentProtectionRule|\ApiClients\Client\GitHub\Schema\Operations\Repos\ListCustomDeploymentRuleIntegrations\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListEnvironmentSecrets\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListEnvironmentVariables\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\ShortBlob|\ApiClients\Client\GitHub\Schema\Blob|\ApiClients\Client\GitHub\Schema\GitCommit|\ApiClients\Client\GitHub\Schema\GitRef|\ApiClients\Client\GitHub\Schema\GitTag|\ApiClients\Client\GitHub\Schema\GitTree|\ApiClients\Client\GitHub\Schema\Hook|\ApiClients\Client\GitHub\Schema\Operations\Repos\RedeliverWebhookDelivery\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\Import|\ApiClients\Client\GitHub\Schema\PorterAuthor|\ApiClients\Client\GitHub\Schema\Operations\Interactions\GetRestrictionsForRepo\Response\ApplicationJson\Ok\Application\Json\One|\ApiClients\Client\GitHub\Schema\Issue|\ApiClients\Client\GitHub\Schema\IssueComment|\ApiClients\Client\GitHub\Schema\IssueEvent|\ApiClients\Client\GitHub\Schema\DeployKey|\ApiClients\Client\GitHub\Schema\Label|\ApiClients\Client\GitHub\Schema\Language|\ApiClients\Client\GitHub\Schema\LicenseContent|\ApiClients\Client\GitHub\Schema\MergedUpstream|\ApiClients\Client\GitHub\Schema\Milestone|\ApiClients\Client\GitHub\Schema\Operations\Activity\MarkRepoNotificationsAsRead\Response\ApplicationJson\Accepted|\ApiClients\Client\GitHub\Schema\Page|\ApiClients\Client\GitHub\Schema\PageBuildStatus|\ApiClients\Client\GitHub\Schema\PageBuild|\ApiClients\Client\GitHub\Schema\PageDeployment|\ApiClients\Client\GitHub\Schema\PagesDeploymentStatus|\ApiClients\Client\GitHub\Schema\PagesHealthCheck|\ApiClients\Client\GitHub\Schema\Operations\Repos\CheckPrivateVulnerabilityReporting\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\PullRequest|\ApiClients\Client\GitHub\Schema\PullRequestReviewComment|\ApiClients\Client\GitHub\Schema\PullRequestMergeResult|\ApiClients\Client\GitHub\Schema\PullRequestReviewRequest|\ApiClients\Client\GitHub\Schema\PullRequestSimple|\ApiClients\Client\GitHub\Schema\PullRequestReview|\ApiClients\Client\GitHub\Schema\Operations\Pulls\UpdateBranch\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\Release|\ApiClients\Client\GitHub\Schema\ReleaseAsset|\ApiClients\Client\GitHub\Schema\ReleaseNotesContent|\ApiClients\Client\GitHub\Schema\SecretScanningAlert|\ApiClients\Client\GitHub\Schema\SecretScanningPushProtectionBypass|\ApiClients\Client\GitHub\Schema\SecretScanningScanHistory|\ApiClients\Client\GitHub\Schema\RepositoryAdvisory|\ApiClients\Client\GitHub\Schema\Operations\SecurityAdvisories\CreateRepositoryAdvisoryCveRequest\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\SimpleUser|\ApiClients\Client\GitHub\Schema\Stargazer|\ApiClients\Client\GitHub\Schema\Operations\Repos\GetCodeFrequencyStats\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Repos\GetCommitActivityStats\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Repos\GetContributorsStats\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\ParticipationStats|\ApiClients\Client\GitHub\Schema\Status|\ApiClients\Client\GitHub\Schema\RepositorySubscription|\ApiClients\Client\GitHub\Schema\TagProtection|\ApiClients\Client\GitHub\Schema\Topic|\ApiClients\Client\GitHub\Schema\CloneTraffic|\ApiClients\Client\GitHub\Schema\ViewTraffic|\ApiClients\Client\GitHub\Schema\MinimalRepository|\ApiClients\Client\GitHub\Schema\Operations\Search\Code\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Search\Commits\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Search\IssuesAndPullRequests\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Search\Labels\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Search\Repos\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Search\Topics\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Search\Users\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\PrivateUser|\ApiClients\Client\GitHub\Schema\PublicUser|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\ListForAuthenticatedUser\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\ListSecretsForAuthenticatedUser\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\CodespacesUserPublicKey|\ApiClients\Client\GitHub\Schema\CodespacesSecret|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\ListRepositoriesForSecretForAuthenticatedUser\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\DeleteForAuthenticatedUser\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\CodespaceExportDetails|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\CodespaceMachinesForAuthenticatedUser\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\CodespaceWithFullRepository|\ApiClients\Client\GitHub\Schema\GpgKey|\ApiClients\Client\GitHub\Schema\Operations\Apps\ListInstallationsForAuthenticatedUser\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Apps\ListInstallationReposForAuthenticatedUser\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Interactions\GetRestrictionsForAuthenticatedUser\Response\ApplicationJson\Ok\Application\Json\One|\ApiClients\Client\GitHub\Schema\Key|\ApiClients\Client\GitHub\Schema\SshSigningKey|\ApiClients\Client\GitHub\Schema\Operations\Users\ListAttestations\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Hovercard|\ApiClients\Client\GitHub\Schema\StarredRepository|\ApiClients\Client\GitHub\Schema\Repository; public function operations(): OperationsInterface; diff --git a/clients/GitHub/src/Internal/Hydrator/Operation/Enterprises/Enterprise/CodeSecurity/Configurations.php b/clients/GitHub/src/Internal/Hydrator/Operation/Enterprises/Enterprise/CodeSecurity/Configurations.php new file mode 100644 index 00000000000..040f7f06ef4 --- /dev/null +++ b/clients/GitHub/src/Internal/Hydrator/Operation/Enterprises/Enterprise/CodeSecurity/Configurations.php @@ -0,0 +1,1128 @@ + $className + * + * @return T + * + * @template T of object + */ + public function hydrateObject(string $className, array $payload): object + { + return match ($className) { + 'ApiClients\Client\GitHub\Schema\BasicError' => $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️BasicError($payload), + 'ApiClients\Client\GitHub\Schema\CodeSecurityConfiguration' => $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration($payload), + 'ApiClients\Client\GitHub\Schema\CodeSecurityConfiguration\DependencyGraphAutosubmitActionOptions' => $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration⚡️DependencyGraphAutosubmitActionOptions($payload), + 'ApiClients\Client\GitHub\Schema\CodeSecurityConfiguration\CodeScanningDefaultSetupOptions' => $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration⚡️CodeScanningDefaultSetupOptions($payload), + 'ApiClients\Client\GitHub\Schema\CodeSecurityConfiguration\SecretScanningDelegatedBypassOptions' => $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration⚡️SecretScanningDelegatedBypassOptions($payload), + 'ApiClients\Client\GitHub\Schema\ScimError' => $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️ScimError($payload), + default => throw UnableToHydrateObject::noHydrationDefined($className, $this->hydrationStack), + }; + } + + private function hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️BasicError(array $payload): BasicError + { + $properties = []; + $missingFields = []; + try { + $value = $payload['message'] ?? null; + + if ($value === null) { + $properties['message'] = null; + goto after_message; + } + + $properties['message'] = $value; + + after_message: + + $value = $payload['documentation_url'] ?? null; + + if ($value === null) { + $properties['documentationUrl'] = null; + goto after_documentationUrl; + } + + $properties['documentationUrl'] = $value; + + after_documentationUrl: + + $value = $payload['url'] ?? null; + + if ($value === null) { + $properties['url'] = null; + goto after_url; + } + + $properties['url'] = $value; + + after_url: + + $value = $payload['status'] ?? null; + + if ($value === null) { + $properties['status'] = null; + goto after_status; + } + + $properties['status'] = $value; + + after_status: + } catch (Throwable $exception) { + throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\BasicError', $exception, stack: $this->hydrationStack); + } + + if (count($missingFields) > 0) { + throw UnableToHydrateObject::dueToMissingFields(BasicError::class, $missingFields, stack: $this->hydrationStack); + } + + try { + return new BasicError(...$properties); + } catch (Throwable $exception) { + throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\BasicError', $exception, stack: $this->hydrationStack); + } + } + + private function hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration(array $payload): CodeSecurityConfiguration + { + $properties = []; + $missingFields = []; + try { + $value = $payload['id'] ?? null; + + if ($value === null) { + $properties['id'] = null; + goto after_id; + } + + $properties['id'] = $value; + + after_id: + + $value = $payload['name'] ?? null; + + if ($value === null) { + $properties['name'] = null; + goto after_name; + } + + $properties['name'] = $value; + + after_name: + + $value = $payload['target_type'] ?? null; + + if ($value === null) { + $properties['targetType'] = null; + goto after_targetType; + } + + $properties['targetType'] = $value; + + after_targetType: + + $value = $payload['description'] ?? null; + + if ($value === null) { + $properties['description'] = null; + goto after_description; + } + + $properties['description'] = $value; + + after_description: + + $value = $payload['advanced_security'] ?? null; + + if ($value === null) { + $properties['advancedSecurity'] = null; + goto after_advancedSecurity; + } + + $properties['advancedSecurity'] = $value; + + after_advancedSecurity: + + $value = $payload['dependency_graph'] ?? null; + + if ($value === null) { + $properties['dependencyGraph'] = null; + goto after_dependencyGraph; + } + + $properties['dependencyGraph'] = $value; + + after_dependencyGraph: + + $value = $payload['dependency_graph_autosubmit_action'] ?? null; + + if ($value === null) { + $properties['dependencyGraphAutosubmitAction'] = null; + goto after_dependencyGraphAutosubmitAction; + } + + $properties['dependencyGraphAutosubmitAction'] = $value; + + after_dependencyGraphAutosubmitAction: + + $value = $payload['dependency_graph_autosubmit_action_options'] ?? null; + + if ($value === null) { + $properties['dependencyGraphAutosubmitActionOptions'] = null; + goto after_dependencyGraphAutosubmitActionOptions; + } + + if (is_array($value)) { + try { + $this->hydrationStack[] = 'dependencyGraphAutosubmitActionOptions'; + $value = $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration⚡️DependencyGraphAutosubmitActionOptions($value); + } finally { + array_pop($this->hydrationStack); + } + } + + $properties['dependencyGraphAutosubmitActionOptions'] = $value; + + after_dependencyGraphAutosubmitActionOptions: + + $value = $payload['dependabot_alerts'] ?? null; + + if ($value === null) { + $properties['dependabotAlerts'] = null; + goto after_dependabotAlerts; + } + + $properties['dependabotAlerts'] = $value; + + after_dependabotAlerts: + + $value = $payload['dependabot_security_updates'] ?? null; + + if ($value === null) { + $properties['dependabotSecurityUpdates'] = null; + goto after_dependabotSecurityUpdates; + } + + $properties['dependabotSecurityUpdates'] = $value; + + after_dependabotSecurityUpdates: + + $value = $payload['code_scanning_default_setup'] ?? null; + + if ($value === null) { + $properties['codeScanningDefaultSetup'] = null; + goto after_codeScanningDefaultSetup; + } + + $properties['codeScanningDefaultSetup'] = $value; + + after_codeScanningDefaultSetup: + + $value = $payload['code_scanning_default_setup_options'] ?? null; + + if ($value === null) { + $properties['codeScanningDefaultSetupOptions'] = null; + goto after_codeScanningDefaultSetupOptions; + } + + if (is_array($value)) { + try { + $this->hydrationStack[] = 'codeScanningDefaultSetupOptions'; + $value = $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration⚡️CodeScanningDefaultSetupOptions($value); + } finally { + array_pop($this->hydrationStack); + } + } + + $properties['codeScanningDefaultSetupOptions'] = $value; + + after_codeScanningDefaultSetupOptions: + + $value = $payload['secret_scanning'] ?? null; + + if ($value === null) { + $properties['secretScanning'] = null; + goto after_secretScanning; + } + + $properties['secretScanning'] = $value; + + after_secretScanning: + + $value = $payload['secret_scanning_push_protection'] ?? null; + + if ($value === null) { + $properties['secretScanningPushProtection'] = null; + goto after_secretScanningPushProtection; + } + + $properties['secretScanningPushProtection'] = $value; + + after_secretScanningPushProtection: + + $value = $payload['secret_scanning_delegated_bypass'] ?? null; + + if ($value === null) { + $properties['secretScanningDelegatedBypass'] = null; + goto after_secretScanningDelegatedBypass; + } + + $properties['secretScanningDelegatedBypass'] = $value; + + after_secretScanningDelegatedBypass: + + $value = $payload['secret_scanning_delegated_bypass_options'] ?? null; + + if ($value === null) { + $properties['secretScanningDelegatedBypassOptions'] = null; + goto after_secretScanningDelegatedBypassOptions; + } + + if (is_array($value)) { + try { + $this->hydrationStack[] = 'secretScanningDelegatedBypassOptions'; + $value = $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration⚡️SecretScanningDelegatedBypassOptions($value); + } finally { + array_pop($this->hydrationStack); + } + } + + $properties['secretScanningDelegatedBypassOptions'] = $value; + + after_secretScanningDelegatedBypassOptions: + + $value = $payload['secret_scanning_validity_checks'] ?? null; + + if ($value === null) { + $properties['secretScanningValidityChecks'] = null; + goto after_secretScanningValidityChecks; + } + + $properties['secretScanningValidityChecks'] = $value; + + after_secretScanningValidityChecks: + + $value = $payload['secret_scanning_non_provider_patterns'] ?? null; + + if ($value === null) { + $properties['secretScanningNonProviderPatterns'] = null; + goto after_secretScanningNonProviderPatterns; + } + + $properties['secretScanningNonProviderPatterns'] = $value; + + after_secretScanningNonProviderPatterns: + + $value = $payload['private_vulnerability_reporting'] ?? null; + + if ($value === null) { + $properties['privateVulnerabilityReporting'] = null; + goto after_privateVulnerabilityReporting; + } + + $properties['privateVulnerabilityReporting'] = $value; + + after_privateVulnerabilityReporting: + + $value = $payload['enforcement'] ?? null; + + if ($value === null) { + $properties['enforcement'] = null; + goto after_enforcement; + } + + $properties['enforcement'] = $value; + + after_enforcement: + + $value = $payload['url'] ?? null; + + if ($value === null) { + $properties['url'] = null; + goto after_url; + } + + $properties['url'] = $value; + + after_url: + + $value = $payload['html_url'] ?? null; + + if ($value === null) { + $properties['htmlUrl'] = null; + goto after_htmlUrl; + } + + $properties['htmlUrl'] = $value; + + after_htmlUrl: + + $value = $payload['created_at'] ?? null; + + if ($value === null) { + $properties['createdAt'] = null; + goto after_createdAt; + } + + $properties['createdAt'] = $value; + + after_createdAt: + + $value = $payload['updated_at'] ?? null; + + if ($value === null) { + $properties['updatedAt'] = null; + goto after_updatedAt; + } + + $properties['updatedAt'] = $value; + + after_updatedAt: + } catch (Throwable $exception) { + throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\CodeSecurityConfiguration', $exception, stack: $this->hydrationStack); + } + + if (count($missingFields) > 0) { + throw UnableToHydrateObject::dueToMissingFields(CodeSecurityConfiguration::class, $missingFields, stack: $this->hydrationStack); + } + + try { + return new CodeSecurityConfiguration(...$properties); + } catch (Throwable $exception) { + throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\CodeSecurityConfiguration', $exception, stack: $this->hydrationStack); + } + } + + private function hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration⚡️DependencyGraphAutosubmitActionOptions(array $payload): DependencyGraphAutosubmitActionOptions + { + $properties = []; + $missingFields = []; + try { + $value = $payload['labeled_runners'] ?? null; + + if ($value === null) { + $properties['labeledRunners'] = null; + goto after_labeledRunners; + } + + $properties['labeledRunners'] = $value; + + after_labeledRunners: + } catch (Throwable $exception) { + throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\CodeSecurityConfiguration\DependencyGraphAutosubmitActionOptions', $exception, stack: $this->hydrationStack); + } + + if (count($missingFields) > 0) { + throw UnableToHydrateObject::dueToMissingFields(DependencyGraphAutosubmitActionOptions::class, $missingFields, stack: $this->hydrationStack); + } + + try { + return new DependencyGraphAutosubmitActionOptions(...$properties); + } catch (Throwable $exception) { + throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\CodeSecurityConfiguration\DependencyGraphAutosubmitActionOptions', $exception, stack: $this->hydrationStack); + } + } + + private function hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration⚡️CodeScanningDefaultSetupOptions(array $payload): CodeScanningDefaultSetupOptions + { + $properties = []; + $missingFields = []; + try { + $value = $payload['runner_type'] ?? null; + + if ($value === null) { + $properties['runnerType'] = null; + goto after_runnerType; + } + + $properties['runnerType'] = $value; + + after_runnerType: + + $value = $payload['runner_label'] ?? null; + + if ($value === null) { + $properties['runnerLabel'] = null; + goto after_runnerLabel; + } + + $properties['runnerLabel'] = $value; + + after_runnerLabel: + } catch (Throwable $exception) { + throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\CodeSecurityConfiguration\CodeScanningDefaultSetupOptions', $exception, stack: $this->hydrationStack); + } + + if (count($missingFields) > 0) { + throw UnableToHydrateObject::dueToMissingFields(CodeScanningDefaultSetupOptions::class, $missingFields, stack: $this->hydrationStack); + } + + try { + return new CodeScanningDefaultSetupOptions(...$properties); + } catch (Throwable $exception) { + throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\CodeSecurityConfiguration\CodeScanningDefaultSetupOptions', $exception, stack: $this->hydrationStack); + } + } + + private function hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration⚡️SecretScanningDelegatedBypassOptions(array $payload): SecretScanningDelegatedBypassOptions + { + $properties = []; + $missingFields = []; + try { + $value = $payload['reviewers'] ?? null; + + if ($value === null) { + $properties['reviewers'] = null; + goto after_reviewers; + } + + $properties['reviewers'] = $value; + + after_reviewers: + } catch (Throwable $exception) { + throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\CodeSecurityConfiguration\SecretScanningDelegatedBypassOptions', $exception, stack: $this->hydrationStack); + } + + if (count($missingFields) > 0) { + throw UnableToHydrateObject::dueToMissingFields(SecretScanningDelegatedBypassOptions::class, $missingFields, stack: $this->hydrationStack); + } + + try { + return new SecretScanningDelegatedBypassOptions(...$properties); + } catch (Throwable $exception) { + throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\CodeSecurityConfiguration\SecretScanningDelegatedBypassOptions', $exception, stack: $this->hydrationStack); + } + } + + private function hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️ScimError(array $payload): ScimError + { + $properties = []; + $missingFields = []; + try { + $value = $payload['message'] ?? null; + + if ($value === null) { + $properties['message'] = null; + goto after_message; + } + + $properties['message'] = $value; + + after_message: + + $value = $payload['documentation_url'] ?? null; + + if ($value === null) { + $properties['documentationUrl'] = null; + goto after_documentationUrl; + } + + $properties['documentationUrl'] = $value; + + after_documentationUrl: + + $value = $payload['detail'] ?? null; + + if ($value === null) { + $properties['detail'] = null; + goto after_detail; + } + + $properties['detail'] = $value; + + after_detail: + + $value = $payload['status'] ?? null; + + if ($value === null) { + $properties['status'] = null; + goto after_status; + } + + $properties['status'] = $value; + + after_status: + + $value = $payload['scim_type'] ?? null; + + if ($value === null) { + $properties['scimType'] = null; + goto after_scimType; + } + + $properties['scimType'] = $value; + + after_scimType: + + $value = $payload['schemas'] ?? null; + + if ($value === null) { + $properties['schemas'] = null; + goto after_schemas; + } + + $properties['schemas'] = $value; + + after_schemas: + } catch (Throwable $exception) { + throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\ScimError', $exception, stack: $this->hydrationStack); + } + + if (count($missingFields) > 0) { + throw UnableToHydrateObject::dueToMissingFields(ScimError::class, $missingFields, stack: $this->hydrationStack); + } + + try { + return new ScimError(...$properties); + } catch (Throwable $exception) { + throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\ScimError', $exception, stack: $this->hydrationStack); + } + } + + private function serializeViaTypeMap(string $accessor, object $object, array $payloadToTypeMap): array + { + foreach ($payloadToTypeMap as $payloadType => [$valueType, $method]) { + if (is_a($object, $valueType)) { + return [$accessor => $payloadType] + $this->{$method}($object); + } + } + + throw new LogicException('No type mapped for object of class: ' . $object::class); + } + + public function serializeObject(object $object): mixed + { + return $this->serializeObjectOfType($object, $object::class); + } + + /** + * @param T $object + * @param class-string $className + * + * @template T + */ + public function serializeObjectOfType(object $object, string $className): mixed + { + try { + return match ($className) { + 'array' => $this->serializeValuearray($object), + 'Ramsey\Uuid\UuidInterface' => $this->serializeValueRamsey⚡️Uuid⚡️UuidInterface($object), + 'DateTime' => $this->serializeValueDateTime($object), + 'DateTimeImmutable' => $this->serializeValueDateTimeImmutable($object), + 'DateTimeInterface' => $this->serializeValueDateTimeInterface($object), + 'ApiClients\Client\GitHub\Schema\BasicError' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️BasicError($object), + 'ApiClients\Client\GitHub\Schema\CodeSecurityConfiguration' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration($object), + 'ApiClients\Client\GitHub\Schema\CodeSecurityConfiguration\DependencyGraphAutosubmitActionOptions' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration⚡️DependencyGraphAutosubmitActionOptions($object), + 'ApiClients\Client\GitHub\Schema\CodeSecurityConfiguration\CodeScanningDefaultSetupOptions' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration⚡️CodeScanningDefaultSetupOptions($object), + 'ApiClients\Client\GitHub\Schema\CodeSecurityConfiguration\SecretScanningDelegatedBypassOptions' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration⚡️SecretScanningDelegatedBypassOptions($object), + 'ApiClients\Client\GitHub\Schema\ScimError' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️ScimError($object), + default => throw new LogicException("No serialization defined for $className"), + }; + } catch (Throwable $exception) { + throw UnableToSerializeObject::dueToError($className, $exception); + } + } + + private function serializeValuearray(mixed $value): mixed + { + static $serializer; + + if ($serializer === null) { + $serializer = new SerializeArrayItems(...[]); + } + + return $serializer->serialize($value, $this); + } + + private function serializeValueRamsey⚡️Uuid⚡️UuidInterface(mixed $value): mixed + { + static $serializer; + + if ($serializer === null) { + $serializer = new SerializeUuidToString(...[]); + } + + return $serializer->serialize($value, $this); + } + + private function serializeValueDateTime(mixed $value): mixed + { + static $serializer; + + if ($serializer === null) { + $serializer = new SerializeDateTime(...[]); + } + + return $serializer->serialize($value, $this); + } + + private function serializeValueDateTimeImmutable(mixed $value): mixed + { + static $serializer; + + if ($serializer === null) { + $serializer = new SerializeDateTime(...[]); + } + + return $serializer->serialize($value, $this); + } + + private function serializeValueDateTimeInterface(mixed $value): mixed + { + static $serializer; + + if ($serializer === null) { + $serializer = new SerializeDateTime(...[]); + } + + return $serializer->serialize($value, $this); + } + + private function serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️BasicError(mixed $object): mixed + { + assert($object instanceof BasicError); + $result = []; + + $message = $object->message; + + if ($message === null) { + goto after_message; + } + + after_message: $result['message'] = $message; + + $documentationUrl = $object->documentationUrl; + + if ($documentationUrl === null) { + goto after_documentationUrl; + } + + after_documentationUrl: $result['documentation_url'] = $documentationUrl; + + $url = $object->url; + + if ($url === null) { + goto after_url; + } + + after_url: $result['url'] = $url; + + $status = $object->status; + + if ($status === null) { + goto after_status; + } + + after_status: $result['status'] = $status; + + return $result; + } + + private function serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration(mixed $object): mixed + { + assert($object instanceof CodeSecurityConfiguration); + $result = []; + + $id = $object->id; + + if ($id === null) { + goto after_id; + } + + after_id: $result['id'] = $id; + + $name = $object->name; + + if ($name === null) { + goto after_name; + } + + after_name: $result['name'] = $name; + + $targetType = $object->targetType; + + if ($targetType === null) { + goto after_targetType; + } + + after_targetType: $result['target_type'] = $targetType; + + $description = $object->description; + + if ($description === null) { + goto after_description; + } + + after_description: $result['description'] = $description; + + $advancedSecurity = $object->advancedSecurity; + + if ($advancedSecurity === null) { + goto after_advancedSecurity; + } + + after_advancedSecurity: $result['advanced_security'] = $advancedSecurity; + + $dependencyGraph = $object->dependencyGraph; + + if ($dependencyGraph === null) { + goto after_dependencyGraph; + } + + after_dependencyGraph: $result['dependency_graph'] = $dependencyGraph; + + $dependencyGraphAutosubmitAction = $object->dependencyGraphAutosubmitAction; + + if ($dependencyGraphAutosubmitAction === null) { + goto after_dependencyGraphAutosubmitAction; + } + + after_dependencyGraphAutosubmitAction: $result['dependency_graph_autosubmit_action'] = $dependencyGraphAutosubmitAction; + + $dependencyGraphAutosubmitActionOptions = $object->dependencyGraphAutosubmitActionOptions; + + if ($dependencyGraphAutosubmitActionOptions === null) { + goto after_dependencyGraphAutosubmitActionOptions; + } + + $dependencyGraphAutosubmitActionOptions = $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration⚡️DependencyGraphAutosubmitActionOptions($dependencyGraphAutosubmitActionOptions); + after_dependencyGraphAutosubmitActionOptions: $result['dependency_graph_autosubmit_action_options'] = $dependencyGraphAutosubmitActionOptions; + + $dependabotAlerts = $object->dependabotAlerts; + + if ($dependabotAlerts === null) { + goto after_dependabotAlerts; + } + + after_dependabotAlerts: $result['dependabot_alerts'] = $dependabotAlerts; + + $dependabotSecurityUpdates = $object->dependabotSecurityUpdates; + + if ($dependabotSecurityUpdates === null) { + goto after_dependabotSecurityUpdates; + } + + after_dependabotSecurityUpdates: $result['dependabot_security_updates'] = $dependabotSecurityUpdates; + + $codeScanningDefaultSetup = $object->codeScanningDefaultSetup; + + if ($codeScanningDefaultSetup === null) { + goto after_codeScanningDefaultSetup; + } + + after_codeScanningDefaultSetup: $result['code_scanning_default_setup'] = $codeScanningDefaultSetup; + + $codeScanningDefaultSetupOptions = $object->codeScanningDefaultSetupOptions; + + if ($codeScanningDefaultSetupOptions === null) { + goto after_codeScanningDefaultSetupOptions; + } + + $codeScanningDefaultSetupOptions = $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration⚡️CodeScanningDefaultSetupOptions($codeScanningDefaultSetupOptions); + after_codeScanningDefaultSetupOptions: $result['code_scanning_default_setup_options'] = $codeScanningDefaultSetupOptions; + + $secretScanning = $object->secretScanning; + + if ($secretScanning === null) { + goto after_secretScanning; + } + + after_secretScanning: $result['secret_scanning'] = $secretScanning; + + $secretScanningPushProtection = $object->secretScanningPushProtection; + + if ($secretScanningPushProtection === null) { + goto after_secretScanningPushProtection; + } + + after_secretScanningPushProtection: $result['secret_scanning_push_protection'] = $secretScanningPushProtection; + + $secretScanningDelegatedBypass = $object->secretScanningDelegatedBypass; + + if ($secretScanningDelegatedBypass === null) { + goto after_secretScanningDelegatedBypass; + } + + after_secretScanningDelegatedBypass: $result['secret_scanning_delegated_bypass'] = $secretScanningDelegatedBypass; + + $secretScanningDelegatedBypassOptions = $object->secretScanningDelegatedBypassOptions; + + if ($secretScanningDelegatedBypassOptions === null) { + goto after_secretScanningDelegatedBypassOptions; + } + + $secretScanningDelegatedBypassOptions = $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration⚡️SecretScanningDelegatedBypassOptions($secretScanningDelegatedBypassOptions); + after_secretScanningDelegatedBypassOptions: $result['secret_scanning_delegated_bypass_options'] = $secretScanningDelegatedBypassOptions; + + $secretScanningValidityChecks = $object->secretScanningValidityChecks; + + if ($secretScanningValidityChecks === null) { + goto after_secretScanningValidityChecks; + } + + after_secretScanningValidityChecks: $result['secret_scanning_validity_checks'] = $secretScanningValidityChecks; + + $secretScanningNonProviderPatterns = $object->secretScanningNonProviderPatterns; + + if ($secretScanningNonProviderPatterns === null) { + goto after_secretScanningNonProviderPatterns; + } + + after_secretScanningNonProviderPatterns: $result['secret_scanning_non_provider_patterns'] = $secretScanningNonProviderPatterns; + + $privateVulnerabilityReporting = $object->privateVulnerabilityReporting; + + if ($privateVulnerabilityReporting === null) { + goto after_privateVulnerabilityReporting; + } + + after_privateVulnerabilityReporting: $result['private_vulnerability_reporting'] = $privateVulnerabilityReporting; + + $enforcement = $object->enforcement; + + if ($enforcement === null) { + goto after_enforcement; + } + + after_enforcement: $result['enforcement'] = $enforcement; + + $url = $object->url; + + if ($url === null) { + goto after_url; + } + + after_url: $result['url'] = $url; + + $htmlUrl = $object->htmlUrl; + + if ($htmlUrl === null) { + goto after_htmlUrl; + } + + after_htmlUrl: $result['html_url'] = $htmlUrl; + + $createdAt = $object->createdAt; + + if ($createdAt === null) { + goto after_createdAt; + } + + after_createdAt: $result['created_at'] = $createdAt; + + $updatedAt = $object->updatedAt; + + if ($updatedAt === null) { + goto after_updatedAt; + } + + after_updatedAt: $result['updated_at'] = $updatedAt; + + return $result; + } + + private function serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration⚡️DependencyGraphAutosubmitActionOptions(mixed $object): mixed + { + assert($object instanceof DependencyGraphAutosubmitActionOptions); + $result = []; + + $labeledRunners = $object->labeledRunners; + + if ($labeledRunners === null) { + goto after_labeledRunners; + } + + after_labeledRunners: $result['labeled_runners'] = $labeledRunners; + + return $result; + } + + private function serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration⚡️CodeScanningDefaultSetupOptions(mixed $object): mixed + { + assert($object instanceof CodeScanningDefaultSetupOptions); + $result = []; + + $runnerType = $object->runnerType; + + if ($runnerType === null) { + goto after_runnerType; + } + + after_runnerType: $result['runner_type'] = $runnerType; + + $runnerLabel = $object->runnerLabel; + + if ($runnerLabel === null) { + goto after_runnerLabel; + } + + after_runnerLabel: $result['runner_label'] = $runnerLabel; + + return $result; + } + + private function serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration⚡️SecretScanningDelegatedBypassOptions(mixed $object): mixed + { + assert($object instanceof SecretScanningDelegatedBypassOptions); + $result = []; + + $reviewers = $object->reviewers; + + if ($reviewers === null) { + goto after_reviewers; + } + + static $reviewersSerializer0; + + if ($reviewersSerializer0 === null) { + $reviewersSerializer0 = new SerializeArrayItems(...[]); + } + + $reviewers = $reviewersSerializer0->serialize($reviewers, $this); + after_reviewers: $result['reviewers'] = $reviewers; + + return $result; + } + + private function serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️ScimError(mixed $object): mixed + { + assert($object instanceof ScimError); + $result = []; + + $message = $object->message; + + if ($message === null) { + goto after_message; + } + + after_message: $result['message'] = $message; + + $documentationUrl = $object->documentationUrl; + + if ($documentationUrl === null) { + goto after_documentationUrl; + } + + after_documentationUrl: $result['documentation_url'] = $documentationUrl; + + $detail = $object->detail; + + if ($detail === null) { + goto after_detail; + } + + after_detail: $result['detail'] = $detail; + + $status = $object->status; + + if ($status === null) { + goto after_status; + } + + after_status: $result['status'] = $status; + + $scimType = $object->scimType; + + if ($scimType === null) { + goto after_scimType; + } + + after_scimType: $result['scim_type'] = $scimType; + + $schemas = $object->schemas; + + if ($schemas === null) { + goto after_schemas; + } + + static $schemasSerializer0; + + if ($schemasSerializer0 === null) { + $schemasSerializer0 = new SerializeArrayItems(...[]); + } + + $schemas = $schemasSerializer0->serialize($schemas, $this); + after_schemas: $result['schemas'] = $schemas; + + return $result; + } + + /** + * @param class-string $className + * @param iterable $payloads; + * + * @return IterableList + * + * @throws UnableToHydrateObject + * + * @template T + */ + public function hydrateObjects(string $className, iterable $payloads): IterableList + { + return new IterableList($this->doHydrateObjects($className, $payloads)); + } + + private function doHydrateObjects(string $className, iterable $payloads): Generator + { + foreach ($payloads as $index => $payload) { + yield $index => $this->hydrateObject($className, $payload); + } + } + + /** + * @param class-string $className + * @param iterable $payloads; + * + * @return IterableList + * + * @throws UnableToSerializeObject + * + * @template T + */ + public function serializeObjects(iterable $payloads): IterableList + { + return new IterableList($this->doSerializeObjects($payloads)); + } + + private function doSerializeObjects(iterable $objects): Generator + { + foreach ($objects as $index => $object) { + yield $index => $this->serializeObject($object); + } + } +} diff --git a/clients/GitHub/src/Internal/Hydrator/Operation/Enterprises/Enterprise/CodeSecurity/Configurations/ConfigurationId.php b/clients/GitHub/src/Internal/Hydrator/Operation/Enterprises/Enterprise/CodeSecurity/Configurations/ConfigurationId.php new file mode 100644 index 00000000000..cc6e7391990 --- /dev/null +++ b/clients/GitHub/src/Internal/Hydrator/Operation/Enterprises/Enterprise/CodeSecurity/Configurations/ConfigurationId.php @@ -0,0 +1,1128 @@ + $className + * + * @return T + * + * @template T of object + */ + public function hydrateObject(string $className, array $payload): object + { + return match ($className) { + 'ApiClients\Client\GitHub\Schema\CodeSecurityConfiguration' => $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration($payload), + 'ApiClients\Client\GitHub\Schema\CodeSecurityConfiguration\DependencyGraphAutosubmitActionOptions' => $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration⚡️DependencyGraphAutosubmitActionOptions($payload), + 'ApiClients\Client\GitHub\Schema\CodeSecurityConfiguration\CodeScanningDefaultSetupOptions' => $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration⚡️CodeScanningDefaultSetupOptions($payload), + 'ApiClients\Client\GitHub\Schema\CodeSecurityConfiguration\SecretScanningDelegatedBypassOptions' => $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration⚡️SecretScanningDelegatedBypassOptions($payload), + 'ApiClients\Client\GitHub\Schema\BasicError' => $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️BasicError($payload), + 'ApiClients\Client\GitHub\Schema\ScimError' => $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️ScimError($payload), + default => throw UnableToHydrateObject::noHydrationDefined($className, $this->hydrationStack), + }; + } + + private function hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration(array $payload): CodeSecurityConfiguration + { + $properties = []; + $missingFields = []; + try { + $value = $payload['id'] ?? null; + + if ($value === null) { + $properties['id'] = null; + goto after_id; + } + + $properties['id'] = $value; + + after_id: + + $value = $payload['name'] ?? null; + + if ($value === null) { + $properties['name'] = null; + goto after_name; + } + + $properties['name'] = $value; + + after_name: + + $value = $payload['target_type'] ?? null; + + if ($value === null) { + $properties['targetType'] = null; + goto after_targetType; + } + + $properties['targetType'] = $value; + + after_targetType: + + $value = $payload['description'] ?? null; + + if ($value === null) { + $properties['description'] = null; + goto after_description; + } + + $properties['description'] = $value; + + after_description: + + $value = $payload['advanced_security'] ?? null; + + if ($value === null) { + $properties['advancedSecurity'] = null; + goto after_advancedSecurity; + } + + $properties['advancedSecurity'] = $value; + + after_advancedSecurity: + + $value = $payload['dependency_graph'] ?? null; + + if ($value === null) { + $properties['dependencyGraph'] = null; + goto after_dependencyGraph; + } + + $properties['dependencyGraph'] = $value; + + after_dependencyGraph: + + $value = $payload['dependency_graph_autosubmit_action'] ?? null; + + if ($value === null) { + $properties['dependencyGraphAutosubmitAction'] = null; + goto after_dependencyGraphAutosubmitAction; + } + + $properties['dependencyGraphAutosubmitAction'] = $value; + + after_dependencyGraphAutosubmitAction: + + $value = $payload['dependency_graph_autosubmit_action_options'] ?? null; + + if ($value === null) { + $properties['dependencyGraphAutosubmitActionOptions'] = null; + goto after_dependencyGraphAutosubmitActionOptions; + } + + if (is_array($value)) { + try { + $this->hydrationStack[] = 'dependencyGraphAutosubmitActionOptions'; + $value = $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration⚡️DependencyGraphAutosubmitActionOptions($value); + } finally { + array_pop($this->hydrationStack); + } + } + + $properties['dependencyGraphAutosubmitActionOptions'] = $value; + + after_dependencyGraphAutosubmitActionOptions: + + $value = $payload['dependabot_alerts'] ?? null; + + if ($value === null) { + $properties['dependabotAlerts'] = null; + goto after_dependabotAlerts; + } + + $properties['dependabotAlerts'] = $value; + + after_dependabotAlerts: + + $value = $payload['dependabot_security_updates'] ?? null; + + if ($value === null) { + $properties['dependabotSecurityUpdates'] = null; + goto after_dependabotSecurityUpdates; + } + + $properties['dependabotSecurityUpdates'] = $value; + + after_dependabotSecurityUpdates: + + $value = $payload['code_scanning_default_setup'] ?? null; + + if ($value === null) { + $properties['codeScanningDefaultSetup'] = null; + goto after_codeScanningDefaultSetup; + } + + $properties['codeScanningDefaultSetup'] = $value; + + after_codeScanningDefaultSetup: + + $value = $payload['code_scanning_default_setup_options'] ?? null; + + if ($value === null) { + $properties['codeScanningDefaultSetupOptions'] = null; + goto after_codeScanningDefaultSetupOptions; + } + + if (is_array($value)) { + try { + $this->hydrationStack[] = 'codeScanningDefaultSetupOptions'; + $value = $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration⚡️CodeScanningDefaultSetupOptions($value); + } finally { + array_pop($this->hydrationStack); + } + } + + $properties['codeScanningDefaultSetupOptions'] = $value; + + after_codeScanningDefaultSetupOptions: + + $value = $payload['secret_scanning'] ?? null; + + if ($value === null) { + $properties['secretScanning'] = null; + goto after_secretScanning; + } + + $properties['secretScanning'] = $value; + + after_secretScanning: + + $value = $payload['secret_scanning_push_protection'] ?? null; + + if ($value === null) { + $properties['secretScanningPushProtection'] = null; + goto after_secretScanningPushProtection; + } + + $properties['secretScanningPushProtection'] = $value; + + after_secretScanningPushProtection: + + $value = $payload['secret_scanning_delegated_bypass'] ?? null; + + if ($value === null) { + $properties['secretScanningDelegatedBypass'] = null; + goto after_secretScanningDelegatedBypass; + } + + $properties['secretScanningDelegatedBypass'] = $value; + + after_secretScanningDelegatedBypass: + + $value = $payload['secret_scanning_delegated_bypass_options'] ?? null; + + if ($value === null) { + $properties['secretScanningDelegatedBypassOptions'] = null; + goto after_secretScanningDelegatedBypassOptions; + } + + if (is_array($value)) { + try { + $this->hydrationStack[] = 'secretScanningDelegatedBypassOptions'; + $value = $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration⚡️SecretScanningDelegatedBypassOptions($value); + } finally { + array_pop($this->hydrationStack); + } + } + + $properties['secretScanningDelegatedBypassOptions'] = $value; + + after_secretScanningDelegatedBypassOptions: + + $value = $payload['secret_scanning_validity_checks'] ?? null; + + if ($value === null) { + $properties['secretScanningValidityChecks'] = null; + goto after_secretScanningValidityChecks; + } + + $properties['secretScanningValidityChecks'] = $value; + + after_secretScanningValidityChecks: + + $value = $payload['secret_scanning_non_provider_patterns'] ?? null; + + if ($value === null) { + $properties['secretScanningNonProviderPatterns'] = null; + goto after_secretScanningNonProviderPatterns; + } + + $properties['secretScanningNonProviderPatterns'] = $value; + + after_secretScanningNonProviderPatterns: + + $value = $payload['private_vulnerability_reporting'] ?? null; + + if ($value === null) { + $properties['privateVulnerabilityReporting'] = null; + goto after_privateVulnerabilityReporting; + } + + $properties['privateVulnerabilityReporting'] = $value; + + after_privateVulnerabilityReporting: + + $value = $payload['enforcement'] ?? null; + + if ($value === null) { + $properties['enforcement'] = null; + goto after_enforcement; + } + + $properties['enforcement'] = $value; + + after_enforcement: + + $value = $payload['url'] ?? null; + + if ($value === null) { + $properties['url'] = null; + goto after_url; + } + + $properties['url'] = $value; + + after_url: + + $value = $payload['html_url'] ?? null; + + if ($value === null) { + $properties['htmlUrl'] = null; + goto after_htmlUrl; + } + + $properties['htmlUrl'] = $value; + + after_htmlUrl: + + $value = $payload['created_at'] ?? null; + + if ($value === null) { + $properties['createdAt'] = null; + goto after_createdAt; + } + + $properties['createdAt'] = $value; + + after_createdAt: + + $value = $payload['updated_at'] ?? null; + + if ($value === null) { + $properties['updatedAt'] = null; + goto after_updatedAt; + } + + $properties['updatedAt'] = $value; + + after_updatedAt: + } catch (Throwable $exception) { + throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\CodeSecurityConfiguration', $exception, stack: $this->hydrationStack); + } + + if (count($missingFields) > 0) { + throw UnableToHydrateObject::dueToMissingFields(CodeSecurityConfiguration::class, $missingFields, stack: $this->hydrationStack); + } + + try { + return new CodeSecurityConfiguration(...$properties); + } catch (Throwable $exception) { + throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\CodeSecurityConfiguration', $exception, stack: $this->hydrationStack); + } + } + + private function hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration⚡️DependencyGraphAutosubmitActionOptions(array $payload): DependencyGraphAutosubmitActionOptions + { + $properties = []; + $missingFields = []; + try { + $value = $payload['labeled_runners'] ?? null; + + if ($value === null) { + $properties['labeledRunners'] = null; + goto after_labeledRunners; + } + + $properties['labeledRunners'] = $value; + + after_labeledRunners: + } catch (Throwable $exception) { + throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\CodeSecurityConfiguration\DependencyGraphAutosubmitActionOptions', $exception, stack: $this->hydrationStack); + } + + if (count($missingFields) > 0) { + throw UnableToHydrateObject::dueToMissingFields(DependencyGraphAutosubmitActionOptions::class, $missingFields, stack: $this->hydrationStack); + } + + try { + return new DependencyGraphAutosubmitActionOptions(...$properties); + } catch (Throwable $exception) { + throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\CodeSecurityConfiguration\DependencyGraphAutosubmitActionOptions', $exception, stack: $this->hydrationStack); + } + } + + private function hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration⚡️CodeScanningDefaultSetupOptions(array $payload): CodeScanningDefaultSetupOptions + { + $properties = []; + $missingFields = []; + try { + $value = $payload['runner_type'] ?? null; + + if ($value === null) { + $properties['runnerType'] = null; + goto after_runnerType; + } + + $properties['runnerType'] = $value; + + after_runnerType: + + $value = $payload['runner_label'] ?? null; + + if ($value === null) { + $properties['runnerLabel'] = null; + goto after_runnerLabel; + } + + $properties['runnerLabel'] = $value; + + after_runnerLabel: + } catch (Throwable $exception) { + throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\CodeSecurityConfiguration\CodeScanningDefaultSetupOptions', $exception, stack: $this->hydrationStack); + } + + if (count($missingFields) > 0) { + throw UnableToHydrateObject::dueToMissingFields(CodeScanningDefaultSetupOptions::class, $missingFields, stack: $this->hydrationStack); + } + + try { + return new CodeScanningDefaultSetupOptions(...$properties); + } catch (Throwable $exception) { + throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\CodeSecurityConfiguration\CodeScanningDefaultSetupOptions', $exception, stack: $this->hydrationStack); + } + } + + private function hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration⚡️SecretScanningDelegatedBypassOptions(array $payload): SecretScanningDelegatedBypassOptions + { + $properties = []; + $missingFields = []; + try { + $value = $payload['reviewers'] ?? null; + + if ($value === null) { + $properties['reviewers'] = null; + goto after_reviewers; + } + + $properties['reviewers'] = $value; + + after_reviewers: + } catch (Throwable $exception) { + throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\CodeSecurityConfiguration\SecretScanningDelegatedBypassOptions', $exception, stack: $this->hydrationStack); + } + + if (count($missingFields) > 0) { + throw UnableToHydrateObject::dueToMissingFields(SecretScanningDelegatedBypassOptions::class, $missingFields, stack: $this->hydrationStack); + } + + try { + return new SecretScanningDelegatedBypassOptions(...$properties); + } catch (Throwable $exception) { + throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\CodeSecurityConfiguration\SecretScanningDelegatedBypassOptions', $exception, stack: $this->hydrationStack); + } + } + + private function hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️BasicError(array $payload): BasicError + { + $properties = []; + $missingFields = []; + try { + $value = $payload['message'] ?? null; + + if ($value === null) { + $properties['message'] = null; + goto after_message; + } + + $properties['message'] = $value; + + after_message: + + $value = $payload['documentation_url'] ?? null; + + if ($value === null) { + $properties['documentationUrl'] = null; + goto after_documentationUrl; + } + + $properties['documentationUrl'] = $value; + + after_documentationUrl: + + $value = $payload['url'] ?? null; + + if ($value === null) { + $properties['url'] = null; + goto after_url; + } + + $properties['url'] = $value; + + after_url: + + $value = $payload['status'] ?? null; + + if ($value === null) { + $properties['status'] = null; + goto after_status; + } + + $properties['status'] = $value; + + after_status: + } catch (Throwable $exception) { + throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\BasicError', $exception, stack: $this->hydrationStack); + } + + if (count($missingFields) > 0) { + throw UnableToHydrateObject::dueToMissingFields(BasicError::class, $missingFields, stack: $this->hydrationStack); + } + + try { + return new BasicError(...$properties); + } catch (Throwable $exception) { + throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\BasicError', $exception, stack: $this->hydrationStack); + } + } + + private function hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️ScimError(array $payload): ScimError + { + $properties = []; + $missingFields = []; + try { + $value = $payload['message'] ?? null; + + if ($value === null) { + $properties['message'] = null; + goto after_message; + } + + $properties['message'] = $value; + + after_message: + + $value = $payload['documentation_url'] ?? null; + + if ($value === null) { + $properties['documentationUrl'] = null; + goto after_documentationUrl; + } + + $properties['documentationUrl'] = $value; + + after_documentationUrl: + + $value = $payload['detail'] ?? null; + + if ($value === null) { + $properties['detail'] = null; + goto after_detail; + } + + $properties['detail'] = $value; + + after_detail: + + $value = $payload['status'] ?? null; + + if ($value === null) { + $properties['status'] = null; + goto after_status; + } + + $properties['status'] = $value; + + after_status: + + $value = $payload['scim_type'] ?? null; + + if ($value === null) { + $properties['scimType'] = null; + goto after_scimType; + } + + $properties['scimType'] = $value; + + after_scimType: + + $value = $payload['schemas'] ?? null; + + if ($value === null) { + $properties['schemas'] = null; + goto after_schemas; + } + + $properties['schemas'] = $value; + + after_schemas: + } catch (Throwable $exception) { + throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\ScimError', $exception, stack: $this->hydrationStack); + } + + if (count($missingFields) > 0) { + throw UnableToHydrateObject::dueToMissingFields(ScimError::class, $missingFields, stack: $this->hydrationStack); + } + + try { + return new ScimError(...$properties); + } catch (Throwable $exception) { + throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\ScimError', $exception, stack: $this->hydrationStack); + } + } + + private function serializeViaTypeMap(string $accessor, object $object, array $payloadToTypeMap): array + { + foreach ($payloadToTypeMap as $payloadType => [$valueType, $method]) { + if (is_a($object, $valueType)) { + return [$accessor => $payloadType] + $this->{$method}($object); + } + } + + throw new LogicException('No type mapped for object of class: ' . $object::class); + } + + public function serializeObject(object $object): mixed + { + return $this->serializeObjectOfType($object, $object::class); + } + + /** + * @param T $object + * @param class-string $className + * + * @template T + */ + public function serializeObjectOfType(object $object, string $className): mixed + { + try { + return match ($className) { + 'array' => $this->serializeValuearray($object), + 'Ramsey\Uuid\UuidInterface' => $this->serializeValueRamsey⚡️Uuid⚡️UuidInterface($object), + 'DateTime' => $this->serializeValueDateTime($object), + 'DateTimeImmutable' => $this->serializeValueDateTimeImmutable($object), + 'DateTimeInterface' => $this->serializeValueDateTimeInterface($object), + 'ApiClients\Client\GitHub\Schema\CodeSecurityConfiguration' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration($object), + 'ApiClients\Client\GitHub\Schema\CodeSecurityConfiguration\DependencyGraphAutosubmitActionOptions' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration⚡️DependencyGraphAutosubmitActionOptions($object), + 'ApiClients\Client\GitHub\Schema\CodeSecurityConfiguration\CodeScanningDefaultSetupOptions' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration⚡️CodeScanningDefaultSetupOptions($object), + 'ApiClients\Client\GitHub\Schema\CodeSecurityConfiguration\SecretScanningDelegatedBypassOptions' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration⚡️SecretScanningDelegatedBypassOptions($object), + 'ApiClients\Client\GitHub\Schema\BasicError' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️BasicError($object), + 'ApiClients\Client\GitHub\Schema\ScimError' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️ScimError($object), + default => throw new LogicException("No serialization defined for $className"), + }; + } catch (Throwable $exception) { + throw UnableToSerializeObject::dueToError($className, $exception); + } + } + + private function serializeValuearray(mixed $value): mixed + { + static $serializer; + + if ($serializer === null) { + $serializer = new SerializeArrayItems(...[]); + } + + return $serializer->serialize($value, $this); + } + + private function serializeValueRamsey⚡️Uuid⚡️UuidInterface(mixed $value): mixed + { + static $serializer; + + if ($serializer === null) { + $serializer = new SerializeUuidToString(...[]); + } + + return $serializer->serialize($value, $this); + } + + private function serializeValueDateTime(mixed $value): mixed + { + static $serializer; + + if ($serializer === null) { + $serializer = new SerializeDateTime(...[]); + } + + return $serializer->serialize($value, $this); + } + + private function serializeValueDateTimeImmutable(mixed $value): mixed + { + static $serializer; + + if ($serializer === null) { + $serializer = new SerializeDateTime(...[]); + } + + return $serializer->serialize($value, $this); + } + + private function serializeValueDateTimeInterface(mixed $value): mixed + { + static $serializer; + + if ($serializer === null) { + $serializer = new SerializeDateTime(...[]); + } + + return $serializer->serialize($value, $this); + } + + private function serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration(mixed $object): mixed + { + assert($object instanceof CodeSecurityConfiguration); + $result = []; + + $id = $object->id; + + if ($id === null) { + goto after_id; + } + + after_id: $result['id'] = $id; + + $name = $object->name; + + if ($name === null) { + goto after_name; + } + + after_name: $result['name'] = $name; + + $targetType = $object->targetType; + + if ($targetType === null) { + goto after_targetType; + } + + after_targetType: $result['target_type'] = $targetType; + + $description = $object->description; + + if ($description === null) { + goto after_description; + } + + after_description: $result['description'] = $description; + + $advancedSecurity = $object->advancedSecurity; + + if ($advancedSecurity === null) { + goto after_advancedSecurity; + } + + after_advancedSecurity: $result['advanced_security'] = $advancedSecurity; + + $dependencyGraph = $object->dependencyGraph; + + if ($dependencyGraph === null) { + goto after_dependencyGraph; + } + + after_dependencyGraph: $result['dependency_graph'] = $dependencyGraph; + + $dependencyGraphAutosubmitAction = $object->dependencyGraphAutosubmitAction; + + if ($dependencyGraphAutosubmitAction === null) { + goto after_dependencyGraphAutosubmitAction; + } + + after_dependencyGraphAutosubmitAction: $result['dependency_graph_autosubmit_action'] = $dependencyGraphAutosubmitAction; + + $dependencyGraphAutosubmitActionOptions = $object->dependencyGraphAutosubmitActionOptions; + + if ($dependencyGraphAutosubmitActionOptions === null) { + goto after_dependencyGraphAutosubmitActionOptions; + } + + $dependencyGraphAutosubmitActionOptions = $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration⚡️DependencyGraphAutosubmitActionOptions($dependencyGraphAutosubmitActionOptions); + after_dependencyGraphAutosubmitActionOptions: $result['dependency_graph_autosubmit_action_options'] = $dependencyGraphAutosubmitActionOptions; + + $dependabotAlerts = $object->dependabotAlerts; + + if ($dependabotAlerts === null) { + goto after_dependabotAlerts; + } + + after_dependabotAlerts: $result['dependabot_alerts'] = $dependabotAlerts; + + $dependabotSecurityUpdates = $object->dependabotSecurityUpdates; + + if ($dependabotSecurityUpdates === null) { + goto after_dependabotSecurityUpdates; + } + + after_dependabotSecurityUpdates: $result['dependabot_security_updates'] = $dependabotSecurityUpdates; + + $codeScanningDefaultSetup = $object->codeScanningDefaultSetup; + + if ($codeScanningDefaultSetup === null) { + goto after_codeScanningDefaultSetup; + } + + after_codeScanningDefaultSetup: $result['code_scanning_default_setup'] = $codeScanningDefaultSetup; + + $codeScanningDefaultSetupOptions = $object->codeScanningDefaultSetupOptions; + + if ($codeScanningDefaultSetupOptions === null) { + goto after_codeScanningDefaultSetupOptions; + } + + $codeScanningDefaultSetupOptions = $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration⚡️CodeScanningDefaultSetupOptions($codeScanningDefaultSetupOptions); + after_codeScanningDefaultSetupOptions: $result['code_scanning_default_setup_options'] = $codeScanningDefaultSetupOptions; + + $secretScanning = $object->secretScanning; + + if ($secretScanning === null) { + goto after_secretScanning; + } + + after_secretScanning: $result['secret_scanning'] = $secretScanning; + + $secretScanningPushProtection = $object->secretScanningPushProtection; + + if ($secretScanningPushProtection === null) { + goto after_secretScanningPushProtection; + } + + after_secretScanningPushProtection: $result['secret_scanning_push_protection'] = $secretScanningPushProtection; + + $secretScanningDelegatedBypass = $object->secretScanningDelegatedBypass; + + if ($secretScanningDelegatedBypass === null) { + goto after_secretScanningDelegatedBypass; + } + + after_secretScanningDelegatedBypass: $result['secret_scanning_delegated_bypass'] = $secretScanningDelegatedBypass; + + $secretScanningDelegatedBypassOptions = $object->secretScanningDelegatedBypassOptions; + + if ($secretScanningDelegatedBypassOptions === null) { + goto after_secretScanningDelegatedBypassOptions; + } + + $secretScanningDelegatedBypassOptions = $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration⚡️SecretScanningDelegatedBypassOptions($secretScanningDelegatedBypassOptions); + after_secretScanningDelegatedBypassOptions: $result['secret_scanning_delegated_bypass_options'] = $secretScanningDelegatedBypassOptions; + + $secretScanningValidityChecks = $object->secretScanningValidityChecks; + + if ($secretScanningValidityChecks === null) { + goto after_secretScanningValidityChecks; + } + + after_secretScanningValidityChecks: $result['secret_scanning_validity_checks'] = $secretScanningValidityChecks; + + $secretScanningNonProviderPatterns = $object->secretScanningNonProviderPatterns; + + if ($secretScanningNonProviderPatterns === null) { + goto after_secretScanningNonProviderPatterns; + } + + after_secretScanningNonProviderPatterns: $result['secret_scanning_non_provider_patterns'] = $secretScanningNonProviderPatterns; + + $privateVulnerabilityReporting = $object->privateVulnerabilityReporting; + + if ($privateVulnerabilityReporting === null) { + goto after_privateVulnerabilityReporting; + } + + after_privateVulnerabilityReporting: $result['private_vulnerability_reporting'] = $privateVulnerabilityReporting; + + $enforcement = $object->enforcement; + + if ($enforcement === null) { + goto after_enforcement; + } + + after_enforcement: $result['enforcement'] = $enforcement; + + $url = $object->url; + + if ($url === null) { + goto after_url; + } + + after_url: $result['url'] = $url; + + $htmlUrl = $object->htmlUrl; + + if ($htmlUrl === null) { + goto after_htmlUrl; + } + + after_htmlUrl: $result['html_url'] = $htmlUrl; + + $createdAt = $object->createdAt; + + if ($createdAt === null) { + goto after_createdAt; + } + + after_createdAt: $result['created_at'] = $createdAt; + + $updatedAt = $object->updatedAt; + + if ($updatedAt === null) { + goto after_updatedAt; + } + + after_updatedAt: $result['updated_at'] = $updatedAt; + + return $result; + } + + private function serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration⚡️DependencyGraphAutosubmitActionOptions(mixed $object): mixed + { + assert($object instanceof DependencyGraphAutosubmitActionOptions); + $result = []; + + $labeledRunners = $object->labeledRunners; + + if ($labeledRunners === null) { + goto after_labeledRunners; + } + + after_labeledRunners: $result['labeled_runners'] = $labeledRunners; + + return $result; + } + + private function serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration⚡️CodeScanningDefaultSetupOptions(mixed $object): mixed + { + assert($object instanceof CodeScanningDefaultSetupOptions); + $result = []; + + $runnerType = $object->runnerType; + + if ($runnerType === null) { + goto after_runnerType; + } + + after_runnerType: $result['runner_type'] = $runnerType; + + $runnerLabel = $object->runnerLabel; + + if ($runnerLabel === null) { + goto after_runnerLabel; + } + + after_runnerLabel: $result['runner_label'] = $runnerLabel; + + return $result; + } + + private function serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration⚡️SecretScanningDelegatedBypassOptions(mixed $object): mixed + { + assert($object instanceof SecretScanningDelegatedBypassOptions); + $result = []; + + $reviewers = $object->reviewers; + + if ($reviewers === null) { + goto after_reviewers; + } + + static $reviewersSerializer0; + + if ($reviewersSerializer0 === null) { + $reviewersSerializer0 = new SerializeArrayItems(...[]); + } + + $reviewers = $reviewersSerializer0->serialize($reviewers, $this); + after_reviewers: $result['reviewers'] = $reviewers; + + return $result; + } + + private function serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️BasicError(mixed $object): mixed + { + assert($object instanceof BasicError); + $result = []; + + $message = $object->message; + + if ($message === null) { + goto after_message; + } + + after_message: $result['message'] = $message; + + $documentationUrl = $object->documentationUrl; + + if ($documentationUrl === null) { + goto after_documentationUrl; + } + + after_documentationUrl: $result['documentation_url'] = $documentationUrl; + + $url = $object->url; + + if ($url === null) { + goto after_url; + } + + after_url: $result['url'] = $url; + + $status = $object->status; + + if ($status === null) { + goto after_status; + } + + after_status: $result['status'] = $status; + + return $result; + } + + private function serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️ScimError(mixed $object): mixed + { + assert($object instanceof ScimError); + $result = []; + + $message = $object->message; + + if ($message === null) { + goto after_message; + } + + after_message: $result['message'] = $message; + + $documentationUrl = $object->documentationUrl; + + if ($documentationUrl === null) { + goto after_documentationUrl; + } + + after_documentationUrl: $result['documentation_url'] = $documentationUrl; + + $detail = $object->detail; + + if ($detail === null) { + goto after_detail; + } + + after_detail: $result['detail'] = $detail; + + $status = $object->status; + + if ($status === null) { + goto after_status; + } + + after_status: $result['status'] = $status; + + $scimType = $object->scimType; + + if ($scimType === null) { + goto after_scimType; + } + + after_scimType: $result['scim_type'] = $scimType; + + $schemas = $object->schemas; + + if ($schemas === null) { + goto after_schemas; + } + + static $schemasSerializer0; + + if ($schemasSerializer0 === null) { + $schemasSerializer0 = new SerializeArrayItems(...[]); + } + + $schemas = $schemasSerializer0->serialize($schemas, $this); + after_schemas: $result['schemas'] = $schemas; + + return $result; + } + + /** + * @param class-string $className + * @param iterable $payloads; + * + * @return IterableList + * + * @throws UnableToHydrateObject + * + * @template T + */ + public function hydrateObjects(string $className, iterable $payloads): IterableList + { + return new IterableList($this->doHydrateObjects($className, $payloads)); + } + + private function doHydrateObjects(string $className, iterable $payloads): Generator + { + foreach ($payloads as $index => $payload) { + yield $index => $this->hydrateObject($className, $payload); + } + } + + /** + * @param class-string $className + * @param iterable $payloads; + * + * @return IterableList + * + * @throws UnableToSerializeObject + * + * @template T + */ + public function serializeObjects(iterable $payloads): IterableList + { + return new IterableList($this->doSerializeObjects($payloads)); + } + + private function doSerializeObjects(iterable $objects): Generator + { + foreach ($objects as $index => $object) { + yield $index => $this->serializeObject($object); + } + } +} diff --git a/clients/GitHub/src/Internal/Hydrator/Operation/Enterprises/Enterprise/CodeSecurity/Configurations/ConfigurationId/Attach.php b/clients/GitHub/src/Internal/Hydrator/Operation/Enterprises/Enterprise/CodeSecurity/Configurations/ConfigurationId/Attach.php new file mode 100644 index 00000000000..fcdae7857de --- /dev/null +++ b/clients/GitHub/src/Internal/Hydrator/Operation/Enterprises/Enterprise/CodeSecurity/Configurations/ConfigurationId/Attach.php @@ -0,0 +1,286 @@ + $className + * + * @return T + * + * @template T of object + */ + public function hydrateObject(string $className, array $payload): object + { + return match ($className) { + 'ApiClients\Client\GitHub\Schema\BasicError' => $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️BasicError($payload), + default => throw UnableToHydrateObject::noHydrationDefined($className, $this->hydrationStack), + }; + } + + private function hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️BasicError(array $payload): BasicError + { + $properties = []; + $missingFields = []; + try { + $value = $payload['message'] ?? null; + + if ($value === null) { + $properties['message'] = null; + goto after_message; + } + + $properties['message'] = $value; + + after_message: + + $value = $payload['documentation_url'] ?? null; + + if ($value === null) { + $properties['documentationUrl'] = null; + goto after_documentationUrl; + } + + $properties['documentationUrl'] = $value; + + after_documentationUrl: + + $value = $payload['url'] ?? null; + + if ($value === null) { + $properties['url'] = null; + goto after_url; + } + + $properties['url'] = $value; + + after_url: + + $value = $payload['status'] ?? null; + + if ($value === null) { + $properties['status'] = null; + goto after_status; + } + + $properties['status'] = $value; + + after_status: + } catch (Throwable $exception) { + throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\BasicError', $exception, stack: $this->hydrationStack); + } + + if (count($missingFields) > 0) { + throw UnableToHydrateObject::dueToMissingFields(BasicError::class, $missingFields, stack: $this->hydrationStack); + } + + try { + return new BasicError(...$properties); + } catch (Throwable $exception) { + throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\BasicError', $exception, stack: $this->hydrationStack); + } + } + + private function serializeViaTypeMap(string $accessor, object $object, array $payloadToTypeMap): array + { + foreach ($payloadToTypeMap as $payloadType => [$valueType, $method]) { + if (is_a($object, $valueType)) { + return [$accessor => $payloadType] + $this->{$method}($object); + } + } + + throw new LogicException('No type mapped for object of class: ' . $object::class); + } + + public function serializeObject(object $object): mixed + { + return $this->serializeObjectOfType($object, $object::class); + } + + /** + * @param T $object + * @param class-string $className + * + * @template T + */ + public function serializeObjectOfType(object $object, string $className): mixed + { + try { + return match ($className) { + 'array' => $this->serializeValuearray($object), + 'Ramsey\Uuid\UuidInterface' => $this->serializeValueRamsey⚡️Uuid⚡️UuidInterface($object), + 'DateTime' => $this->serializeValueDateTime($object), + 'DateTimeImmutable' => $this->serializeValueDateTimeImmutable($object), + 'DateTimeInterface' => $this->serializeValueDateTimeInterface($object), + 'ApiClients\Client\GitHub\Schema\BasicError' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️BasicError($object), + default => throw new LogicException("No serialization defined for $className"), + }; + } catch (Throwable $exception) { + throw UnableToSerializeObject::dueToError($className, $exception); + } + } + + private function serializeValuearray(mixed $value): mixed + { + static $serializer; + + if ($serializer === null) { + $serializer = new SerializeArrayItems(...[]); + } + + return $serializer->serialize($value, $this); + } + + private function serializeValueRamsey⚡️Uuid⚡️UuidInterface(mixed $value): mixed + { + static $serializer; + + if ($serializer === null) { + $serializer = new SerializeUuidToString(...[]); + } + + return $serializer->serialize($value, $this); + } + + private function serializeValueDateTime(mixed $value): mixed + { + static $serializer; + + if ($serializer === null) { + $serializer = new SerializeDateTime(...[]); + } + + return $serializer->serialize($value, $this); + } + + private function serializeValueDateTimeImmutable(mixed $value): mixed + { + static $serializer; + + if ($serializer === null) { + $serializer = new SerializeDateTime(...[]); + } + + return $serializer->serialize($value, $this); + } + + private function serializeValueDateTimeInterface(mixed $value): mixed + { + static $serializer; + + if ($serializer === null) { + $serializer = new SerializeDateTime(...[]); + } + + return $serializer->serialize($value, $this); + } + + private function serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️BasicError(mixed $object): mixed + { + assert($object instanceof BasicError); + $result = []; + + $message = $object->message; + + if ($message === null) { + goto after_message; + } + + after_message: $result['message'] = $message; + + $documentationUrl = $object->documentationUrl; + + if ($documentationUrl === null) { + goto after_documentationUrl; + } + + after_documentationUrl: $result['documentation_url'] = $documentationUrl; + + $url = $object->url; + + if ($url === null) { + goto after_url; + } + + after_url: $result['url'] = $url; + + $status = $object->status; + + if ($status === null) { + goto after_status; + } + + after_status: $result['status'] = $status; + + return $result; + } + + /** + * @param class-string $className + * @param iterable $payloads; + * + * @return IterableList + * + * @throws UnableToHydrateObject + * + * @template T + */ + public function hydrateObjects(string $className, iterable $payloads): IterableList + { + return new IterableList($this->doHydrateObjects($className, $payloads)); + } + + private function doHydrateObjects(string $className, iterable $payloads): Generator + { + foreach ($payloads as $index => $payload) { + yield $index => $this->hydrateObject($className, $payload); + } + } + + /** + * @param class-string $className + * @param iterable $payloads; + * + * @return IterableList + * + * @throws UnableToSerializeObject + * + * @template T + */ + public function serializeObjects(iterable $payloads): IterableList + { + return new IterableList($this->doSerializeObjects($payloads)); + } + + private function doSerializeObjects(iterable $objects): Generator + { + foreach ($objects as $index => $object) { + yield $index => $this->serializeObject($object); + } + } +} diff --git a/clients/GitHub/src/Internal/Hydrator/Operation/Enterprises/Enterprise/CodeSecurity/Configurations/ConfigurationId/Defaults.php b/clients/GitHub/src/Internal/Hydrator/Operation/Enterprises/Enterprise/CodeSecurity/Configurations/ConfigurationId/Defaults.php new file mode 100644 index 00000000000..7e86bffc964 --- /dev/null +++ b/clients/GitHub/src/Internal/Hydrator/Operation/Enterprises/Enterprise/CodeSecurity/Configurations/ConfigurationId/Defaults.php @@ -0,0 +1,1055 @@ + $className + * + * @return T + * + * @template T of object + */ + public function hydrateObject(string $className, array $payload): object + { + return match ($className) { + 'ApiClients\Client\GitHub\Schema\Operations\CodeSecurity\SetConfigurationAsDefaultForEnterprise\Response\ApplicationJson\Ok' => $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️Operations⚡️CodeSecurity⚡️SetConfigurationAsDefaultForEnterprise⚡️Response⚡️ApplicationJson⚡️Ok($payload), + 'ApiClients\Client\GitHub\Schema\CodeSecurityConfiguration' => $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration($payload), + 'ApiClients\Client\GitHub\Schema\CodeSecurityConfiguration\DependencyGraphAutosubmitActionOptions' => $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration⚡️DependencyGraphAutosubmitActionOptions($payload), + 'ApiClients\Client\GitHub\Schema\CodeSecurityConfiguration\CodeScanningDefaultSetupOptions' => $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration⚡️CodeScanningDefaultSetupOptions($payload), + 'ApiClients\Client\GitHub\Schema\CodeSecurityConfiguration\SecretScanningDelegatedBypassOptions' => $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration⚡️SecretScanningDelegatedBypassOptions($payload), + 'ApiClients\Client\GitHub\Schema\BasicError' => $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️BasicError($payload), + default => throw UnableToHydrateObject::noHydrationDefined($className, $this->hydrationStack), + }; + } + + private function hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️Operations⚡️CodeSecurity⚡️SetConfigurationAsDefaultForEnterprise⚡️Response⚡️ApplicationJson⚡️Ok(array $payload): Ok + { + $properties = []; + $missingFields = []; + try { + $value = $payload['default_for_new_repos'] ?? null; + + if ($value === null) { + $properties['defaultForNewRepos'] = null; + goto after_defaultForNewRepos; + } + + $properties['defaultForNewRepos'] = $value; + + after_defaultForNewRepos: + + $value = $payload['configuration'] ?? null; + + if ($value === null) { + $properties['configuration'] = null; + goto after_configuration; + } + + if (is_array($value)) { + try { + $this->hydrationStack[] = 'configuration'; + $value = $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration($value); + } finally { + array_pop($this->hydrationStack); + } + } + + $properties['configuration'] = $value; + + after_configuration: + } catch (Throwable $exception) { + throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\Operations\CodeSecurity\SetConfigurationAsDefaultForEnterprise\Response\ApplicationJson\Ok', $exception, stack: $this->hydrationStack); + } + + if (count($missingFields) > 0) { + throw UnableToHydrateObject::dueToMissingFields(Ok::class, $missingFields, stack: $this->hydrationStack); + } + + try { + return new Ok(...$properties); + } catch (Throwable $exception) { + throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\Operations\CodeSecurity\SetConfigurationAsDefaultForEnterprise\Response\ApplicationJson\Ok', $exception, stack: $this->hydrationStack); + } + } + + private function hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration(array $payload): CodeSecurityConfiguration + { + $properties = []; + $missingFields = []; + try { + $value = $payload['id'] ?? null; + + if ($value === null) { + $properties['id'] = null; + goto after_id; + } + + $properties['id'] = $value; + + after_id: + + $value = $payload['name'] ?? null; + + if ($value === null) { + $properties['name'] = null; + goto after_name; + } + + $properties['name'] = $value; + + after_name: + + $value = $payload['target_type'] ?? null; + + if ($value === null) { + $properties['targetType'] = null; + goto after_targetType; + } + + $properties['targetType'] = $value; + + after_targetType: + + $value = $payload['description'] ?? null; + + if ($value === null) { + $properties['description'] = null; + goto after_description; + } + + $properties['description'] = $value; + + after_description: + + $value = $payload['advanced_security'] ?? null; + + if ($value === null) { + $properties['advancedSecurity'] = null; + goto after_advancedSecurity; + } + + $properties['advancedSecurity'] = $value; + + after_advancedSecurity: + + $value = $payload['dependency_graph'] ?? null; + + if ($value === null) { + $properties['dependencyGraph'] = null; + goto after_dependencyGraph; + } + + $properties['dependencyGraph'] = $value; + + after_dependencyGraph: + + $value = $payload['dependency_graph_autosubmit_action'] ?? null; + + if ($value === null) { + $properties['dependencyGraphAutosubmitAction'] = null; + goto after_dependencyGraphAutosubmitAction; + } + + $properties['dependencyGraphAutosubmitAction'] = $value; + + after_dependencyGraphAutosubmitAction: + + $value = $payload['dependency_graph_autosubmit_action_options'] ?? null; + + if ($value === null) { + $properties['dependencyGraphAutosubmitActionOptions'] = null; + goto after_dependencyGraphAutosubmitActionOptions; + } + + if (is_array($value)) { + try { + $this->hydrationStack[] = 'dependencyGraphAutosubmitActionOptions'; + $value = $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration⚡️DependencyGraphAutosubmitActionOptions($value); + } finally { + array_pop($this->hydrationStack); + } + } + + $properties['dependencyGraphAutosubmitActionOptions'] = $value; + + after_dependencyGraphAutosubmitActionOptions: + + $value = $payload['dependabot_alerts'] ?? null; + + if ($value === null) { + $properties['dependabotAlerts'] = null; + goto after_dependabotAlerts; + } + + $properties['dependabotAlerts'] = $value; + + after_dependabotAlerts: + + $value = $payload['dependabot_security_updates'] ?? null; + + if ($value === null) { + $properties['dependabotSecurityUpdates'] = null; + goto after_dependabotSecurityUpdates; + } + + $properties['dependabotSecurityUpdates'] = $value; + + after_dependabotSecurityUpdates: + + $value = $payload['code_scanning_default_setup'] ?? null; + + if ($value === null) { + $properties['codeScanningDefaultSetup'] = null; + goto after_codeScanningDefaultSetup; + } + + $properties['codeScanningDefaultSetup'] = $value; + + after_codeScanningDefaultSetup: + + $value = $payload['code_scanning_default_setup_options'] ?? null; + + if ($value === null) { + $properties['codeScanningDefaultSetupOptions'] = null; + goto after_codeScanningDefaultSetupOptions; + } + + if (is_array($value)) { + try { + $this->hydrationStack[] = 'codeScanningDefaultSetupOptions'; + $value = $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration⚡️CodeScanningDefaultSetupOptions($value); + } finally { + array_pop($this->hydrationStack); + } + } + + $properties['codeScanningDefaultSetupOptions'] = $value; + + after_codeScanningDefaultSetupOptions: + + $value = $payload['secret_scanning'] ?? null; + + if ($value === null) { + $properties['secretScanning'] = null; + goto after_secretScanning; + } + + $properties['secretScanning'] = $value; + + after_secretScanning: + + $value = $payload['secret_scanning_push_protection'] ?? null; + + if ($value === null) { + $properties['secretScanningPushProtection'] = null; + goto after_secretScanningPushProtection; + } + + $properties['secretScanningPushProtection'] = $value; + + after_secretScanningPushProtection: + + $value = $payload['secret_scanning_delegated_bypass'] ?? null; + + if ($value === null) { + $properties['secretScanningDelegatedBypass'] = null; + goto after_secretScanningDelegatedBypass; + } + + $properties['secretScanningDelegatedBypass'] = $value; + + after_secretScanningDelegatedBypass: + + $value = $payload['secret_scanning_delegated_bypass_options'] ?? null; + + if ($value === null) { + $properties['secretScanningDelegatedBypassOptions'] = null; + goto after_secretScanningDelegatedBypassOptions; + } + + if (is_array($value)) { + try { + $this->hydrationStack[] = 'secretScanningDelegatedBypassOptions'; + $value = $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration⚡️SecretScanningDelegatedBypassOptions($value); + } finally { + array_pop($this->hydrationStack); + } + } + + $properties['secretScanningDelegatedBypassOptions'] = $value; + + after_secretScanningDelegatedBypassOptions: + + $value = $payload['secret_scanning_validity_checks'] ?? null; + + if ($value === null) { + $properties['secretScanningValidityChecks'] = null; + goto after_secretScanningValidityChecks; + } + + $properties['secretScanningValidityChecks'] = $value; + + after_secretScanningValidityChecks: + + $value = $payload['secret_scanning_non_provider_patterns'] ?? null; + + if ($value === null) { + $properties['secretScanningNonProviderPatterns'] = null; + goto after_secretScanningNonProviderPatterns; + } + + $properties['secretScanningNonProviderPatterns'] = $value; + + after_secretScanningNonProviderPatterns: + + $value = $payload['private_vulnerability_reporting'] ?? null; + + if ($value === null) { + $properties['privateVulnerabilityReporting'] = null; + goto after_privateVulnerabilityReporting; + } + + $properties['privateVulnerabilityReporting'] = $value; + + after_privateVulnerabilityReporting: + + $value = $payload['enforcement'] ?? null; + + if ($value === null) { + $properties['enforcement'] = null; + goto after_enforcement; + } + + $properties['enforcement'] = $value; + + after_enforcement: + + $value = $payload['url'] ?? null; + + if ($value === null) { + $properties['url'] = null; + goto after_url; + } + + $properties['url'] = $value; + + after_url: + + $value = $payload['html_url'] ?? null; + + if ($value === null) { + $properties['htmlUrl'] = null; + goto after_htmlUrl; + } + + $properties['htmlUrl'] = $value; + + after_htmlUrl: + + $value = $payload['created_at'] ?? null; + + if ($value === null) { + $properties['createdAt'] = null; + goto after_createdAt; + } + + $properties['createdAt'] = $value; + + after_createdAt: + + $value = $payload['updated_at'] ?? null; + + if ($value === null) { + $properties['updatedAt'] = null; + goto after_updatedAt; + } + + $properties['updatedAt'] = $value; + + after_updatedAt: + } catch (Throwable $exception) { + throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\CodeSecurityConfiguration', $exception, stack: $this->hydrationStack); + } + + if (count($missingFields) > 0) { + throw UnableToHydrateObject::dueToMissingFields(CodeSecurityConfiguration::class, $missingFields, stack: $this->hydrationStack); + } + + try { + return new CodeSecurityConfiguration(...$properties); + } catch (Throwable $exception) { + throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\CodeSecurityConfiguration', $exception, stack: $this->hydrationStack); + } + } + + private function hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration⚡️DependencyGraphAutosubmitActionOptions(array $payload): DependencyGraphAutosubmitActionOptions + { + $properties = []; + $missingFields = []; + try { + $value = $payload['labeled_runners'] ?? null; + + if ($value === null) { + $properties['labeledRunners'] = null; + goto after_labeledRunners; + } + + $properties['labeledRunners'] = $value; + + after_labeledRunners: + } catch (Throwable $exception) { + throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\CodeSecurityConfiguration\DependencyGraphAutosubmitActionOptions', $exception, stack: $this->hydrationStack); + } + + if (count($missingFields) > 0) { + throw UnableToHydrateObject::dueToMissingFields(DependencyGraphAutosubmitActionOptions::class, $missingFields, stack: $this->hydrationStack); + } + + try { + return new DependencyGraphAutosubmitActionOptions(...$properties); + } catch (Throwable $exception) { + throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\CodeSecurityConfiguration\DependencyGraphAutosubmitActionOptions', $exception, stack: $this->hydrationStack); + } + } + + private function hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration⚡️CodeScanningDefaultSetupOptions(array $payload): CodeScanningDefaultSetupOptions + { + $properties = []; + $missingFields = []; + try { + $value = $payload['runner_type'] ?? null; + + if ($value === null) { + $properties['runnerType'] = null; + goto after_runnerType; + } + + $properties['runnerType'] = $value; + + after_runnerType: + + $value = $payload['runner_label'] ?? null; + + if ($value === null) { + $properties['runnerLabel'] = null; + goto after_runnerLabel; + } + + $properties['runnerLabel'] = $value; + + after_runnerLabel: + } catch (Throwable $exception) { + throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\CodeSecurityConfiguration\CodeScanningDefaultSetupOptions', $exception, stack: $this->hydrationStack); + } + + if (count($missingFields) > 0) { + throw UnableToHydrateObject::dueToMissingFields(CodeScanningDefaultSetupOptions::class, $missingFields, stack: $this->hydrationStack); + } + + try { + return new CodeScanningDefaultSetupOptions(...$properties); + } catch (Throwable $exception) { + throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\CodeSecurityConfiguration\CodeScanningDefaultSetupOptions', $exception, stack: $this->hydrationStack); + } + } + + private function hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration⚡️SecretScanningDelegatedBypassOptions(array $payload): SecretScanningDelegatedBypassOptions + { + $properties = []; + $missingFields = []; + try { + $value = $payload['reviewers'] ?? null; + + if ($value === null) { + $properties['reviewers'] = null; + goto after_reviewers; + } + + $properties['reviewers'] = $value; + + after_reviewers: + } catch (Throwable $exception) { + throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\CodeSecurityConfiguration\SecretScanningDelegatedBypassOptions', $exception, stack: $this->hydrationStack); + } + + if (count($missingFields) > 0) { + throw UnableToHydrateObject::dueToMissingFields(SecretScanningDelegatedBypassOptions::class, $missingFields, stack: $this->hydrationStack); + } + + try { + return new SecretScanningDelegatedBypassOptions(...$properties); + } catch (Throwable $exception) { + throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\CodeSecurityConfiguration\SecretScanningDelegatedBypassOptions', $exception, stack: $this->hydrationStack); + } + } + + private function hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️BasicError(array $payload): BasicError + { + $properties = []; + $missingFields = []; + try { + $value = $payload['message'] ?? null; + + if ($value === null) { + $properties['message'] = null; + goto after_message; + } + + $properties['message'] = $value; + + after_message: + + $value = $payload['documentation_url'] ?? null; + + if ($value === null) { + $properties['documentationUrl'] = null; + goto after_documentationUrl; + } + + $properties['documentationUrl'] = $value; + + after_documentationUrl: + + $value = $payload['url'] ?? null; + + if ($value === null) { + $properties['url'] = null; + goto after_url; + } + + $properties['url'] = $value; + + after_url: + + $value = $payload['status'] ?? null; + + if ($value === null) { + $properties['status'] = null; + goto after_status; + } + + $properties['status'] = $value; + + after_status: + } catch (Throwable $exception) { + throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\BasicError', $exception, stack: $this->hydrationStack); + } + + if (count($missingFields) > 0) { + throw UnableToHydrateObject::dueToMissingFields(BasicError::class, $missingFields, stack: $this->hydrationStack); + } + + try { + return new BasicError(...$properties); + } catch (Throwable $exception) { + throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\BasicError', $exception, stack: $this->hydrationStack); + } + } + + private function serializeViaTypeMap(string $accessor, object $object, array $payloadToTypeMap): array + { + foreach ($payloadToTypeMap as $payloadType => [$valueType, $method]) { + if (is_a($object, $valueType)) { + return [$accessor => $payloadType] + $this->{$method}($object); + } + } + + throw new LogicException('No type mapped for object of class: ' . $object::class); + } + + public function serializeObject(object $object): mixed + { + return $this->serializeObjectOfType($object, $object::class); + } + + /** + * @param T $object + * @param class-string $className + * + * @template T + */ + public function serializeObjectOfType(object $object, string $className): mixed + { + try { + return match ($className) { + 'array' => $this->serializeValuearray($object), + 'Ramsey\Uuid\UuidInterface' => $this->serializeValueRamsey⚡️Uuid⚡️UuidInterface($object), + 'DateTime' => $this->serializeValueDateTime($object), + 'DateTimeImmutable' => $this->serializeValueDateTimeImmutable($object), + 'DateTimeInterface' => $this->serializeValueDateTimeInterface($object), + 'ApiClients\Client\GitHub\Schema\Operations\CodeSecurity\SetConfigurationAsDefaultForEnterprise\Response\ApplicationJson\Ok' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️Operations⚡️CodeSecurity⚡️SetConfigurationAsDefaultForEnterprise⚡️Response⚡️ApplicationJson⚡️Ok($object), + 'ApiClients\Client\GitHub\Schema\CodeSecurityConfiguration' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration($object), + 'ApiClients\Client\GitHub\Schema\CodeSecurityConfiguration\DependencyGraphAutosubmitActionOptions' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration⚡️DependencyGraphAutosubmitActionOptions($object), + 'ApiClients\Client\GitHub\Schema\CodeSecurityConfiguration\CodeScanningDefaultSetupOptions' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration⚡️CodeScanningDefaultSetupOptions($object), + 'ApiClients\Client\GitHub\Schema\CodeSecurityConfiguration\SecretScanningDelegatedBypassOptions' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration⚡️SecretScanningDelegatedBypassOptions($object), + 'ApiClients\Client\GitHub\Schema\BasicError' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️BasicError($object), + default => throw new LogicException("No serialization defined for $className"), + }; + } catch (Throwable $exception) { + throw UnableToSerializeObject::dueToError($className, $exception); + } + } + + private function serializeValuearray(mixed $value): mixed + { + static $serializer; + + if ($serializer === null) { + $serializer = new SerializeArrayItems(...[]); + } + + return $serializer->serialize($value, $this); + } + + private function serializeValueRamsey⚡️Uuid⚡️UuidInterface(mixed $value): mixed + { + static $serializer; + + if ($serializer === null) { + $serializer = new SerializeUuidToString(...[]); + } + + return $serializer->serialize($value, $this); + } + + private function serializeValueDateTime(mixed $value): mixed + { + static $serializer; + + if ($serializer === null) { + $serializer = new SerializeDateTime(...[]); + } + + return $serializer->serialize($value, $this); + } + + private function serializeValueDateTimeImmutable(mixed $value): mixed + { + static $serializer; + + if ($serializer === null) { + $serializer = new SerializeDateTime(...[]); + } + + return $serializer->serialize($value, $this); + } + + private function serializeValueDateTimeInterface(mixed $value): mixed + { + static $serializer; + + if ($serializer === null) { + $serializer = new SerializeDateTime(...[]); + } + + return $serializer->serialize($value, $this); + } + + private function serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️Operations⚡️CodeSecurity⚡️SetConfigurationAsDefaultForEnterprise⚡️Response⚡️ApplicationJson⚡️Ok(mixed $object): mixed + { + assert($object instanceof Ok); + $result = []; + + $defaultForNewRepos = $object->defaultForNewRepos; + + if ($defaultForNewRepos === null) { + goto after_defaultForNewRepos; + } + + after_defaultForNewRepos: $result['default_for_new_repos'] = $defaultForNewRepos; + + $configuration = $object->configuration; + + if ($configuration === null) { + goto after_configuration; + } + + $configuration = $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration($configuration); + after_configuration: $result['configuration'] = $configuration; + + return $result; + } + + private function serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration(mixed $object): mixed + { + assert($object instanceof CodeSecurityConfiguration); + $result = []; + + $id = $object->id; + + if ($id === null) { + goto after_id; + } + + after_id: $result['id'] = $id; + + $name = $object->name; + + if ($name === null) { + goto after_name; + } + + after_name: $result['name'] = $name; + + $targetType = $object->targetType; + + if ($targetType === null) { + goto after_targetType; + } + + after_targetType: $result['target_type'] = $targetType; + + $description = $object->description; + + if ($description === null) { + goto after_description; + } + + after_description: $result['description'] = $description; + + $advancedSecurity = $object->advancedSecurity; + + if ($advancedSecurity === null) { + goto after_advancedSecurity; + } + + after_advancedSecurity: $result['advanced_security'] = $advancedSecurity; + + $dependencyGraph = $object->dependencyGraph; + + if ($dependencyGraph === null) { + goto after_dependencyGraph; + } + + after_dependencyGraph: $result['dependency_graph'] = $dependencyGraph; + + $dependencyGraphAutosubmitAction = $object->dependencyGraphAutosubmitAction; + + if ($dependencyGraphAutosubmitAction === null) { + goto after_dependencyGraphAutosubmitAction; + } + + after_dependencyGraphAutosubmitAction: $result['dependency_graph_autosubmit_action'] = $dependencyGraphAutosubmitAction; + + $dependencyGraphAutosubmitActionOptions = $object->dependencyGraphAutosubmitActionOptions; + + if ($dependencyGraphAutosubmitActionOptions === null) { + goto after_dependencyGraphAutosubmitActionOptions; + } + + $dependencyGraphAutosubmitActionOptions = $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration⚡️DependencyGraphAutosubmitActionOptions($dependencyGraphAutosubmitActionOptions); + after_dependencyGraphAutosubmitActionOptions: $result['dependency_graph_autosubmit_action_options'] = $dependencyGraphAutosubmitActionOptions; + + $dependabotAlerts = $object->dependabotAlerts; + + if ($dependabotAlerts === null) { + goto after_dependabotAlerts; + } + + after_dependabotAlerts: $result['dependabot_alerts'] = $dependabotAlerts; + + $dependabotSecurityUpdates = $object->dependabotSecurityUpdates; + + if ($dependabotSecurityUpdates === null) { + goto after_dependabotSecurityUpdates; + } + + after_dependabotSecurityUpdates: $result['dependabot_security_updates'] = $dependabotSecurityUpdates; + + $codeScanningDefaultSetup = $object->codeScanningDefaultSetup; + + if ($codeScanningDefaultSetup === null) { + goto after_codeScanningDefaultSetup; + } + + after_codeScanningDefaultSetup: $result['code_scanning_default_setup'] = $codeScanningDefaultSetup; + + $codeScanningDefaultSetupOptions = $object->codeScanningDefaultSetupOptions; + + if ($codeScanningDefaultSetupOptions === null) { + goto after_codeScanningDefaultSetupOptions; + } + + $codeScanningDefaultSetupOptions = $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration⚡️CodeScanningDefaultSetupOptions($codeScanningDefaultSetupOptions); + after_codeScanningDefaultSetupOptions: $result['code_scanning_default_setup_options'] = $codeScanningDefaultSetupOptions; + + $secretScanning = $object->secretScanning; + + if ($secretScanning === null) { + goto after_secretScanning; + } + + after_secretScanning: $result['secret_scanning'] = $secretScanning; + + $secretScanningPushProtection = $object->secretScanningPushProtection; + + if ($secretScanningPushProtection === null) { + goto after_secretScanningPushProtection; + } + + after_secretScanningPushProtection: $result['secret_scanning_push_protection'] = $secretScanningPushProtection; + + $secretScanningDelegatedBypass = $object->secretScanningDelegatedBypass; + + if ($secretScanningDelegatedBypass === null) { + goto after_secretScanningDelegatedBypass; + } + + after_secretScanningDelegatedBypass: $result['secret_scanning_delegated_bypass'] = $secretScanningDelegatedBypass; + + $secretScanningDelegatedBypassOptions = $object->secretScanningDelegatedBypassOptions; + + if ($secretScanningDelegatedBypassOptions === null) { + goto after_secretScanningDelegatedBypassOptions; + } + + $secretScanningDelegatedBypassOptions = $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration⚡️SecretScanningDelegatedBypassOptions($secretScanningDelegatedBypassOptions); + after_secretScanningDelegatedBypassOptions: $result['secret_scanning_delegated_bypass_options'] = $secretScanningDelegatedBypassOptions; + + $secretScanningValidityChecks = $object->secretScanningValidityChecks; + + if ($secretScanningValidityChecks === null) { + goto after_secretScanningValidityChecks; + } + + after_secretScanningValidityChecks: $result['secret_scanning_validity_checks'] = $secretScanningValidityChecks; + + $secretScanningNonProviderPatterns = $object->secretScanningNonProviderPatterns; + + if ($secretScanningNonProviderPatterns === null) { + goto after_secretScanningNonProviderPatterns; + } + + after_secretScanningNonProviderPatterns: $result['secret_scanning_non_provider_patterns'] = $secretScanningNonProviderPatterns; + + $privateVulnerabilityReporting = $object->privateVulnerabilityReporting; + + if ($privateVulnerabilityReporting === null) { + goto after_privateVulnerabilityReporting; + } + + after_privateVulnerabilityReporting: $result['private_vulnerability_reporting'] = $privateVulnerabilityReporting; + + $enforcement = $object->enforcement; + + if ($enforcement === null) { + goto after_enforcement; + } + + after_enforcement: $result['enforcement'] = $enforcement; + + $url = $object->url; + + if ($url === null) { + goto after_url; + } + + after_url: $result['url'] = $url; + + $htmlUrl = $object->htmlUrl; + + if ($htmlUrl === null) { + goto after_htmlUrl; + } + + after_htmlUrl: $result['html_url'] = $htmlUrl; + + $createdAt = $object->createdAt; + + if ($createdAt === null) { + goto after_createdAt; + } + + after_createdAt: $result['created_at'] = $createdAt; + + $updatedAt = $object->updatedAt; + + if ($updatedAt === null) { + goto after_updatedAt; + } + + after_updatedAt: $result['updated_at'] = $updatedAt; + + return $result; + } + + private function serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration⚡️DependencyGraphAutosubmitActionOptions(mixed $object): mixed + { + assert($object instanceof DependencyGraphAutosubmitActionOptions); + $result = []; + + $labeledRunners = $object->labeledRunners; + + if ($labeledRunners === null) { + goto after_labeledRunners; + } + + after_labeledRunners: $result['labeled_runners'] = $labeledRunners; + + return $result; + } + + private function serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration⚡️CodeScanningDefaultSetupOptions(mixed $object): mixed + { + assert($object instanceof CodeScanningDefaultSetupOptions); + $result = []; + + $runnerType = $object->runnerType; + + if ($runnerType === null) { + goto after_runnerType; + } + + after_runnerType: $result['runner_type'] = $runnerType; + + $runnerLabel = $object->runnerLabel; + + if ($runnerLabel === null) { + goto after_runnerLabel; + } + + after_runnerLabel: $result['runner_label'] = $runnerLabel; + + return $result; + } + + private function serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration⚡️SecretScanningDelegatedBypassOptions(mixed $object): mixed + { + assert($object instanceof SecretScanningDelegatedBypassOptions); + $result = []; + + $reviewers = $object->reviewers; + + if ($reviewers === null) { + goto after_reviewers; + } + + static $reviewersSerializer0; + + if ($reviewersSerializer0 === null) { + $reviewersSerializer0 = new SerializeArrayItems(...[]); + } + + $reviewers = $reviewersSerializer0->serialize($reviewers, $this); + after_reviewers: $result['reviewers'] = $reviewers; + + return $result; + } + + private function serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️BasicError(mixed $object): mixed + { + assert($object instanceof BasicError); + $result = []; + + $message = $object->message; + + if ($message === null) { + goto after_message; + } + + after_message: $result['message'] = $message; + + $documentationUrl = $object->documentationUrl; + + if ($documentationUrl === null) { + goto after_documentationUrl; + } + + after_documentationUrl: $result['documentation_url'] = $documentationUrl; + + $url = $object->url; + + if ($url === null) { + goto after_url; + } + + after_url: $result['url'] = $url; + + $status = $object->status; + + if ($status === null) { + goto after_status; + } + + after_status: $result['status'] = $status; + + return $result; + } + + /** + * @param class-string $className + * @param iterable $payloads; + * + * @return IterableList + * + * @throws UnableToHydrateObject + * + * @template T + */ + public function hydrateObjects(string $className, iterable $payloads): IterableList + { + return new IterableList($this->doHydrateObjects($className, $payloads)); + } + + private function doHydrateObjects(string $className, iterable $payloads): Generator + { + foreach ($payloads as $index => $payload) { + yield $index => $this->hydrateObject($className, $payload); + } + } + + /** + * @param class-string $className + * @param iterable $payloads; + * + * @return IterableList + * + * @throws UnableToSerializeObject + * + * @template T + */ + public function serializeObjects(iterable $payloads): IterableList + { + return new IterableList($this->doSerializeObjects($payloads)); + } + + private function doSerializeObjects(iterable $objects): Generator + { + foreach ($objects as $index => $object) { + yield $index => $this->serializeObject($object); + } + } +} diff --git a/clients/GitHub/src/Internal/Hydrator/Operation/Enterprises/Enterprise/CodeSecurity/Configurations/ConfigurationId/Repositories.php b/clients/GitHub/src/Internal/Hydrator/Operation/Enterprises/Enterprise/CodeSecurity/Configurations/ConfigurationId/Repositories.php new file mode 100644 index 00000000000..f062d683e8c --- /dev/null +++ b/clients/GitHub/src/Internal/Hydrator/Operation/Enterprises/Enterprise/CodeSecurity/Configurations/ConfigurationId/Repositories.php @@ -0,0 +1,286 @@ + $className + * + * @return T + * + * @template T of object + */ + public function hydrateObject(string $className, array $payload): object + { + return match ($className) { + 'ApiClients\Client\GitHub\Schema\BasicError' => $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️BasicError($payload), + default => throw UnableToHydrateObject::noHydrationDefined($className, $this->hydrationStack), + }; + } + + private function hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️BasicError(array $payload): BasicError + { + $properties = []; + $missingFields = []; + try { + $value = $payload['message'] ?? null; + + if ($value === null) { + $properties['message'] = null; + goto after_message; + } + + $properties['message'] = $value; + + after_message: + + $value = $payload['documentation_url'] ?? null; + + if ($value === null) { + $properties['documentationUrl'] = null; + goto after_documentationUrl; + } + + $properties['documentationUrl'] = $value; + + after_documentationUrl: + + $value = $payload['url'] ?? null; + + if ($value === null) { + $properties['url'] = null; + goto after_url; + } + + $properties['url'] = $value; + + after_url: + + $value = $payload['status'] ?? null; + + if ($value === null) { + $properties['status'] = null; + goto after_status; + } + + $properties['status'] = $value; + + after_status: + } catch (Throwable $exception) { + throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\BasicError', $exception, stack: $this->hydrationStack); + } + + if (count($missingFields) > 0) { + throw UnableToHydrateObject::dueToMissingFields(BasicError::class, $missingFields, stack: $this->hydrationStack); + } + + try { + return new BasicError(...$properties); + } catch (Throwable $exception) { + throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\BasicError', $exception, stack: $this->hydrationStack); + } + } + + private function serializeViaTypeMap(string $accessor, object $object, array $payloadToTypeMap): array + { + foreach ($payloadToTypeMap as $payloadType => [$valueType, $method]) { + if (is_a($object, $valueType)) { + return [$accessor => $payloadType] + $this->{$method}($object); + } + } + + throw new LogicException('No type mapped for object of class: ' . $object::class); + } + + public function serializeObject(object $object): mixed + { + return $this->serializeObjectOfType($object, $object::class); + } + + /** + * @param T $object + * @param class-string $className + * + * @template T + */ + public function serializeObjectOfType(object $object, string $className): mixed + { + try { + return match ($className) { + 'array' => $this->serializeValuearray($object), + 'Ramsey\Uuid\UuidInterface' => $this->serializeValueRamsey⚡️Uuid⚡️UuidInterface($object), + 'DateTime' => $this->serializeValueDateTime($object), + 'DateTimeImmutable' => $this->serializeValueDateTimeImmutable($object), + 'DateTimeInterface' => $this->serializeValueDateTimeInterface($object), + 'ApiClients\Client\GitHub\Schema\BasicError' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️BasicError($object), + default => throw new LogicException("No serialization defined for $className"), + }; + } catch (Throwable $exception) { + throw UnableToSerializeObject::dueToError($className, $exception); + } + } + + private function serializeValuearray(mixed $value): mixed + { + static $serializer; + + if ($serializer === null) { + $serializer = new SerializeArrayItems(...[]); + } + + return $serializer->serialize($value, $this); + } + + private function serializeValueRamsey⚡️Uuid⚡️UuidInterface(mixed $value): mixed + { + static $serializer; + + if ($serializer === null) { + $serializer = new SerializeUuidToString(...[]); + } + + return $serializer->serialize($value, $this); + } + + private function serializeValueDateTime(mixed $value): mixed + { + static $serializer; + + if ($serializer === null) { + $serializer = new SerializeDateTime(...[]); + } + + return $serializer->serialize($value, $this); + } + + private function serializeValueDateTimeImmutable(mixed $value): mixed + { + static $serializer; + + if ($serializer === null) { + $serializer = new SerializeDateTime(...[]); + } + + return $serializer->serialize($value, $this); + } + + private function serializeValueDateTimeInterface(mixed $value): mixed + { + static $serializer; + + if ($serializer === null) { + $serializer = new SerializeDateTime(...[]); + } + + return $serializer->serialize($value, $this); + } + + private function serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️BasicError(mixed $object): mixed + { + assert($object instanceof BasicError); + $result = []; + + $message = $object->message; + + if ($message === null) { + goto after_message; + } + + after_message: $result['message'] = $message; + + $documentationUrl = $object->documentationUrl; + + if ($documentationUrl === null) { + goto after_documentationUrl; + } + + after_documentationUrl: $result['documentation_url'] = $documentationUrl; + + $url = $object->url; + + if ($url === null) { + goto after_url; + } + + after_url: $result['url'] = $url; + + $status = $object->status; + + if ($status === null) { + goto after_status; + } + + after_status: $result['status'] = $status; + + return $result; + } + + /** + * @param class-string $className + * @param iterable $payloads; + * + * @return IterableList + * + * @throws UnableToHydrateObject + * + * @template T + */ + public function hydrateObjects(string $className, iterable $payloads): IterableList + { + return new IterableList($this->doHydrateObjects($className, $payloads)); + } + + private function doHydrateObjects(string $className, iterable $payloads): Generator + { + foreach ($payloads as $index => $payload) { + yield $index => $this->hydrateObject($className, $payload); + } + } + + /** + * @param class-string $className + * @param iterable $payloads; + * + * @return IterableList + * + * @throws UnableToSerializeObject + * + * @template T + */ + public function serializeObjects(iterable $payloads): IterableList + { + return new IterableList($this->doSerializeObjects($payloads)); + } + + private function doSerializeObjects(iterable $objects): Generator + { + foreach ($objects as $index => $object) { + yield $index => $this->serializeObject($object); + } + } +} diff --git a/clients/GitHub/src/Internal/Hydrator/Operation/Meta.php b/clients/GitHub/src/Internal/Hydrator/Operation/Meta.php index 2119408e976..9d212afcbde 100644 --- a/clients/GitHub/src/Internal/Hydrator/Operation/Meta.php +++ b/clients/GitHub/src/Internal/Hydrator/Operation/Meta.php @@ -6,6 +6,7 @@ use ApiClients\Client\GitHub\Schema\ApiOverview; use ApiClients\Client\GitHub\Schema\ApiOverview\Domains; +use ApiClients\Client\GitHub\Schema\ApiOverview\Domains\ActionsInbound; use ApiClients\Client\GitHub\Schema\ApiOverview\Domains\ArtifactAttestations; use ApiClients\Client\GitHub\Schema\ApiOverview\SshKeyFingerprints; use EventSauce\ObjectHydrator\IterableList; @@ -46,6 +47,7 @@ public function hydrateObject(string $className, array $payload): object 'ApiClients\Client\GitHub\Schema\ApiOverview' => $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️ApiOverview($payload), 'ApiClients\Client\GitHub\Schema\ApiOverview\SshKeyFingerprints' => $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️ApiOverview⚡️SshKeyFingerprints($payload), 'ApiClients\Client\GitHub\Schema\ApiOverview\Domains' => $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️ApiOverview⚡️Domains($payload), + 'ApiClients\Client\GitHub\Schema\ApiOverview\Domains\ActionsInbound' => $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️ApiOverview⚡️Domains⚡️ActionsInbound($payload), 'ApiClients\Client\GitHub\Schema\ApiOverview\Domains\ArtifactAttestations' => $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️ApiOverview⚡️Domains⚡️ArtifactAttestations($payload), default => throw UnableToHydrateObject::noHydrationDefined($className, $this->hydrationStack), }; @@ -398,6 +400,26 @@ private function hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️ApiO after_actions: + $value = $payload['actions_inbound'] ?? null; + + if ($value === null) { + $properties['actionsInbound'] = null; + goto after_actionsInbound; + } + + if (is_array($value)) { + try { + $this->hydrationStack[] = 'actionsInbound'; + $value = $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️ApiOverview⚡️Domains⚡️ActionsInbound($value); + } finally { + array_pop($this->hydrationStack); + } + } + + $properties['actionsInbound'] = $value; + + after_actionsInbound: + $value = $payload['artifact_attestations'] ?? null; if ($value === null) { @@ -432,6 +454,47 @@ private function hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️ApiO } } + private function hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️ApiOverview⚡️Domains⚡️ActionsInbound(array $payload): ActionsInbound + { + $properties = []; + $missingFields = []; + try { + $value = $payload['full_domains'] ?? null; + + if ($value === null) { + $properties['fullDomains'] = null; + goto after_fullDomains; + } + + $properties['fullDomains'] = $value; + + after_fullDomains: + + $value = $payload['wildcard_domains'] ?? null; + + if ($value === null) { + $properties['wildcardDomains'] = null; + goto after_wildcardDomains; + } + + $properties['wildcardDomains'] = $value; + + after_wildcardDomains: + } catch (Throwable $exception) { + throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\ApiOverview\Domains\ActionsInbound', $exception, stack: $this->hydrationStack); + } + + if (count($missingFields) > 0) { + throw UnableToHydrateObject::dueToMissingFields(ActionsInbound::class, $missingFields, stack: $this->hydrationStack); + } + + try { + return new ActionsInbound(...$properties); + } catch (Throwable $exception) { + throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\ApiOverview\Domains\ActionsInbound', $exception, stack: $this->hydrationStack); + } + } + private function hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️ApiOverview⚡️Domains⚡️ArtifactAttestations(array $payload): ArtifactAttestations { $properties = []; @@ -507,6 +570,7 @@ public function serializeObjectOfType(object $object, string $className): mixed 'ApiClients\Client\GitHub\Schema\ApiOverview' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️ApiOverview($object), 'ApiClients\Client\GitHub\Schema\ApiOverview\SshKeyFingerprints' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️ApiOverview⚡️SshKeyFingerprints($object), 'ApiClients\Client\GitHub\Schema\ApiOverview\Domains' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️ApiOverview⚡️Domains($object), + 'ApiClients\Client\GitHub\Schema\ApiOverview\Domains\ActionsInbound' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️ApiOverview⚡️Domains⚡️ActionsInbound($object), 'ApiClients\Client\GitHub\Schema\ApiOverview\Domains\ArtifactAttestations' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️ApiOverview⚡️Domains⚡️ArtifactAttestations($object), default => throw new LogicException("No serialization defined for $className"), }; @@ -929,6 +993,15 @@ private function serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema $actions = $actionsSerializer0->serialize($actions, $this); after_actions: $result['actions'] = $actions; + $actionsInbound = $object->actionsInbound; + + if ($actionsInbound === null) { + goto after_actionsInbound; + } + + $actionsInbound = $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️ApiOverview⚡️Domains⚡️ActionsInbound($actionsInbound); + after_actionsInbound: $result['actions_inbound'] = $actionsInbound; + $artifactAttestations = $object->artifactAttestations; if ($artifactAttestations === null) { @@ -941,6 +1014,44 @@ private function serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema return $result; } + private function serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️ApiOverview⚡️Domains⚡️ActionsInbound(mixed $object): mixed + { + assert($object instanceof ActionsInbound); + $result = []; + + $fullDomains = $object->fullDomains; + + if ($fullDomains === null) { + goto after_fullDomains; + } + + static $fullDomainsSerializer0; + + if ($fullDomainsSerializer0 === null) { + $fullDomainsSerializer0 = new SerializeArrayItems(...[]); + } + + $fullDomains = $fullDomainsSerializer0->serialize($fullDomains, $this); + after_fullDomains: $result['full_domains'] = $fullDomains; + + $wildcardDomains = $object->wildcardDomains; + + if ($wildcardDomains === null) { + goto after_wildcardDomains; + } + + static $wildcardDomainsSerializer0; + + if ($wildcardDomainsSerializer0 === null) { + $wildcardDomainsSerializer0 = new SerializeArrayItems(...[]); + } + + $wildcardDomains = $wildcardDomainsSerializer0->serialize($wildcardDomains, $this); + after_wildcardDomains: $result['wildcard_domains'] = $wildcardDomains; + + return $result; + } + private function serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️ApiOverview⚡️Domains⚡️ArtifactAttestations(mixed $object): mixed { assert($object instanceof ArtifactAttestations); diff --git a/clients/GitHub/src/Internal/Hydrator/Operation/Orgs/Org/CodeSecurity/Configurations/ConfigurationId/Defaults.php b/clients/GitHub/src/Internal/Hydrator/Operation/Orgs/Org/CodeSecurity/Configurations/ConfigurationId/Defaults.php index d92192bdcd9..f604774bd54 100644 --- a/clients/GitHub/src/Internal/Hydrator/Operation/Orgs/Org/CodeSecurity/Configurations/ConfigurationId/Defaults.php +++ b/clients/GitHub/src/Internal/Hydrator/Operation/Orgs/Org/CodeSecurity/Configurations/ConfigurationId/Defaults.php @@ -9,7 +9,7 @@ use ApiClients\Client\GitHub\Schema\CodeSecurityConfiguration\CodeScanningDefaultSetupOptions; use ApiClients\Client\GitHub\Schema\CodeSecurityConfiguration\DependencyGraphAutosubmitActionOptions; use ApiClients\Client\GitHub\Schema\CodeSecurityConfiguration\SecretScanningDelegatedBypassOptions; -use ApiClients\Client\GitHub\Schema\Operations\CodeSecurity\SetConfigurationAsDefault\Response\ApplicationJson\Ok; +use ApiClients\Client\GitHub\Schema\Operations\CodeSecurity\SetConfigurationAsDefault\Response\ApplicationJson\Ok\Application\Json; use EventSauce\ObjectHydrator\IterableList; use EventSauce\ObjectHydrator\ObjectMapper; use EventSauce\ObjectHydrator\PropertySerializers\SerializeArrayItems; @@ -45,7 +45,7 @@ public function __construct() public function hydrateObject(string $className, array $payload): object { return match ($className) { - 'ApiClients\Client\GitHub\Schema\Operations\CodeSecurity\SetConfigurationAsDefault\Response\ApplicationJson\Ok' => $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️Operations⚡️CodeSecurity⚡️SetConfigurationAsDefault⚡️Response⚡️ApplicationJson⚡️Ok($payload), + 'ApiClients\Client\GitHub\Schema\Operations\CodeSecurity\SetConfigurationAsDefault\Response\ApplicationJson\Ok\Application\Json' => $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️Operations⚡️CodeSecurity⚡️SetConfigurationAsDefault⚡️Response⚡️ApplicationJson⚡️Ok⚡️Application⚡️Json($payload), 'ApiClients\Client\GitHub\Schema\CodeSecurityConfiguration' => $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration($payload), 'ApiClients\Client\GitHub\Schema\CodeSecurityConfiguration\DependencyGraphAutosubmitActionOptions' => $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration⚡️DependencyGraphAutosubmitActionOptions($payload), 'ApiClients\Client\GitHub\Schema\CodeSecurityConfiguration\CodeScanningDefaultSetupOptions' => $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration⚡️CodeScanningDefaultSetupOptions($payload), @@ -55,7 +55,7 @@ public function hydrateObject(string $className, array $payload): object }; } - private function hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️Operations⚡️CodeSecurity⚡️SetConfigurationAsDefault⚡️Response⚡️ApplicationJson⚡️Ok(array $payload): Ok + private function hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️Operations⚡️CodeSecurity⚡️SetConfigurationAsDefault⚡️Response⚡️ApplicationJson⚡️Ok⚡️Application⚡️Json(array $payload): Json { $properties = []; $missingFields = []; @@ -91,17 +91,17 @@ private function hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️Oper after_configuration: } catch (Throwable $exception) { - throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\Operations\CodeSecurity\SetConfigurationAsDefault\Response\ApplicationJson\Ok', $exception, stack: $this->hydrationStack); + throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\Operations\CodeSecurity\SetConfigurationAsDefault\Response\ApplicationJson\Ok\Application\Json', $exception, stack: $this->hydrationStack); } if (count($missingFields) > 0) { - throw UnableToHydrateObject::dueToMissingFields(Ok::class, $missingFields, stack: $this->hydrationStack); + throw UnableToHydrateObject::dueToMissingFields(Json::class, $missingFields, stack: $this->hydrationStack); } try { - return new Ok(...$properties); + return new Json(...$properties); } catch (Throwable $exception) { - throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\Operations\CodeSecurity\SetConfigurationAsDefault\Response\ApplicationJson\Ok', $exception, stack: $this->hydrationStack); + throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\Operations\CodeSecurity\SetConfigurationAsDefault\Response\ApplicationJson\Ok\Application\Json', $exception, stack: $this->hydrationStack); } } @@ -610,7 +610,7 @@ public function serializeObjectOfType(object $object, string $className): mixed 'DateTime' => $this->serializeValueDateTime($object), 'DateTimeImmutable' => $this->serializeValueDateTimeImmutable($object), 'DateTimeInterface' => $this->serializeValueDateTimeInterface($object), - 'ApiClients\Client\GitHub\Schema\Operations\CodeSecurity\SetConfigurationAsDefault\Response\ApplicationJson\Ok' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️Operations⚡️CodeSecurity⚡️SetConfigurationAsDefault⚡️Response⚡️ApplicationJson⚡️Ok($object), + 'ApiClients\Client\GitHub\Schema\Operations\CodeSecurity\SetConfigurationAsDefault\Response\ApplicationJson\Ok\Application\Json' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️Operations⚡️CodeSecurity⚡️SetConfigurationAsDefault⚡️Response⚡️ApplicationJson⚡️Ok⚡️Application⚡️Json($object), 'ApiClients\Client\GitHub\Schema\CodeSecurityConfiguration' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration($object), 'ApiClients\Client\GitHub\Schema\CodeSecurityConfiguration\DependencyGraphAutosubmitActionOptions' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration⚡️DependencyGraphAutosubmitActionOptions($object), 'ApiClients\Client\GitHub\Schema\CodeSecurityConfiguration\CodeScanningDefaultSetupOptions' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeSecurityConfiguration⚡️CodeScanningDefaultSetupOptions($object), @@ -678,9 +678,9 @@ private function serializeValueDateTimeInterface(mixed $value): mixed return $serializer->serialize($value, $this); } - private function serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️Operations⚡️CodeSecurity⚡️SetConfigurationAsDefault⚡️Response⚡️ApplicationJson⚡️Ok(mixed $object): mixed + private function serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️Operations⚡️CodeSecurity⚡️SetConfigurationAsDefault⚡️Response⚡️ApplicationJson⚡️Ok⚡️Application⚡️Json(mixed $object): mixed { - assert($object instanceof Ok); + assert($object instanceof Json); $result = []; $defaultForNewRepos = $object->defaultForNewRepos; diff --git a/clients/GitHub/src/Internal/Hydrator/Operation/Repos/Owner/Repo/CodeScanning/Alerts/AlertNumber/Autofix.php b/clients/GitHub/src/Internal/Hydrator/Operation/Repos/Owner/Repo/CodeScanning/Alerts/AlertNumber/Autofix.php new file mode 100644 index 00000000000..74c1b242315 --- /dev/null +++ b/clients/GitHub/src/Internal/Hydrator/Operation/Repos/Owner/Repo/CodeScanning/Alerts/AlertNumber/Autofix.php @@ -0,0 +1,450 @@ + $className + * + * @return T + * + * @template T of object + */ + public function hydrateObject(string $className, array $payload): object + { + return match ($className) { + 'ApiClients\Client\GitHub\Schema\CodeScanningAutofix' => $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeScanningAutofix($payload), + 'ApiClients\Client\GitHub\Schema\BasicError' => $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️BasicError($payload), + 'ApiClients\Client\GitHub\Schema\Operations\SecretScanning\ListAlertsForEnterprise\Response\ApplicationJson\ServiceUnavailable' => $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️Operations⚡️SecretScanning⚡️ListAlertsForEnterprise⚡️Response⚡️ApplicationJson⚡️ServiceUnavailable($payload), + default => throw UnableToHydrateObject::noHydrationDefined($className, $this->hydrationStack), + }; + } + + private function hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeScanningAutofix(array $payload): CodeScanningAutofix + { + $properties = []; + $missingFields = []; + try { + $value = $payload['status'] ?? null; + + if ($value === null) { + $missingFields[] = 'status'; + goto after_status; + } + + $properties['status'] = $value; + + after_status: + + $value = $payload['description'] ?? null; + + if ($value === null) { + $properties['description'] = null; + goto after_description; + } + + $properties['description'] = $value; + + after_description: + + $value = $payload['started_at'] ?? null; + + if ($value === null) { + $missingFields[] = 'started_at'; + goto after_startedAt; + } + + $properties['startedAt'] = $value; + + after_startedAt: + } catch (Throwable $exception) { + throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\CodeScanningAutofix', $exception, stack: $this->hydrationStack); + } + + if (count($missingFields) > 0) { + throw UnableToHydrateObject::dueToMissingFields(CodeScanningAutofix::class, $missingFields, stack: $this->hydrationStack); + } + + try { + return new CodeScanningAutofix(...$properties); + } catch (Throwable $exception) { + throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\CodeScanningAutofix', $exception, stack: $this->hydrationStack); + } + } + + private function hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️BasicError(array $payload): BasicError + { + $properties = []; + $missingFields = []; + try { + $value = $payload['message'] ?? null; + + if ($value === null) { + $properties['message'] = null; + goto after_message; + } + + $properties['message'] = $value; + + after_message: + + $value = $payload['documentation_url'] ?? null; + + if ($value === null) { + $properties['documentationUrl'] = null; + goto after_documentationUrl; + } + + $properties['documentationUrl'] = $value; + + after_documentationUrl: + + $value = $payload['url'] ?? null; + + if ($value === null) { + $properties['url'] = null; + goto after_url; + } + + $properties['url'] = $value; + + after_url: + + $value = $payload['status'] ?? null; + + if ($value === null) { + $properties['status'] = null; + goto after_status; + } + + $properties['status'] = $value; + + after_status: + } catch (Throwable $exception) { + throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\BasicError', $exception, stack: $this->hydrationStack); + } + + if (count($missingFields) > 0) { + throw UnableToHydrateObject::dueToMissingFields(BasicError::class, $missingFields, stack: $this->hydrationStack); + } + + try { + return new BasicError(...$properties); + } catch (Throwable $exception) { + throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\BasicError', $exception, stack: $this->hydrationStack); + } + } + + private function hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️Operations⚡️SecretScanning⚡️ListAlertsForEnterprise⚡️Response⚡️ApplicationJson⚡️ServiceUnavailable(array $payload): ServiceUnavailable + { + $properties = []; + $missingFields = []; + try { + $value = $payload['code'] ?? null; + + if ($value === null) { + $properties['code'] = null; + goto after_code; + } + + $properties['code'] = $value; + + after_code: + + $value = $payload['message'] ?? null; + + if ($value === null) { + $properties['message'] = null; + goto after_message; + } + + $properties['message'] = $value; + + after_message: + + $value = $payload['documentation_url'] ?? null; + + if ($value === null) { + $properties['documentationUrl'] = null; + goto after_documentationUrl; + } + + $properties['documentationUrl'] = $value; + + after_documentationUrl: + } catch (Throwable $exception) { + throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\Operations\SecretScanning\ListAlertsForEnterprise\Response\ApplicationJson\ServiceUnavailable', $exception, stack: $this->hydrationStack); + } + + if (count($missingFields) > 0) { + throw UnableToHydrateObject::dueToMissingFields(ServiceUnavailable::class, $missingFields, stack: $this->hydrationStack); + } + + try { + return new ServiceUnavailable(...$properties); + } catch (Throwable $exception) { + throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\Operations\SecretScanning\ListAlertsForEnterprise\Response\ApplicationJson\ServiceUnavailable', $exception, stack: $this->hydrationStack); + } + } + + private function serializeViaTypeMap(string $accessor, object $object, array $payloadToTypeMap): array + { + foreach ($payloadToTypeMap as $payloadType => [$valueType, $method]) { + if (is_a($object, $valueType)) { + return [$accessor => $payloadType] + $this->{$method}($object); + } + } + + throw new LogicException('No type mapped for object of class: ' . $object::class); + } + + public function serializeObject(object $object): mixed + { + return $this->serializeObjectOfType($object, $object::class); + } + + /** + * @param T $object + * @param class-string $className + * + * @template T + */ + public function serializeObjectOfType(object $object, string $className): mixed + { + try { + return match ($className) { + 'array' => $this->serializeValuearray($object), + 'Ramsey\Uuid\UuidInterface' => $this->serializeValueRamsey⚡️Uuid⚡️UuidInterface($object), + 'DateTime' => $this->serializeValueDateTime($object), + 'DateTimeImmutable' => $this->serializeValueDateTimeImmutable($object), + 'DateTimeInterface' => $this->serializeValueDateTimeInterface($object), + 'ApiClients\Client\GitHub\Schema\CodeScanningAutofix' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeScanningAutofix($object), + 'ApiClients\Client\GitHub\Schema\BasicError' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️BasicError($object), + 'ApiClients\Client\GitHub\Schema\Operations\SecretScanning\ListAlertsForEnterprise\Response\ApplicationJson\ServiceUnavailable' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️Operations⚡️SecretScanning⚡️ListAlertsForEnterprise⚡️Response⚡️ApplicationJson⚡️ServiceUnavailable($object), + default => throw new LogicException("No serialization defined for $className"), + }; + } catch (Throwable $exception) { + throw UnableToSerializeObject::dueToError($className, $exception); + } + } + + private function serializeValuearray(mixed $value): mixed + { + static $serializer; + + if ($serializer === null) { + $serializer = new SerializeArrayItems(...[]); + } + + return $serializer->serialize($value, $this); + } + + private function serializeValueRamsey⚡️Uuid⚡️UuidInterface(mixed $value): mixed + { + static $serializer; + + if ($serializer === null) { + $serializer = new SerializeUuidToString(...[]); + } + + return $serializer->serialize($value, $this); + } + + private function serializeValueDateTime(mixed $value): mixed + { + static $serializer; + + if ($serializer === null) { + $serializer = new SerializeDateTime(...[]); + } + + return $serializer->serialize($value, $this); + } + + private function serializeValueDateTimeImmutable(mixed $value): mixed + { + static $serializer; + + if ($serializer === null) { + $serializer = new SerializeDateTime(...[]); + } + + return $serializer->serialize($value, $this); + } + + private function serializeValueDateTimeInterface(mixed $value): mixed + { + static $serializer; + + if ($serializer === null) { + $serializer = new SerializeDateTime(...[]); + } + + return $serializer->serialize($value, $this); + } + + private function serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeScanningAutofix(mixed $object): mixed + { + assert($object instanceof CodeScanningAutofix); + $result = []; + + $status = $object->status; + after_status: $result['status'] = $status; + + $description = $object->description; + + if ($description === null) { + goto after_description; + } + + after_description: $result['description'] = $description; + + $startedAt = $object->startedAt; + after_startedAt: $result['started_at'] = $startedAt; + + return $result; + } + + private function serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️BasicError(mixed $object): mixed + { + assert($object instanceof BasicError); + $result = []; + + $message = $object->message; + + if ($message === null) { + goto after_message; + } + + after_message: $result['message'] = $message; + + $documentationUrl = $object->documentationUrl; + + if ($documentationUrl === null) { + goto after_documentationUrl; + } + + after_documentationUrl: $result['documentation_url'] = $documentationUrl; + + $url = $object->url; + + if ($url === null) { + goto after_url; + } + + after_url: $result['url'] = $url; + + $status = $object->status; + + if ($status === null) { + goto after_status; + } + + after_status: $result['status'] = $status; + + return $result; + } + + private function serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️Operations⚡️SecretScanning⚡️ListAlertsForEnterprise⚡️Response⚡️ApplicationJson⚡️ServiceUnavailable(mixed $object): mixed + { + assert($object instanceof ServiceUnavailable); + $result = []; + + $code = $object->code; + + if ($code === null) { + goto after_code; + } + + after_code: $result['code'] = $code; + + $message = $object->message; + + if ($message === null) { + goto after_message; + } + + after_message: $result['message'] = $message; + + $documentationUrl = $object->documentationUrl; + + if ($documentationUrl === null) { + goto after_documentationUrl; + } + + after_documentationUrl: $result['documentation_url'] = $documentationUrl; + + return $result; + } + + /** + * @param class-string $className + * @param iterable $payloads; + * + * @return IterableList + * + * @throws UnableToHydrateObject + * + * @template T + */ + public function hydrateObjects(string $className, iterable $payloads): IterableList + { + return new IterableList($this->doHydrateObjects($className, $payloads)); + } + + private function doHydrateObjects(string $className, iterable $payloads): Generator + { + foreach ($payloads as $index => $payload) { + yield $index => $this->hydrateObject($className, $payload); + } + } + + /** + * @param class-string $className + * @param iterable $payloads; + * + * @return IterableList + * + * @throws UnableToSerializeObject + * + * @template T + */ + public function serializeObjects(iterable $payloads): IterableList + { + return new IterableList($this->doSerializeObjects($payloads)); + } + + private function doSerializeObjects(iterable $objects): Generator + { + foreach ($objects as $index => $object) { + yield $index => $this->serializeObject($object); + } + } +} diff --git a/clients/GitHub/src/Internal/Hydrator/Operation/Repos/Owner/Repo/CodeScanning/Alerts/AlertNumber/Autofix/Commits.php b/clients/GitHub/src/Internal/Hydrator/Operation/Repos/Owner/Repo/CodeScanning/Alerts/AlertNumber/Autofix/Commits.php new file mode 100644 index 00000000000..12d806f2a3d --- /dev/null +++ b/clients/GitHub/src/Internal/Hydrator/Operation/Repos/Owner/Repo/CodeScanning/Alerts/AlertNumber/Autofix/Commits.php @@ -0,0 +1,441 @@ + $className + * + * @return T + * + * @template T of object + */ + public function hydrateObject(string $className, array $payload): object + { + return match ($className) { + 'ApiClients\Client\GitHub\Schema\CodeScanningAutofixCommitsResponse' => $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeScanningAutofixCommitsResponse($payload), + 'ApiClients\Client\GitHub\Schema\BasicError' => $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️BasicError($payload), + 'ApiClients\Client\GitHub\Schema\Operations\SecretScanning\ListAlertsForEnterprise\Response\ApplicationJson\ServiceUnavailable' => $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️Operations⚡️SecretScanning⚡️ListAlertsForEnterprise⚡️Response⚡️ApplicationJson⚡️ServiceUnavailable($payload), + default => throw UnableToHydrateObject::noHydrationDefined($className, $this->hydrationStack), + }; + } + + private function hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeScanningAutofixCommitsResponse(array $payload): CodeScanningAutofixCommitsResponse + { + $properties = []; + $missingFields = []; + try { + $value = $payload['target_ref'] ?? null; + + if ($value === null) { + $properties['targetRef'] = null; + goto after_targetRef; + } + + $properties['targetRef'] = $value; + + after_targetRef: + + $value = $payload['sha'] ?? null; + + if ($value === null) { + $properties['sha'] = null; + goto after_sha; + } + + $properties['sha'] = $value; + + after_sha: + } catch (Throwable $exception) { + throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\CodeScanningAutofixCommitsResponse', $exception, stack: $this->hydrationStack); + } + + if (count($missingFields) > 0) { + throw UnableToHydrateObject::dueToMissingFields(CodeScanningAutofixCommitsResponse::class, $missingFields, stack: $this->hydrationStack); + } + + try { + return new CodeScanningAutofixCommitsResponse(...$properties); + } catch (Throwable $exception) { + throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\CodeScanningAutofixCommitsResponse', $exception, stack: $this->hydrationStack); + } + } + + private function hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️BasicError(array $payload): BasicError + { + $properties = []; + $missingFields = []; + try { + $value = $payload['message'] ?? null; + + if ($value === null) { + $properties['message'] = null; + goto after_message; + } + + $properties['message'] = $value; + + after_message: + + $value = $payload['documentation_url'] ?? null; + + if ($value === null) { + $properties['documentationUrl'] = null; + goto after_documentationUrl; + } + + $properties['documentationUrl'] = $value; + + after_documentationUrl: + + $value = $payload['url'] ?? null; + + if ($value === null) { + $properties['url'] = null; + goto after_url; + } + + $properties['url'] = $value; + + after_url: + + $value = $payload['status'] ?? null; + + if ($value === null) { + $properties['status'] = null; + goto after_status; + } + + $properties['status'] = $value; + + after_status: + } catch (Throwable $exception) { + throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\BasicError', $exception, stack: $this->hydrationStack); + } + + if (count($missingFields) > 0) { + throw UnableToHydrateObject::dueToMissingFields(BasicError::class, $missingFields, stack: $this->hydrationStack); + } + + try { + return new BasicError(...$properties); + } catch (Throwable $exception) { + throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\BasicError', $exception, stack: $this->hydrationStack); + } + } + + private function hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️Operations⚡️SecretScanning⚡️ListAlertsForEnterprise⚡️Response⚡️ApplicationJson⚡️ServiceUnavailable(array $payload): ServiceUnavailable + { + $properties = []; + $missingFields = []; + try { + $value = $payload['code'] ?? null; + + if ($value === null) { + $properties['code'] = null; + goto after_code; + } + + $properties['code'] = $value; + + after_code: + + $value = $payload['message'] ?? null; + + if ($value === null) { + $properties['message'] = null; + goto after_message; + } + + $properties['message'] = $value; + + after_message: + + $value = $payload['documentation_url'] ?? null; + + if ($value === null) { + $properties['documentationUrl'] = null; + goto after_documentationUrl; + } + + $properties['documentationUrl'] = $value; + + after_documentationUrl: + } catch (Throwable $exception) { + throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\Operations\SecretScanning\ListAlertsForEnterprise\Response\ApplicationJson\ServiceUnavailable', $exception, stack: $this->hydrationStack); + } + + if (count($missingFields) > 0) { + throw UnableToHydrateObject::dueToMissingFields(ServiceUnavailable::class, $missingFields, stack: $this->hydrationStack); + } + + try { + return new ServiceUnavailable(...$properties); + } catch (Throwable $exception) { + throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\Operations\SecretScanning\ListAlertsForEnterprise\Response\ApplicationJson\ServiceUnavailable', $exception, stack: $this->hydrationStack); + } + } + + private function serializeViaTypeMap(string $accessor, object $object, array $payloadToTypeMap): array + { + foreach ($payloadToTypeMap as $payloadType => [$valueType, $method]) { + if (is_a($object, $valueType)) { + return [$accessor => $payloadType] + $this->{$method}($object); + } + } + + throw new LogicException('No type mapped for object of class: ' . $object::class); + } + + public function serializeObject(object $object): mixed + { + return $this->serializeObjectOfType($object, $object::class); + } + + /** + * @param T $object + * @param class-string $className + * + * @template T + */ + public function serializeObjectOfType(object $object, string $className): mixed + { + try { + return match ($className) { + 'array' => $this->serializeValuearray($object), + 'Ramsey\Uuid\UuidInterface' => $this->serializeValueRamsey⚡️Uuid⚡️UuidInterface($object), + 'DateTime' => $this->serializeValueDateTime($object), + 'DateTimeImmutable' => $this->serializeValueDateTimeImmutable($object), + 'DateTimeInterface' => $this->serializeValueDateTimeInterface($object), + 'ApiClients\Client\GitHub\Schema\CodeScanningAutofixCommitsResponse' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeScanningAutofixCommitsResponse($object), + 'ApiClients\Client\GitHub\Schema\BasicError' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️BasicError($object), + 'ApiClients\Client\GitHub\Schema\Operations\SecretScanning\ListAlertsForEnterprise\Response\ApplicationJson\ServiceUnavailable' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️Operations⚡️SecretScanning⚡️ListAlertsForEnterprise⚡️Response⚡️ApplicationJson⚡️ServiceUnavailable($object), + default => throw new LogicException("No serialization defined for $className"), + }; + } catch (Throwable $exception) { + throw UnableToSerializeObject::dueToError($className, $exception); + } + } + + private function serializeValuearray(mixed $value): mixed + { + static $serializer; + + if ($serializer === null) { + $serializer = new SerializeArrayItems(...[]); + } + + return $serializer->serialize($value, $this); + } + + private function serializeValueRamsey⚡️Uuid⚡️UuidInterface(mixed $value): mixed + { + static $serializer; + + if ($serializer === null) { + $serializer = new SerializeUuidToString(...[]); + } + + return $serializer->serialize($value, $this); + } + + private function serializeValueDateTime(mixed $value): mixed + { + static $serializer; + + if ($serializer === null) { + $serializer = new SerializeDateTime(...[]); + } + + return $serializer->serialize($value, $this); + } + + private function serializeValueDateTimeImmutable(mixed $value): mixed + { + static $serializer; + + if ($serializer === null) { + $serializer = new SerializeDateTime(...[]); + } + + return $serializer->serialize($value, $this); + } + + private function serializeValueDateTimeInterface(mixed $value): mixed + { + static $serializer; + + if ($serializer === null) { + $serializer = new SerializeDateTime(...[]); + } + + return $serializer->serialize($value, $this); + } + + private function serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CodeScanningAutofixCommitsResponse(mixed $object): mixed + { + assert($object instanceof CodeScanningAutofixCommitsResponse); + $result = []; + + $targetRef = $object->targetRef; + + if ($targetRef === null) { + goto after_targetRef; + } + + after_targetRef: $result['target_ref'] = $targetRef; + + $sha = $object->sha; + + if ($sha === null) { + goto after_sha; + } + + after_sha: $result['sha'] = $sha; + + return $result; + } + + private function serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️BasicError(mixed $object): mixed + { + assert($object instanceof BasicError); + $result = []; + + $message = $object->message; + + if ($message === null) { + goto after_message; + } + + after_message: $result['message'] = $message; + + $documentationUrl = $object->documentationUrl; + + if ($documentationUrl === null) { + goto after_documentationUrl; + } + + after_documentationUrl: $result['documentation_url'] = $documentationUrl; + + $url = $object->url; + + if ($url === null) { + goto after_url; + } + + after_url: $result['url'] = $url; + + $status = $object->status; + + if ($status === null) { + goto after_status; + } + + after_status: $result['status'] = $status; + + return $result; + } + + private function serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️Operations⚡️SecretScanning⚡️ListAlertsForEnterprise⚡️Response⚡️ApplicationJson⚡️ServiceUnavailable(mixed $object): mixed + { + assert($object instanceof ServiceUnavailable); + $result = []; + + $code = $object->code; + + if ($code === null) { + goto after_code; + } + + after_code: $result['code'] = $code; + + $message = $object->message; + + if ($message === null) { + goto after_message; + } + + after_message: $result['message'] = $message; + + $documentationUrl = $object->documentationUrl; + + if ($documentationUrl === null) { + goto after_documentationUrl; + } + + after_documentationUrl: $result['documentation_url'] = $documentationUrl; + + return $result; + } + + /** + * @param class-string $className + * @param iterable $payloads; + * + * @return IterableList + * + * @throws UnableToHydrateObject + * + * @template T + */ + public function hydrateObjects(string $className, iterable $payloads): IterableList + { + return new IterableList($this->doHydrateObjects($className, $payloads)); + } + + private function doHydrateObjects(string $className, iterable $payloads): Generator + { + foreach ($payloads as $index => $payload) { + yield $index => $this->hydrateObject($className, $payload); + } + } + + /** + * @param class-string $className + * @param iterable $payloads; + * + * @return IterableList + * + * @throws UnableToSerializeObject + * + * @template T + */ + public function serializeObjects(iterable $payloads): IterableList + { + return new IterableList($this->doSerializeObjects($payloads)); + } + + private function doSerializeObjects(iterable $objects): Generator + { + foreach ($objects as $index => $object) { + yield $index => $this->serializeObject($object); + } + } +} diff --git a/clients/GitHub/src/Internal/Hydrators.php b/clients/GitHub/src/Internal/Hydrators.php index 69f15110e50..cec3e82f07e 100644 --- a/clients/GitHub/src/Internal/Hydrators.php +++ b/clients/GitHub/src/Internal/Hydrators.php @@ -38,6 +38,12 @@ final class Hydrators implements ObjectMapper private Internal\Hydrator\Operation\CodesOfConduct|null $operation🌀CodesOfConduct = null; private Internal\Hydrator\Operation\CodesOfConduct\Key|null $operation🌀CodesOfConduct🌀Key = null; private Internal\Hydrator\Operation\Emojis|null $operation🌀Emojis = null; + private Internal\Hydrator\Operation\Enterprises\Enterprise\CodeSecurity\Configurations|null $operation🌀Enterprises🌀Enterprise🌀CodeSecurity🌀Configurations = null; + private Internal\Hydrator\Operation\Enterprises\Enterprise\CodeSecurity\Configurations\Defaults|null $operation🌀Enterprises🌀Enterprise🌀CodeSecurity🌀Configurations🌀Defaults = null; + private Internal\Hydrator\Operation\Enterprises\Enterprise\CodeSecurity\Configurations\ConfigurationId|null $operation🌀Enterprises🌀Enterprise🌀CodeSecurity🌀Configurations🌀ConfigurationId = null; + private Internal\Hydrator\Operation\Enterprises\Enterprise\CodeSecurity\Configurations\ConfigurationId\Attach|null $operation🌀Enterprises🌀Enterprise🌀CodeSecurity🌀Configurations🌀ConfigurationId🌀Attach = null; + private Internal\Hydrator\Operation\Enterprises\Enterprise\CodeSecurity\Configurations\ConfigurationId\Defaults|null $operation🌀Enterprises🌀Enterprise🌀CodeSecurity🌀Configurations🌀ConfigurationId🌀Defaults = null; + private Internal\Hydrator\Operation\Enterprises\Enterprise\CodeSecurity\Configurations\ConfigurationId\Repositories|null $operation🌀Enterprises🌀Enterprise🌀CodeSecurity🌀Configurations🌀ConfigurationId🌀Repositories = null; private Internal\Hydrator\Operation\Enterprises\Enterprise\Dependabot\Alerts|null $operation🌀Enterprises🌀Enterprise🌀Dependabot🌀Alerts = null; private Internal\Hydrator\Operation\Enterprises\Enterprise\SecretScanning\Alerts|null $operation🌀Enterprises🌀Enterprise🌀SecretScanning🌀Alerts = null; private Internal\Hydrator\Operation\Events|null $operation🌀Events = null; @@ -334,6 +340,8 @@ final class Hydrators implements ObjectMapper private Internal\Hydrator\Operation\Repos\Owner\Repo\CheckSuites\CheckSuiteId\Rerequest|null $operation🌀Repos🌀Owner🌀Repo🌀CheckSuites🌀CheckSuiteId🌀Rerequest = null; private Internal\Hydrator\Operation\Repos\Owner\Repo\CodeScanning\Alerts|null $operation🌀Repos🌀Owner🌀Repo🌀CodeScanning🌀Alerts = null; private Internal\Hydrator\Operation\Repos\Owner\Repo\CodeScanning\Alerts\AlertNumber|null $operation🌀Repos🌀Owner🌀Repo🌀CodeScanning🌀Alerts🌀AlertNumber = null; + private Internal\Hydrator\Operation\Repos\Owner\Repo\CodeScanning\Alerts\AlertNumber\Autofix|null $operation🌀Repos🌀Owner🌀Repo🌀CodeScanning🌀Alerts🌀AlertNumber🌀Autofix = null; + private Internal\Hydrator\Operation\Repos\Owner\Repo\CodeScanning\Alerts\AlertNumber\Autofix\Commits|null $operation🌀Repos🌀Owner🌀Repo🌀CodeScanning🌀Alerts🌀AlertNumber🌀Autofix🌀Commits = null; private Internal\Hydrator\Operation\Repos\Owner\Repo\CodeScanning\Alerts\AlertNumber\Instances|null $operation🌀Repos🌀Owner🌀Repo🌀CodeScanning🌀Alerts🌀AlertNumber🌀Instances = null; private Internal\Hydrator\Operation\Repos\Owner\Repo\CodeScanning\Analyses|null $operation🌀Repos🌀Owner🌀Repo🌀CodeScanning🌀Analyses = null; private Internal\Hydrator\Operation\Repos\Owner\Repo\CodeScanning\Analyses\AnalysisId|null $operation🌀Repos🌀Owner🌀Repo🌀CodeScanning🌀Analyses🌀AnalysisId = null; @@ -754,6 +762,9 @@ public function hydrateObject(string $className, array $payload): object '\\ApiClients\\Client\\GitHub\\Schema\\ClassroomAssignment', '\\ApiClients\\Client\\GitHub\\Schema\\SimpleClassroomRepository', '\\ApiClients\\Client\\GitHub\\Schema\\Classroom', '\\ApiClients\\Client\\GitHub\\Schema\\SimpleClassroomOrganization' => $this->getObjectMapperOperation🌀Assignments🌀AssignmentId()->hydrateObject($className, $payload), '\\ApiClients\\Client\\GitHub\\Schema\\CodeOfConduct' => $this->getObjectMapperOperation🌀CodesOfConduct🌀Key()->hydrateObject($className, $payload), '\\ApiClients\\Client\\GitHub\\Schema\\Operations\\Emojis\\Get\\Response\\ApplicationJson\\Ok\\Application\\Json' => $this->getObjectMapperOperation🌀Emojis()->hydrateObject($className, $payload), + '\\ApiClients\\Client\\GitHub\\Schema\\CodeSecurityConfiguration', '\\ApiClients\\Client\\GitHub\\Schema\\CodeSecurityConfiguration\\DependencyGraphAutosubmitActionOptions', '\\ApiClients\\Client\\GitHub\\Schema\\CodeSecurityConfiguration\\CodeScanningDefaultSetupOptions', '\\ApiClients\\Client\\GitHub\\Schema\\CodeSecurityConfiguration\\SecretScanningDelegatedBypassOptions' => $this->getObjectMapperOperation🌀Enterprises🌀Enterprise🌀CodeSecurity🌀Configurations()->hydrateObject($className, $payload), + '\\ApiClients\\Client\\GitHub\\Schema\\Operations\\CodeSecurity\\AttachEnterpriseConfiguration\\Response\\ApplicationJson\\Accepted\\Application\\Json' => $this->getObjectMapperOperation🌀Enterprises🌀Enterprise🌀CodeSecurity🌀Configurations🌀ConfigurationId🌀Attach()->hydrateObject($className, $payload), + '\\ApiClients\\Client\\GitHub\\Schema\\Operations\\CodeSecurity\\SetConfigurationAsDefaultForEnterprise\\Response\\ApplicationJson\\Ok' => $this->getObjectMapperOperation🌀Enterprises🌀Enterprise🌀CodeSecurity🌀Configurations🌀ConfigurationId🌀Defaults()->hydrateObject($className, $payload), '\\ApiClients\\Client\\GitHub\\Schema\\Operations\\SecretScanning\\ListAlertsForEnterprise\\Response\\ApplicationJson\\ServiceUnavailable' => $this->getObjectMapperOperation🌀Enterprises🌀Enterprise🌀SecretScanning🌀Alerts()->hydrateObject($className, $payload), '\\ApiClients\\Client\\GitHub\\Schema\\Feed', '\\ApiClients\\Client\\GitHub\\Schema\\Feed\\Links', '\\ApiClients\\Client\\GitHub\\Schema\\LinkWithType' => $this->getObjectMapperOperation🌀Feeds()->hydrateObject($className, $payload), '\\ApiClients\\Client\\GitHub\\Schema\\GistSimple', '\\ApiClients\\Client\\GitHub\\Schema\\GistSimple\\ForkOf', '\\ApiClients\\Client\\GitHub\\Schema\\GistSimple\\ForkOf\\Files', '\\ApiClients\\Client\\GitHub\\Schema\\GistSimple\\Files' => $this->getObjectMapperOperation🌀Gists()->hydrateObject($className, $payload), @@ -765,7 +776,7 @@ public function hydrateObject(string $className, array $payload): object '\\ApiClients\\Client\\GitHub\\Schema\\Operations\\Apps\\ListReposAccessibleToInstallation\\Response\\ApplicationJson\\Ok' => $this->getObjectMapperOperation🌀Installation🌀Repositories()->hydrateObject($className, $payload), '\\ApiClients\\Client\\GitHub\\Schema\\License' => $this->getObjectMapperOperation🌀Licenses🌀License()->hydrateObject($className, $payload), '\\ApiClients\\Client\\GitHub\\Schema\\MarketplacePurchase', '\\ApiClients\\Client\\GitHub\\Schema\\MarketplacePurchase\\MarketplacePendingChange', '\\ApiClients\\Client\\GitHub\\Schema\\MarketplaceListingPlan', '\\ApiClients\\Client\\GitHub\\Schema\\MarketplacePurchase\\MarketplacePurchase' => $this->getObjectMapperOperation🌀MarketplaceListing🌀Accounts🌀AccountId()->hydrateObject($className, $payload), - '\\ApiClients\\Client\\GitHub\\Schema\\ApiOverview', '\\ApiClients\\Client\\GitHub\\Schema\\ApiOverview\\SshKeyFingerprints', '\\ApiClients\\Client\\GitHub\\Schema\\ApiOverview\\Domains', '\\ApiClients\\Client\\GitHub\\Schema\\ApiOverview\\Domains\\ArtifactAttestations' => $this->getObjectMapperOperation🌀Meta()->hydrateObject($className, $payload), + '\\ApiClients\\Client\\GitHub\\Schema\\ApiOverview', '\\ApiClients\\Client\\GitHub\\Schema\\ApiOverview\\SshKeyFingerprints', '\\ApiClients\\Client\\GitHub\\Schema\\ApiOverview\\Domains', '\\ApiClients\\Client\\GitHub\\Schema\\ApiOverview\\Domains\\ActionsInbound', '\\ApiClients\\Client\\GitHub\\Schema\\ApiOverview\\Domains\\ArtifactAttestations' => $this->getObjectMapperOperation🌀Meta()->hydrateObject($className, $payload), '\\ApiClients\\Client\\GitHub\\Schema\\Operations\\Activity\\MarkNotificationsAsRead\\Response\\ApplicationJson\\Accepted' => $this->getObjectMapperOperation🌀Notifications()->hydrateObject($className, $payload), '\\ApiClients\\Client\\GitHub\\Schema\\Thread', '\\ApiClients\\Client\\GitHub\\Schema\\MinimalRepository', '\\ApiClients\\Client\\GitHub\\Schema\\MinimalRepository\\Permissions', '\\ApiClients\\Client\\GitHub\\Schema\\MinimalRepository\\License', '\\ApiClients\\Client\\GitHub\\Schema\\SecurityAndAnalysis', '\\ApiClients\\Client\\GitHub\\Schema\\SecurityAndAnalysis\\AdvancedSecurity', '\\ApiClients\\Client\\GitHub\\Schema\\SecurityAndAnalysis\\DependabotSecurityUpdates', '\\ApiClients\\Client\\GitHub\\Schema\\SecurityAndAnalysis\\SecretScanning', '\\ApiClients\\Client\\GitHub\\Schema\\SecurityAndAnalysis\\SecretScanningPushProtection', '\\ApiClients\\Client\\GitHub\\Schema\\SecurityAndAnalysis\\SecretScanningNonProviderPatterns', '\\ApiClients\\Client\\GitHub\\Schema\\SecurityAndAnalysis\\SecretScanningAiDetection', '\\ApiClients\\Client\\GitHub\\Schema\\Thread\\Subject' => $this->getObjectMapperOperation🌀Notifications🌀Threads🌀ThreadId()->hydrateObject($className, $payload), '\\ApiClients\\Client\\GitHub\\Schema\\ThreadSubscription' => $this->getObjectMapperOperation🌀Notifications🌀Threads🌀ThreadId🌀Subscription()->hydrateObject($className, $payload), @@ -793,9 +804,8 @@ public function hydrateObject(string $className, array $payload): object '\\ApiClients\\Client\\GitHub\\Schema\\OrganizationActionsVariable' => $this->getObjectMapperOperation🌀Orgs🌀Org🌀Actions🌀Variables🌀Name()->hydrateObject($className, $payload), '\\ApiClients\\Client\\GitHub\\Schema\\Operations\\Actions\\ListSelectedReposForOrgVariable\\Response\\ApplicationJson\\Ok\\Application\\Json' => $this->getObjectMapperOperation🌀Orgs🌀Org🌀Actions🌀Variables🌀Name🌀Repositories()->hydrateObject($className, $payload), '\\ApiClients\\Client\\GitHub\\Schema\\Operations\\Orgs\\ListAttestations\\Response\\ApplicationJson\\Ok' => $this->getObjectMapperOperation🌀Orgs🌀Org🌀Attestations🌀SubjectDigest()->hydrateObject($className, $payload), - '\\ApiClients\\Client\\GitHub\\Schema\\CodeSecurityConfiguration', '\\ApiClients\\Client\\GitHub\\Schema\\CodeSecurityConfiguration\\DependencyGraphAutosubmitActionOptions', '\\ApiClients\\Client\\GitHub\\Schema\\CodeSecurityConfiguration\\CodeScanningDefaultSetupOptions', '\\ApiClients\\Client\\GitHub\\Schema\\CodeSecurityConfiguration\\SecretScanningDelegatedBypassOptions' => $this->getObjectMapperOperation🌀Orgs🌀Org🌀CodeSecurity🌀Configurations()->hydrateObject($className, $payload), '\\ApiClients\\Client\\GitHub\\Schema\\Operations\\CodeSecurity\\AttachConfiguration\\Response\\ApplicationJson\\Accepted\\Application\\Json' => $this->getObjectMapperOperation🌀Orgs🌀Org🌀CodeSecurity🌀Configurations🌀ConfigurationId🌀Attach()->hydrateObject($className, $payload), - '\\ApiClients\\Client\\GitHub\\Schema\\Operations\\CodeSecurity\\SetConfigurationAsDefault\\Response\\ApplicationJson\\Ok' => $this->getObjectMapperOperation🌀Orgs🌀Org🌀CodeSecurity🌀Configurations🌀ConfigurationId🌀Defaults()->hydrateObject($className, $payload), + '\\ApiClients\\Client\\GitHub\\Schema\\Operations\\CodeSecurity\\SetConfigurationAsDefault\\Response\\ApplicationJson\\Ok\\Application\\Json' => $this->getObjectMapperOperation🌀Orgs🌀Org🌀CodeSecurity🌀Configurations🌀ConfigurationId🌀Defaults()->hydrateObject($className, $payload), '\\ApiClients\\Client\\GitHub\\Schema\\Operations\\Codespaces\\ListInOrganization\\Response\\ApplicationJson\\Ok' => $this->getObjectMapperOperation🌀Orgs🌀Org🌀Codespaces()->hydrateObject($className, $payload), '\\ApiClients\\Client\\GitHub\\Schema\\Operations\\Codespaces\\ListOrgSecrets\\Response\\ApplicationJson\\Ok' => $this->getObjectMapperOperation🌀Orgs🌀Org🌀Codespaces🌀Secrets()->hydrateObject($className, $payload), '\\ApiClients\\Client\\GitHub\\Schema\\CodespacesPublicKey' => $this->getObjectMapperOperation🌀Orgs🌀Org🌀Codespaces🌀Secrets🌀PublicKey()->hydrateObject($className, $payload), @@ -889,6 +899,8 @@ public function hydrateObject(string $className, array $payload): object '\\ApiClients\\Client\\GitHub\\Schema\\CheckSuitePreference', '\\ApiClients\\Client\\GitHub\\Schema\\CheckSuitePreference\\Preferences' => $this->getObjectMapperOperation🌀Repos🌀Owner🌀Repo🌀CheckSuites🌀Preferences()->hydrateObject($className, $payload), '\\ApiClients\\Client\\GitHub\\Schema\\Operations\\Checks\\ListForSuite\\Response\\ApplicationJson\\Ok' => $this->getObjectMapperOperation🌀Repos🌀Owner🌀Repo🌀CheckSuites🌀CheckSuiteId🌀CheckRuns()->hydrateObject($className, $payload), '\\ApiClients\\Client\\GitHub\\Schema\\CodeScanningAlert', '\\ApiClients\\Client\\GitHub\\Schema\\CodeScanningAlertRule', '\\ApiClients\\Client\\GitHub\\Schema\\CodeScanningAnalysisTool', '\\ApiClients\\Client\\GitHub\\Schema\\CodeScanningAlertInstance', '\\ApiClients\\Client\\GitHub\\Schema\\CodeScanningAlertInstance\\Message', '\\ApiClients\\Client\\GitHub\\Schema\\CodeScanningAlertLocation' => $this->getObjectMapperOperation🌀Repos🌀Owner🌀Repo🌀CodeScanning🌀Alerts🌀AlertNumber()->hydrateObject($className, $payload), + '\\ApiClients\\Client\\GitHub\\Schema\\CodeScanningAutofix' => $this->getObjectMapperOperation🌀Repos🌀Owner🌀Repo🌀CodeScanning🌀Alerts🌀AlertNumber🌀Autofix()->hydrateObject($className, $payload), + '\\ApiClients\\Client\\GitHub\\Schema\\CodeScanningAutofixCommitsResponse' => $this->getObjectMapperOperation🌀Repos🌀Owner🌀Repo🌀CodeScanning🌀Alerts🌀AlertNumber🌀Autofix🌀Commits()->hydrateObject($className, $payload), '\\ApiClients\\Client\\GitHub\\Schema\\CodeScanningAnalysis', '\\ApiClients\\Client\\GitHub\\Schema\\Operations\\CodeScanning\\GetAnalysis\\Response\\ApplicationJsonSarif\\Ok\\Application\\JsonSarif', '\\ApiClients\\Client\\GitHub\\Schema\\CodeScanningAnalysisDeletion' => $this->getObjectMapperOperation🌀Repos🌀Owner🌀Repo🌀CodeScanning🌀Analyses🌀AnalysisId()->hydrateObject($className, $payload), '\\ApiClients\\Client\\GitHub\\Schema\\CodeScanningCodeqlDatabase' => $this->getObjectMapperOperation🌀Repos🌀Owner🌀Repo🌀CodeScanning🌀Codeql🌀Databases🌀Language()->hydrateObject($className, $payload), '\\ApiClients\\Client\\GitHub\\Schema\\CodeScanningVariantAnalysis', '\\ApiClients\\Client\\GitHub\\Schema\\SimpleRepository', '\\ApiClients\\Client\\GitHub\\Schema\\CodeScanningVariantAnalysis\\SkippedRepositories', '\\ApiClients\\Client\\GitHub\\Schema\\CodeScanningVariantAnalysisSkippedRepoGroup', '\\ApiClients\\Client\\GitHub\\Schema\\CodeScanningVariantAnalysis\\SkippedRepositories\\NotFoundRepos' => $this->getObjectMapperOperation🌀Repos🌀Owner🌀Repo🌀CodeScanning🌀Codeql🌀VariantAnalyses()->hydrateObject($className, $payload), @@ -1115,6 +1127,9 @@ public function serializeObjectOfType(object $object, string $className): mixed '\\ApiClients\\Client\\GitHub\\Schema\\ClassroomAssignment', '\\ApiClients\\Client\\GitHub\\Schema\\SimpleClassroomRepository', '\\ApiClients\\Client\\GitHub\\Schema\\Classroom', '\\ApiClients\\Client\\GitHub\\Schema\\SimpleClassroomOrganization' => $this->getObjectMapperOperation🌀Assignments🌀AssignmentId()->serializeObject($object), '\\ApiClients\\Client\\GitHub\\Schema\\CodeOfConduct' => $this->getObjectMapperOperation🌀CodesOfConduct🌀Key()->serializeObject($object), '\\ApiClients\\Client\\GitHub\\Schema\\Operations\\Emojis\\Get\\Response\\ApplicationJson\\Ok\\Application\\Json' => $this->getObjectMapperOperation🌀Emojis()->serializeObject($object), + '\\ApiClients\\Client\\GitHub\\Schema\\CodeSecurityConfiguration', '\\ApiClients\\Client\\GitHub\\Schema\\CodeSecurityConfiguration\\DependencyGraphAutosubmitActionOptions', '\\ApiClients\\Client\\GitHub\\Schema\\CodeSecurityConfiguration\\CodeScanningDefaultSetupOptions', '\\ApiClients\\Client\\GitHub\\Schema\\CodeSecurityConfiguration\\SecretScanningDelegatedBypassOptions' => $this->getObjectMapperOperation🌀Enterprises🌀Enterprise🌀CodeSecurity🌀Configurations()->serializeObject($object), + '\\ApiClients\\Client\\GitHub\\Schema\\Operations\\CodeSecurity\\AttachEnterpriseConfiguration\\Response\\ApplicationJson\\Accepted\\Application\\Json' => $this->getObjectMapperOperation🌀Enterprises🌀Enterprise🌀CodeSecurity🌀Configurations🌀ConfigurationId🌀Attach()->serializeObject($object), + '\\ApiClients\\Client\\GitHub\\Schema\\Operations\\CodeSecurity\\SetConfigurationAsDefaultForEnterprise\\Response\\ApplicationJson\\Ok' => $this->getObjectMapperOperation🌀Enterprises🌀Enterprise🌀CodeSecurity🌀Configurations🌀ConfigurationId🌀Defaults()->serializeObject($object), '\\ApiClients\\Client\\GitHub\\Schema\\Operations\\SecretScanning\\ListAlertsForEnterprise\\Response\\ApplicationJson\\ServiceUnavailable' => $this->getObjectMapperOperation🌀Enterprises🌀Enterprise🌀SecretScanning🌀Alerts()->serializeObject($object), '\\ApiClients\\Client\\GitHub\\Schema\\Feed', '\\ApiClients\\Client\\GitHub\\Schema\\Feed\\Links', '\\ApiClients\\Client\\GitHub\\Schema\\LinkWithType' => $this->getObjectMapperOperation🌀Feeds()->serializeObject($object), '\\ApiClients\\Client\\GitHub\\Schema\\GistSimple', '\\ApiClients\\Client\\GitHub\\Schema\\GistSimple\\ForkOf', '\\ApiClients\\Client\\GitHub\\Schema\\GistSimple\\ForkOf\\Files', '\\ApiClients\\Client\\GitHub\\Schema\\GistSimple\\Files' => $this->getObjectMapperOperation🌀Gists()->serializeObject($object), @@ -1126,7 +1141,7 @@ public function serializeObjectOfType(object $object, string $className): mixed '\\ApiClients\\Client\\GitHub\\Schema\\Operations\\Apps\\ListReposAccessibleToInstallation\\Response\\ApplicationJson\\Ok' => $this->getObjectMapperOperation🌀Installation🌀Repositories()->serializeObject($object), '\\ApiClients\\Client\\GitHub\\Schema\\License' => $this->getObjectMapperOperation🌀Licenses🌀License()->serializeObject($object), '\\ApiClients\\Client\\GitHub\\Schema\\MarketplacePurchase', '\\ApiClients\\Client\\GitHub\\Schema\\MarketplacePurchase\\MarketplacePendingChange', '\\ApiClients\\Client\\GitHub\\Schema\\MarketplaceListingPlan', '\\ApiClients\\Client\\GitHub\\Schema\\MarketplacePurchase\\MarketplacePurchase' => $this->getObjectMapperOperation🌀MarketplaceListing🌀Accounts🌀AccountId()->serializeObject($object), - '\\ApiClients\\Client\\GitHub\\Schema\\ApiOverview', '\\ApiClients\\Client\\GitHub\\Schema\\ApiOverview\\SshKeyFingerprints', '\\ApiClients\\Client\\GitHub\\Schema\\ApiOverview\\Domains', '\\ApiClients\\Client\\GitHub\\Schema\\ApiOverview\\Domains\\ArtifactAttestations' => $this->getObjectMapperOperation🌀Meta()->serializeObject($object), + '\\ApiClients\\Client\\GitHub\\Schema\\ApiOverview', '\\ApiClients\\Client\\GitHub\\Schema\\ApiOverview\\SshKeyFingerprints', '\\ApiClients\\Client\\GitHub\\Schema\\ApiOverview\\Domains', '\\ApiClients\\Client\\GitHub\\Schema\\ApiOverview\\Domains\\ActionsInbound', '\\ApiClients\\Client\\GitHub\\Schema\\ApiOverview\\Domains\\ArtifactAttestations' => $this->getObjectMapperOperation🌀Meta()->serializeObject($object), '\\ApiClients\\Client\\GitHub\\Schema\\Operations\\Activity\\MarkNotificationsAsRead\\Response\\ApplicationJson\\Accepted' => $this->getObjectMapperOperation🌀Notifications()->serializeObject($object), '\\ApiClients\\Client\\GitHub\\Schema\\Thread', '\\ApiClients\\Client\\GitHub\\Schema\\MinimalRepository', '\\ApiClients\\Client\\GitHub\\Schema\\MinimalRepository\\Permissions', '\\ApiClients\\Client\\GitHub\\Schema\\MinimalRepository\\License', '\\ApiClients\\Client\\GitHub\\Schema\\SecurityAndAnalysis', '\\ApiClients\\Client\\GitHub\\Schema\\SecurityAndAnalysis\\AdvancedSecurity', '\\ApiClients\\Client\\GitHub\\Schema\\SecurityAndAnalysis\\DependabotSecurityUpdates', '\\ApiClients\\Client\\GitHub\\Schema\\SecurityAndAnalysis\\SecretScanning', '\\ApiClients\\Client\\GitHub\\Schema\\SecurityAndAnalysis\\SecretScanningPushProtection', '\\ApiClients\\Client\\GitHub\\Schema\\SecurityAndAnalysis\\SecretScanningNonProviderPatterns', '\\ApiClients\\Client\\GitHub\\Schema\\SecurityAndAnalysis\\SecretScanningAiDetection', '\\ApiClients\\Client\\GitHub\\Schema\\Thread\\Subject' => $this->getObjectMapperOperation🌀Notifications🌀Threads🌀ThreadId()->serializeObject($object), '\\ApiClients\\Client\\GitHub\\Schema\\ThreadSubscription' => $this->getObjectMapperOperation🌀Notifications🌀Threads🌀ThreadId🌀Subscription()->serializeObject($object), @@ -1154,9 +1169,8 @@ public function serializeObjectOfType(object $object, string $className): mixed '\\ApiClients\\Client\\GitHub\\Schema\\OrganizationActionsVariable' => $this->getObjectMapperOperation🌀Orgs🌀Org🌀Actions🌀Variables🌀Name()->serializeObject($object), '\\ApiClients\\Client\\GitHub\\Schema\\Operations\\Actions\\ListSelectedReposForOrgVariable\\Response\\ApplicationJson\\Ok\\Application\\Json' => $this->getObjectMapperOperation🌀Orgs🌀Org🌀Actions🌀Variables🌀Name🌀Repositories()->serializeObject($object), '\\ApiClients\\Client\\GitHub\\Schema\\Operations\\Orgs\\ListAttestations\\Response\\ApplicationJson\\Ok' => $this->getObjectMapperOperation🌀Orgs🌀Org🌀Attestations🌀SubjectDigest()->serializeObject($object), - '\\ApiClients\\Client\\GitHub\\Schema\\CodeSecurityConfiguration', '\\ApiClients\\Client\\GitHub\\Schema\\CodeSecurityConfiguration\\DependencyGraphAutosubmitActionOptions', '\\ApiClients\\Client\\GitHub\\Schema\\CodeSecurityConfiguration\\CodeScanningDefaultSetupOptions', '\\ApiClients\\Client\\GitHub\\Schema\\CodeSecurityConfiguration\\SecretScanningDelegatedBypassOptions' => $this->getObjectMapperOperation🌀Orgs🌀Org🌀CodeSecurity🌀Configurations()->serializeObject($object), '\\ApiClients\\Client\\GitHub\\Schema\\Operations\\CodeSecurity\\AttachConfiguration\\Response\\ApplicationJson\\Accepted\\Application\\Json' => $this->getObjectMapperOperation🌀Orgs🌀Org🌀CodeSecurity🌀Configurations🌀ConfigurationId🌀Attach()->serializeObject($object), - '\\ApiClients\\Client\\GitHub\\Schema\\Operations\\CodeSecurity\\SetConfigurationAsDefault\\Response\\ApplicationJson\\Ok' => $this->getObjectMapperOperation🌀Orgs🌀Org🌀CodeSecurity🌀Configurations🌀ConfigurationId🌀Defaults()->serializeObject($object), + '\\ApiClients\\Client\\GitHub\\Schema\\Operations\\CodeSecurity\\SetConfigurationAsDefault\\Response\\ApplicationJson\\Ok\\Application\\Json' => $this->getObjectMapperOperation🌀Orgs🌀Org🌀CodeSecurity🌀Configurations🌀ConfigurationId🌀Defaults()->serializeObject($object), '\\ApiClients\\Client\\GitHub\\Schema\\Operations\\Codespaces\\ListInOrganization\\Response\\ApplicationJson\\Ok' => $this->getObjectMapperOperation🌀Orgs🌀Org🌀Codespaces()->serializeObject($object), '\\ApiClients\\Client\\GitHub\\Schema\\Operations\\Codespaces\\ListOrgSecrets\\Response\\ApplicationJson\\Ok' => $this->getObjectMapperOperation🌀Orgs🌀Org🌀Codespaces🌀Secrets()->serializeObject($object), '\\ApiClients\\Client\\GitHub\\Schema\\CodespacesPublicKey' => $this->getObjectMapperOperation🌀Orgs🌀Org🌀Codespaces🌀Secrets🌀PublicKey()->serializeObject($object), @@ -1250,6 +1264,8 @@ public function serializeObjectOfType(object $object, string $className): mixed '\\ApiClients\\Client\\GitHub\\Schema\\CheckSuitePreference', '\\ApiClients\\Client\\GitHub\\Schema\\CheckSuitePreference\\Preferences' => $this->getObjectMapperOperation🌀Repos🌀Owner🌀Repo🌀CheckSuites🌀Preferences()->serializeObject($object), '\\ApiClients\\Client\\GitHub\\Schema\\Operations\\Checks\\ListForSuite\\Response\\ApplicationJson\\Ok' => $this->getObjectMapperOperation🌀Repos🌀Owner🌀Repo🌀CheckSuites🌀CheckSuiteId🌀CheckRuns()->serializeObject($object), '\\ApiClients\\Client\\GitHub\\Schema\\CodeScanningAlert', '\\ApiClients\\Client\\GitHub\\Schema\\CodeScanningAlertRule', '\\ApiClients\\Client\\GitHub\\Schema\\CodeScanningAnalysisTool', '\\ApiClients\\Client\\GitHub\\Schema\\CodeScanningAlertInstance', '\\ApiClients\\Client\\GitHub\\Schema\\CodeScanningAlertInstance\\Message', '\\ApiClients\\Client\\GitHub\\Schema\\CodeScanningAlertLocation' => $this->getObjectMapperOperation🌀Repos🌀Owner🌀Repo🌀CodeScanning🌀Alerts🌀AlertNumber()->serializeObject($object), + '\\ApiClients\\Client\\GitHub\\Schema\\CodeScanningAutofix' => $this->getObjectMapperOperation🌀Repos🌀Owner🌀Repo🌀CodeScanning🌀Alerts🌀AlertNumber🌀Autofix()->serializeObject($object), + '\\ApiClients\\Client\\GitHub\\Schema\\CodeScanningAutofixCommitsResponse' => $this->getObjectMapperOperation🌀Repos🌀Owner🌀Repo🌀CodeScanning🌀Alerts🌀AlertNumber🌀Autofix🌀Commits()->serializeObject($object), '\\ApiClients\\Client\\GitHub\\Schema\\CodeScanningAnalysis', '\\ApiClients\\Client\\GitHub\\Schema\\Operations\\CodeScanning\\GetAnalysis\\Response\\ApplicationJsonSarif\\Ok\\Application\\JsonSarif', '\\ApiClients\\Client\\GitHub\\Schema\\CodeScanningAnalysisDeletion' => $this->getObjectMapperOperation🌀Repos🌀Owner🌀Repo🌀CodeScanning🌀Analyses🌀AnalysisId()->serializeObject($object), '\\ApiClients\\Client\\GitHub\\Schema\\CodeScanningCodeqlDatabase' => $this->getObjectMapperOperation🌀Repos🌀Owner🌀Repo🌀CodeScanning🌀Codeql🌀Databases🌀Language()->serializeObject($object), '\\ApiClients\\Client\\GitHub\\Schema\\CodeScanningVariantAnalysis', '\\ApiClients\\Client\\GitHub\\Schema\\SimpleRepository', '\\ApiClients\\Client\\GitHub\\Schema\\CodeScanningVariantAnalysis\\SkippedRepositories', '\\ApiClients\\Client\\GitHub\\Schema\\CodeScanningVariantAnalysisSkippedRepoGroup', '\\ApiClients\\Client\\GitHub\\Schema\\CodeScanningVariantAnalysis\\SkippedRepositories\\NotFoundRepos' => $this->getObjectMapperOperation🌀Repos🌀Owner🌀Repo🌀CodeScanning🌀Codeql🌀VariantAnalyses()->serializeObject($object), @@ -1697,6 +1713,60 @@ public function getObjectMapperOperation🌀Emojis(): Internal\Hydrator\Operatio return $this->operation🌀Emojis; } + public function getObjectMapperOperation🌀Enterprises🌀Enterprise🌀CodeSecurity🌀Configurations(): Internal\Hydrator\Operation\Enterprises\Enterprise\CodeSecurity\Configurations + { + if ($this->operation🌀Enterprises🌀Enterprise🌀CodeSecurity🌀Configurations instanceof Internal\Hydrator\Operation\Enterprises\Enterprise\CodeSecurity\Configurations === false) { + $this->operation🌀Enterprises🌀Enterprise🌀CodeSecurity🌀Configurations = new Internal\Hydrator\Operation\Enterprises\Enterprise\CodeSecurity\Configurations(); + } + + return $this->operation🌀Enterprises🌀Enterprise🌀CodeSecurity🌀Configurations; + } + + public function getObjectMapperOperation🌀Enterprises🌀Enterprise🌀CodeSecurity🌀Configurations🌀Defaults(): Internal\Hydrator\Operation\Enterprises\Enterprise\CodeSecurity\Configurations\Defaults + { + if ($this->operation🌀Enterprises🌀Enterprise🌀CodeSecurity🌀Configurations🌀Defaults instanceof Internal\Hydrator\Operation\Enterprises\Enterprise\CodeSecurity\Configurations\Defaults === false) { + $this->operation🌀Enterprises🌀Enterprise🌀CodeSecurity🌀Configurations🌀Defaults = new Internal\Hydrator\Operation\Enterprises\Enterprise\CodeSecurity\Configurations\Defaults(); + } + + return $this->operation🌀Enterprises🌀Enterprise🌀CodeSecurity🌀Configurations🌀Defaults; + } + + public function getObjectMapperOperation🌀Enterprises🌀Enterprise🌀CodeSecurity🌀Configurations🌀ConfigurationId(): Internal\Hydrator\Operation\Enterprises\Enterprise\CodeSecurity\Configurations\ConfigurationId + { + if ($this->operation🌀Enterprises🌀Enterprise🌀CodeSecurity🌀Configurations🌀ConfigurationId instanceof Internal\Hydrator\Operation\Enterprises\Enterprise\CodeSecurity\Configurations\ConfigurationId === false) { + $this->operation🌀Enterprises🌀Enterprise🌀CodeSecurity🌀Configurations🌀ConfigurationId = new Internal\Hydrator\Operation\Enterprises\Enterprise\CodeSecurity\Configurations\ConfigurationId(); + } + + return $this->operation🌀Enterprises🌀Enterprise🌀CodeSecurity🌀Configurations🌀ConfigurationId; + } + + public function getObjectMapperOperation🌀Enterprises🌀Enterprise🌀CodeSecurity🌀Configurations🌀ConfigurationId🌀Attach(): Internal\Hydrator\Operation\Enterprises\Enterprise\CodeSecurity\Configurations\ConfigurationId\Attach + { + if ($this->operation🌀Enterprises🌀Enterprise🌀CodeSecurity🌀Configurations🌀ConfigurationId🌀Attach instanceof Internal\Hydrator\Operation\Enterprises\Enterprise\CodeSecurity\Configurations\ConfigurationId\Attach === false) { + $this->operation🌀Enterprises🌀Enterprise🌀CodeSecurity🌀Configurations🌀ConfigurationId🌀Attach = new Internal\Hydrator\Operation\Enterprises\Enterprise\CodeSecurity\Configurations\ConfigurationId\Attach(); + } + + return $this->operation🌀Enterprises🌀Enterprise🌀CodeSecurity🌀Configurations🌀ConfigurationId🌀Attach; + } + + public function getObjectMapperOperation🌀Enterprises🌀Enterprise🌀CodeSecurity🌀Configurations🌀ConfigurationId🌀Defaults(): Internal\Hydrator\Operation\Enterprises\Enterprise\CodeSecurity\Configurations\ConfigurationId\Defaults + { + if ($this->operation🌀Enterprises🌀Enterprise🌀CodeSecurity🌀Configurations🌀ConfigurationId🌀Defaults instanceof Internal\Hydrator\Operation\Enterprises\Enterprise\CodeSecurity\Configurations\ConfigurationId\Defaults === false) { + $this->operation🌀Enterprises🌀Enterprise🌀CodeSecurity🌀Configurations🌀ConfigurationId🌀Defaults = new Internal\Hydrator\Operation\Enterprises\Enterprise\CodeSecurity\Configurations\ConfigurationId\Defaults(); + } + + return $this->operation🌀Enterprises🌀Enterprise🌀CodeSecurity🌀Configurations🌀ConfigurationId🌀Defaults; + } + + public function getObjectMapperOperation🌀Enterprises🌀Enterprise🌀CodeSecurity🌀Configurations🌀ConfigurationId🌀Repositories(): Internal\Hydrator\Operation\Enterprises\Enterprise\CodeSecurity\Configurations\ConfigurationId\Repositories + { + if ($this->operation🌀Enterprises🌀Enterprise🌀CodeSecurity🌀Configurations🌀ConfigurationId🌀Repositories instanceof Internal\Hydrator\Operation\Enterprises\Enterprise\CodeSecurity\Configurations\ConfigurationId\Repositories === false) { + $this->operation🌀Enterprises🌀Enterprise🌀CodeSecurity🌀Configurations🌀ConfigurationId🌀Repositories = new Internal\Hydrator\Operation\Enterprises\Enterprise\CodeSecurity\Configurations\ConfigurationId\Repositories(); + } + + return $this->operation🌀Enterprises🌀Enterprise🌀CodeSecurity🌀Configurations🌀ConfigurationId🌀Repositories; + } + public function getObjectMapperOperation🌀Enterprises🌀Enterprise🌀Dependabot🌀Alerts(): Internal\Hydrator\Operation\Enterprises\Enterprise\Dependabot\Alerts { if ($this->operation🌀Enterprises🌀Enterprise🌀Dependabot🌀Alerts instanceof Internal\Hydrator\Operation\Enterprises\Enterprise\Dependabot\Alerts === false) { @@ -4361,6 +4431,24 @@ public function getObjectMapperOperation🌀Repos🌀Owner🌀Repo🌀CodeScanni return $this->operation🌀Repos🌀Owner🌀Repo🌀CodeScanning🌀Alerts🌀AlertNumber; } + public function getObjectMapperOperation🌀Repos🌀Owner🌀Repo🌀CodeScanning🌀Alerts🌀AlertNumber🌀Autofix(): Internal\Hydrator\Operation\Repos\Owner\Repo\CodeScanning\Alerts\AlertNumber\Autofix + { + if ($this->operation🌀Repos🌀Owner🌀Repo🌀CodeScanning🌀Alerts🌀AlertNumber🌀Autofix instanceof Internal\Hydrator\Operation\Repos\Owner\Repo\CodeScanning\Alerts\AlertNumber\Autofix === false) { + $this->operation🌀Repos🌀Owner🌀Repo🌀CodeScanning🌀Alerts🌀AlertNumber🌀Autofix = new Internal\Hydrator\Operation\Repos\Owner\Repo\CodeScanning\Alerts\AlertNumber\Autofix(); + } + + return $this->operation🌀Repos🌀Owner🌀Repo🌀CodeScanning🌀Alerts🌀AlertNumber🌀Autofix; + } + + public function getObjectMapperOperation🌀Repos🌀Owner🌀Repo🌀CodeScanning🌀Alerts🌀AlertNumber🌀Autofix🌀Commits(): Internal\Hydrator\Operation\Repos\Owner\Repo\CodeScanning\Alerts\AlertNumber\Autofix\Commits + { + if ($this->operation🌀Repos🌀Owner🌀Repo🌀CodeScanning🌀Alerts🌀AlertNumber🌀Autofix🌀Commits instanceof Internal\Hydrator\Operation\Repos\Owner\Repo\CodeScanning\Alerts\AlertNumber\Autofix\Commits === false) { + $this->operation🌀Repos🌀Owner🌀Repo🌀CodeScanning🌀Alerts🌀AlertNumber🌀Autofix🌀Commits = new Internal\Hydrator\Operation\Repos\Owner\Repo\CodeScanning\Alerts\AlertNumber\Autofix\Commits(); + } + + return $this->operation🌀Repos🌀Owner🌀Repo🌀CodeScanning🌀Alerts🌀AlertNumber🌀Autofix🌀Commits; + } + public function getObjectMapperOperation🌀Repos🌀Owner🌀Repo🌀CodeScanning🌀Alerts🌀AlertNumber🌀Instances(): Internal\Hydrator\Operation\Repos\Owner\Repo\CodeScanning\Alerts\AlertNumber\Instances { if ($this->operation🌀Repos🌀Owner🌀Repo🌀CodeScanning🌀Alerts🌀AlertNumber🌀Instances instanceof Internal\Hydrator\Operation\Repos\Owner\Repo\CodeScanning\Alerts\AlertNumber\Instances === false) { diff --git a/clients/GitHub/src/Internal/Operation/CodeScanning/CommitAutofix.php b/clients/GitHub/src/Internal/Operation/CodeScanning/CommitAutofix.php new file mode 100644 index 00000000000..672366feb6c --- /dev/null +++ b/clients/GitHub/src/Internal/Operation/CodeScanning/CommitAutofix.php @@ -0,0 +1,110 @@ +owner = $owner; + $this->repo = $repo; + $this->alertNumber = $alertNumber; + } + + public function createRequest(array $data): RequestInterface + { + $this->requestSchemaValidator->validate($data, Reader::readFromJson(Schema\CodeScanningAutofixCommits::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + + return new Request('POST', str_replace(['{owner}', '{repo}', '{alert_number}'], [$this->owner, $this->repo, $this->alertNumber], '/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/commits'), ['Content-Type' => 'application/json'], json_encode($data)); + } + + public function createResponse(ResponseInterface $response): Schema\CodeScanningAutofixCommitsResponse|WithoutBody + { + $code = $response->getStatusCode(); + [$contentType] = explode(';', $response->getHeaderLine('Content-Type')); + switch ($contentType) { + case 'application/json': + $body = json_decode($response->getBody()->getContents(), true); + switch ($code) { + /** + * Created + **/ + case 201: + $this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\CodeScanningAutofixCommitsResponse::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + + return $this->hydrator->hydrateObject(Schema\CodeScanningAutofixCommitsResponse::class, $body); + /** + * Bad Request + **/ + + case 400: + $this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\BasicError::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + + throw new ErrorSchemas\BasicError(400, $this->hydrator->hydrateObject(Schema\BasicError::class, $body)); + /** + * Response if the repository is archived or if GitHub Advanced Security is not enabled for this repository + **/ + + case 403: + $this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\BasicError::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + + throw new ErrorSchemas\BasicError(403, $this->hydrator->hydrateObject(Schema\BasicError::class, $body)); + /** + * Resource not found + **/ + + case 404: + $this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\BasicError::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + + throw new ErrorSchemas\BasicError(404, $this->hydrator->hydrateObject(Schema\BasicError::class, $body)); + /** + * Service unavailable + **/ + + case 503: + $this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\Operations\SecretScanning\ListAlertsForEnterprise\Response\ApplicationJson\ServiceUnavailable::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + + throw new ErrorSchemas\Operations\SecretScanning\ListAlertsForEnterprise\Response\ApplicationJson\ServiceUnavailable(503, $this->hydrator->hydrateObject(Schema\Operations\SecretScanning\ListAlertsForEnterprise\Response\ApplicationJson\ServiceUnavailable::class, $body)); + } + + break; + } + + switch ($code) { + /** + * Unprocessable Entity + **/ + case 422: + return new WithoutBody(422, []); + } + + throw new RuntimeException('Unable to find matching response code and content type'); + } +} diff --git a/clients/GitHub/src/Internal/Operation/CodeScanning/CreateAutofix.php b/clients/GitHub/src/Internal/Operation/CodeScanning/CreateAutofix.php new file mode 100644 index 00000000000..3711dbe2e79 --- /dev/null +++ b/clients/GitHub/src/Internal/Operation/CodeScanning/CreateAutofix.php @@ -0,0 +1,115 @@ +owner = $owner; + $this->repo = $repo; + $this->alertNumber = $alertNumber; + } + + public function createRequest(): RequestInterface + { + return new Request('POST', str_replace(['{owner}', '{repo}', '{alert_number}'], [$this->owner, $this->repo, $this->alertNumber], '/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix')); + } + + public function createResponse(ResponseInterface $response): Schema\CodeScanningAutofix|WithoutBody + { + $code = $response->getStatusCode(); + [$contentType] = explode(';', $response->getHeaderLine('Content-Type')); + switch ($contentType) { + case 'application/json': + $body = json_decode($response->getBody()->getContents(), true); + switch ($code) { + /** + * OK + **/ + case 200: + $this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\CodeScanningAutofix::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + + return $this->hydrator->hydrateObject(Schema\CodeScanningAutofix::class, $body); + /** + * Accepted + **/ + + case 202: + $this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\CodeScanningAutofix::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + + return $this->hydrator->hydrateObject(Schema\CodeScanningAutofix::class, $body); + /** + * Bad Request + **/ + + case 400: + $this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\BasicError::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + + throw new ErrorSchemas\BasicError(400, $this->hydrator->hydrateObject(Schema\BasicError::class, $body)); + /** + * Response if the repository is archived, if GitHub Advanced Security is not enabled for this repository or if rate limit is exceeded + **/ + + case 403: + $this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\BasicError::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + + throw new ErrorSchemas\BasicError(403, $this->hydrator->hydrateObject(Schema\BasicError::class, $body)); + /** + * Resource not found + **/ + + case 404: + $this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\BasicError::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + + throw new ErrorSchemas\BasicError(404, $this->hydrator->hydrateObject(Schema\BasicError::class, $body)); + /** + * Service unavailable + **/ + + case 503: + $this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\Operations\SecretScanning\ListAlertsForEnterprise\Response\ApplicationJson\ServiceUnavailable::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + + throw new ErrorSchemas\Operations\SecretScanning\ListAlertsForEnterprise\Response\ApplicationJson\ServiceUnavailable(503, $this->hydrator->hydrateObject(Schema\Operations\SecretScanning\ListAlertsForEnterprise\Response\ApplicationJson\ServiceUnavailable::class, $body)); + } + + break; + } + + switch ($code) { + /** + * Unprocessable Entity + **/ + case 422: + return new WithoutBody(422, []); + } + + throw new RuntimeException('Unable to find matching response code and content type'); + } +} diff --git a/clients/GitHub/src/Internal/Operation/CodeScanning/GetAutofix.php b/clients/GitHub/src/Internal/Operation/CodeScanning/GetAutofix.php new file mode 100644 index 00000000000..07980e20903 --- /dev/null +++ b/clients/GitHub/src/Internal/Operation/CodeScanning/GetAutofix.php @@ -0,0 +1,98 @@ +owner = $owner; + $this->repo = $repo; + $this->alertNumber = $alertNumber; + } + + public function createRequest(): RequestInterface + { + return new Request('GET', str_replace(['{owner}', '{repo}', '{alert_number}'], [$this->owner, $this->repo, $this->alertNumber], '/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix')); + } + + public function createResponse(ResponseInterface $response): Schema\CodeScanningAutofix + { + $code = $response->getStatusCode(); + [$contentType] = explode(';', $response->getHeaderLine('Content-Type')); + switch ($contentType) { + case 'application/json': + $body = json_decode($response->getBody()->getContents(), true); + switch ($code) { + /** + * Response + **/ + case 200: + $this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\CodeScanningAutofix::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + + return $this->hydrator->hydrateObject(Schema\CodeScanningAutofix::class, $body); + /** + * Bad Request + **/ + + case 400: + $this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\BasicError::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + + throw new ErrorSchemas\BasicError(400, $this->hydrator->hydrateObject(Schema\BasicError::class, $body)); + /** + * Response if GitHub Advanced Security is not enabled for this repository + **/ + + case 403: + $this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\BasicError::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + + throw new ErrorSchemas\BasicError(403, $this->hydrator->hydrateObject(Schema\BasicError::class, $body)); + /** + * Resource not found + **/ + + case 404: + $this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\BasicError::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + + throw new ErrorSchemas\BasicError(404, $this->hydrator->hydrateObject(Schema\BasicError::class, $body)); + /** + * Service unavailable + **/ + + case 503: + $this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\Operations\SecretScanning\ListAlertsForEnterprise\Response\ApplicationJson\ServiceUnavailable::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + + throw new ErrorSchemas\Operations\SecretScanning\ListAlertsForEnterprise\Response\ApplicationJson\ServiceUnavailable(503, $this->hydrator->hydrateObject(Schema\Operations\SecretScanning\ListAlertsForEnterprise\Response\ApplicationJson\ServiceUnavailable::class, $body)); + } + + break; + } + + throw new RuntimeException('Unable to find matching response code and content type'); + } +} diff --git a/clients/GitHub/src/Internal/Operation/CodeSecurity/AttachEnterpriseConfiguration.php b/clients/GitHub/src/Internal/Operation/CodeSecurity/AttachEnterpriseConfiguration.php new file mode 100644 index 00000000000..b2dbe1d6d35 --- /dev/null +++ b/clients/GitHub/src/Internal/Operation/CodeSecurity/AttachEnterpriseConfiguration.php @@ -0,0 +1,90 @@ +enterprise = $enterprise; + $this->configurationId = $configurationId; + } + + public function createRequest(array $data): RequestInterface + { + $this->requestSchemaValidator->validate($data, Reader::readFromJson(Schema\CodeSecurity\AttachEnterpriseConfiguration\Request\ApplicationJson::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + + return new Request('POST', str_replace(['{enterprise}', '{configuration_id}'], [$this->enterprise, $this->configurationId], '/enterprises/{enterprise}/code-security/configurations/{configuration_id}/attach'), ['Content-Type' => 'application/json'], json_encode($data)); + } + + public function createResponse(ResponseInterface $response): Schema\Operations\CodeSecurity\AttachEnterpriseConfiguration\Response\ApplicationJson\Accepted\Application\Json + { + $code = $response->getStatusCode(); + [$contentType] = explode(';', $response->getHeaderLine('Content-Type')); + switch ($contentType) { + case 'application/json': + $body = json_decode($response->getBody()->getContents(), true); + switch ($code) { + /** + * Accepted + **/ + case 202: + $this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\Operations\CodeSecurity\AttachEnterpriseConfiguration\Response\ApplicationJson\Accepted\Application\Json::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + + return $this->hydrator->hydrateObject(Schema\Operations\CodeSecurity\AttachEnterpriseConfiguration\Response\ApplicationJson\Accepted\Application\Json::class, $body); + /** + * Forbidden + **/ + + case 403: + $this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\BasicError::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + + throw new ErrorSchemas\BasicError(403, $this->hydrator->hydrateObject(Schema\BasicError::class, $body)); + /** + * Resource not found + **/ + + case 404: + $this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\BasicError::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + + throw new ErrorSchemas\BasicError(404, $this->hydrator->hydrateObject(Schema\BasicError::class, $body)); + /** + * Conflict + **/ + + case 409: + $this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\BasicError::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + + throw new ErrorSchemas\BasicError(409, $this->hydrator->hydrateObject(Schema\BasicError::class, $body)); + } + + break; + } + + throw new RuntimeException('Unable to find matching response code and content type'); + } +} diff --git a/clients/GitHub/src/Internal/Operation/CodeSecurity/CreateConfigurationForEnterprise.php b/clients/GitHub/src/Internal/Operation/CodeSecurity/CreateConfigurationForEnterprise.php new file mode 100644 index 00000000000..159101bb111 --- /dev/null +++ b/clients/GitHub/src/Internal/Operation/CodeSecurity/CreateConfigurationForEnterprise.php @@ -0,0 +1,100 @@ +enterprise = $enterprise; + } + + public function createRequest(array $data): RequestInterface + { + $this->requestSchemaValidator->validate($data, Reader::readFromJson(Schema\CodeSecurity\CreateConfigurationForEnterprise\Request\ApplicationJson::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + + return new Request('POST', str_replace(['{enterprise}'], [$this->enterprise], '/enterprises/{enterprise}/code-security/configurations'), ['Content-Type' => 'application/json'], json_encode($data)); + } + + public function createResponse(ResponseInterface $response): Schema\CodeSecurityConfiguration + { + $code = $response->getStatusCode(); + [$contentType] = explode(';', $response->getHeaderLine('Content-Type')); + switch ($contentType) { + case 'application/json': + $body = json_decode($response->getBody()->getContents(), true); + switch ($code) { + /** + * Successfully created code security configuration + **/ + case 201: + $this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\CodeSecurityConfiguration::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + + return $this->hydrator->hydrateObject(Schema\CodeSecurityConfiguration::class, $body); + /** + * Bad Request + **/ + + case 400: + $this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\BasicError::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + + throw new ErrorSchemas\BasicError(400, $this->hydrator->hydrateObject(Schema\BasicError::class, $body)); + /** + * Forbidden + **/ + + case 403: + $this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\BasicError::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + + throw new ErrorSchemas\BasicError(403, $this->hydrator->hydrateObject(Schema\BasicError::class, $body)); + /** + * Resource not found + **/ + + case 404: + $this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\BasicError::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + + throw new ErrorSchemas\BasicError(404, $this->hydrator->hydrateObject(Schema\BasicError::class, $body)); + } + + break; + case 'application/scim+json': + $body = json_decode($response->getBody()->getContents(), true); + switch ($code) { + /** + * Bad Request + **/ + case 400: + $this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\ScimError::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + + throw new ErrorSchemas\ScimError(400, $this->hydrator->hydrateObject(Schema\ScimError::class, $body)); + } + + break; + } + + throw new RuntimeException('Unable to find matching response code and content type'); + } +} diff --git a/clients/GitHub/src/Internal/Operation/CodeSecurity/DeleteConfigurationForEnterprise.php b/clients/GitHub/src/Internal/Operation/CodeSecurity/DeleteConfigurationForEnterprise.php new file mode 100644 index 00000000000..50ff427f952 --- /dev/null +++ b/clients/GitHub/src/Internal/Operation/CodeSecurity/DeleteConfigurationForEnterprise.php @@ -0,0 +1,109 @@ +enterprise = $enterprise; + $this->configurationId = $configurationId; + } + + public function createRequest(): RequestInterface + { + return new Request('DELETE', str_replace(['{enterprise}', '{configuration_id}'], [$this->enterprise, $this->configurationId], '/enterprises/{enterprise}/code-security/configurations/{configuration_id}')); + } + + public function createResponse(ResponseInterface $response): WithoutBody + { + $code = $response->getStatusCode(); + [$contentType] = explode(';', $response->getHeaderLine('Content-Type')); + switch ($contentType) { + case 'application/json': + $body = json_decode($response->getBody()->getContents(), true); + switch ($code) { + /** + * Bad Request + **/ + case 400: + $this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\BasicError::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + + throw new ErrorSchemas\BasicError(400, $this->hydrator->hydrateObject(Schema\BasicError::class, $body)); + /** + * Forbidden + **/ + + case 403: + $this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\BasicError::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + + throw new ErrorSchemas\BasicError(403, $this->hydrator->hydrateObject(Schema\BasicError::class, $body)); + /** + * Resource not found + **/ + + case 404: + $this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\BasicError::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + + throw new ErrorSchemas\BasicError(404, $this->hydrator->hydrateObject(Schema\BasicError::class, $body)); + /** + * Conflict + **/ + + case 409: + $this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\BasicError::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + + throw new ErrorSchemas\BasicError(409, $this->hydrator->hydrateObject(Schema\BasicError::class, $body)); + } + + break; + case 'application/scim+json': + $body = json_decode($response->getBody()->getContents(), true); + switch ($code) { + /** + * Bad Request + **/ + case 400: + $this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\ScimError::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + + throw new ErrorSchemas\ScimError(400, $this->hydrator->hydrateObject(Schema\ScimError::class, $body)); + } + + break; + } + + switch ($code) { + /** + * A header with no content is returned. + **/ + case 204: + return new WithoutBody(204, []); + } + + throw new RuntimeException('Unable to find matching response code and content type'); + } +} diff --git a/clients/GitHub/src/Internal/Operation/CodeSecurity/GetConfigurationsForEnterprise.php b/clients/GitHub/src/Internal/Operation/CodeSecurity/GetConfigurationsForEnterprise.php new file mode 100644 index 00000000000..2e70e813661 --- /dev/null +++ b/clients/GitHub/src/Internal/Operation/CodeSecurity/GetConfigurationsForEnterprise.php @@ -0,0 +1,99 @@ +enterprise = $enterprise; + $this->before = $before; + $this->after = $after; + $this->perPage = $perPage; + } + + public function createRequest(): RequestInterface + { + return new Request('GET', str_replace(['{enterprise}', '{before}', '{after}', '{per_page}'], [$this->enterprise, $this->before, $this->after, $this->perPage], '/enterprises/{enterprise}/code-security/configurations' . '?before={before}&after={after}&per_page={per_page}')); + } + + /** @return Observable */ + public function createResponse(ResponseInterface $response): Observable + { + $code = $response->getStatusCode(); + [$contentType] = explode(';', $response->getHeaderLine('Content-Type')); + switch ($contentType) { + case 'application/json': + $body = json_decode($response->getBody()->getContents(), true); + switch ($code) { + /** + * Response + **/ + case 200: + return Observable::fromArray($body, new ImmediateScheduler())->map(function (array $body): Schema\CodeSecurityConfiguration { + $error = new RuntimeException(); + try { + $this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\CodeSecurityConfiguration::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema')); + + return $this->hydrator->hydrateObject(Schema\CodeSecurityConfiguration::class, $body); + } catch (Throwable $error) { + goto items_application_json_two_hundred_aaaaa; + } + + items_application_json_two_hundred_aaaaa: + throw $error; + }); + /** + * Forbidden + **/ + + case 403: + $this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\BasicError::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + + throw new ErrorSchemas\BasicError(403, $this->hydrator->hydrateObject(Schema\BasicError::class, $body)); + /** + * Resource not found + **/ + + case 404: + $this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\BasicError::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + + throw new ErrorSchemas\BasicError(404, $this->hydrator->hydrateObject(Schema\BasicError::class, $body)); + } + + break; + } + + throw new RuntimeException('Unable to find matching response code and content type'); + } +} diff --git a/clients/GitHub/src/Internal/Operation/CodeSecurity/GetDefaultConfigurationsForEnterprise.php b/clients/GitHub/src/Internal/Operation/CodeSecurity/GetDefaultConfigurationsForEnterprise.php new file mode 100644 index 00000000000..f3295ab8507 --- /dev/null +++ b/clients/GitHub/src/Internal/Operation/CodeSecurity/GetDefaultConfigurationsForEnterprise.php @@ -0,0 +1,73 @@ +enterprise = $enterprise; + } + + public function createRequest(): RequestInterface + { + return new Request('GET', str_replace(['{enterprise}'], [$this->enterprise], '/enterprises/{enterprise}/code-security/configurations/defaults')); + } + + /** @return Observable */ + public function createResponse(ResponseInterface $response): Observable + { + $code = $response->getStatusCode(); + [$contentType] = explode(';', $response->getHeaderLine('Content-Type')); + switch ($contentType) { + case 'application/json': + $body = json_decode($response->getBody()->getContents(), true); + switch ($code) { + /** + * Response + **/ + case 200: + return Observable::fromArray($body, new ImmediateScheduler())->map(function (array $body): Schema\CodeSecurityDefaultConfigurations { + $error = new RuntimeException(); + try { + $this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\CodeSecurityDefaultConfigurations::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema')); + + return $this->hydrator->hydrateObject(Schema\CodeSecurityDefaultConfigurations::class, $body); + } catch (Throwable $error) { + goto items_application_json_two_hundred_aaaaa; + } + + items_application_json_two_hundred_aaaaa: + throw $error; + }); + } + + break; + } + + throw new RuntimeException('Unable to find matching response code and content type'); + } +} diff --git a/clients/GitHub/src/Internal/Operation/CodeSecurity/GetRepositoriesForEnterpriseConfiguration.php b/clients/GitHub/src/Internal/Operation/CodeSecurity/GetRepositoriesForEnterpriseConfiguration.php new file mode 100644 index 00000000000..d4a54cdd512 --- /dev/null +++ b/clients/GitHub/src/Internal/Operation/CodeSecurity/GetRepositoriesForEnterpriseConfiguration.php @@ -0,0 +1,107 @@ +enterprise = $enterprise; + $this->configurationId = $configurationId; + $this->before = $before; + $this->after = $after; + $this->perPage = $perPage; + $this->status = $status; + } + + public function createRequest(): RequestInterface + { + return new Request('GET', str_replace(['{enterprise}', '{configuration_id}', '{before}', '{after}', '{per_page}', '{status}'], [$this->enterprise, $this->configurationId, $this->before, $this->after, $this->perPage, $this->status], '/enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories' . '?before={before}&after={after}&per_page={per_page}&status={status}')); + } + + /** @return Observable */ + public function createResponse(ResponseInterface $response): Observable + { + $code = $response->getStatusCode(); + [$contentType] = explode(';', $response->getHeaderLine('Content-Type')); + switch ($contentType) { + case 'application/json': + $body = json_decode($response->getBody()->getContents(), true); + switch ($code) { + /** + * Response + **/ + case 200: + return Observable::fromArray($body, new ImmediateScheduler())->map(function (array $body): Schema\CodeSecurityConfigurationRepositories { + $error = new RuntimeException(); + try { + $this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\CodeSecurityConfigurationRepositories::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema')); + + return $this->hydrator->hydrateObject(Schema\CodeSecurityConfigurationRepositories::class, $body); + } catch (Throwable $error) { + goto items_application_json_two_hundred_aaaaa; + } + + items_application_json_two_hundred_aaaaa: + throw $error; + }); + /** + * Forbidden + **/ + + case 403: + $this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\BasicError::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + + throw new ErrorSchemas\BasicError(403, $this->hydrator->hydrateObject(Schema\BasicError::class, $body)); + /** + * Resource not found + **/ + + case 404: + $this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\BasicError::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + + throw new ErrorSchemas\BasicError(404, $this->hydrator->hydrateObject(Schema\BasicError::class, $body)); + } + + break; + } + + throw new RuntimeException('Unable to find matching response code and content type'); + } +} diff --git a/clients/GitHub/src/Internal/Operation/CodeSecurity/GetSingleConfigurationForEnterprise.php b/clients/GitHub/src/Internal/Operation/CodeSecurity/GetSingleConfigurationForEnterprise.php new file mode 100644 index 00000000000..bac8d8de8a3 --- /dev/null +++ b/clients/GitHub/src/Internal/Operation/CodeSecurity/GetSingleConfigurationForEnterprise.php @@ -0,0 +1,88 @@ +enterprise = $enterprise; + $this->configurationId = $configurationId; + } + + public function createRequest(): RequestInterface + { + return new Request('GET', str_replace(['{enterprise}', '{configuration_id}'], [$this->enterprise, $this->configurationId], '/enterprises/{enterprise}/code-security/configurations/{configuration_id}')); + } + + public function createResponse(ResponseInterface $response): Schema\CodeSecurityConfiguration|WithoutBody + { + $code = $response->getStatusCode(); + [$contentType] = explode(';', $response->getHeaderLine('Content-Type')); + switch ($contentType) { + case 'application/json': + $body = json_decode($response->getBody()->getContents(), true); + switch ($code) { + /** + * Response + **/ + case 200: + $this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\CodeSecurityConfiguration::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + + return $this->hydrator->hydrateObject(Schema\CodeSecurityConfiguration::class, $body); + /** + * Forbidden + **/ + + case 403: + $this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\BasicError::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + + throw new ErrorSchemas\BasicError(403, $this->hydrator->hydrateObject(Schema\BasicError::class, $body)); + /** + * Resource not found + **/ + + case 404: + $this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\BasicError::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + + throw new ErrorSchemas\BasicError(404, $this->hydrator->hydrateObject(Schema\BasicError::class, $body)); + } + + break; + } + + switch ($code) { + /** + * Not modified + **/ + case 304: + return new WithoutBody(304, []); + } + + throw new RuntimeException('Unable to find matching response code and content type'); + } +} diff --git a/clients/GitHub/src/Internal/Operation/CodeSecurity/SetConfigurationAsDefault.php b/clients/GitHub/src/Internal/Operation/CodeSecurity/SetConfigurationAsDefault.php index 6d4932b4f68..dc18ca1ce4c 100644 --- a/clients/GitHub/src/Internal/Operation/CodeSecurity/SetConfigurationAsDefault.php +++ b/clients/GitHub/src/Internal/Operation/CodeSecurity/SetConfigurationAsDefault.php @@ -41,7 +41,7 @@ public function createRequest(array $data): RequestInterface return new Request('PUT', str_replace(['{org}', '{configuration_id}'], [$this->org, $this->configurationId], '/orgs/{org}/code-security/configurations/{configuration_id}/defaults'), ['Content-Type' => 'application/json'], json_encode($data)); } - public function createResponse(ResponseInterface $response): Schema\Operations\CodeSecurity\SetConfigurationAsDefault\Response\ApplicationJson\Ok + public function createResponse(ResponseInterface $response): Schema\Operations\CodeSecurity\SetConfigurationAsDefault\Response\ApplicationJson\Ok\Application\Json { $code = $response->getStatusCode(); [$contentType] = explode(';', $response->getHeaderLine('Content-Type')); @@ -53,9 +53,9 @@ public function createResponse(ResponseInterface $response): Schema\Operations\C * Default successfully changed. **/ case 200: - $this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\Operations\CodeSecurity\SetConfigurationAsDefault\Response\ApplicationJson\Ok::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + $this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\Operations\CodeSecurity\SetConfigurationAsDefault\Response\ApplicationJson\Ok\Application\Json::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); - return $this->hydrator->hydrateObject(Schema\Operations\CodeSecurity\SetConfigurationAsDefault\Response\ApplicationJson\Ok::class, $body); + return $this->hydrator->hydrateObject(Schema\Operations\CodeSecurity\SetConfigurationAsDefault\Response\ApplicationJson\Ok\Application\Json::class, $body); /** * Forbidden **/ diff --git a/clients/GitHub/src/Internal/Operation/CodeSecurity/SetConfigurationAsDefaultForEnterprise.php b/clients/GitHub/src/Internal/Operation/CodeSecurity/SetConfigurationAsDefaultForEnterprise.php new file mode 100644 index 00000000000..3f116025f13 --- /dev/null +++ b/clients/GitHub/src/Internal/Operation/CodeSecurity/SetConfigurationAsDefaultForEnterprise.php @@ -0,0 +1,82 @@ +enterprise = $enterprise; + $this->configurationId = $configurationId; + } + + public function createRequest(array $data): RequestInterface + { + $this->requestSchemaValidator->validate($data, Reader::readFromJson(Schema\CodeSecurity\SetConfigurationAsDefaultForEnterprise\Request\ApplicationJson::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + + return new Request('PUT', str_replace(['{enterprise}', '{configuration_id}'], [$this->enterprise, $this->configurationId], '/enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults'), ['Content-Type' => 'application/json'], json_encode($data)); + } + + public function createResponse(ResponseInterface $response): Schema\Operations\CodeSecurity\SetConfigurationAsDefaultForEnterprise\Response\ApplicationJson\Ok + { + $code = $response->getStatusCode(); + [$contentType] = explode(';', $response->getHeaderLine('Content-Type')); + switch ($contentType) { + case 'application/json': + $body = json_decode($response->getBody()->getContents(), true); + switch ($code) { + /** + * Default successfully changed. + **/ + case 200: + $this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\Operations\CodeSecurity\SetConfigurationAsDefaultForEnterprise\Response\ApplicationJson\Ok::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + + return $this->hydrator->hydrateObject(Schema\Operations\CodeSecurity\SetConfigurationAsDefaultForEnterprise\Response\ApplicationJson\Ok::class, $body); + /** + * Forbidden + **/ + + case 403: + $this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\BasicError::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + + throw new ErrorSchemas\BasicError(403, $this->hydrator->hydrateObject(Schema\BasicError::class, $body)); + /** + * Resource not found + **/ + + case 404: + $this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\BasicError::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + + throw new ErrorSchemas\BasicError(404, $this->hydrator->hydrateObject(Schema\BasicError::class, $body)); + } + + break; + } + + throw new RuntimeException('Unable to find matching response code and content type'); + } +} diff --git a/clients/GitHub/src/Internal/Operation/CodeSecurity/UpdateEnterpriseConfiguration.php b/clients/GitHub/src/Internal/Operation/CodeSecurity/UpdateEnterpriseConfiguration.php new file mode 100644 index 00000000000..449b6ceb9c7 --- /dev/null +++ b/clients/GitHub/src/Internal/Operation/CodeSecurity/UpdateEnterpriseConfiguration.php @@ -0,0 +1,99 @@ +enterprise = $enterprise; + $this->configurationId = $configurationId; + } + + public function createRequest(array $data): RequestInterface + { + $this->requestSchemaValidator->validate($data, Reader::readFromJson(Schema\CodeSecurity\UpdateEnterpriseConfiguration\Request\ApplicationJson::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + + return new Request('PATCH', str_replace(['{enterprise}', '{configuration_id}'], [$this->enterprise, $this->configurationId], '/enterprises/{enterprise}/code-security/configurations/{configuration_id}'), ['Content-Type' => 'application/json'], json_encode($data)); + } + + public function createResponse(ResponseInterface $response): Schema\CodeSecurityConfiguration|WithoutBody + { + $code = $response->getStatusCode(); + [$contentType] = explode(';', $response->getHeaderLine('Content-Type')); + switch ($contentType) { + case 'application/json': + $body = json_decode($response->getBody()->getContents(), true); + switch ($code) { + /** + * Response + **/ + case 200: + $this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\CodeSecurityConfiguration::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + + return $this->hydrator->hydrateObject(Schema\CodeSecurityConfiguration::class, $body); + /** + * Forbidden + **/ + + case 403: + $this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\BasicError::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + + throw new ErrorSchemas\BasicError(403, $this->hydrator->hydrateObject(Schema\BasicError::class, $body)); + /** + * Resource not found + **/ + + case 404: + $this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\BasicError::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + + throw new ErrorSchemas\BasicError(404, $this->hydrator->hydrateObject(Schema\BasicError::class, $body)); + /** + * Conflict + **/ + + case 409: + $this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\BasicError::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + + throw new ErrorSchemas\BasicError(409, $this->hydrator->hydrateObject(Schema\BasicError::class, $body)); + } + + break; + } + + switch ($code) { + /** + * Not modified + **/ + case 304: + return new WithoutBody(304, []); + } + + throw new RuntimeException('Unable to find matching response code and content type'); + } +} diff --git a/clients/GitHub/src/Internal/Operator/CodeScanning/CommitAutofix.php b/clients/GitHub/src/Internal/Operator/CodeScanning/CommitAutofix.php new file mode 100644 index 00000000000..1e269f3889c --- /dev/null +++ b/clients/GitHub/src/Internal/Operator/CodeScanning/CommitAutofix.php @@ -0,0 +1,41 @@ +requestSchemaValidator, $this->responseSchemaValidator, $this->hydrator, $owner, $repo, $alertNumber); + $request = $operation->createRequest($params); + $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): CodeScanningAutofixCommitsResponse|WithoutBody { + return $operation->createResponse($response); + })); + if ($result instanceof Observable) { + $result = awaitObservable($result); + } + + return $result; + } +} diff --git a/clients/GitHub/src/Internal/Operator/CodeScanning/CreateAutofix.php b/clients/GitHub/src/Internal/Operator/CodeScanning/CreateAutofix.php new file mode 100644 index 00000000000..88a0993daa3 --- /dev/null +++ b/clients/GitHub/src/Internal/Operator/CodeScanning/CreateAutofix.php @@ -0,0 +1,41 @@ +responseSchemaValidator, $this->hydrator, $owner, $repo, $alertNumber); + $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): CodeScanningAutofix|WithoutBody { + return $operation->createResponse($response); + })); + if ($result instanceof Observable) { + $result = awaitObservable($result); + } + + return $result; + } +} diff --git a/clients/GitHub/src/Internal/Operator/CodeScanning/GetAutofix.php b/clients/GitHub/src/Internal/Operator/CodeScanning/GetAutofix.php new file mode 100644 index 00000000000..cb004ab95e6 --- /dev/null +++ b/clients/GitHub/src/Internal/Operator/CodeScanning/GetAutofix.php @@ -0,0 +1,40 @@ +responseSchemaValidator, $this->hydrator, $owner, $repo, $alertNumber); + $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): CodeScanningAutofix { + return $operation->createResponse($response); + })); + if ($result instanceof Observable) { + $result = awaitObservable($result); + } + + return $result; + } +} diff --git a/clients/GitHub/src/Internal/Operator/CodeSecurity/AttachEnterpriseConfiguration.php b/clients/GitHub/src/Internal/Operator/CodeSecurity/AttachEnterpriseConfiguration.php new file mode 100644 index 00000000000..1251b1501f4 --- /dev/null +++ b/clients/GitHub/src/Internal/Operator/CodeSecurity/AttachEnterpriseConfiguration.php @@ -0,0 +1,40 @@ +requestSchemaValidator, $this->responseSchemaValidator, $this->hydrator, $enterprise, $configurationId); + $request = $operation->createRequest($params); + $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): Json { + return $operation->createResponse($response); + })); + if ($result instanceof Observable) { + $result = awaitObservable($result); + } + + return $result; + } +} diff --git a/clients/GitHub/src/Internal/Operator/CodeSecurity/CreateConfigurationForEnterprise.php b/clients/GitHub/src/Internal/Operator/CodeSecurity/CreateConfigurationForEnterprise.php new file mode 100644 index 00000000000..234dbca2569 --- /dev/null +++ b/clients/GitHub/src/Internal/Operator/CodeSecurity/CreateConfigurationForEnterprise.php @@ -0,0 +1,40 @@ +requestSchemaValidator, $this->responseSchemaValidator, $this->hydrator, $enterprise); + $request = $operation->createRequest($params); + $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): CodeSecurityConfiguration { + return $operation->createResponse($response); + })); + if ($result instanceof Observable) { + $result = awaitObservable($result); + } + + return $result; + } +} diff --git a/clients/GitHub/src/Internal/Operator/CodeSecurity/DeleteConfigurationForEnterprise.php b/clients/GitHub/src/Internal/Operator/CodeSecurity/DeleteConfigurationForEnterprise.php new file mode 100644 index 00000000000..c181cfb2eb9 --- /dev/null +++ b/clients/GitHub/src/Internal/Operator/CodeSecurity/DeleteConfigurationForEnterprise.php @@ -0,0 +1,40 @@ +responseSchemaValidator, $this->hydrator, $enterprise, $configurationId); + $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): WithoutBody { + return $operation->createResponse($response); + })); + if ($result instanceof Observable) { + $result = awaitObservable($result); + } + + return $result; + } +} diff --git a/clients/GitHub/src/Internal/Operator/CodeSecurity/GetConfigurationsForEnterprise.php b/clients/GitHub/src/Internal/Operator/CodeSecurity/GetConfigurationsForEnterprise.php new file mode 100644 index 00000000000..2dc14842986 --- /dev/null +++ b/clients/GitHub/src/Internal/Operator/CodeSecurity/GetConfigurationsForEnterprise.php @@ -0,0 +1,41 @@ + */ + public function call(string $enterprise, string $before, string $after, int $perPage = 30): iterable + { + $operation = new \ApiClients\Client\GitHub\Internal\Operation\CodeSecurity\GetConfigurationsForEnterprise($this->responseSchemaValidator, $this->hydrator, $enterprise, $before, $after, $perPage); + $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); + })); + if ($result instanceof Observable) { + $result = awaitObservable($result); + } + + return $result; + } +} diff --git a/clients/GitHub/src/Internal/Operator/CodeSecurity/GetDefaultConfigurationsForEnterprise.php b/clients/GitHub/src/Internal/Operator/CodeSecurity/GetDefaultConfigurationsForEnterprise.php new file mode 100644 index 00000000000..408875ebf93 --- /dev/null +++ b/clients/GitHub/src/Internal/Operator/CodeSecurity/GetDefaultConfigurationsForEnterprise.php @@ -0,0 +1,41 @@ + */ + public function call(string $enterprise): iterable + { + $operation = new \ApiClients\Client\GitHub\Internal\Operation\CodeSecurity\GetDefaultConfigurationsForEnterprise($this->responseSchemaValidator, $this->hydrator, $enterprise); + $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); + })); + if ($result instanceof Observable) { + $result = awaitObservable($result); + } + + return $result; + } +} diff --git a/clients/GitHub/src/Internal/Operator/CodeSecurity/GetRepositoriesForEnterpriseConfiguration.php b/clients/GitHub/src/Internal/Operator/CodeSecurity/GetRepositoriesForEnterpriseConfiguration.php new file mode 100644 index 00000000000..98569fca929 --- /dev/null +++ b/clients/GitHub/src/Internal/Operator/CodeSecurity/GetRepositoriesForEnterpriseConfiguration.php @@ -0,0 +1,41 @@ + */ + public function call(string $enterprise, int $configurationId, string $before, string $after, int $perPage = 30, string $status = 'all'): iterable + { + $operation = new \ApiClients\Client\GitHub\Internal\Operation\CodeSecurity\GetRepositoriesForEnterpriseConfiguration($this->responseSchemaValidator, $this->hydrator, $enterprise, $configurationId, $before, $after, $perPage, $status); + $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); + })); + if ($result instanceof Observable) { + $result = awaitObservable($result); + } + + return $result; + } +} diff --git a/clients/GitHub/src/Internal/Operator/CodeSecurity/GetSingleConfigurationForEnterprise.php b/clients/GitHub/src/Internal/Operator/CodeSecurity/GetSingleConfigurationForEnterprise.php new file mode 100644 index 00000000000..48dd83f5a1f --- /dev/null +++ b/clients/GitHub/src/Internal/Operator/CodeSecurity/GetSingleConfigurationForEnterprise.php @@ -0,0 +1,41 @@ +responseSchemaValidator, $this->hydrator, $enterprise, $configurationId); + $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): CodeSecurityConfiguration|WithoutBody { + return $operation->createResponse($response); + })); + if ($result instanceof Observable) { + $result = awaitObservable($result); + } + + return $result; + } +} diff --git a/clients/GitHub/src/Internal/Operator/CodeSecurity/SetConfigurationAsDefault.php b/clients/GitHub/src/Internal/Operator/CodeSecurity/SetConfigurationAsDefault.php index 4dfd07dc646..8c4bdefd8fe 100644 --- a/clients/GitHub/src/Internal/Operator/CodeSecurity/SetConfigurationAsDefault.php +++ b/clients/GitHub/src/Internal/Operator/CodeSecurity/SetConfigurationAsDefault.php @@ -5,7 +5,7 @@ namespace ApiClients\Client\GitHub\Internal\Operator\CodeSecurity; use ApiClients\Client\GitHub\Internal; -use ApiClients\Client\GitHub\Schema\Operations\CodeSecurity\SetConfigurationAsDefault\Response\ApplicationJson\Ok; +use ApiClients\Client\GitHub\Schema\Operations\CodeSecurity\SetConfigurationAsDefault\Response\ApplicationJson\Ok\Application\Json; use ApiClients\Contracts\HTTP\Headers\AuthenticationInterface; use League\OpenAPIValidation\Schema\SchemaValidator; use Psr\Http\Message\ResponseInterface; @@ -24,12 +24,11 @@ public function __construct(private Browser $browser, private AuthenticationInte { } - /** @return */ - public function call(string $org, int $configurationId, array $params): Ok + public function call(string $org, int $configurationId, array $params): Json { $operation = new \ApiClients\Client\GitHub\Internal\Operation\CodeSecurity\SetConfigurationAsDefault($this->requestSchemaValidator, $this->responseSchemaValidator, $this->hydrator, $org, $configurationId); $request = $operation->createRequest($params); - $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): Ok { + $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): Json { return $operation->createResponse($response); })); if ($result instanceof Observable) { diff --git a/clients/GitHub/src/Internal/Operator/CodeSecurity/SetConfigurationAsDefaultForEnterprise.php b/clients/GitHub/src/Internal/Operator/CodeSecurity/SetConfigurationAsDefaultForEnterprise.php new file mode 100644 index 00000000000..27df73c461b --- /dev/null +++ b/clients/GitHub/src/Internal/Operator/CodeSecurity/SetConfigurationAsDefaultForEnterprise.php @@ -0,0 +1,40 @@ +requestSchemaValidator, $this->responseSchemaValidator, $this->hydrator, $enterprise, $configurationId); + $request = $operation->createRequest($params); + $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): Ok { + return $operation->createResponse($response); + })); + if ($result instanceof Observable) { + $result = awaitObservable($result); + } + + return $result; + } +} diff --git a/clients/GitHub/src/Internal/Operator/CodeSecurity/UpdateEnterpriseConfiguration.php b/clients/GitHub/src/Internal/Operator/CodeSecurity/UpdateEnterpriseConfiguration.php new file mode 100644 index 00000000000..464a69a4dfb --- /dev/null +++ b/clients/GitHub/src/Internal/Operator/CodeSecurity/UpdateEnterpriseConfiguration.php @@ -0,0 +1,41 @@ +requestSchemaValidator, $this->responseSchemaValidator, $this->hydrator, $enterprise, $configurationId); + $request = $operation->createRequest($params); + $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): CodeSecurityConfiguration|WithoutBody { + return $operation->createResponse($response); + })); + if ($result instanceof Observable) { + $result = awaitObservable($result); + } + + return $result; + } +} diff --git a/clients/GitHub/src/Internal/Operators.php b/clients/GitHub/src/Internal/Operators.php index 36a7e384107..3fa824be870 100644 --- a/clients/GitHub/src/Internal/Operators.php +++ b/clients/GitHub/src/Internal/Operators.php @@ -48,6 +48,15 @@ final class Operators private Internal\Operator\CodesOfConduct\GetAllCodesOfConduct|null $codesOfConduct👷GetAllCodesOfConduct = null; private Internal\Operator\CodesOfConduct\GetConductCode|null $codesOfConduct👷GetConductCode = null; private Internal\Operator\Emojis\Get|null $emojis👷Get = null; + private Internal\Operator\CodeSecurity\GetConfigurationsForEnterprise|null $codeSecurity👷GetConfigurationsForEnterprise = null; + private Internal\Operator\CodeSecurity\CreateConfigurationForEnterprise|null $codeSecurity👷CreateConfigurationForEnterprise = null; + private Internal\Operator\CodeSecurity\GetDefaultConfigurationsForEnterprise|null $codeSecurity👷GetDefaultConfigurationsForEnterprise = null; + private Internal\Operator\CodeSecurity\GetSingleConfigurationForEnterprise|null $codeSecurity👷GetSingleConfigurationForEnterprise = null; + private Internal\Operator\CodeSecurity\DeleteConfigurationForEnterprise|null $codeSecurity👷DeleteConfigurationForEnterprise = null; + private Internal\Operator\CodeSecurity\UpdateEnterpriseConfiguration|null $codeSecurity👷UpdateEnterpriseConfiguration = null; + private Internal\Operator\CodeSecurity\AttachEnterpriseConfiguration|null $codeSecurity👷AttachEnterpriseConfiguration = null; + private Internal\Operator\CodeSecurity\SetConfigurationAsDefaultForEnterprise|null $codeSecurity👷SetConfigurationAsDefaultForEnterprise = null; + private Internal\Operator\CodeSecurity\GetRepositoriesForEnterpriseConfiguration|null $codeSecurity👷GetRepositoriesForEnterpriseConfiguration = null; private Internal\Operator\Dependabot\ListAlertsForEnterprise|null $dependabot👷ListAlertsForEnterprise = null; private Internal\Operator\SecretScanning\ListAlertsForEnterprise|null $secretScanning👷ListAlertsForEnterprise = null; private Internal\Operator\Activity\ListPublicEvents|null $activity👷ListPublicEvents = null; @@ -580,6 +589,9 @@ final class Operators private Internal\Operator\CodeScanning\ListAlertsForRepoListing|null $codeScanning👷ListAlertsForRepoListing = null; private Internal\Operator\CodeScanning\GetAlert|null $codeScanning👷GetAlert = null; private Internal\Operator\CodeScanning\UpdateAlert|null $codeScanning👷UpdateAlert = null; + private Internal\Operator\CodeScanning\GetAutofix|null $codeScanning👷GetAutofix = null; + private Internal\Operator\CodeScanning\CreateAutofix|null $codeScanning👷CreateAutofix = null; + private Internal\Operator\CodeScanning\CommitAutofix|null $codeScanning👷CommitAutofix = null; private Internal\Operator\CodeScanning\ListAlertInstances|null $codeScanning👷ListAlertInstances = null; private Internal\Operator\CodeScanning\ListAlertInstancesListing|null $codeScanning👷ListAlertInstancesListing = null; private Internal\Operator\CodeScanning\ListRecentAnalyses|null $codeScanning👷ListRecentAnalyses = null; @@ -1509,6 +1521,87 @@ public function emojis👷Get(): Internal\Operator\Emojis\Get return $this->emojis👷Get; } + public function codeSecurity👷GetConfigurationsForEnterprise(): Internal\Operator\CodeSecurity\GetConfigurationsForEnterprise + { + if ($this->codeSecurity👷GetConfigurationsForEnterprise instanceof Internal\Operator\CodeSecurity\GetConfigurationsForEnterprise === false) { + $this->codeSecurity👷GetConfigurationsForEnterprise = new Internal\Operator\CodeSecurity\GetConfigurationsForEnterprise($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Enterprises🌀Enterprise🌀CodeSecurity🌀Configurations()); + } + + return $this->codeSecurity👷GetConfigurationsForEnterprise; + } + + public function codeSecurity👷CreateConfigurationForEnterprise(): Internal\Operator\CodeSecurity\CreateConfigurationForEnterprise + { + if ($this->codeSecurity👷CreateConfigurationForEnterprise instanceof Internal\Operator\CodeSecurity\CreateConfigurationForEnterprise === false) { + $this->codeSecurity👷CreateConfigurationForEnterprise = new Internal\Operator\CodeSecurity\CreateConfigurationForEnterprise($this->browser, $this->authentication, $this->requestSchemaValidator, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Enterprises🌀Enterprise🌀CodeSecurity🌀Configurations()); + } + + return $this->codeSecurity👷CreateConfigurationForEnterprise; + } + + public function codeSecurity👷GetDefaultConfigurationsForEnterprise(): Internal\Operator\CodeSecurity\GetDefaultConfigurationsForEnterprise + { + if ($this->codeSecurity👷GetDefaultConfigurationsForEnterprise instanceof Internal\Operator\CodeSecurity\GetDefaultConfigurationsForEnterprise === false) { + $this->codeSecurity👷GetDefaultConfigurationsForEnterprise = new Internal\Operator\CodeSecurity\GetDefaultConfigurationsForEnterprise($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Enterprises🌀Enterprise🌀CodeSecurity🌀Configurations🌀Defaults()); + } + + return $this->codeSecurity👷GetDefaultConfigurationsForEnterprise; + } + + public function codeSecurity👷GetSingleConfigurationForEnterprise(): Internal\Operator\CodeSecurity\GetSingleConfigurationForEnterprise + { + if ($this->codeSecurity👷GetSingleConfigurationForEnterprise instanceof Internal\Operator\CodeSecurity\GetSingleConfigurationForEnterprise === false) { + $this->codeSecurity👷GetSingleConfigurationForEnterprise = new Internal\Operator\CodeSecurity\GetSingleConfigurationForEnterprise($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Enterprises🌀Enterprise🌀CodeSecurity🌀Configurations🌀ConfigurationId()); + } + + return $this->codeSecurity👷GetSingleConfigurationForEnterprise; + } + + public function codeSecurity👷DeleteConfigurationForEnterprise(): Internal\Operator\CodeSecurity\DeleteConfigurationForEnterprise + { + if ($this->codeSecurity👷DeleteConfigurationForEnterprise instanceof Internal\Operator\CodeSecurity\DeleteConfigurationForEnterprise === false) { + $this->codeSecurity👷DeleteConfigurationForEnterprise = new Internal\Operator\CodeSecurity\DeleteConfigurationForEnterprise($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Enterprises🌀Enterprise🌀CodeSecurity🌀Configurations🌀ConfigurationId()); + } + + return $this->codeSecurity👷DeleteConfigurationForEnterprise; + } + + public function codeSecurity👷UpdateEnterpriseConfiguration(): Internal\Operator\CodeSecurity\UpdateEnterpriseConfiguration + { + if ($this->codeSecurity👷UpdateEnterpriseConfiguration instanceof Internal\Operator\CodeSecurity\UpdateEnterpriseConfiguration === false) { + $this->codeSecurity👷UpdateEnterpriseConfiguration = new Internal\Operator\CodeSecurity\UpdateEnterpriseConfiguration($this->browser, $this->authentication, $this->requestSchemaValidator, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Enterprises🌀Enterprise🌀CodeSecurity🌀Configurations🌀ConfigurationId()); + } + + return $this->codeSecurity👷UpdateEnterpriseConfiguration; + } + + public function codeSecurity👷AttachEnterpriseConfiguration(): Internal\Operator\CodeSecurity\AttachEnterpriseConfiguration + { + if ($this->codeSecurity👷AttachEnterpriseConfiguration instanceof Internal\Operator\CodeSecurity\AttachEnterpriseConfiguration === false) { + $this->codeSecurity👷AttachEnterpriseConfiguration = new Internal\Operator\CodeSecurity\AttachEnterpriseConfiguration($this->browser, $this->authentication, $this->requestSchemaValidator, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Enterprises🌀Enterprise🌀CodeSecurity🌀Configurations🌀ConfigurationId🌀Attach()); + } + + return $this->codeSecurity👷AttachEnterpriseConfiguration; + } + + public function codeSecurity👷SetConfigurationAsDefaultForEnterprise(): Internal\Operator\CodeSecurity\SetConfigurationAsDefaultForEnterprise + { + if ($this->codeSecurity👷SetConfigurationAsDefaultForEnterprise instanceof Internal\Operator\CodeSecurity\SetConfigurationAsDefaultForEnterprise === false) { + $this->codeSecurity👷SetConfigurationAsDefaultForEnterprise = new Internal\Operator\CodeSecurity\SetConfigurationAsDefaultForEnterprise($this->browser, $this->authentication, $this->requestSchemaValidator, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Enterprises🌀Enterprise🌀CodeSecurity🌀Configurations🌀ConfigurationId🌀Defaults()); + } + + return $this->codeSecurity👷SetConfigurationAsDefaultForEnterprise; + } + + public function codeSecurity👷GetRepositoriesForEnterpriseConfiguration(): Internal\Operator\CodeSecurity\GetRepositoriesForEnterpriseConfiguration + { + if ($this->codeSecurity👷GetRepositoriesForEnterpriseConfiguration instanceof Internal\Operator\CodeSecurity\GetRepositoriesForEnterpriseConfiguration === false) { + $this->codeSecurity👷GetRepositoriesForEnterpriseConfiguration = new Internal\Operator\CodeSecurity\GetRepositoriesForEnterpriseConfiguration($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Enterprises🌀Enterprise🌀CodeSecurity🌀Configurations🌀ConfigurationId🌀Repositories()); + } + + return $this->codeSecurity👷GetRepositoriesForEnterpriseConfiguration; + } + public function dependabot👷ListAlertsForEnterprise(): Internal\Operator\Dependabot\ListAlertsForEnterprise { if ($this->dependabot👷ListAlertsForEnterprise instanceof Internal\Operator\Dependabot\ListAlertsForEnterprise === false) { @@ -6297,6 +6390,33 @@ public function codeScanning👷UpdateAlert(): Internal\Operator\CodeScanning\Up return $this->codeScanning👷UpdateAlert; } + public function codeScanning👷GetAutofix(): Internal\Operator\CodeScanning\GetAutofix + { + if ($this->codeScanning👷GetAutofix instanceof Internal\Operator\CodeScanning\GetAutofix === false) { + $this->codeScanning👷GetAutofix = new Internal\Operator\CodeScanning\GetAutofix($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Repos🌀Owner🌀Repo🌀CodeScanning🌀Alerts🌀AlertNumber🌀Autofix()); + } + + return $this->codeScanning👷GetAutofix; + } + + public function codeScanning👷CreateAutofix(): Internal\Operator\CodeScanning\CreateAutofix + { + if ($this->codeScanning👷CreateAutofix instanceof Internal\Operator\CodeScanning\CreateAutofix === false) { + $this->codeScanning👷CreateAutofix = new Internal\Operator\CodeScanning\CreateAutofix($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Repos🌀Owner🌀Repo🌀CodeScanning🌀Alerts🌀AlertNumber🌀Autofix()); + } + + return $this->codeScanning👷CreateAutofix; + } + + public function codeScanning👷CommitAutofix(): Internal\Operator\CodeScanning\CommitAutofix + { + if ($this->codeScanning👷CommitAutofix instanceof Internal\Operator\CodeScanning\CommitAutofix === false) { + $this->codeScanning👷CommitAutofix = new Internal\Operator\CodeScanning\CommitAutofix($this->browser, $this->authentication, $this->requestSchemaValidator, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Repos🌀Owner🌀Repo🌀CodeScanning🌀Alerts🌀AlertNumber🌀Autofix🌀Commits()); + } + + return $this->codeScanning👷CommitAutofix; + } + public function codeScanning👷ListAlertInstances(): Internal\Operator\CodeScanning\ListAlertInstances { if ($this->codeScanning👷ListAlertInstances instanceof Internal\Operator\CodeScanning\ListAlertInstances === false) { diff --git a/clients/GitHub/src/Internal/Router/Delete/Actions.php b/clients/GitHub/src/Internal/Router/Delete/Actions.php index b74f13911eb..018fd6707e1 100644 --- a/clients/GitHub/src/Internal/Router/Delete/Actions.php +++ b/clients/GitHub/src/Internal/Router/Delete/Actions.php @@ -22,6 +22,123 @@ public function __construct(private SchemaValidator $requestSchemaValidator, pri { } + /** @return */ + public function deleteSelfHostedRunnerGroupFromOrg(array $params): WithoutBody + { + $arguments = []; + if (array_key_exists('org', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: org'); + } + + $arguments['org'] = $params['org']; + unset($params['org']); + if (array_key_exists('runner_group_id', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: runner_group_id'); + } + + $arguments['runner_group_id'] = $params['runner_group_id']; + unset($params['runner_group_id']); + $operator = new Internal\Operator\Actions\DeleteSelfHostedRunnerGroupFromOrg($this->browser, $this->authentication); + + return $operator->call($arguments['org'], $arguments['runner_group_id']); + } + + /** @return */ + public function deleteSelfHostedRunnerFromOrg(array $params): WithoutBody + { + $arguments = []; + if (array_key_exists('org', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: org'); + } + + $arguments['org'] = $params['org']; + unset($params['org']); + if (array_key_exists('runner_id', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: runner_id'); + } + + $arguments['runner_id'] = $params['runner_id']; + unset($params['runner_id']); + $operator = new Internal\Operator\Actions\DeleteSelfHostedRunnerFromOrg($this->browser, $this->authentication); + + return $operator->call($arguments['org'], $arguments['runner_id']); + } + + /** @return */ + public function deleteOrgSecret(array $params): WithoutBody + { + $arguments = []; + if (array_key_exists('org', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: org'); + } + + $arguments['org'] = $params['org']; + unset($params['org']); + if (array_key_exists('secret_name', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: secret_name'); + } + + $arguments['secret_name'] = $params['secret_name']; + unset($params['secret_name']); + $operator = new Internal\Operator\Actions\DeleteOrgSecret($this->browser, $this->authentication); + + return $operator->call($arguments['org'], $arguments['secret_name']); + } + + /** @return */ + public function deleteOrgVariable(array $params): WithoutBody + { + $arguments = []; + if (array_key_exists('org', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: org'); + } + + $arguments['org'] = $params['org']; + unset($params['org']); + if (array_key_exists('name', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: name'); + } + + $arguments['name'] = $params['name']; + unset($params['name']); + $operator = new Internal\Operator\Actions\DeleteOrgVariable($this->browser, $this->authentication); + + return $operator->call($arguments['org'], $arguments['name']); + } + + /** @return */ + public function deleteActionsCacheByKey(array $params): ActionsCacheList + { + $arguments = []; + if (array_key_exists('owner', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: owner'); + } + + $arguments['owner'] = $params['owner']; + unset($params['owner']); + if (array_key_exists('repo', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: repo'); + } + + $arguments['repo'] = $params['repo']; + unset($params['repo']); + if (array_key_exists('key', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: key'); + } + + $arguments['key'] = $params['key']; + unset($params['key']); + if (array_key_exists('ref', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: ref'); + } + + $arguments['ref'] = $params['ref']; + unset($params['ref']); + $operator = new Internal\Operator\Actions\DeleteActionsCacheByKey($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Repos🌀Owner🌀Repo🌀Actions🌀Caches()); + + return $operator->call($arguments['owner'], $arguments['repo'], $arguments['key'], $arguments['ref']); + } + /** @return */ public function disableSelectedRepositoryGithubActionsOrganization(array $params): WithoutBody { @@ -226,123 +343,6 @@ public function deleteRepoVariable(array $params): WithoutBody return $operator->call($arguments['owner'], $arguments['repo'], $arguments['name']); } - /** @return */ - public function deleteSelfHostedRunnerGroupFromOrg(array $params): WithoutBody - { - $arguments = []; - if (array_key_exists('org', $params) === false) { - throw new InvalidArgumentException('Missing mandatory field: org'); - } - - $arguments['org'] = $params['org']; - unset($params['org']); - if (array_key_exists('runner_group_id', $params) === false) { - throw new InvalidArgumentException('Missing mandatory field: runner_group_id'); - } - - $arguments['runner_group_id'] = $params['runner_group_id']; - unset($params['runner_group_id']); - $operator = new Internal\Operator\Actions\DeleteSelfHostedRunnerGroupFromOrg($this->browser, $this->authentication); - - return $operator->call($arguments['org'], $arguments['runner_group_id']); - } - - /** @return */ - public function deleteSelfHostedRunnerFromOrg(array $params): WithoutBody - { - $arguments = []; - if (array_key_exists('org', $params) === false) { - throw new InvalidArgumentException('Missing mandatory field: org'); - } - - $arguments['org'] = $params['org']; - unset($params['org']); - if (array_key_exists('runner_id', $params) === false) { - throw new InvalidArgumentException('Missing mandatory field: runner_id'); - } - - $arguments['runner_id'] = $params['runner_id']; - unset($params['runner_id']); - $operator = new Internal\Operator\Actions\DeleteSelfHostedRunnerFromOrg($this->browser, $this->authentication); - - return $operator->call($arguments['org'], $arguments['runner_id']); - } - - /** @return */ - public function deleteOrgSecret(array $params): WithoutBody - { - $arguments = []; - if (array_key_exists('org', $params) === false) { - throw new InvalidArgumentException('Missing mandatory field: org'); - } - - $arguments['org'] = $params['org']; - unset($params['org']); - if (array_key_exists('secret_name', $params) === false) { - throw new InvalidArgumentException('Missing mandatory field: secret_name'); - } - - $arguments['secret_name'] = $params['secret_name']; - unset($params['secret_name']); - $operator = new Internal\Operator\Actions\DeleteOrgSecret($this->browser, $this->authentication); - - return $operator->call($arguments['org'], $arguments['secret_name']); - } - - /** @return */ - public function deleteOrgVariable(array $params): WithoutBody - { - $arguments = []; - if (array_key_exists('org', $params) === false) { - throw new InvalidArgumentException('Missing mandatory field: org'); - } - - $arguments['org'] = $params['org']; - unset($params['org']); - if (array_key_exists('name', $params) === false) { - throw new InvalidArgumentException('Missing mandatory field: name'); - } - - $arguments['name'] = $params['name']; - unset($params['name']); - $operator = new Internal\Operator\Actions\DeleteOrgVariable($this->browser, $this->authentication); - - return $operator->call($arguments['org'], $arguments['name']); - } - - /** @return */ - public function deleteActionsCacheByKey(array $params): ActionsCacheList - { - $arguments = []; - if (array_key_exists('owner', $params) === false) { - throw new InvalidArgumentException('Missing mandatory field: owner'); - } - - $arguments['owner'] = $params['owner']; - unset($params['owner']); - if (array_key_exists('repo', $params) === false) { - throw new InvalidArgumentException('Missing mandatory field: repo'); - } - - $arguments['repo'] = $params['repo']; - unset($params['repo']); - if (array_key_exists('key', $params) === false) { - throw new InvalidArgumentException('Missing mandatory field: key'); - } - - $arguments['key'] = $params['key']; - unset($params['key']); - if (array_key_exists('ref', $params) === false) { - throw new InvalidArgumentException('Missing mandatory field: ref'); - } - - $arguments['ref'] = $params['ref']; - unset($params['ref']); - $operator = new Internal\Operator\Actions\DeleteActionsCacheByKey($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Repos🌀Owner🌀Repo🌀Actions🌀Caches()); - - return $operator->call($arguments['owner'], $arguments['repo'], $arguments['key'], $arguments['ref']); - } - /** @return */ public function removeRepoAccessToSelfHostedRunnerGroupInOrg(array $params): WithoutBody { diff --git a/clients/GitHub/src/Internal/Router/Delete/Apps.php b/clients/GitHub/src/Internal/Router/Delete/Apps.php index 4e75027a38b..d889f1e3c7f 100644 --- a/clients/GitHub/src/Internal/Router/Delete/Apps.php +++ b/clients/GitHub/src/Internal/Router/Delete/Apps.php @@ -79,14 +79,6 @@ public function unsuspendInstallation(array $params): WithoutBody return $operator->call($arguments['installation_id']); } - /** @return */ - public function revokeInstallationAccessToken(array $params): WithoutBody - { - $operator = new Internal\Operator\Apps\RevokeInstallationAccessToken($this->browser, $this->authentication); - - return $operator->call(); - } - /** @return */ public function removeRepoFromInstallationForAuthenticatedUser(array $params): WithoutBody { @@ -107,4 +99,12 @@ public function removeRepoFromInstallationForAuthenticatedUser(array $params): W return $operator->call($arguments['installation_id'], $arguments['repository_id']); } + + /** @return */ + public function revokeInstallationAccessToken(array $params): WithoutBody + { + $operator = new Internal\Operator\Apps\RevokeInstallationAccessToken($this->browser, $this->authentication); + + return $operator->call(); + } } diff --git a/clients/GitHub/src/Internal/Router/Delete/CodeSecurity.php b/clients/GitHub/src/Internal/Router/Delete/CodeSecurity.php index d12e4ca0673..86fa8262d38 100644 --- a/clients/GitHub/src/Internal/Router/Delete/CodeSecurity.php +++ b/clients/GitHub/src/Internal/Router/Delete/CodeSecurity.php @@ -19,6 +19,26 @@ public function __construct(private SchemaValidator $requestSchemaValidator, pri { } + public function deleteConfigurationForEnterprise(array $params): WithoutBody + { + $arguments = []; + if (array_key_exists('enterprise', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: enterprise'); + } + + $arguments['enterprise'] = $params['enterprise']; + unset($params['enterprise']); + if (array_key_exists('configuration_id', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: configuration_id'); + } + + $arguments['configuration_id'] = $params['configuration_id']; + unset($params['configuration_id']); + $operator = new Internal\Operator\CodeSecurity\DeleteConfigurationForEnterprise($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Enterprises🌀Enterprise🌀CodeSecurity🌀Configurations🌀ConfigurationId()); + + return $operator->call($arguments['enterprise'], $arguments['configuration_id']); + } + /** @return */ public function detachConfiguration(array $params): WithoutBody { diff --git a/clients/GitHub/src/Internal/Router/Delete/Codespaces.php b/clients/GitHub/src/Internal/Router/Delete/Codespaces.php index 9d23f04d45c..d4f49fa67fa 100644 --- a/clients/GitHub/src/Internal/Router/Delete/Codespaces.php +++ b/clients/GitHub/src/Internal/Router/Delete/Codespaces.php @@ -50,6 +50,42 @@ public function deleteSecretForAuthenticatedUser(array $params): WithoutBody return $operator->call($arguments['secret_name']); } + /** @return */ + public function deleteCodespacesAccessUsers(array $params): WithoutBody + { + $arguments = []; + if (array_key_exists('org', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: org'); + } + + $arguments['org'] = $params['org']; + unset($params['org']); + $operator = new Internal\Operator\Codespaces\DeleteCodespacesAccessUsers($this->browser, $this->authentication, $this->requestSchemaValidator, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Orgs🌀Org🌀Codespaces🌀Access🌀SelectedUsers()); + + return $operator->call($arguments['org'], $params); + } + + /** @return */ + public function deleteOrgSecret(array $params): WithoutBody + { + $arguments = []; + if (array_key_exists('org', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: org'); + } + + $arguments['org'] = $params['org']; + unset($params['org']); + if (array_key_exists('secret_name', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: secret_name'); + } + + $arguments['secret_name'] = $params['secret_name']; + unset($params['secret_name']); + $operator = new Internal\Operator\Codespaces\DeleteOrgSecret($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Orgs🌀Org🌀Codespaces🌀Secrets🌀SecretName()); + + return $operator->call($arguments['org'], $arguments['secret_name']); + } + /** @return */ public function deleteFromOrganization(array $params): \ApiClients\Client\GitHub\Schema\Operations\Codespaces\DeleteFromOrganization\Response\ApplicationJson\Accepted\Application\Json|WithoutBody { @@ -125,42 +161,6 @@ public function removeRepositoryForSecretForAuthenticatedUser(array $params): Wi return $operator->call($arguments['secret_name'], $arguments['repository_id']); } - /** @return */ - public function deleteCodespacesAccessUsers(array $params): WithoutBody - { - $arguments = []; - if (array_key_exists('org', $params) === false) { - throw new InvalidArgumentException('Missing mandatory field: org'); - } - - $arguments['org'] = $params['org']; - unset($params['org']); - $operator = new Internal\Operator\Codespaces\DeleteCodespacesAccessUsers($this->browser, $this->authentication, $this->requestSchemaValidator, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Orgs🌀Org🌀Codespaces🌀Access🌀SelectedUsers()); - - return $operator->call($arguments['org'], $params); - } - - /** @return */ - public function deleteOrgSecret(array $params): WithoutBody - { - $arguments = []; - if (array_key_exists('org', $params) === false) { - throw new InvalidArgumentException('Missing mandatory field: org'); - } - - $arguments['org'] = $params['org']; - unset($params['org']); - if (array_key_exists('secret_name', $params) === false) { - throw new InvalidArgumentException('Missing mandatory field: secret_name'); - } - - $arguments['secret_name'] = $params['secret_name']; - unset($params['secret_name']); - $operator = new Internal\Operator\Codespaces\DeleteOrgSecret($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Orgs🌀Org🌀Codespaces🌀Secrets🌀SecretName()); - - return $operator->call($arguments['org'], $arguments['secret_name']); - } - /** @return */ public function removeSelectedRepoFromOrgSecret(array $params): WithoutBody { diff --git a/clients/GitHub/src/Internal/Router/Delete/Dependabot.php b/clients/GitHub/src/Internal/Router/Delete/Dependabot.php index d2f43ecc078..a3b58e73a1c 100644 --- a/clients/GitHub/src/Internal/Router/Delete/Dependabot.php +++ b/clients/GitHub/src/Internal/Router/Delete/Dependabot.php @@ -20,51 +20,51 @@ public function __construct(private SchemaValidator $requestSchemaValidator, pri } /** @return */ - public function deleteRepoSecret(array $params): WithoutBody + public function deleteOrgSecret(array $params): WithoutBody { $arguments = []; - if (array_key_exists('owner', $params) === false) { - throw new InvalidArgumentException('Missing mandatory field: owner'); - } - - $arguments['owner'] = $params['owner']; - unset($params['owner']); - if (array_key_exists('repo', $params) === false) { - throw new InvalidArgumentException('Missing mandatory field: repo'); + if (array_key_exists('org', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: org'); } - $arguments['repo'] = $params['repo']; - unset($params['repo']); + $arguments['org'] = $params['org']; + unset($params['org']); if (array_key_exists('secret_name', $params) === false) { throw new InvalidArgumentException('Missing mandatory field: secret_name'); } $arguments['secret_name'] = $params['secret_name']; unset($params['secret_name']); - $operator = new Internal\Operator\Dependabot\DeleteRepoSecret($this->browser, $this->authentication); + $operator = new Internal\Operator\Dependabot\DeleteOrgSecret($this->browser, $this->authentication); - return $operator->call($arguments['owner'], $arguments['repo'], $arguments['secret_name']); + return $operator->call($arguments['org'], $arguments['secret_name']); } /** @return */ - public function deleteOrgSecret(array $params): WithoutBody + public function deleteRepoSecret(array $params): WithoutBody { $arguments = []; - if (array_key_exists('org', $params) === false) { - throw new InvalidArgumentException('Missing mandatory field: org'); + if (array_key_exists('owner', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: owner'); } - $arguments['org'] = $params['org']; - unset($params['org']); + $arguments['owner'] = $params['owner']; + unset($params['owner']); + if (array_key_exists('repo', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: repo'); + } + + $arguments['repo'] = $params['repo']; + unset($params['repo']); if (array_key_exists('secret_name', $params) === false) { throw new InvalidArgumentException('Missing mandatory field: secret_name'); } $arguments['secret_name'] = $params['secret_name']; unset($params['secret_name']); - $operator = new Internal\Operator\Dependabot\DeleteOrgSecret($this->browser, $this->authentication); + $operator = new Internal\Operator\Dependabot\DeleteRepoSecret($this->browser, $this->authentication); - return $operator->call($arguments['org'], $arguments['secret_name']); + return $operator->call($arguments['owner'], $arguments['repo'], $arguments['secret_name']); } /** @return */ diff --git a/clients/GitHub/src/Internal/Router/Delete/Issues.php b/clients/GitHub/src/Internal/Router/Delete/Issues.php index d2b673be49e..1dd97343c10 100644 --- a/clients/GitHub/src/Internal/Router/Delete/Issues.php +++ b/clients/GitHub/src/Internal/Router/Delete/Issues.php @@ -23,7 +23,7 @@ public function __construct(private SchemaValidator $requestSchemaValidator, pri } /** @return */ - public function deleteComment(array $params): WithoutBody + public function deleteLabel(array $params): WithoutBody { $arguments = []; if (array_key_exists('owner', $params) === false) { @@ -38,19 +38,19 @@ public function deleteComment(array $params): WithoutBody $arguments['repo'] = $params['repo']; unset($params['repo']); - if (array_key_exists('comment_id', $params) === false) { - throw new InvalidArgumentException('Missing mandatory field: comment_id'); + if (array_key_exists('name', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: name'); } - $arguments['comment_id'] = $params['comment_id']; - unset($params['comment_id']); - $operator = new Internal\Operator\Issues\DeleteComment($this->browser, $this->authentication); + $arguments['name'] = $params['name']; + unset($params['name']); + $operator = new Internal\Operator\Issues\DeleteLabel($this->browser, $this->authentication); - return $operator->call($arguments['owner'], $arguments['repo'], $arguments['comment_id']); + return $operator->call($arguments['owner'], $arguments['repo'], $arguments['name']); } /** @return */ - public function removeAssignees(array $params): Issue + public function deleteMilestone(array $params): WithoutBody { $arguments = []; if (array_key_exists('owner', $params) === false) { @@ -65,19 +65,19 @@ public function removeAssignees(array $params): Issue $arguments['repo'] = $params['repo']; unset($params['repo']); - if (array_key_exists('issue_number', $params) === false) { - throw new InvalidArgumentException('Missing mandatory field: issue_number'); + if (array_key_exists('milestone_number', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: milestone_number'); } - $arguments['issue_number'] = $params['issue_number']; - unset($params['issue_number']); - $operator = new Internal\Operator\Issues\RemoveAssignees($this->browser, $this->authentication, $this->requestSchemaValidator, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Repos🌀Owner🌀Repo🌀Issues🌀IssueNumber🌀Assignees()); + $arguments['milestone_number'] = $params['milestone_number']; + unset($params['milestone_number']); + $operator = new Internal\Operator\Issues\DeleteMilestone($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Repos🌀Owner🌀Repo🌀Milestones🌀MilestoneNumber()); - return $operator->call($arguments['owner'], $arguments['repo'], $arguments['issue_number'], $params); + return $operator->call($arguments['owner'], $arguments['repo'], $arguments['milestone_number']); } /** @return */ - public function removeAllLabels(array $params): BasicError|WithoutBody + public function deleteComment(array $params): WithoutBody { $arguments = []; if (array_key_exists('owner', $params) === false) { @@ -92,19 +92,19 @@ public function removeAllLabels(array $params): BasicError|WithoutBody $arguments['repo'] = $params['repo']; unset($params['repo']); - if (array_key_exists('issue_number', $params) === false) { - throw new InvalidArgumentException('Missing mandatory field: issue_number'); + if (array_key_exists('comment_id', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: comment_id'); } - $arguments['issue_number'] = $params['issue_number']; - unset($params['issue_number']); - $operator = new Internal\Operator\Issues\RemoveAllLabels($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Repos🌀Owner🌀Repo🌀Issues🌀IssueNumber🌀Labels()); + $arguments['comment_id'] = $params['comment_id']; + unset($params['comment_id']); + $operator = new Internal\Operator\Issues\DeleteComment($this->browser, $this->authentication); - return $operator->call($arguments['owner'], $arguments['repo'], $arguments['issue_number']); + return $operator->call($arguments['owner'], $arguments['repo'], $arguments['comment_id']); } /** @return */ - public function unlock(array $params): WithoutBody + public function removeAssignees(array $params): Issue { $arguments = []; if (array_key_exists('owner', $params) === false) { @@ -125,13 +125,13 @@ public function unlock(array $params): WithoutBody $arguments['issue_number'] = $params['issue_number']; unset($params['issue_number']); - $operator = new Internal\Operator\Issues\Unlock($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Repos🌀Owner🌀Repo🌀Issues🌀IssueNumber🌀Lock()); + $operator = new Internal\Operator\Issues\RemoveAssignees($this->browser, $this->authentication, $this->requestSchemaValidator, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Repos🌀Owner🌀Repo🌀Issues🌀IssueNumber🌀Assignees()); - return $operator->call($arguments['owner'], $arguments['repo'], $arguments['issue_number']); + return $operator->call($arguments['owner'], $arguments['repo'], $arguments['issue_number'], $params); } /** @return */ - public function removeSubIssue(array $params): Issue + public function removeAllLabels(array $params): BasicError|WithoutBody { $arguments = []; if (array_key_exists('owner', $params) === false) { @@ -152,13 +152,13 @@ public function removeSubIssue(array $params): Issue $arguments['issue_number'] = $params['issue_number']; unset($params['issue_number']); - $operator = new Internal\Operator\Issues\RemoveSubIssue($this->browser, $this->authentication, $this->requestSchemaValidator, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Repos🌀Owner🌀Repo🌀Issues🌀IssueNumber🌀SubIssue()); + $operator = new Internal\Operator\Issues\RemoveAllLabels($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Repos🌀Owner🌀Repo🌀Issues🌀IssueNumber🌀Labels()); - return $operator->call($arguments['owner'], $arguments['repo'], $arguments['issue_number'], $params); + return $operator->call($arguments['owner'], $arguments['repo'], $arguments['issue_number']); } /** @return */ - public function deleteLabel(array $params): WithoutBody + public function unlock(array $params): WithoutBody { $arguments = []; if (array_key_exists('owner', $params) === false) { @@ -173,19 +173,19 @@ public function deleteLabel(array $params): WithoutBody $arguments['repo'] = $params['repo']; unset($params['repo']); - if (array_key_exists('name', $params) === false) { - throw new InvalidArgumentException('Missing mandatory field: name'); + if (array_key_exists('issue_number', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: issue_number'); } - $arguments['name'] = $params['name']; - unset($params['name']); - $operator = new Internal\Operator\Issues\DeleteLabel($this->browser, $this->authentication); + $arguments['issue_number'] = $params['issue_number']; + unset($params['issue_number']); + $operator = new Internal\Operator\Issues\Unlock($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Repos🌀Owner🌀Repo🌀Issues🌀IssueNumber🌀Lock()); - return $operator->call($arguments['owner'], $arguments['repo'], $arguments['name']); + return $operator->call($arguments['owner'], $arguments['repo'], $arguments['issue_number']); } /** @return */ - public function deleteMilestone(array $params): WithoutBody + public function removeSubIssue(array $params): Issue { $arguments = []; if (array_key_exists('owner', $params) === false) { @@ -200,15 +200,15 @@ public function deleteMilestone(array $params): WithoutBody $arguments['repo'] = $params['repo']; unset($params['repo']); - if (array_key_exists('milestone_number', $params) === false) { - throw new InvalidArgumentException('Missing mandatory field: milestone_number'); + if (array_key_exists('issue_number', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: issue_number'); } - $arguments['milestone_number'] = $params['milestone_number']; - unset($params['milestone_number']); - $operator = new Internal\Operator\Issues\DeleteMilestone($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Repos🌀Owner🌀Repo🌀Milestones🌀MilestoneNumber()); + $arguments['issue_number'] = $params['issue_number']; + unset($params['issue_number']); + $operator = new Internal\Operator\Issues\RemoveSubIssue($this->browser, $this->authentication, $this->requestSchemaValidator, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Repos🌀Owner🌀Repo🌀Issues🌀IssueNumber🌀SubIssue()); - return $operator->call($arguments['owner'], $arguments['repo'], $arguments['milestone_number']); + return $operator->call($arguments['owner'], $arguments['repo'], $arguments['issue_number'], $params); } /** @return Observable|Schema\BasicError */ diff --git a/clients/GitHub/src/Internal/Router/Delete/Migrations.php b/clients/GitHub/src/Internal/Router/Delete/Migrations.php index 7e60b37aee4..ce87c7d2dc4 100644 --- a/clients/GitHub/src/Internal/Router/Delete/Migrations.php +++ b/clients/GitHub/src/Internal/Router/Delete/Migrations.php @@ -56,45 +56,45 @@ public function deleteArchiveForAuthenticatedUser(array $params): WithoutBody } /** @return */ - public function unlockRepoForAuthenticatedUser(array $params): WithoutBody + public function deleteArchiveForOrg(array $params): WithoutBody { $arguments = []; + if (array_key_exists('org', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: org'); + } + + $arguments['org'] = $params['org']; + unset($params['org']); if (array_key_exists('migration_id', $params) === false) { throw new InvalidArgumentException('Missing mandatory field: migration_id'); } $arguments['migration_id'] = $params['migration_id']; unset($params['migration_id']); - if (array_key_exists('repo_name', $params) === false) { - throw new InvalidArgumentException('Missing mandatory field: repo_name'); - } - - $arguments['repo_name'] = $params['repo_name']; - unset($params['repo_name']); - $operator = new Internal\Operator\Migrations\UnlockRepoForAuthenticatedUser($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀User🌀Migrations🌀MigrationId🌀Repos🌀RepoName🌀Lock()); + $operator = new Internal\Operator\Migrations\DeleteArchiveForOrg($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Orgs🌀Org🌀Migrations🌀MigrationId🌀Archive()); - return $operator->call($arguments['migration_id'], $arguments['repo_name']); + return $operator->call($arguments['org'], $arguments['migration_id']); } /** @return */ - public function deleteArchiveForOrg(array $params): WithoutBody + public function unlockRepoForAuthenticatedUser(array $params): WithoutBody { $arguments = []; - if (array_key_exists('org', $params) === false) { - throw new InvalidArgumentException('Missing mandatory field: org'); - } - - $arguments['org'] = $params['org']; - unset($params['org']); if (array_key_exists('migration_id', $params) === false) { throw new InvalidArgumentException('Missing mandatory field: migration_id'); } $arguments['migration_id'] = $params['migration_id']; unset($params['migration_id']); - $operator = new Internal\Operator\Migrations\DeleteArchiveForOrg($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Orgs🌀Org🌀Migrations🌀MigrationId🌀Archive()); + if (array_key_exists('repo_name', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: repo_name'); + } - return $operator->call($arguments['org'], $arguments['migration_id']); + $arguments['repo_name'] = $params['repo_name']; + unset($params['repo_name']); + $operator = new Internal\Operator\Migrations\UnlockRepoForAuthenticatedUser($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀User🌀Migrations🌀MigrationId🌀Repos🌀RepoName🌀Lock()); + + return $operator->call($arguments['migration_id'], $arguments['repo_name']); } /** @return */ diff --git a/clients/GitHub/src/Internal/Router/Delete/Orgs.php b/clients/GitHub/src/Internal/Router/Delete/Orgs.php index ee6c6e11fe1..f6f76412338 100644 --- a/clients/GitHub/src/Internal/Router/Delete/Orgs.php +++ b/clients/GitHub/src/Internal/Router/Delete/Orgs.php @@ -168,7 +168,7 @@ public function removePublicMembershipForAuthenticatedUser(array $params): Witho } /** @return */ - public function delete(array $params): Json + public function revokeAllOrgRolesTeam(array $params): WithoutBody { $arguments = []; if (array_key_exists('org', $params) === false) { @@ -177,13 +177,19 @@ public function delete(array $params): Json $arguments['org'] = $params['org']; unset($params['org']); - $operator = new Internal\Operator\Orgs\Delete($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Orgs🌀Org()); + if (array_key_exists('team_slug', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: team_slug'); + } - return $operator->call($arguments['org']); + $arguments['team_slug'] = $params['team_slug']; + unset($params['team_slug']); + $operator = new Internal\Operator\Orgs\RevokeAllOrgRolesTeam($this->browser, $this->authentication); + + return $operator->call($arguments['org'], $arguments['team_slug']); } /** @return */ - public function revokeOrgRoleTeam(array $params): WithoutBody + public function revokeAllOrgRolesUser(array $params): WithoutBody { $arguments = []; if (array_key_exists('org', $params) === false) { @@ -192,25 +198,19 @@ public function revokeOrgRoleTeam(array $params): WithoutBody $arguments['org'] = $params['org']; unset($params['org']); - if (array_key_exists('team_slug', $params) === false) { - throw new InvalidArgumentException('Missing mandatory field: team_slug'); - } - - $arguments['team_slug'] = $params['team_slug']; - unset($params['team_slug']); - if (array_key_exists('role_id', $params) === false) { - throw new InvalidArgumentException('Missing mandatory field: role_id'); + if (array_key_exists('username', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: username'); } - $arguments['role_id'] = $params['role_id']; - unset($params['role_id']); - $operator = new Internal\Operator\Orgs\RevokeOrgRoleTeam($this->browser, $this->authentication); + $arguments['username'] = $params['username']; + unset($params['username']); + $operator = new Internal\Operator\Orgs\RevokeAllOrgRolesUser($this->browser, $this->authentication); - return $operator->call($arguments['org'], $arguments['team_slug'], $arguments['role_id']); + return $operator->call($arguments['org'], $arguments['username']); } /** @return */ - public function revokeOrgRoleUser(array $params): WithoutBody + public function removeCustomProperty(array $params): WithoutBody { $arguments = []; if (array_key_exists('org', $params) === false) { @@ -219,25 +219,19 @@ public function revokeOrgRoleUser(array $params): WithoutBody $arguments['org'] = $params['org']; unset($params['org']); - if (array_key_exists('username', $params) === false) { - throw new InvalidArgumentException('Missing mandatory field: username'); - } - - $arguments['username'] = $params['username']; - unset($params['username']); - if (array_key_exists('role_id', $params) === false) { - throw new InvalidArgumentException('Missing mandatory field: role_id'); + if (array_key_exists('custom_property_name', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: custom_property_name'); } - $arguments['role_id'] = $params['role_id']; - unset($params['role_id']); - $operator = new Internal\Operator\Orgs\RevokeOrgRoleUser($this->browser, $this->authentication); + $arguments['custom_property_name'] = $params['custom_property_name']; + unset($params['custom_property_name']); + $operator = new Internal\Operator\Orgs\RemoveCustomProperty($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Orgs🌀Org🌀Properties🌀Schema🌀CustomPropertyName()); - return $operator->call($arguments['org'], $arguments['username'], $arguments['role_id']); + return $operator->call($arguments['org'], $arguments['custom_property_name']); } /** @return */ - public function revokeAllOrgRolesTeam(array $params): WithoutBody + public function removeSecurityManagerTeam(array $params): WithoutBody { $arguments = []; if (array_key_exists('org', $params) === false) { @@ -252,13 +246,13 @@ public function revokeAllOrgRolesTeam(array $params): WithoutBody $arguments['team_slug'] = $params['team_slug']; unset($params['team_slug']); - $operator = new Internal\Operator\Orgs\RevokeAllOrgRolesTeam($this->browser, $this->authentication); + $operator = new Internal\Operator\Orgs\RemoveSecurityManagerTeam($this->browser, $this->authentication); return $operator->call($arguments['org'], $arguments['team_slug']); } /** @return */ - public function revokeAllOrgRolesUser(array $params): WithoutBody + public function delete(array $params): Json { $arguments = []; if (array_key_exists('org', $params) === false) { @@ -267,19 +261,13 @@ public function revokeAllOrgRolesUser(array $params): WithoutBody $arguments['org'] = $params['org']; unset($params['org']); - if (array_key_exists('username', $params) === false) { - throw new InvalidArgumentException('Missing mandatory field: username'); - } - - $arguments['username'] = $params['username']; - unset($params['username']); - $operator = new Internal\Operator\Orgs\RevokeAllOrgRolesUser($this->browser, $this->authentication); + $operator = new Internal\Operator\Orgs\Delete($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Orgs🌀Org()); - return $operator->call($arguments['org'], $arguments['username']); + return $operator->call($arguments['org']); } /** @return */ - public function removeCustomProperty(array $params): WithoutBody + public function revokeOrgRoleTeam(array $params): WithoutBody { $arguments = []; if (array_key_exists('org', $params) === false) { @@ -288,19 +276,25 @@ public function removeCustomProperty(array $params): WithoutBody $arguments['org'] = $params['org']; unset($params['org']); - if (array_key_exists('custom_property_name', $params) === false) { - throw new InvalidArgumentException('Missing mandatory field: custom_property_name'); + if (array_key_exists('team_slug', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: team_slug'); } - $arguments['custom_property_name'] = $params['custom_property_name']; - unset($params['custom_property_name']); - $operator = new Internal\Operator\Orgs\RemoveCustomProperty($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Orgs🌀Org🌀Properties🌀Schema🌀CustomPropertyName()); + $arguments['team_slug'] = $params['team_slug']; + unset($params['team_slug']); + if (array_key_exists('role_id', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: role_id'); + } - return $operator->call($arguments['org'], $arguments['custom_property_name']); + $arguments['role_id'] = $params['role_id']; + unset($params['role_id']); + $operator = new Internal\Operator\Orgs\RevokeOrgRoleTeam($this->browser, $this->authentication); + + return $operator->call($arguments['org'], $arguments['team_slug'], $arguments['role_id']); } /** @return */ - public function removeSecurityManagerTeam(array $params): WithoutBody + public function revokeOrgRoleUser(array $params): WithoutBody { $arguments = []; if (array_key_exists('org', $params) === false) { @@ -309,14 +303,20 @@ public function removeSecurityManagerTeam(array $params): WithoutBody $arguments['org'] = $params['org']; unset($params['org']); - if (array_key_exists('team_slug', $params) === false) { - throw new InvalidArgumentException('Missing mandatory field: team_slug'); + if (array_key_exists('username', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: username'); } - $arguments['team_slug'] = $params['team_slug']; - unset($params['team_slug']); - $operator = new Internal\Operator\Orgs\RemoveSecurityManagerTeam($this->browser, $this->authentication); + $arguments['username'] = $params['username']; + unset($params['username']); + if (array_key_exists('role_id', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: role_id'); + } - return $operator->call($arguments['org'], $arguments['team_slug']); + $arguments['role_id'] = $params['role_id']; + unset($params['role_id']); + $operator = new Internal\Operator\Orgs\RevokeOrgRoleUser($this->browser, $this->authentication); + + return $operator->call($arguments['org'], $arguments['username'], $arguments['role_id']); } } diff --git a/clients/GitHub/src/Internal/Router/Delete/Packages.php b/clients/GitHub/src/Internal/Router/Delete/Packages.php index cf17c8874ca..5f49f8c52c3 100644 --- a/clients/GitHub/src/Internal/Router/Delete/Packages.php +++ b/clients/GitHub/src/Internal/Router/Delete/Packages.php @@ -41,7 +41,7 @@ public function deletePackageForAuthenticatedUser(array $params): WithoutBody } /** @return */ - public function deletePackageVersionForAuthenticatedUser(array $params): WithoutBody + public function deletePackageForOrg(array $params): WithoutBody { $arguments = []; if (array_key_exists('package_type', $params) === false) { @@ -56,19 +56,19 @@ public function deletePackageVersionForAuthenticatedUser(array $params): Without $arguments['package_name'] = $params['package_name']; unset($params['package_name']); - if (array_key_exists('package_version_id', $params) === false) { - throw new InvalidArgumentException('Missing mandatory field: package_version_id'); + if (array_key_exists('org', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: org'); } - $arguments['package_version_id'] = $params['package_version_id']; - unset($params['package_version_id']); - $operator = new Internal\Operator\Packages\DeletePackageVersionForAuthenticatedUser($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀User🌀Packages🌀PackageType🌀PackageName🌀Versions🌀PackageVersionId()); + $arguments['org'] = $params['org']; + unset($params['org']); + $operator = new Internal\Operator\Packages\DeletePackageForOrg($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Orgs🌀Org🌀Packages🌀PackageType🌀PackageName()); - return $operator->call($arguments['package_type'], $arguments['package_name'], $arguments['package_version_id']); + return $operator->call($arguments['package_type'], $arguments['package_name'], $arguments['org']); } /** @return */ - public function deletePackageForOrg(array $params): WithoutBody + public function deletePackageForUser(array $params): WithoutBody { $arguments = []; if (array_key_exists('package_type', $params) === false) { @@ -83,19 +83,19 @@ public function deletePackageForOrg(array $params): WithoutBody $arguments['package_name'] = $params['package_name']; unset($params['package_name']); - if (array_key_exists('org', $params) === false) { - throw new InvalidArgumentException('Missing mandatory field: org'); + if (array_key_exists('username', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: username'); } - $arguments['org'] = $params['org']; - unset($params['org']); - $operator = new Internal\Operator\Packages\DeletePackageForOrg($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Orgs🌀Org🌀Packages🌀PackageType🌀PackageName()); + $arguments['username'] = $params['username']; + unset($params['username']); + $operator = new Internal\Operator\Packages\DeletePackageForUser($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Users🌀Username🌀Packages🌀PackageType🌀PackageName()); - return $operator->call($arguments['package_type'], $arguments['package_name'], $arguments['org']); + return $operator->call($arguments['package_type'], $arguments['package_name'], $arguments['username']); } /** @return */ - public function deletePackageForUser(array $params): WithoutBody + public function deletePackageVersionForAuthenticatedUser(array $params): WithoutBody { $arguments = []; if (array_key_exists('package_type', $params) === false) { @@ -110,15 +110,15 @@ public function deletePackageForUser(array $params): WithoutBody $arguments['package_name'] = $params['package_name']; unset($params['package_name']); - if (array_key_exists('username', $params) === false) { - throw new InvalidArgumentException('Missing mandatory field: username'); + if (array_key_exists('package_version_id', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: package_version_id'); } - $arguments['username'] = $params['username']; - unset($params['username']); - $operator = new Internal\Operator\Packages\DeletePackageForUser($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Users🌀Username🌀Packages🌀PackageType🌀PackageName()); + $arguments['package_version_id'] = $params['package_version_id']; + unset($params['package_version_id']); + $operator = new Internal\Operator\Packages\DeletePackageVersionForAuthenticatedUser($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀User🌀Packages🌀PackageType🌀PackageName🌀Versions🌀PackageVersionId()); - return $operator->call($arguments['package_type'], $arguments['package_name'], $arguments['username']); + return $operator->call($arguments['package_type'], $arguments['package_name'], $arguments['package_version_id']); } /** @return */ diff --git a/clients/GitHub/src/Internal/Router/Delete/Repos.php b/clients/GitHub/src/Internal/Router/Delete/Repos.php index 529625864d6..2d2f4d9a1c5 100644 --- a/clients/GitHub/src/Internal/Router/Delete/Repos.php +++ b/clients/GitHub/src/Internal/Router/Delete/Repos.php @@ -163,87 +163,6 @@ public function disableVulnerabilityAlerts(array $params): WithoutBody return $operator->call($arguments['owner'], $arguments['repo']); } - /** @return */ - public function deleteBranchProtection(array $params): WithoutBody - { - $arguments = []; - if (array_key_exists('owner', $params) === false) { - throw new InvalidArgumentException('Missing mandatory field: owner'); - } - - $arguments['owner'] = $params['owner']; - unset($params['owner']); - if (array_key_exists('repo', $params) === false) { - throw new InvalidArgumentException('Missing mandatory field: repo'); - } - - $arguments['repo'] = $params['repo']; - unset($params['repo']); - if (array_key_exists('branch', $params) === false) { - throw new InvalidArgumentException('Missing mandatory field: branch'); - } - - $arguments['branch'] = $params['branch']; - unset($params['branch']); - $operator = new Internal\Operator\Repos\DeleteBranchProtection($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Repos🌀Owner🌀Repo🌀Branches🌀Branch🌀Protection()); - - return $operator->call($arguments['owner'], $arguments['repo'], $arguments['branch']); - } - - /** @return */ - public function deleteReleaseAsset(array $params): WithoutBody - { - $arguments = []; - if (array_key_exists('owner', $params) === false) { - throw new InvalidArgumentException('Missing mandatory field: owner'); - } - - $arguments['owner'] = $params['owner']; - unset($params['owner']); - if (array_key_exists('repo', $params) === false) { - throw new InvalidArgumentException('Missing mandatory field: repo'); - } - - $arguments['repo'] = $params['repo']; - unset($params['repo']); - if (array_key_exists('asset_id', $params) === false) { - throw new InvalidArgumentException('Missing mandatory field: asset_id'); - } - - $arguments['asset_id'] = $params['asset_id']; - unset($params['asset_id']); - $operator = new Internal\Operator\Repos\DeleteReleaseAsset($this->browser, $this->authentication); - - return $operator->call($arguments['owner'], $arguments['repo'], $arguments['asset_id']); - } - - /** @return */ - public function deleteTagProtection(array $params): WithoutBody - { - $arguments = []; - if (array_key_exists('owner', $params) === false) { - throw new InvalidArgumentException('Missing mandatory field: owner'); - } - - $arguments['owner'] = $params['owner']; - unset($params['owner']); - if (array_key_exists('repo', $params) === false) { - throw new InvalidArgumentException('Missing mandatory field: repo'); - } - - $arguments['repo'] = $params['repo']; - unset($params['repo']); - if (array_key_exists('tag_protection_id', $params) === false) { - throw new InvalidArgumentException('Missing mandatory field: tag_protection_id'); - } - - $arguments['tag_protection_id'] = $params['tag_protection_id']; - unset($params['tag_protection_id']); - $operator = new Internal\Operator\Repos\DeleteTagProtection($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Repos🌀Owner🌀Repo🌀Tags🌀Protection🌀TagProtectionId()); - - return $operator->call($arguments['owner'], $arguments['repo'], $arguments['tag_protection_id']); - } - /** @return */ public function deleteAutolink(array $params): WithoutBody { @@ -541,6 +460,87 @@ public function deleteRepoRuleset(array $params): WithoutBody return $operator->call($arguments['owner'], $arguments['repo'], $arguments['ruleset_id']); } + /** @return */ + public function deleteBranchProtection(array $params): WithoutBody + { + $arguments = []; + if (array_key_exists('owner', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: owner'); + } + + $arguments['owner'] = $params['owner']; + unset($params['owner']); + if (array_key_exists('repo', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: repo'); + } + + $arguments['repo'] = $params['repo']; + unset($params['repo']); + if (array_key_exists('branch', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: branch'); + } + + $arguments['branch'] = $params['branch']; + unset($params['branch']); + $operator = new Internal\Operator\Repos\DeleteBranchProtection($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Repos🌀Owner🌀Repo🌀Branches🌀Branch🌀Protection()); + + return $operator->call($arguments['owner'], $arguments['repo'], $arguments['branch']); + } + + /** @return */ + public function deleteReleaseAsset(array $params): WithoutBody + { + $arguments = []; + if (array_key_exists('owner', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: owner'); + } + + $arguments['owner'] = $params['owner']; + unset($params['owner']); + if (array_key_exists('repo', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: repo'); + } + + $arguments['repo'] = $params['repo']; + unset($params['repo']); + if (array_key_exists('asset_id', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: asset_id'); + } + + $arguments['asset_id'] = $params['asset_id']; + unset($params['asset_id']); + $operator = new Internal\Operator\Repos\DeleteReleaseAsset($this->browser, $this->authentication); + + return $operator->call($arguments['owner'], $arguments['repo'], $arguments['asset_id']); + } + + /** @return */ + public function deleteTagProtection(array $params): WithoutBody + { + $arguments = []; + if (array_key_exists('owner', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: owner'); + } + + $arguments['owner'] = $params['owner']; + unset($params['owner']); + if (array_key_exists('repo', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: repo'); + } + + $arguments['repo'] = $params['repo']; + unset($params['repo']); + if (array_key_exists('tag_protection_id', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: tag_protection_id'); + } + + $arguments['tag_protection_id'] = $params['tag_protection_id']; + unset($params['tag_protection_id']); + $operator = new Internal\Operator\Repos\DeleteTagProtection($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Repos🌀Owner🌀Repo🌀Tags🌀Protection🌀TagProtectionId()); + + return $operator->call($arguments['owner'], $arguments['repo'], $arguments['tag_protection_id']); + } + /** @return */ public function deleteAdminBranchProtection(array $params): WithoutBody { diff --git a/clients/GitHub/src/Internal/Router/Delete/Six.php b/clients/GitHub/src/Internal/Router/Delete/Six.php index f43dc6be9c4..f42f91c156f 100644 --- a/clients/GitHub/src/Internal/Router/Delete/Six.php +++ b/clients/GitHub/src/Internal/Router/Delete/Six.php @@ -17,10 +17,23 @@ public function __construct(private Routers $routers) { } + /** @return \ApiClients\Tools\OpenApiClient\Utils\Response\WithoutBody| */ public function call(string $call, array $params, array $pathChunks): WithoutBody|Ok|\ApiClients\Client\GitHub\Schema\Operations\Copilot\CancelCopilotSeatAssignmentForUsers\Response\ApplicationJson\Ok|ActionsCacheList|FileCommit { if ($pathChunks[0] === '') { - if ($pathChunks[1] === 'orgs') { + if ($pathChunks[1] === 'enterprises') { + if ($pathChunks[2] === '{enterprise}') { + if ($pathChunks[3] === 'code-security') { + if ($pathChunks[4] === 'configurations') { + if ($pathChunks[5] === '{configuration_id}') { + if ($call === 'DELETE /enterprises/{enterprise}/code-security/configurations/{configuration_id}') { + return $this->routers->internal🔀Router🔀Delete🔀CodeSecurity()->deleteConfigurationForEnterprise($params); + } + } + } + } + } + } elseif ($pathChunks[1] === 'orgs') { if ($pathChunks[2] === '{org}') { if ($pathChunks[3] === 'actions') { if ($pathChunks[4] === 'runner-groups') { diff --git a/clients/GitHub/src/Internal/Router/Delete/Teams.php b/clients/GitHub/src/Internal/Router/Delete/Teams.php index 92591894f9f..8c9a0d2b5dc 100644 --- a/clients/GitHub/src/Internal/Router/Delete/Teams.php +++ b/clients/GitHub/src/Internal/Router/Delete/Teams.php @@ -124,6 +124,33 @@ public function removeProjectLegacy(array $params): WithoutBody return $operator->call($arguments['team_id'], $arguments['project_id']); } + /** @return */ + public function removeRepoLegacy(array $params): WithoutBody + { + $arguments = []; + if (array_key_exists('team_id', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: team_id'); + } + + $arguments['team_id'] = $params['team_id']; + unset($params['team_id']); + if (array_key_exists('owner', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: owner'); + } + + $arguments['owner'] = $params['owner']; + unset($params['owner']); + if (array_key_exists('repo', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: repo'); + } + + $arguments['repo'] = $params['repo']; + unset($params['repo']); + $operator = new Internal\Operator\Teams\RemoveRepoLegacy($this->browser, $this->authentication); + + return $operator->call($arguments['team_id'], $arguments['owner'], $arguments['repo']); + } + /** @return */ public function deleteLegacy(array $params): WithoutBody { @@ -247,33 +274,6 @@ public function deleteDiscussionCommentLegacy(array $params): WithoutBody return $operator->call($arguments['team_id'], $arguments['discussion_number'], $arguments['comment_number']); } - /** @return */ - public function removeRepoLegacy(array $params): WithoutBody - { - $arguments = []; - if (array_key_exists('team_id', $params) === false) { - throw new InvalidArgumentException('Missing mandatory field: team_id'); - } - - $arguments['team_id'] = $params['team_id']; - unset($params['team_id']); - if (array_key_exists('owner', $params) === false) { - throw new InvalidArgumentException('Missing mandatory field: owner'); - } - - $arguments['owner'] = $params['owner']; - unset($params['owner']); - if (array_key_exists('repo', $params) === false) { - throw new InvalidArgumentException('Missing mandatory field: repo'); - } - - $arguments['repo'] = $params['repo']; - unset($params['repo']); - $operator = new Internal\Operator\Teams\RemoveRepoLegacy($this->browser, $this->authentication); - - return $operator->call($arguments['team_id'], $arguments['owner'], $arguments['repo']); - } - /** @return */ public function removeRepoInOrg(array $params): WithoutBody { diff --git a/clients/GitHub/src/Internal/Router/Get/CodeScanning.php b/clients/GitHub/src/Internal/Router/Get/CodeScanning.php index 99e97da0073..0bdc85b6753 100644 --- a/clients/GitHub/src/Internal/Router/Get/CodeScanning.php +++ b/clients/GitHub/src/Internal/Router/Get/CodeScanning.php @@ -8,6 +8,7 @@ use ApiClients\Client\GitHub\Schema; use ApiClients\Client\GitHub\Schema\CodeScanningAlert; use ApiClients\Client\GitHub\Schema\CodeScanningAnalysis; +use ApiClients\Client\GitHub\Schema\CodeScanningAutofix; use ApiClients\Client\GitHub\Schema\CodeScanningCodeqlDatabase; use ApiClients\Client\GitHub\Schema\CodeScanningDefaultSetup; use ApiClients\Client\GitHub\Schema\CodeScanningSarifsStatus; @@ -393,6 +394,32 @@ public function getSarif(array $params): CodeScanningSarifsStatus|WithoutBody return $operator->call($arguments['owner'], $arguments['repo'], $arguments['sarif_id']); } + public function getAutofix(array $params): CodeScanningAutofix + { + $arguments = []; + if (array_key_exists('owner', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: owner'); + } + + $arguments['owner'] = $params['owner']; + unset($params['owner']); + if (array_key_exists('repo', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: repo'); + } + + $arguments['repo'] = $params['repo']; + unset($params['repo']); + if (array_key_exists('alert_number', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: alert_number'); + } + + $arguments['alert_number'] = $params['alert_number']; + unset($params['alert_number']); + $operator = new Internal\Operator\CodeScanning\GetAutofix($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Repos🌀Owner🌀Repo🌀CodeScanning🌀Alerts🌀AlertNumber🌀Autofix()); + + return $operator->call($arguments['owner'], $arguments['repo'], $arguments['alert_number']); + } + /** @return Observable */ public function listAlertInstances(array $params): iterable { diff --git a/clients/GitHub/src/Internal/Router/Get/CodeSecurity.php b/clients/GitHub/src/Internal/Router/Get/CodeSecurity.php index c94d6e6aa58..1c924159bef 100644 --- a/clients/GitHub/src/Internal/Router/Get/CodeSecurity.php +++ b/clients/GitHub/src/Internal/Router/Get/CodeSecurity.php @@ -22,6 +22,39 @@ public function __construct(private SchemaValidator $requestSchemaValidator, pri { } + /** @return iterable */ + public function getConfigurationsForEnterprise(array $params): iterable + { + $arguments = []; + if (array_key_exists('enterprise', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: enterprise'); + } + + $arguments['enterprise'] = $params['enterprise']; + unset($params['enterprise']); + if (array_key_exists('before', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: before'); + } + + $arguments['before'] = $params['before']; + unset($params['before']); + if (array_key_exists('after', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: after'); + } + + $arguments['after'] = $params['after']; + unset($params['after']); + if (array_key_exists('per_page', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: per_page'); + } + + $arguments['per_page'] = $params['per_page']; + unset($params['per_page']); + $operator = new Internal\Operator\CodeSecurity\GetConfigurationsForEnterprise($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Enterprises🌀Enterprise🌀CodeSecurity🌀Configurations()); + + return $operator->call($arguments['enterprise'], $arguments['before'], $arguments['after'], $arguments['per_page']); + } + /** @return Observable */ public function getConfigurationsForOrg(array $params): iterable { @@ -82,6 +115,41 @@ public function getConfigurationForRepository(array $params): CodeSecurityConfig return $operator->call($arguments['owner'], $arguments['repo']); } + /** @return iterable */ + public function getDefaultConfigurationsForEnterprise(array $params): iterable + { + $arguments = []; + if (array_key_exists('enterprise', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: enterprise'); + } + + $arguments['enterprise'] = $params['enterprise']; + unset($params['enterprise']); + $operator = new Internal\Operator\CodeSecurity\GetDefaultConfigurationsForEnterprise($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Enterprises🌀Enterprise🌀CodeSecurity🌀Configurations🌀Defaults()); + + return $operator->call($arguments['enterprise']); + } + + public function getSingleConfigurationForEnterprise(array $params): CodeSecurityConfiguration|WithoutBody + { + $arguments = []; + if (array_key_exists('enterprise', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: enterprise'); + } + + $arguments['enterprise'] = $params['enterprise']; + unset($params['enterprise']); + if (array_key_exists('configuration_id', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: configuration_id'); + } + + $arguments['configuration_id'] = $params['configuration_id']; + unset($params['configuration_id']); + $operator = new Internal\Operator\CodeSecurity\GetSingleConfigurationForEnterprise($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Enterprises🌀Enterprise🌀CodeSecurity🌀Configurations🌀ConfigurationId()); + + return $operator->call($arguments['enterprise'], $arguments['configuration_id']); + } + /** @return Observable|WithoutBody */ public function getDefaultConfigurations(array $params): iterable|WithoutBody { @@ -118,6 +186,51 @@ public function getConfiguration(array $params): CodeSecurityConfiguration|Witho return $operator->call($arguments['org'], $arguments['configuration_id']); } + /** @return iterable */ + public function getRepositoriesForEnterpriseConfiguration(array $params): iterable + { + $arguments = []; + if (array_key_exists('enterprise', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: enterprise'); + } + + $arguments['enterprise'] = $params['enterprise']; + unset($params['enterprise']); + if (array_key_exists('configuration_id', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: configuration_id'); + } + + $arguments['configuration_id'] = $params['configuration_id']; + unset($params['configuration_id']); + if (array_key_exists('before', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: before'); + } + + $arguments['before'] = $params['before']; + unset($params['before']); + if (array_key_exists('after', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: after'); + } + + $arguments['after'] = $params['after']; + unset($params['after']); + if (array_key_exists('per_page', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: per_page'); + } + + $arguments['per_page'] = $params['per_page']; + unset($params['per_page']); + if (array_key_exists('status', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: status'); + } + + $arguments['status'] = $params['status']; + unset($params['status']); + $operator = new Internal\Operator\CodeSecurity\GetRepositoriesForEnterpriseConfiguration($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Enterprises🌀Enterprise🌀CodeSecurity🌀Configurations🌀ConfigurationId🌀Repositories()); + + return $operator->call($arguments['enterprise'], $arguments['configuration_id'], $arguments['before'], $arguments['after'], $arguments['per_page'], $arguments['status']); + } + /** @return Observable */ public function getRepositoriesForConfiguration(array $params): iterable { diff --git a/clients/GitHub/src/Internal/Router/Get/Eight.php b/clients/GitHub/src/Internal/Router/Get/Eight.php index 5c5d697bcde..a5499326384 100644 --- a/clients/GitHub/src/Internal/Router/Get/Eight.php +++ b/clients/GitHub/src/Internal/Router/Get/Eight.php @@ -10,6 +10,7 @@ use ApiClients\Client\GitHub\Schema\ActionsVariable; use ApiClients\Client\GitHub\Schema\ApiInsightsSummaryStats; use ApiClients\Client\GitHub\Schema\BranchRestrictionPolicy; +use ApiClients\Client\GitHub\Schema\CodeScanningAutofix; use ApiClients\Client\GitHub\Schema\CodeScanningCodeqlDatabase; use ApiClients\Client\GitHub\Schema\CodeScanningVariantAnalysis; use ApiClients\Client\GitHub\Schema\DeploymentBranchPolicy; @@ -36,8 +37,8 @@ public function __construct(private Routers $routers) { } - /** @return Observable||Observable|Observable|Observable|Observable|Observable|Observable|Observable|WithoutBody */ - public function call(string $call, array $params, array $pathChunks): iterable|ApiInsightsSummaryStats|PackageVersion|TeamRepository|WithoutBody|OidcCustomSubRepo|Ok|Json|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListJobsForWorkflowRun\Response\ApplicationJson\Ok\Application\Json|WorkflowRunUsage|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListWorkflowRuns\Response\ApplicationJson\Ok\Application\Json|WorkflowUsage|ProtectedBranchAdminEnforced|ProtectedBranchPullRequestReview|StatusCheckPolicy|BranchRestrictionPolicy|CodeScanningCodeqlDatabase|CodeScanningVariantAnalysis|DeploymentStatus|DeploymentBranchPolicy|\ApiClients\Client\GitHub\Schema\Operations\Repos\ListCustomDeploymentRuleIntegrations\Response\ApplicationJson\Ok|DeploymentProtectionRule|ActionsPublicKey|ActionsSecret|ActionsVariable|HookDelivery|PullRequestReview + /** @return Observable||Observable|Observable|Observable|Observable|Observable|Schema\CodeScanningAutofix|Observable|Observable|WithoutBody */ + public function call(string $call, array $params, array $pathChunks): iterable|ApiInsightsSummaryStats|PackageVersion|TeamRepository|WithoutBody|OidcCustomSubRepo|Ok|Json|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListJobsForWorkflowRun\Response\ApplicationJson\Ok\Application\Json|WorkflowRunUsage|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListWorkflowRuns\Response\ApplicationJson\Ok\Application\Json|WorkflowUsage|ProtectedBranchAdminEnforced|ProtectedBranchPullRequestReview|StatusCheckPolicy|BranchRestrictionPolicy|CodeScanningAutofix|CodeScanningCodeqlDatabase|CodeScanningVariantAnalysis|DeploymentStatus|DeploymentBranchPolicy|\ApiClients\Client\GitHub\Schema\Operations\Repos\ListCustomDeploymentRuleIntegrations\Response\ApplicationJson\Ok|DeploymentProtectionRule|ActionsPublicKey|ActionsSecret|ActionsVariable|HookDelivery|PullRequestReview { if ($pathChunks[0] === '') { if ($pathChunks[1] === 'orgs') { @@ -226,7 +227,11 @@ public function call(string $call, array $params, array $pathChunks): iterable|A } elseif ($pathChunks[4] === 'code-scanning') { if ($pathChunks[5] === 'alerts') { if ($pathChunks[6] === '{alert_number}') { - if ($pathChunks[7] === 'instances') { + if ($pathChunks[7] === 'autofix') { + if ($call === 'GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix') { + return $this->routers->internal🔀Router🔀Get🔀CodeScanning()->getAutofix($params); + } + } elseif ($pathChunks[7] === 'instances') { if ($call === 'GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances') { return $this->routers->internal🔀Router🔀Get🔀CodeScanning()->listAlertInstances($params); } diff --git a/clients/GitHub/src/Internal/Router/Get/Five.php b/clients/GitHub/src/Internal/Router/Get/Five.php index ca9fc5426b3..0709da206e3 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|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|Observable|Observable */ + /** @return |iterable|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|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\ListSelfHostedRunnersForOrg\Response\ApplicationJson\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] === '') { @@ -67,7 +67,13 @@ public function call(string $call, array $params, array $pathChunks): HookDelive } } elseif ($pathChunks[1] === 'enterprises') { if ($pathChunks[2] === '{enterprise}') { - if ($pathChunks[3] === 'dependabot') { + if ($pathChunks[3] === 'code-security') { + if ($pathChunks[4] === 'configurations') { + if ($call === 'GET /enterprises/{enterprise}/code-security/configurations') { + return $this->routers->internal🔀Router🔀Get🔀CodeSecurity()->getConfigurationsForEnterprise($params); + } + } + } elseif ($pathChunks[3] === 'dependabot') { if ($pathChunks[4] === 'alerts') { if ($call === 'GET /enterprises/{enterprise}/dependabot/alerts') { return $this->routers->internal🔀Router🔀Get🔀Dependabot()->listAlertsForEnterprise($params); diff --git a/clients/GitHub/src/Internal/Router/Get/Seven.php b/clients/GitHub/src/Internal/Router/Get/Seven.php index 2fc7234ffe1..2e43d5ab880 100644 --- a/clients/GitHub/src/Internal/Router/Get/Seven.php +++ b/clients/GitHub/src/Internal/Router/Get/Seven.php @@ -63,11 +63,25 @@ public function __construct(private Routers $routers) { } - /** @return |Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Schema\BasicError|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Schema\ConvertedNoteToIssueIssueEvent|Schema\TimelineCommentEvent|Schema\TimelineCrossReferencedEvent|Schema\TimelineCommittedEvent|Schema\TimelineReviewedEvent|Schema\TimelineLineCommentedEvent|Schema\TimelineCommitCommentedEvent|Schema\TimelineAssignedIssueEvent|Schema\TimelineUnassignedIssueEvent|Schema\StateChangeIssueEvent>|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable */ - public function call(string $call, array $params, array $pathChunks): OidcCustomSub|Ok|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListSelfHostedRunnersInGroupForOrg\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListLabelsForSelfHostedRunnerForOrg\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListSelectedReposForOrgSecret\Response\ApplicationJson\Ok|Json|WithoutBody|iterable|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\ListSelectedReposForOrgSecret\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Dependabot\ListSelectedReposForOrgSecret\Response\ApplicationJson\Ok\Application\Json|HookDelivery|TeamDiscussion|TeamMembership|TeamProject|Artifact|ActionsCacheUsageByRepository|Job|ActionsWorkflowAccessToRepository|SelectedActions|ActionsGetDefaultWorkflowPermissions|Runner|WorkflowRun|ActionsPublicKey|ActionsSecret|ActionsVariable|Workflow|BranchProtection|\ApiClients\Client\GitHub\Schema\Operations\Checks\ListForSuite\Response\ApplicationJson\Ok|CodeScanningAlert|CodeScanningAnalysis|CodeScanningSarifsStatus|CodespacesPublicKey|RepoCodespacesSecret|RepositoryCollaboratorPermission|\ApiClients\Client\GitHub\Schema\Operations\Checks\ListForRef\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Checks\ListSuitesForRef\Response\ApplicationJson\Ok|CombinedCommitStatus|BasicError|DependabotAlert|DependabotPublicKey|DependabotSecret|\ApiClients\Client\GitHub\Schema\Operations\Repos\ListDeploymentBranchPolicies\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Repos\GetAllDeploymentProtectionRules\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListEnvironmentSecrets\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListEnvironmentVariables\Response\ApplicationJson\Ok\Application\Json|Blob|GitCommit|GitRef|GitTag|GitTree|WebhookConfig|IssueComment|IssueEvent|PageBuild|PagesDeploymentStatus|PullRequestReviewComment|PullRequestReviewRequest|ReleaseAsset|Release|RuleSuite|SecretScanningAlert|TeamDiscussionComment|PackageVersion + /** @return iterable||Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Schema\BasicError|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Schema\ConvertedNoteToIssueIssueEvent|Schema\TimelineCommentEvent|Schema\TimelineCrossReferencedEvent|Schema\TimelineCommittedEvent|Schema\TimelineReviewedEvent|Schema\TimelineLineCommentedEvent|Schema\TimelineCommitCommentedEvent|Schema\TimelineAssignedIssueEvent|Schema\TimelineUnassignedIssueEvent|Schema\StateChangeIssueEvent>|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable */ + public function call(string $call, array $params, array $pathChunks): iterable|OidcCustomSub|Ok|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListSelfHostedRunnersInGroupForOrg\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListLabelsForSelfHostedRunnerForOrg\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListSelectedReposForOrgSecret\Response\ApplicationJson\Ok|Json|WithoutBody|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\ListSelectedReposForOrgSecret\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Dependabot\ListSelectedReposForOrgSecret\Response\ApplicationJson\Ok\Application\Json|HookDelivery|TeamDiscussion|TeamMembership|TeamProject|Artifact|ActionsCacheUsageByRepository|Job|ActionsWorkflowAccessToRepository|SelectedActions|ActionsGetDefaultWorkflowPermissions|Runner|WorkflowRun|ActionsPublicKey|ActionsSecret|ActionsVariable|Workflow|BranchProtection|\ApiClients\Client\GitHub\Schema\Operations\Checks\ListForSuite\Response\ApplicationJson\Ok|CodeScanningAlert|CodeScanningAnalysis|CodeScanningSarifsStatus|CodespacesPublicKey|RepoCodespacesSecret|RepositoryCollaboratorPermission|\ApiClients\Client\GitHub\Schema\Operations\Checks\ListForRef\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Checks\ListSuitesForRef\Response\ApplicationJson\Ok|CombinedCommitStatus|BasicError|DependabotAlert|DependabotPublicKey|DependabotSecret|\ApiClients\Client\GitHub\Schema\Operations\Repos\ListDeploymentBranchPolicies\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Repos\GetAllDeploymentProtectionRules\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListEnvironmentSecrets\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListEnvironmentVariables\Response\ApplicationJson\Ok\Application\Json|Blob|GitCommit|GitRef|GitTag|GitTree|WebhookConfig|IssueComment|IssueEvent|PageBuild|PagesDeploymentStatus|PullRequestReviewComment|PullRequestReviewRequest|ReleaseAsset|Release|RuleSuite|SecretScanningAlert|TeamDiscussionComment|PackageVersion { if ($pathChunks[0] === '') { - if ($pathChunks[1] === 'orgs') { + if ($pathChunks[1] === 'enterprises') { + if ($pathChunks[2] === '{enterprise}') { + if ($pathChunks[3] === 'code-security') { + if ($pathChunks[4] === 'configurations') { + if ($pathChunks[5] === '{configuration_id}') { + if ($pathChunks[6] === 'repositories') { + if ($call === 'GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories') { + return $this->routers->internal🔀Router🔀Get🔀CodeSecurity()->getRepositoriesForEnterpriseConfiguration($params); + } + } + } + } + } + } + } elseif ($pathChunks[1] === 'orgs') { if ($pathChunks[2] === '{org}') { if ($pathChunks[3] === 'actions') { if ($pathChunks[4] === 'oidc') { diff --git a/clients/GitHub/src/Internal/Router/Get/Six.php b/clients/GitHub/src/Internal/Router/Get/Six.php index b01d6f5e2a0..f7c431ee2c6 100644 --- a/clients/GitHub/src/Internal/Router/Get/Six.php +++ b/clients/GitHub/src/Internal/Router/Get/Six.php @@ -78,11 +78,27 @@ 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|Schema\Operations\Repos\GetCodeFrequencyStats\Response\ApplicationJson\Accepted\Application\Json|Observable|Schema\Operations\Repos\GetCommitActivityStats\Response\ApplicationJson\Accepted\Application\Json|Observable|Schema\Operations\Repos\GetContributorsStats\Response\ApplicationJson\Accepted\Application\Json|Observable|Observable|Observable|Observable|Observable */ - public function call(string $call, array $params, array $pathChunks): iterable|BillingUsageReport|ActionsCacheUsageOrgEnterprise|Ok|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListSelectedRepositoriesEnabledGithubActionsOrganization\Response\ApplicationJson\Ok|SelectedActions|ActionsGetDefaultWorkflowPermissions|RunnerGroupsOrg|Runner|ActionsPublicKey|OrganizationActionsSecret|OrganizationActionsVariable|WithoutBody|CodeSecurityConfiguration|CodespacesPublicKey|CodespacesOrgSecret|\ApiClients\Client\GitHub\Schema\Operations\Copilot\ListCopilotSeats\Response\ApplicationJson\Ok|DependabotPublicKey|OrganizationDependabotSecret|WebhookConfig|ApiInsightsSummaryStats|Json|CopilotSeatDetails|Package|CustomProperty|RuleSuite|ActionsBillingUsage|PackagesBillingUsage|CombinedBillingUsage|ProjectCollaboratorPermission|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListArtifactsForRepo\Response\ApplicationJson\Ok|ActionsCacheList|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListRepoOrganizationSecrets\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListRepoOrganizationVariables\Response\ApplicationJson\Ok|ActionsRepositoryPermissions|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListSelfHostedRunnersForRepo\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListWorkflowRunsForRepo\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListRepoSecrets\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListRepoVariables\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListRepoWorkflows\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Repos\ListAttestations\Response\ApplicationJson\Ok\Application\Json|Autolink|BranchWithProtection|BasicError|CheckRun|CheckSuite|CodeScanningDefaultSetup|CodeownersErrors|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\ListDevcontainersInRepositoryForAuthenticatedUser\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\RepoMachinesForAuthenticatedUser\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\PreFlightWithRepoForAuthenticatedUser\Response\ApplicationJson\Ok|CodespacesPermissionsCheckForDevcontainer|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\ListRepoSecrets\Response\ApplicationJson\Ok|CommitComment|Commit|CommunityProfile|CommitComparison|ContentDirectory|ContentFile|ContentSymlink|ContentSubmodule|\ApiClients\Client\GitHub\Schema\Operations\Dependabot\ListRepoSecrets\Response\ApplicationJson\Ok|DependencyGraphSpdxSbom|Deployment|Environment|Hook|Issue|DeployKey|Label|Milestone|PagesHealthCheck|EmptyObject|PullRequest|Release|RepositoryRuleset|SecretScanningScanHistory|RepositoryAdvisory|\ApiClients\Client\GitHub\Schema\Operations\Repos\GetCodeFrequencyStats\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Repos\GetCommitActivityStats\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Repos\GetContributorsStats\Response\ApplicationJson\Accepted\Application\Json|ParticipationStats|CloneTraffic|ViewTraffic|TeamRepository|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\ListRepositoriesForSecretForAuthenticatedUser\Response\ApplicationJson\Ok\Application\Json|CodespaceExportDetails + /** @return iterable|Schema\CodeSecurityConfiguration|\ApiClients\Tools\OpenApiClient\Utils\Response\WithoutBody|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|Schema\Operations\Repos\GetCodeFrequencyStats\Response\ApplicationJson\Accepted\Application\Json|Observable|Schema\Operations\Repos\GetCommitActivityStats\Response\ApplicationJson\Accepted\Application\Json|Observable|Schema\Operations\Repos\GetContributorsStats\Response\ApplicationJson\Accepted\Application\Json|Observable|Observable|Observable|Observable|Observable */ + public function call(string $call, array $params, array $pathChunks): iterable|CodeSecurityConfiguration|WithoutBody|BillingUsageReport|ActionsCacheUsageOrgEnterprise|Ok|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListSelectedRepositoriesEnabledGithubActionsOrganization\Response\ApplicationJson\Ok|SelectedActions|ActionsGetDefaultWorkflowPermissions|RunnerGroupsOrg|Runner|ActionsPublicKey|OrganizationActionsSecret|OrganizationActionsVariable|CodespacesPublicKey|CodespacesOrgSecret|\ApiClients\Client\GitHub\Schema\Operations\Copilot\ListCopilotSeats\Response\ApplicationJson\Ok|DependabotPublicKey|OrganizationDependabotSecret|WebhookConfig|ApiInsightsSummaryStats|Json|CopilotSeatDetails|Package|CustomProperty|RuleSuite|ActionsBillingUsage|PackagesBillingUsage|CombinedBillingUsage|ProjectCollaboratorPermission|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListArtifactsForRepo\Response\ApplicationJson\Ok|ActionsCacheList|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListRepoOrganizationSecrets\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListRepoOrganizationVariables\Response\ApplicationJson\Ok|ActionsRepositoryPermissions|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListSelfHostedRunnersForRepo\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListWorkflowRunsForRepo\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListRepoSecrets\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListRepoVariables\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListRepoWorkflows\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Repos\ListAttestations\Response\ApplicationJson\Ok\Application\Json|Autolink|BranchWithProtection|BasicError|CheckRun|CheckSuite|CodeScanningDefaultSetup|CodeownersErrors|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\ListDevcontainersInRepositoryForAuthenticatedUser\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\RepoMachinesForAuthenticatedUser\Response\ApplicationJson\Ok|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\PreFlightWithRepoForAuthenticatedUser\Response\ApplicationJson\Ok|CodespacesPermissionsCheckForDevcontainer|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\ListRepoSecrets\Response\ApplicationJson\Ok|CommitComment|Commit|CommunityProfile|CommitComparison|ContentDirectory|ContentFile|ContentSymlink|ContentSubmodule|\ApiClients\Client\GitHub\Schema\Operations\Dependabot\ListRepoSecrets\Response\ApplicationJson\Ok|DependencyGraphSpdxSbom|Deployment|Environment|Hook|Issue|DeployKey|Label|Milestone|PagesHealthCheck|EmptyObject|PullRequest|Release|RepositoryRuleset|SecretScanningScanHistory|RepositoryAdvisory|\ApiClients\Client\GitHub\Schema\Operations\Repos\GetCodeFrequencyStats\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Repos\GetCommitActivityStats\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHub\Schema\Operations\Repos\GetContributorsStats\Response\ApplicationJson\Accepted\Application\Json|ParticipationStats|CloneTraffic|ViewTraffic|TeamRepository|\ApiClients\Client\GitHub\Schema\Operations\Codespaces\ListRepositoriesForSecretForAuthenticatedUser\Response\ApplicationJson\Ok\Application\Json|CodespaceExportDetails { if ($pathChunks[0] === '') { - if ($pathChunks[1] === 'marketplace_listing') { + if ($pathChunks[1] === 'enterprises') { + if ($pathChunks[2] === '{enterprise}') { + if ($pathChunks[3] === 'code-security') { + if ($pathChunks[4] === 'configurations') { + if ($pathChunks[5] === 'defaults') { + if ($call === 'GET /enterprises/{enterprise}/code-security/configurations/defaults') { + return $this->routers->internal🔀Router🔀Get🔀CodeSecurity()->getDefaultConfigurationsForEnterprise($params); + } + } elseif ($pathChunks[5] === '{configuration_id}') { + if ($call === 'GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}') { + return $this->routers->internal🔀Router🔀Get🔀CodeSecurity()->getSingleConfigurationForEnterprise($params); + } + } + } + } + } + } elseif ($pathChunks[1] === 'marketplace_listing') { if ($pathChunks[2] === 'stubbed') { if ($pathChunks[3] === 'plans') { if ($pathChunks[4] === '{plan_id}') { diff --git a/clients/GitHub/src/Internal/Router/Patch/CodeSecurity.php b/clients/GitHub/src/Internal/Router/Patch/CodeSecurity.php index 480126e31c1..bc7c4092f67 100644 --- a/clients/GitHub/src/Internal/Router/Patch/CodeSecurity.php +++ b/clients/GitHub/src/Internal/Router/Patch/CodeSecurity.php @@ -20,6 +20,26 @@ public function __construct(private SchemaValidator $requestSchemaValidator, pri { } + public function updateEnterpriseConfiguration(array $params): CodeSecurityConfiguration|WithoutBody + { + $arguments = []; + if (array_key_exists('enterprise', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: enterprise'); + } + + $arguments['enterprise'] = $params['enterprise']; + unset($params['enterprise']); + if (array_key_exists('configuration_id', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: configuration_id'); + } + + $arguments['configuration_id'] = $params['configuration_id']; + unset($params['configuration_id']); + $operator = new Internal\Operator\CodeSecurity\UpdateEnterpriseConfiguration($this->browser, $this->authentication, $this->requestSchemaValidator, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Enterprises🌀Enterprise🌀CodeSecurity🌀Configurations🌀ConfigurationId()); + + return $operator->call($arguments['enterprise'], $arguments['configuration_id'], $params); + } + /** @return */ public function updateConfiguration(array $params): CodeSecurityConfiguration|WithoutBody { diff --git a/clients/GitHub/src/Internal/Router/Patch/Migrations.php b/clients/GitHub/src/Internal/Router/Patch/Migrations.php index 73870d8efe0..07d87f450da 100644 --- a/clients/GitHub/src/Internal/Router/Patch/Migrations.php +++ b/clients/GitHub/src/Internal/Router/Patch/Migrations.php @@ -21,7 +21,7 @@ public function __construct(private SchemaValidator $requestSchemaValidator, pri } /** @return */ - public function updateImport(array $params): Import + public function setLfsPreference(array $params): Import { $arguments = []; if (array_key_exists('owner', $params) === false) { @@ -36,13 +36,13 @@ public function updateImport(array $params): Import $arguments['repo'] = $params['repo']; unset($params['repo']); - $operator = new Internal\Operator\Migrations\UpdateImport($this->browser, $this->authentication, $this->requestSchemaValidator, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Repos🌀Owner🌀Repo🌀Import()); + $operator = new Internal\Operator\Migrations\SetLfsPreference($this->browser, $this->authentication, $this->requestSchemaValidator, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Repos🌀Owner🌀Repo🌀Import🌀Lfs()); return $operator->call($arguments['owner'], $arguments['repo'], $params); } /** @return */ - public function setLfsPreference(array $params): Import + public function updateImport(array $params): Import { $arguments = []; if (array_key_exists('owner', $params) === false) { @@ -57,7 +57,7 @@ public function setLfsPreference(array $params): Import $arguments['repo'] = $params['repo']; unset($params['repo']); - $operator = new Internal\Operator\Migrations\SetLfsPreference($this->browser, $this->authentication, $this->requestSchemaValidator, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Repos🌀Owner🌀Repo🌀Import🌀Lfs()); + $operator = new Internal\Operator\Migrations\UpdateImport($this->browser, $this->authentication, $this->requestSchemaValidator, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Repos🌀Owner🌀Repo🌀Import()); return $operator->call($arguments['owner'], $arguments['repo'], $params); } diff --git a/clients/GitHub/src/Internal/Router/Patch/Orgs.php b/clients/GitHub/src/Internal/Router/Patch/Orgs.php index 60d0bdc9783..9bd82ddcc97 100644 --- a/clients/GitHub/src/Internal/Router/Patch/Orgs.php +++ b/clients/GitHub/src/Internal/Router/Patch/Orgs.php @@ -24,6 +24,27 @@ public function __construct(private SchemaValidator $requestSchemaValidator, pri { } + /** @return */ + public function updateWebhookConfigForOrg(array $params): WebhookConfig + { + $arguments = []; + if (array_key_exists('org', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: org'); + } + + $arguments['org'] = $params['org']; + unset($params['org']); + if (array_key_exists('hook_id', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: hook_id'); + } + + $arguments['hook_id'] = $params['hook_id']; + unset($params['hook_id']); + $operator = new Internal\Operator\Orgs\UpdateWebhookConfigForOrg($this->browser, $this->authentication, $this->requestSchemaValidator, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Orgs🌀Org🌀Hooks🌀HookId🌀Config()); + + return $operator->call($arguments['org'], $arguments['hook_id'], $params); + } + /** @return */ public function update(array $params): OrganizationFull { @@ -104,25 +125,4 @@ public function updateMembershipForAuthenticatedUser(array $params): OrgMembersh return $operator->call($arguments['org'], $params); } - - /** @return */ - public function updateWebhookConfigForOrg(array $params): WebhookConfig - { - $arguments = []; - if (array_key_exists('org', $params) === false) { - throw new InvalidArgumentException('Missing mandatory field: org'); - } - - $arguments['org'] = $params['org']; - unset($params['org']); - if (array_key_exists('hook_id', $params) === false) { - throw new InvalidArgumentException('Missing mandatory field: hook_id'); - } - - $arguments['hook_id'] = $params['hook_id']; - unset($params['hook_id']); - $operator = new Internal\Operator\Orgs\UpdateWebhookConfigForOrg($this->browser, $this->authentication, $this->requestSchemaValidator, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Orgs🌀Org🌀Hooks🌀HookId🌀Config()); - - return $operator->call($arguments['org'], $arguments['hook_id'], $params); - } } diff --git a/clients/GitHub/src/Internal/Router/Patch/Six.php b/clients/GitHub/src/Internal/Router/Patch/Six.php index f5d20803086..88921b80c63 100644 --- a/clients/GitHub/src/Internal/Router/Patch/Six.php +++ b/clients/GitHub/src/Internal/Router/Patch/Six.php @@ -32,10 +32,23 @@ public function __construct(private Routers $routers) { } - public function call(string $call, array $params, array $pathChunks): RunnerGroupsOrg|WithoutBody|CodeSecurityConfiguration|WebhookConfig|CheckRun|CheckSuitePreference|EmptyObject|CodeScanningDefaultSetupUpdateResponse|CommitComment|Hook|Import|RepositoryInvitation|Issue|BasicError|Label|Milestone|PullRequest|Release|RepositoryAdvisory + /** @return Schema\CodeSecurityConfiguration|\ApiClients\Tools\OpenApiClient\Utils\Response\WithoutBody| */ + public function call(string $call, array $params, array $pathChunks): CodeSecurityConfiguration|WithoutBody|RunnerGroupsOrg|WebhookConfig|CheckRun|CheckSuitePreference|EmptyObject|CodeScanningDefaultSetupUpdateResponse|CommitComment|Hook|Import|RepositoryInvitation|Issue|BasicError|Label|Milestone|PullRequest|Release|RepositoryAdvisory { if ($pathChunks[0] === '') { - if ($pathChunks[1] === 'orgs') { + if ($pathChunks[1] === 'enterprises') { + if ($pathChunks[2] === '{enterprise}') { + if ($pathChunks[3] === 'code-security') { + if ($pathChunks[4] === 'configurations') { + if ($pathChunks[5] === '{configuration_id}') { + if ($call === 'PATCH /enterprises/{enterprise}/code-security/configurations/{configuration_id}') { + return $this->routers->internal🔀Router🔀Patch🔀CodeSecurity()->updateEnterpriseConfiguration($params); + } + } + } + } + } + } elseif ($pathChunks[1] === 'orgs') { if ($pathChunks[2] === '{org}') { if ($pathChunks[3] === 'actions') { if ($pathChunks[4] === 'runner-groups') { diff --git a/clients/GitHub/src/Internal/Router/Post/CodeScanning.php b/clients/GitHub/src/Internal/Router/Post/CodeScanning.php index e434880b665..d539bb22223 100644 --- a/clients/GitHub/src/Internal/Router/Post/CodeScanning.php +++ b/clients/GitHub/src/Internal/Router/Post/CodeScanning.php @@ -5,6 +5,8 @@ namespace ApiClients\Client\GitHub\Internal\Router\Post; use ApiClients\Client\GitHub\Internal; +use ApiClients\Client\GitHub\Schema\CodeScanningAutofix; +use ApiClients\Client\GitHub\Schema\CodeScanningAutofixCommitsResponse; use ApiClients\Client\GitHub\Schema\CodeScanningSarifsReceipt; use ApiClients\Client\GitHub\Schema\CodeScanningVariantAnalysis; use ApiClients\Contracts\HTTP\Headers\AuthenticationInterface; @@ -62,4 +64,56 @@ public function createVariantAnalysis(array $params): CodeScanningVariantAnalysi return $operator->call($arguments['owner'], $arguments['repo'], $params); } + + public function createAutofix(array $params): CodeScanningAutofix|WithoutBody + { + $arguments = []; + if (array_key_exists('owner', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: owner'); + } + + $arguments['owner'] = $params['owner']; + unset($params['owner']); + if (array_key_exists('repo', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: repo'); + } + + $arguments['repo'] = $params['repo']; + unset($params['repo']); + if (array_key_exists('alert_number', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: alert_number'); + } + + $arguments['alert_number'] = $params['alert_number']; + unset($params['alert_number']); + $operator = new Internal\Operator\CodeScanning\CreateAutofix($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Repos🌀Owner🌀Repo🌀CodeScanning🌀Alerts🌀AlertNumber🌀Autofix()); + + return $operator->call($arguments['owner'], $arguments['repo'], $arguments['alert_number']); + } + + public function commitAutofix(array $params): CodeScanningAutofixCommitsResponse|WithoutBody + { + $arguments = []; + if (array_key_exists('owner', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: owner'); + } + + $arguments['owner'] = $params['owner']; + unset($params['owner']); + if (array_key_exists('repo', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: repo'); + } + + $arguments['repo'] = $params['repo']; + unset($params['repo']); + if (array_key_exists('alert_number', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: alert_number'); + } + + $arguments['alert_number'] = $params['alert_number']; + unset($params['alert_number']); + $operator = new Internal\Operator\CodeScanning\CommitAutofix($this->browser, $this->authentication, $this->requestSchemaValidator, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Repos🌀Owner🌀Repo🌀CodeScanning🌀Alerts🌀AlertNumber🌀Autofix🌀Commits()); + + return $operator->call($arguments['owner'], $arguments['repo'], $arguments['alert_number'], $params); + } } diff --git a/clients/GitHub/src/Internal/Router/Post/CodeSecurity.php b/clients/GitHub/src/Internal/Router/Post/CodeSecurity.php index 2009e211ab9..ada8568b9f8 100644 --- a/clients/GitHub/src/Internal/Router/Post/CodeSecurity.php +++ b/clients/GitHub/src/Internal/Router/Post/CodeSecurity.php @@ -6,7 +6,7 @@ use ApiClients\Client\GitHub\Internal; use ApiClients\Client\GitHub\Schema\CodeSecurityConfiguration; -use ApiClients\Client\GitHub\Schema\Operations\CodeSecurity\AttachConfiguration\Response\ApplicationJson\Accepted\Application\Json; +use ApiClients\Client\GitHub\Schema\Operations\CodeSecurity\AttachEnterpriseConfiguration\Response\ApplicationJson\Accepted\Application\Json; use ApiClients\Contracts\HTTP\Headers\AuthenticationInterface; use InvalidArgumentException; use League\OpenAPIValidation\Schema\SchemaValidator; @@ -20,6 +20,20 @@ public function __construct(private SchemaValidator $requestSchemaValidator, pri { } + public function createConfigurationForEnterprise(array $params): CodeSecurityConfiguration + { + $arguments = []; + if (array_key_exists('enterprise', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: enterprise'); + } + + $arguments['enterprise'] = $params['enterprise']; + unset($params['enterprise']); + $operator = new Internal\Operator\CodeSecurity\CreateConfigurationForEnterprise($this->browser, $this->authentication, $this->requestSchemaValidator, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Enterprises🌀Enterprise🌀CodeSecurity🌀Configurations()); + + return $operator->call($arguments['enterprise'], $params); + } + /** @return */ public function createConfiguration(array $params): CodeSecurityConfiguration { @@ -35,8 +49,28 @@ public function createConfiguration(array $params): CodeSecurityConfiguration return $operator->call($arguments['org'], $params); } + public function attachEnterpriseConfiguration(array $params): Json + { + $arguments = []; + if (array_key_exists('enterprise', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: enterprise'); + } + + $arguments['enterprise'] = $params['enterprise']; + unset($params['enterprise']); + if (array_key_exists('configuration_id', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: configuration_id'); + } + + $arguments['configuration_id'] = $params['configuration_id']; + unset($params['configuration_id']); + $operator = new Internal\Operator\CodeSecurity\AttachEnterpriseConfiguration($this->browser, $this->authentication, $this->requestSchemaValidator, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Enterprises🌀Enterprise🌀CodeSecurity🌀Configurations🌀ConfigurationId🌀Attach()); + + return $operator->call($arguments['enterprise'], $arguments['configuration_id'], $params); + } + /** @return */ - public function attachConfiguration(array $params): Json + public function attachConfiguration(array $params): \ApiClients\Client\GitHub\Schema\Operations\CodeSecurity\AttachConfiguration\Response\ApplicationJson\Accepted\Application\Json { $arguments = []; if (array_key_exists('org', $params) === false) { diff --git a/clients/GitHub/src/Internal/Router/Post/Codespaces.php b/clients/GitHub/src/Internal/Router/Post/Codespaces.php index 74225463e75..368690d1bb6 100644 --- a/clients/GitHub/src/Internal/Router/Post/Codespaces.php +++ b/clients/GitHub/src/Internal/Router/Post/Codespaces.php @@ -118,14 +118,6 @@ public function stopForAuthenticatedUser(array $params): Codespace return $operator->call($arguments['codespace_name']); } - /** @return */ - public function createForAuthenticatedUser(array $params): Codespace - { - $operator = new Internal\Operator\Codespaces\CreateForAuthenticatedUser($this->browser, $this->authentication, $this->requestSchemaValidator, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀User🌀Codespaces()); - - return $operator->call($params); - } - /** @return */ public function createWithPrForAuthenticatedUser(array $params): Codespace { @@ -153,6 +145,14 @@ public function createWithPrForAuthenticatedUser(array $params): Codespace return $operator->call($arguments['owner'], $arguments['repo'], $arguments['pull_number'], $params); } + /** @return */ + public function createForAuthenticatedUser(array $params): Codespace + { + $operator = new Internal\Operator\Codespaces\CreateForAuthenticatedUser($this->browser, $this->authentication, $this->requestSchemaValidator, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀User🌀Codespaces()); + + return $operator->call($params); + } + /** @return */ public function stopInOrganization(array $params): Codespace|WithoutBody { diff --git a/clients/GitHub/src/Internal/Router/Post/Eight.php b/clients/GitHub/src/Internal/Router/Post/Eight.php index 2bf2256cae7..fc3bfdfd6a7 100644 --- a/clients/GitHub/src/Internal/Router/Post/Eight.php +++ b/clients/GitHub/src/Internal/Router/Post/Eight.php @@ -5,6 +5,7 @@ namespace ApiClients\Client\GitHub\Internal\Router\Post; use ApiClients\Client\GitHub\Internal\Routers; +use ApiClients\Client\GitHub\Schema\CodeScanningAutofix; use ApiClients\Client\GitHub\Schema\Codespace; use ApiClients\Client\GitHub\Schema\EmptyObject; use ApiClients\Client\GitHub\Schema\Operations\Actions\ListLabelsForSelfHostedRunnerForOrg\Response\ApplicationJson\Ok; @@ -21,8 +22,8 @@ public function __construct(private Routers $routers) { } - /** @return |Observable */ - public function call(string $call, array $params, array $pathChunks): Json|Codespace|WithoutBody|TeamDiscussionComment|Reaction|EmptyObject|Ok|iterable|ProtectedBranchAdminEnforced + /** @return |Observable|Schema\CodeScanningAutofix|\ApiClients\Tools\OpenApiClient\Utils\Response\WithoutBody */ + public function call(string $call, array $params, array $pathChunks): Json|Codespace|WithoutBody|TeamDiscussionComment|Reaction|EmptyObject|Ok|iterable|ProtectedBranchAdminEnforced|CodeScanningAutofix { if ($pathChunks[0] === '') { if ($pathChunks[1] === 'orgs') { @@ -144,6 +145,16 @@ public function call(string $call, array $params, array $pathChunks): Json|Codes } } } + } elseif ($pathChunks[4] === 'code-scanning') { + if ($pathChunks[5] === 'alerts') { + if ($pathChunks[6] === '{alert_number}') { + if ($pathChunks[7] === 'autofix') { + if ($call === 'POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix') { + return $this->routers->internal🔀Router🔀Post🔀CodeScanning()->createAutofix($params); + } + } + } + } } elseif ($pathChunks[4] === 'issues') { if ($pathChunks[5] === 'comments') { if ($pathChunks[6] === '{comment_id}') { diff --git a/clients/GitHub/src/Internal/Router/Post/Five.php b/clients/GitHub/src/Internal/Router/Post/Five.php index 3cf09bec829..58926c575f3 100644 --- a/clients/GitHub/src/Internal/Router/Post/Five.php +++ b/clients/GitHub/src/Internal/Router/Post/Five.php @@ -44,7 +44,8 @@ public function __construct(private Routers $routers) { } - public function call(string $call, array $params, array $pathChunks): InstallationToken|Authorization|RunnerGroupsOrg|EmptyObject|CodeSecurityConfiguration|WithoutBody|ProjectCard|Json|Created|Autolink|CheckRun|CheckSuite|Codespace|Deployment|\ApiClients\Client\GitHub\Schema\Operations\Repos\CreateDeployment\Response\ApplicationJson\Accepted\Application\Json|FullRepository|Hook|Issue|DeployKey|Label|MergedUpstream|Commit|Milestone|Page|Project|PullRequest|Release|RepositoryRuleset|RepositoryAdvisory|MinimalRepository|CodespaceExportDetails|CodespaceWithFullRepository + /** @return |Schema\CodeSecurityConfiguration */ + public function call(string $call, array $params, array $pathChunks): InstallationToken|Authorization|CodeSecurityConfiguration|RunnerGroupsOrg|EmptyObject|WithoutBody|ProjectCard|Json|Created|Autolink|CheckRun|CheckSuite|Codespace|Deployment|\ApiClients\Client\GitHub\Schema\Operations\Repos\CreateDeployment\Response\ApplicationJson\Accepted\Application\Json|FullRepository|Hook|Issue|DeployKey|Label|MergedUpstream|Commit|Milestone|Page|Project|PullRequest|Release|RepositoryRuleset|RepositoryAdvisory|MinimalRepository|CodespaceExportDetails|CodespaceWithFullRepository { if ($pathChunks[0] === '') { if ($pathChunks[1] === 'app') { @@ -67,6 +68,16 @@ public function call(string $call, array $params, array $pathChunks): Installati } } } + } elseif ($pathChunks[1] === 'enterprises') { + if ($pathChunks[2] === '{enterprise}') { + if ($pathChunks[3] === 'code-security') { + if ($pathChunks[4] === 'configurations') { + if ($call === 'POST /enterprises/{enterprise}/code-security/configurations') { + return $this->routers->internal🔀Router🔀Post🔀CodeSecurity()->createConfigurationForEnterprise($params); + } + } + } + } } elseif ($pathChunks[1] === 'orgs') { if ($pathChunks[2] === '{org}') { if ($pathChunks[3] === 'actions') { diff --git a/clients/GitHub/src/Internal/Router/Post/Nine.php b/clients/GitHub/src/Internal/Router/Post/Nine.php index 847cdf2eebe..f5aeb8f23e4 100644 --- a/clients/GitHub/src/Internal/Router/Post/Nine.php +++ b/clients/GitHub/src/Internal/Router/Post/Nine.php @@ -5,6 +5,7 @@ namespace ApiClients\Client\GitHub\Internal\Router\Post; use ApiClients\Client\GitHub\Internal\Routers; +use ApiClients\Client\GitHub\Schema\CodeScanningAutofixCommitsResponse; use ApiClients\Client\GitHub\Schema\Operations\Repos\RedeliverWebhookDelivery\Response\ApplicationJson\Accepted\Application\Json; use ApiClients\Client\GitHub\Schema\PullRequestReview; use ApiClients\Client\GitHub\Schema\PullRequestReviewComment; @@ -17,8 +18,8 @@ public function __construct(private Routers $routers) { } - /** @return |Observable|Observable|Observable|Observable */ - public function call(string $call, array $params, array $pathChunks): WithoutBody|iterable|Json|PullRequestReviewComment|PullRequestReview + /** @return |Observable|Observable|Observable|Observable|Schema\CodeScanningAutofixCommitsResponse|\ApiClients\Tools\OpenApiClient\Utils\Response\WithoutBody */ + public function call(string $call, array $params, array $pathChunks): WithoutBody|iterable|CodeScanningAutofixCommitsResponse|Json|PullRequestReviewComment|PullRequestReview { if ($pathChunks[0] === '') { if ($pathChunks[1] === 'orgs') { @@ -68,6 +69,18 @@ public function call(string $call, array $params, array $pathChunks): WithoutBod } } } + } elseif ($pathChunks[4] === 'code-scanning') { + if ($pathChunks[5] === 'alerts') { + if ($pathChunks[6] === '{alert_number}') { + if ($pathChunks[7] === 'autofix') { + if ($pathChunks[8] === 'commits') { + if ($call === 'POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/commits') { + return $this->routers->internal🔀Router🔀Post🔀CodeScanning()->commitAutofix($params); + } + } + } + } + } } elseif ($pathChunks[4] === 'hooks') { if ($pathChunks[5] === '{hook_id}') { if ($pathChunks[6] === 'deliveries') { diff --git a/clients/GitHub/src/Internal/Router/Post/Repos.php b/clients/GitHub/src/Internal/Router/Post/Repos.php index a337abdedee..bcf9ab67fb9 100644 --- a/clients/GitHub/src/Internal/Router/Post/Repos.php +++ b/clients/GitHub/src/Internal/Router/Post/Repos.php @@ -480,14 +480,6 @@ public function createUsingTemplate(array $params): FullRepository return $operator->call($arguments['template_owner'], $arguments['template_repo'], $params); } - /** @return */ - public function createForAuthenticatedUser(array $params): FullRepository|WithoutBody - { - $operator = new Internal\Operator\Repos\CreateForAuthenticatedUser($this->browser, $this->authentication, $this->requestSchemaValidator, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀User🌀Repos()); - - return $operator->call($params); - } - /** @return */ public function renameBranch(array $params): BranchWithProtection { @@ -716,6 +708,14 @@ public function uploadReleaseAsset(array $params): ReleaseAsset|WithoutBody return $operator->call($arguments['owner'], $arguments['repo'], $arguments['release_id'], $arguments['name'], $arguments['label'], $params); } + /** @return */ + public function createForAuthenticatedUser(array $params): FullRepository|WithoutBody + { + $operator = new Internal\Operator\Repos\CreateForAuthenticatedUser($this->browser, $this->authentication, $this->requestSchemaValidator, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀User🌀Repos()); + + return $operator->call($params); + } + /** @return */ public function setAdminBranchProtection(array $params): ProtectedBranchAdminEnforced { diff --git a/clients/GitHub/src/Internal/Router/Post/Seven.php b/clients/GitHub/src/Internal/Router/Post/Seven.php index 8609cacc085..fcb9e535918 100644 --- a/clients/GitHub/src/Internal/Router/Post/Seven.php +++ b/clients/GitHub/src/Internal/Router/Post/Seven.php @@ -20,7 +20,7 @@ use ApiClients\Client\GitHub\Schema\IssueComment; use ApiClients\Client\GitHub\Schema\Operations\Actions\GenerateRunnerJitconfigForOrg\Response\ApplicationJson\Created; use ApiClients\Client\GitHub\Schema\Operations\Actions\ListLabelsForSelfHostedRunnerForOrg\Response\ApplicationJson\Ok; -use ApiClients\Client\GitHub\Schema\Operations\CodeSecurity\AttachConfiguration\Response\ApplicationJson\Accepted\Application\Json; +use ApiClients\Client\GitHub\Schema\Operations\CodeSecurity\AttachEnterpriseConfiguration\Response\ApplicationJson\Accepted\Application\Json; use ApiClients\Client\GitHub\Schema\PullRequestReview; use ApiClients\Client\GitHub\Schema\PullRequestReviewComment; use ApiClients\Client\GitHub\Schema\PullRequestSimple; @@ -35,11 +35,25 @@ public function __construct(private Routers $routers) { } - /** @return |Observable|Schema\BasicError */ - public function call(string $call, array $params, array $pathChunks): Ok|Json|WithoutBody|Created|AuthenticationToken|BranchWithProtection|EmptyObject|CodeScanningVariantAnalysis|Reaction|CommitComment|DeploymentStatus|DeploymentBranchPolicy|DeploymentProtectionRule|Issue|IssueComment|iterable|BasicError|Codespace|PullRequestReviewComment|PullRequestSimple|PullRequestReview|ReleaseAsset|\ApiClients\Client\GitHub\Schema\Operations\SecurityAdvisories\CreateRepositoryAdvisoryCveRequest\Response\ApplicationJson\Accepted\Application\Json|FullRepository + /** @return Schema\Operations\CodeSecurity\AttachEnterpriseConfiguration\Response\ApplicationJson\Accepted\Application\Json||Observable|Schema\BasicError */ + public function call(string $call, array $params, array $pathChunks): Json|Ok|\ApiClients\Client\GitHub\Schema\Operations\CodeSecurity\AttachConfiguration\Response\ApplicationJson\Accepted\Application\Json|WithoutBody|Created|AuthenticationToken|BranchWithProtection|EmptyObject|CodeScanningVariantAnalysis|Reaction|CommitComment|DeploymentStatus|DeploymentBranchPolicy|DeploymentProtectionRule|Issue|IssueComment|iterable|BasicError|Codespace|PullRequestReviewComment|PullRequestSimple|PullRequestReview|ReleaseAsset|\ApiClients\Client\GitHub\Schema\Operations\SecurityAdvisories\CreateRepositoryAdvisoryCveRequest\Response\ApplicationJson\Accepted\Application\Json|FullRepository { if ($pathChunks[0] === '') { - if ($pathChunks[1] === 'orgs') { + if ($pathChunks[1] === 'enterprises') { + if ($pathChunks[2] === '{enterprise}') { + if ($pathChunks[3] === 'code-security') { + if ($pathChunks[4] === 'configurations') { + if ($pathChunks[5] === '{configuration_id}') { + if ($pathChunks[6] === 'attach') { + if ($call === 'POST /enterprises/{enterprise}/code-security/configurations/{configuration_id}/attach') { + return $this->routers->internal🔀Router🔀Post🔀CodeSecurity()->attachEnterpriseConfiguration($params); + } + } + } + } + } + } + } elseif ($pathChunks[1] === 'orgs') { if ($pathChunks[2] === '{org}') { if ($pathChunks[3] === 'actions') { if ($pathChunks[4] === 'runners') { diff --git a/clients/GitHub/src/Internal/Router/Put/CodeSecurity.php b/clients/GitHub/src/Internal/Router/Put/CodeSecurity.php index 5255beb4d38..6279bf61ef6 100644 --- a/clients/GitHub/src/Internal/Router/Put/CodeSecurity.php +++ b/clients/GitHub/src/Internal/Router/Put/CodeSecurity.php @@ -5,7 +5,8 @@ namespace ApiClients\Client\GitHub\Internal\Router\Put; use ApiClients\Client\GitHub\Internal; -use ApiClients\Client\GitHub\Schema\Operations\CodeSecurity\SetConfigurationAsDefault\Response\ApplicationJson\Ok; +use ApiClients\Client\GitHub\Schema\Operations\CodeSecurity\SetConfigurationAsDefault\Response\ApplicationJson\Ok\Application\Json; +use ApiClients\Client\GitHub\Schema\Operations\CodeSecurity\SetConfigurationAsDefaultForEnterprise\Response\ApplicationJson\Ok; use ApiClients\Contracts\HTTP\Headers\AuthenticationInterface; use InvalidArgumentException; use League\OpenAPIValidation\Schema\SchemaValidator; @@ -19,8 +20,27 @@ public function __construct(private SchemaValidator $requestSchemaValidator, pri { } - /** @return */ - public function setConfigurationAsDefault(array $params): Ok + public function setConfigurationAsDefaultForEnterprise(array $params): Ok + { + $arguments = []; + if (array_key_exists('enterprise', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: enterprise'); + } + + $arguments['enterprise'] = $params['enterprise']; + unset($params['enterprise']); + if (array_key_exists('configuration_id', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: configuration_id'); + } + + $arguments['configuration_id'] = $params['configuration_id']; + unset($params['configuration_id']); + $operator = new Internal\Operator\CodeSecurity\SetConfigurationAsDefaultForEnterprise($this->browser, $this->authentication, $this->requestSchemaValidator, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Enterprises🌀Enterprise🌀CodeSecurity🌀Configurations🌀ConfigurationId🌀Defaults()); + + return $operator->call($arguments['enterprise'], $arguments['configuration_id'], $params); + } + + public function setConfigurationAsDefault(array $params): Json { $arguments = []; if (array_key_exists('org', $params) === false) { diff --git a/clients/GitHub/src/Internal/Router/Put/Seven.php b/clients/GitHub/src/Internal/Router/Put/Seven.php index 718b3c782bc..506a03ec4e8 100644 --- a/clients/GitHub/src/Internal/Router/Put/Seven.php +++ b/clients/GitHub/src/Internal/Router/Put/Seven.php @@ -7,8 +7,8 @@ use ApiClients\Client\GitHub\Internal\Routers; use ApiClients\Client\GitHub\Schema\BasicError; use ApiClients\Client\GitHub\Schema\EmptyObject; -use ApiClients\Client\GitHub\Schema\Operations\Actions\ListLabelsForSelfHostedRunnerForOrg\Response\ApplicationJson\Ok; -use ApiClients\Client\GitHub\Schema\Operations\Pulls\UpdateBranch\Response\ApplicationJson\Accepted\Application\Json; +use ApiClients\Client\GitHub\Schema\Operations\CodeSecurity\SetConfigurationAsDefault\Response\ApplicationJson\Ok\Application\Json; +use ApiClients\Client\GitHub\Schema\Operations\CodeSecurity\SetConfigurationAsDefaultForEnterprise\Response\ApplicationJson\Ok; use ApiClients\Client\GitHub\Schema\ProtectedBranch; use ApiClients\Client\GitHub\Schema\PullRequestMergeResult; use ApiClients\Client\GitHub\Schema\TeamMembership; @@ -21,11 +21,25 @@ public function __construct(private Routers $routers) { } - /** @return |Observable|Schema\BasicError */ - public function call(string $call, array $params, array $pathChunks): EmptyObject|WithoutBody|Ok|\ApiClients\Client\GitHub\Schema\Operations\CodeSecurity\SetConfigurationAsDefault\Response\ApplicationJson\Ok|TeamMembership|ProtectedBranch|iterable|BasicError|PullRequestMergeResult|Json + /** @return Schema\Operations\CodeSecurity\SetConfigurationAsDefaultForEnterprise\Response\ApplicationJson\Ok||Schema\Operations\CodeSecurity\SetConfigurationAsDefault\Response\ApplicationJson\Ok\Application\Json|Observable|Schema\BasicError */ + public function call(string $call, array $params, array $pathChunks): Ok|EmptyObject|WithoutBody|\ApiClients\Client\GitHub\Schema\Operations\Actions\ListLabelsForSelfHostedRunnerForOrg\Response\ApplicationJson\Ok|Json|TeamMembership|ProtectedBranch|iterable|BasicError|PullRequestMergeResult|\ApiClients\Client\GitHub\Schema\Operations\Pulls\UpdateBranch\Response\ApplicationJson\Accepted\Application\Json { if ($pathChunks[0] === '') { - if ($pathChunks[1] === 'orgs') { + if ($pathChunks[1] === 'enterprises') { + if ($pathChunks[2] === '{enterprise}') { + if ($pathChunks[3] === 'code-security') { + if ($pathChunks[4] === 'configurations') { + if ($pathChunks[5] === '{configuration_id}') { + if ($pathChunks[6] === 'defaults') { + if ($call === 'PUT /enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults') { + return $this->routers->internal🔀Router🔀Put🔀CodeSecurity()->setConfigurationAsDefaultForEnterprise($params); + } + } + } + } + } + } + } elseif ($pathChunks[1] === 'orgs') { if ($pathChunks[2] === '{org}') { if ($pathChunks[3] === 'actions') { if ($pathChunks[4] === 'oidc') { diff --git a/clients/GitHub/src/Internal/Routers.php b/clients/GitHub/src/Internal/Routers.php index f225ac10309..0b59b9cc62f 100644 --- a/clients/GitHub/src/Internal/Routers.php +++ b/clients/GitHub/src/Internal/Routers.php @@ -33,11 +33,11 @@ final class Routers private Internal\Router\Get\Interactions|null $internal🔀Router🔀Get🔀Interactions = null; private Internal\Router\Get\Migrations|null $internal🔀Router🔀Get🔀Migrations = null; private Internal\Router\Get\Packages|null $internal🔀Router🔀Get🔀Packages = null; + private Internal\Router\Get\CodeSecurity|null $internal🔀Router🔀Get🔀CodeSecurity = null; private Internal\Router\Get\Dependabot|null $internal🔀Router🔀Get🔀Dependabot = null; private Internal\Router\Get\SecretScanning|null $internal🔀Router🔀Get🔀SecretScanning = null; private Internal\Router\Get\Actions|null $internal🔀Router🔀Get🔀Actions = null; private Internal\Router\Get\CodeScanning|null $internal🔀Router🔀Get🔀CodeScanning = null; - private Internal\Router\Get\CodeSecurity|null $internal🔀Router🔀Get🔀CodeSecurity = null; private Internal\Router\Get\Copilot|null $internal🔀Router🔀Get🔀Copilot = null; private Internal\Router\Get\Pulls|null $internal🔀Router🔀Get🔀Pulls = null; private Internal\Router\Get\Billing|null $internal🔀Router🔀Get🔀Billing = null; @@ -76,17 +76,17 @@ final class Routers private Internal\Router\Patch\Repos|null $internal🔀Router🔀Patch🔀Repos = null; private Internal\Router\Patch\Codespaces|null $internal🔀Router🔀Patch🔀Codespaces = null; private Internal\Router\Patch\Users|null $internal🔀Router🔀Patch🔀Users = null; - private Internal\Router\Patch\Gists|null $internal🔀Router🔀Patch🔀Gists = null; - private Internal\Router\Patch\Orgs|null $internal🔀Router🔀Patch🔀Orgs = null; - private Internal\Router\Patch\Teams|null $internal🔀Router🔀Patch🔀Teams = null; - private Internal\Router\Patch\Migrations|null $internal🔀Router🔀Patch🔀Migrations = null; - private Internal\Router\Patch\Actions|null $internal🔀Router🔀Patch🔀Actions = null; private Internal\Router\Patch\CodeSecurity|null $internal🔀Router🔀Patch🔀CodeSecurity = null; + private Internal\Router\Patch\Actions|null $internal🔀Router🔀Patch🔀Actions = null; + private Internal\Router\Patch\Orgs|null $internal🔀Router🔀Patch🔀Orgs = null; private Internal\Router\Patch\Checks|null $internal🔀Router🔀Patch🔀Checks = null; private Internal\Router\Patch\CodeScanning|null $internal🔀Router🔀Patch🔀CodeScanning = null; + private Internal\Router\Patch\Migrations|null $internal🔀Router🔀Patch🔀Migrations = null; private Internal\Router\Patch\Issues|null $internal🔀Router🔀Patch🔀Issues = null; private Internal\Router\Patch\Pulls|null $internal🔀Router🔀Patch🔀Pulls = null; private Internal\Router\Patch\SecurityAdvisories|null $internal🔀Router🔀Patch🔀SecurityAdvisories = null; + private Internal\Router\Patch\Gists|null $internal🔀Router🔀Patch🔀Gists = null; + private Internal\Router\Patch\Teams|null $internal🔀Router🔀Patch🔀Teams = null; private Internal\Router\Patch\Dependabot|null $internal🔀Router🔀Patch🔀Dependabot = null; private Internal\Router\Patch\Git|null $internal🔀Router🔀Patch🔀Git = null; private Internal\Router\Patch\SecretScanning|null $internal🔀Router🔀Patch🔀SecretScanning = null; @@ -123,14 +123,14 @@ final class Routers private Internal\Router\Delete\Teams|null $internal🔀Router🔀Delete🔀Teams = null; private Internal\Router\Delete\Migrations|null $internal🔀Router🔀Delete🔀Migrations = null; private Internal\Router\Delete\Packages|null $internal🔀Router🔀Delete🔀Packages = null; + private Internal\Router\Delete\CodeSecurity|null $internal🔀Router🔀Delete🔀CodeSecurity = null; private Internal\Router\Delete\Actions|null $internal🔀Router🔀Delete🔀Actions = null; - private Internal\Router\Delete\CodeScanning|null $internal🔀Router🔀Delete🔀CodeScanning = null; + private Internal\Router\Delete\Copilot|null $internal🔀Router🔀Delete🔀Copilot = null; private Internal\Router\Delete\Dependabot|null $internal🔀Router🔀Delete🔀Dependabot = null; - private Internal\Router\Delete\Git|null $internal🔀Router🔀Delete🔀Git = null; private Internal\Router\Delete\Issues|null $internal🔀Router🔀Delete🔀Issues = null; + private Internal\Router\Delete\CodeScanning|null $internal🔀Router🔀Delete🔀CodeScanning = null; + private Internal\Router\Delete\Git|null $internal🔀Router🔀Delete🔀Git = null; private Internal\Router\Delete\Pulls|null $internal🔀Router🔀Delete🔀Pulls = null; - private Internal\Router\Delete\CodeSecurity|null $internal🔀Router🔀Delete🔀CodeSecurity = null; - private Internal\Router\Delete\Copilot|null $internal🔀Router🔀Delete🔀Copilot = null; private Internal\Router\Delete\Reactions|null $internal🔀Router🔀Delete🔀Reactions = null; private Internal\Router\Put\Apps|null $internal🔀Router🔀Put🔀Apps = null; private Internal\Router\Put\Activity|null $internal🔀Router🔀Put🔀Activity = null; @@ -142,13 +142,13 @@ final class Routers private Internal\Router\Put\Migrations|null $internal🔀Router🔀Put🔀Migrations = null; private Internal\Router\Put\Interactions|null $internal🔀Router🔀Put🔀Interactions = null; private Internal\Router\Put\Teams|null $internal🔀Router🔀Put🔀Teams = null; - private Internal\Router\Put\Gists|null $internal🔀Router🔀Put🔀Gists = null; - private Internal\Router\Put\Users|null $internal🔀Router🔀Put🔀Users = null; - private Internal\Router\Put\Oidc|null $internal🔀Router🔀Put🔀Oidc = null; private Internal\Router\Put\CodeSecurity|null $internal🔀Router🔀Put🔀CodeSecurity = null; + private Internal\Router\Put\Oidc|null $internal🔀Router🔀Put🔀Oidc = null; private Internal\Router\Put\Dependabot|null $internal🔀Router🔀Put🔀Dependabot = null; private Internal\Router\Put\Issues|null $internal🔀Router🔀Put🔀Issues = null; private Internal\Router\Put\Pulls|null $internal🔀Router🔀Put🔀Pulls = null; + private Internal\Router\Put\Gists|null $internal🔀Router🔀Put🔀Gists = null; + private Internal\Router\Put\Users|null $internal🔀Router🔀Put🔀Users = null; private Internal\Router\Stream\Migrations|null $internal🔀Router🔀Stream🔀Migrations = null; private Internal\Router\Stream\Repos|null $internal🔀Router🔀Stream🔀Repos = null; private Internal\Router\Stream\Actions|null $internal🔀Router🔀Stream🔀Actions = null; @@ -355,6 +355,15 @@ public function internal🔀Router🔀Get🔀Packages(): Internal\Router\Get\Pac return $this->internal🔀Router🔀Get🔀Packages; } + public function internal🔀Router🔀Get🔀CodeSecurity(): Internal\Router\Get\CodeSecurity + { + if ($this->internal🔀Router🔀Get🔀CodeSecurity instanceof Internal\Router\Get\CodeSecurity === false) { + $this->internal🔀Router🔀Get🔀CodeSecurity = new Internal\Router\Get\CodeSecurity(browser: $this->browser, authentication: $this->authentication, requestSchemaValidator: $this->requestSchemaValidator, responseSchemaValidator: $this->responseSchemaValidator, hydrators: $this->hydrators); + } + + return $this->internal🔀Router🔀Get🔀CodeSecurity; + } + public function internal🔀Router🔀Get🔀Dependabot(): Internal\Router\Get\Dependabot { if ($this->internal🔀Router🔀Get🔀Dependabot instanceof Internal\Router\Get\Dependabot === false) { @@ -391,15 +400,6 @@ public function internal🔀Router🔀Get🔀CodeScanning(): Internal\Router\Get return $this->internal🔀Router🔀Get🔀CodeScanning; } - public function internal🔀Router🔀Get🔀CodeSecurity(): Internal\Router\Get\CodeSecurity - { - if ($this->internal🔀Router🔀Get🔀CodeSecurity instanceof Internal\Router\Get\CodeSecurity === false) { - $this->internal🔀Router🔀Get🔀CodeSecurity = new Internal\Router\Get\CodeSecurity(browser: $this->browser, authentication: $this->authentication, requestSchemaValidator: $this->requestSchemaValidator, responseSchemaValidator: $this->responseSchemaValidator, hydrators: $this->hydrators); - } - - return $this->internal🔀Router🔀Get🔀CodeSecurity; - } - public function internal🔀Router🔀Get🔀Copilot(): Internal\Router\Get\Copilot { if ($this->internal🔀Router🔀Get🔀Copilot instanceof Internal\Router\Get\Copilot === false) { @@ -742,40 +742,13 @@ public function internal🔀Router🔀Patch🔀Users(): Internal\Router\Patch\Us return $this->internal🔀Router🔀Patch🔀Users; } - public function internal🔀Router🔀Patch🔀Gists(): Internal\Router\Patch\Gists - { - if ($this->internal🔀Router🔀Patch🔀Gists instanceof Internal\Router\Patch\Gists === false) { - $this->internal🔀Router🔀Patch🔀Gists = new Internal\Router\Patch\Gists(browser: $this->browser, authentication: $this->authentication, requestSchemaValidator: $this->requestSchemaValidator, responseSchemaValidator: $this->responseSchemaValidator, hydrators: $this->hydrators); - } - - return $this->internal🔀Router🔀Patch🔀Gists; - } - - public function internal🔀Router🔀Patch🔀Orgs(): Internal\Router\Patch\Orgs - { - if ($this->internal🔀Router🔀Patch🔀Orgs instanceof Internal\Router\Patch\Orgs === false) { - $this->internal🔀Router🔀Patch🔀Orgs = new Internal\Router\Patch\Orgs(browser: $this->browser, authentication: $this->authentication, requestSchemaValidator: $this->requestSchemaValidator, responseSchemaValidator: $this->responseSchemaValidator, hydrators: $this->hydrators); - } - - return $this->internal🔀Router🔀Patch🔀Orgs; - } - - public function internal🔀Router🔀Patch🔀Teams(): Internal\Router\Patch\Teams - { - if ($this->internal🔀Router🔀Patch🔀Teams instanceof Internal\Router\Patch\Teams === false) { - $this->internal🔀Router🔀Patch🔀Teams = new Internal\Router\Patch\Teams(browser: $this->browser, authentication: $this->authentication, requestSchemaValidator: $this->requestSchemaValidator, responseSchemaValidator: $this->responseSchemaValidator, hydrators: $this->hydrators); - } - - return $this->internal🔀Router🔀Patch🔀Teams; - } - - public function internal🔀Router🔀Patch🔀Migrations(): Internal\Router\Patch\Migrations + public function internal🔀Router🔀Patch🔀CodeSecurity(): Internal\Router\Patch\CodeSecurity { - if ($this->internal🔀Router🔀Patch🔀Migrations instanceof Internal\Router\Patch\Migrations === false) { - $this->internal🔀Router🔀Patch🔀Migrations = new Internal\Router\Patch\Migrations(browser: $this->browser, authentication: $this->authentication, requestSchemaValidator: $this->requestSchemaValidator, responseSchemaValidator: $this->responseSchemaValidator, hydrators: $this->hydrators); + if ($this->internal🔀Router🔀Patch🔀CodeSecurity instanceof Internal\Router\Patch\CodeSecurity === false) { + $this->internal🔀Router🔀Patch🔀CodeSecurity = new Internal\Router\Patch\CodeSecurity(browser: $this->browser, authentication: $this->authentication, requestSchemaValidator: $this->requestSchemaValidator, responseSchemaValidator: $this->responseSchemaValidator, hydrators: $this->hydrators); } - return $this->internal🔀Router🔀Patch🔀Migrations; + return $this->internal🔀Router🔀Patch🔀CodeSecurity; } public function internal🔀Router🔀Patch🔀Actions(): Internal\Router\Patch\Actions @@ -787,13 +760,13 @@ public function internal🔀Router🔀Patch🔀Actions(): Internal\Router\Patch\ return $this->internal🔀Router🔀Patch🔀Actions; } - public function internal🔀Router🔀Patch🔀CodeSecurity(): Internal\Router\Patch\CodeSecurity + public function internal🔀Router🔀Patch🔀Orgs(): Internal\Router\Patch\Orgs { - if ($this->internal🔀Router🔀Patch🔀CodeSecurity instanceof Internal\Router\Patch\CodeSecurity === false) { - $this->internal🔀Router🔀Patch🔀CodeSecurity = new Internal\Router\Patch\CodeSecurity(browser: $this->browser, authentication: $this->authentication, requestSchemaValidator: $this->requestSchemaValidator, responseSchemaValidator: $this->responseSchemaValidator, hydrators: $this->hydrators); + if ($this->internal🔀Router🔀Patch🔀Orgs instanceof Internal\Router\Patch\Orgs === false) { + $this->internal🔀Router🔀Patch🔀Orgs = new Internal\Router\Patch\Orgs(browser: $this->browser, authentication: $this->authentication, requestSchemaValidator: $this->requestSchemaValidator, responseSchemaValidator: $this->responseSchemaValidator, hydrators: $this->hydrators); } - return $this->internal🔀Router🔀Patch🔀CodeSecurity; + return $this->internal🔀Router🔀Patch🔀Orgs; } public function internal🔀Router🔀Patch🔀Checks(): Internal\Router\Patch\Checks @@ -814,6 +787,15 @@ public function internal🔀Router🔀Patch🔀CodeScanning(): Internal\Router\P return $this->internal🔀Router🔀Patch🔀CodeScanning; } + public function internal🔀Router🔀Patch🔀Migrations(): Internal\Router\Patch\Migrations + { + if ($this->internal🔀Router🔀Patch🔀Migrations instanceof Internal\Router\Patch\Migrations === false) { + $this->internal🔀Router🔀Patch🔀Migrations = new Internal\Router\Patch\Migrations(browser: $this->browser, authentication: $this->authentication, requestSchemaValidator: $this->requestSchemaValidator, responseSchemaValidator: $this->responseSchemaValidator, hydrators: $this->hydrators); + } + + return $this->internal🔀Router🔀Patch🔀Migrations; + } + public function internal🔀Router🔀Patch🔀Issues(): Internal\Router\Patch\Issues { if ($this->internal🔀Router🔀Patch🔀Issues instanceof Internal\Router\Patch\Issues === false) { @@ -841,6 +823,24 @@ public function internal🔀Router🔀Patch🔀SecurityAdvisories(): Internal\Ro return $this->internal🔀Router🔀Patch🔀SecurityAdvisories; } + public function internal🔀Router🔀Patch🔀Gists(): Internal\Router\Patch\Gists + { + if ($this->internal🔀Router🔀Patch🔀Gists instanceof Internal\Router\Patch\Gists === false) { + $this->internal🔀Router🔀Patch🔀Gists = new Internal\Router\Patch\Gists(browser: $this->browser, authentication: $this->authentication, requestSchemaValidator: $this->requestSchemaValidator, responseSchemaValidator: $this->responseSchemaValidator, hydrators: $this->hydrators); + } + + return $this->internal🔀Router🔀Patch🔀Gists; + } + + public function internal🔀Router🔀Patch🔀Teams(): Internal\Router\Patch\Teams + { + if ($this->internal🔀Router🔀Patch🔀Teams instanceof Internal\Router\Patch\Teams === false) { + $this->internal🔀Router🔀Patch🔀Teams = new Internal\Router\Patch\Teams(browser: $this->browser, authentication: $this->authentication, requestSchemaValidator: $this->requestSchemaValidator, responseSchemaValidator: $this->responseSchemaValidator, hydrators: $this->hydrators); + } + + return $this->internal🔀Router🔀Patch🔀Teams; + } + public function internal🔀Router🔀Patch🔀Dependabot(): Internal\Router\Patch\Dependabot { if ($this->internal🔀Router🔀Patch🔀Dependabot instanceof Internal\Router\Patch\Dependabot === false) { @@ -1165,6 +1165,15 @@ public function internal🔀Router🔀Delete🔀Packages(): Internal\Router\Dele return $this->internal🔀Router🔀Delete🔀Packages; } + public function internal🔀Router🔀Delete🔀CodeSecurity(): Internal\Router\Delete\CodeSecurity + { + if ($this->internal🔀Router🔀Delete🔀CodeSecurity instanceof Internal\Router\Delete\CodeSecurity === false) { + $this->internal🔀Router🔀Delete🔀CodeSecurity = new Internal\Router\Delete\CodeSecurity(browser: $this->browser, authentication: $this->authentication, requestSchemaValidator: $this->requestSchemaValidator, responseSchemaValidator: $this->responseSchemaValidator, hydrators: $this->hydrators); + } + + return $this->internal🔀Router🔀Delete🔀CodeSecurity; + } + public function internal🔀Router🔀Delete🔀Actions(): Internal\Router\Delete\Actions { if ($this->internal🔀Router🔀Delete🔀Actions instanceof Internal\Router\Delete\Actions === false) { @@ -1174,13 +1183,13 @@ public function internal🔀Router🔀Delete🔀Actions(): Internal\Router\Delet return $this->internal🔀Router🔀Delete🔀Actions; } - public function internal🔀Router🔀Delete🔀CodeScanning(): Internal\Router\Delete\CodeScanning + public function internal🔀Router🔀Delete🔀Copilot(): Internal\Router\Delete\Copilot { - if ($this->internal🔀Router🔀Delete🔀CodeScanning instanceof Internal\Router\Delete\CodeScanning === false) { - $this->internal🔀Router🔀Delete🔀CodeScanning = new Internal\Router\Delete\CodeScanning(browser: $this->browser, authentication: $this->authentication, requestSchemaValidator: $this->requestSchemaValidator, responseSchemaValidator: $this->responseSchemaValidator, hydrators: $this->hydrators); + if ($this->internal🔀Router🔀Delete🔀Copilot instanceof Internal\Router\Delete\Copilot === false) { + $this->internal🔀Router🔀Delete🔀Copilot = new Internal\Router\Delete\Copilot(browser: $this->browser, authentication: $this->authentication, requestSchemaValidator: $this->requestSchemaValidator, responseSchemaValidator: $this->responseSchemaValidator, hydrators: $this->hydrators); } - return $this->internal🔀Router🔀Delete🔀CodeScanning; + return $this->internal🔀Router🔀Delete🔀Copilot; } public function internal🔀Router🔀Delete🔀Dependabot(): Internal\Router\Delete\Dependabot @@ -1192,15 +1201,6 @@ public function internal🔀Router🔀Delete🔀Dependabot(): Internal\Router\De return $this->internal🔀Router🔀Delete🔀Dependabot; } - public function internal🔀Router🔀Delete🔀Git(): Internal\Router\Delete\Git - { - if ($this->internal🔀Router🔀Delete🔀Git instanceof Internal\Router\Delete\Git === false) { - $this->internal🔀Router🔀Delete🔀Git = new Internal\Router\Delete\Git(browser: $this->browser, authentication: $this->authentication, requestSchemaValidator: $this->requestSchemaValidator, responseSchemaValidator: $this->responseSchemaValidator, hydrators: $this->hydrators); - } - - return $this->internal🔀Router🔀Delete🔀Git; - } - public function internal🔀Router🔀Delete🔀Issues(): Internal\Router\Delete\Issues { if ($this->internal🔀Router🔀Delete🔀Issues instanceof Internal\Router\Delete\Issues === false) { @@ -1210,31 +1210,31 @@ public function internal🔀Router🔀Delete🔀Issues(): Internal\Router\Delete return $this->internal🔀Router🔀Delete🔀Issues; } - public function internal🔀Router🔀Delete🔀Pulls(): Internal\Router\Delete\Pulls + public function internal🔀Router🔀Delete🔀CodeScanning(): Internal\Router\Delete\CodeScanning { - if ($this->internal🔀Router🔀Delete🔀Pulls instanceof Internal\Router\Delete\Pulls === false) { - $this->internal🔀Router🔀Delete🔀Pulls = new Internal\Router\Delete\Pulls(browser: $this->browser, authentication: $this->authentication, requestSchemaValidator: $this->requestSchemaValidator, responseSchemaValidator: $this->responseSchemaValidator, hydrators: $this->hydrators); + if ($this->internal🔀Router🔀Delete🔀CodeScanning instanceof Internal\Router\Delete\CodeScanning === false) { + $this->internal🔀Router🔀Delete🔀CodeScanning = new Internal\Router\Delete\CodeScanning(browser: $this->browser, authentication: $this->authentication, requestSchemaValidator: $this->requestSchemaValidator, responseSchemaValidator: $this->responseSchemaValidator, hydrators: $this->hydrators); } - return $this->internal🔀Router🔀Delete🔀Pulls; + return $this->internal🔀Router🔀Delete🔀CodeScanning; } - public function internal🔀Router🔀Delete🔀CodeSecurity(): Internal\Router\Delete\CodeSecurity + public function internal🔀Router🔀Delete🔀Git(): Internal\Router\Delete\Git { - if ($this->internal🔀Router🔀Delete🔀CodeSecurity instanceof Internal\Router\Delete\CodeSecurity === false) { - $this->internal🔀Router🔀Delete🔀CodeSecurity = new Internal\Router\Delete\CodeSecurity(browser: $this->browser, authentication: $this->authentication, requestSchemaValidator: $this->requestSchemaValidator, responseSchemaValidator: $this->responseSchemaValidator, hydrators: $this->hydrators); + if ($this->internal🔀Router🔀Delete🔀Git instanceof Internal\Router\Delete\Git === false) { + $this->internal🔀Router🔀Delete🔀Git = new Internal\Router\Delete\Git(browser: $this->browser, authentication: $this->authentication, requestSchemaValidator: $this->requestSchemaValidator, responseSchemaValidator: $this->responseSchemaValidator, hydrators: $this->hydrators); } - return $this->internal🔀Router🔀Delete🔀CodeSecurity; + return $this->internal🔀Router🔀Delete🔀Git; } - public function internal🔀Router🔀Delete🔀Copilot(): Internal\Router\Delete\Copilot + public function internal🔀Router🔀Delete🔀Pulls(): Internal\Router\Delete\Pulls { - if ($this->internal🔀Router🔀Delete🔀Copilot instanceof Internal\Router\Delete\Copilot === false) { - $this->internal🔀Router🔀Delete🔀Copilot = new Internal\Router\Delete\Copilot(browser: $this->browser, authentication: $this->authentication, requestSchemaValidator: $this->requestSchemaValidator, responseSchemaValidator: $this->responseSchemaValidator, hydrators: $this->hydrators); + if ($this->internal🔀Router🔀Delete🔀Pulls instanceof Internal\Router\Delete\Pulls === false) { + $this->internal🔀Router🔀Delete🔀Pulls = new Internal\Router\Delete\Pulls(browser: $this->browser, authentication: $this->authentication, requestSchemaValidator: $this->requestSchemaValidator, responseSchemaValidator: $this->responseSchemaValidator, hydrators: $this->hydrators); } - return $this->internal🔀Router🔀Delete🔀Copilot; + return $this->internal🔀Router🔀Delete🔀Pulls; } public function internal🔀Router🔀Delete🔀Reactions(): Internal\Router\Delete\Reactions @@ -1336,22 +1336,13 @@ public function internal🔀Router🔀Put🔀Teams(): Internal\Router\Put\Teams return $this->internal🔀Router🔀Put🔀Teams; } - public function internal🔀Router🔀Put🔀Gists(): Internal\Router\Put\Gists - { - if ($this->internal🔀Router🔀Put🔀Gists instanceof Internal\Router\Put\Gists === false) { - $this->internal🔀Router🔀Put🔀Gists = new Internal\Router\Put\Gists(browser: $this->browser, authentication: $this->authentication, requestSchemaValidator: $this->requestSchemaValidator, responseSchemaValidator: $this->responseSchemaValidator, hydrators: $this->hydrators); - } - - return $this->internal🔀Router🔀Put🔀Gists; - } - - public function internal🔀Router🔀Put🔀Users(): Internal\Router\Put\Users + public function internal🔀Router🔀Put🔀CodeSecurity(): Internal\Router\Put\CodeSecurity { - if ($this->internal🔀Router🔀Put🔀Users instanceof Internal\Router\Put\Users === false) { - $this->internal🔀Router🔀Put🔀Users = new Internal\Router\Put\Users(browser: $this->browser, authentication: $this->authentication, requestSchemaValidator: $this->requestSchemaValidator, responseSchemaValidator: $this->responseSchemaValidator, hydrators: $this->hydrators); + if ($this->internal🔀Router🔀Put🔀CodeSecurity instanceof Internal\Router\Put\CodeSecurity === false) { + $this->internal🔀Router🔀Put🔀CodeSecurity = new Internal\Router\Put\CodeSecurity(browser: $this->browser, authentication: $this->authentication, requestSchemaValidator: $this->requestSchemaValidator, responseSchemaValidator: $this->responseSchemaValidator, hydrators: $this->hydrators); } - return $this->internal🔀Router🔀Put🔀Users; + return $this->internal🔀Router🔀Put🔀CodeSecurity; } public function internal🔀Router🔀Put🔀Oidc(): Internal\Router\Put\Oidc @@ -1363,15 +1354,6 @@ public function internal🔀Router🔀Put🔀Oidc(): Internal\Router\Put\Oidc return $this->internal🔀Router🔀Put🔀Oidc; } - public function internal🔀Router🔀Put🔀CodeSecurity(): Internal\Router\Put\CodeSecurity - { - if ($this->internal🔀Router🔀Put🔀CodeSecurity instanceof Internal\Router\Put\CodeSecurity === false) { - $this->internal🔀Router🔀Put🔀CodeSecurity = new Internal\Router\Put\CodeSecurity(browser: $this->browser, authentication: $this->authentication, requestSchemaValidator: $this->requestSchemaValidator, responseSchemaValidator: $this->responseSchemaValidator, hydrators: $this->hydrators); - } - - return $this->internal🔀Router🔀Put🔀CodeSecurity; - } - public function internal🔀Router🔀Put🔀Dependabot(): Internal\Router\Put\Dependabot { if ($this->internal🔀Router🔀Put🔀Dependabot instanceof Internal\Router\Put\Dependabot === false) { @@ -1399,6 +1381,24 @@ public function internal🔀Router🔀Put🔀Pulls(): Internal\Router\Put\Pulls return $this->internal🔀Router🔀Put🔀Pulls; } + public function internal🔀Router🔀Put🔀Gists(): Internal\Router\Put\Gists + { + if ($this->internal🔀Router🔀Put🔀Gists instanceof Internal\Router\Put\Gists === false) { + $this->internal🔀Router🔀Put🔀Gists = new Internal\Router\Put\Gists(browser: $this->browser, authentication: $this->authentication, requestSchemaValidator: $this->requestSchemaValidator, responseSchemaValidator: $this->responseSchemaValidator, hydrators: $this->hydrators); + } + + return $this->internal🔀Router🔀Put🔀Gists; + } + + public function internal🔀Router🔀Put🔀Users(): Internal\Router\Put\Users + { + if ($this->internal🔀Router🔀Put🔀Users instanceof Internal\Router\Put\Users === false) { + $this->internal🔀Router🔀Put🔀Users = new Internal\Router\Put\Users(browser: $this->browser, authentication: $this->authentication, requestSchemaValidator: $this->requestSchemaValidator, responseSchemaValidator: $this->responseSchemaValidator, hydrators: $this->hydrators); + } + + return $this->internal🔀Router🔀Put🔀Users; + } + public function internal🔀Router🔀Stream🔀Migrations(): Internal\Router\Stream\Migrations { if ($this->internal🔀Router🔀Stream🔀Migrations instanceof Internal\Router\Stream\Migrations === false) { diff --git a/clients/GitHub/src/Operation/CodeScanning.php b/clients/GitHub/src/Operation/CodeScanning.php index 4786830ab4c..0f057e8c3d3 100644 --- a/clients/GitHub/src/Operation/CodeScanning.php +++ b/clients/GitHub/src/Operation/CodeScanning.php @@ -9,6 +9,8 @@ use ApiClients\Client\GitHub\Schema\CodeScanningAlert; use ApiClients\Client\GitHub\Schema\CodeScanningAnalysis; use ApiClients\Client\GitHub\Schema\CodeScanningAnalysisDeletion; +use ApiClients\Client\GitHub\Schema\CodeScanningAutofix; +use ApiClients\Client\GitHub\Schema\CodeScanningAutofixCommitsResponse; use ApiClients\Client\GitHub\Schema\CodeScanningCodeqlDatabase; use ApiClients\Client\GitHub\Schema\CodeScanningDefaultSetup; use ApiClients\Client\GitHub\Schema\CodeScanningDefaultSetupUpdateResponse; @@ -61,6 +63,21 @@ public function updateAlert(string $owner, string $repo, int $alertNumber, array return $this->operators->codeScanning👷UpdateAlert()->call($owner, $repo, $alertNumber, $params); } + public function getAutofix(string $owner, string $repo, int $alertNumber): CodeScanningAutofix + { + return $this->operators->codeScanning👷GetAutofix()->call($owner, $repo, $alertNumber); + } + + public function createAutofix(string $owner, string $repo, int $alertNumber): CodeScanningAutofix|WithoutBody + { + return $this->operators->codeScanning👷CreateAutofix()->call($owner, $repo, $alertNumber); + } + + public function commitAutofix(string $owner, string $repo, int $alertNumber, array $params): CodeScanningAutofixCommitsResponse|WithoutBody + { + return $this->operators->codeScanning👷CommitAutofix()->call($owner, $repo, $alertNumber, $params); + } + /** @return Observable */ public function listAlertInstances(string $owner, string $repo, int $alertNumber, string $ref, int $pr, int $page, int $perPage): iterable { diff --git a/clients/GitHub/src/Operation/CodeSecurity.php b/clients/GitHub/src/Operation/CodeSecurity.php index e3dbb8d1418..ca4381428c3 100644 --- a/clients/GitHub/src/Operation/CodeSecurity.php +++ b/clients/GitHub/src/Operation/CodeSecurity.php @@ -8,8 +8,8 @@ use ApiClients\Client\GitHub\Schema; use ApiClients\Client\GitHub\Schema\CodeSecurityConfiguration; use ApiClients\Client\GitHub\Schema\CodeSecurityConfigurationForRepository; -use ApiClients\Client\GitHub\Schema\Operations\CodeSecurity\AttachConfiguration\Response\ApplicationJson\Accepted\Application\Json; -use ApiClients\Client\GitHub\Schema\Operations\CodeSecurity\SetConfigurationAsDefault\Response\ApplicationJson\Ok; +use ApiClients\Client\GitHub\Schema\Operations\CodeSecurity\AttachEnterpriseConfiguration\Response\ApplicationJson\Accepted\Application\Json; +use ApiClients\Client\GitHub\Schema\Operations\CodeSecurity\SetConfigurationAsDefaultForEnterprise\Response\ApplicationJson\Ok; use ApiClients\Tools\OpenApiClient\Utils\Response\WithoutBody; final class CodeSecurity @@ -18,6 +18,54 @@ public function __construct(private Internal\Operators $operators) { } + /** @return iterable */ + public function getConfigurationsForEnterprise(string $enterprise, string $before, string $after, int $perPage): iterable + { + return $this->operators->codeSecurity👷GetConfigurationsForEnterprise()->call($enterprise, $before, $after, $perPage); + } + + public function createConfigurationForEnterprise(string $enterprise, array $params): CodeSecurityConfiguration + { + return $this->operators->codeSecurity👷CreateConfigurationForEnterprise()->call($enterprise, $params); + } + + /** @return iterable */ + public function getDefaultConfigurationsForEnterprise(string $enterprise): iterable + { + return $this->operators->codeSecurity👷GetDefaultConfigurationsForEnterprise()->call($enterprise); + } + + public function getSingleConfigurationForEnterprise(string $enterprise, int $configurationId): CodeSecurityConfiguration|WithoutBody + { + return $this->operators->codeSecurity👷GetSingleConfigurationForEnterprise()->call($enterprise, $configurationId); + } + + public function deleteConfigurationForEnterprise(string $enterprise, int $configurationId): WithoutBody + { + return $this->operators->codeSecurity👷DeleteConfigurationForEnterprise()->call($enterprise, $configurationId); + } + + public function updateEnterpriseConfiguration(string $enterprise, int $configurationId, array $params): CodeSecurityConfiguration|WithoutBody + { + return $this->operators->codeSecurity👷UpdateEnterpriseConfiguration()->call($enterprise, $configurationId, $params); + } + + public function attachEnterpriseConfiguration(string $enterprise, int $configurationId, array $params): Json + { + return $this->operators->codeSecurity👷AttachEnterpriseConfiguration()->call($enterprise, $configurationId, $params); + } + + public function setConfigurationAsDefaultForEnterprise(string $enterprise, int $configurationId, array $params): Ok + { + return $this->operators->codeSecurity👷SetConfigurationAsDefaultForEnterprise()->call($enterprise, $configurationId, $params); + } + + /** @return iterable */ + public function getRepositoriesForEnterpriseConfiguration(string $enterprise, int $configurationId, string $before, string $after, int $perPage, string $status): iterable + { + return $this->operators->codeSecurity👷GetRepositoriesForEnterpriseConfiguration()->call($enterprise, $configurationId, $before, $after, $perPage, $status); + } + /** @return Observable */ public function getConfigurationsForOrg(string $org, string $before, string $after, string $targetType, int $perPage): iterable { @@ -61,13 +109,12 @@ public function updateConfiguration(string $org, int $configurationId, array $pa } /** @return */ - public function attachConfiguration(string $org, int $configurationId, array $params): Json + public function attachConfiguration(string $org, int $configurationId, array $params): \ApiClients\Client\GitHub\Schema\Operations\CodeSecurity\AttachConfiguration\Response\ApplicationJson\Accepted\Application\Json { return $this->operators->codeSecurity👷AttachConfiguration()->call($org, $configurationId, $params); } - /** @return */ - public function setConfigurationAsDefault(string $org, int $configurationId, array $params): Ok + public function setConfigurationAsDefault(string $org, int $configurationId, array $params): \ApiClients\Client\GitHub\Schema\Operations\CodeSecurity\SetConfigurationAsDefault\Response\ApplicationJson\Ok\Application\Json { return $this->operators->codeSecurity👷SetConfigurationAsDefault()->call($org, $configurationId, $params); } diff --git a/clients/GitHub/src/Operations.php b/clients/GitHub/src/Operations.php index 16ea923d1a1..514e8702bd1 100644 --- a/clients/GitHub/src/Operations.php +++ b/clients/GitHub/src/Operations.php @@ -40,6 +40,11 @@ public function emojis(): Operation\Emojis return new Operation\Emojis($this->operators); } + public function codeSecurity(): Operation\CodeSecurity + { + return new Operation\CodeSecurity($this->operators); + } + public function dependabot(): Operation\Dependabot { return new Operation\Dependabot($this->operators); @@ -105,11 +110,6 @@ public function codeScanning(): Operation\CodeScanning return new Operation\CodeScanning($this->operators); } - public function codeSecurity(): Operation\CodeSecurity - { - return new Operation\CodeSecurity($this->operators); - } - public function codespaces(): Operation\Codespaces { return new Operation\Codespaces($this->operators); diff --git a/clients/GitHub/src/OperationsInterface.php b/clients/GitHub/src/OperationsInterface.php index 092430263d4..e0343fe3286 100644 --- a/clients/GitHub/src/OperationsInterface.php +++ b/clients/GitHub/src/OperationsInterface.php @@ -18,6 +18,8 @@ public function codesOfConduct(): Operation\CodesOfConduct; public function emojis(): Operation\Emojis; + public function codeSecurity(): Operation\CodeSecurity; + public function dependabot(): Operation\Dependabot; public function secretScanning(): Operation\SecretScanning; @@ -44,8 +46,6 @@ public function oidc(): Operation\Oidc; public function codeScanning(): Operation\CodeScanning; - public function codeSecurity(): Operation\CodeSecurity; - public function codespaces(): Operation\Codespaces; public function copilot(): Operation\Copilot; diff --git a/clients/GitHub/src/PHPStan/ClientCallReturnTypes.php b/clients/GitHub/src/PHPStan/ClientCallReturnTypes.php index e96066fad5c..017b8c93451 100644 --- a/clients/GitHub/src/PHPStan/ClientCallReturnTypes.php +++ b/clients/GitHub/src/PHPStan/ClientCallReturnTypes.php @@ -191,6 +191,42 @@ public function getTypeFromMethodCall(MethodReflection $methodReflection, Method return $this->typeResolver->resolve(''); } + if ($call === 'GET /enterprises/{enterprise}/code-security/configurations') { + return $this->typeResolver->resolve('iterable'); + } + + if ($call === 'POST /enterprises/{enterprise}/code-security/configurations') { + return $this->typeResolver->resolve('Schema\\CodeSecurityConfiguration'); + } + + if ($call === 'GET /enterprises/{enterprise}/code-security/configurations/defaults') { + return $this->typeResolver->resolve('iterable'); + } + + if ($call === 'GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}') { + return $this->typeResolver->resolve('Schema\\CodeSecurityConfiguration|\\ApiClients\\Tools\\OpenApiClient\\Utils\\Response\\WithoutBody'); + } + + if ($call === 'DELETE /enterprises/{enterprise}/code-security/configurations/{configuration_id}') { + return $this->typeResolver->resolve('\\ApiClients\\Tools\\OpenApiClient\\Utils\\Response\\WithoutBody'); + } + + if ($call === 'PATCH /enterprises/{enterprise}/code-security/configurations/{configuration_id}') { + return $this->typeResolver->resolve('Schema\\CodeSecurityConfiguration|\\ApiClients\\Tools\\OpenApiClient\\Utils\\Response\\WithoutBody'); + } + + if ($call === 'POST /enterprises/{enterprise}/code-security/configurations/{configuration_id}/attach') { + return $this->typeResolver->resolve('Schema\\Operations\\CodeSecurity\\AttachEnterpriseConfiguration\\Response\\ApplicationJson\\Accepted\\Application\\Json'); + } + + if ($call === 'PUT /enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults') { + return $this->typeResolver->resolve('Schema\\Operations\\CodeSecurity\\SetConfigurationAsDefaultForEnterprise\\Response\\ApplicationJson\\Ok'); + } + + if ($call === 'GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories') { + return $this->typeResolver->resolve('iterable'); + } + if ($call === 'GET /enterprises/{enterprise}/dependabot/alerts') { return $this->typeResolver->resolve('Observable|WithoutBody'); } @@ -760,7 +796,7 @@ public function getTypeFromMethodCall(MethodReflection $methodReflection, Method } if ($call === 'PUT /orgs/{org}/code-security/configurations/{configuration_id}/defaults') { - return $this->typeResolver->resolve(''); + return $this->typeResolver->resolve('Schema\\Operations\\CodeSecurity\\SetConfigurationAsDefault\\Response\\ApplicationJson\\Ok\\Application\\Json'); } if ($call === 'GET /orgs/{org}/code-security/configurations/{configuration_id}/repositories') { @@ -2319,6 +2355,18 @@ public function getTypeFromMethodCall(MethodReflection $methodReflection, Method return $this->typeResolver->resolve(''); } + if ($call === 'GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix') { + return $this->typeResolver->resolve('Schema\\CodeScanningAutofix'); + } + + if ($call === 'POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix') { + return $this->typeResolver->resolve('Schema\\CodeScanningAutofix|\\ApiClients\\Tools\\OpenApiClient\\Utils\\Response\\WithoutBody'); + } + + if ($call === 'POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/commits') { + return $this->typeResolver->resolve('Schema\\CodeScanningAutofixCommitsResponse|\\ApiClients\\Tools\\OpenApiClient\\Utils\\Response\\WithoutBody'); + } + if ($call === 'GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances') { return $this->typeResolver->resolve('Observable'); } diff --git a/clients/GitHub/src/Schema/AliasAbstract/Tiet07CEC6F7/Tiet1DE9A5A0/Tiet17BD6D01/Tiet0890CA07.php b/clients/GitHub/src/Schema/AliasAbstract/Tiet07CEC6F7/Tiet1DE9A5A0/Tiet17BD6D01/Tiet0890CA07.php new file mode 100644 index 00000000000..90598e28b99 --- /dev/null +++ b/clients/GitHub/src/Schema/AliasAbstract/Tiet07CEC6F7/Tiet1DE9A5A0/Tiet17BD6D01/Tiet0890CA07.php @@ -0,0 +1,313 @@ + 'application/json'], json_encode(json_decode(Schema\CodeScanningAutofixCommitsResponse::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('POST', '/repos/generated/generated/code-scanning/alerts/12/autofix/commits', Argument::type('array'), json_encode(json_decode(Schema\CodeScanningAutofixCommits::SCHEMA_EXAMPLE_DATA, true)))->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->call(Internal\Operation\CodeScanning\CommitAutofix::OPERATION_MATCH, (static function (array $data): array { + $data['owner'] = 'generated'; + $data['repo'] = 'generated'; + $data['alert_number'] = 12; + + return $data; + })(json_decode(Schema\CodeScanningAutofixCommits::SCHEMA_EXAMPLE_DATA, true))); + } + + /** @test */ + public function operations_httpCode_201_requestContentType_application_json_responseContentType_application_json_zero(): void + { + $response = new Response(201, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\CodeScanningAutofixCommitsResponse::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('POST', '/repos/generated/generated/code-scanning/alerts/12/autofix/commits', Argument::type('array'), json_encode(json_decode(Schema\CodeScanningAutofixCommits::SCHEMA_EXAMPLE_DATA, true)))->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->codeScanning()->commitAutofix('generated', 'generated', 12, json_decode(Schema\CodeScanningAutofixCommits::SCHEMA_EXAMPLE_DATA, true)); + } + + /** @test */ + public function call_httpCode_400_requestContentType_application_json_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\BasicError::class); + $response = new Response(400, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\BasicError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('POST', '/repos/generated/generated/code-scanning/alerts/12/autofix/commits', Argument::type('array'), json_encode(json_decode(Schema\CodeScanningAutofixCommits::SCHEMA_EXAMPLE_DATA, true)))->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->call(Internal\Operation\CodeScanning\CommitAutofix::OPERATION_MATCH, (static function (array $data): array { + $data['owner'] = 'generated'; + $data['repo'] = 'generated'; + $data['alert_number'] = 12; + + return $data; + })(json_decode(Schema\CodeScanningAutofixCommits::SCHEMA_EXAMPLE_DATA, true))); + } + + /** @test */ + public function operations_httpCode_400_requestContentType_application_json_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\BasicError::class); + $response = new Response(400, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\BasicError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('POST', '/repos/generated/generated/code-scanning/alerts/12/autofix/commits', Argument::type('array'), json_encode(json_decode(Schema\CodeScanningAutofixCommits::SCHEMA_EXAMPLE_DATA, true)))->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->codeScanning()->commitAutofix('generated', 'generated', 12, json_decode(Schema\CodeScanningAutofixCommits::SCHEMA_EXAMPLE_DATA, true)); + } + + /** @test */ + public function call_httpCode_403_requestContentType_application_json_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\BasicError::class); + $response = new Response(403, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\BasicError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('POST', '/repos/generated/generated/code-scanning/alerts/12/autofix/commits', Argument::type('array'), json_encode(json_decode(Schema\CodeScanningAutofixCommits::SCHEMA_EXAMPLE_DATA, true)))->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->call(Internal\Operation\CodeScanning\CommitAutofix::OPERATION_MATCH, (static function (array $data): array { + $data['owner'] = 'generated'; + $data['repo'] = 'generated'; + $data['alert_number'] = 12; + + return $data; + })(json_decode(Schema\CodeScanningAutofixCommits::SCHEMA_EXAMPLE_DATA, true))); + } + + /** @test */ + public function operations_httpCode_403_requestContentType_application_json_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\BasicError::class); + $response = new Response(403, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\BasicError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('POST', '/repos/generated/generated/code-scanning/alerts/12/autofix/commits', Argument::type('array'), json_encode(json_decode(Schema\CodeScanningAutofixCommits::SCHEMA_EXAMPLE_DATA, true)))->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->codeScanning()->commitAutofix('generated', 'generated', 12, json_decode(Schema\CodeScanningAutofixCommits::SCHEMA_EXAMPLE_DATA, true)); + } + + /** @test */ + public function call_httpCode_404_requestContentType_application_json_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\BasicError::class); + $response = new Response(404, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\BasicError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('POST', '/repos/generated/generated/code-scanning/alerts/12/autofix/commits', Argument::type('array'), json_encode(json_decode(Schema\CodeScanningAutofixCommits::SCHEMA_EXAMPLE_DATA, true)))->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->call(Internal\Operation\CodeScanning\CommitAutofix::OPERATION_MATCH, (static function (array $data): array { + $data['owner'] = 'generated'; + $data['repo'] = 'generated'; + $data['alert_number'] = 12; + + return $data; + })(json_decode(Schema\CodeScanningAutofixCommits::SCHEMA_EXAMPLE_DATA, true))); + } + + /** @test */ + public function operations_httpCode_404_requestContentType_application_json_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\BasicError::class); + $response = new Response(404, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\BasicError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('POST', '/repos/generated/generated/code-scanning/alerts/12/autofix/commits', Argument::type('array'), json_encode(json_decode(Schema\CodeScanningAutofixCommits::SCHEMA_EXAMPLE_DATA, true)))->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->codeScanning()->commitAutofix('generated', 'generated', 12, json_decode(Schema\CodeScanningAutofixCommits::SCHEMA_EXAMPLE_DATA, true)); + } + + /** @test */ + public function call_httpCode_503_requestContentType_application_json_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\Operations\SecretScanning\ListAlertsForEnterprise\Response\ApplicationJson\ServiceUnavailable::class); + $response = new Response(503, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\Operations\SecretScanning\ListAlertsForEnterprise\Response\ApplicationJson\ServiceUnavailable::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('POST', '/repos/generated/generated/code-scanning/alerts/12/autofix/commits', Argument::type('array'), json_encode(json_decode(Schema\CodeScanningAutofixCommits::SCHEMA_EXAMPLE_DATA, true)))->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->call(Internal\Operation\CodeScanning\CommitAutofix::OPERATION_MATCH, (static function (array $data): array { + $data['owner'] = 'generated'; + $data['repo'] = 'generated'; + $data['alert_number'] = 12; + + return $data; + })(json_decode(Schema\CodeScanningAutofixCommits::SCHEMA_EXAMPLE_DATA, true))); + } + + /** @test */ + public function operations_httpCode_503_requestContentType_application_json_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\Operations\SecretScanning\ListAlertsForEnterprise\Response\ApplicationJson\ServiceUnavailable::class); + $response = new Response(503, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\Operations\SecretScanning\ListAlertsForEnterprise\Response\ApplicationJson\ServiceUnavailable::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('POST', '/repos/generated/generated/code-scanning/alerts/12/autofix/commits', Argument::type('array'), json_encode(json_decode(Schema\CodeScanningAutofixCommits::SCHEMA_EXAMPLE_DATA, true)))->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->codeScanning()->commitAutofix('generated', 'generated', 12, json_decode(Schema\CodeScanningAutofixCommits::SCHEMA_EXAMPLE_DATA, true)); + } + + /** @test */ + public function call_httpCode_422_requestContentType_application_json_empty(): void + { + $response = new Response(422, []); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('POST', '/repos/generated/generated/code-scanning/alerts/12/autofix/commits', Argument::type('array'), json_encode(json_decode(Schema\CodeScanningAutofixCommits::SCHEMA_EXAMPLE_DATA, true)))->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->call(Internal\Operation\CodeScanning\CommitAutofix::OPERATION_MATCH, (static function (array $data): array { + $data['owner'] = 'generated'; + $data['repo'] = 'generated'; + $data['alert_number'] = 12; + + return $data; + })(json_decode(Schema\CodeScanningAutofixCommits::SCHEMA_EXAMPLE_DATA, true))); + } + + /** @test */ + public function operations_httpCode_422_requestContentType_application_json_empty(): void + { + $response = new Response(422, []); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('POST', '/repos/generated/generated/code-scanning/alerts/12/autofix/commits', Argument::type('array'), json_encode(json_decode(Schema\CodeScanningAutofixCommits::SCHEMA_EXAMPLE_DATA, true)))->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->codeScanning()->commitAutofix('generated', 'generated', 12, json_decode(Schema\CodeScanningAutofixCommits::SCHEMA_EXAMPLE_DATA, true)); + self::assertArrayHasKey('code', $result); + self::assertSame(422, $result['code']); + } +} diff --git a/clients/GitHub/tests/Internal/Operation/CodeScanning/CreateAutofixTest.php b/clients/GitHub/tests/Internal/Operation/CodeScanning/CreateAutofixTest.php new file mode 100644 index 00000000000..7003a9cf86a --- /dev/null +++ b/clients/GitHub/tests/Internal/Operation/CodeScanning/CreateAutofixTest.php @@ -0,0 +1,271 @@ + 'application/json'], json_encode(json_decode(Schema\CodeScanningAutofix::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('POST', '/repos/generated/generated/code-scanning/alerts/12/autofix', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->call(Internal\Operation\CodeScanning\CreateAutofix::OPERATION_MATCH, (static function (array $data): array { + $data['owner'] = 'generated'; + $data['repo'] = 'generated'; + $data['alert_number'] = 12; + + return $data; + })([])); + } + + /** @test */ + public function operations_httpCode_200_responseContentType_application_json_zero(): void + { + $response = new Response(200, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\CodeScanningAutofix::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('POST', '/repos/generated/generated/code-scanning/alerts/12/autofix', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->codeScanning()->createAutofix('generated', 'generated', 12); + } + + /** @test */ + public function call_httpCode_202_responseContentType_application_json_zero(): void + { + $response = new Response(202, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\CodeScanningAutofix::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('POST', '/repos/generated/generated/code-scanning/alerts/12/autofix', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->call(Internal\Operation\CodeScanning\CreateAutofix::OPERATION_MATCH, (static function (array $data): array { + $data['owner'] = 'generated'; + $data['repo'] = 'generated'; + $data['alert_number'] = 12; + + return $data; + })([])); + } + + /** @test */ + public function operations_httpCode_202_responseContentType_application_json_zero(): void + { + $response = new Response(202, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\CodeScanningAutofix::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('POST', '/repos/generated/generated/code-scanning/alerts/12/autofix', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->codeScanning()->createAutofix('generated', 'generated', 12); + } + + /** @test */ + public function call_httpCode_400_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\BasicError::class); + $response = new Response(400, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\BasicError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('POST', '/repos/generated/generated/code-scanning/alerts/12/autofix', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->call(Internal\Operation\CodeScanning\CreateAutofix::OPERATION_MATCH, (static function (array $data): array { + $data['owner'] = 'generated'; + $data['repo'] = 'generated'; + $data['alert_number'] = 12; + + return $data; + })([])); + } + + /** @test */ + public function operations_httpCode_400_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\BasicError::class); + $response = new Response(400, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\BasicError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('POST', '/repos/generated/generated/code-scanning/alerts/12/autofix', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->codeScanning()->createAutofix('generated', 'generated', 12); + } + + /** @test */ + public function call_httpCode_403_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\BasicError::class); + $response = new Response(403, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\BasicError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('POST', '/repos/generated/generated/code-scanning/alerts/12/autofix', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->call(Internal\Operation\CodeScanning\CreateAutofix::OPERATION_MATCH, (static function (array $data): array { + $data['owner'] = 'generated'; + $data['repo'] = 'generated'; + $data['alert_number'] = 12; + + return $data; + })([])); + } + + /** @test */ + public function operations_httpCode_403_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\BasicError::class); + $response = new Response(403, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\BasicError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('POST', '/repos/generated/generated/code-scanning/alerts/12/autofix', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->codeScanning()->createAutofix('generated', 'generated', 12); + } + + /** @test */ + public function call_httpCode_404_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\BasicError::class); + $response = new Response(404, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\BasicError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('POST', '/repos/generated/generated/code-scanning/alerts/12/autofix', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->call(Internal\Operation\CodeScanning\CreateAutofix::OPERATION_MATCH, (static function (array $data): array { + $data['owner'] = 'generated'; + $data['repo'] = 'generated'; + $data['alert_number'] = 12; + + return $data; + })([])); + } + + /** @test */ + public function operations_httpCode_404_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\BasicError::class); + $response = new Response(404, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\BasicError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('POST', '/repos/generated/generated/code-scanning/alerts/12/autofix', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->codeScanning()->createAutofix('generated', 'generated', 12); + } + + /** @test */ + public function call_httpCode_503_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\Operations\SecretScanning\ListAlertsForEnterprise\Response\ApplicationJson\ServiceUnavailable::class); + $response = new Response(503, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\Operations\SecretScanning\ListAlertsForEnterprise\Response\ApplicationJson\ServiceUnavailable::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('POST', '/repos/generated/generated/code-scanning/alerts/12/autofix', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->call(Internal\Operation\CodeScanning\CreateAutofix::OPERATION_MATCH, (static function (array $data): array { + $data['owner'] = 'generated'; + $data['repo'] = 'generated'; + $data['alert_number'] = 12; + + return $data; + })([])); + } + + /** @test */ + public function operations_httpCode_503_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\Operations\SecretScanning\ListAlertsForEnterprise\Response\ApplicationJson\ServiceUnavailable::class); + $response = new Response(503, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\Operations\SecretScanning\ListAlertsForEnterprise\Response\ApplicationJson\ServiceUnavailable::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('POST', '/repos/generated/generated/code-scanning/alerts/12/autofix', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->codeScanning()->createAutofix('generated', 'generated', 12); + } + + /** @test */ + public function call_httpCode_422_empty(): void + { + $response = new Response(422, []); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('POST', '/repos/generated/generated/code-scanning/alerts/12/autofix', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->call(Internal\Operation\CodeScanning\CreateAutofix::OPERATION_MATCH, (static function (array $data): array { + $data['owner'] = 'generated'; + $data['repo'] = 'generated'; + $data['alert_number'] = 12; + + return $data; + })([])); + } + + /** @test */ + public function operations_httpCode_422_empty(): void + { + $response = new Response(422, []); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('POST', '/repos/generated/generated/code-scanning/alerts/12/autofix', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->codeScanning()->createAutofix('generated', 'generated', 12); + self::assertArrayHasKey('code', $result); + self::assertSame(422, $result['code']); + } +} diff --git a/clients/GitHub/tests/Internal/Operation/CodeScanning/GetAutofixTest.php b/clients/GitHub/tests/Internal/Operation/CodeScanning/GetAutofixTest.php new file mode 100644 index 00000000000..bdc81b92c4e --- /dev/null +++ b/clients/GitHub/tests/Internal/Operation/CodeScanning/GetAutofixTest.php @@ -0,0 +1,201 @@ + 'application/json'], json_encode(json_decode(Schema\CodeScanningAutofix::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $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/code-scanning/alerts/12/autofix', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->call(Internal\Operation\CodeScanning\GetAutofix::OPERATION_MATCH, (static function (array $data): array { + $data['owner'] = 'generated'; + $data['repo'] = 'generated'; + $data['alert_number'] = 12; + + return $data; + })([])); + } + + /** @test */ + public function operations_httpCode_200_responseContentType_application_json_zero(): void + { + $response = new Response(200, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\CodeScanningAutofix::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $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/code-scanning/alerts/12/autofix', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->codeScanning()->getAutofix('generated', 'generated', 12); + } + + /** @test */ + public function call_httpCode_400_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\BasicError::class); + $response = new Response(400, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\BasicError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $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/code-scanning/alerts/12/autofix', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->call(Internal\Operation\CodeScanning\GetAutofix::OPERATION_MATCH, (static function (array $data): array { + $data['owner'] = 'generated'; + $data['repo'] = 'generated'; + $data['alert_number'] = 12; + + return $data; + })([])); + } + + /** @test */ + public function operations_httpCode_400_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\BasicError::class); + $response = new Response(400, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\BasicError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $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/code-scanning/alerts/12/autofix', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->codeScanning()->getAutofix('generated', 'generated', 12); + } + + /** @test */ + public function call_httpCode_403_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\BasicError::class); + $response = new Response(403, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\BasicError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $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/code-scanning/alerts/12/autofix', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->call(Internal\Operation\CodeScanning\GetAutofix::OPERATION_MATCH, (static function (array $data): array { + $data['owner'] = 'generated'; + $data['repo'] = 'generated'; + $data['alert_number'] = 12; + + return $data; + })([])); + } + + /** @test */ + public function operations_httpCode_403_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\BasicError::class); + $response = new Response(403, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\BasicError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $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/code-scanning/alerts/12/autofix', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->codeScanning()->getAutofix('generated', 'generated', 12); + } + + /** @test */ + public function call_httpCode_404_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\BasicError::class); + $response = new Response(404, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\BasicError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $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/code-scanning/alerts/12/autofix', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->call(Internal\Operation\CodeScanning\GetAutofix::OPERATION_MATCH, (static function (array $data): array { + $data['owner'] = 'generated'; + $data['repo'] = 'generated'; + $data['alert_number'] = 12; + + return $data; + })([])); + } + + /** @test */ + public function operations_httpCode_404_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\BasicError::class); + $response = new Response(404, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\BasicError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $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/code-scanning/alerts/12/autofix', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->codeScanning()->getAutofix('generated', 'generated', 12); + } + + /** @test */ + public function call_httpCode_503_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\Operations\SecretScanning\ListAlertsForEnterprise\Response\ApplicationJson\ServiceUnavailable::class); + $response = new Response(503, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\Operations\SecretScanning\ListAlertsForEnterprise\Response\ApplicationJson\ServiceUnavailable::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $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/code-scanning/alerts/12/autofix', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->call(Internal\Operation\CodeScanning\GetAutofix::OPERATION_MATCH, (static function (array $data): array { + $data['owner'] = 'generated'; + $data['repo'] = 'generated'; + $data['alert_number'] = 12; + + return $data; + })([])); + } + + /** @test */ + public function operations_httpCode_503_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\Operations\SecretScanning\ListAlertsForEnterprise\Response\ApplicationJson\ServiceUnavailable::class); + $response = new Response(503, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\Operations\SecretScanning\ListAlertsForEnterprise\Response\ApplicationJson\ServiceUnavailable::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $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/code-scanning/alerts/12/autofix', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->codeScanning()->getAutofix('generated', 'generated', 12); + } +} diff --git a/clients/GitHub/tests/Internal/Operation/CodeSecurity/AttachEnterpriseConfigurationTest.php b/clients/GitHub/tests/Internal/Operation/CodeSecurity/AttachEnterpriseConfigurationTest.php new file mode 100644 index 00000000000..1f6d2fb0728 --- /dev/null +++ b/clients/GitHub/tests/Internal/Operation/CodeSecurity/AttachEnterpriseConfigurationTest.php @@ -0,0 +1,161 @@ + 'application/json'], json_encode(json_decode(Schema\Operations\CodeSecurity\AttachEnterpriseConfiguration\Response\ApplicationJson\Accepted\Application\Json::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('POST', '/enterprises/generated/code-security/configurations/16/attach', Argument::type('array'), json_encode(json_decode(Schema\CodeSecurity\AttachEnterpriseConfiguration\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)))->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->call(Internal\Operation\CodeSecurity\AttachEnterpriseConfiguration::OPERATION_MATCH, (static function (array $data): array { + $data['enterprise'] = 'generated'; + $data['configuration_id'] = 16; + + return $data; + })(json_decode(Schema\CodeSecurity\AttachEnterpriseConfiguration\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true))); + } + + /** @test */ + public function operations_httpCode_202_requestContentType_application_json_responseContentType_application_json_zero(): void + { + $response = new Response(202, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\Operations\CodeSecurity\AttachEnterpriseConfiguration\Response\ApplicationJson\Accepted\Application\Json::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('POST', '/enterprises/generated/code-security/configurations/16/attach', Argument::type('array'), json_encode(json_decode(Schema\CodeSecurity\AttachEnterpriseConfiguration\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)))->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->codeSecurity()->attachEnterpriseConfiguration('generated', 16, json_decode(Schema\CodeSecurity\AttachEnterpriseConfiguration\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)); + } + + /** @test */ + public function call_httpCode_403_requestContentType_application_json_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\BasicError::class); + $response = new Response(403, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\BasicError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('POST', '/enterprises/generated/code-security/configurations/16/attach', Argument::type('array'), json_encode(json_decode(Schema\CodeSecurity\AttachEnterpriseConfiguration\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)))->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->call(Internal\Operation\CodeSecurity\AttachEnterpriseConfiguration::OPERATION_MATCH, (static function (array $data): array { + $data['enterprise'] = 'generated'; + $data['configuration_id'] = 16; + + return $data; + })(json_decode(Schema\CodeSecurity\AttachEnterpriseConfiguration\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true))); + } + + /** @test */ + public function operations_httpCode_403_requestContentType_application_json_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\BasicError::class); + $response = new Response(403, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\BasicError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('POST', '/enterprises/generated/code-security/configurations/16/attach', Argument::type('array'), json_encode(json_decode(Schema\CodeSecurity\AttachEnterpriseConfiguration\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)))->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->codeSecurity()->attachEnterpriseConfiguration('generated', 16, json_decode(Schema\CodeSecurity\AttachEnterpriseConfiguration\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)); + } + + /** @test */ + public function call_httpCode_404_requestContentType_application_json_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\BasicError::class); + $response = new Response(404, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\BasicError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('POST', '/enterprises/generated/code-security/configurations/16/attach', Argument::type('array'), json_encode(json_decode(Schema\CodeSecurity\AttachEnterpriseConfiguration\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)))->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->call(Internal\Operation\CodeSecurity\AttachEnterpriseConfiguration::OPERATION_MATCH, (static function (array $data): array { + $data['enterprise'] = 'generated'; + $data['configuration_id'] = 16; + + return $data; + })(json_decode(Schema\CodeSecurity\AttachEnterpriseConfiguration\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true))); + } + + /** @test */ + public function operations_httpCode_404_requestContentType_application_json_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\BasicError::class); + $response = new Response(404, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\BasicError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('POST', '/enterprises/generated/code-security/configurations/16/attach', Argument::type('array'), json_encode(json_decode(Schema\CodeSecurity\AttachEnterpriseConfiguration\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)))->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->codeSecurity()->attachEnterpriseConfiguration('generated', 16, json_decode(Schema\CodeSecurity\AttachEnterpriseConfiguration\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)); + } + + /** @test */ + public function call_httpCode_409_requestContentType_application_json_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\BasicError::class); + $response = new Response(409, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\BasicError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('POST', '/enterprises/generated/code-security/configurations/16/attach', Argument::type('array'), json_encode(json_decode(Schema\CodeSecurity\AttachEnterpriseConfiguration\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)))->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->call(Internal\Operation\CodeSecurity\AttachEnterpriseConfiguration::OPERATION_MATCH, (static function (array $data): array { + $data['enterprise'] = 'generated'; + $data['configuration_id'] = 16; + + return $data; + })(json_decode(Schema\CodeSecurity\AttachEnterpriseConfiguration\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true))); + } + + /** @test */ + public function operations_httpCode_409_requestContentType_application_json_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\BasicError::class); + $response = new Response(409, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\BasicError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('POST', '/enterprises/generated/code-security/configurations/16/attach', Argument::type('array'), json_encode(json_decode(Schema\CodeSecurity\AttachEnterpriseConfiguration\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)))->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->codeSecurity()->attachEnterpriseConfiguration('generated', 16, json_decode(Schema\CodeSecurity\AttachEnterpriseConfiguration\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)); + } +} diff --git a/clients/GitHub/tests/Internal/Operation/CodeSecurity/CreateConfigurationForEnterpriseTest.php b/clients/GitHub/tests/Internal/Operation/CodeSecurity/CreateConfigurationForEnterpriseTest.php new file mode 100644 index 00000000000..0cafdddb9b2 --- /dev/null +++ b/clients/GitHub/tests/Internal/Operation/CodeSecurity/CreateConfigurationForEnterpriseTest.php @@ -0,0 +1,191 @@ + 'application/json'], json_encode(json_decode(Schema\CodeSecurityConfiguration::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('POST', '/enterprises/generated/code-security/configurations', Argument::type('array'), json_encode(json_decode(Schema\CodeSecurity\CreateConfigurationForEnterprise\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)))->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->call(Internal\Operation\CodeSecurity\CreateConfigurationForEnterprise::OPERATION_MATCH, (static function (array $data): array { + $data['enterprise'] = 'generated'; + + return $data; + })(json_decode(Schema\CodeSecurity\CreateConfigurationForEnterprise\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true))); + } + + /** @test */ + public function operations_httpCode_201_requestContentType_application_json_responseContentType_application_json_zero(): void + { + $response = new Response(201, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\CodeSecurityConfiguration::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('POST', '/enterprises/generated/code-security/configurations', Argument::type('array'), json_encode(json_decode(Schema\CodeSecurity\CreateConfigurationForEnterprise\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)))->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->codeSecurity()->createConfigurationForEnterprise('generated', json_decode(Schema\CodeSecurity\CreateConfigurationForEnterprise\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)); + } + + /** @test */ + public function call_httpCode_400_requestContentType_application_json_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\BasicError::class); + $response = new Response(400, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\BasicError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('POST', '/enterprises/generated/code-security/configurations', Argument::type('array'), json_encode(json_decode(Schema\CodeSecurity\CreateConfigurationForEnterprise\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)))->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->call(Internal\Operation\CodeSecurity\CreateConfigurationForEnterprise::OPERATION_MATCH, (static function (array $data): array { + $data['enterprise'] = 'generated'; + + return $data; + })(json_decode(Schema\CodeSecurity\CreateConfigurationForEnterprise\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true))); + } + + /** @test */ + public function operations_httpCode_400_requestContentType_application_json_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\BasicError::class); + $response = new Response(400, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\BasicError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('POST', '/enterprises/generated/code-security/configurations', Argument::type('array'), json_encode(json_decode(Schema\CodeSecurity\CreateConfigurationForEnterprise\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)))->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->codeSecurity()->createConfigurationForEnterprise('generated', json_decode(Schema\CodeSecurity\CreateConfigurationForEnterprise\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)); + } + + /** @test */ + public function call_httpCode_400_requestContentType_application_json_responseContentType_application_scim_json_zero(): void + { + self::expectException(ErrorSchemas\ScimError::class); + $response = new Response(400, ['Content-Type' => 'application/scim+json'], json_encode(json_decode(Schema\ScimError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('POST', '/enterprises/generated/code-security/configurations', Argument::type('array'), json_encode(json_decode(Schema\CodeSecurity\CreateConfigurationForEnterprise\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)))->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->call(Internal\Operation\CodeSecurity\CreateConfigurationForEnterprise::OPERATION_MATCH, (static function (array $data): array { + $data['enterprise'] = 'generated'; + + return $data; + })(json_decode(Schema\CodeSecurity\CreateConfigurationForEnterprise\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true))); + } + + /** @test */ + public function operations_httpCode_400_requestContentType_application_json_responseContentType_application_scim_json_zero(): void + { + self::expectException(ErrorSchemas\ScimError::class); + $response = new Response(400, ['Content-Type' => 'application/scim+json'], json_encode(json_decode(Schema\ScimError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('POST', '/enterprises/generated/code-security/configurations', Argument::type('array'), json_encode(json_decode(Schema\CodeSecurity\CreateConfigurationForEnterprise\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)))->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->codeSecurity()->createConfigurationForEnterprise('generated', json_decode(Schema\CodeSecurity\CreateConfigurationForEnterprise\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)); + } + + /** @test */ + public function call_httpCode_403_requestContentType_application_json_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\BasicError::class); + $response = new Response(403, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\BasicError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('POST', '/enterprises/generated/code-security/configurations', Argument::type('array'), json_encode(json_decode(Schema\CodeSecurity\CreateConfigurationForEnterprise\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)))->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->call(Internal\Operation\CodeSecurity\CreateConfigurationForEnterprise::OPERATION_MATCH, (static function (array $data): array { + $data['enterprise'] = 'generated'; + + return $data; + })(json_decode(Schema\CodeSecurity\CreateConfigurationForEnterprise\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true))); + } + + /** @test */ + public function operations_httpCode_403_requestContentType_application_json_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\BasicError::class); + $response = new Response(403, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\BasicError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('POST', '/enterprises/generated/code-security/configurations', Argument::type('array'), json_encode(json_decode(Schema\CodeSecurity\CreateConfigurationForEnterprise\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)))->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->codeSecurity()->createConfigurationForEnterprise('generated', json_decode(Schema\CodeSecurity\CreateConfigurationForEnterprise\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)); + } + + /** @test */ + public function call_httpCode_404_requestContentType_application_json_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\BasicError::class); + $response = new Response(404, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\BasicError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('POST', '/enterprises/generated/code-security/configurations', Argument::type('array'), json_encode(json_decode(Schema\CodeSecurity\CreateConfigurationForEnterprise\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)))->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->call(Internal\Operation\CodeSecurity\CreateConfigurationForEnterprise::OPERATION_MATCH, (static function (array $data): array { + $data['enterprise'] = 'generated'; + + return $data; + })(json_decode(Schema\CodeSecurity\CreateConfigurationForEnterprise\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true))); + } + + /** @test */ + public function operations_httpCode_404_requestContentType_application_json_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\BasicError::class); + $response = new Response(404, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\BasicError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('POST', '/enterprises/generated/code-security/configurations', Argument::type('array'), json_encode(json_decode(Schema\CodeSecurity\CreateConfigurationForEnterprise\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)))->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->codeSecurity()->createConfigurationForEnterprise('generated', json_decode(Schema\CodeSecurity\CreateConfigurationForEnterprise\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)); + } +} diff --git a/clients/GitHub/tests/Internal/Operation/CodeSecurity/DeleteConfigurationForEnterpriseTest.php b/clients/GitHub/tests/Internal/Operation/CodeSecurity/DeleteConfigurationForEnterpriseTest.php new file mode 100644 index 00000000000..9ca0827a828 --- /dev/null +++ b/clients/GitHub/tests/Internal/Operation/CodeSecurity/DeleteConfigurationForEnterpriseTest.php @@ -0,0 +1,233 @@ + 'application/json'], json_encode(json_decode(Schema\BasicError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('DELETE', '/enterprises/generated/code-security/configurations/16', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->call(Internal\Operation\CodeSecurity\DeleteConfigurationForEnterprise::OPERATION_MATCH, (static function (array $data): array { + $data['enterprise'] = 'generated'; + $data['configuration_id'] = 16; + + return $data; + })([])); + } + + /** @test */ + public function operations_httpCode_400_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\BasicError::class); + $response = new Response(400, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\BasicError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('DELETE', '/enterprises/generated/code-security/configurations/16', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->codeSecurity()->deleteConfigurationForEnterprise('generated', 16); + } + + /** @test */ + public function call_httpCode_400_responseContentType_application_scim_json_zero(): void + { + self::expectException(ErrorSchemas\ScimError::class); + $response = new Response(400, ['Content-Type' => 'application/scim+json'], json_encode(json_decode(Schema\ScimError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('DELETE', '/enterprises/generated/code-security/configurations/16', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->call(Internal\Operation\CodeSecurity\DeleteConfigurationForEnterprise::OPERATION_MATCH, (static function (array $data): array { + $data['enterprise'] = 'generated'; + $data['configuration_id'] = 16; + + return $data; + })([])); + } + + /** @test */ + public function operations_httpCode_400_responseContentType_application_scim_json_zero(): void + { + self::expectException(ErrorSchemas\ScimError::class); + $response = new Response(400, ['Content-Type' => 'application/scim+json'], json_encode(json_decode(Schema\ScimError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('DELETE', '/enterprises/generated/code-security/configurations/16', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->codeSecurity()->deleteConfigurationForEnterprise('generated', 16); + } + + /** @test */ + public function call_httpCode_403_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\BasicError::class); + $response = new Response(403, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\BasicError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('DELETE', '/enterprises/generated/code-security/configurations/16', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->call(Internal\Operation\CodeSecurity\DeleteConfigurationForEnterprise::OPERATION_MATCH, (static function (array $data): array { + $data['enterprise'] = 'generated'; + $data['configuration_id'] = 16; + + return $data; + })([])); + } + + /** @test */ + public function operations_httpCode_403_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\BasicError::class); + $response = new Response(403, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\BasicError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('DELETE', '/enterprises/generated/code-security/configurations/16', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->codeSecurity()->deleteConfigurationForEnterprise('generated', 16); + } + + /** @test */ + public function call_httpCode_404_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\BasicError::class); + $response = new Response(404, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\BasicError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('DELETE', '/enterprises/generated/code-security/configurations/16', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->call(Internal\Operation\CodeSecurity\DeleteConfigurationForEnterprise::OPERATION_MATCH, (static function (array $data): array { + $data['enterprise'] = 'generated'; + $data['configuration_id'] = 16; + + return $data; + })([])); + } + + /** @test */ + public function operations_httpCode_404_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\BasicError::class); + $response = new Response(404, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\BasicError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('DELETE', '/enterprises/generated/code-security/configurations/16', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->codeSecurity()->deleteConfigurationForEnterprise('generated', 16); + } + + /** @test */ + public function call_httpCode_409_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\BasicError::class); + $response = new Response(409, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\BasicError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('DELETE', '/enterprises/generated/code-security/configurations/16', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->call(Internal\Operation\CodeSecurity\DeleteConfigurationForEnterprise::OPERATION_MATCH, (static function (array $data): array { + $data['enterprise'] = 'generated'; + $data['configuration_id'] = 16; + + return $data; + })([])); + } + + /** @test */ + public function operations_httpCode_409_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\BasicError::class); + $response = new Response(409, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\BasicError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('DELETE', '/enterprises/generated/code-security/configurations/16', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->codeSecurity()->deleteConfigurationForEnterprise('generated', 16); + } + + /** @test */ + public function call_httpCode_204_empty(): void + { + $response = new Response(204, []); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('DELETE', '/enterprises/generated/code-security/configurations/16', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->call(Internal\Operation\CodeSecurity\DeleteConfigurationForEnterprise::OPERATION_MATCH, (static function (array $data): array { + $data['enterprise'] = 'generated'; + $data['configuration_id'] = 16; + + return $data; + })([])); + } + + /** @test */ + public function operations_httpCode_204_empty(): void + { + $response = new Response(204, []); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('DELETE', '/enterprises/generated/code-security/configurations/16', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->codeSecurity()->deleteConfigurationForEnterprise('generated', 16); + self::assertArrayHasKey('code', $result); + self::assertSame(204, $result['code']); + } +} diff --git a/clients/GitHub/tests/Internal/Operation/CodeSecurity/GetConfigurationsForEnterpriseTest.php b/clients/GitHub/tests/Internal/Operation/CodeSecurity/GetConfigurationsForEnterpriseTest.php new file mode 100644 index 00000000000..940e6fb7536 --- /dev/null +++ b/clients/GitHub/tests/Internal/Operation/CodeSecurity/GetConfigurationsForEnterpriseTest.php @@ -0,0 +1,97 @@ + 'application/json'], json_encode(json_decode(Schema\BasicError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/enterprises/generated/code-security/configurations?before=generated&after=generated&per_page=8', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->call(Internal\Operation\CodeSecurity\GetConfigurationsForEnterprise::OPERATION_MATCH, (static function (array $data): array { + $data['enterprise'] = 'generated'; + $data['before'] = 'generated'; + $data['after'] = 'generated'; + $data['per_page'] = 8; + + return $data; + })([])); + } + + /** @test */ + public function operations_httpCode_403_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\BasicError::class); + $response = new Response(403, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\BasicError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/enterprises/generated/code-security/configurations?before=generated&after=generated&per_page=8', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->codeSecurity()->getConfigurationsForEnterprise('generated', 'generated', 'generated', 8); + } + + /** @test */ + public function call_httpCode_404_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\BasicError::class); + $response = new Response(404, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\BasicError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/enterprises/generated/code-security/configurations?before=generated&after=generated&per_page=8', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->call(Internal\Operation\CodeSecurity\GetConfigurationsForEnterprise::OPERATION_MATCH, (static function (array $data): array { + $data['enterprise'] = 'generated'; + $data['before'] = 'generated'; + $data['after'] = 'generated'; + $data['per_page'] = 8; + + return $data; + })([])); + } + + /** @test */ + public function operations_httpCode_404_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\BasicError::class); + $response = new Response(404, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\BasicError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/enterprises/generated/code-security/configurations?before=generated&after=generated&per_page=8', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->codeSecurity()->getConfigurationsForEnterprise('generated', 'generated', 'generated', 8); + } +} diff --git a/clients/GitHub/tests/Internal/Operation/CodeSecurity/GetDefaultConfigurationsForEnterpriseTest.php b/clients/GitHub/tests/Internal/Operation/CodeSecurity/GetDefaultConfigurationsForEnterpriseTest.php new file mode 100644 index 00000000000..aa3ac2e2389 --- /dev/null +++ b/clients/GitHub/tests/Internal/Operation/CodeSecurity/GetDefaultConfigurationsForEnterpriseTest.php @@ -0,0 +1,12 @@ + 'application/json'], json_encode(json_decode(Schema\BasicError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/enterprises/generated/code-security/configurations/16/repositories?before=generated&after=generated&per_page=8&status=generated', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->call(Internal\Operation\CodeSecurity\GetRepositoriesForEnterpriseConfiguration::OPERATION_MATCH, (static function (array $data): array { + $data['enterprise'] = 'generated'; + $data['configuration_id'] = 16; + $data['before'] = 'generated'; + $data['after'] = 'generated'; + $data['per_page'] = 8; + $data['status'] = 'generated'; + + return $data; + })([])); + } + + /** @test */ + public function operations_httpCode_403_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\BasicError::class); + $response = new Response(403, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\BasicError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/enterprises/generated/code-security/configurations/16/repositories?before=generated&after=generated&per_page=8&status=generated', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->codeSecurity()->getRepositoriesForEnterpriseConfiguration('generated', 16, 'generated', 'generated', 8, 'generated'); + } + + /** @test */ + public function call_httpCode_404_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\BasicError::class); + $response = new Response(404, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\BasicError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/enterprises/generated/code-security/configurations/16/repositories?before=generated&after=generated&per_page=8&status=generated', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->call(Internal\Operation\CodeSecurity\GetRepositoriesForEnterpriseConfiguration::OPERATION_MATCH, (static function (array $data): array { + $data['enterprise'] = 'generated'; + $data['configuration_id'] = 16; + $data['before'] = 'generated'; + $data['after'] = 'generated'; + $data['per_page'] = 8; + $data['status'] = 'generated'; + + return $data; + })([])); + } + + /** @test */ + public function operations_httpCode_404_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\BasicError::class); + $response = new Response(404, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\BasicError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/enterprises/generated/code-security/configurations/16/repositories?before=generated&after=generated&per_page=8&status=generated', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->codeSecurity()->getRepositoriesForEnterpriseConfiguration('generated', 16, 'generated', 'generated', 8, 'generated'); + } +} diff --git a/clients/GitHub/tests/Internal/Operation/CodeSecurity/GetSingleConfigurationForEnterpriseTest.php b/clients/GitHub/tests/Internal/Operation/CodeSecurity/GetSingleConfigurationForEnterpriseTest.php new file mode 100644 index 00000000000..b539d9e5d53 --- /dev/null +++ b/clients/GitHub/tests/Internal/Operation/CodeSecurity/GetSingleConfigurationForEnterpriseTest.php @@ -0,0 +1,161 @@ + 'application/json'], json_encode(json_decode(Schema\CodeSecurityConfiguration::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/enterprises/generated/code-security/configurations/16', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->call(Internal\Operation\CodeSecurity\GetSingleConfigurationForEnterprise::OPERATION_MATCH, (static function (array $data): array { + $data['enterprise'] = 'generated'; + $data['configuration_id'] = 16; + + return $data; + })([])); + } + + /** @test */ + public function operations_httpCode_200_responseContentType_application_json_zero(): void + { + $response = new Response(200, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\CodeSecurityConfiguration::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/enterprises/generated/code-security/configurations/16', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->codeSecurity()->getSingleConfigurationForEnterprise('generated', 16); + } + + /** @test */ + public function call_httpCode_403_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\BasicError::class); + $response = new Response(403, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\BasicError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/enterprises/generated/code-security/configurations/16', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->call(Internal\Operation\CodeSecurity\GetSingleConfigurationForEnterprise::OPERATION_MATCH, (static function (array $data): array { + $data['enterprise'] = 'generated'; + $data['configuration_id'] = 16; + + return $data; + })([])); + } + + /** @test */ + public function operations_httpCode_403_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\BasicError::class); + $response = new Response(403, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\BasicError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/enterprises/generated/code-security/configurations/16', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->codeSecurity()->getSingleConfigurationForEnterprise('generated', 16); + } + + /** @test */ + public function call_httpCode_404_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\BasicError::class); + $response = new Response(404, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\BasicError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/enterprises/generated/code-security/configurations/16', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->call(Internal\Operation\CodeSecurity\GetSingleConfigurationForEnterprise::OPERATION_MATCH, (static function (array $data): array { + $data['enterprise'] = 'generated'; + $data['configuration_id'] = 16; + + return $data; + })([])); + } + + /** @test */ + public function operations_httpCode_404_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\BasicError::class); + $response = new Response(404, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\BasicError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/enterprises/generated/code-security/configurations/16', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->codeSecurity()->getSingleConfigurationForEnterprise('generated', 16); + } + + /** @test */ + public function call_httpCode_304_empty(): void + { + $response = new Response(304, []); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/enterprises/generated/code-security/configurations/16', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->call(Internal\Operation\CodeSecurity\GetSingleConfigurationForEnterprise::OPERATION_MATCH, (static function (array $data): array { + $data['enterprise'] = 'generated'; + $data['configuration_id'] = 16; + + return $data; + })([])); + } + + /** @test */ + public function operations_httpCode_304_empty(): void + { + $response = new Response(304, []); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/enterprises/generated/code-security/configurations/16', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->codeSecurity()->getSingleConfigurationForEnterprise('generated', 16); + self::assertArrayHasKey('code', $result); + self::assertSame(304, $result['code']); + } +} diff --git a/clients/GitHub/tests/Internal/Operation/CodeSecurity/SetConfigurationAsDefaultForEnterpriseTest.php b/clients/GitHub/tests/Internal/Operation/CodeSecurity/SetConfigurationAsDefaultForEnterpriseTest.php new file mode 100644 index 00000000000..4d33115f65d --- /dev/null +++ b/clients/GitHub/tests/Internal/Operation/CodeSecurity/SetConfigurationAsDefaultForEnterpriseTest.php @@ -0,0 +1,126 @@ + 'application/json'], json_encode(json_decode(Schema\Operations\CodeSecurity\SetConfigurationAsDefaultForEnterprise\Response\ApplicationJson\Ok::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('PUT', '/enterprises/generated/code-security/configurations/16/defaults', Argument::type('array'), json_encode(json_decode(Schema\CodeSecurity\SetConfigurationAsDefaultForEnterprise\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)))->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->call(Internal\Operation\CodeSecurity\SetConfigurationAsDefaultForEnterprise::OPERATION_MATCH, (static function (array $data): array { + $data['enterprise'] = 'generated'; + $data['configuration_id'] = 16; + + return $data; + })(json_decode(Schema\CodeSecurity\SetConfigurationAsDefaultForEnterprise\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true))); + } + + /** @test */ + public function operations_httpCode_200_requestContentType_application_json_responseContentType_application_json_zero(): void + { + $response = new Response(200, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\Operations\CodeSecurity\SetConfigurationAsDefaultForEnterprise\Response\ApplicationJson\Ok::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('PUT', '/enterprises/generated/code-security/configurations/16/defaults', Argument::type('array'), json_encode(json_decode(Schema\CodeSecurity\SetConfigurationAsDefaultForEnterprise\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)))->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->codeSecurity()->setConfigurationAsDefaultForEnterprise('generated', 16, json_decode(Schema\CodeSecurity\SetConfigurationAsDefaultForEnterprise\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)); + } + + /** @test */ + public function call_httpCode_403_requestContentType_application_json_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\BasicError::class); + $response = new Response(403, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\BasicError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('PUT', '/enterprises/generated/code-security/configurations/16/defaults', Argument::type('array'), json_encode(json_decode(Schema\CodeSecurity\SetConfigurationAsDefaultForEnterprise\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)))->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->call(Internal\Operation\CodeSecurity\SetConfigurationAsDefaultForEnterprise::OPERATION_MATCH, (static function (array $data): array { + $data['enterprise'] = 'generated'; + $data['configuration_id'] = 16; + + return $data; + })(json_decode(Schema\CodeSecurity\SetConfigurationAsDefaultForEnterprise\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true))); + } + + /** @test */ + public function operations_httpCode_403_requestContentType_application_json_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\BasicError::class); + $response = new Response(403, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\BasicError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('PUT', '/enterprises/generated/code-security/configurations/16/defaults', Argument::type('array'), json_encode(json_decode(Schema\CodeSecurity\SetConfigurationAsDefaultForEnterprise\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)))->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->codeSecurity()->setConfigurationAsDefaultForEnterprise('generated', 16, json_decode(Schema\CodeSecurity\SetConfigurationAsDefaultForEnterprise\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)); + } + + /** @test */ + public function call_httpCode_404_requestContentType_application_json_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\BasicError::class); + $response = new Response(404, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\BasicError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('PUT', '/enterprises/generated/code-security/configurations/16/defaults', Argument::type('array'), json_encode(json_decode(Schema\CodeSecurity\SetConfigurationAsDefaultForEnterprise\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)))->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->call(Internal\Operation\CodeSecurity\SetConfigurationAsDefaultForEnterprise::OPERATION_MATCH, (static function (array $data): array { + $data['enterprise'] = 'generated'; + $data['configuration_id'] = 16; + + return $data; + })(json_decode(Schema\CodeSecurity\SetConfigurationAsDefaultForEnterprise\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true))); + } + + /** @test */ + public function operations_httpCode_404_requestContentType_application_json_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\BasicError::class); + $response = new Response(404, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\BasicError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('PUT', '/enterprises/generated/code-security/configurations/16/defaults', Argument::type('array'), json_encode(json_decode(Schema\CodeSecurity\SetConfigurationAsDefaultForEnterprise\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)))->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->codeSecurity()->setConfigurationAsDefaultForEnterprise('generated', 16, json_decode(Schema\CodeSecurity\SetConfigurationAsDefaultForEnterprise\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)); + } +} diff --git a/clients/GitHub/tests/Internal/Operation/CodeSecurity/SetConfigurationAsDefaultTest.php b/clients/GitHub/tests/Internal/Operation/CodeSecurity/SetConfigurationAsDefaultTest.php index df789d6ab24..75d992ac4a2 100644 --- a/clients/GitHub/tests/Internal/Operation/CodeSecurity/SetConfigurationAsDefaultTest.php +++ b/clients/GitHub/tests/Internal/Operation/CodeSecurity/SetConfigurationAsDefaultTest.php @@ -24,7 +24,7 @@ final class SetConfigurationAsDefaultTest extends AsyncTestCase /** @test */ public function call_httpCode_200_requestContentType_application_json_responseContentType_application_json_zero(): void { - $response = new Response(200, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\Operations\CodeSecurity\SetConfigurationAsDefault\Response\ApplicationJson\Ok::SCHEMA_EXAMPLE_DATA, true))); + $response = new Response(200, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\Operations\CodeSecurity\SetConfigurationAsDefault\Response\ApplicationJson\Ok\Application\Json::SCHEMA_EXAMPLE_DATA, true))); $auth = $this->prophesize(AuthenticationInterface::class); $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); $browser = $this->prophesize(Browser::class); @@ -43,7 +43,7 @@ public function call_httpCode_200_requestContentType_application_json_responseCo /** @test */ public function operations_httpCode_200_requestContentType_application_json_responseContentType_application_json_zero(): void { - $response = new Response(200, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\Operations\CodeSecurity\SetConfigurationAsDefault\Response\ApplicationJson\Ok::SCHEMA_EXAMPLE_DATA, true))); + $response = new Response(200, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\Operations\CodeSecurity\SetConfigurationAsDefault\Response\ApplicationJson\Ok\Application\Json::SCHEMA_EXAMPLE_DATA, true))); $auth = $this->prophesize(AuthenticationInterface::class); $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); $browser = $this->prophesize(Browser::class); diff --git a/clients/GitHub/tests/Internal/Operation/CodeSecurity/UpdateEnterpriseConfigurationTest.php b/clients/GitHub/tests/Internal/Operation/CodeSecurity/UpdateEnterpriseConfigurationTest.php new file mode 100644 index 00000000000..858e56abb49 --- /dev/null +++ b/clients/GitHub/tests/Internal/Operation/CodeSecurity/UpdateEnterpriseConfigurationTest.php @@ -0,0 +1,196 @@ + 'application/json'], json_encode(json_decode(Schema\CodeSecurityConfiguration::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('PATCH', '/enterprises/generated/code-security/configurations/16', Argument::type('array'), json_encode(json_decode(Schema\CodeSecurity\UpdateEnterpriseConfiguration\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)))->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->call(Internal\Operation\CodeSecurity\UpdateEnterpriseConfiguration::OPERATION_MATCH, (static function (array $data): array { + $data['enterprise'] = 'generated'; + $data['configuration_id'] = 16; + + return $data; + })(json_decode(Schema\CodeSecurity\UpdateEnterpriseConfiguration\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true))); + } + + /** @test */ + public function operations_httpCode_200_requestContentType_application_json_responseContentType_application_json_zero(): void + { + $response = new Response(200, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\CodeSecurityConfiguration::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('PATCH', '/enterprises/generated/code-security/configurations/16', Argument::type('array'), json_encode(json_decode(Schema\CodeSecurity\UpdateEnterpriseConfiguration\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)))->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->codeSecurity()->updateEnterpriseConfiguration('generated', 16, json_decode(Schema\CodeSecurity\UpdateEnterpriseConfiguration\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)); + } + + /** @test */ + public function call_httpCode_403_requestContentType_application_json_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\BasicError::class); + $response = new Response(403, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\BasicError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('PATCH', '/enterprises/generated/code-security/configurations/16', Argument::type('array'), json_encode(json_decode(Schema\CodeSecurity\UpdateEnterpriseConfiguration\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)))->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->call(Internal\Operation\CodeSecurity\UpdateEnterpriseConfiguration::OPERATION_MATCH, (static function (array $data): array { + $data['enterprise'] = 'generated'; + $data['configuration_id'] = 16; + + return $data; + })(json_decode(Schema\CodeSecurity\UpdateEnterpriseConfiguration\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true))); + } + + /** @test */ + public function operations_httpCode_403_requestContentType_application_json_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\BasicError::class); + $response = new Response(403, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\BasicError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('PATCH', '/enterprises/generated/code-security/configurations/16', Argument::type('array'), json_encode(json_decode(Schema\CodeSecurity\UpdateEnterpriseConfiguration\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)))->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->codeSecurity()->updateEnterpriseConfiguration('generated', 16, json_decode(Schema\CodeSecurity\UpdateEnterpriseConfiguration\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)); + } + + /** @test */ + public function call_httpCode_404_requestContentType_application_json_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\BasicError::class); + $response = new Response(404, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\BasicError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('PATCH', '/enterprises/generated/code-security/configurations/16', Argument::type('array'), json_encode(json_decode(Schema\CodeSecurity\UpdateEnterpriseConfiguration\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)))->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->call(Internal\Operation\CodeSecurity\UpdateEnterpriseConfiguration::OPERATION_MATCH, (static function (array $data): array { + $data['enterprise'] = 'generated'; + $data['configuration_id'] = 16; + + return $data; + })(json_decode(Schema\CodeSecurity\UpdateEnterpriseConfiguration\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true))); + } + + /** @test */ + public function operations_httpCode_404_requestContentType_application_json_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\BasicError::class); + $response = new Response(404, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\BasicError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('PATCH', '/enterprises/generated/code-security/configurations/16', Argument::type('array'), json_encode(json_decode(Schema\CodeSecurity\UpdateEnterpriseConfiguration\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)))->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->codeSecurity()->updateEnterpriseConfiguration('generated', 16, json_decode(Schema\CodeSecurity\UpdateEnterpriseConfiguration\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)); + } + + /** @test */ + public function call_httpCode_409_requestContentType_application_json_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\BasicError::class); + $response = new Response(409, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\BasicError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('PATCH', '/enterprises/generated/code-security/configurations/16', Argument::type('array'), json_encode(json_decode(Schema\CodeSecurity\UpdateEnterpriseConfiguration\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)))->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->call(Internal\Operation\CodeSecurity\UpdateEnterpriseConfiguration::OPERATION_MATCH, (static function (array $data): array { + $data['enterprise'] = 'generated'; + $data['configuration_id'] = 16; + + return $data; + })(json_decode(Schema\CodeSecurity\UpdateEnterpriseConfiguration\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true))); + } + + /** @test */ + public function operations_httpCode_409_requestContentType_application_json_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\BasicError::class); + $response = new Response(409, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\BasicError::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('PATCH', '/enterprises/generated/code-security/configurations/16', Argument::type('array'), json_encode(json_decode(Schema\CodeSecurity\UpdateEnterpriseConfiguration\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)))->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->codeSecurity()->updateEnterpriseConfiguration('generated', 16, json_decode(Schema\CodeSecurity\UpdateEnterpriseConfiguration\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)); + } + + /** @test */ + public function call_httpCode_304_requestContentType_application_json_empty(): void + { + $response = new Response(304, []); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('PATCH', '/enterprises/generated/code-security/configurations/16', Argument::type('array'), json_encode(json_decode(Schema\CodeSecurity\UpdateEnterpriseConfiguration\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)))->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->call(Internal\Operation\CodeSecurity\UpdateEnterpriseConfiguration::OPERATION_MATCH, (static function (array $data): array { + $data['enterprise'] = 'generated'; + $data['configuration_id'] = 16; + + return $data; + })(json_decode(Schema\CodeSecurity\UpdateEnterpriseConfiguration\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true))); + } + + /** @test */ + public function operations_httpCode_304_requestContentType_application_json_empty(): void + { + $response = new Response(304, []); + $auth = $this->prophesize(AuthenticationInterface::class); + $auth->authHeader(Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(Browser::class); + $browser->withBase(Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal()); + $browser->request('PATCH', '/enterprises/generated/code-security/configurations/16', Argument::type('array'), json_encode(json_decode(Schema\CodeSecurity\UpdateEnterpriseConfiguration\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)))->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->codeSecurity()->updateEnterpriseConfiguration('generated', 16, json_decode(Schema\CodeSecurity\UpdateEnterpriseConfiguration\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)); + self::assertArrayHasKey('code', $result); + self::assertSame(304, $result['code']); + } +} diff --git a/clients/GitHub/tests/Types/ClientCallReturnTypes.php b/clients/GitHub/tests/Types/ClientCallReturnTypes.php index 92e7af21565..4a7069dc24d 100644 --- a/clients/GitHub/tests/Types/ClientCallReturnTypes.php +++ b/clients/GitHub/tests/Types/ClientCallReturnTypes.php @@ -54,6 +54,15 @@ function authHeader(): string assertType('Observable|WithoutBody', $client->call('GET /codes_of_conduct')); assertType('', $client->call('GET /codes_of_conduct/{key}')); assertType('', $client->call('GET /emojis')); +assertType('iterable', $client->call('GET /enterprises/{enterprise}/code-security/configurations')); +assertType('Schema\\CodeSecurityConfiguration', $client->call('POST /enterprises/{enterprise}/code-security/configurations')); +assertType('iterable', $client->call('GET /enterprises/{enterprise}/code-security/configurations/defaults')); +assertType('Schema\\CodeSecurityConfiguration|\\ApiClients\\Tools\\OpenApiClient\\Utils\\Response\\WithoutBody', $client->call('GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}')); +assertType('\\ApiClients\\Tools\\OpenApiClient\\Utils\\Response\\WithoutBody', $client->call('DELETE /enterprises/{enterprise}/code-security/configurations/{configuration_id}')); +assertType('Schema\\CodeSecurityConfiguration|\\ApiClients\\Tools\\OpenApiClient\\Utils\\Response\\WithoutBody', $client->call('PATCH /enterprises/{enterprise}/code-security/configurations/{configuration_id}')); +assertType('Schema\\Operations\\CodeSecurity\\AttachEnterpriseConfiguration\\Response\\ApplicationJson\\Accepted\\Application\\Json', $client->call('POST /enterprises/{enterprise}/code-security/configurations/{configuration_id}/attach')); +assertType('Schema\\Operations\\CodeSecurity\\SetConfigurationAsDefaultForEnterprise\\Response\\ApplicationJson\\Ok', $client->call('PUT /enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults')); +assertType('iterable', $client->call('GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories')); assertType('Observable|WithoutBody', $client->call('GET /enterprises/{enterprise}/dependabot/alerts')); assertType('Observable', $client->call('GET /enterprises/{enterprise}/secret-scanning/alerts')); assertType('Observable|WithoutBody', $client->call('GET /events')); @@ -196,7 +205,7 @@ function authHeader(): string assertType('', $client->call('DELETE /orgs/{org}/code-security/configurations/{configuration_id}')); assertType('', $client->call('PATCH /orgs/{org}/code-security/configurations/{configuration_id}')); assertType('', $client->call('POST /orgs/{org}/code-security/configurations/{configuration_id}/attach')); -assertType('', $client->call('PUT /orgs/{org}/code-security/configurations/{configuration_id}/defaults')); +assertType('Schema\\Operations\\CodeSecurity\\SetConfigurationAsDefault\\Response\\ApplicationJson\\Ok\\Application\\Json', $client->call('PUT /orgs/{org}/code-security/configurations/{configuration_id}/defaults')); assertType('Observable', $client->call('GET /orgs/{org}/code-security/configurations/{configuration_id}/repositories')); assertType('', $client->call('GET /orgs/{org}/codespaces')); assertType('', $client->call('PUT /orgs/{org}/codespaces/access')); @@ -586,6 +595,9 @@ function authHeader(): string assertType('Observable|WithoutBody', $client->call('LIST /repos/{owner}/{repo}/code-scanning/alerts')); assertType('', $client->call('GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}')); assertType('', $client->call('PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}')); +assertType('Schema\\CodeScanningAutofix', $client->call('GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix')); +assertType('Schema\\CodeScanningAutofix|\\ApiClients\\Tools\\OpenApiClient\\Utils\\Response\\WithoutBody', $client->call('POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix')); +assertType('Schema\\CodeScanningAutofixCommitsResponse|\\ApiClients\\Tools\\OpenApiClient\\Utils\\Response\\WithoutBody', $client->call('POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/commits')); assertType('Observable', $client->call('GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances')); assertType('Observable', $client->call('LIST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances')); assertType('Observable', $client->call('GET /repos/{owner}/{repo}/code-scanning/analyses')); diff --git a/etc/specs/GitHub/current.spec.yaml b/etc/specs/GitHub/current.spec.yaml index 4c5e494e3ee..dede8955802 100644 --- a/etc/specs/GitHub/current.spec.yaml +++ b/etc/specs/GitHub/current.spec.yaml @@ -1433,6 +1433,685 @@ paths: enabledForGitHubApps: true category: emojis subcategory: emojis + "/enterprises/{enterprise}/code-security/configurations": + get: + summary: Get code security configurations for an enterprise + description: |- + Lists all code security configurations available in an enterprise. + + The authenticated user must be an administrator of the enterprise in order to use this endpoint. + + OAuth app tokens and personal access tokens (classic) need the `read:enterprise` scope to use this endpoint. + tags: + - code-security + operationId: code-security/get-configurations-for-enterprise + externalDocs: + description: API method documentation + url: https://docs.github.com/rest/code-security/configurations#get-code-security-configurations-for-an-enterprise + parameters: + - "$ref": "#/components/parameters/enterprise" + - name: per_page + in: query + description: 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)." + required: false + schema: + type: integer + default: 30 + - "$ref": "#/components/parameters/pagination-before" + - "$ref": "#/components/parameters/pagination-after" + responses: + '200': + description: Response + content: + application/json: + schema: + type: array + items: + "$ref": "#/components/schemas/code-security-configuration" + examples: + default: + "$ref": "#/components/examples/enterprise-code-security-configuration-list" + '403': + "$ref": "#/components/responses/forbidden" + '404': + "$ref": "#/components/responses/not_found" + x-github: + githubCloudOnly: false + enabledForGitHubApps: false + category: code-security + subcategory: configurations + post: + summary: Create a code security configuration for an enterprise + description: |- + Creates a code security configuration in an enterprise. + + The authenticated user must be an administrator of the enterprise in order to use this endpoint. + + OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. + tags: + - code-security + operationId: code-security/create-configuration-for-enterprise + externalDocs: + description: API method documentation + url: https://docs.github.com/rest/code-security/configurations#create-a-code-security-configuration-for-an-enterprise + parameters: + - "$ref": "#/components/parameters/enterprise" + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: false + properties: + name: + type: string + description: The name of the code security configuration. Must be + unique within the enterprise. + description: + type: string + description: A description of the code security configuration + maxLength: 255 + advanced_security: + type: string + description: The enablement status of GitHub Advanced Security + enum: + - enabled + - disabled + default: disabled + dependency_graph: + type: string + description: The enablement status of Dependency Graph + enum: + - enabled + - disabled + - not_set + default: enabled + dependency_graph_autosubmit_action: + type: string + description: The enablement status of Automatic dependency submission + enum: + - enabled + - disabled + - not_set + default: disabled + dependency_graph_autosubmit_action_options: + type: object + description: Feature options for Automatic dependency submission + properties: + labeled_runners: + type: boolean + description: Whether to use runners labeled with 'dependency-submission' + or standard GitHub runners. + default: false + dependabot_alerts: + type: string + description: The enablement status of Dependabot alerts + enum: + - enabled + - disabled + - not_set + default: disabled + dependabot_security_updates: + type: string + description: The enablement status of Dependabot security updates + enum: + - enabled + - disabled + - not_set + default: disabled + code_scanning_default_setup: + type: string + description: The enablement status of code scanning default setup + enum: + - enabled + - disabled + - not_set + default: disabled + code_scanning_default_setup_options: + "$ref": "#/components/schemas/code-scanning-default-setup-options" + secret_scanning: + type: string + description: The enablement status of secret scanning + enum: + - enabled + - disabled + - not_set + default: disabled + secret_scanning_push_protection: + type: string + description: The enablement status of secret scanning push protection + enum: + - enabled + - disabled + - not_set + default: disabled + secret_scanning_validity_checks: + type: string + description: The enablement status of secret scanning validity checks + enum: + - enabled + - disabled + - not_set + default: disabled + secret_scanning_non_provider_patterns: + type: string + description: The enablement status of secret scanning non provider + patterns + enum: + - enabled + - disabled + - not_set + default: disabled + private_vulnerability_reporting: + type: string + description: The enablement status of private vulnerability reporting + enum: + - enabled + - disabled + - not_set + default: disabled + enforcement: + type: string + description: The enforcement status for a security configuration + enum: + - enforced + - unenforced + default: enforced + required: + - name + - description + examples: + default: + summary: Example for a code security configuration + value: + name: High rish settings + description: This is a code security configuration for octo-enterprise + advanced_security: enabled + dependabot_alerts: enabled + dependabot_security_updates: not_set + secret_scanning: enabled + responses: + '201': + description: Successfully created code security configuration + content: + application/json: + schema: + "$ref": "#/components/schemas/code-security-configuration" + examples: + default: + "$ref": "#/components/examples/enterprise-code-security-configuration" + '400': + "$ref": "#/components/responses/bad_request" + '403': + "$ref": "#/components/responses/forbidden" + '404': + "$ref": "#/components/responses/not_found" + x-github: + githubCloudOnly: false + enabledForGitHubApps: false + category: code-security + subcategory: configurations + "/enterprises/{enterprise}/code-security/configurations/defaults": + get: + summary: Get default code security configurations for an enterprise + description: |- + Lists the default code security configurations for an enterprise. + + The authenticated user must be an administrator of the enterprise in order to use this endpoint. + + OAuth app tokens and personal access tokens (classic) need the `read:enterprise` scope to use this endpoint. + tags: + - code-security + operationId: code-security/get-default-configurations-for-enterprise + externalDocs: + description: API method documentation + url: https://docs.github.com/rest/code-security/configurations#get-default-code-security-configurations-for-an-enterprise + parameters: + - "$ref": "#/components/parameters/enterprise" + responses: + '200': + description: Response + content: + application/json: + schema: + "$ref": "#/components/schemas/code-security-default-configurations" + examples: + default: + "$ref": "#/components/examples/code-security-default-configurations" + x-github: + githubCloudOnly: false + enabledForGitHubApps: true + category: code-security + subcategory: configurations + "/enterprises/{enterprise}/code-security/configurations/{configuration_id}": + get: + summary: Retrieve a code security configuration of an enterprise + description: |- + Gets a code security configuration available in an enterprise. + + The authenticated user must be an administrator of the enterprise in order to use this endpoint. + + OAuth app tokens and personal access tokens (classic) need the `read:enterprise` scope to use this endpoint. + tags: + - code-security + operationId: code-security/get-single-configuration-for-enterprise + externalDocs: + description: API method documentation + url: https://docs.github.com/rest/code-security/configurations#retrieve-a-code-security-configuration-of-an-enterprise + parameters: + - "$ref": "#/components/parameters/enterprise" + - "$ref": "#/components/parameters/configuration-id" + responses: + '200': + description: Response + content: + application/json: + schema: + "$ref": "#/components/schemas/code-security-configuration" + examples: + default: + "$ref": "#/components/examples/enterprise-code-security-configuration" + '304': + "$ref": "#/components/responses/not_modified" + '403': + "$ref": "#/components/responses/forbidden" + '404': + "$ref": "#/components/responses/not_found" + x-github: + githubCloudOnly: false + enabledForGitHubApps: false + category: code-security + subcategory: configurations + patch: + summary: Update a custom code security configuration for an enterprise + description: |- + Updates a code security configuration in an enterprise. + + The authenticated user must be an administrator of the enterprise in order to use this endpoint. + + OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. + tags: + - code-security + operationId: code-security/update-enterprise-configuration + externalDocs: + description: API method documentation + url: https://docs.github.com/rest/code-security/configurations#update-a-custom-code-security-configuration-for-an-enterprise + parameters: + - "$ref": "#/components/parameters/enterprise" + - "$ref": "#/components/parameters/configuration-id" + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: false + properties: + name: + type: string + description: The name of the code security configuration. Must be + unique across the enterprise. + description: + type: string + description: A description of the code security configuration + maxLength: 255 + advanced_security: + type: string + description: The enablement status of GitHub Advanced Security. + Must be set to enabled if you want to enable any GHAS settings. + enum: + - enabled + - disabled + dependency_graph: + type: string + description: The enablement status of Dependency Graph + enum: + - enabled + - disabled + - not_set + dependency_graph_autosubmit_action: + type: string + description: The enablement status of Automatic dependency submission + enum: + - enabled + - disabled + - not_set + dependency_graph_autosubmit_action_options: + type: object + description: Feature options for Automatic dependency submission + properties: + labeled_runners: + type: boolean + description: Whether to use runners labeled with 'dependency-submission' + or standard GitHub runners. + dependabot_alerts: + type: string + description: The enablement status of Dependabot alerts + enum: + - enabled + - disabled + - not_set + dependabot_security_updates: + type: string + description: The enablement status of Dependabot security updates + enum: + - enabled + - disabled + - not_set + code_scanning_default_setup: + type: string + description: The enablement status of code scanning default setup + enum: + - enabled + - disabled + - not_set + code_scanning_default_setup_options: + "$ref": "#/components/schemas/code-scanning-default-setup-options" + secret_scanning: + type: string + description: The enablement status of secret scanning + enum: + - enabled + - disabled + - not_set + secret_scanning_push_protection: + type: string + description: The enablement status of secret scanning push protection + enum: + - enabled + - disabled + - not_set + secret_scanning_validity_checks: + type: string + description: The enablement status of secret scanning validity checks + enum: + - enabled + - disabled + - not_set + secret_scanning_non_provider_patterns: + type: string + description: The enablement status of secret scanning non-provider + patterns + enum: + - enabled + - disabled + - not_set + private_vulnerability_reporting: + type: string + description: The enablement status of private vulnerability reporting + enum: + - enabled + - disabled + - not_set + enforcement: + type: string + description: The enforcement status for a security configuration + enum: + - enforced + - unenforced + examples: + default: + summary: Example for updating a code security configuration + value: + name: octo-enterprise recommended settings v2 + secret_scanning: disabled + code_scanning_default_setup: enabled + responses: + '200': + description: Response + content: + application/json: + schema: + "$ref": "#/components/schemas/code-security-configuration" + examples: + default: + "$ref": "#/components/examples/enterprise-code-security-configuration" + '304': + "$ref": "#/components/responses/not_modified" + '403': + "$ref": "#/components/responses/forbidden" + '404': + "$ref": "#/components/responses/not_found" + '409': + "$ref": "#/components/responses/conflict" + x-github: + githubCloudOnly: false + enabledForGitHubApps: false + category: code-security + subcategory: configurations + delete: + summary: Delete a code security configuration for an enterprise + description: |- + Deletes a code security configuration from an enterprise. + Repositories attached to the configuration will retain their settings but will no longer be associated with + the configuration. + + The authenticated user must be an administrator for the enterprise to use this endpoint. + + OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. + tags: + - code-security + operationId: code-security/delete-configuration-for-enterprise + externalDocs: + description: API method documentation + url: https://docs.github.com/rest/code-security/configurations#delete-a-code-security-configuration-for-an-enterprise + parameters: + - "$ref": "#/components/parameters/enterprise" + - "$ref": "#/components/parameters/configuration-id" + responses: + '204': + "$ref": "#/components/responses/no_content" + '400': + "$ref": "#/components/responses/bad_request" + '403': + "$ref": "#/components/responses/forbidden" + '404': + "$ref": "#/components/responses/not_found" + '409': + "$ref": "#/components/responses/conflict" + x-github: + githubCloudOnly: false + enabledForGitHubApps: false + category: code-security + subcategory: configurations + "/enterprises/{enterprise}/code-security/configurations/{configuration_id}/attach": + post: + summary: Attach an enterprise configuration to repositories + description: |- + Attaches an enterprise code security configuration to repositories. If the repositories specified are already attached to a configuration, they will be re-attached to the provided configuration. + + If insufficient GHAS licenses are available to attach the configuration to a repository, only free features will be enabled. + + The authenticated user must be an administrator for the enterprise to use this endpoint. + + OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. + tags: + - code-security + operationId: code-security/attach-enterprise-configuration + externalDocs: + description: API method documentation + url: https://docs.github.com/rest/code-security/configurations#attach-an-enterprise-configuration-to-repositories + parameters: + - "$ref": "#/components/parameters/enterprise" + - "$ref": "#/components/parameters/configuration-id" + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: false + properties: + scope: + type: string + description: The type of repositories to attach the configuration + to. `selected` means the configuration will be attached to only + the repositories specified by `selected_repository_ids` + enum: + - all + - all_without_configurations + required: + - scope + examples: + default: + summary: Example for attaching a configuration to some repositories + value: + scope: all + responses: + '202': + "$ref": "#/components/responses/accepted" + '403': + "$ref": "#/components/responses/forbidden" + '404': + "$ref": "#/components/responses/not_found" + '409': + "$ref": "#/components/responses/conflict" + x-github: + githubCloudOnly: false + enabledForGitHubApps: true + category: code-security + subcategory: configurations + "/enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults": + put: + summary: Set a code security configuration as a default for an enterprise + description: |- + Sets a code security configuration as a default to be applied to new repositories in your enterprise. + + This configuration will be applied by default to the matching repository type when created, but only for organizations within the enterprise that do not already have a default code security configuration set. + + The authenticated user must be an administrator for the enterprise to use this endpoint. + + OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. + tags: + - code-security + operationId: code-security/set-configuration-as-default-for-enterprise + externalDocs: + description: API method documentation + url: https://docs.github.com/rest/code-security/configurations#set-a-code-security-configuration-as-a-default-for-an-enterprise + parameters: + - "$ref": "#/components/parameters/enterprise" + - "$ref": "#/components/parameters/configuration-id" + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + default_for_new_repos: + type: string + description: Specify which types of repository this security configuration + should be applied to by default. + enum: + - all + - none + - private_and_internal + - public + examples: + default: + summary: Set this configuration to be enabled by default on all new + repositories. + value: + default_for_new_repos: all + responses: + '200': + description: Default successfully changed. + content: + application/json: + schema: + type: object + properties: + default_for_new_repos: + type: string + description: Specifies which types of repository this security + configuration is applied to by default. + enum: + - all + - none + - private_and_internal + - public + configuration: + "$ref": "#/components/schemas/code-security-configuration" + examples: + default: + value: + default_for_new_repos: all + configuration: + "$ref": "#/components/examples/code-security-configuration" + '403': + "$ref": "#/components/responses/forbidden" + '404': + "$ref": "#/components/responses/not_found" + x-github: + githubCloudOnly: false + enabledForGitHubApps: true + category: code-security + subcategory: configurations + "/enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories": + get: + summary: Get repositories associated with an enterprise code security configuration + description: |- + Lists the repositories associated with an enterprise code security configuration in an organization. + + The authenticated user must be an administrator of the enterprise in order to use this endpoint. + + OAuth app tokens and personal access tokens (classic) need the `read:enterprise` scope to use this endpoint. + tags: + - code-security + operationId: code-security/get-repositories-for-enterprise-configuration + externalDocs: + description: API method documentation + url: https://docs.github.com/rest/code-security/configurations#get-repositories-associated-with-an-enterprise-code-security-configuration + parameters: + - "$ref": "#/components/parameters/enterprise" + - "$ref": "#/components/parameters/configuration-id" + - name: per_page + description: 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)." + in: query + required: false + schema: + type: integer + default: 30 + - "$ref": "#/components/parameters/pagination-before" + - "$ref": "#/components/parameters/pagination-after" + - name: status + description: |- + A comma-separated list of statuses. If specified, only repositories with these attachment statuses will be returned. + + Can be: `all`, `attached`, `attaching`, `removed`, `enforced`, `failed`, `updating`, `removed_by_enterprise` + in: query + required: false + schema: + type: string + default: all + responses: + '200': + description: Response + content: + application/json: + schema: + type: array + items: + "$ref": "#/components/schemas/code-security-configuration-repositories" + examples: + default: + summary: Example of code security configuration repositories + value: + - status: attached + repository: + "$ref": "#/components/examples/simple-repository" + '403': + "$ref": "#/components/responses/forbidden" + '404': + "$ref": "#/components/responses/not_found" + x-github: + githubCloudOnly: false + enabledForGitHubApps: false + category: code-security + subcategory: configurations "/enterprises/{enterprise}/dependabot/alerts": get: summary: List Dependabot alerts for an enterprise @@ -13803,11 +14482,8 @@ paths: get: summary: List security manager teams description: |- - Lists teams that are security managers for an organization. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." - - The authenticated user must be an administrator or security manager for the organization to use this endpoint. - - OAuth app tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. + > [!WARNING] + > **Closing down notice:** This operation is closing down and will be removed starting January 1, 2026. Please use the "[Organization Roles](https://docs.github.com/rest/orgs/organization-roles)" endpoints instead. tags: - orgs operationId: orgs/list-security-manager-teams @@ -13834,15 +14510,15 @@ paths: previews: [] category: orgs subcategory: security-managers + deprecationDate: '2024-12-01' + removalDate: '2026-01-01' + deprecated: true "/orgs/{org}/security-managers/teams/{team_slug}": put: summary: Add a security manager team description: |- - Adds a team as a security manager for an organization. For more information, see "[Managing security for an organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization) for an organization." - - The authenticated user must be an administrator for the organization to use this endpoint. - - OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. + > [!WARNING] + > **Closing down notice:** This operation is closing down and will be removed starting January 1, 2026. Please use the "[Organization Roles](https://docs.github.com/rest/orgs/organization-roles)" endpoints instead. tags: - orgs operationId: orgs/add-security-manager-team @@ -13861,14 +14537,14 @@ paths: previews: [] category: orgs subcategory: security-managers + deprecationDate: '2024-12-01' + removalDate: '2026-01-01' + deprecated: true delete: summary: Remove a security manager team description: |- - Removes the security manager role from a team for an organization. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization) team from an organization." - - The authenticated user must be an administrator for the organization to use this endpoint. - - OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + > [!WARNING] + > **Closing down notice:** This operation is closing down and will be removed starting January 1, 2026. Please use the "[Organization Roles](https://docs.github.com/rest/orgs/organization-roles)" endpoints instead. tags: - orgs operationId: orgs/remove-security-manager-team @@ -13887,6 +14563,9 @@ paths: previews: [] category: orgs subcategory: security-managers + deprecationDate: '2024-12-01' + removalDate: '2026-01-01' + deprecated: true "/orgs/{org}/settings/billing/actions": get: summary: Get GitHub Actions billing for an organization @@ -23819,6 +24498,153 @@ paths: githubCloudOnly: false category: code-scanning subcategory: code-scanning + "/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix": + get: + summary: Get the status of an autofix for a code scanning alert + description: |- + Gets the status and description of an autofix for a code scanning alert. + + OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. + tags: + - code-scanning + operationId: code-scanning/get-autofix + externalDocs: + description: API method documentation + url: https://docs.github.com/rest/code-scanning/code-scanning#get-the-status-of-an-autofix-for-a-code-scanning-alert + parameters: + - "$ref": "#/components/parameters/owner" + - "$ref": "#/components/parameters/repo" + - "$ref": "#/components/parameters/alert-number" + responses: + '200': + description: Response + content: + application/json: + schema: + "$ref": "#/components/schemas/code-scanning-autofix" + examples: + default: + "$ref": "#/components/examples/code-scanning-autofix" + '400': + "$ref": "#/components/responses/code_scanning_bad_request" + '403': + "$ref": "#/components/responses/code_scanning_forbidden_read" + '404': + "$ref": "#/components/responses/not_found" + '503': + "$ref": "#/components/responses/service_unavailable" + x-github: + githubCloudOnly: false + enabledForGitHubApps: true + category: code-scanning + subcategory: code-scanning + post: + summary: Create an autofix for a code scanning alert + description: |- + Creates an autofix for a code scanning alert. + + If a new autofix is to be created as a result of this request or is currently being generated, then this endpoint will return a 202 Accepted response. + + If an autofix already exists for a given alert, then this endpoint will return a 200 OK response. + + OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. + tags: + - code-scanning + operationId: code-scanning/create-autofix + externalDocs: + description: API method documentation + url: https://docs.github.com/rest/code-scanning/code-scanning#create-an-autofix-for-a-code-scanning-alert + parameters: + - "$ref": "#/components/parameters/owner" + - "$ref": "#/components/parameters/repo" + - "$ref": "#/components/parameters/alert-number" + responses: + '200': + description: OK + content: + application/json: + schema: + "$ref": "#/components/schemas/code-scanning-autofix" + examples: + default: + "$ref": "#/components/examples/code-scanning-autofix" + '202': + description: Accepted + content: + application/json: + schema: + "$ref": "#/components/schemas/code-scanning-autofix" + examples: + default: + "$ref": "#/components/examples/code-scanning-autofix-pending" + '400': + "$ref": "#/components/responses/code_scanning_bad_request" + '403': + "$ref": "#/components/responses/code_scanning_autofix_create_forbidden" + '404': + "$ref": "#/components/responses/not_found" + '422': + description: Unprocessable Entity + '503': + "$ref": "#/components/responses/service_unavailable" + x-github: + githubCloudOnly: false + enabledForGitHubApps: true + category: code-scanning + subcategory: code-scanning + "/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/commits": + post: + summary: Commit an autofix for a code scanning alert + description: |- + Commits an autofix for a code scanning alert. + + If an autofix is commited as a result of this request, then this endpoint will return a 201 Created response. + + OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. + tags: + - code-scanning + operationId: code-scanning/commit-autofix + externalDocs: + description: API method documentation + url: https://docs.github.com/rest/code-scanning/code-scanning#commit-an-autofix-for-a-code-scanning-alert + parameters: + - "$ref": "#/components/parameters/owner" + - "$ref": "#/components/parameters/repo" + - "$ref": "#/components/parameters/alert-number" + requestBody: + required: false + content: + application/json: + schema: + "$ref": "#/components/schemas/code-scanning-autofix-commits" + examples: + default: + "$ref": "#/components/examples/code-scanning-autofix-commits" + responses: + '201': + description: Created + content: + application/json: + schema: + "$ref": "#/components/schemas/code-scanning-autofix-commits-response" + examples: + default: + "$ref": "#/components/examples/code-scanning-autofix-commits-response" + '400': + "$ref": "#/components/responses/code_scanning_bad_request" + '403': + "$ref": "#/components/responses/code_scanning_forbidden_write" + '404': + "$ref": "#/components/responses/not_found" + '422': + description: Unprocessable Entity + '503': + "$ref": "#/components/responses/service_unavailable" + x-github: + githubCloudOnly: false + enabledForGitHubApps: true + category: code-scanning + subcategory: code-scanning "/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances": get: summary: List instances of a code scanning alert @@ -68581,273 +69407,216 @@ components: - html_url - key - name - alert-number: - type: integer - description: The security alert number. - readOnly: true - dependabot-alert-package: + code-security-configuration: type: object - description: Details for the vulnerable package. - readOnly: true + description: A code security configuration properties: - ecosystem: - type: string - description: The package's language or package management ecosystem. - readOnly: true + id: + type: integer + description: The ID of the code security configuration name: type: string - description: The unique package name within its ecosystem. - readOnly: true - required: - - ecosystem - - name - additionalProperties: false - dependabot-alert-security-vulnerability: - type: object - description: Details pertaining to one vulnerable version range for the advisory. - readOnly: true - properties: - package: - "$ref": "#/components/schemas/dependabot-alert-package" - severity: + description: The name of the code security configuration. Must be unique + within the organization. + target_type: type: string - description: The severity of the vulnerability. - readOnly: true + description: The type of the code security configuration. enum: - - low - - medium - - high - - critical - vulnerable_version_range: - type: string - description: Conditions that identify vulnerable versions of this vulnerability's - package. - readOnly: true - first_patched_version: - type: - - object - - 'null' - description: Details pertaining to the package version that patches this - vulnerability. - readOnly: true - properties: - identifier: - type: string - description: The package version that patches this vulnerability. - readOnly: true - required: - - identifier - additionalProperties: false - required: - - package - - severity - - vulnerable_version_range - - first_patched_version - additionalProperties: false - dependabot-alert-security-advisory: - type: object - description: Details for the GitHub Security Advisory. - readOnly: true - properties: - ghsa_id: + - global + - organization + - enterprise + description: type: string - description: The unique GitHub Security Advisory ID assigned to the advisory. - readOnly: true - cve_id: - type: - - string - - 'null' - description: The unique CVE ID assigned to the advisory. - readOnly: true - summary: + description: A description of the code security configuration + advanced_security: type: string - description: A short, plain text summary of the advisory. - readOnly: true - maxLength: 1024 - description: + description: The enablement status of GitHub Advanced Security + enum: + - enabled + - disabled + dependency_graph: type: string - description: A long-form Markdown-supported description of the advisory. - readOnly: true - vulnerabilities: - type: array - description: Vulnerable version range information for the advisory. - readOnly: true - items: - "$ref": "#/components/schemas/dependabot-alert-security-vulnerability" - severity: + description: The enablement status of Dependency Graph + enum: + - enabled + - disabled + - not_set + dependency_graph_autosubmit_action: type: string - description: The severity of the advisory. - readOnly: true + description: The enablement status of Automatic dependency submission enum: - - low - - medium - - high - - critical - cvss: + - enabled + - disabled + - not_set + dependency_graph_autosubmit_action_options: type: object - description: Details for the advisory pertaining to the Common Vulnerability - Scoring System. - readOnly: true + description: Feature options for Automatic dependency submission properties: - score: - type: number - description: The overall CVSS score of the advisory. - minimum: 0 - maximum: 10 - readOnly: true - vector_string: + labeled_runners: + type: boolean + description: Whether to use runners labeled with 'dependency-submission' + or standard GitHub runners. + dependabot_alerts: + type: string + description: The enablement status of Dependabot alerts + enum: + - enabled + - disabled + - not_set + dependabot_security_updates: + type: string + description: The enablement status of Dependabot security updates + enum: + - enabled + - disabled + - not_set + code_scanning_default_setup: + type: string + description: The enablement status of code scanning default setup + enum: + - enabled + - disabled + - not_set + code_scanning_default_setup_options: + type: + - object + - 'null' + description: Feature options for code scanning default setup + properties: + runner_type: type: - string - 'null' - description: The full CVSS vector string for the advisory. - readOnly: true - required: - - score - - vector_string - additionalProperties: false - cvss_severities: - "$ref": "#/components/schemas/cvss-severities" - cwes: - type: array - description: Details for the advisory pertaining to Common Weakness Enumeration. - readOnly: true - items: - type: object - description: A CWE weakness assigned to the advisory. - readOnly: true - properties: - cwe_id: - type: string - description: The unique CWE ID. - readOnly: true - name: - type: string - description: The short, plain text name of the CWE. - readOnly: true - required: - - cwe_id - - name - additionalProperties: false - identifiers: - type: array - description: Values that identify this advisory among security information - sources. - readOnly: true - items: - type: object - description: An advisory identifier. - readOnly: true - properties: + enum: + - standard + - labeled + - not_set + - + description: Whether to use labeled runners or standard GitHub runners. + runner_label: type: - type: string - description: The type of advisory identifier. - readOnly: true - enum: - - CVE - - GHSA - value: - type: string - description: The value of the advisory identifer. - readOnly: true - required: - - value - - type - additionalProperties: false - references: - type: array - description: Links to additional advisory information. - readOnly: true - items: - type: object - description: A link to additional advisory information. - readOnly: true - properties: - url: - type: string - description: The URL of the reference. - format: uri - readOnly: true - required: - - url - additionalProperties: false - published_at: + - string + - 'null' + description: The label of the runner to use for code scanning when runner_type + is 'labeled'. + secret_scanning: + type: string + description: The enablement status of secret scanning + enum: + - enabled + - disabled + - not_set + secret_scanning_push_protection: + type: string + description: The enablement status of secret scanning push protection + enum: + - enabled + - disabled + - not_set + secret_scanning_delegated_bypass: + type: string + description: The enablement status of secret scanning delegated bypass + enum: + - enabled + - disabled + - not_set + secret_scanning_delegated_bypass_options: + type: object + description: Feature options for secret scanning delegated bypass + properties: + reviewers: + type: array + description: The bypass reviewers for secret scanning delegated bypass + items: + type: object + required: + - reviewer_id + - reviewer_type + properties: + reviewer_id: + type: integer + description: The ID of the team or role selected as a bypass reviewer + reviewer_type: + type: string + description: The type of the bypass reviewer + enum: + - TEAM + - ROLE + secret_scanning_validity_checks: + type: string + description: The enablement status of secret scanning validity checks + enum: + - enabled + - disabled + - not_set + secret_scanning_non_provider_patterns: + type: string + description: The enablement status of secret scanning non-provider patterns + enum: + - enabled + - disabled + - not_set + private_vulnerability_reporting: + type: string + description: The enablement status of private vulnerability reporting + enum: + - enabled + - disabled + - not_set + enforcement: + type: string + description: The enforcement status for a security configuration + enum: + - enforced + - unenforced + url: + type: string + format: uri + description: The URL of the configuration + html_url: + type: string + format: uri + description: The URL of the configuration + created_at: type: string - description: 'The time that the advisory was published in ISO 8601 format: - `YYYY-MM-DDTHH:MM:SSZ`.' format: date-time - readOnly: true updated_at: type: string - description: 'The time that the advisory was last modified in ISO 8601 format: - `YYYY-MM-DDTHH:MM:SSZ`.' format: date-time - readOnly: true - withdrawn_at: + code-scanning-default-setup-options: + type: + - object + - 'null' + description: Feature options for code scanning default setup + properties: + runner_type: + type: string + enum: + - standard + - labeled + - not_set + description: Whether to use labeled runners or standard GitHub runners. + runner_label: type: - string - 'null' - description: 'The time that the advisory was withdrawn in ISO 8601 format: - `YYYY-MM-DDTHH:MM:SSZ`.' - format: date-time - readOnly: true - required: - - ghsa_id - - cve_id - - summary - - description - - vulnerabilities - - severity - - cvss - - cwes - - identifiers - - references - - published_at - - updated_at - - withdrawn_at - additionalProperties: false - alert-url: - type: string - description: The REST API URL of the alert resource. - format: uri - readOnly: true - alert-html-url: - type: string - description: The GitHub URL of the alert resource. - format: uri - readOnly: true - alert-created-at: - type: string - description: 'The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`.' - format: date-time - readOnly: true - alert-updated-at: - type: string - description: 'The time that the alert was last updated in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`.' - format: date-time - readOnly: true - alert-dismissed-at: - type: - - string - - 'null' - description: 'The time that the alert was dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`.' - format: date-time - readOnly: true - alert-fixed-at: - type: - - string - - 'null' - description: 'The time that the alert was no longer detected and was considered - fixed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`.' - format: date-time - readOnly: true - alert-auto-dismissed-at: - type: - - string - - 'null' - description: 'The time that the alert was auto-dismissed in ISO 8601 format: - `YYYY-MM-DDTHH:MM:SSZ`.' - format: date-time - readOnly: true + description: The label of the runner to use for code scanning default setup + when runner_type is 'labeled'. + code-security-default-configurations: + type: array + description: A list of default code security configurations + items: + type: object + properties: + default_for_new_repos: + enum: + - public + - private_and_internal + - all + description: The visibility of newly created repositories for which the + code security configuration will be applied to by default + configuration: + "$ref": "#/components/schemas/code-security-configuration" simple-repository: title: Simple Repository description: A GitHub repository. @@ -69164,6 +69933,293 @@ components: - teams_url - trees_url - url + code-security-configuration-repositories: + type: object + description: Repositories associated with a code security configuration and + attachment status + properties: + status: + type: string + description: The attachment status of the code security configuration on + the repository. + enum: + - attached + - attaching + - detached + - removed + - enforced + - failed + - updating + - removed_by_enterprise + repository: + "$ref": "#/components/schemas/simple-repository" + alert-number: + type: integer + description: The security alert number. + readOnly: true + dependabot-alert-package: + type: object + description: Details for the vulnerable package. + readOnly: true + properties: + ecosystem: + type: string + description: The package's language or package management ecosystem. + readOnly: true + name: + type: string + description: The unique package name within its ecosystem. + readOnly: true + required: + - ecosystem + - name + additionalProperties: false + dependabot-alert-security-vulnerability: + type: object + description: Details pertaining to one vulnerable version range for the advisory. + readOnly: true + properties: + package: + "$ref": "#/components/schemas/dependabot-alert-package" + severity: + type: string + description: The severity of the vulnerability. + readOnly: true + enum: + - low + - medium + - high + - critical + vulnerable_version_range: + type: string + description: Conditions that identify vulnerable versions of this vulnerability's + package. + readOnly: true + first_patched_version: + type: + - object + - 'null' + description: Details pertaining to the package version that patches this + vulnerability. + readOnly: true + properties: + identifier: + type: string + description: The package version that patches this vulnerability. + readOnly: true + required: + - identifier + additionalProperties: false + required: + - package + - severity + - vulnerable_version_range + - first_patched_version + additionalProperties: false + dependabot-alert-security-advisory: + type: object + description: Details for the GitHub Security Advisory. + readOnly: true + properties: + ghsa_id: + type: string + description: The unique GitHub Security Advisory ID assigned to the advisory. + readOnly: true + cve_id: + type: + - string + - 'null' + description: The unique CVE ID assigned to the advisory. + readOnly: true + summary: + type: string + description: A short, plain text summary of the advisory. + readOnly: true + maxLength: 1024 + description: + type: string + description: A long-form Markdown-supported description of the advisory. + readOnly: true + vulnerabilities: + type: array + description: Vulnerable version range information for the advisory. + readOnly: true + items: + "$ref": "#/components/schemas/dependabot-alert-security-vulnerability" + severity: + type: string + description: The severity of the advisory. + readOnly: true + enum: + - low + - medium + - high + - critical + cvss: + type: object + description: Details for the advisory pertaining to the Common Vulnerability + Scoring System. + readOnly: true + properties: + score: + type: number + description: The overall CVSS score of the advisory. + minimum: 0 + maximum: 10 + readOnly: true + vector_string: + type: + - string + - 'null' + description: The full CVSS vector string for the advisory. + readOnly: true + required: + - score + - vector_string + additionalProperties: false + cvss_severities: + "$ref": "#/components/schemas/cvss-severities" + cwes: + type: array + description: Details for the advisory pertaining to Common Weakness Enumeration. + readOnly: true + items: + type: object + description: A CWE weakness assigned to the advisory. + readOnly: true + properties: + cwe_id: + type: string + description: The unique CWE ID. + readOnly: true + name: + type: string + description: The short, plain text name of the CWE. + readOnly: true + required: + - cwe_id + - name + additionalProperties: false + identifiers: + type: array + description: Values that identify this advisory among security information + sources. + readOnly: true + items: + type: object + description: An advisory identifier. + readOnly: true + properties: + type: + type: string + description: The type of advisory identifier. + readOnly: true + enum: + - CVE + - GHSA + value: + type: string + description: The value of the advisory identifer. + readOnly: true + required: + - value + - type + additionalProperties: false + references: + type: array + description: Links to additional advisory information. + readOnly: true + items: + type: object + description: A link to additional advisory information. + readOnly: true + properties: + url: + type: string + description: The URL of the reference. + format: uri + readOnly: true + required: + - url + additionalProperties: false + published_at: + type: string + description: 'The time that the advisory was published in ISO 8601 format: + `YYYY-MM-DDTHH:MM:SSZ`.' + format: date-time + readOnly: true + updated_at: + type: string + description: 'The time that the advisory was last modified in ISO 8601 format: + `YYYY-MM-DDTHH:MM:SSZ`.' + format: date-time + readOnly: true + withdrawn_at: + type: + - string + - 'null' + description: 'The time that the advisory was withdrawn in ISO 8601 format: + `YYYY-MM-DDTHH:MM:SSZ`.' + format: date-time + readOnly: true + required: + - ghsa_id + - cve_id + - summary + - description + - vulnerabilities + - severity + - cvss + - cwes + - identifiers + - references + - published_at + - updated_at + - withdrawn_at + additionalProperties: false + alert-url: + type: string + description: The REST API URL of the alert resource. + format: uri + readOnly: true + alert-html-url: + type: string + description: The GitHub URL of the alert resource. + format: uri + readOnly: true + alert-created-at: + type: string + description: 'The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`.' + format: date-time + readOnly: true + alert-updated-at: + type: string + description: 'The time that the alert was last updated in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`.' + format: date-time + readOnly: true + alert-dismissed-at: + type: + - string + - 'null' + description: 'The time that the alert was dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`.' + format: date-time + readOnly: true + alert-fixed-at: + type: + - string + - 'null' + description: 'The time that the alert was no longer detected and was considered + fixed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`.' + format: date-time + readOnly: true + alert-auto-dismissed-at: + type: + - string + - 'null' + description: 'The time that the alert was auto-dismissed in ISO 8601 format: + `YYYY-MM-DDTHH:MM:SSZ`.' + format: date-time + readOnly: true dependabot-alert-with-repository: type: object description: A Dependabot alert. @@ -71037,6 +72093,21 @@ components: type: string examples: - example.com + actions_inbound: + type: object + properties: + full_domains: + type: array + items: + type: string + examples: + - example.com + wildcard_domains: + type: array + items: + type: string + examples: + - example.com artifact_attestations: type: object properties: @@ -72766,236 +73837,6 @@ components: - tool - most_recent_instance - repository - code-security-configuration: - type: object - description: A code security configuration - properties: - id: - type: integer - description: The ID of the code security configuration - name: - type: string - description: The name of the code security configuration. Must be unique - within the organization. - target_type: - type: string - description: The type of the code security configuration. - enum: - - global - - organization - - enterprise - description: - type: string - description: A description of the code security configuration - advanced_security: - type: string - description: The enablement status of GitHub Advanced Security - enum: - - enabled - - disabled - dependency_graph: - type: string - description: The enablement status of Dependency Graph - enum: - - enabled - - disabled - - not_set - dependency_graph_autosubmit_action: - type: string - description: The enablement status of Automatic dependency submission - enum: - - enabled - - disabled - - not_set - dependency_graph_autosubmit_action_options: - type: object - description: Feature options for Automatic dependency submission - properties: - labeled_runners: - type: boolean - description: Whether to use runners labeled with 'dependency-submission' - or standard GitHub runners. - dependabot_alerts: - type: string - description: The enablement status of Dependabot alerts - enum: - - enabled - - disabled - - not_set - dependabot_security_updates: - type: string - description: The enablement status of Dependabot security updates - enum: - - enabled - - disabled - - not_set - code_scanning_default_setup: - type: string - description: The enablement status of code scanning default setup - enum: - - enabled - - disabled - - not_set - code_scanning_default_setup_options: - type: - - object - - 'null' - description: Feature options for code scanning default setup - properties: - runner_type: - type: - - string - - 'null' - enum: - - standard - - labeled - - not_set - - - description: Whether to use labeled runners or standard GitHub runners. - runner_label: - type: - - string - - 'null' - description: The label of the runner to use for code scanning when runner_type - is 'labeled'. - secret_scanning: - type: string - description: The enablement status of secret scanning - enum: - - enabled - - disabled - - not_set - secret_scanning_push_protection: - type: string - description: The enablement status of secret scanning push protection - enum: - - enabled - - disabled - - not_set - secret_scanning_delegated_bypass: - type: string - description: The enablement status of secret scanning delegated bypass - enum: - - enabled - - disabled - - not_set - secret_scanning_delegated_bypass_options: - type: object - description: Feature options for secret scanning delegated bypass - properties: - reviewers: - type: array - description: The bypass reviewers for secret scanning delegated bypass - items: - type: object - required: - - reviewer_id - - reviewer_type - properties: - reviewer_id: - type: integer - description: The ID of the team or role selected as a bypass reviewer - reviewer_type: - type: string - description: The type of the bypass reviewer - enum: - - TEAM - - ROLE - secret_scanning_validity_checks: - type: string - description: The enablement status of secret scanning validity checks - enum: - - enabled - - disabled - - not_set - secret_scanning_non_provider_patterns: - type: string - description: The enablement status of secret scanning non-provider patterns - enum: - - enabled - - disabled - - not_set - private_vulnerability_reporting: - type: string - description: The enablement status of private vulnerability reporting - enum: - - enabled - - disabled - - not_set - enforcement: - type: string - description: The enforcement status for a security configuration - enum: - - enforced - - unenforced - url: - type: string - format: uri - description: The URL of the configuration - html_url: - type: string - format: uri - description: The URL of the configuration - created_at: - type: string - format: date-time - updated_at: - type: string - format: date-time - code-scanning-default-setup-options: - type: - - object - - 'null' - description: Feature options for code scanning default setup - properties: - runner_type: - type: string - enum: - - standard - - labeled - - not_set - description: Whether to use labeled runners or standard GitHub runners. - runner_label: - type: - - string - - 'null' - description: The label of the runner to use for code scanning default setup - when runner_type is 'labeled'. - code-security-default-configurations: - type: array - description: A list of default code security configurations - items: - type: object - properties: - default_for_new_repos: - enum: - - public - - private_and_internal - - all - description: The visibility of newly created repositories for which the - code security configuration will be applied to by default - configuration: - "$ref": "#/components/schemas/code-security-configuration" - code-security-configuration-repositories: - type: object - description: Repositories associated with a code security configuration and - attachment status - properties: - status: - type: string - description: The attachment status of the code security configuration on - the repository. - enum: - - attached - - attaching - - detached - - removed - - enforced - - failed - - updating - - removed_by_enterprise - repository: - "$ref": "#/components/schemas/simple-repository" codespace-machine: type: object title: Codespace machine @@ -81973,6 +82814,62 @@ components: enum: - open - dismissed + code-scanning-autofix-status: + type: string + description: The status of an autofix. + enum: + - pending + - error + - success + - outdated + code-scanning-autofix-description: + type: + - string + - 'null' + description: The description of an autofix. + code-scanning-autofix-started-at: + type: string + description: 'The start time of an autofix in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`.' + format: date-time + readOnly: true + code-scanning-autofix: + type: object + properties: + status: + "$ref": "#/components/schemas/code-scanning-autofix-status" + description: + "$ref": "#/components/schemas/code-scanning-autofix-description" + started_at: + "$ref": "#/components/schemas/code-scanning-autofix-started-at" + required: + - status + - description + - started_at + code-scanning-autofix-commits: + description: Commit an autofix for a code scanning alert + type: + - object + - 'null' + properties: + target_ref: + description: The Git reference of target branch for the commit. Branch needs + to already exist. For more information, see "[Git References](https://git-scm.com/book/en/v2/Git-Internals-Git-References)" + in the Git documentation. + type: string + message: + description: Commit message to be used. + type: string + code-scanning-autofix-commits-response: + type: object + properties: + target_ref: + type: string + description: The Git reference of target branch for the commit. For more + information, see "[Git References](https://git-scm.com/book/en/v2/Git-Internals-Git-References)" + in the Git documentation. + sha: + type: string + description: SHA of commit with autofix. code-scanning-analysis-sarif-id: type: string description: An identifier for the upload. @@ -202005,6 +202902,244 @@ components: zombie_man: https://github.githubassets.com/images/icons/emoji/unicode/1f9df-2642.png?v8 zombie_woman: https://github.githubassets.com/images/icons/emoji/unicode/1f9df-2640.png?v8 zzz: https://github.githubassets.com/images/icons/emoji/unicode/1f4a4.png?v8 + enterprise-code-security-configuration-list: + value: + - id: 17 + target_type: global + name: GitHub recommended + description: Suggested settings for Dependabot, secret scanning, and code + scanning. + advanced_security: enabled + dependency_graph: enabled + dependency_graph_autosubmit_action: not_set + dependency_graph_autosubmit_action_options: + labeled_runners: false + dependabot_alerts: enabled + dependabot_security_updates: not_set + code_scanning_default_setup: enabled + code_scanning_default_setup_options: + runner_type: not_set + runner_label: + secret_scanning: enabled + secret_scanning_push_protection: enabled + secret_scanning_validity_checks: enabled + secret_scanning_non_provider_patterns: enabled + private_vulnerability_reporting: enabled + enforcement: enforced + url: https://api.github.com/enterprises/octo-enterprise/code-security/configurations/17 + html_url: https://github.com/organizations/octo-enterprise/settings/security_analysis/configurations/17/view + created_at: '2023-12-04T15:58:07Z' + updated_at: '2023-12-04T15:58:07Z' + - id: 1326 + target_type: enterprise + name: High risk settings + description: This is a code security configuration for octo-enterprise high + risk repositories + advanced_security: enabled + dependency_graph: enabled + dependency_graph_autosubmit_action: enabled + dependency_graph_autosubmit_action_options: + labeled_runners: false + dependabot_alerts: enabled + dependabot_security_updates: enabled + code_scanning_default_setup: enabled + code_scanning_default_setup_options: + runner_type: not_set + runner_label: + secret_scanning: enabled + secret_scanning_push_protection: enabled + secret_scanning_validity_checks: disabled + secret_scanning_non_provider_patterns: disabled + private_vulnerability_reporting: enabled + enforcement: enforced + url: https://api.github.com/enterprises/octo-enterprise/code-security/configurations/1326 + html_url: https://github.com/enterprises/octo-enterprise/settings/security_analysis/configurations/1326/edit + created_at: '2024-05-10T00:00:00Z' + updated_at: '2024-05-10T00:00:00Z' + enterprise-code-security-configuration: + value: + id: 1325 + target_type: enterprise + name: High risk settings + description: This is a code security configuration for octo-enterprise + advanced_security: enabled + dependency_graph: enabled + dependency_graph_autosubmit_action: enabled + dependency_graph_autosubmit_action_options: + labeled_runners: false + dependabot_alerts: enabled + dependabot_security_updates: not_set + code_scanning_default_setup: disabled + secret_scanning: enabled + secret_scanning_push_protection: disabled + secret_scanning_delegated_bypass: disabled + secret_scanning_validity_checks: disabled + secret_scanning_non_provider_patterns: disabled + private_vulnerability_reporting: disabled + enforcement: enforced + url: https://api.github.com/enterprises/octo-enterprise/code-security/configurations/1325 + html_url: https://github.com/enterprises/octo-enterprise/settings/security_analysis/configurations/1325/edit + created_at: '2024-05-01T00:00:00Z' + updated_at: '2024-05-01T00:00:00Z' + code-security-default-configurations: + value: + - default_for_new_repos: public + configuration: + id: 1325 + target_type: organization + name: octo-org recommended settings + description: This is a code security configuration for octo-org + advanced_security: enabled + dependency_graph: enabled + dependency_graph_autosubmit_action: not_set + dependency_graph_autosubmit_action_options: + labeled_runners: false + dependabot_alerts: enabled + dependabot_security_updates: not_set + code_scanning_default_setup: enabled + code_scanning_default_setup_options: + runner_type: not_set + runner_label: + secret_scanning: enabled + secret_scanning_push_protection: enabled + secret_scanning_delegated_bypass: enabled + secret_scanning_delegated_bypass_options: + reviewers: + - security_configuration_id: 1325 + reviewer_id: 5678 + reviewer_type: TEAM + secret_scanning_validity_checks: enabled + secret_scanning_non_provider_patterns: enabled + private_vulnerability_reporting: enabled + enforcement: enforced + url: https://api.github.com/orgs/octo-org/code-security/configurations/1325 + html_url: https://github.com/organizations/octo-org/settings/security_products/configurations/edit/1325 + created_at: '2024-05-01T00:00:00Z' + updated_at: '2024-05-01T00:00:00Z' + - default_for_new_repos: private_and_internal + configuration: + id: 17 + target_type: global + name: GitHub recommended + description: Suggested settings for Dependabot, secret scanning, and code + scanning. + advanced_security: enabled + dependency_graph: enabled + dependency_graph_autosubmit_action: not_set + dependency_graph_autosubmit_action_options: + labeled_runners: false + dependabot_alerts: enabled + dependabot_security_updates: not_set + code_scanning_default_setup: enabled + code_scanning_default_setup_options: + runner_type: not_set + runner_label: + secret_scanning: enabled + secret_scanning_push_protection: enabled + secret_scanning_delegated_bypass: disabled + secret_scanning_validity_checks: disabled + private_vulnerability_reporting: enabled + enforcement: enforced + url: https://api.github.com/orgs/octo-org/code-security/configurations/17 + html_url: https://github.com/organizations/octo-org/settings/security_products/configurations/view + created_at: '2023-12-04T15:58:07Z' + updated_at: '2023-12-04T15:58:07Z' + code-security-configuration: + value: + id: 1325 + target_type: organization + name: octo-org recommended settings + description: This is a code security configuration for octo-org + advanced_security: enabled + dependency_graph: enabled + dependency_graph_autosubmit_action: enabled + dependency_graph_autosubmit_action_options: + labeled_runners: false + dependabot_alerts: enabled + dependabot_security_updates: not_set + code_scanning_default_setup: disabled + code_scanning_default_setup_options: + runner_type: not_set + runner_label: + secret_scanning: enabled + secret_scanning_push_protection: disabled + secret_scanning_delegated_bypass: disabled + secret_scanning_validity_checks: disabled + secret_scanning_non_provider_patterns: disabled + private_vulnerability_reporting: disabled + enforcement: enforced + url: https://api.github.com/orgs/octo-org/code-security/configurations/1325 + html_url: https://github.com/organizations/octo-org/settings/security_products/configurations/edit/1325 + created_at: '2024-05-01T00:00:00Z' + updated_at: '2024-05-01T00:00:00Z' + simple-repository: + value: + id: 1296269 + node_id: MDEwOlJlcG9zaXRvcnkxMjk2MjY5 + name: Hello-World + full_name: octocat/Hello-World + owner: + login: octocat + id: 1 + node_id: MDQ6VXNlcjE= + avatar_url: https://github.com/images/error/octocat_happy.gif + gravatar_id: '' + url: https://api.github.com/users/octocat + html_url: https://github.com/octocat + followers_url: https://api.github.com/users/octocat/followers + following_url: https://api.github.com/users/octocat/following{/other_user} + gists_url: https://api.github.com/users/octocat/gists{/gist_id} + starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo} + subscriptions_url: https://api.github.com/users/octocat/subscriptions + organizations_url: https://api.github.com/users/octocat/orgs + repos_url: https://api.github.com/users/octocat/repos + events_url: https://api.github.com/users/octocat/events{/privacy} + received_events_url: https://api.github.com/users/octocat/received_events + type: User + site_admin: false + private: false + html_url: https://github.com/octocat/Hello-World + description: This your first repo! + fork: false + url: https://api.github.com/repos/octocat/Hello-World + archive_url: https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref} + assignees_url: https://api.github.com/repos/octocat/Hello-World/assignees{/user} + blobs_url: https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha} + branches_url: https://api.github.com/repos/octocat/Hello-World/branches{/branch} + collaborators_url: https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator} + comments_url: https://api.github.com/repos/octocat/Hello-World/comments{/number} + commits_url: https://api.github.com/repos/octocat/Hello-World/commits{/sha} + compare_url: https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head} + contents_url: https://api.github.com/repos/octocat/Hello-World/contents/{+path} + contributors_url: https://api.github.com/repos/octocat/Hello-World/contributors + deployments_url: https://api.github.com/repos/octocat/Hello-World/deployments + downloads_url: https://api.github.com/repos/octocat/Hello-World/downloads + events_url: https://api.github.com/repos/octocat/Hello-World/events + forks_url: https://api.github.com/repos/octocat/Hello-World/forks + git_commits_url: https://api.github.com/repos/octocat/Hello-World/git/commits{/sha} + git_refs_url: https://api.github.com/repos/octocat/Hello-World/git/refs{/sha} + git_tags_url: https://api.github.com/repos/octocat/Hello-World/git/tags{/sha} + git_url: git:github.com/octocat/Hello-World.git + issue_comment_url: https://api.github.com/repos/octocat/Hello-World/issues/comments{/number} + issue_events_url: https://api.github.com/repos/octocat/Hello-World/issues/events{/number} + issues_url: https://api.github.com/repos/octocat/Hello-World/issues{/number} + keys_url: https://api.github.com/repos/octocat/Hello-World/keys{/key_id} + labels_url: https://api.github.com/repos/octocat/Hello-World/labels{/name} + languages_url: https://api.github.com/repos/octocat/Hello-World/languages + merges_url: https://api.github.com/repos/octocat/Hello-World/merges + milestones_url: https://api.github.com/repos/octocat/Hello-World/milestones{/number} + notifications_url: https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating} + pulls_url: https://api.github.com/repos/octocat/Hello-World/pulls{/number} + releases_url: https://api.github.com/repos/octocat/Hello-World/releases{/id} + ssh_url: git@github.com:octocat/Hello-World.git + stargazers_url: https://api.github.com/repos/octocat/Hello-World/stargazers + statuses_url: https://api.github.com/repos/octocat/Hello-World/statuses/{sha} + subscribers_url: https://api.github.com/repos/octocat/Hello-World/subscribers + subscription_url: https://api.github.com/repos/octocat/Hello-World/subscription + tags_url: https://api.github.com/repos/octocat/Hello-World/tags + teams_url: https://api.github.com/repos/octocat/Hello-World/teams + trees_url: https://api.github.com/repos/octocat/Hello-World/git/trees{/sha} + hooks_url: http://api.github.com/repos/octocat/Hello-World/hooks dependabot-alerts-for-organization: value: - number: 2 @@ -205150,97 +206285,6 @@ components: html_url: https://github.com/organizations/octo-org/settings/security_products/configurations/edit/1326 created_at: '2024-05-10T00:00:00Z' updated_at: '2024-05-10T00:00:00Z' - code-security-configuration: - value: - id: 1325 - target_type: organization - name: octo-org recommended settings - description: This is a code security configuration for octo-org - advanced_security: enabled - dependency_graph: enabled - dependency_graph_autosubmit_action: enabled - dependency_graph_autosubmit_action_options: - labeled_runners: false - dependabot_alerts: enabled - dependabot_security_updates: not_set - code_scanning_default_setup: disabled - code_scanning_default_setup_options: - runner_type: not_set - runner_label: - secret_scanning: enabled - secret_scanning_push_protection: disabled - secret_scanning_delegated_bypass: disabled - secret_scanning_validity_checks: disabled - secret_scanning_non_provider_patterns: disabled - private_vulnerability_reporting: disabled - enforcement: enforced - url: https://api.github.com/orgs/octo-org/code-security/configurations/1325 - html_url: https://github.com/organizations/octo-org/settings/security_products/configurations/edit/1325 - created_at: '2024-05-01T00:00:00Z' - updated_at: '2024-05-01T00:00:00Z' - code-security-default-configurations: - value: - - default_for_new_repos: public - configuration: - id: 1325 - target_type: organization - name: octo-org recommended settings - description: This is a code security configuration for octo-org - advanced_security: enabled - dependency_graph: enabled - dependency_graph_autosubmit_action: not_set - dependency_graph_autosubmit_action_options: - labeled_runners: false - dependabot_alerts: enabled - dependabot_security_updates: not_set - code_scanning_default_setup: enabled - code_scanning_default_setup_options: - runner_type: not_set - runner_label: - secret_scanning: enabled - secret_scanning_push_protection: enabled - secret_scanning_delegated_bypass: enabled - secret_scanning_delegated_bypass_options: - reviewers: - - security_configuration_id: 1325 - reviewer_id: 5678 - reviewer_type: TEAM - secret_scanning_validity_checks: enabled - secret_scanning_non_provider_patterns: enabled - private_vulnerability_reporting: enabled - enforcement: enforced - url: https://api.github.com/orgs/octo-org/code-security/configurations/1325 - html_url: https://github.com/organizations/octo-org/settings/security_products/configurations/edit/1325 - created_at: '2024-05-01T00:00:00Z' - updated_at: '2024-05-01T00:00:00Z' - - default_for_new_repos: private_and_internal - configuration: - id: 17 - target_type: global - name: GitHub recommended - description: Suggested settings for Dependabot, secret scanning, and code - scanning. - advanced_security: enabled - dependency_graph: enabled - dependency_graph_autosubmit_action: not_set - dependency_graph_autosubmit_action_options: - labeled_runners: false - dependabot_alerts: enabled - dependabot_security_updates: not_set - code_scanning_default_setup: enabled - code_scanning_default_setup_options: - runner_type: not_set - runner_label: - secret_scanning: enabled - secret_scanning_push_protection: enabled - secret_scanning_delegated_bypass: disabled - secret_scanning_validity_checks: disabled - private_vulnerability_reporting: enabled - enforcement: enforced - url: https://api.github.com/orgs/octo-org/code-security/configurations/17 - html_url: https://github.com/organizations/octo-org/settings/security_products/configurations/view - created_at: '2023-12-04T15:58:07Z' - updated_at: '2023-12-04T15:58:07Z' code-security-configuration-updated: value: id: 1325 @@ -205269,74 +206313,6 @@ components: html_url: https://github.com/organizations/octo-org/settings/security_products/configurations/edit/1325 created_at: '2024-05-01T00:00:00Z' updated_at: '2024-05-01T00:00:00Z' - simple-repository: - value: - id: 1296269 - node_id: MDEwOlJlcG9zaXRvcnkxMjk2MjY5 - name: Hello-World - full_name: octocat/Hello-World - owner: - login: octocat - id: 1 - node_id: MDQ6VXNlcjE= - avatar_url: https://github.com/images/error/octocat_happy.gif - gravatar_id: '' - url: https://api.github.com/users/octocat - html_url: https://github.com/octocat - followers_url: https://api.github.com/users/octocat/followers - following_url: https://api.github.com/users/octocat/following{/other_user} - gists_url: https://api.github.com/users/octocat/gists{/gist_id} - starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo} - subscriptions_url: https://api.github.com/users/octocat/subscriptions - organizations_url: https://api.github.com/users/octocat/orgs - repos_url: https://api.github.com/users/octocat/repos - events_url: https://api.github.com/users/octocat/events{/privacy} - received_events_url: https://api.github.com/users/octocat/received_events - type: User - site_admin: false - private: false - html_url: https://github.com/octocat/Hello-World - description: This your first repo! - fork: false - url: https://api.github.com/repos/octocat/Hello-World - archive_url: https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref} - assignees_url: https://api.github.com/repos/octocat/Hello-World/assignees{/user} - blobs_url: https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha} - branches_url: https://api.github.com/repos/octocat/Hello-World/branches{/branch} - collaborators_url: https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator} - comments_url: https://api.github.com/repos/octocat/Hello-World/comments{/number} - commits_url: https://api.github.com/repos/octocat/Hello-World/commits{/sha} - compare_url: https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head} - contents_url: https://api.github.com/repos/octocat/Hello-World/contents/{+path} - contributors_url: https://api.github.com/repos/octocat/Hello-World/contributors - deployments_url: https://api.github.com/repos/octocat/Hello-World/deployments - downloads_url: https://api.github.com/repos/octocat/Hello-World/downloads - events_url: https://api.github.com/repos/octocat/Hello-World/events - forks_url: https://api.github.com/repos/octocat/Hello-World/forks - git_commits_url: https://api.github.com/repos/octocat/Hello-World/git/commits{/sha} - git_refs_url: https://api.github.com/repos/octocat/Hello-World/git/refs{/sha} - git_tags_url: https://api.github.com/repos/octocat/Hello-World/git/tags{/sha} - git_url: git:github.com/octocat/Hello-World.git - issue_comment_url: https://api.github.com/repos/octocat/Hello-World/issues/comments{/number} - issue_events_url: https://api.github.com/repos/octocat/Hello-World/issues/events{/number} - issues_url: https://api.github.com/repos/octocat/Hello-World/issues{/number} - keys_url: https://api.github.com/repos/octocat/Hello-World/keys{/key_id} - labels_url: https://api.github.com/repos/octocat/Hello-World/labels{/name} - languages_url: https://api.github.com/repos/octocat/Hello-World/languages - merges_url: https://api.github.com/repos/octocat/Hello-World/merges - milestones_url: https://api.github.com/repos/octocat/Hello-World/milestones{/number} - notifications_url: https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating} - pulls_url: https://api.github.com/repos/octocat/Hello-World/pulls{/number} - releases_url: https://api.github.com/repos/octocat/Hello-World/releases{/id} - ssh_url: git@github.com:octocat/Hello-World.git - stargazers_url: https://api.github.com/repos/octocat/Hello-World/stargazers - statuses_url: https://api.github.com/repos/octocat/Hello-World/statuses/{sha} - subscribers_url: https://api.github.com/repos/octocat/Hello-World/subscribers - subscription_url: https://api.github.com/repos/octocat/Hello-World/subscription - tags_url: https://api.github.com/repos/octocat/Hello-World/tags - teams_url: https://api.github.com/repos/octocat/Hello-World/teams - trees_url: https://api.github.com/repos/octocat/Hello-World/git/trees{/sha} - hooks_url: http://api.github.com/repos/octocat/Hello-World/hooks codespaces-list: value: total_count: 3 @@ -212539,6 +213515,29 @@ components: classifications: - test instances_url: https://api.github.com/repos/octocat/hello-world/code-scanning/alerts/42/instances + code-scanning-autofix: + value: + status: success + description: This fixes an XSS vulnerability by escaping the user input. + started_at: '2024-02-14T12:29:18Z' + code-scanning-bad-request: + value: + message: The alert_number is not valid + documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#get-the-status-of-an-autofix-for-a-code-scanning-alert + status: '400' + code-scanning-autofix-pending: + value: + status: pending + description: + started_at: '2024-02-14T12:29:18Z' + code-scanning-autofix-commits: + value: + target_ref: refs/heads/fix-bug + message: "Let's fix this \U0001FAB2!" + code-scanning-autofix-commits-response: + value: + target_ref: refs/heads/main + sha: 178f4f6090b3fccad4a65b3e83d076a622d59652 code-scanning-alert-instances: value: - ref: refs/heads/main @@ -226302,6 +227301,13 @@ components: required: true schema: type: string + configuration-id: + name: configuration_id + description: The unique identifier of the code security configuration. + in: path + required: true + schema: + type: integer dependabot-alert-comma-separated-states: name: state in: query @@ -226682,13 +227688,6 @@ components: required: false schema: "$ref": "#/components/schemas/code-scanning-analysis-tool-guid" - configuration-id: - name: configuration_id - description: The unique identifier of the code security configuration. - in: path - required: true - schema: - type: integer hook-id: name: hook_id description: The unique identifier of the hook. You can find this value in the @@ -227683,6 +228682,14 @@ components: application/json: schema: "$ref": "#/components/schemas/basic-error" + conflict: + description: Conflict + content: + application/json: + schema: + "$ref": "#/components/schemas/basic-error" + no_content: + description: A header with no content is returned. service_unavailable: description: Service unavailable content: @@ -227739,12 +228746,6 @@ components: application/json: schema: "$ref": "#/components/schemas/basic-error" - conflict: - description: Conflict - content: - application/json: - schema: - "$ref": "#/components/schemas/basic-error" actions_runner_jitconfig: description: Response content: @@ -227801,8 +228802,6 @@ components: examples: default: "$ref": "#/components/examples/runner-labels-readonly" - no_content: - description: A header with no content is returned. usage_metrics_api_disabled: description: Copilot Usage Merics API setting is disabled at the organization or enterprise level. @@ -227838,6 +228837,22 @@ components: application/json: schema: "$ref": "#/components/schemas/basic-error" + code_scanning_bad_request: + description: Bad Request + content: + application/json: + schema: + "$ref": "#/components/schemas/basic-error" + examples: + default: + "$ref": "#/components/examples/code-scanning-bad-request" + code_scanning_autofix_create_forbidden: + description: Response if the repository is archived, if GitHub Advanced Security + is not enabled for this repository or if rate limit is exceeded + content: + application/json: + schema: + "$ref": "#/components/schemas/basic-error" found: description: Found code_scanning_conflict: