From b0f05aa8f909fc7520b905b0f4c88ad19cbb3637 Mon Sep 17 00:00:00 2001 From: WyriHaximus <147145+WyriHaximus@users.noreply.github.com> Date: Sat, 23 Nov 2024 18:00:49 +0000 Subject: [PATCH] =?UTF-8?q?[GitHubEnterpriseCloud]=20Update=20to=201.1.4-a?= =?UTF-8?q?17f4264c506565e251516e5c4217ed8=20from=201.1.4-c004de9f6ab1478f?= =?UTF-8?q?11c99a0269aa347a=20Detected=20Schema=20changes:=202024-11-23=20?= =?UTF-8?q?17:27:17=20ERROR=20unable=20to=20open=20the=20rolodex=20file,?= =?UTF-8?q?=20check=20specification=20references=20and=20base=20path=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=E2=94=9C=20file:=20/=5F=5Fw/github-root/github-root/server-sta?= =?UTF-8?q?tistics-actions.yaml=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=E2=94=94=20error:=20open=20/=5F=5Fw?= =?UTF-8?q?/github-root/github-root/server-statistics-actions.yaml:=20no?= =?UTF-8?q?=20such=20file=20or=20directory=202024-11-23=2017:27:17=20ERROR?= =?UTF-8?q?=20unable=20to=20open=20the=20rolodex=20file,=20check=20specifi?= =?UTF-8?q?cation=20references=20and=20base=20path=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=E2=94=9C=20file:?= =?UTF-8?q?=20/=5F=5Fw/github-root/github-root/server-statistics-packages.?= =?UTF-8?q?yaml=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=E2=94=94=20error:=20open=20/=5F=5Fw/github-root/gi?= =?UTF-8?q?thub-root/server-statistics-packages.yaml:=20no=20such=20file?= =?UTF-8?q?=20or=20directory=202024-11-23=2017:27:17=20ERROR=20unable=20to?= =?UTF-8?q?=20open=20the=20rolodex=20file,=20check=20specification=20refer?= =?UTF-8?q?ences=20and=20base=20path=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=E2=94=9C=20file:=20/=5F=5Fw/g?= =?UTF-8?q?ithub-root/github-root/server-statistics-advisory-db.yaml=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=E2=94=94=20error:=20open=20/=5F=5Fw/github-root/github-root/se?= =?UTF-8?q?rver-statistics-advisory-db.yaml:=20no=20such=20file=20or=20dir?= =?UTF-8?q?ectory=202024-11-23=2017:27:19=20ERROR=20unable=20to=20open=20t?= =?UTF-8?q?he=20rolodex=20file,=20check=20specification=20references=20and?= =?UTF-8?q?=20base=20path=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=E2=94=9C=20file:=20/=5F=5Fw/github-root/g?= =?UTF-8?q?ithub-root/server-statistics-actions.yaml=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=E2=94=94=20err?= =?UTF-8?q?or:=20open=20/=5F=5Fw/github-root/github-root/server-statistics?= =?UTF-8?q?-actions.yaml:=20no=20such=20file=20or=20directory=202024-11-23?= =?UTF-8?q?=2017:27:19=20ERROR=20unable=20to=20open=20the=20rolodex=20file?= =?UTF-8?q?,=20check=20specification=20references=20and=20base=20path=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=E2=94=9C=20file:=20/=5F=5Fw/github-root/github-root/server-?= =?UTF-8?q?statistics-packages.yaml=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=E2=94=94=20error:=20open=20/=5F?= =?UTF-8?q?=5Fw/github-root/github-root/server-statistics-packages.yaml:?= =?UTF-8?q?=20no=20such=20file=20or=20directory=202024-11-23=2017:27:19=20?= =?UTF-8?q?ERROR=20unable=20to=20open=20the=20rolodex=20file,=20check=20sp?= =?UTF-8?q?ecification=20references=20and=20base=20path=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=E2=94=9C=20?= =?UTF-8?q?file:=20/=5F=5Fw/github-root/github-root/server-statistics-advi?= =?UTF-8?q?sory-db.yaml=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=E2=94=94=20error:=20open=20/=5F=5Fw/github-r?= =?UTF-8?q?oot/github-root/server-statistics-advisory-db.yaml:=20no=20such?= =?UTF-8?q?=20file=20or=20directory=20ERROR:=20component=20`server-statist?= =?UTF-8?q?ics-actions.yaml`=20does=20not=20exist=20in=20the=20specificati?= =?UTF-8?q?on=20ERROR:=20component=20`server-statistics-packages.yaml`=20d?= =?UTF-8?q?oes=20not=20exist=20in=20the=20specification=20ERROR:=20compone?= =?UTF-8?q?nt=20`server-statistics-advisory-db.yaml`=20does=20not=20exist?= =?UTF-8?q?=20in=20the=20specification=20ERROR:=20cannot=20resolve=20refer?= =?UTF-8?q?ence=20`server-statistics-actions.yaml`,=20it's=20missing:=20?= =?UTF-8?q?=20[209920:11]=20ERROR:=20cannot=20resolve=20reference=20`serve?= =?UTF-8?q?r-statistics-packages.yaml`,=20it's=20missing:=20=20[209922:11]?= =?UTF-8?q?=20ERROR:=20cannot=20resolve=20reference=20`server-statistics-a?= =?UTF-8?q?dvisory-db.yaml`,=20it's=20missing:=20=20[209924:11]=20ERROR:?= =?UTF-8?q?=20component=20`server-statistics-actions.yaml`=20does=20not=20?= =?UTF-8?q?exist=20in=20the=20specification=20ERROR:=20component=20`server?= =?UTF-8?q?-statistics-packages.yaml`=20does=20not=20exist=20in=20the=20sp?= =?UTF-8?q?ecification=20ERROR:=20component=20`server-statistics-advisory-?= =?UTF-8?q?db.yaml`=20does=20not=20exist=20in=20the=20specification=20ERRO?= =?UTF-8?q?R:=20cannot=20resolve=20reference=20`server-statistics-actions.?= =?UTF-8?q?yaml`,=20it's=20missing:=20=20[209921:11]=20ERROR:=20cannot=20r?= =?UTF-8?q?esolve=20reference=20`server-statistics-packages.yaml`,=20it's?= =?UTF-8?q?=20missing:=20=20[209923:11]=20ERROR:=20cannot=20resolve=20refe?= =?UTF-8?q?rence=20`server-statistics-advisory-db.yaml`,=20it's=20missing:?= =?UTF-8?q?=20=20[209925:11]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- clients/GitHubEnterpriseCloud/README.md | 28 + .../etc/openapi-client-generator.state | 64 +- .../Org/Settings/Billing/Usage.php | 580 ++++++++++++++++++ .../src/Internal/Hydrators.php | 10 + .../GetGithubBillingUsageReportOrg.php | 117 ++++ .../GetGithubBillingUsageReportOrg.php | 40 ++ .../EnterpriseAdmin/CreateAuditLogStream.php | 1 + .../EnterpriseAdmin/DeleteAuditLogStream.php | 1 + .../EnterpriseAdmin/GetAuditLogStreamKey.php | 1 + .../EnterpriseAdmin/GetAuditLogStreams.php | 2 +- .../EnterpriseAdmin/GetOneAuditLogStream.php | 1 + .../EnterpriseAdmin/UpdateAuditLogStream.php | 1 + .../src/Internal/Operators.php | 10 + .../Router/Delete/EnterpriseAdmin.php | 1 + .../src/Internal/Router/Delete/Six.php | 1 - .../src/Internal/Router/Get/Billing.php | 38 ++ .../Internal/Router/Get/EnterpriseAdmin.php | 4 +- .../src/Internal/Router/Get/Five.php | 2 +- .../src/Internal/Router/Get/Six.php | 14 +- .../Internal/Router/Post/EnterpriseAdmin.php | 1 + .../src/Internal/Router/Post/Five.php | 1 - .../Internal/Router/Put/EnterpriseAdmin.php | 1 + .../src/Internal/Router/Put/Six.php | 1 - .../src/Operation/Billing.php | 5 + .../src/Operation/EnterpriseAdmin.php | 7 +- .../src/PHPStan/ClientCallReturnTypes.php | 16 +- .../GetGithubBillingUsageReportOrgTest.php | 249 ++++++++ .../tests/Types/ClientCallReturnTypes.php | 13 +- .../GitHubEnterpriseCloud/current.spec.yaml | 96 +-- 29 files changed, 1218 insertions(+), 88 deletions(-) create mode 100644 clients/GitHubEnterpriseCloud/src/Internal/Hydrator/Operation/Organizations/Org/Settings/Billing/Usage.php create mode 100644 clients/GitHubEnterpriseCloud/src/Internal/Operation/Billing/GetGithubBillingUsageReportOrg.php create mode 100644 clients/GitHubEnterpriseCloud/src/Internal/Operator/Billing/GetGithubBillingUsageReportOrg.php create mode 100644 clients/GitHubEnterpriseCloud/tests/Internal/Operation/Billing/GetGithubBillingUsageReportOrgTest.php diff --git a/clients/GitHubEnterpriseCloud/README.md b/clients/GitHubEnterpriseCloud/README.md index e717848a83c..4ad0db9656a 100644 --- a/clients/GitHubEnterpriseCloud/README.md +++ b/clients/GitHubEnterpriseCloud/README.md @@ -4070,6 +4070,34 @@ $client->operations()->orgs()->listCustomRoles( organization_id: 'generat You can find more about this operation over at the [API method documentation](https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#closing-down---list-custom-repository-roles-in-an-organization). +### billing/get-github-billing-usage-report-org + +Get billing usage report for an organization + +Using the `call` method: +```php +$client->call('GET /organizations/{org}/settings/billing/usage', [ + 'org' => 'generated', + 'year' => 4, + 'month' => 5, + 'day' => 3, + 'hour' => 4, +]); +``` + +Operations method: +```php +$client->operations()->billing()->getGithubBillingUsageReportOrg( org: 'generated', + year: 4, + month: 5, + day: 3, + hour: 4, +); +``` + +You can find more about this operation over at the [API method documentation](https://docs.github.com/enterprise-cloud@latest//rest/billing/enhanced-billing#get-billing-usage-report-for-an-organization). + + ### orgs/get Get an organization diff --git a/clients/GitHubEnterpriseCloud/etc/openapi-client-generator.state b/clients/GitHubEnterpriseCloud/etc/openapi-client-generator.state index 4dbe1e7bd47..19368006fca 100644 --- a/clients/GitHubEnterpriseCloud/etc/openapi-client-generator.state +++ b/clients/GitHubEnterpriseCloud/etc/openapi-client-generator.state @@ -1,5 +1,5 @@ { - "specHash": "c004de9f6ab1478f11c99a0269aa347a", + "specHash": "a17f4264c506565e251516e5c4217ed8", "generatedFiles": { "files": [ { @@ -5880,7 +5880,7 @@ }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Operation\/EnterpriseAdmin.php", - "hash": "dca87500add5189034324181f9a779d6" + "hash": "59924982b0630b2af66c53e80fab4d4c" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Operation\/Actions.php", @@ -5904,7 +5904,7 @@ }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Operation\/Billing.php", - "hash": "966f7db10e65ae9cd5ee44b95c168b21" + "hash": "87cfdd76636567618c6a13038d88d6d5" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Operation\/Activity.php", @@ -26032,7 +26032,7 @@ }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Router\/Get\/EnterpriseAdmin.php", - "hash": "d806c29a78933ac054478bfc1bc2a080" + "hash": "d5e459b77b05c27689574e2d34874113" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Router\/Get\/AnnouncementBanners.php", @@ -26064,7 +26064,7 @@ }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Billing.php", - "hash": "6b5a2c95d462af3827ec30bc276e4a06" + "hash": "8587e66b491340c3410e73e7781aeb13" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Checks.php", @@ -26124,7 +26124,7 @@ }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Router\/Post\/EnterpriseAdmin.php", - "hash": "d961292c36a1b85376f2e08f2fb4abe4" + "hash": "e2c8ecd5c9b61e176e87b9c791015c9b" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Router\/Post\/Codespaces.php", @@ -26404,7 +26404,7 @@ }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Router\/Delete\/EnterpriseAdmin.php", - "hash": "98fb305e17b02e7503f200eb6090f205" + "hash": "50b2b38b302d5cfe69bae4c3e2ce9e50" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Router\/Delete\/Actions.php", @@ -26448,7 +26448,7 @@ }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Router\/Put\/EnterpriseAdmin.php", - "hash": "0cf5a3e855fc01efee8d39aeb2d8207f" + "hash": "e186113400ff5b9c315b46248c433830" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Router\/Put\/Activity.php", @@ -26544,11 +26544,11 @@ }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Five.php", - "hash": "4489002a005b298974703c0bdddf39ad" + "hash": "d82b73cc27be17f35716209659677b3b" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Six.php", - "hash": "d5624a79520a4b3536bd5fafb9756369" + "hash": "447986dc13673c21e65adc57e4cbbc10" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Seven.php", @@ -26576,7 +26576,7 @@ }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Router\/Post\/Five.php", - "hash": "18c9978a46acd59778f2afb571e5a227" + "hash": "15312ba97078e9b59a44d6a62bc96584" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Router\/Post\/Seven.php", @@ -26684,7 +26684,7 @@ }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Router\/Delete\/Six.php", - "hash": "b1a1a2ebcd7a15d2e4a8110e08ed5c6c" + "hash": "7dfe44551de81f1267bf544db4f97d32" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Router\/Delete\/Eight.php", @@ -26712,7 +26712,7 @@ }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Router\/Put\/Six.php", - "hash": "5189ec91cb12bc451a8da1984e052a59" + "hash": "91238f88956c6ea8fc6576d7c3bdc5a3" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Router\/Put\/Eight.php", @@ -26752,7 +26752,7 @@ }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Operators.php", - "hash": "3a3be8697950d94305dd965ce65487b2" + "hash": "caaade9b724943010812f28ea2d0f4c9" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Hydrator\/Operation\/Root.php", @@ -28924,7 +28924,7 @@ }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Hydrators.php", - "hash": "c9a0c73912840ccffe56be556716afe8" + "hash": "b5b0f752ec5fb86e4e5d8f82f16bb529" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Operation\/EnterpriseAdmin\/ListProvisionedGroupsEnterprise.php", @@ -29724,11 +29724,11 @@ }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/PHPStan\/ClientCallReturnTypes.php", - "hash": "869a3ad78c341bdf9db1817003485d57" + "hash": "397c573da52c6a554ddcdda6ed526bff" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/tests\/\/Types\/ClientCallReturnTypes.php", - "hash": "add9ca26314ceba4392cc8da1037e8ff" + "hash": "be8b0622bbc38092f5df7de4ad6fecee" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/..\/etc\/phpstan-extension.neon", @@ -33156,7 +33156,7 @@ }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Operation\/ApiInsights.php", - "hash": "58d77b9a9227372d7aec3f26aacb87b9" + "hash": "6bf9f7829121dba63588c95d05aaf1c3" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Hydrator\/Operation\/Orgs\/Org\/Insights\/Api\/SummaryStats.php", @@ -33188,7 +33188,7 @@ }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Operator\/EnterpriseAdmin\/GetAuditLogStreamKey.php", - "hash": "9898ea0828458aa0da5f61b519a7807f" + "hash": "e338995c990e8d6fed72239d209b1806" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/tests\/\/Internal\/Operation\/EnterpriseAdmin\/GetAuditLogStreamKeyTest.php", @@ -33200,7 +33200,7 @@ }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Operator\/EnterpriseAdmin\/GetAuditLogStreams.php", - "hash": "69e18cf2056e20a8567cf925a31ed770" + "hash": "024ec90e59019f13fe990f7bc321e8ad" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/tests\/\/Internal\/Operation\/EnterpriseAdmin\/GetAuditLogStreamsTest.php", @@ -33212,7 +33212,7 @@ }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Operator\/EnterpriseAdmin\/CreateAuditLogStream.php", - "hash": "6b7f868fa3288477fe2570f307e775db" + "hash": "dbcfd2d4f69a494d3a1caebaf4b5ec72" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/tests\/\/Internal\/Operation\/EnterpriseAdmin\/CreateAuditLogStreamTest.php", @@ -33224,7 +33224,7 @@ }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Operator\/EnterpriseAdmin\/GetOneAuditLogStream.php", - "hash": "db7bb54421994358be6847e0714c1ad0" + "hash": "d6ce68360feb6ae455a77301dc7c15ce" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/tests\/\/Internal\/Operation\/EnterpriseAdmin\/GetOneAuditLogStreamTest.php", @@ -33236,7 +33236,7 @@ }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Operator\/EnterpriseAdmin\/UpdateAuditLogStream.php", - "hash": "6fe2c86dcccc60539fb346d64c7e0d69" + "hash": "708185ab405e45c25b6a918fb2e26dcc" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/tests\/\/Internal\/Operation\/EnterpriseAdmin\/UpdateAuditLogStreamTest.php", @@ -33248,7 +33248,7 @@ }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Operator\/EnterpriseAdmin\/DeleteAuditLogStream.php", - "hash": "38e9dcfca0d8b91367f635ef81e42fd3" + "hash": "7d5b6c2563ae29c31c8c1c383aebecf0" }, { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Schema\/AuditLogStreamKey.php", @@ -33325,6 +33325,22 @@ { "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Hydrator\/Operation\/Enterprises\/Enterprise\/AuditLog\/Streams\/StreamId.php", "hash": "b6fd0daf7ebef7aee4411224b58a6203" + }, + { + "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Operation\/Billing\/GetGithubBillingUsageReportOrg.php", + "hash": "85f0c4cb36c4b4e926bd6c5fe624b227" + }, + { + "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Operator\/Billing\/GetGithubBillingUsageReportOrg.php", + "hash": "0083986a636c8e2c2119d1ce95ea161f" + }, + { + "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/tests\/\/Internal\/Operation\/Billing\/GetGithubBillingUsageReportOrgTest.php", + "hash": "e1840ead7b4a67aca4c6a8c5031b43fb" + }, + { + "name": ".\/clients\/GitHubEnterpriseCloud\/etc\/..\/\/src\/\/Internal\/Hydrator\/Operation\/Organizations\/Org\/Settings\/Billing\/Usage.php", + "hash": "cb07210e658850117154aa37a6a04e41" } ] }, diff --git a/clients/GitHubEnterpriseCloud/src/Internal/Hydrator/Operation/Organizations/Org/Settings/Billing/Usage.php b/clients/GitHubEnterpriseCloud/src/Internal/Hydrator/Operation/Organizations/Org/Settings/Billing/Usage.php new file mode 100644 index 00000000000..5fa954110b9 --- /dev/null +++ b/clients/GitHubEnterpriseCloud/src/Internal/Hydrator/Operation/Organizations/Org/Settings/Billing/Usage.php @@ -0,0 +1,580 @@ + $className + * + * @return T + * + * @template T of object + */ + public function hydrateObject(string $className, array $payload): object + { + return match ($className) { + 'ApiClients\Client\GitHubEnterpriseCloud\Schema\BillingUsageReport' => $this->hydrateApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️Schema⚡️BillingUsageReport($payload), + 'ApiClients\Client\GitHubEnterpriseCloud\Schema\BasicError' => $this->hydrateApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️Schema⚡️BasicError($payload), + 'ApiClients\Client\GitHubEnterpriseCloud\Schema\ScimError' => $this->hydrateApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️Schema⚡️ScimError($payload), + 'ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\CodeScanning\ListAlertsForEnterprise\Response\ApplicationJson\ServiceUnavailable' => $this->hydrateApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️Schema⚡️Operations⚡️CodeScanning⚡️ListAlertsForEnterprise⚡️Response⚡️ApplicationJson⚡️ServiceUnavailable($payload), + default => throw UnableToHydrateObject::noHydrationDefined($className, $this->hydrationStack), + }; + } + + private function hydrateApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️Schema⚡️BillingUsageReport(array $payload): BillingUsageReport + { + $properties = []; + $missingFields = []; + try { + $value = $payload['usage_items'] ?? null; + + if ($value === null) { + $properties['usageItems'] = null; + goto after_usageItems; + } + + $properties['usageItems'] = $value; + + after_usageItems: + } catch (Throwable $exception) { + throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHubEnterpriseCloud\Schema\BillingUsageReport', $exception, stack: $this->hydrationStack); + } + + if (count($missingFields) > 0) { + throw UnableToHydrateObject::dueToMissingFields(BillingUsageReport::class, $missingFields, stack: $this->hydrationStack); + } + + try { + return new BillingUsageReport(...$properties); + } catch (Throwable $exception) { + throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHubEnterpriseCloud\Schema\BillingUsageReport', $exception, stack: $this->hydrationStack); + } + } + + private function hydrateApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️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\GitHubEnterpriseCloud\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\GitHubEnterpriseCloud\Schema\BasicError', $exception, stack: $this->hydrationStack); + } + } + + private function hydrateApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️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\GitHubEnterpriseCloud\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\GitHubEnterpriseCloud\Schema\ScimError', $exception, stack: $this->hydrationStack); + } + } + + private function hydrateApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️Schema⚡️Operations⚡️CodeScanning⚡️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\GitHubEnterpriseCloud\Schema\Operations\CodeScanning\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\GitHubEnterpriseCloud\Schema\Operations\CodeScanning\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\GitHubEnterpriseCloud\Schema\BillingUsageReport' => $this->serializeObjectApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️Schema⚡️BillingUsageReport($object), + 'ApiClients\Client\GitHubEnterpriseCloud\Schema\BasicError' => $this->serializeObjectApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️Schema⚡️BasicError($object), + 'ApiClients\Client\GitHubEnterpriseCloud\Schema\ScimError' => $this->serializeObjectApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️Schema⚡️ScimError($object), + 'ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\CodeScanning\ListAlertsForEnterprise\Response\ApplicationJson\ServiceUnavailable' => $this->serializeObjectApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️Schema⚡️Operations⚡️CodeScanning⚡️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⚡️GitHubEnterpriseCloud⚡️Schema⚡️BillingUsageReport(mixed $object): mixed + { + assert($object instanceof BillingUsageReport); + $result = []; + + $usageItems = $object->usageItems; + + if ($usageItems === null) { + goto after_usageItems; + } + + static $usageItemsSerializer0; + + if ($usageItemsSerializer0 === null) { + $usageItemsSerializer0 = new SerializeArrayItems(...[]); + } + + $usageItems = $usageItemsSerializer0->serialize($usageItems, $this); + after_usageItems: $result['usage_items'] = $usageItems; + + return $result; + } + + private function serializeObjectApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️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⚡️GitHubEnterpriseCloud⚡️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; + } + + private function serializeObjectApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️Schema⚡️Operations⚡️CodeScanning⚡️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/GitHubEnterpriseCloud/src/Internal/Hydrators.php b/clients/GitHubEnterpriseCloud/src/Internal/Hydrators.php index f5024560c9b..6b0c3de7704 100644 --- a/clients/GitHubEnterpriseCloud/src/Internal/Hydrators.php +++ b/clients/GitHubEnterpriseCloud/src/Internal/Hydrators.php @@ -119,6 +119,7 @@ final class Hydrators implements ObjectMapper private Internal\Hydrator\Operation\Octocat|null $operation🌀Octocat = null; private Internal\Hydrator\Operation\Organizations|null $operation🌀Organizations = null; private Internal\Hydrator\Operation\Organizations\OrganizationId\CustomRoles|null $operation🌀Organizations🌀OrganizationId🌀CustomRoles = null; + private Internal\Hydrator\Operation\Organizations\Org\Settings\Billing\Usage|null $operation🌀Organizations🌀Org🌀Settings🌀Billing🌀Usage = null; private Internal\Hydrator\Operation\Orgs\Org|null $operation🌀Orgs🌀Org = null; private Internal\Hydrator\Operation\Orgs\Org\Actions\Cache\Usage|null $operation🌀Orgs🌀Org🌀Actions🌀Cache🌀Usage = null; private Internal\Hydrator\Operation\Orgs\Org\Actions\Cache\UsageByRepository|null $operation🌀Orgs🌀Org🌀Actions🌀Cache🌀UsageByRepository = null; @@ -2538,6 +2539,15 @@ public function getObjectMapperOperation🌀Organizations🌀OrganizationId🌀C return $this->operation🌀Organizations🌀OrganizationId🌀CustomRoles; } + public function getObjectMapperOperation🌀Organizations🌀Org🌀Settings🌀Billing🌀Usage(): Internal\Hydrator\Operation\Organizations\Org\Settings\Billing\Usage + { + if ($this->operation🌀Organizations🌀Org🌀Settings🌀Billing🌀Usage instanceof Internal\Hydrator\Operation\Organizations\Org\Settings\Billing\Usage === false) { + $this->operation🌀Organizations🌀Org🌀Settings🌀Billing🌀Usage = new Internal\Hydrator\Operation\Organizations\Org\Settings\Billing\Usage(); + } + + return $this->operation🌀Organizations🌀Org🌀Settings🌀Billing🌀Usage; + } + public function getObjectMapperOperation🌀Orgs🌀Org(): Internal\Hydrator\Operation\Orgs\Org { if ($this->operation🌀Orgs🌀Org instanceof Internal\Hydrator\Operation\Orgs\Org === false) { diff --git a/clients/GitHubEnterpriseCloud/src/Internal/Operation/Billing/GetGithubBillingUsageReportOrg.php b/clients/GitHubEnterpriseCloud/src/Internal/Operation/Billing/GetGithubBillingUsageReportOrg.php new file mode 100644 index 00000000000..e01d33d0919 --- /dev/null +++ b/clients/GitHubEnterpriseCloud/src/Internal/Operation/Billing/GetGithubBillingUsageReportOrg.php @@ -0,0 +1,117 @@ +org = $org; + $this->year = $year; + $this->month = $month; + $this->day = $day; + $this->hour = $hour; + } + + public function createRequest(): RequestInterface + { + return new Request('GET', str_replace(['{org}', '{year}', '{month}', '{day}', '{hour}'], [$this->org, $this->year, $this->month, $this->day, $this->hour], '/organizations/{org}/settings/billing/usage' . '?year={year}&month={month}&day={day}&hour={hour}')); + } + + public function createResponse(ResponseInterface $response): Schema\BillingUsageReport + { + $code = $response->getStatusCode(); + [$contentType] = explode(';', $response->getHeaderLine('Content-Type')); + switch ($contentType) { + case 'application/json': + $body = json_decode($response->getBody()->getContents(), true); + switch ($code) { + /** + * Billing usage report response for an organization + **/ + case 200: + $this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\BillingUsageReport::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + + return $this->hydrator->hydrateObject(Schema\BillingUsageReport::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)); + /** + * Internal Error + **/ + + case 500: + $this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\BasicError::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + + throw new ErrorSchemas\BasicError(500, $this->hydrator->hydrateObject(Schema\BasicError::class, $body)); + /** + * Service unavailable + **/ + + case 503: + $this->responseSchemaValidator->validate($body, Reader::readFromJson(Schema\Operations\CodeScanning\ListAlertsForEnterprise\Response\ApplicationJson\ServiceUnavailable::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + + throw new ErrorSchemas\Operations\CodeScanning\ListAlertsForEnterprise\Response\ApplicationJson\ServiceUnavailable(503, $this->hydrator->hydrateObject(Schema\Operations\CodeScanning\ListAlertsForEnterprise\Response\ApplicationJson\ServiceUnavailable::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/GitHubEnterpriseCloud/src/Internal/Operator/Billing/GetGithubBillingUsageReportOrg.php b/clients/GitHubEnterpriseCloud/src/Internal/Operator/Billing/GetGithubBillingUsageReportOrg.php new file mode 100644 index 00000000000..29789432536 --- /dev/null +++ b/clients/GitHubEnterpriseCloud/src/Internal/Operator/Billing/GetGithubBillingUsageReportOrg.php @@ -0,0 +1,40 @@ +responseSchemaValidator, $this->hydrator, $org, $year, $month, $day, $hour); + $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): BillingUsageReport { + return $operation->createResponse($response); + })); + if ($result instanceof Observable) { + $result = awaitObservable($result); + } + + return $result; + } +} diff --git a/clients/GitHubEnterpriseCloud/src/Internal/Operator/EnterpriseAdmin/CreateAuditLogStream.php b/clients/GitHubEnterpriseCloud/src/Internal/Operator/EnterpriseAdmin/CreateAuditLogStream.php index 1d91cf1f61f..68decbf61dd 100644 --- a/clients/GitHubEnterpriseCloud/src/Internal/Operator/EnterpriseAdmin/CreateAuditLogStream.php +++ b/clients/GitHubEnterpriseCloud/src/Internal/Operator/EnterpriseAdmin/CreateAuditLogStream.php @@ -24,6 +24,7 @@ public function __construct(private Browser $browser, private AuthenticationInte { } + /** @return */ public function call(string $enterprise, array $params): GetAuditLogStreamConfig { $operation = new \ApiClients\Client\GitHubEnterpriseCloud\Internal\Operation\EnterpriseAdmin\CreateAuditLogStream($this->requestSchemaValidator, $this->responseSchemaValidator, $this->hydrator, $enterprise); diff --git a/clients/GitHubEnterpriseCloud/src/Internal/Operator/EnterpriseAdmin/DeleteAuditLogStream.php b/clients/GitHubEnterpriseCloud/src/Internal/Operator/EnterpriseAdmin/DeleteAuditLogStream.php index 94406af5c46..50aa6368d3d 100644 --- a/clients/GitHubEnterpriseCloud/src/Internal/Operator/EnterpriseAdmin/DeleteAuditLogStream.php +++ b/clients/GitHubEnterpriseCloud/src/Internal/Operator/EnterpriseAdmin/DeleteAuditLogStream.php @@ -22,6 +22,7 @@ public function __construct(private Browser $browser, private AuthenticationInte { } + /** @return */ public function call(string $enterprise, int $streamId): WithoutBody { $operation = new \ApiClients\Client\GitHubEnterpriseCloud\Internal\Operation\EnterpriseAdmin\DeleteAuditLogStream($enterprise, $streamId); diff --git a/clients/GitHubEnterpriseCloud/src/Internal/Operator/EnterpriseAdmin/GetAuditLogStreamKey.php b/clients/GitHubEnterpriseCloud/src/Internal/Operator/EnterpriseAdmin/GetAuditLogStreamKey.php index f29ada3d7e1..10eb3c0f9d3 100644 --- a/clients/GitHubEnterpriseCloud/src/Internal/Operator/EnterpriseAdmin/GetAuditLogStreamKey.php +++ b/clients/GitHubEnterpriseCloud/src/Internal/Operator/EnterpriseAdmin/GetAuditLogStreamKey.php @@ -24,6 +24,7 @@ public function __construct(private Browser $browser, private AuthenticationInte { } + /** @return */ public function call(string $enterprise): AuditLogStreamKey { $operation = new \ApiClients\Client\GitHubEnterpriseCloud\Internal\Operation\EnterpriseAdmin\GetAuditLogStreamKey($this->responseSchemaValidator, $this->hydrator, $enterprise); diff --git a/clients/GitHubEnterpriseCloud/src/Internal/Operator/EnterpriseAdmin/GetAuditLogStreams.php b/clients/GitHubEnterpriseCloud/src/Internal/Operator/EnterpriseAdmin/GetAuditLogStreams.php index 0c169e1992b..1b77c64f8b5 100644 --- a/clients/GitHubEnterpriseCloud/src/Internal/Operator/EnterpriseAdmin/GetAuditLogStreams.php +++ b/clients/GitHubEnterpriseCloud/src/Internal/Operator/EnterpriseAdmin/GetAuditLogStreams.php @@ -24,7 +24,7 @@ public function __construct(private Browser $browser, private AuthenticationInte { } - /** @return iterable */ + /** @return Observable */ public function call(string $enterprise): iterable { $operation = new \ApiClients\Client\GitHubEnterpriseCloud\Internal\Operation\EnterpriseAdmin\GetAuditLogStreams($this->responseSchemaValidator, $this->hydrator, $enterprise); diff --git a/clients/GitHubEnterpriseCloud/src/Internal/Operator/EnterpriseAdmin/GetOneAuditLogStream.php b/clients/GitHubEnterpriseCloud/src/Internal/Operator/EnterpriseAdmin/GetOneAuditLogStream.php index 4280592a404..b59a4c11193 100644 --- a/clients/GitHubEnterpriseCloud/src/Internal/Operator/EnterpriseAdmin/GetOneAuditLogStream.php +++ b/clients/GitHubEnterpriseCloud/src/Internal/Operator/EnterpriseAdmin/GetOneAuditLogStream.php @@ -24,6 +24,7 @@ public function __construct(private Browser $browser, private AuthenticationInte { } + /** @return */ public function call(string $enterprise, int $streamId): GetAuditLogStreamConfig { $operation = new \ApiClients\Client\GitHubEnterpriseCloud\Internal\Operation\EnterpriseAdmin\GetOneAuditLogStream($this->responseSchemaValidator, $this->hydrator, $enterprise, $streamId); diff --git a/clients/GitHubEnterpriseCloud/src/Internal/Operator/EnterpriseAdmin/UpdateAuditLogStream.php b/clients/GitHubEnterpriseCloud/src/Internal/Operator/EnterpriseAdmin/UpdateAuditLogStream.php index ffed4f32bd3..acd02a2b7b9 100644 --- a/clients/GitHubEnterpriseCloud/src/Internal/Operator/EnterpriseAdmin/UpdateAuditLogStream.php +++ b/clients/GitHubEnterpriseCloud/src/Internal/Operator/EnterpriseAdmin/UpdateAuditLogStream.php @@ -24,6 +24,7 @@ public function __construct(private Browser $browser, private AuthenticationInte { } + /** @return */ public function call(string $enterprise, int $streamId, array $params): GetAuditLogStreamConfig { $operation = new \ApiClients\Client\GitHubEnterpriseCloud\Internal\Operation\EnterpriseAdmin\UpdateAuditLogStream($this->requestSchemaValidator, $this->responseSchemaValidator, $this->hydrator, $enterprise, $streamId); diff --git a/clients/GitHubEnterpriseCloud/src/Internal/Operators.php b/clients/GitHubEnterpriseCloud/src/Internal/Operators.php index 70fe4ccb212..a24eb577e68 100644 --- a/clients/GitHubEnterpriseCloud/src/Internal/Operators.php +++ b/clients/GitHubEnterpriseCloud/src/Internal/Operators.php @@ -187,6 +187,7 @@ final class Operators private Internal\Operator\Meta\GetOctocat|null $meta👷GetOctocat = null; private Internal\Operator\Orgs\List_|null $orgs👷List_ = null; private Internal\Operator\Orgs\ListCustomRoles|null $orgs👷ListCustomRoles = null; + private Internal\Operator\Billing\GetGithubBillingUsageReportOrg|null $billing👷GetGithubBillingUsageReportOrg = null; private Internal\Operator\Orgs\Get|null $orgs👷Get = null; private Internal\Operator\Orgs\Delete|null $orgs👷Delete = null; private Internal\Operator\Orgs\Update|null $orgs👷Update = null; @@ -2880,6 +2881,15 @@ public function orgs👷ListCustomRoles(): Internal\Operator\Orgs\ListCustomRole return $this->orgs👷ListCustomRoles; } + public function billing👷GetGithubBillingUsageReportOrg(): Internal\Operator\Billing\GetGithubBillingUsageReportOrg + { + if ($this->billing👷GetGithubBillingUsageReportOrg instanceof Internal\Operator\Billing\GetGithubBillingUsageReportOrg === false) { + $this->billing👷GetGithubBillingUsageReportOrg = new Internal\Operator\Billing\GetGithubBillingUsageReportOrg($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Organizations🌀Org🌀Settings🌀Billing🌀Usage()); + } + + return $this->billing👷GetGithubBillingUsageReportOrg; + } + public function orgs👷Get(): Internal\Operator\Orgs\Get { if ($this->orgs👷Get instanceof Internal\Operator\Orgs\Get === false) { diff --git a/clients/GitHubEnterpriseCloud/src/Internal/Router/Delete/EnterpriseAdmin.php b/clients/GitHubEnterpriseCloud/src/Internal/Router/Delete/EnterpriseAdmin.php index 6ba446574e3..542e1041e01 100644 --- a/clients/GitHubEnterpriseCloud/src/Internal/Router/Delete/EnterpriseAdmin.php +++ b/clients/GitHubEnterpriseCloud/src/Internal/Router/Delete/EnterpriseAdmin.php @@ -147,6 +147,7 @@ public function deleteSelfHostedRunnerFromEnterprise(array $params): WithoutBody return $operator->call($arguments['enterprise'], $arguments['runner_id']); } + /** @return */ public function deleteAuditLogStream(array $params): WithoutBody { $arguments = []; diff --git a/clients/GitHubEnterpriseCloud/src/Internal/Router/Delete/Six.php b/clients/GitHubEnterpriseCloud/src/Internal/Router/Delete/Six.php index 1af7c52a324..9d55bebfd59 100644 --- a/clients/GitHubEnterpriseCloud/src/Internal/Router/Delete/Six.php +++ b/clients/GitHubEnterpriseCloud/src/Internal/Router/Delete/Six.php @@ -17,7 +17,6 @@ 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\GitHubEnterpriseCloud\Schema\Operations\Copilot\CancelCopilotSeatAssignmentForUsers\Response\ApplicationJson\Ok|ActionsCacheList|FileCommit { if ($pathChunks[0] === '') { diff --git a/clients/GitHubEnterpriseCloud/src/Internal/Router/Get/Billing.php b/clients/GitHubEnterpriseCloud/src/Internal/Router/Get/Billing.php index 2f0abf59402..8a0d4869de2 100644 --- a/clients/GitHubEnterpriseCloud/src/Internal/Router/Get/Billing.php +++ b/clients/GitHubEnterpriseCloud/src/Internal/Router/Get/Billing.php @@ -156,6 +156,44 @@ public function getGithubBillingUsageReportGhe(array $params): BillingUsageRepor return $operator->call($arguments['enterprise'], $arguments['year'], $arguments['month'], $arguments['day'], $arguments['hour'], $arguments['cost_center_id']); } + public function getGithubBillingUsageReportOrg(array $params): BillingUsageReport + { + $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('year', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: year'); + } + + $arguments['year'] = $params['year']; + unset($params['year']); + if (array_key_exists('month', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: month'); + } + + $arguments['month'] = $params['month']; + unset($params['month']); + if (array_key_exists('day', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: day'); + } + + $arguments['day'] = $params['day']; + unset($params['day']); + if (array_key_exists('hour', $params) === false) { + throw new InvalidArgumentException('Missing mandatory field: hour'); + } + + $arguments['hour'] = $params['hour']; + unset($params['hour']); + $operator = new Internal\Operator\Billing\GetGithubBillingUsageReportOrg($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Organizations🌀Org🌀Settings🌀Billing🌀Usage()); + + return $operator->call($arguments['org'], $arguments['year'], $arguments['month'], $arguments['day'], $arguments['hour']); + } + /** @return */ public function getGithubActionsBillingOrg(array $params): ActionsBillingUsage { diff --git a/clients/GitHubEnterpriseCloud/src/Internal/Router/Get/EnterpriseAdmin.php b/clients/GitHubEnterpriseCloud/src/Internal/Router/Get/EnterpriseAdmin.php index 796476cd034..a7cc339b4ec 100644 --- a/clients/GitHubEnterpriseCloud/src/Internal/Router/Get/EnterpriseAdmin.php +++ b/clients/GitHubEnterpriseCloud/src/Internal/Router/Get/EnterpriseAdmin.php @@ -239,6 +239,7 @@ public function listSelfHostedRunnersForEnterprise(array $params): \ApiClients\C return $operator->call($arguments['name'], $arguments['enterprise'], $arguments['per_page'], $arguments['page']); } + /** @return */ public function getAuditLogStreamKey(array $params): AuditLogStreamKey { $arguments = []; @@ -253,7 +254,7 @@ public function getAuditLogStreamKey(array $params): AuditLogStreamKey return $operator->call($arguments['enterprise']); } - /** @return iterable */ + /** @return Observable */ public function getAuditLogStreams(array $params): iterable { $arguments = []; @@ -367,6 +368,7 @@ public function getSelfHostedRunnerForEnterprise(array $params): Runner return $operator->call($arguments['enterprise'], $arguments['runner_id']); } + /** @return */ public function getOneAuditLogStream(array $params): GetAuditLogStreamConfig { $arguments = []; diff --git a/clients/GitHubEnterpriseCloud/src/Internal/Router/Get/Five.php b/clients/GitHubEnterpriseCloud/src/Internal/Router/Get/Five.php index d32dd5f781d..e17d61e3800 100644 --- a/clients/GitHubEnterpriseCloud/src/Internal/Router/Get/Five.php +++ b/clients/GitHubEnterpriseCloud/src/Internal/Router/Get/Five.php @@ -56,7 +56,7 @@ public function __construct(private Routers $routers) { } - /** @return |Schema\AuditLogStreamKey|iterable|Observable|Observable|Observable|Observable|WithoutBody|Observable|Observable|Observable|Schema\BasicError|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable */ + /** @return |Observable|Observable|Observable|Observable|Observable|WithoutBody|Observable|Observable|Observable|Schema\BasicError|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable|Observable */ public function call(string $call, array $params, array $pathChunks): HookDelivery|ActionsEnterprisePermissions|Ok|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\EnterpriseAdmin\ListSelfHostedRunnersForEnterprise\Response\ApplicationJson\Ok|AuditLogStreamKey|iterable|WithoutBody|GistComment|MarketplacePurchase|BasicError|ThreadSubscription|ActionsOrganizationPermissions|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Actions\ListSelfHostedRunnerGroupsForOrg\Response\ApplicationJson\Ok|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Actions\ListSelfHostedRunnersForOrg\Response\ApplicationJson\Ok|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Actions\ListOrgSecrets\Response\ApplicationJson\Ok|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Actions\ListOrgVariables\Response\ApplicationJson\Ok|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Orgs\ListAttestations\Response\ApplicationJson\Ok|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Codespaces\ListOrgSecrets\Response\ApplicationJson\Ok|CopilotOrganizationDetails|OrganizationCustomRepositoryRole|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Dependabot\ListOrgSecrets\Response\ApplicationJson\Ok|ExternalGroup|OrgHook|OrgMembership|Migration|OrganizationRole|RepositoryRuleset|GroupMapping|TeamFull|ProjectCard|CheckAutomatedSecurityFixes|CodeSecurityConfigurationForRepository|Json|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Repos\GetAllEnvironments\Response\ApplicationJson\Ok|Import|Installation|InteractionLimitResponse|One|Language|LicenseContent|Page|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Repos\CheckPrivateVulnerabilityReporting\Response\ApplicationJson\Ok|ContentFile|SimpleUser|Stargazer|RepositorySubscription|Topic|TeamDiscussion|TeamMembership|TeamProject|CodespacesUserPublicKey|CodespacesSecret|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Codespaces\CodespaceMachinesForAuthenticatedUser\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Apps\ListInstallationReposForAuthenticatedUser\Response\ApplicationJson\Ok|Package|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Users\ListAttestations\Response\ApplicationJson\Ok|EmptyObject { if ($pathChunks[0] === '') { diff --git a/clients/GitHubEnterpriseCloud/src/Internal/Router/Get/Six.php b/clients/GitHubEnterpriseCloud/src/Internal/Router/Get/Six.php index 3a605bb476b..5bcf963f758 100644 --- a/clients/GitHubEnterpriseCloud/src/Internal/Router/Get/Six.php +++ b/clients/GitHubEnterpriseCloud/src/Internal/Router/Get/Six.php @@ -85,7 +85,7 @@ public function __construct(private Routers $routers) { } - /** @return |Observable|Schema\GetAuditLogStreamConfig|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 */ + /** @return |Observable|Observable|Schema\BillingUsageReport|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): ActionsCacheUsageOrgEnterprise|Ok|SelectedActions|ActionsGetDefaultWorkflowPermissions|RunnerGroupsEnterprise|iterable|Runner|GetAuditLogStreamConfig|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Copilot\ListCopilotSeatsForEnterprise\Response\ApplicationJson\Ok|ActionsBillingUsage|AdvancedSecurityActiveCommitters|GetAllCostCenters|PackagesBillingUsage|CombinedBillingUsage|BillingUsageReport|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Actions\GetActionsCacheUsageByRepoForOrg\Response\ApplicationJson\Ok|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Actions\ListSelectedRepositoriesEnabledGithubActionsOrganization\Response\ApplicationJson\Ok|RunnerGroupsOrg|ActionsPublicKey|OrganizationActionsSecret|OrganizationActionsVariable|WithoutBody|CodeSecurityConfiguration|CodespacesPublicKey|CodespacesOrgSecret|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Copilot\ListCopilotSeats\Response\ApplicationJson\Ok|DependabotPublicKey|OrganizationDependabotSecret|WebhookConfig|ApiInsightsSummaryStats|Json|CopilotSeatDetails|Package|CustomProperty|RuleSuite|ExternalGroups|ProjectCollaboratorPermission|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Actions\ListArtifactsForRepo\Response\ApplicationJson\Ok|ActionsCacheList|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Actions\ListRepoOrganizationSecrets\Response\ApplicationJson\Ok|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Actions\ListRepoOrganizationVariables\Response\ApplicationJson\Ok|ActionsRepositoryPermissions|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Actions\ListSelfHostedRunnersForRepo\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Actions\ListWorkflowRunsForRepo\Response\ApplicationJson\Ok|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Actions\ListRepoSecrets\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Actions\ListRepoVariables\Response\ApplicationJson\Ok\Application\Json|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Actions\ListRepoWorkflows\Response\ApplicationJson\Ok|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Repos\ListAttestations\Response\ApplicationJson\Ok\Application\Json|Autolink|BranchWithProtection|BasicError|CheckRun|CheckSuite|CodeScanningDefaultSetup|CodeownersErrors|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Codespaces\ListDevcontainersInRepositoryForAuthenticatedUser\Response\ApplicationJson\Ok|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Codespaces\RepoMachinesForAuthenticatedUser\Response\ApplicationJson\Ok|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Codespaces\PreFlightWithRepoForAuthenticatedUser\Response\ApplicationJson\Ok|CodespacesPermissionsCheckForDevcontainer|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Codespaces\ListRepoSecrets\Response\ApplicationJson\Ok|CommitComment|Commit|CommunityProfile|CommitComparison|ContentDirectory|ContentFile|ContentSymlink|ContentSubmodule|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Dependabot\ListRepoSecrets\Response\ApplicationJson\Ok|DependencyGraphSpdxSbom|Deployment|Environment|Hook|Issue|DeployKey|Label|Milestone|PagesHealthCheck|EmptyObject|PullRequest|Release|RepositoryRuleset|RepositoryAdvisory|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Repos\GetCodeFrequencyStats\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Repos\GetCommitActivityStats\Response\ApplicationJson\Accepted\Application\Json|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Repos\GetContributorsStats\Response\ApplicationJson\Accepted\Application\Json|ParticipationStats|CloneTraffic|ViewTraffic|ScimEnterpriseGroupList|ScimEnterpriseUserList|ScimUserList|TeamRepository|\ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\Codespaces\ListRepositoriesForSecretForAuthenticatedUser\Response\ApplicationJson\Ok\Application\Json|CodespaceExportDetails { if ($pathChunks[0] === '') { @@ -187,6 +187,18 @@ public function call(string $call, array $params, array $pathChunks): ActionsCac } } } + } elseif ($pathChunks[1] === 'organizations') { + if ($pathChunks[2] === '{org}') { + if ($pathChunks[3] === 'settings') { + if ($pathChunks[4] === 'billing') { + if ($pathChunks[5] === 'usage') { + if ($call === 'GET /organizations/{org}/settings/billing/usage') { + return $this->routers->internal🔀Router🔀Get🔀Billing()->getGithubBillingUsageReportOrg($params); + } + } + } + } + } } elseif ($pathChunks[1] === 'orgs') { if ($pathChunks[2] === '{org}') { if ($pathChunks[3] === 'actions') { diff --git a/clients/GitHubEnterpriseCloud/src/Internal/Router/Post/EnterpriseAdmin.php b/clients/GitHubEnterpriseCloud/src/Internal/Router/Post/EnterpriseAdmin.php index 8626698e29c..ac1f7d9e69b 100644 --- a/clients/GitHubEnterpriseCloud/src/Internal/Router/Post/EnterpriseAdmin.php +++ b/clients/GitHubEnterpriseCloud/src/Internal/Router/Post/EnterpriseAdmin.php @@ -100,6 +100,7 @@ public function createSelfHostedRunnerGroupForEnterprise(array $params): RunnerG return $operator->call($arguments['enterprise'], $params); } + /** @return */ public function createAuditLogStream(array $params): GetAuditLogStreamConfig { $arguments = []; diff --git a/clients/GitHubEnterpriseCloud/src/Internal/Router/Post/Five.php b/clients/GitHubEnterpriseCloud/src/Internal/Router/Post/Five.php index 638fae6f6a6..09dd88199d1 100644 --- a/clients/GitHubEnterpriseCloud/src/Internal/Router/Post/Five.php +++ b/clients/GitHubEnterpriseCloud/src/Internal/Router/Post/Five.php @@ -46,7 +46,6 @@ public function __construct(private Routers $routers) { } - /** @return |Schema\GetAuditLogStreamConfig */ public function call(string $call, array $params, array $pathChunks): InstallationToken|Authorization|RunnerGroupsEnterprise|GetAuditLogStreamConfig|WithoutBody|RunnerGroupsOrg|EmptyObject|CodeSecurityConfiguration|ProjectCard|Json|Created|Autolink|CheckRun|CheckSuite|Codespace|Deployment|\ApiClients\Client\GitHubEnterpriseCloud\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] === '') { diff --git a/clients/GitHubEnterpriseCloud/src/Internal/Router/Put/EnterpriseAdmin.php b/clients/GitHubEnterpriseCloud/src/Internal/Router/Put/EnterpriseAdmin.php index 3f3340fcbbf..e70e536b4bf 100644 --- a/clients/GitHubEnterpriseCloud/src/Internal/Router/Put/EnterpriseAdmin.php +++ b/clients/GitHubEnterpriseCloud/src/Internal/Router/Put/EnterpriseAdmin.php @@ -194,6 +194,7 @@ public function setAllowedActionsEnterprise(array $params): WithoutBody return $operator->call($arguments['enterprise'], $params); } + /** @return */ public function updateAuditLogStream(array $params): GetAuditLogStreamConfig { $arguments = []; diff --git a/clients/GitHubEnterpriseCloud/src/Internal/Router/Put/Six.php b/clients/GitHubEnterpriseCloud/src/Internal/Router/Put/Six.php index 794024d5093..38e8b3e497f 100644 --- a/clients/GitHubEnterpriseCloud/src/Internal/Router/Put/Six.php +++ b/clients/GitHubEnterpriseCloud/src/Internal/Router/Put/Six.php @@ -21,7 +21,6 @@ public function __construct(private Routers $routers) { } - /** @return |Schema\GetAuditLogStreamConfig */ public function call(string $call, array $params, array $pathChunks): WithoutBody|GetAuditLogStreamConfig|EmptyObject|CustomProperty|RepositoryInvitation|FileCommit|Environment|RepositoryRuleset { if ($pathChunks[0] === '') { diff --git a/clients/GitHubEnterpriseCloud/src/Operation/Billing.php b/clients/GitHubEnterpriseCloud/src/Operation/Billing.php index f2691bc0032..f25d7800f66 100644 --- a/clients/GitHubEnterpriseCloud/src/Operation/Billing.php +++ b/clients/GitHubEnterpriseCloud/src/Operation/Billing.php @@ -68,6 +68,11 @@ public function getGithubBillingUsageReportGhe(string $enterprise, int $year, in return $this->operators->billing👷GetGithubBillingUsageReportGhe()->call($enterprise, $year, $month, $day, $hour, $costCenterId); } + public function getGithubBillingUsageReportOrg(string $org, int $year, int $month, int $day, int $hour): BillingUsageReport + { + return $this->operators->billing👷GetGithubBillingUsageReportOrg()->call($org, $year, $month, $day, $hour); + } + /** @return */ public function getGithubActionsBillingOrg(string $org): ActionsBillingUsage { diff --git a/clients/GitHubEnterpriseCloud/src/Operation/EnterpriseAdmin.php b/clients/GitHubEnterpriseCloud/src/Operation/EnterpriseAdmin.php index 8af4529449d..8c48f28bc50 100644 --- a/clients/GitHubEnterpriseCloud/src/Operation/EnterpriseAdmin.php +++ b/clients/GitHubEnterpriseCloud/src/Operation/EnterpriseAdmin.php @@ -237,32 +237,37 @@ public function getAuditLogListing(string $enterprise, string $phrase, string $i return $this->operators->enterpriseAdmin👷GetAuditLogListing()->call($enterprise, $phrase, $include, $after, $before, $order, $page, $perPage); } + /** @return */ public function getAuditLogStreamKey(string $enterprise): AuditLogStreamKey { return $this->operators->enterpriseAdmin👷GetAuditLogStreamKey()->call($enterprise); } - /** @return iterable */ + /** @return Observable */ public function getAuditLogStreams(string $enterprise): iterable { return $this->operators->enterpriseAdmin👷GetAuditLogStreams()->call($enterprise); } + /** @return */ public function createAuditLogStream(string $enterprise, array $params): GetAuditLogStreamConfig { return $this->operators->enterpriseAdmin👷CreateAuditLogStream()->call($enterprise, $params); } + /** @return */ public function getOneAuditLogStream(string $enterprise, int $streamId): GetAuditLogStreamConfig { return $this->operators->enterpriseAdmin👷GetOneAuditLogStream()->call($enterprise, $streamId); } + /** @return */ public function updateAuditLogStream(string $enterprise, int $streamId, array $params): GetAuditLogStreamConfig { return $this->operators->enterpriseAdmin👷UpdateAuditLogStream()->call($enterprise, $streamId, $params); } + /** @return */ public function deleteAuditLogStream(string $enterprise, int $streamId): WithoutBody { return $this->operators->enterpriseAdmin👷DeleteAuditLogStream()->call($enterprise, $streamId); diff --git a/clients/GitHubEnterpriseCloud/src/PHPStan/ClientCallReturnTypes.php b/clients/GitHubEnterpriseCloud/src/PHPStan/ClientCallReturnTypes.php index 0c8295ec9ca..dbe1b842469 100644 --- a/clients/GitHubEnterpriseCloud/src/PHPStan/ClientCallReturnTypes.php +++ b/clients/GitHubEnterpriseCloud/src/PHPStan/ClientCallReturnTypes.php @@ -364,27 +364,27 @@ public function getTypeFromMethodCall(MethodReflection $methodReflection, Method } if ($call === 'GET /enterprises/{enterprise}/audit-log/stream-key') { - return $this->typeResolver->resolve('Schema\\AuditLogStreamKey'); + return $this->typeResolver->resolve(''); } if ($call === 'GET /enterprises/{enterprise}/audit-log/streams') { - return $this->typeResolver->resolve('iterable'); + return $this->typeResolver->resolve('Observable'); } if ($call === 'POST /enterprises/{enterprise}/audit-log/streams') { - return $this->typeResolver->resolve('Schema\\GetAuditLogStreamConfig'); + return $this->typeResolver->resolve(''); } if ($call === 'GET /enterprises/{enterprise}/audit-log/streams/{stream_id}') { - return $this->typeResolver->resolve('Schema\\GetAuditLogStreamConfig'); + return $this->typeResolver->resolve(''); } if ($call === 'PUT /enterprises/{enterprise}/audit-log/streams/{stream_id}') { - return $this->typeResolver->resolve('Schema\\GetAuditLogStreamConfig'); + return $this->typeResolver->resolve(''); } if ($call === 'DELETE /enterprises/{enterprise}/audit-log/streams/{stream_id}') { - return $this->typeResolver->resolve('\\ApiClients\\Tools\\OpenApiClient\\Utils\\Response\\WithoutBody'); + return $this->typeResolver->resolve(''); } if ($call === 'GET /enterprises/{enterprise}/code-scanning/alerts') { @@ -747,6 +747,10 @@ public function getTypeFromMethodCall(MethodReflection $methodReflection, Method return $this->typeResolver->resolve(''); } + if ($call === 'GET /organizations/{org}/settings/billing/usage') { + return $this->typeResolver->resolve('Schema\\BillingUsageReport'); + } + if ($call === 'GET /orgs/{org}') { return $this->typeResolver->resolve(''); } diff --git a/clients/GitHubEnterpriseCloud/tests/Internal/Operation/Billing/GetGithubBillingUsageReportOrgTest.php b/clients/GitHubEnterpriseCloud/tests/Internal/Operation/Billing/GetGithubBillingUsageReportOrgTest.php new file mode 100644 index 00000000000..ab15ab4fbae --- /dev/null +++ b/clients/GitHubEnterpriseCloud/tests/Internal/Operation/Billing/GetGithubBillingUsageReportOrgTest.php @@ -0,0 +1,249 @@ + 'application/json'], json_encode(json_decode(Schema\BillingUsageReport::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', '/organizations/generated/settings/billing/usage?year=4&month=5&day=3&hour=4', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->call(Internal\Operation\Billing\GetGithubBillingUsageReportOrg::OPERATION_MATCH, (static function (array $data): array { + $data['org'] = 'generated'; + $data['year'] = 4; + $data['month'] = 5; + $data['day'] = 3; + $data['hour'] = 4; + + 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\BillingUsageReport::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', '/organizations/generated/settings/billing/usage?year=4&month=5&day=3&hour=4', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->billing()->getGithubBillingUsageReportOrg('generated', 4, 5, 3, 4); + } + + /** @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', '/organizations/generated/settings/billing/usage?year=4&month=5&day=3&hour=4', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->call(Internal\Operation\Billing\GetGithubBillingUsageReportOrg::OPERATION_MATCH, (static function (array $data): array { + $data['org'] = 'generated'; + $data['year'] = 4; + $data['month'] = 5; + $data['day'] = 3; + $data['hour'] = 4; + + 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', '/organizations/generated/settings/billing/usage?year=4&month=5&day=3&hour=4', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->billing()->getGithubBillingUsageReportOrg('generated', 4, 5, 3, 4); + } + + /** @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('GET', '/organizations/generated/settings/billing/usage?year=4&month=5&day=3&hour=4', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->call(Internal\Operation\Billing\GetGithubBillingUsageReportOrg::OPERATION_MATCH, (static function (array $data): array { + $data['org'] = 'generated'; + $data['year'] = 4; + $data['month'] = 5; + $data['day'] = 3; + $data['hour'] = 4; + + 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('GET', '/organizations/generated/settings/billing/usage?year=4&month=5&day=3&hour=4', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->billing()->getGithubBillingUsageReportOrg('generated', 4, 5, 3, 4); + } + + /** @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', '/organizations/generated/settings/billing/usage?year=4&month=5&day=3&hour=4', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->call(Internal\Operation\Billing\GetGithubBillingUsageReportOrg::OPERATION_MATCH, (static function (array $data): array { + $data['org'] = 'generated'; + $data['year'] = 4; + $data['month'] = 5; + $data['day'] = 3; + $data['hour'] = 4; + + 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', '/organizations/generated/settings/billing/usage?year=4&month=5&day=3&hour=4', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->billing()->getGithubBillingUsageReportOrg('generated', 4, 5, 3, 4); + } + + /** @test */ + public function call_httpCode_500_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\BasicError::class); + $response = new Response(500, ['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', '/organizations/generated/settings/billing/usage?year=4&month=5&day=3&hour=4', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->call(Internal\Operation\Billing\GetGithubBillingUsageReportOrg::OPERATION_MATCH, (static function (array $data): array { + $data['org'] = 'generated'; + $data['year'] = 4; + $data['month'] = 5; + $data['day'] = 3; + $data['hour'] = 4; + + return $data; + })([])); + } + + /** @test */ + public function operations_httpCode_500_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\BasicError::class); + $response = new Response(500, ['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', '/organizations/generated/settings/billing/usage?year=4&month=5&day=3&hour=4', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->billing()->getGithubBillingUsageReportOrg('generated', 4, 5, 3, 4); + } + + /** @test */ + public function call_httpCode_503_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\Operations\CodeScanning\ListAlertsForEnterprise\Response\ApplicationJson\ServiceUnavailable::class); + $response = new Response(503, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\Operations\CodeScanning\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', '/organizations/generated/settings/billing/usage?year=4&month=5&day=3&hour=4', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->call(Internal\Operation\Billing\GetGithubBillingUsageReportOrg::OPERATION_MATCH, (static function (array $data): array { + $data['org'] = 'generated'; + $data['year'] = 4; + $data['month'] = 5; + $data['day'] = 3; + $data['hour'] = 4; + + return $data; + })([])); + } + + /** @test */ + public function operations_httpCode_503_responseContentType_application_json_zero(): void + { + self::expectException(ErrorSchemas\Operations\CodeScanning\ListAlertsForEnterprise\Response\ApplicationJson\ServiceUnavailable::class); + $response = new Response(503, ['Content-Type' => 'application/json'], json_encode(json_decode(Schema\Operations\CodeScanning\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', '/organizations/generated/settings/billing/usage?year=4&month=5&day=3&hour=4', Argument::type('array'), Argument::any())->willReturn(resolve($response))->shouldBeCalled(); + $client = new Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->billing()->getGithubBillingUsageReportOrg('generated', 4, 5, 3, 4); + } +} diff --git a/clients/GitHubEnterpriseCloud/tests/Types/ClientCallReturnTypes.php b/clients/GitHubEnterpriseCloud/tests/Types/ClientCallReturnTypes.php index 31a47d64015..1087a2eca7d 100644 --- a/clients/GitHubEnterpriseCloud/tests/Types/ClientCallReturnTypes.php +++ b/clients/GitHubEnterpriseCloud/tests/Types/ClientCallReturnTypes.php @@ -97,12 +97,12 @@ function authHeader(): string assertType('', $client->call('PATCH /enterprises/{enterprise}/announcement')); assertType('Observable', $client->call('GET /enterprises/{enterprise}/audit-log')); assertType('Observable', $client->call('LIST /enterprises/{enterprise}/audit-log')); -assertType('Schema\\AuditLogStreamKey', $client->call('GET /enterprises/{enterprise}/audit-log/stream-key')); -assertType('iterable', $client->call('GET /enterprises/{enterprise}/audit-log/streams')); -assertType('Schema\\GetAuditLogStreamConfig', $client->call('POST /enterprises/{enterprise}/audit-log/streams')); -assertType('Schema\\GetAuditLogStreamConfig', $client->call('GET /enterprises/{enterprise}/audit-log/streams/{stream_id}')); -assertType('Schema\\GetAuditLogStreamConfig', $client->call('PUT /enterprises/{enterprise}/audit-log/streams/{stream_id}')); -assertType('\\ApiClients\\Tools\\OpenApiClient\\Utils\\Response\\WithoutBody', $client->call('DELETE /enterprises/{enterprise}/audit-log/streams/{stream_id}')); +assertType('', $client->call('GET /enterprises/{enterprise}/audit-log/stream-key')); +assertType('Observable', $client->call('GET /enterprises/{enterprise}/audit-log/streams')); +assertType('', $client->call('POST /enterprises/{enterprise}/audit-log/streams')); +assertType('', $client->call('GET /enterprises/{enterprise}/audit-log/streams/{stream_id}')); +assertType('', $client->call('PUT /enterprises/{enterprise}/audit-log/streams/{stream_id}')); +assertType('', $client->call('DELETE /enterprises/{enterprise}/audit-log/streams/{stream_id}')); assertType('Observable', $client->call('GET /enterprises/{enterprise}/code-scanning/alerts')); assertType('Observable', $client->call('LIST /enterprises/{enterprise}/code-scanning/alerts')); assertType('', $client->call('GET /enterprises/{enterprise}/code_security_and_analysis')); @@ -193,6 +193,7 @@ function authHeader(): string assertType('', $client->call('GET /octocat')); assertType('Observable|WithoutBody', $client->call('GET /organizations')); assertType('', $client->call('GET /organizations/{organization_id}/custom_roles')); +assertType('Schema\\BillingUsageReport', $client->call('GET /organizations/{org}/settings/billing/usage')); assertType('', $client->call('GET /orgs/{org}')); assertType('', $client->call('DELETE /orgs/{org}')); assertType('', $client->call('PATCH /orgs/{org}')); diff --git a/etc/specs/GitHubEnterpriseCloud/current.spec.yaml b/etc/specs/GitHubEnterpriseCloud/current.spec.yaml index 58d02bf26d9..6eac176902f 100644 --- a/etc/specs/GitHubEnterpriseCloud/current.spec.yaml +++ b/etc/specs/GitHubEnterpriseCloud/current.spec.yaml @@ -6534,6 +6534,41 @@ paths: category: orgs subcategory: custom-roles deprecated: true + "/organizations/{org}/settings/billing/usage": + get: + summary: Get billing usage report for an organization + description: |- + Gets a report of the total usage for an organization. To use this endpoint, you must be an administrator of an organization within an enterprise or an organization account. + + **Note:** This endpoint is only available to organizations with access to the enhanced billing platform. For more information, see "[About the enhanced billing platform](https://docs.github.com/enterprise-cloud@latest//billing/using-the-new-billing-platform)." + tags: + - billing + operationId: billing/get-github-billing-usage-report-org + externalDocs: + description: API method documentation + url: https://docs.github.com/enterprise-cloud@latest//rest/billing/enhanced-billing#get-billing-usage-report-for-an-organization + parameters: + - "$ref": "#/components/parameters/org" + - "$ref": "#/components/parameters/billing-usage-report-year" + - "$ref": "#/components/parameters/billing-usage-report-month" + - "$ref": "#/components/parameters/billing-usage-report-day" + - "$ref": "#/components/parameters/billing-usage-report-hour" + responses: + '200': + "$ref": "#/components/responses/billing_usage_report_org" + '400': + "$ref": "#/components/responses/bad_request" + '403': + "$ref": "#/components/responses/forbidden" + '500': + "$ref": "#/components/responses/internal_error" + '503': + "$ref": "#/components/responses/service_unavailable" + x-github: + githubCloudOnly: false + enabledForGitHubApps: true + category: billing + subcategory: enhanced-billing "/orgs/{org}": get: summary: Get an organization @@ -44669,9 +44704,6 @@ paths: get: summary: List provisioned SCIM groups for an enterprise description: |- - > [!NOTE] - > SCIM provisioning for users and groups using the REST API is in public preview and subject to change. - Lists provisioned SCIM groups in an enterprise. You can improve query search time by using the `excludedAttributes` query parameter with a value of `members` to exclude members from the response. @@ -44728,9 +44760,6 @@ paths: post: summary: Provision a SCIM enterprise group description: |- - > [!NOTE] - > SCIM provisioning for users and groups using the REST API is in public preview and subject to change. - Creates a SCIM group for an enterprise. When members are part of the group provisioning payload, they're designated as external group members. Providers are responsible for maintaining a mapping between the `externalId` and `id` for each user. @@ -44785,11 +44814,7 @@ paths: "/scim/v2/enterprises/{enterprise}/Groups/{scim_group_id}": get: summary: Get SCIM provisioning information for an enterprise group - description: |- - > [!NOTE] - > SCIM provisioning for users and groups using the REST API is in public preview and subject to change. - - Gets information about a SCIM group. + description: Gets information about a SCIM group. operationId: enterprise-admin/get-provisioning-information-for-enterprise-group tags: - enterprise-admin @@ -44830,9 +44855,6 @@ paths: put: summary: Set SCIM information for a provisioned enterprise group description: |- - > [!NOTE] - > SCIM provisioning for users and groups using the REST API is in public preview and subject to change. - Replaces an existing provisioned group’s information. You must provide all the information required for the group as if you were provisioning it for the first time. Any existing group information that you don't provide will be removed, including group membership. If you want to only update a specific attribute, use the [Update an attribute for a SCIM enterprise group](#update-an-attribute-for-a-scim-enterprise-group) endpoint instead. @@ -44905,9 +44927,6 @@ paths: patch: summary: Update an attribute for a SCIM enterprise group description: |- - > [!NOTE] - > SCIM provisioning for users and groups using the REST API is in public preview and subject to change. - Update a provisioned group’s individual attributes. To modify a group's values, you'll need to use a specific Operations JSON format which must include at least one of the following operations: add, remove, or replace. For examples and more information on this SCIM format, consult the [SCIM specification](https://tools.ietf.org/html/rfc7644#section-3.5.2). The update function can also be used to add group memberships. @@ -44987,11 +45006,7 @@ paths: subcategory: scim delete: summary: Delete a SCIM group from an enterprise - description: |- - > [!NOTE] - > SCIM provisioning using the REST API is in public preview and subject to change. - - Deletes a SCIM group from an enterprise. + description: Deletes a SCIM group from an enterprise. operationId: enterprise-admin/delete-scim-group-from-enterprise tags: - enterprise-admin @@ -45025,9 +45040,6 @@ paths: get: summary: List SCIM provisioned identities for an enterprise description: |- - > [!NOTE] - > SCIM provisioning for users and groups using the REST API is in public preview and subject to change. - Lists provisioned SCIM enterprise members. When you remove a user with a SCIM-provisioned external identity from an enterprise using a `patch` with `active` flag to `false`, the user's metadata remains intact. This means they can potentially re-join the enterprise later. Although, while suspended, the user can't sign in. If you want to ensure the user can't re-join in the future, use the delete request. Only users who weren't permanently deleted will appear in the result list. @@ -45083,9 +45095,6 @@ paths: post: summary: Provision a SCIM enterprise user description: |- - > [!NOTE] - > SCIM provisioning for users and groups using the REST API is in public preview and subject to change. - Creates an external identity for a new SCIM enterprise user. SCIM is responsible for user provisioning, not authentication. The actual user authentication is handled by SAML. However, with SCIM enabled, users must first be provisioned via SCIM before they can sign in through SAML. @@ -45140,11 +45149,7 @@ paths: "/scim/v2/enterprises/{enterprise}/Users/{scim_user_id}": get: summary: Get SCIM provisioning information for an enterprise user - description: |- - > [!NOTE] - > SCIM provisioning for users and groups using the REST API is in public preview and subject to change. - - Gets information about a SCIM user. + description: Gets information about a SCIM user. operationId: enterprise-admin/get-provisioning-information-for-enterprise-user tags: - enterprise-admin @@ -45184,9 +45189,6 @@ paths: put: summary: Set SCIM information for a provisioned enterprise user description: |- - > [!NOTE] - > SCIM provisioning for users and groups using the REST API is in public preview and subject to change. - Replaces an existing provisioned user's information. You must supply complete user information, just as you would when provisioning them initially. Any previously existing data not provided will be deleted. To update only a specific attribute, refer to the [Update an attribute for a SCIM user](#update-an-attribute-for-a-scim-enterprise-user) endpoint. @@ -45243,9 +45245,6 @@ paths: patch: summary: Update an attribute for a SCIM enterprise user description: |- - > [!NOTE] - > SCIM provisioning for users and groups using the REST API is in public preview and subject to change. - Update a provisioned user's individual attributes. To modify a user's attributes, you'll need to provide a `Operations` JSON formatted request that includes at least one of the following actions: add, remove, or replace. For specific examples and more information on the SCIM operations format, please refer to the [SCIM specification](https://tools.ietf.org/html/rfc7644#section-3.5.2). @@ -45349,11 +45348,11 @@ paths: subcategory: scim delete: summary: Delete a SCIM user from an enterprise - description: |- - > [!NOTE] - > SCIM provisioning using the REST API is in public preview and subject to change. - - Suspends a SCIM user permanently from an enterprise. This action will: remove all the user's data, anonymize their login, email, and display name, erase all external identity SCIM attributes, delete the user's emails, avatar, PATs, SSH keys, OAuth authorizations, GPG keys, and SAML mappings. This action is irreversible. + description: 'Suspends a SCIM user permanently from an enterprise. This action + will: remove all the user''s data, anonymize their login, email, and display + name, erase all external identity SCIM attributes, delete the user''s emails, + avatar, PATs, SSH keys, OAuth authorizations, GPG keys, and SAML mappings. + This action is irreversible.' operationId: enterprise-admin/delete-user-from-enterprise tags: - enterprise-admin @@ -236606,6 +236605,15 @@ components: application/json: schema: "$ref": "#/components/schemas/basic-error" + billing_usage_report_org: + description: Billing usage report response for an organization + content: + application/json: + schema: + "$ref": "#/components/schemas/billing-usage-report" + examples: + default: + "$ref": "#/components/examples/billing-usage-report" no_content: description: A header with no content is returned. package_es_list_error: