From 8ce8c66f0a6e38a820c3fcd495d0422f6d6acd83 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Tue, 1 Dec 2026 22:35:53 +0000 Subject: [PATCH] ## Python SDK Changes: * `open_router.scim.list_organization_role_mappings()`: **Added** * `open_router.scim.create_organization_role_mapping()`: **Added** * `open_router.scim.delete_organization_role_mapping()`: **Added** --- .speakeasy/gen.lock | 178 +++- .speakeasy/gen.yaml | 2 +- .speakeasy/out.openapi.yaml | 318 +++++++ .speakeasy/workflow.lock | 10 +- RELEASES.md | 12 +- ...eatescimorganizationrolemappingrequest.mdx | 10 + ...scimorganizationrolemappingrequestrole.mdx | 22 + ...atescimorganizationrolemappingresponse.mdx | 9 + ...etescimorganizationrolemappingresponse.mdx | 9 + ...stscimorganizationrolemappingsresponse.mdx | 11 + .../scimorganizationrolemapping.mdx | 15 + .../scimorganizationrolemappingrole.mdx | 22 + ...eatescimorganizationrolemappingglobals.mdx | 11 + ...eatescimorganizationrolemappingrequest.mdx | 12 + ...letescimorganizationrolemappingglobals.mdx | 11 + ...letescimorganizationrolemappingrequest.mdx | 12 + ...istscimorganizationrolemappingsglobals.mdx | 11 + ...istscimorganizationrolemappingsrequest.mdx | 11 + docs/sdks/scim/README.mdx | 154 ++++ pyproject.toml | 2 +- src/openrouter/_version.py | 4 +- src/openrouter/components/__init__.py | 46 + ...reatescimorganizationrolemappingrequest.py | 29 + ...eatescimorganizationrolemappingresponse.py | 17 + ...letescimorganizationrolemappingresponse.py | 26 + ...istscimorganizationrolemappingsresponse.py | 26 + .../components/scimorganizationrolemapping.py | 63 ++ src/openrouter/operations/__init__.py | 42 + .../createscimorganizationrolemapping.py | 146 +++ .../deletescimorganizationrolemapping.py | 142 +++ .../listscimorganizationrolemappings.py | 137 +++ src/openrouter/scim.py | 868 ++++++++++++++++++ uv.lock | 2 +- 33 files changed, 2358 insertions(+), 32 deletions(-) create mode 100644 docs/components/createscimorganizationrolemappingrequest.mdx create mode 100644 docs/components/createscimorganizationrolemappingrequestrole.mdx create mode 100644 docs/components/createscimorganizationrolemappingresponse.mdx create mode 100644 docs/components/deletescimorganizationrolemappingresponse.mdx create mode 100644 docs/components/listscimorganizationrolemappingsresponse.mdx create mode 100644 docs/components/scimorganizationrolemapping.mdx create mode 100644 docs/components/scimorganizationrolemappingrole.mdx create mode 100644 docs/operations/createscimorganizationrolemappingglobals.mdx create mode 100644 docs/operations/createscimorganizationrolemappingrequest.mdx create mode 100644 docs/operations/deletescimorganizationrolemappingglobals.mdx create mode 100644 docs/operations/deletescimorganizationrolemappingrequest.mdx create mode 100644 docs/operations/listscimorganizationrolemappingsglobals.mdx create mode 100644 docs/operations/listscimorganizationrolemappingsrequest.mdx create mode 100644 src/openrouter/components/createscimorganizationrolemappingrequest.py create mode 100644 src/openrouter/components/createscimorganizationrolemappingresponse.py create mode 100644 src/openrouter/components/deletescimorganizationrolemappingresponse.py create mode 100644 src/openrouter/components/listscimorganizationrolemappingsresponse.py create mode 100644 src/openrouter/components/scimorganizationrolemapping.py create mode 100644 src/openrouter/operations/createscimorganizationrolemapping.py create mode 100644 src/openrouter/operations/deletescimorganizationrolemapping.py create mode 100644 src/openrouter/operations/listscimorganizationrolemappings.py diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index bc773ab6..f093ea85 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,19 +1,19 @@ lockVersion: 2.0.0 id: c48cf606-fb42-4a45-9c23-8f0555307828 management: - docChecksum: 9e92da774887908fa842069197550069 + docChecksum: fc5a1f7403ef9532e605cc0f6251c308 docVersion: 1.0.0 speakeasyVersion: 1.803.2 generationVersion: 2.950.13 - releaseVersion: 1.3.224 - configChecksum: a85b04bba7f7ac6e968b2cf7233da674 + releaseVersion: 1.3.225 + configChecksum: 7551bf9f7f03c35bc42d6a2c4ea3a800 repoURL: https://github.com/OpenRouterTeam/python-sdk.git installationURL: https://github.com/OpenRouterTeam/python-sdk.git published: true persistentEdits: - generation_id: 0b7bf2cf-999a-4f8e-a80c-f2cc15a17ae2 - pristine_commit_hash: 840c28e705a7d19d4cdef33fe0c1cdf1164baaa7 - pristine_tree_hash: 1ae8eef552d49da9de4a22b15fcf8ee0244fa2ff + generation_id: 4f596bff-694f-4d13-800a-b794f508bfd4 + pristine_commit_hash: d1f885a37b58693a05a2b3d76bcfb5a8a65ec060 + pristine_tree_hash: b1321830edb542133c698444e6c99e8459f500a8 features: python: acceptHeaders: 3.0.0 @@ -2922,6 +2922,18 @@ trackedFiles: id: 1343f81fb7f9 last_write_checksum: sha1:2d7d8d53a81739d44e64ee95fe74a45ed1f2a9ab pristine_git_object: 44c09a6f9c4ab97e8d851a565bb6654a81cb1528 + docs/components/createscimorganizationrolemappingrequest.mdx: + id: a0980edf9647 + last_write_checksum: sha1:8039c972d5a6aacf93a64f85c493f130617c03e3 + pristine_git_object: b45fc6a01d1a8e284dfb4619ac182a287deb72c8 + docs/components/createscimorganizationrolemappingrequestrole.mdx: + id: 8f843c2a9bb6 + last_write_checksum: sha1:93a870bbe4d6e02ab7820edd703b4429503d8ec8 + pristine_git_object: 6000239ec37fe545ad98cb48a7df889fbdb105c0 + docs/components/createscimorganizationrolemappingresponse.mdx: + id: b40634dfd482 + last_write_checksum: sha1:bec1af7a11f923343fd05844f7981b19c9c41ced + pristine_git_object: 3561f89077bf8af6f8847ab953db68e7ab309e30 docs/components/createscimsyncjobresponse.mdx: id: 1845762e5b3a last_write_checksum: sha1:9b0d0a33536dd94795426293ba9944a9c86d90f3 @@ -3282,6 +3294,10 @@ trackedFiles: id: 3cd77320d674 last_write_checksum: sha1:b6b82e0aa08aa4fc76b79ddd5ffe4e3741707c81 pristine_git_object: 05324ebbc26e0a170d54d939fab938d582327614 + docs/components/deletescimorganizationrolemappingresponse.mdx: + id: 59cf6895ca6e + last_write_checksum: sha1:b7be0cd69d0c9e70bd86771a9a877f5f9cdabe33 + pristine_git_object: 2130a12205287adf1938b8ed4e3add549fd5e7c9 docs/components/deleteworkspacebudgetresponse.mdx: id: 438cab4d21cf last_write_checksum: sha1:6691731218680ca9247965dfe64f8c77ab22c128 @@ -5022,6 +5038,10 @@ trackedFiles: id: b7b20d46cf95 last_write_checksum: sha1:c746607d8b439f345a4d92401cc2f13ab77b5c79 pristine_git_object: 0e495364e16999479738c66ed0a849fb8ef37e6e + docs/components/listscimorganizationrolemappingsresponse.mdx: + id: 5cc1137cb802 + last_write_checksum: sha1:16c95b8c3c5b6bb2a7a29f721e922751dfa73710 + pristine_git_object: a67adcd91658ca410abe2d355e0178dd9a549e1a docs/components/listtoolsresponse.mdx: id: 51bafdfebe6d last_write_checksum: sha1:9379079a8a3798a41f385960c80994dddd0a25bd @@ -8230,6 +8250,14 @@ trackedFiles: id: 0306b7b3cf78 last_write_checksum: sha1:93f2d7d1dc60a2b1635202d83ae9f00cc314e2e6 pristine_git_object: 94331ee57f8ebf2b21903d5ebda22e0faf23044a + docs/components/scimorganizationrolemapping.mdx: + id: a75fc1832d1c + last_write_checksum: sha1:a0dec5843ccfd9cf9de34e764283b4bb5edc4c25 + pristine_git_object: 8cb787f8f3e6c69384084c2294cffa0970d1d4e4 + docs/components/scimorganizationrolemappingrole.mdx: + id: 39541d9b9b50 + last_write_checksum: sha1:c386c2de39701f8c75d5fafd1d494d4eb6d9e522 + pristine_git_object: abb4677331c975c3c5e03bef005635d6eb2a3f2d docs/components/scimsyncjob.mdx: id: 4016ff89381c last_write_checksum: sha1:f08503db0547d5139dfd1b0bc95a5a5ffa97baa8 @@ -10554,6 +10582,14 @@ trackedFiles: id: 0cf573a9a3b4 last_write_checksum: sha1:25513fa0a3df5c8d2839ef67b24fcd4380e5ed14 pristine_git_object: ea32432ba02845a1a1a7174c7f8d0fd64531750e + docs/operations/createscimorganizationrolemappingglobals.mdx: + id: 96832ff919b5 + last_write_checksum: sha1:5c39c40049291a3ed75fa995d4928ec097eec4cd + pristine_git_object: 6ac1d01f4cfbe014fe4c171346553209ef1c2431 + docs/operations/createscimorganizationrolemappingrequest.mdx: + id: c1ec37fbe809 + last_write_checksum: sha1:2482bc548d50496f2407b8c765607c19d2475bb9 + pristine_git_object: 95c87f3092c8ccdc8da2e08e95f3222921f09fe2 docs/operations/createscimsyncjobglobals.mdx: id: 81b32708351d last_write_checksum: sha1:b6b1fb93dd08357d9cb0a0d96c2af51f01975a0b @@ -10734,6 +10770,14 @@ trackedFiles: id: 429d1931c37a last_write_checksum: sha1:e042b66678a8497bcccb187a80db8d289aa39d80 pristine_git_object: ee532715449a0b834956844e4857b9381402a07f + docs/operations/deletescimorganizationrolemappingglobals.mdx: + id: 1175e98b2a55 + last_write_checksum: sha1:3b6be24fe5ff8870d1b1594226a10dc73587b0dd + pristine_git_object: a7bae6271c9cf50868a731fc16f883740672793c + docs/operations/deletescimorganizationrolemappingrequest.mdx: + id: 8960d6fe1bcf + last_write_checksum: sha1:abd9867ea24a080af8daf49e37b9888fca1814f6 + pristine_git_object: 1642ce63d67fbcc0d8ac0bc1a106bb246fd820e4 docs/operations/deletevaultsecretglobals.mdx: id: 445d5e528646 last_write_checksum: sha1:41edb6f0eb6391a4ba48c584132b2bbc5537732d @@ -11734,6 +11778,14 @@ trackedFiles: id: b763a3eaa70b last_write_checksum: sha1:246b6d9bb45198398a6fc3840164c2e70bfaf2e6 pristine_git_object: 7d77c461db62d65a8ede454c9b3322b01a52c4be + docs/operations/listscimorganizationrolemappingsglobals.mdx: + id: 647b95ed2afe + last_write_checksum: sha1:1d610a51033698e13a2d23b6071be94e3add5620 + pristine_git_object: d77066a806bcdf61cc15b872b476d3b0fc2d1844 + docs/operations/listscimorganizationrolemappingsrequest.mdx: + id: 3bf3c1c8e52f + last_write_checksum: sha1:bec7c2cc58dff31bc02fca957061a48a32ec54ef + pristine_git_object: 8a217b31248d19e0a02149f7d139ea28f8cab659 docs/operations/listspeechmodelsglobals.mdx: id: c02b33cf5aa4 last_write_checksum: sha1:43394566d6cd00506e365b341210d677b7e76292 @@ -12300,8 +12352,8 @@ trackedFiles: pristine_git_object: 2713692f889d5d3fb5450060a18cdb28334ff745 docs/sdks/scim/README.mdx: id: fd6d8a91a053 - last_write_checksum: sha1:d912e224557d116afeeeb1245dc79d5623975e30 - pristine_git_object: 50d5c20cd6676067aa42953625109ec69c777f42 + last_write_checksum: sha1:41764afeeddbf2aee02623dd7a449d0bb98c25ce + pristine_git_object: 429d980619e325e2a2f86b9cafc2fc74343f7d9d docs/sdks/stt/README.mdx: id: 190b0dc9a5d1 last_write_checksum: sha1:855bbe02b8316c063023eaa71ff87bdae037f684 @@ -12336,8 +12388,8 @@ trackedFiles: pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544 pyproject.toml: id: 5d07e7d72637 - last_write_checksum: sha1:58f9061ac9d1b35f8c867743d1ea245109ede516 - pristine_git_object: ae837959edc1cef8295d1a1ab74ff96697c6c699 + last_write_checksum: sha1:4a4f316516168b9dbbfc6f2f08dd6316da0a9f04 + pristine_git_object: a3f11da90f8c1133f0c81fd73229f45392072876 scripts/prepare_readme.py: id: e0c5957a6035 last_write_checksum: sha1:77f44b60b98bc126557ec27391f91dfba764bb54 @@ -12364,8 +12416,8 @@ trackedFiles: pristine_git_object: 86713cfea633e09d33b3d4e65281071fe20e6137 src/openrouter/_version.py: id: d8d15ad6c586 - last_write_checksum: sha1:a79f5a9f64b4986a7f4bbef31cd92137207ffe8f - pristine_git_object: 221c1bdb2b3a4226afa5e8995be316bd3dd39887 + last_write_checksum: sha1:55d67b3465b122737a2126b61d5c78eaaedb347c + pristine_git_object: 38d93a7b16629138f0ca59189a9401b757039774 src/openrouter/alpha.py: id: 306c4d93308d last_write_checksum: sha1:80cc0f39649445431cc2247ed0e0765438467766 @@ -12412,8 +12464,8 @@ trackedFiles: pristine_git_object: ad3d247954547814054c01989a2dff3d12b3e4e1 src/openrouter/components/__init__.py: id: 81754e97b3f4 - last_write_checksum: sha1:e64a338525b068f90a7dbb5055715a3a38090b8d - pristine_git_object: 619d9b1bc51148bac7c2272fab958f9f79295042 + last_write_checksum: sha1:c5f3c4d53e39e61178888e16b406c60050eee712 + pristine_git_object: 99a867e982f676e5f36c86b982cbc35957119f1a src/openrouter/components/aabenchmarkentry.py: id: e2e0f0b48c82 last_write_checksum: sha1:08125e1d60df82793e11e8aed6e3c9fdb7512ebb @@ -13674,6 +13726,14 @@ trackedFiles: id: f8798c422360 last_write_checksum: sha1:fe554fba7ee3924661b789491b1cc31e4517119d pristine_git_object: 7fde9784d1da97bbd4a70b5a64d72ea8ffa7fe64 + src/openrouter/components/createscimorganizationrolemappingrequest.py: + id: 7e4279f2aa05 + last_write_checksum: sha1:a9b984b8529afdba57fc1f121ff4083c8e84ef2f + pristine_git_object: 19a2e5f073654070b7577bfe68223bdb9ece42dc + src/openrouter/components/createscimorganizationrolemappingresponse.py: + id: c5e131cbe2f0 + last_write_checksum: sha1:d3b27c56c9abb8e37493bbba113f427aefabf446 + pristine_git_object: ab86659ccfa09c06233c2a18639f1daa931d67bf src/openrouter/components/createscimsyncjobresponse.py: id: 5dada6452185 last_write_checksum: sha1:f3533b148f303fb26ac595a97269f66405faf416 @@ -13834,6 +13894,10 @@ trackedFiles: id: aef026b5e627 last_write_checksum: sha1:ccf8a4261d6c889d320fcce82bd8f73ae13cb07f pristine_git_object: 08a2289ff162c8758168d8da8414dd2f0ec3cc6e + src/openrouter/components/deletescimorganizationrolemappingresponse.py: + id: f2aed926989f + last_write_checksum: sha1:6c2e5fd638a763dccec050ccfdfcc234e85e5531 + pristine_git_object: 2d79f7929a493e465b1996f1f41ea9d91ff4c285 src/openrouter/components/deleteworkspacebudgetresponse.py: id: f9b733ad07c1 last_write_checksum: sha1:9bbbb1e27113d3ccebf7adf47b6554acf6139cb2 @@ -14514,6 +14578,10 @@ trackedFiles: id: 7c20d71efb80 last_write_checksum: sha1:1a8318984c6789d39fcfb26950003decd43e8671 pristine_git_object: 8eedc46ae432ebaf1dcf40a15a918456c801f836 + src/openrouter/components/listscimorganizationrolemappingsresponse.py: + id: 6050509c75e4 + last_write_checksum: sha1:681d6df6358471583ab2e6131a6f1a950a0036f9 + pristine_git_object: b2868c8ffdf8614005ca441d8a707eacd3e1d6fd src/openrouter/components/listtoolsresponse.py: id: 55d1f4305b3a last_write_checksum: sha1:688d9f42382bb250f0e49449bd1437deca731ada @@ -15674,6 +15742,10 @@ trackedFiles: id: c4d7a895a0bc last_write_checksum: sha1:426befccd88107766691cff08a93741c6f388471 pristine_git_object: b2e0acc56568f3c0ff542ec141c761ad62ddad80 + src/openrouter/components/scimorganizationrolemapping.py: + id: 81f2e9224676 + last_write_checksum: sha1:5d34c36872358cff24c87fddc6c4d7e2bdb429a2 + pristine_git_object: dc6e39a281c065366923c9ec30c701f5539ac4b1 src/openrouter/components/scimsyncjob.py: id: a3d7fd291eb2 last_write_checksum: sha1:f845f10ad866dce1f3189da457a255d7ede41eab @@ -16608,8 +16680,8 @@ trackedFiles: pristine_git_object: 039fd484b407d7ca13177a892db5939b312ee50d src/openrouter/operations/__init__.py: id: 9afcea1e7161 - last_write_checksum: sha1:05800705114143944a7d184dfd0839b55b61fc20 - pristine_git_object: 6d6f4d5c3f081ea99f828325d056c35f4cbc2ba7 + last_write_checksum: sha1:4bd14f64e187e92c36bbfbfb10c4d5ca8041199b + pristine_git_object: b5a6b1701ce79c3ee1aebb2511b779038eb048d1 src/openrouter/operations/activateprivateendpoint.py: id: 3b39eec5d66f last_write_checksum: sha1:9406e6b3d38c82895fd795f637702ef579cc6d36 @@ -16758,6 +16830,10 @@ trackedFiles: id: 48a7da108d46 last_write_checksum: sha1:7d510d57cce56c508847565be44dfe0f2d2812e3 pristine_git_object: 5e9dc6fb071c8087c7edbd766dded2fc19e00c9f + src/openrouter/operations/createscimorganizationrolemapping.py: + id: fb50bfbc0cf2 + last_write_checksum: sha1:a1716c916095539f5c1ce8f10d75645fdbc7310f + pristine_git_object: f03904035c860e3343bb34e507d9a0612ad04af8 src/openrouter/operations/createscimsyncjob.py: id: 6e34c289d71d last_write_checksum: sha1:3395583f3df63ed55df668d1172a9fbe507a47f0 @@ -16838,6 +16914,10 @@ trackedFiles: id: 5006e36e243e last_write_checksum: sha1:5d80b78c9223f946aeb6e17aae26af33948b6b65 pristine_git_object: bada4a4344b1af53386a83a9ddedd28513d04127 + src/openrouter/operations/deletescimorganizationrolemapping.py: + id: e621cae89d21 + last_write_checksum: sha1:887a1f34d14f39a82c520d20c037536a481145af + pristine_git_object: a115d277d8e01a33dfb9ba7a2fab1c7ad2ab508f src/openrouter/operations/deletevaultsecret.py: id: 1a7a4e95df3d last_write_checksum: sha1:5e63aac783c783de8171d4d4b35d11a77867f151 @@ -17174,6 +17254,10 @@ trackedFiles: id: 9f32309bb157 last_write_checksum: sha1:2319b023e5e8bd308df04a66e535edc2ffaa289d pristine_git_object: ac0de5426e797ff26d835fd88c0a4d7cb86844d3 + src/openrouter/operations/listscimorganizationrolemappings.py: + id: 6cdaed4d22b4 + last_write_checksum: sha1:496b0d10bdd36dffe74b65c99386d05bad423e9b + pristine_git_object: 686972a89aed1cdb71542d189d10fc946464acbd src/openrouter/operations/listspeechmodels.py: id: bf5b66c7f12a last_write_checksum: sha1:8c47519eff2a15a328928ab86f2f831b32754dbd @@ -17340,8 +17424,8 @@ trackedFiles: pristine_git_object: 9657171612cd81ca38c0dcdec14b49eb9adbb5f9 src/openrouter/scim.py: id: 351afd6b616e - last_write_checksum: sha1:d7ee3432ea7a5a5e6aee18671a4335b7fbe96f9c - pristine_git_object: da36fb6c787c5d7abde82cef765620a3a88b874c + last_write_checksum: sha1:789e68d0ec063fea0b8eb0afd6582918b8b909e7 + pristine_git_object: c06eab04cb453a67f98177d6f1f28aa1578e9c02 src/openrouter/sdk.py: id: ee9846c4c9c5 last_write_checksum: sha1:e2ac234f50cf2fa57417f0be1c9222dc8cfcf947 @@ -22641,9 +22725,61 @@ examples: application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} "500": application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + listScimOrganizationRoleMappings: + speakeasy-default-list-scim-organization-role-mappings: + responses: + "200": + application/json: {"data": [{"created_at": "2025-08-24T10:30:00.000Z", "id": "scimgrm_2abc123", "precedence": 1, "role": "member", "scim_group_display_name": "Engineering", "scim_group_id": "550e8400-e29b-41d4-a716-446655440000", "updated_at": "2025-08-24T10:30:00.000Z"}], "role_mapping_enabled": true, "total_count": 604343} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "403": + application/json: {"error": {"code": 403, "message": "Only management keys can perform this operation"}} + "404": + application/json: {"error": {"code": 404, "message": "Resource not found"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + createScimOrganizationRoleMapping: + speakeasy-default-create-scim-organization-role-mapping: + requestBody: + application/json: {"role": "member", "scim_group_id": "d8ef171b-bf4a-489e-9ae2-36debb7b72b2"} + responses: + "201": + application/json: {"data": {"created_at": "2025-08-24T10:30:00.000Z", "id": "scimgrm_2abc123", "precedence": 1, "role": "member", "scim_group_display_name": "Engineering", "scim_group_id": "550e8400-e29b-41d4-a716-446655440000", "updated_at": "2025-08-24T10:30:00.000Z"}} + "400": + application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "403": + application/json: {"error": {"code": 403, "message": "Only management keys can perform this operation"}} + "404": + application/json: {"error": {"code": 404, "message": "Resource not found"}} + "409": + application/json: {"error": {"code": 409, "message": "Resource conflict. Please try again later."}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + deleteScimOrganizationRoleMapping: + speakeasy-default-delete-scim-organization-role-mapping: + parameters: + path: + id: "" + responses: + "200": + application/json: {"deleted": true} + "400": + application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "403": + application/json: {"error": {"code": 403, "message": "Only management keys can perform this operation"}} + "404": + application/json: {"error": {"code": 404, "message": "Resource not found"}} + "409": + application/json: {"error": {"code": 409, "message": "Resource conflict. Please try again later."}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} examplesVersion: 1.0.2 releaseNotes: | ## Python SDK Changes: - * `open_router.batch.create_batches()`: `response.results[].response.body.union(BatchImageGenerationResponse).id` **Added** - * `open_router.batch.get_batches()`: `response.results[].response.body.union(BatchImageGenerationResponse).id` **Added** - * `open_router.batch.get_results()`: `response.data[].response.body.union(BatchImageGenerationResponse).id` **Added** + * `open_router.scim.list_organization_role_mappings()`: **Added** + * `open_router.scim.create_organization_role_mapping()`: **Added** + * `open_router.scim.delete_organization_role_mapping()`: **Added** diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index c414e367..758d6edc 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -37,7 +37,7 @@ generation: documentation: mintlify preApplyUnionDiscriminators: true python: - version: 1.3.224 + version: 1.3.225 additionalDependencies: dev: pytest: '>=8.3' diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index b12c9f48..73c70542 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -11660,6 +11660,30 @@ components: required: - 'data' type: 'object' + CreateScimOrganizationRoleMappingRequest: + properties: + role: + description: 'Organization role granted to members of the mapped SCIM group.' + enum: + - 'admin' + - 'member' + example: 'member' + type: 'string' + x-speakeasy-unknown-values: allow + scim_group_id: + format: 'uuid' + type: 'string' + required: + - 'scim_group_id' + - 'role' + type: 'object' + CreateScimOrganizationRoleMappingResponse: + properties: + data: + $ref: '#/components/schemas/ScimOrganizationRoleMapping' + required: + - 'data' + type: 'object' CreateScimSyncJobResponse: properties: data: @@ -12857,6 +12881,14 @@ components: required: - 'deleted' type: 'object' + DeleteScimOrganizationRoleMappingResponse: + properties: + deleted: + const: true + type: 'boolean' + required: + - 'deleted' + type: 'object' DeleteWorkspaceBudgetResponse: example: deleted: true @@ -19537,6 +19569,22 @@ components: - 'data' - 'total_count' type: 'object' + ListScimOrganizationRoleMappingsResponse: + properties: + data: + items: + $ref: '#/components/schemas/ScimOrganizationRoleMapping' + type: 'array' + role_mapping_enabled: + description: 'Whether organization role mapping is enabled for the SCIM directory. Enable it in the dashboard before creating or deleting mappings.' + type: 'boolean' + total_count: + type: 'integer' + required: + - 'role_mapping_enabled' + - 'data' + - 'total_count' + type: 'object' ListToolsResponse: properties: data: @@ -34930,6 +34978,50 @@ components: - 'created_at' - 'updated_at' type: 'object' + ScimOrganizationRoleMapping: + example: + created_at: '2025-08-24T10:30:00.000Z' + id: 'scimgrm_2abc123' + precedence: 1 + role: 'member' + scim_group_display_name: 'Engineering' + scim_group_id: '550e8400-e29b-41d4-a716-446655440000' + updated_at: '2025-08-24T10:30:00.000Z' + properties: + created_at: + type: 'string' + id: + type: 'string' + precedence: + description: 'Resolution order when a user is in several mapped groups; lower wins.' + type: 'integer' + role: + description: 'Organization role granted to members of the mapped SCIM group.' + enum: + - 'admin' + - 'member' + example: 'member' + type: 'string' + x-speakeasy-unknown-values: allow + scim_group_display_name: + type: 'string' + scim_group_id: + description: 'ID of the SCIM group (from `GET /scim/groups`). `null` when the identity provider group has not been synced yet.' + format: 'uuid' + type: + - 'string' + - 'null' + updated_at: + type: 'string' + required: + - 'id' + - 'scim_group_id' + - 'scim_group_display_name' + - 'role' + - 'precedence' + - 'created_at' + - 'updated_at' + type: 'object' ScimSyncJob: properties: created_at: @@ -62277,6 +62369,232 @@ paths: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" - $ref: "#/components/parameters/AppCategories" + /scim/organization-role-mappings: + get: + description: 'List the SCIM group-to-organization-role mappings for the organization, and whether organization role mapping is enabled. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'listScimOrganizationRoleMappings' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ListScimOrganizationRoleMappingsResponse' + description: 'List of SCIM organization role mappings' + '401': + content: + application/json: + example: + error: + code: 401 + message: 'Missing Authentication header' + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Authentication required or invalid credentials' + '403': + content: + application/json: + example: + error: + code: 403 + message: 'Only management keys can perform this operation' + schema: + $ref: '#/components/schemas/ForbiddenResponse' + description: 'Forbidden - Authentication successful but insufficient permissions' + '404': + content: + application/json: + example: + error: + code: 404 + message: 'Resource not found' + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - Resource does not exist' + '500': + content: + application/json: + example: + error: + code: 500 + message: 'Internal Server Error' + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Unexpected server error' + summary: 'List SCIM organization role mappings' + tags: + - 'SCIM' + x-speakeasy-name-override: 'listOrganizationRoleMappings' + post: + description: 'Map a SCIM group to an organization role (`admin` or `member`). Members of the group receive that organization role on their next SCIM sync. Organization role mapping must be enabled for the SCIM directory in the dashboard; otherwise writes return `409`. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'createScimOrganizationRoleMapping' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateScimOrganizationRoleMappingRequest' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/CreateScimOrganizationRoleMappingResponse' + description: 'SCIM organization role mapping created' + '400': + content: + application/json: + example: + error: + code: 400 + message: 'Invalid request parameters' + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: 'Bad Request - Invalid request parameters or malformed input' + '401': + content: + application/json: + example: + error: + code: 401 + message: 'Missing Authentication header' + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Authentication required or invalid credentials' + '403': + content: + application/json: + example: + error: + code: 403 + message: 'Only management keys can perform this operation' + schema: + $ref: '#/components/schemas/ForbiddenResponse' + description: 'Forbidden - Authentication successful but insufficient permissions' + '404': + content: + application/json: + example: + error: + code: 404 + message: 'Resource not found' + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - Resource does not exist' + '409': + content: + application/json: + example: + error: + code: 409 + message: 'Resource conflict. Please try again later.' + schema: + $ref: '#/components/schemas/ConflictResponse' + description: 'Conflict - Resource conflict or concurrent modification' + '500': + content: + application/json: + example: + error: + code: 500 + message: 'Internal Server Error' + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Unexpected server error' + summary: 'Create a SCIM organization role mapping' + tags: + - 'SCIM' + x-speakeasy-name-override: 'createOrganizationRoleMapping' + parameters: + - $ref: "#/components/parameters/AppIdentifier" + - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" + /scim/organization-role-mappings/{id}: + delete: + description: 'Delete a SCIM group-to-organization-role mapping. Deleting the last `admin` mapping returns `409`. Organization role mapping must be enabled for the SCIM directory in the dashboard; otherwise writes return `409`. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'deleteScimOrganizationRoleMapping' + parameters: + - in: 'path' + name: 'id' + required: true + schema: + maxLength: 128 + minLength: 1 + type: 'string' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteScimOrganizationRoleMappingResponse' + description: 'SCIM organization role mapping deleted' + '400': + content: + application/json: + example: + error: + code: 400 + message: 'Invalid request parameters' + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: 'Bad Request - Invalid request parameters or malformed input' + '401': + content: + application/json: + example: + error: + code: 401 + message: 'Missing Authentication header' + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Authentication required or invalid credentials' + '403': + content: + application/json: + example: + error: + code: 403 + message: 'Only management keys can perform this operation' + schema: + $ref: '#/components/schemas/ForbiddenResponse' + description: 'Forbidden - Authentication successful but insufficient permissions' + '404': + content: + application/json: + example: + error: + code: 404 + message: 'Resource not found' + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - Resource does not exist' + '409': + content: + application/json: + example: + error: + code: 409 + message: 'Resource conflict. Please try again later.' + schema: + $ref: '#/components/schemas/ConflictResponse' + description: 'Conflict - Resource conflict or concurrent modification' + '500': + content: + application/json: + example: + error: + code: 500 + message: 'Internal Server Error' + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Unexpected server error' + summary: 'Delete a SCIM organization role mapping' + tags: + - 'SCIM' + x-speakeasy-name-override: 'deleteOrganizationRoleMapping' + parameters: + - $ref: "#/components/parameters/AppIdentifier" + - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" /scim/sync-jobs: post: description: 'Start a SCIM directory sync. [Management key](/docs/guides/overview/auth/management-api-keys) required.' diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index d0221134..10ae3732 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -2,8 +2,8 @@ speakeasyVersion: 1.803.2 sources: OpenRouter API: sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:4ebc5f72bb4bde1a4c95de59087ce6f0bca2427676002202db033b7861afa147 - sourceBlobDigest: sha256:aa553839bcd3f17ae3f080790fb549f29cecf7fdbc857b6dce6d222d36345bb6 + sourceRevisionDigest: sha256:6185f185b85e8cbf9b2f4a39828ae8d21e85d8c1c2ea2a198d979cd544ab3d74 + sourceBlobDigest: sha256:23ee9b5e5a1bfd0074fadb9f698f5cbb3542155243249bab3aaf5d8cf7841309 tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: open-router: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:4ebc5f72bb4bde1a4c95de59087ce6f0bca2427676002202db033b7861afa147 - sourceBlobDigest: sha256:aa553839bcd3f17ae3f080790fb549f29cecf7fdbc857b6dce6d222d36345bb6 + sourceRevisionDigest: sha256:6185f185b85e8cbf9b2f4a39828ae8d21e85d8c1c2ea2a198d979cd544ab3d74 + sourceBlobDigest: sha256:23ee9b5e5a1bfd0074fadb9f698f5cbb3542155243249bab3aaf5d8cf7841309 codeSamplesNamespace: open-router-python-code-samples - codeSamplesRevisionDigest: sha256:a6cf1ccde23827e7c3c72196d0dcace292a268842c26d6ea323c45e7f76383f6 + codeSamplesRevisionDigest: sha256:8716e1847e73fdaa73c024a4295bbdaa85632657421799b41bf768bf9296fddc workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.803.2 diff --git a/RELEASES.md b/RELEASES.md index 3a7cdef3..89ddc0d2 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -5009,4 +5009,14 @@ Based on: ### Generated - [python v1.3.224] . ### Releases -- [PyPI v1.3.224] https://pypi.org/project/openrouter/1.3.224 - . \ No newline at end of file +- [PyPI v1.3.224] https://pypi.org/project/openrouter/1.3.224 - . + +## 2026-12-01 22:32:33 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.803.2 (2.950.13) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v1.3.225] . +### Releases +- [PyPI v1.3.225] https://pypi.org/project/openrouter/1.3.225 - . \ No newline at end of file diff --git a/docs/components/createscimorganizationrolemappingrequest.mdx b/docs/components/createscimorganizationrolemappingrequest.mdx new file mode 100644 index 00000000..b45fc6a0 --- /dev/null +++ b/docs/components/createscimorganizationrolemappingrequest.mdx @@ -0,0 +1,10 @@ +--- +title: "CreateScimOrganizationRoleMappingRequest" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | +| `role` | [components.CreateScimOrganizationRoleMappingRequestRole](../components/createscimorganizationrolemappingrequestrole.mdx) | ✔️ | Organization role granted to members of the mapped SCIM group. | member | +| `scim_group_id` | *str* | ✔️ | N/A | | \ No newline at end of file diff --git a/docs/components/createscimorganizationrolemappingrequestrole.mdx b/docs/components/createscimorganizationrolemappingrequestrole.mdx new file mode 100644 index 00000000..6000239e --- /dev/null +++ b/docs/components/createscimorganizationrolemappingrequestrole.mdx @@ -0,0 +1,22 @@ +--- +title: "CreateScimOrganizationRoleMappingRequestRole" +--- + +Organization role granted to members of the mapped SCIM group. + +## Example Usage + +```python +from openrouter.components import CreateScimOrganizationRoleMappingRequestRole + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: CreateScimOrganizationRoleMappingRequestRole = "admin" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"admin"` +- `"member"` diff --git a/docs/components/createscimorganizationrolemappingresponse.mdx b/docs/components/createscimorganizationrolemappingresponse.mdx new file mode 100644 index 00000000..3561f890 --- /dev/null +++ b/docs/components/createscimorganizationrolemappingresponse.mdx @@ -0,0 +1,9 @@ +--- +title: "CreateScimOrganizationRoleMappingResponse" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `data` | [components.ScimOrganizationRoleMapping](../components/scimorganizationrolemapping.mdx) | ✔️ | N/A | \{
"created_at": "2025-08-24T10:30:00.000Z",
"id": "scimgrm_2abc123",
"precedence": 1,
"role": "member",
"scim_group_display_name": "Engineering",
"scim_group_id": "550e8400-e29b-41d4-a716-446655440000",
"updated_at": "2025-08-24T10:30:00.000Z"
} | \ No newline at end of file diff --git a/docs/components/deletescimorganizationrolemappingresponse.mdx b/docs/components/deletescimorganizationrolemappingresponse.mdx new file mode 100644 index 00000000..2130a122 --- /dev/null +++ b/docs/components/deletescimorganizationrolemappingresponse.mdx @@ -0,0 +1,9 @@ +--- +title: "DeleteScimOrganizationRoleMappingResponse" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `deleted` | *Literal[True]* | ✔️ | N/A | \ No newline at end of file diff --git a/docs/components/listscimorganizationrolemappingsresponse.mdx b/docs/components/listscimorganizationrolemappingsresponse.mdx new file mode 100644 index 00000000..a67adcd9 --- /dev/null +++ b/docs/components/listscimorganizationrolemappingsresponse.mdx @@ -0,0 +1,11 @@ +--- +title: "ListScimOrganizationRoleMappingsResponse" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | +| `data` | List[[components.ScimOrganizationRoleMapping](../components/scimorganizationrolemapping.mdx)] | ✔️ | N/A | +| `role_mapping_enabled` | *bool* | ✔️ | Whether organization role mapping is enabled for the SCIM directory. Enable it in the dashboard before creating or deleting mappings. | +| `total_count` | *int* | ✔️ | N/A | \ No newline at end of file diff --git a/docs/components/scimorganizationrolemapping.mdx b/docs/components/scimorganizationrolemapping.mdx new file mode 100644 index 00000000..8cb787f8 --- /dev/null +++ b/docs/components/scimorganizationrolemapping.mdx @@ -0,0 +1,15 @@ +--- +title: "ScimOrganizationRoleMapping" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `created_at` | *str* | ✔️ | N/A | | +| `id` | *str* | ✔️ | N/A | | +| `precedence` | *int* | ✔️ | Resolution order when a user is in several mapped groups; lower wins. | | +| `role` | [components.ScimOrganizationRoleMappingRole](../components/scimorganizationrolemappingrole.mdx) | ✔️ | Organization role granted to members of the mapped SCIM group. | member | +| `scim_group_display_name` | *str* | ✔️ | N/A | | +| `scim_group_id` | *Nullable[str]* | ✔️ | ID of the SCIM group (from `GET /scim/groups`). `null` when the identity provider group has not been synced yet. | | +| `updated_at` | *str* | ✔️ | N/A | | \ No newline at end of file diff --git a/docs/components/scimorganizationrolemappingrole.mdx b/docs/components/scimorganizationrolemappingrole.mdx new file mode 100644 index 00000000..abb46773 --- /dev/null +++ b/docs/components/scimorganizationrolemappingrole.mdx @@ -0,0 +1,22 @@ +--- +title: "ScimOrganizationRoleMappingRole" +--- + +Organization role granted to members of the mapped SCIM group. + +## Example Usage + +```python +from openrouter.components import ScimOrganizationRoleMappingRole + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: ScimOrganizationRoleMappingRole = "admin" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"admin"` +- `"member"` diff --git a/docs/operations/createscimorganizationrolemappingglobals.mdx b/docs/operations/createscimorganizationrolemappingglobals.mdx new file mode 100644 index 00000000..6ac1d01f --- /dev/null +++ b/docs/operations/createscimorganizationrolemappingglobals.mdx @@ -0,0 +1,11 @@ +--- +title: "CreateScimOrganizationRoleMappingGlobals" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| +| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/createscimorganizationrolemappingrequest.mdx b/docs/operations/createscimorganizationrolemappingrequest.mdx new file mode 100644 index 00000000..95c87f30 --- /dev/null +++ b/docs/operations/createscimorganizationrolemappingrequest.mdx @@ -0,0 +1,12 @@ +--- +title: "CreateScimOrganizationRoleMappingRequest" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| +| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| +| `create_scim_organization_role_mapping_request` | [components.CreateScimOrganizationRoleMappingRequest](../components/createscimorganizationrolemappingrequest.mdx) | ✔️ | N/A | \ No newline at end of file diff --git a/docs/operations/deletescimorganizationrolemappingglobals.mdx b/docs/operations/deletescimorganizationrolemappingglobals.mdx new file mode 100644 index 00000000..a7bae627 --- /dev/null +++ b/docs/operations/deletescimorganizationrolemappingglobals.mdx @@ -0,0 +1,11 @@ +--- +title: "DeleteScimOrganizationRoleMappingGlobals" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| +| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/deletescimorganizationrolemappingrequest.mdx b/docs/operations/deletescimorganizationrolemappingrequest.mdx new file mode 100644 index 00000000..1642ce63 --- /dev/null +++ b/docs/operations/deletescimorganizationrolemappingrequest.mdx @@ -0,0 +1,12 @@ +--- +title: "DeleteScimOrganizationRoleMappingRequest" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| +| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| +| `id` | *str* | ✔️ | N/A | \ No newline at end of file diff --git a/docs/operations/listscimorganizationrolemappingsglobals.mdx b/docs/operations/listscimorganizationrolemappingsglobals.mdx new file mode 100644 index 00000000..d77066a8 --- /dev/null +++ b/docs/operations/listscimorganizationrolemappingsglobals.mdx @@ -0,0 +1,11 @@ +--- +title: "ListScimOrganizationRoleMappingsGlobals" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| +| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/listscimorganizationrolemappingsrequest.mdx b/docs/operations/listscimorganizationrolemappingsrequest.mdx new file mode 100644 index 00000000..8a217b31 --- /dev/null +++ b/docs/operations/listscimorganizationrolemappingsrequest.mdx @@ -0,0 +1,11 @@ +--- +title: "ListScimOrganizationRoleMappingsRequest" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| +| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/sdks/scim/README.mdx b/docs/sdks/scim/README.mdx index 50d5c20c..429d9806 100644 --- a/docs/sdks/scim/README.mdx +++ b/docs/sdks/scim/README.mdx @@ -15,6 +15,9 @@ Management endpoints for SCIM group-to-workspace mappings, authenticated with a * [read](#read) - Get a SCIM group mapping * [update](#update) - Update a SCIM group mapping * [list_groups](#list_groups) - List SCIM groups +* [list_organization_role_mappings](#list_organization_role_mappings) - List SCIM organization role mappings +* [create_organization_role_mapping](#create_organization_role_mapping) - Create a SCIM organization role mapping +* [delete_organization_role_mapping](#delete_organization_role_mapping) - Delete a SCIM organization role mapping * [create_sync_job](#create_sync_job) - Start a SCIM directory sync * [get_sync_job](#get_sync_job) - Get SCIM directory sync status @@ -328,6 +331,157 @@ with OpenRouter( | errors.InternalServerResponseError | 500 | application/json | | errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | +## list_organization_role_mappings + +List the SCIM group-to-organization-role mappings for the organization, and whether organization role mapping is enabled. [Management key](/docs/guides/overview/auth/management-api-keys) required. + +### Example Usage + +```python +from openrouter import OpenRouter +import os + + +with OpenRouter( + http_referer="", + x_open_router_title="", + x_open_router_categories="", + api_key=os.getenv("OPENROUTER_API_KEY", ""), +) as open_router: + + res = open_router.scim.list_organization_role_mappings() + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| +| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | + +### Response + +**[components.ListScimOrganizationRoleMappingsResponse](../../components/listscimorganizationrolemappingsresponse.mdx)** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | +| errors.UnauthorizedResponseError | 401 | application/json | +| errors.ForbiddenResponseError | 403 | application/json | +| errors.NotFoundResponseError | 404 | application/json | +| errors.InternalServerResponseError | 500 | application/json | +| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | + +## create_organization_role_mapping + +Map a SCIM group to an organization role (`admin` or `member`). Members of the group receive that organization role on their next SCIM sync. Organization role mapping must be enabled for the SCIM directory in the dashboard; otherwise writes return `409`. [Management key](/docs/guides/overview/auth/management-api-keys) required. + +### Example Usage + +```python +from openrouter import OpenRouter +import os + + +with OpenRouter( + http_referer="", + x_open_router_title="", + x_open_router_categories="", + api_key=os.getenv("OPENROUTER_API_KEY", ""), +) as open_router: + + res = open_router.scim.create_organization_role_mapping(role="member", scim_group_id="d8ef171b-bf4a-489e-9ae2-36debb7b72b2") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `role` | [components.CreateScimOrganizationRoleMappingRequestRole](../../components/createscimorganizationrolemappingrequestrole.mdx) | ✔️ | Organization role granted to members of the mapped SCIM group. | member | +| `scim_group_id` | *str* | ✔️ | N/A | | +| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | + +### Response + +**[components.CreateScimOrganizationRoleMappingResponse](../../components/createscimorganizationrolemappingresponse.mdx)** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | +| errors.BadRequestResponseError | 400 | application/json | +| errors.UnauthorizedResponseError | 401 | application/json | +| errors.ForbiddenResponseError | 403 | application/json | +| errors.NotFoundResponseError | 404 | application/json | +| errors.ConflictResponseError | 409 | application/json | +| errors.InternalServerResponseError | 500 | application/json | +| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | + +## delete_organization_role_mapping + +Delete a SCIM group-to-organization-role mapping. Deleting the last `admin` mapping returns `409`. Organization role mapping must be enabled for the SCIM directory in the dashboard; otherwise writes return `409`. [Management key](/docs/guides/overview/auth/management-api-keys) required. + +### Example Usage + +```python +from openrouter import OpenRouter +import os + + +with OpenRouter( + http_referer="", + x_open_router_title="", + x_open_router_categories="", + api_key=os.getenv("OPENROUTER_API_KEY", ""), +) as open_router: + + res = open_router.scim.delete_organization_role_mapping(id="") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | ✔️ | N/A | +| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| +| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | + +### Response + +**[components.DeleteScimOrganizationRoleMappingResponse](../../components/deletescimorganizationrolemappingresponse.mdx)** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | +| errors.BadRequestResponseError | 400 | application/json | +| errors.UnauthorizedResponseError | 401 | application/json | +| errors.ForbiddenResponseError | 403 | application/json | +| errors.NotFoundResponseError | 404 | application/json | +| errors.ConflictResponseError | 409 | application/json | +| errors.InternalServerResponseError | 500 | application/json | +| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | + ## create_sync_job Start a SCIM directory sync. [Management key](/docs/guides/overview/auth/management-api-keys) required. diff --git a/pyproject.toml b/pyproject.toml index ae837959..a3f11da9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openrouter" -version = "1.3.224" +version = "1.3.225" description = "Official Python Client SDK for OpenRouter." authors = [{ name = "OpenRouter" },] readme = "README-PYPI.md" diff --git a/src/openrouter/_version.py b/src/openrouter/_version.py index 221c1bdb..38d93a7b 100644 --- a/src/openrouter/_version.py +++ b/src/openrouter/_version.py @@ -3,10 +3,10 @@ import importlib.metadata __title__: str = "openrouter" -__version__: str = "1.3.224" +__version__: str = "1.3.225" __openapi_doc_version__: str = "1.0.0" __gen_version__: str = "2.950.13" -__user_agent__: str = "speakeasy-sdk/python 1.3.224 2.950.13 1.0.0 openrouter" +__user_agent__: str = "speakeasy-sdk/python 1.3.225 2.950.13 1.0.0 openrouter" try: if __package__ is not None: diff --git a/src/openrouter/components/__init__.py b/src/openrouter/components/__init__.py index 619d9b1b..99a867e9 100644 --- a/src/openrouter/components/__init__.py +++ b/src/openrouter/components/__init__.py @@ -1672,6 +1672,15 @@ CreateScimGroupMappingResponse, CreateScimGroupMappingResponseTypedDict, ) + from .createscimorganizationrolemappingrequest import ( + CreateScimOrganizationRoleMappingRequest, + CreateScimOrganizationRoleMappingRequestRole, + CreateScimOrganizationRoleMappingRequestTypedDict, + ) + from .createscimorganizationrolemappingresponse import ( + CreateScimOrganizationRoleMappingResponse, + CreateScimOrganizationRoleMappingResponseTypedDict, + ) from .createscimsyncjobresponse import ( CreateScimSyncJobResponse, CreateScimSyncJobResponseTypedDict, @@ -1910,6 +1919,10 @@ DeleteScimGroupMappingResponse, DeleteScimGroupMappingResponseTypedDict, ) + from .deletescimorganizationrolemappingresponse import ( + DeleteScimOrganizationRoleMappingResponse, + DeleteScimOrganizationRoleMappingResponseTypedDict, + ) from .deleteworkspacebudgetresponse import ( DeleteWorkspaceBudgetResponse, DeleteWorkspaceBudgetResponseTypedDict, @@ -2813,6 +2826,10 @@ ListScimGroupsResponse, ListScimGroupsResponseTypedDict, ) + from .listscimorganizationrolemappingsresponse import ( + ListScimOrganizationRoleMappingsResponse, + ListScimOrganizationRoleMappingsResponseTypedDict, + ) from .listtoolsresponse import ( ListToolsResponse, ListToolsResponseLinks, @@ -4596,6 +4613,11 @@ ScimGroupMappingRole, ScimGroupMappingTypedDict, ) + from .scimorganizationrolemapping import ( + ScimOrganizationRoleMapping, + ScimOrganizationRoleMappingRole, + ScimOrganizationRoleMappingTypedDict, + ) from .scimsyncjob import ScimSyncJob, ScimSyncJobStatus, ScimSyncJobTypedDict from .searchcontextsizeenum import SearchContextSizeEnum from .searchmodelsservertool_openrouter import ( @@ -6557,6 +6579,11 @@ "CreateScimGroupMappingRequestTypedDict", "CreateScimGroupMappingResponse", "CreateScimGroupMappingResponseTypedDict", + "CreateScimOrganizationRoleMappingRequest", + "CreateScimOrganizationRoleMappingRequestRole", + "CreateScimOrganizationRoleMappingRequestTypedDict", + "CreateScimOrganizationRoleMappingResponse", + "CreateScimOrganizationRoleMappingResponseTypedDict", "CreateScimSyncJobResponse", "CreateScimSyncJobResponseTypedDict", "CreateWorkspaceRequest", @@ -6706,6 +6733,8 @@ "DeletePrivateEndpointResponseTypedDict", "DeleteScimGroupMappingResponse", "DeleteScimGroupMappingResponseTypedDict", + "DeleteScimOrganizationRoleMappingResponse", + "DeleteScimOrganizationRoleMappingResponseTypedDict", "DeleteWorkspaceBudgetResponse", "DeleteWorkspaceBudgetResponseTypedDict", "DeleteWorkspaceResponse", @@ -7405,6 +7434,8 @@ "ListScimGroupMappingsResponseTypedDict", "ListScimGroupsResponse", "ListScimGroupsResponseTypedDict", + "ListScimOrganizationRoleMappingsResponse", + "ListScimOrganizationRoleMappingsResponseTypedDict", "ListToolsResponse", "ListToolsResponseLinks", "ListToolsResponseLinksTypedDict", @@ -8687,6 +8718,9 @@ "ScimGroupMappingRole", "ScimGroupMappingTypedDict", "ScimGroupTypedDict", + "ScimOrganizationRoleMapping", + "ScimOrganizationRoleMappingRole", + "ScimOrganizationRoleMappingTypedDict", "ScimSyncJob", "ScimSyncJobStatus", "ScimSyncJobTypedDict", @@ -10577,6 +10611,11 @@ "CreateScimGroupMappingRequestTypedDict": ".createscimgroupmappingrequest", "CreateScimGroupMappingResponse": ".createscimgroupmappingresponse", "CreateScimGroupMappingResponseTypedDict": ".createscimgroupmappingresponse", + "CreateScimOrganizationRoleMappingRequest": ".createscimorganizationrolemappingrequest", + "CreateScimOrganizationRoleMappingRequestRole": ".createscimorganizationrolemappingrequest", + "CreateScimOrganizationRoleMappingRequestTypedDict": ".createscimorganizationrolemappingrequest", + "CreateScimOrganizationRoleMappingResponse": ".createscimorganizationrolemappingresponse", + "CreateScimOrganizationRoleMappingResponseTypedDict": ".createscimorganizationrolemappingresponse", "CreateScimSyncJobResponse": ".createscimsyncjobresponse", "CreateScimSyncJobResponseTypedDict": ".createscimsyncjobresponse", "CreateWorkspaceRequest": ".createworkspacerequest", @@ -10744,6 +10783,8 @@ "DeletePrivateEndpointResponseTypedDict": ".deleteprivateendpointresponse", "DeleteScimGroupMappingResponse": ".deletescimgroupmappingresponse", "DeleteScimGroupMappingResponseTypedDict": ".deletescimgroupmappingresponse", + "DeleteScimOrganizationRoleMappingResponse": ".deletescimorganizationrolemappingresponse", + "DeleteScimOrganizationRoleMappingResponseTypedDict": ".deletescimorganizationrolemappingresponse", "DeleteWorkspaceBudgetResponse": ".deleteworkspacebudgetresponse", "DeleteWorkspaceBudgetResponseTypedDict": ".deleteworkspacebudgetresponse", "DeleteWorkspaceResponse": ".deleteworkspaceresponse", @@ -11417,6 +11458,8 @@ "ListScimGroupMappingsResponseTypedDict": ".listscimgroupmappingsresponse", "ListScimGroupsResponse": ".listscimgroupsresponse", "ListScimGroupsResponseTypedDict": ".listscimgroupsresponse", + "ListScimOrganizationRoleMappingsResponse": ".listscimorganizationrolemappingsresponse", + "ListScimOrganizationRoleMappingsResponseTypedDict": ".listscimorganizationrolemappingsresponse", "ListToolsResponse": ".listtoolsresponse", "ListToolsResponseLinks": ".listtoolsresponse", "ListToolsResponseLinksTypedDict": ".listtoolsresponse", @@ -12793,6 +12836,9 @@ "ScimGroupMapping": ".scimgroupmapping", "ScimGroupMappingRole": ".scimgroupmapping", "ScimGroupMappingTypedDict": ".scimgroupmapping", + "ScimOrganizationRoleMapping": ".scimorganizationrolemapping", + "ScimOrganizationRoleMappingRole": ".scimorganizationrolemapping", + "ScimOrganizationRoleMappingTypedDict": ".scimorganizationrolemapping", "ScimSyncJob": ".scimsyncjob", "ScimSyncJobStatus": ".scimsyncjob", "ScimSyncJobTypedDict": ".scimsyncjob", diff --git a/src/openrouter/components/createscimorganizationrolemappingrequest.py b/src/openrouter/components/createscimorganizationrolemappingrequest.py new file mode 100644 index 00000000..19a2e5f0 --- /dev/null +++ b/src/openrouter/components/createscimorganizationrolemappingrequest.py @@ -0,0 +1,29 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel, UnrecognizedStr +from typing import Literal, Union +from typing_extensions import TypedDict + + +CreateScimOrganizationRoleMappingRequestRole = Union[ + Literal[ + "admin", + "member", + ], + UnrecognizedStr, +] +r"""Organization role granted to members of the mapped SCIM group.""" + + +class CreateScimOrganizationRoleMappingRequestTypedDict(TypedDict): + role: CreateScimOrganizationRoleMappingRequestRole + r"""Organization role granted to members of the mapped SCIM group.""" + scim_group_id: str + + +class CreateScimOrganizationRoleMappingRequest(BaseModel): + role: CreateScimOrganizationRoleMappingRequestRole + r"""Organization role granted to members of the mapped SCIM group.""" + + scim_group_id: str diff --git a/src/openrouter/components/createscimorganizationrolemappingresponse.py b/src/openrouter/components/createscimorganizationrolemappingresponse.py new file mode 100644 index 00000000..ab86659c --- /dev/null +++ b/src/openrouter/components/createscimorganizationrolemappingresponse.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .scimorganizationrolemapping import ( + ScimOrganizationRoleMapping, + ScimOrganizationRoleMappingTypedDict, +) +from openrouter.types import BaseModel +from typing_extensions import TypedDict + + +class CreateScimOrganizationRoleMappingResponseTypedDict(TypedDict): + data: ScimOrganizationRoleMappingTypedDict + + +class CreateScimOrganizationRoleMappingResponse(BaseModel): + data: ScimOrganizationRoleMapping diff --git a/src/openrouter/components/deletescimorganizationrolemappingresponse.py b/src/openrouter/components/deletescimorganizationrolemappingresponse.py new file mode 100644 index 00000000..2d79f792 --- /dev/null +++ b/src/openrouter/components/deletescimorganizationrolemappingresponse.py @@ -0,0 +1,26 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel +from openrouter.utils import validate_const +import pydantic +from pydantic.functional_validators import AfterValidator +from typing import Literal +from typing_extensions import Annotated, TypedDict + + +class DeleteScimOrganizationRoleMappingResponseTypedDict(TypedDict): + deleted: Literal[True] + + +class DeleteScimOrganizationRoleMappingResponse(BaseModel): + DELETED: Annotated[ + Annotated[Literal[True], AfterValidator(validate_const(True))], + pydantic.Field(alias="deleted"), + ] = True + + +try: + DeleteScimOrganizationRoleMappingResponse.model_rebuild() +except NameError: + pass diff --git a/src/openrouter/components/listscimorganizationrolemappingsresponse.py b/src/openrouter/components/listscimorganizationrolemappingsresponse.py new file mode 100644 index 00000000..b2868c8f --- /dev/null +++ b/src/openrouter/components/listscimorganizationrolemappingsresponse.py @@ -0,0 +1,26 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .scimorganizationrolemapping import ( + ScimOrganizationRoleMapping, + ScimOrganizationRoleMappingTypedDict, +) +from openrouter.types import BaseModel +from typing import List +from typing_extensions import TypedDict + + +class ListScimOrganizationRoleMappingsResponseTypedDict(TypedDict): + data: List[ScimOrganizationRoleMappingTypedDict] + role_mapping_enabled: bool + r"""Whether organization role mapping is enabled for the SCIM directory. Enable it in the dashboard before creating or deleting mappings.""" + total_count: int + + +class ListScimOrganizationRoleMappingsResponse(BaseModel): + data: List[ScimOrganizationRoleMapping] + + role_mapping_enabled: bool + r"""Whether organization role mapping is enabled for the SCIM directory. Enable it in the dashboard before creating or deleting mappings.""" + + total_count: int diff --git a/src/openrouter/components/scimorganizationrolemapping.py b/src/openrouter/components/scimorganizationrolemapping.py new file mode 100644 index 00000000..dc6e39a2 --- /dev/null +++ b/src/openrouter/components/scimorganizationrolemapping.py @@ -0,0 +1,63 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL, UnrecognizedStr +from pydantic import model_serializer +from typing import Literal, Union +from typing_extensions import TypedDict + + +ScimOrganizationRoleMappingRole = Union[ + Literal[ + "admin", + "member", + ], + UnrecognizedStr, +] +r"""Organization role granted to members of the mapped SCIM group.""" + + +class ScimOrganizationRoleMappingTypedDict(TypedDict): + created_at: str + id: str + precedence: int + r"""Resolution order when a user is in several mapped groups; lower wins.""" + role: ScimOrganizationRoleMappingRole + r"""Organization role granted to members of the mapped SCIM group.""" + scim_group_display_name: str + scim_group_id: Nullable[str] + r"""ID of the SCIM group (from `GET /scim/groups`). `null` when the identity provider group has not been synced yet.""" + updated_at: str + + +class ScimOrganizationRoleMapping(BaseModel): + created_at: str + + id: str + + precedence: int + r"""Resolution order when a user is in several mapped groups; lower wins.""" + + role: ScimOrganizationRoleMappingRole + r"""Organization role granted to members of the mapped SCIM group.""" + + scim_group_display_name: str + + scim_group_id: Nullable[str] + r"""ID of the SCIM group (from `GET /scim/groups`). `null` when the identity provider group has not been synced yet.""" + + updated_at: str + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + m[k] = val + + return m diff --git a/src/openrouter/operations/__init__.py b/src/openrouter/operations/__init__.py index 6d6f4d5c..b5a6b170 100644 --- a/src/openrouter/operations/__init__.py +++ b/src/openrouter/operations/__init__.py @@ -305,6 +305,12 @@ CreateScimGroupMappingRequest, CreateScimGroupMappingRequestTypedDict, ) + from .createscimorganizationrolemapping import ( + CreateScimOrganizationRoleMappingGlobals, + CreateScimOrganizationRoleMappingGlobalsTypedDict, + CreateScimOrganizationRoleMappingRequest, + CreateScimOrganizationRoleMappingRequestTypedDict, + ) from .createscimsyncjob import ( CreateScimSyncJobGlobals, CreateScimSyncJobGlobalsTypedDict, @@ -437,6 +443,12 @@ KeepMembersEnum, KeepMembersTypedDict, ) + from .deletescimorganizationrolemapping import ( + DeleteScimOrganizationRoleMappingGlobals, + DeleteScimOrganizationRoleMappingGlobalsTypedDict, + DeleteScimOrganizationRoleMappingRequest, + DeleteScimOrganizationRoleMappingRequestTypedDict, + ) from .deletevaultsecret import ( DeleteVaultSecretGlobals, DeleteVaultSecretGlobalsTypedDict, @@ -1089,6 +1101,12 @@ ListScimGroupsResponse, ListScimGroupsResponseTypedDict, ) + from .listscimorganizationrolemappings import ( + ListScimOrganizationRoleMappingsGlobals, + ListScimOrganizationRoleMappingsGlobalsTypedDict, + ListScimOrganizationRoleMappingsRequest, + ListScimOrganizationRoleMappingsRequestTypedDict, + ) from .listspeechmodels import ( ListSpeechModelsGlobals, ListSpeechModelsGlobalsTypedDict, @@ -1540,6 +1558,10 @@ "CreateScimGroupMappingGlobalsTypedDict", "CreateScimGroupMappingRequest", "CreateScimGroupMappingRequestTypedDict", + "CreateScimOrganizationRoleMappingGlobals", + "CreateScimOrganizationRoleMappingGlobalsTypedDict", + "CreateScimOrganizationRoleMappingRequest", + "CreateScimOrganizationRoleMappingRequestTypedDict", "CreateScimSyncJobGlobals", "CreateScimSyncJobGlobalsTypedDict", "CreateScimSyncJobRequest", @@ -1629,6 +1651,10 @@ "DeleteScimGroupMappingGlobalsTypedDict", "DeleteScimGroupMappingRequest", "DeleteScimGroupMappingRequestTypedDict", + "DeleteScimOrganizationRoleMappingGlobals", + "DeleteScimOrganizationRoleMappingGlobalsTypedDict", + "DeleteScimOrganizationRoleMappingRequest", + "DeleteScimOrganizationRoleMappingRequestTypedDict", "DeleteVaultSecretGlobals", "DeleteVaultSecretGlobalsTypedDict", "DeleteVaultSecretRequest", @@ -2111,6 +2137,10 @@ "ListScimGroupsRequestTypedDict", "ListScimGroupsResponse", "ListScimGroupsResponseTypedDict", + "ListScimOrganizationRoleMappingsGlobals", + "ListScimOrganizationRoleMappingsGlobalsTypedDict", + "ListScimOrganizationRoleMappingsRequest", + "ListScimOrganizationRoleMappingsRequestTypedDict", "ListSpeechModelsGlobals", "ListSpeechModelsGlobalsTypedDict", "ListSpeechModelsRequest", @@ -2538,6 +2568,10 @@ "CreateScimGroupMappingGlobalsTypedDict": ".createscimgroupmapping", "CreateScimGroupMappingRequest": ".createscimgroupmapping", "CreateScimGroupMappingRequestTypedDict": ".createscimgroupmapping", + "CreateScimOrganizationRoleMappingGlobals": ".createscimorganizationrolemapping", + "CreateScimOrganizationRoleMappingGlobalsTypedDict": ".createscimorganizationrolemapping", + "CreateScimOrganizationRoleMappingRequest": ".createscimorganizationrolemapping", + "CreateScimOrganizationRoleMappingRequestTypedDict": ".createscimorganizationrolemapping", "CreateScimSyncJobGlobals": ".createscimsyncjob", "CreateScimSyncJobGlobalsTypedDict": ".createscimsyncjob", "CreateScimSyncJobRequest": ".createscimsyncjob", @@ -2630,6 +2664,10 @@ "KeepMembers": ".deletescimgroupmapping", "KeepMembersEnum": ".deletescimgroupmapping", "KeepMembersTypedDict": ".deletescimgroupmapping", + "DeleteScimOrganizationRoleMappingGlobals": ".deletescimorganizationrolemapping", + "DeleteScimOrganizationRoleMappingGlobalsTypedDict": ".deletescimorganizationrolemapping", + "DeleteScimOrganizationRoleMappingRequest": ".deletescimorganizationrolemapping", + "DeleteScimOrganizationRoleMappingRequestTypedDict": ".deletescimorganizationrolemapping", "DeleteVaultSecretGlobals": ".deletevaultsecret", "DeleteVaultSecretGlobalsTypedDict": ".deletevaultsecret", "DeleteVaultSecretRequest": ".deletevaultsecret", @@ -3114,6 +3152,10 @@ "ListScimGroupsRequestTypedDict": ".listscimgroups", "ListScimGroupsResponse": ".listscimgroups", "ListScimGroupsResponseTypedDict": ".listscimgroups", + "ListScimOrganizationRoleMappingsGlobals": ".listscimorganizationrolemappings", + "ListScimOrganizationRoleMappingsGlobalsTypedDict": ".listscimorganizationrolemappings", + "ListScimOrganizationRoleMappingsRequest": ".listscimorganizationrolemappings", + "ListScimOrganizationRoleMappingsRequestTypedDict": ".listscimorganizationrolemappings", "ListSpeechModelsGlobals": ".listspeechmodels", "ListSpeechModelsGlobalsTypedDict": ".listspeechmodels", "ListSpeechModelsRequest": ".listspeechmodels", diff --git a/src/openrouter/operations/createscimorganizationrolemapping.py b/src/openrouter/operations/createscimorganizationrolemapping.py new file mode 100644 index 00000000..f0390403 --- /dev/null +++ b/src/openrouter/operations/createscimorganizationrolemapping.py @@ -0,0 +1,146 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.components import ( + createscimorganizationrolemappingrequest as components_createscimorganizationrolemappingrequest, +) +from openrouter.types import BaseModel, UNSET_SENTINEL +from openrouter.utils import FieldMetadata, HeaderMetadata, RequestMetadata +import pydantic +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class CreateScimOrganizationRoleMappingGlobalsTypedDict(TypedDict): + http_referer: NotRequired[str] + r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. + This is used to track API usage per application. + + """ + x_open_router_title: NotRequired[str] + r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + + +class CreateScimOrganizationRoleMappingGlobals(BaseModel): + http_referer: Annotated[ + Optional[str], + pydantic.Field(alias="HTTP-Referer"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. + This is used to track API usage per application. + + """ + + x_open_router_title: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Title"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + """ + + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + + +class CreateScimOrganizationRoleMappingRequestTypedDict(TypedDict): + create_scim_organization_role_mapping_request: components_createscimorganizationrolemappingrequest.CreateScimOrganizationRoleMappingRequestTypedDict + http_referer: NotRequired[str] + r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. + This is used to track API usage per application. + + """ + x_open_router_title: NotRequired[str] + r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + + +class CreateScimOrganizationRoleMappingRequest(BaseModel): + create_scim_organization_role_mapping_request: Annotated[ + components_createscimorganizationrolemappingrequest.CreateScimOrganizationRoleMappingRequest, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] + + http_referer: Annotated[ + Optional[str], + pydantic.Field(alias="HTTP-Referer"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. + This is used to track API usage per application. + + """ + + x_open_router_title: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Title"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + """ + + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/openrouter/operations/deletescimorganizationrolemapping.py b/src/openrouter/operations/deletescimorganizationrolemapping.py new file mode 100644 index 00000000..a115d277 --- /dev/null +++ b/src/openrouter/operations/deletescimorganizationrolemapping.py @@ -0,0 +1,142 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel, UNSET_SENTINEL +from openrouter.utils import FieldMetadata, HeaderMetadata, PathParamMetadata +import pydantic +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class DeleteScimOrganizationRoleMappingGlobalsTypedDict(TypedDict): + http_referer: NotRequired[str] + r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. + This is used to track API usage per application. + + """ + x_open_router_title: NotRequired[str] + r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + + +class DeleteScimOrganizationRoleMappingGlobals(BaseModel): + http_referer: Annotated[ + Optional[str], + pydantic.Field(alias="HTTP-Referer"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. + This is used to track API usage per application. + + """ + + x_open_router_title: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Title"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + """ + + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + + +class DeleteScimOrganizationRoleMappingRequestTypedDict(TypedDict): + id: str + http_referer: NotRequired[str] + r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. + This is used to track API usage per application. + + """ + x_open_router_title: NotRequired[str] + r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + + +class DeleteScimOrganizationRoleMappingRequest(BaseModel): + id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + http_referer: Annotated[ + Optional[str], + pydantic.Field(alias="HTTP-Referer"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. + This is used to track API usage per application. + + """ + + x_open_router_title: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Title"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + """ + + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/openrouter/operations/listscimorganizationrolemappings.py b/src/openrouter/operations/listscimorganizationrolemappings.py new file mode 100644 index 00000000..686972a8 --- /dev/null +++ b/src/openrouter/operations/listscimorganizationrolemappings.py @@ -0,0 +1,137 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel, UNSET_SENTINEL +from openrouter.utils import FieldMetadata, HeaderMetadata +import pydantic +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ListScimOrganizationRoleMappingsGlobalsTypedDict(TypedDict): + http_referer: NotRequired[str] + r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. + This is used to track API usage per application. + + """ + x_open_router_title: NotRequired[str] + r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + + +class ListScimOrganizationRoleMappingsGlobals(BaseModel): + http_referer: Annotated[ + Optional[str], + pydantic.Field(alias="HTTP-Referer"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. + This is used to track API usage per application. + + """ + + x_open_router_title: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Title"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + """ + + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + + +class ListScimOrganizationRoleMappingsRequestTypedDict(TypedDict): + http_referer: NotRequired[str] + r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. + This is used to track API usage per application. + + """ + x_open_router_title: NotRequired[str] + r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + + +class ListScimOrganizationRoleMappingsRequest(BaseModel): + http_referer: Annotated[ + Optional[str], + pydantic.Field(alias="HTTP-Referer"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. + This is used to track API usage per application. + + """ + + x_open_router_title: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Title"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + """ + + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/openrouter/scim.py b/src/openrouter/scim.py index da36fb6c..c06eab04 100644 --- a/src/openrouter/scim.py +++ b/src/openrouter/scim.py @@ -1889,6 +1889,874 @@ async def empty_result(): raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + def list_organization_role_mappings( + self, + *, + http_referer: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> components.ListScimOrganizationRoleMappingsResponse: + r"""List SCIM organization role mappings + + List the SCIM group-to-organization-role mappings for the organization, and whether organization role mapping is enabled. [Management key](/docs/guides/overview/auth/management-api-keys) required. + + :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. + This is used to track API usage per application. + + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = operations.ListScimOrganizationRoleMappingsRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + ) + + req = self._build_request( + method="GET", + path="/scim/organization-role-mappings", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + _globals=operations.ListScimOrganizationRoleMappingsGlobals( + http_referer=self.sdk_configuration.globals.http_referer, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, + ), + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="listScimOrganizationRoleMappings", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + tags=["SCIM"], + extensions=None, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + components.ListScimOrganizationRoleMappingsResponse, http_res + ) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.UnauthorizedResponseErrorData, http_res + ) + raise errors.UnauthorizedResponseError(response_data, http_res) + if utils.match_response(http_res, "403", "application/json"): + response_data = unmarshal_json_response( + errors.ForbiddenResponseErrorData, http_res + ) + raise errors.ForbiddenResponseError(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + errors.NotFoundResponseErrorData, http_res + ) + raise errors.NotFoundResponseError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerResponseErrorData, http_res + ) + raise errors.InternalServerResponseError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + + async def list_organization_role_mappings_async( + self, + *, + http_referer: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> components.ListScimOrganizationRoleMappingsResponse: + r"""List SCIM organization role mappings + + List the SCIM group-to-organization-role mappings for the organization, and whether organization role mapping is enabled. [Management key](/docs/guides/overview/auth/management-api-keys) required. + + :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. + This is used to track API usage per application. + + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = operations.ListScimOrganizationRoleMappingsRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + ) + + req = self._build_request_async( + method="GET", + path="/scim/organization-role-mappings", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + _globals=operations.ListScimOrganizationRoleMappingsGlobals( + http_referer=self.sdk_configuration.globals.http_referer, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, + ), + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="listScimOrganizationRoleMappings", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + tags=["SCIM"], + extensions=None, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + components.ListScimOrganizationRoleMappingsResponse, http_res + ) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.UnauthorizedResponseErrorData, http_res + ) + raise errors.UnauthorizedResponseError(response_data, http_res) + if utils.match_response(http_res, "403", "application/json"): + response_data = unmarshal_json_response( + errors.ForbiddenResponseErrorData, http_res + ) + raise errors.ForbiddenResponseError(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + errors.NotFoundResponseErrorData, http_res + ) + raise errors.NotFoundResponseError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerResponseErrorData, http_res + ) + raise errors.InternalServerResponseError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + + def create_organization_role_mapping( + self, + *, + role: components.CreateScimOrganizationRoleMappingRequestRole, + scim_group_id: str, + http_referer: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> components.CreateScimOrganizationRoleMappingResponse: + r"""Create a SCIM organization role mapping + + Map a SCIM group to an organization role (`admin` or `member`). Members of the group receive that organization role on their next SCIM sync. Organization role mapping must be enabled for the SCIM directory in the dashboard; otherwise writes return `409`. [Management key](/docs/guides/overview/auth/management-api-keys) required. + + :param role: Organization role granted to members of the mapped SCIM group. + :param scim_group_id: + :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. + This is used to track API usage per application. + + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = operations.CreateScimOrganizationRoleMappingRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + create_scim_organization_role_mapping_request=components.CreateScimOrganizationRoleMappingRequest( + role=role, + scim_group_id=scim_group_id, + ), + ) + + req = self._build_request( + method="POST", + path="/scim/organization-role-mappings", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + _globals=operations.CreateScimOrganizationRoleMappingGlobals( + http_referer=self.sdk_configuration.globals.http_referer, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, + ), + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.create_scim_organization_role_mapping_request, + False, + False, + "json", + components.CreateScimOrganizationRoleMappingRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="createScimOrganizationRoleMapping", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + tags=["SCIM"], + extensions=None, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "201", "application/json"): + return unmarshal_json_response( + components.CreateScimOrganizationRoleMappingResponse, http_res + ) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + errors.BadRequestResponseErrorData, http_res + ) + raise errors.BadRequestResponseError(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.UnauthorizedResponseErrorData, http_res + ) + raise errors.UnauthorizedResponseError(response_data, http_res) + if utils.match_response(http_res, "403", "application/json"): + response_data = unmarshal_json_response( + errors.ForbiddenResponseErrorData, http_res + ) + raise errors.ForbiddenResponseError(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + errors.NotFoundResponseErrorData, http_res + ) + raise errors.NotFoundResponseError(response_data, http_res) + if utils.match_response(http_res, "409", "application/json"): + response_data = unmarshal_json_response( + errors.ConflictResponseErrorData, http_res + ) + raise errors.ConflictResponseError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerResponseErrorData, http_res + ) + raise errors.InternalServerResponseError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + + async def create_organization_role_mapping_async( + self, + *, + role: components.CreateScimOrganizationRoleMappingRequestRole, + scim_group_id: str, + http_referer: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> components.CreateScimOrganizationRoleMappingResponse: + r"""Create a SCIM organization role mapping + + Map a SCIM group to an organization role (`admin` or `member`). Members of the group receive that organization role on their next SCIM sync. Organization role mapping must be enabled for the SCIM directory in the dashboard; otherwise writes return `409`. [Management key](/docs/guides/overview/auth/management-api-keys) required. + + :param role: Organization role granted to members of the mapped SCIM group. + :param scim_group_id: + :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. + This is used to track API usage per application. + + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = operations.CreateScimOrganizationRoleMappingRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + create_scim_organization_role_mapping_request=components.CreateScimOrganizationRoleMappingRequest( + role=role, + scim_group_id=scim_group_id, + ), + ) + + req = self._build_request_async( + method="POST", + path="/scim/organization-role-mappings", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + _globals=operations.CreateScimOrganizationRoleMappingGlobals( + http_referer=self.sdk_configuration.globals.http_referer, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, + ), + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.create_scim_organization_role_mapping_request, + False, + False, + "json", + components.CreateScimOrganizationRoleMappingRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="createScimOrganizationRoleMapping", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + tags=["SCIM"], + extensions=None, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "201", "application/json"): + return unmarshal_json_response( + components.CreateScimOrganizationRoleMappingResponse, http_res + ) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + errors.BadRequestResponseErrorData, http_res + ) + raise errors.BadRequestResponseError(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.UnauthorizedResponseErrorData, http_res + ) + raise errors.UnauthorizedResponseError(response_data, http_res) + if utils.match_response(http_res, "403", "application/json"): + response_data = unmarshal_json_response( + errors.ForbiddenResponseErrorData, http_res + ) + raise errors.ForbiddenResponseError(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + errors.NotFoundResponseErrorData, http_res + ) + raise errors.NotFoundResponseError(response_data, http_res) + if utils.match_response(http_res, "409", "application/json"): + response_data = unmarshal_json_response( + errors.ConflictResponseErrorData, http_res + ) + raise errors.ConflictResponseError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerResponseErrorData, http_res + ) + raise errors.InternalServerResponseError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + + def delete_organization_role_mapping( + self, + *, + id: str, + http_referer: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> components.DeleteScimOrganizationRoleMappingResponse: + r"""Delete a SCIM organization role mapping + + Delete a SCIM group-to-organization-role mapping. Deleting the last `admin` mapping returns `409`. Organization role mapping must be enabled for the SCIM directory in the dashboard; otherwise writes return `409`. [Management key](/docs/guides/overview/auth/management-api-keys) required. + + :param id: + :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. + This is used to track API usage per application. + + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = operations.DeleteScimOrganizationRoleMappingRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + id=id, + ) + + req = self._build_request( + method="DELETE", + path="/scim/organization-role-mappings/{id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + _globals=operations.DeleteScimOrganizationRoleMappingGlobals( + http_referer=self.sdk_configuration.globals.http_referer, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, + ), + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="deleteScimOrganizationRoleMapping", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + tags=["SCIM"], + extensions=None, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + components.DeleteScimOrganizationRoleMappingResponse, http_res + ) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + errors.BadRequestResponseErrorData, http_res + ) + raise errors.BadRequestResponseError(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.UnauthorizedResponseErrorData, http_res + ) + raise errors.UnauthorizedResponseError(response_data, http_res) + if utils.match_response(http_res, "403", "application/json"): + response_data = unmarshal_json_response( + errors.ForbiddenResponseErrorData, http_res + ) + raise errors.ForbiddenResponseError(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + errors.NotFoundResponseErrorData, http_res + ) + raise errors.NotFoundResponseError(response_data, http_res) + if utils.match_response(http_res, "409", "application/json"): + response_data = unmarshal_json_response( + errors.ConflictResponseErrorData, http_res + ) + raise errors.ConflictResponseError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerResponseErrorData, http_res + ) + raise errors.InternalServerResponseError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + + async def delete_organization_role_mapping_async( + self, + *, + id: str, + http_referer: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> components.DeleteScimOrganizationRoleMappingResponse: + r"""Delete a SCIM organization role mapping + + Delete a SCIM group-to-organization-role mapping. Deleting the last `admin` mapping returns `409`. Organization role mapping must be enabled for the SCIM directory in the dashboard; otherwise writes return `409`. [Management key](/docs/guides/overview/auth/management-api-keys) required. + + :param id: + :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. + This is used to track API usage per application. + + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = operations.DeleteScimOrganizationRoleMappingRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + id=id, + ) + + req = self._build_request_async( + method="DELETE", + path="/scim/organization-role-mappings/{id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + _globals=operations.DeleteScimOrganizationRoleMappingGlobals( + http_referer=self.sdk_configuration.globals.http_referer, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, + ), + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="deleteScimOrganizationRoleMapping", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + tags=["SCIM"], + extensions=None, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + components.DeleteScimOrganizationRoleMappingResponse, http_res + ) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + errors.BadRequestResponseErrorData, http_res + ) + raise errors.BadRequestResponseError(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.UnauthorizedResponseErrorData, http_res + ) + raise errors.UnauthorizedResponseError(response_data, http_res) + if utils.match_response(http_res, "403", "application/json"): + response_data = unmarshal_json_response( + errors.ForbiddenResponseErrorData, http_res + ) + raise errors.ForbiddenResponseError(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + errors.NotFoundResponseErrorData, http_res + ) + raise errors.NotFoundResponseError(response_data, http_res) + if utils.match_response(http_res, "409", "application/json"): + response_data = unmarshal_json_response( + errors.ConflictResponseErrorData, http_res + ) + raise errors.ConflictResponseError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerResponseErrorData, http_res + ) + raise errors.InternalServerResponseError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + def create_sync_job( self, *, diff --git a/uv.lock b/uv.lock index 3611de4f..2d20cc9e 100644 --- a/uv.lock +++ b/uv.lock @@ -231,7 +231,7 @@ wheels = [ [[package]] name = "openrouter" -version = "1.3.224" +version = "1.3.225" source = { editable = "." } dependencies = [ { name = "httpcore" },