From ebb03c66b808b02d2ab89f2ef75fd562ceb6b527 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Fri, 4 Sep 2026 18:35:45 +0000 Subject: [PATCH 1/2] ## Python SDK Changes: * `open_router.scim.create_sync_job()`: **Added** * `open_router.scim.get_sync_job()`: **Added** --- .speakeasy/gen.lock | 122 ++++- .speakeasy/gen.yaml | 2 +- .speakeasy/out.openapi.yaml | 179 ++++++ .speakeasy/workflow.lock | 10 +- RELEASES.md | 12 +- docs/components/createscimsyncjobresponse.mdx | 9 + docs/components/getscimsyncjobresponse.mdx | 9 + docs/components/scimsyncjob.mdx | 16 + docs/components/scimsyncjobstatus.mdx | 24 + docs/operations/createscimsyncjobglobals.mdx | 11 + docs/operations/createscimsyncjobrequest.mdx | 11 + docs/operations/createscimsyncjobresponse.mdx | 10 + docs/operations/getscimsyncjobglobals.mdx | 11 + docs/operations/getscimsyncjobrequest.mdx | 12 + docs/sdks/scim/README.mdx | 97 ++++ pyproject.toml | 2 +- src/openrouter/_version.py | 4 +- src/openrouter/components/__init__.py | 23 + .../components/createscimsyncjobresponse.py | 14 + .../components/getscimsyncjobresponse.py | 14 + src/openrouter/components/scimsyncjob.py | 78 +++ src/openrouter/operations/__init__.py | 34 ++ .../operations/createscimsyncjob.py | 151 +++++ src/openrouter/operations/getscimsyncjob.py | 142 +++++ src/openrouter/scim.py | 516 ++++++++++++++++++ uv.lock | 2 +- 26 files changed, 1485 insertions(+), 30 deletions(-) create mode 100644 docs/components/createscimsyncjobresponse.mdx create mode 100644 docs/components/getscimsyncjobresponse.mdx create mode 100644 docs/components/scimsyncjob.mdx create mode 100644 docs/components/scimsyncjobstatus.mdx create mode 100644 docs/operations/createscimsyncjobglobals.mdx create mode 100644 docs/operations/createscimsyncjobrequest.mdx create mode 100644 docs/operations/createscimsyncjobresponse.mdx create mode 100644 docs/operations/getscimsyncjobglobals.mdx create mode 100644 docs/operations/getscimsyncjobrequest.mdx create mode 100644 src/openrouter/components/createscimsyncjobresponse.py create mode 100644 src/openrouter/components/getscimsyncjobresponse.py create mode 100644 src/openrouter/components/scimsyncjob.py create mode 100644 src/openrouter/operations/createscimsyncjob.py create mode 100644 src/openrouter/operations/getscimsyncjob.py diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 22d5ec97..804a9e0c 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: 7dc091828a34b67d7e53e3661f10d732 + docChecksum: fb37e352f340b3898e28721b71606d5d docVersion: 1.0.0 speakeasyVersion: 1.787.0 generationVersion: 2.914.0 - releaseVersion: 1.1.123 - configChecksum: 96ead6e5dbcc3deff78f726877f48b85 + releaseVersion: 1.1.124 + configChecksum: b968187363634ff4148bf9663fc26a42 repoURL: https://github.com/OpenRouterTeam/python-sdk.git installationURL: https://github.com/OpenRouterTeam/python-sdk.git published: true persistentEdits: - generation_id: 1df53725-b696-4dea-9c17-1eaf825607f1 - pristine_commit_hash: 01b9c878edb6a28ad0be21677016cc536f67b9ce - pristine_tree_hash: 4272fd0bcdc1e58bc149cb1ee39449cb73770b76 + generation_id: 50294a37-6869-4125-adc7-d5bcbd063480 + pristine_commit_hash: 790f5f097f1936230cf6dd315efaed100064352b + pristine_tree_hash: f7208567cc8e3d4d610e0fba3d590080f117be41 features: python: acceptHeaders: 3.0.0 @@ -1652,6 +1652,10 @@ trackedFiles: id: 1343f81fb7f9 last_write_checksum: sha1:405c1e9143c6d51cebda7e415fb3b981da5e6c83 pristine_git_object: 9ac0db3fbdb1995b37cbe28015dc24425af0660e + docs/components/createscimsyncjobresponse.mdx: + id: 1845762e5b3a + last_write_checksum: sha1:583c2873f92e3c5eca6efe3b36d7c4a9a8789c7a + pristine_git_object: 578411c9c20ce29b38854cf608060bd6e6aec69e docs/components/createworkspacerequest.mdx: id: ea85d6684017 last_write_checksum: sha1:3fd0555fe82dbdff103995079630e6bcb7503795 @@ -2308,6 +2312,10 @@ trackedFiles: id: 59edec5c97d1 last_write_checksum: sha1:e60a199f393362e0182d4b5aa6218294e6c1af48 pristine_git_object: 3031bf1129e51ad652a31b7142154b49fcc4560f + docs/components/getscimsyncjobresponse.mdx: + id: b6ce94617601 + last_write_checksum: sha1:4f7f13820a8f5d4da47e82136568c39d684a0d71 + pristine_git_object: e671eabcbd7f603a2b687276bca29de1b9ac235d docs/components/getworkspacebudgetresponse.mdx: id: 9a7d2b80e512 last_write_checksum: sha1:a299ce75f8736a4d572a06a48e54e00854a63f0b @@ -4856,6 +4864,14 @@ trackedFiles: id: 0306b7b3cf78 last_write_checksum: sha1:93f2d7d1dc60a2b1635202d83ae9f00cc314e2e6 pristine_git_object: 94331ee57f8ebf2b21903d5ebda22e0faf23044a + docs/components/scimsyncjob.mdx: + id: 4016ff89381c + last_write_checksum: sha1:ece2e4108e3e1f0ddf48b2c18001e04acb5b7e71 + pristine_git_object: 8d852b6587a1c0566e2fd496c805cf50a5d04c16 + docs/components/scimsyncjobstatus.mdx: + id: 1fdb0adb6332 + last_write_checksum: sha1:ce8e66b50b882d83464fef01336e9227a514a5cb + pristine_git_object: a319422a67656f477b27f3ed48149e53c6fd8405 docs/components/scope.mdx: id: 25b03f56752e last_write_checksum: sha1:604855944477d8965aa373bbba3c15fa77a8b70d @@ -6356,6 +6372,18 @@ trackedFiles: id: 0cf573a9a3b4 last_write_checksum: sha1:19276108c153ccd0d96cb8330f559085ed6c43c9 pristine_git_object: c5b268ab42e01e5056deaf0d432858cfa147a362 + docs/operations/createscimsyncjobglobals.mdx: + id: 81b32708351d + last_write_checksum: sha1:91a832b54df23932dd4b465fa1f9d69230b0079d + pristine_git_object: 5a954d8d9789dd4a42a713ce5cfada3bd4c577fa + docs/operations/createscimsyncjobrequest.mdx: + id: f90fe2f8c1a0 + last_write_checksum: sha1:1c557fa00de7abfc05b7e0ace778c1a488989c33 + pristine_git_object: 46f2d75c16d7f52b9a41d4175b5012ed4e5e8925 + docs/operations/createscimsyncjobresponse.mdx: + id: 56c7ec9966fa + last_write_checksum: sha1:b98cbf395a3bc9b53b859f3b1e8efe9ee35366bb + pristine_git_object: 1832b155e778ebd9eb28ebc4a4af459b95a1a506 docs/operations/createvideosglobals.mdx: id: 84de29ff23d6 last_write_checksum: sha1:b0e6bc84afd5b4bcdb3f491c64b3f5c15e74d187 @@ -6728,6 +6756,14 @@ trackedFiles: id: d5f5f6747522 last_write_checksum: sha1:f86eff956c41225004a47350e31bfb0842f6b968 pristine_git_object: 65e59b601a99b58683e4af1f7302a21c9ac3ce04 + docs/operations/getscimsyncjobglobals.mdx: + id: af2a67cdfc94 + last_write_checksum: sha1:04ebee712781c6ccd59d441d83e3b816bd31766c + pristine_git_object: 43e7a43da453b59c36e2be6e0a0d7153690af728 + docs/operations/getscimsyncjobrequest.mdx: + id: 12c3450bce68 + last_write_checksum: sha1:0c119f835feca10ea735f10d27e64db8a6f80cec + pristine_git_object: 6cf043dac4cc37cb5e25a8427d428d1f3765b80c docs/operations/getsessioncostglobals.mdx: id: 9d0a1df1aa96 last_write_checksum: sha1:bd37b2d3bdb691f88c20db056035a03d6c332ca1 @@ -7534,8 +7570,8 @@ trackedFiles: pristine_git_object: 4620eda5cda464ad878f498b92604b435021e5fe docs/sdks/scim/README.mdx: id: fd6d8a91a053 - last_write_checksum: sha1:2e06b16b6c9d34300dfe155e8cbde7728c1b6d9c - pristine_git_object: 6fe10f474e510dba25ab1f7a70257408fc0b83d2 + last_write_checksum: sha1:bfa41cca8d71fe5ae3fbdc7462a1f13b402accca + pristine_git_object: bdfdb8fc68c3fc2377cc12ea0f6ee2a8d8c47427 docs/sdks/stt/README.mdx: id: 190b0dc9a5d1 last_write_checksum: sha1:a9885710fd21bb71b4c80a10ad54a20bf47ddca7 @@ -7558,8 +7594,8 @@ trackedFiles: pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544 pyproject.toml: id: 5d07e7d72637 - last_write_checksum: sha1:256541e6e83f3d7c6b89da4f23f4a0f4d338c341 - pristine_git_object: 39da79f245c80b7ed1ba46789bca01c973a3abc9 + last_write_checksum: sha1:9ba71a915e0f43fe5e9b8313ee467cf89e36e014 + pristine_git_object: 0dc5679248a9deca4b9740737096508727226756 scripts/prepare_readme.py: id: e0c5957a6035 last_write_checksum: sha1:77f44b60b98bc126557ec27391f91dfba764bb54 @@ -7586,8 +7622,8 @@ trackedFiles: pristine_git_object: 86713cfea633e09d33b3d4e65281071fe20e6137 src/openrouter/_version.py: id: d8d15ad6c586 - last_write_checksum: sha1:6382be974b1a8b3cf3ca1167b055ef7a4017aca2 - pristine_git_object: 8093dd8c13fa5b4c9132ba9de05b03ce3fda92f6 + last_write_checksum: sha1:6d3b441c93224fe23d278a3fedead501d62b5129 + pristine_git_object: ae345133c528dfacc31267916b607a5ffda9bda7 src/openrouter/analytics.py: id: cb406b5aaabb last_write_checksum: sha1:1e0004d8d1d5d797e2b54cd1cabeb7f9489d08e9 @@ -7626,8 +7662,8 @@ trackedFiles: pristine_git_object: ad3d247954547814054c01989a2dff3d12b3e4e1 src/openrouter/components/__init__.py: id: 81754e97b3f4 - last_write_checksum: sha1:1cf6c72ab08bb8e0d913cff224c6c960be606877 - pristine_git_object: 18024225c70341bc7c9c24257ec87b91751ec68c + last_write_checksum: sha1:1a85e25de993cf2d55d29822e41f284e71db009a + pristine_git_object: 28614d87753d7ebd555d1c7f342fe946484171a5 src/openrouter/components/aabenchmarkentry.py: id: e2e0f0b48c82 last_write_checksum: sha1:fab4d9a24d2cea937bb749d46c5f83941e99d65c @@ -8368,6 +8404,10 @@ trackedFiles: id: f8798c422360 last_write_checksum: sha1:fe554fba7ee3924661b789491b1cc31e4517119d pristine_git_object: 7fde9784d1da97bbd4a70b5a64d72ea8ffa7fe64 + src/openrouter/components/createscimsyncjobresponse.py: + id: 5dada6452185 + last_write_checksum: sha1:f3533b148f303fb26ac595a97269f66405faf416 + pristine_git_object: 3a03248b4aa36f469420c5602df4f5d21a36dd68 src/openrouter/components/createworkspacerequest.py: id: 3785d9b207c2 last_write_checksum: sha1:26d39e88354ea17dc3a9c0156ddc8769dbae33a4 @@ -8652,6 +8692,10 @@ trackedFiles: id: f6dd9e0daa9e last_write_checksum: sha1:0b1ba09ad5da624c4fdbd1bff5d8919e55133cb9 pristine_git_object: cfca9a058673bf7db640c2cec6d8dfc4f87837bd + src/openrouter/components/getscimsyncjobresponse.py: + id: 3e8fd58a9e6f + last_write_checksum: sha1:e229017fe78fa9f455bf9e80022d8d24a2b502da + pristine_git_object: 0512c0e4de62d22081a4037985574191297dee30 src/openrouter/components/getworkspacebudgetresponse.py: id: 5ae557de0b72 last_write_checksum: sha1:49ee6ebadd481997bf9285d709847e5db8c0911c @@ -9652,6 +9696,10 @@ trackedFiles: id: c4d7a895a0bc last_write_checksum: sha1:426befccd88107766691cff08a93741c6f388471 pristine_git_object: b2e0acc56568f3c0ff542ec141c761ad62ddad80 + src/openrouter/components/scimsyncjob.py: + id: a3d7fd291eb2 + last_write_checksum: sha1:2ba3f6314971f5d020f022296fc16bf608ff6505 + pristine_git_object: cc7c404fbad65b557005dcd525d46720baff6d7a src/openrouter/components/searchcontextsizeenum.py: id: c246413c0bd7 last_write_checksum: sha1:863a664a9f17def86180b0407c8233c263acfae7 @@ -10290,8 +10338,8 @@ trackedFiles: pristine_git_object: 5c553b76ab24d9eaef51c3bf6d85aa74391e335e src/openrouter/operations/__init__.py: id: 9afcea1e7161 - last_write_checksum: sha1:c7fed411d14dc37465fc61bf1fe78f9ba3b18ce2 - pristine_git_object: ceac9dee376e4d8c832b3ff4a6cc6e3bec7eb5f4 + last_write_checksum: sha1:534f35479d3f763b301b02511da7c8211209b70e + pristine_git_object: 036bec20dcedd8dc0a8fbccfffc19207dba2dec9 src/openrouter/operations/bulkaddworkspacemembers.py: id: e0ed56117619 last_write_checksum: sha1:5c44eb0d40fdece3ac084615f6c6082be4cf1d5a @@ -10384,6 +10432,10 @@ trackedFiles: id: 48a7da108d46 last_write_checksum: sha1:7d510d57cce56c508847565be44dfe0f2d2812e3 pristine_git_object: 5e9dc6fb071c8087c7edbd766dded2fc19e00c9f + src/openrouter/operations/createscimsyncjob.py: + id: 6e34c289d71d + last_write_checksum: sha1:3395583f3df63ed55df668d1172a9fbe507a47f0 + pristine_git_object: bafc88732217831ec34ae960b8711e2587640ba9 src/openrouter/operations/createvideos.py: id: d52f6a4a3fe4 last_write_checksum: sha1:dbcf7068a23f48a5d4cfd9c8150206731a40cc9b @@ -10508,6 +10560,10 @@ trackedFiles: id: e1222ef7697e last_write_checksum: sha1:e1d1933f745296958538ae7c4bdc8ead53944492 pristine_git_object: d930ef5a4202b0ec9a88329927f7ea6373a7971f + src/openrouter/operations/getscimsyncjob.py: + id: ebdf522b9390 + last_write_checksum: sha1:85e9956e3cf6968cc39f77148f5d032200ed9d19 + pristine_git_object: dac49707b3c24d2c551082315434c062c7b13333 src/openrouter/operations/getsessioncost.py: id: d01a691a6603 last_write_checksum: sha1:aa6af6b0570292ca32e27400e4278ce0b21b3bce @@ -10726,8 +10782,8 @@ trackedFiles: pristine_git_object: 209f35ce4bf4054b4a7735c742eb9e4b82207f9d src/openrouter/scim.py: id: 351afd6b616e - last_write_checksum: sha1:60ce3b9f80f63bad718912b8f8fb166f273985c0 - pristine_git_object: 31215372bf8bffe5ef0994d171854d997440b95d + last_write_checksum: sha1:a26edbea830c109d7de62b14ebd5dab45892cbba + pristine_git_object: 716b78f3ab2001333f8386750621a35b4b76f622 src/openrouter/sdk.py: id: ee9846c4c9c5 last_write_checksum: sha1:d8eeaa771b4d51749dc9f3390793903e842fc0af @@ -12716,5 +12772,33 @@ examples: application/json: {"error": "invalid_grant", "error_description": "The subject token was not accepted."} "500": application/json: {"error": "invalid_grant", "error_description": "The subject token was not accepted."} + createScimSyncJob: + speakeasy-default-create-scim-sync-job: + responses: + "202": + application/json: {"data": {"created_at": "1712777141098", "deleted_groups": 182193, "error_message": null, "finished_at": "", "id": "7d10512f-6c8e-413d-b6f9-117bd47a1c48", "started_at": "", "status": "succeeded", "synced_groups": 985942}} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "404": + application/json: {"error": {"code": 404, "message": "Resource not found"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + getScimSyncJob: + speakeasy-default-get-scim-sync-job: + parameters: + path: + id: "11506961-3c26-4184-a388-53273cc64c83" + responses: + "200": + application/json: {"data": {"created_at": "1709974767907", "deleted_groups": 892856, "error_message": "", "finished_at": "", "id": "07b0436b-79eb-4e01-940e-aa9d5306e4c4", "started_at": "", "status": "queued", "synced_groups": 824296}} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "404": + application/json: {"error": {"code": 404, "message": "Resource not found"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} examplesVersion: 1.0.2 -releaseNotes: "## Python SDK Changes:\n* `open_router.tts.create_speech()`: \n * `request.provider.options.prime_intellect` **Added**\n* `open_router.stt.create_transcription()`: \n * `request.provider.options.prime_intellect` **Added**\n* `open_router.byok.list()`: \n * `request.provider` **Changed**\n * `response.data[].provider.enum(prime_intellect)` **Added**\n* `open_router.byok.create()`: \n * `request.provider.enum(prime_intellect)` **Added**\n * `response.data.provider.enum(prime_intellect)` **Added**\n* `open_router.byok.get()`: `response.data.provider.enum(prime_intellect)` **Added**\n* `open_router.byok.update()`: `response.data.provider.enum(prime_intellect)` **Added**\n* `open_router.chat.send()`: \n * `request.provider.ignore[].union(ProviderName).enum(prime_intellect)` **Added**\n* `open_router.embeddings.generate()`: \n * `request.provider.ignore[].union(ProviderName).enum(prime_intellect)` **Added**\n* `open_router.endpoints.list_zdr_endpoints()`: `response.data[].provider_name.enum(prime_intellect)` **Added**\n* `open_router.endpoints.list()`: `response.data.endpoints[].provider_name.enum(prime_intellect)` **Added**\n* `open_router.generations.get_generation()`: `response.data.provider_responses[].provider_name.enum(prime_intellect)` **Added**\n* `open_router.images.generate()`: `request.provider` **Changed**\n* `open_router.presets.create_presets_chat_completions()`: \n * `request.provider.ignore[].union(ProviderName).enum(prime_intellect)` **Added**\n* `open_router.presets.create_presets_messages()`: \n * `request.provider.ignore[].union(ProviderName).enum(prime_intellect)` **Added**\n* `open_router.presets.create_presets_responses()`: \n * `request.provider.ignore[].union(ProviderName).enum(prime_intellect)` **Added**\n* `open_router.rerank.rerank()`: \n * `request.provider.ignore[].union(ProviderName).enum(prime_intellect)` **Added**\n* `open_router.responses.send()`: \n * `request.provider.ignore[].union(ProviderName).enum(prime_intellect)` **Added**\n* `open_router.beta.responses.send()`: \n * `request.provider.ignore[].union(ProviderName).enum(prime_intellect)` **Added**\n* `open_router.video_generation.generate()`: \n * `request.provider.options.prime_intellect` **Added**\n" +releaseNotes: | + ## Python SDK Changes: + * `open_router.scim.create_sync_job()`: **Added** + * `open_router.scim.get_sync_job()`: **Added** diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index cc063f6f..ff24040c 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -36,7 +36,7 @@ generation: documentation: mintlify preApplyUnionDiscriminators: true python: - version: 1.1.123 + version: 1.1.124 additionalDependencies: dev: {} main: {} diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index 9b0cce03..55f5571f 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -7774,6 +7774,13 @@ components: required: - 'data' type: 'object' + CreateScimSyncJobResponse: + properties: + data: + $ref: '#/components/schemas/ScimSyncJob' + required: + - 'data' + type: 'object' CreateWorkspaceRequest: example: default_image_model: 'openai/dall-e-3' @@ -10160,6 +10167,13 @@ components: required: - 'data' type: 'object' + GetScimSyncJobResponse: + properties: + data: + $ref: '#/components/schemas/ScimSyncJob' + required: + - 'data' + type: 'object' GetWorkspaceBudgetResponse: example: data: @@ -23542,6 +23556,59 @@ components: - 'created_at' - 'updated_at' type: 'object' + ScimSyncJob: + properties: + created_at: + description: 'Time when the sync job was created.' + type: 'string' + deleted_groups: + description: 'Number of groups deleted, when the job completed successfully.' + type: + - 'integer' + - 'null' + error_message: + description: 'Stable error message when the job failed.' + type: + - 'string' + - 'null' + finished_at: + description: 'Time when synchronization finished.' + type: + - 'string' + - 'null' + id: + description: 'Unique identifier for the sync job.' + format: 'uuid' + type: 'string' + started_at: + description: 'Time when synchronization started.' + type: + - 'string' + - 'null' + status: + description: 'Current status of the sync job: queued, running, succeeded, or failed.' + enum: + - 'queued' + - 'running' + - 'succeeded' + - 'failed' + type: 'string' + x-speakeasy-unknown-values: allow + synced_groups: + description: 'Number of groups synchronized, when the job completed successfully.' + type: + - 'integer' + - 'null' + required: + - 'id' + - 'status' + - 'synced_groups' + - 'deleted_groups' + - 'error_message' + - 'created_at' + - 'started_at' + - 'finished_at' + type: 'object' SearchContextSizeEnum: description: 'Size of the search context for web search tools' enum: @@ -39888,6 +39955,118 @@ paths: - $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.' + operationId: 'createScimSyncJob' + responses: + '202': + content: + application/json: + schema: + $ref: '#/components/schemas/CreateScimSyncJobResponse' + description: 'SCIM directory sync job queued' + headers: + Location: + description: 'Poll URL for the created sync job.' + required: true + schema: + description: 'Poll URL for the created sync job.' + type: 'string' + '401': + content: + application/json: + example: + error: + code: 401 + message: 'Missing Authentication header' + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Authentication required or invalid credentials' + '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: 'Start a SCIM directory sync' + tags: + - 'SCIM' + x-speakeasy-name-override: 'createSyncJob' + parameters: + - $ref: "#/components/parameters/AppIdentifier" + - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" + /scim/sync-jobs/{id}: + get: + description: 'Get SCIM directory sync status. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'getScimSyncJob' + parameters: + - in: 'path' + name: 'id' + required: true + schema: + format: 'uuid' + type: 'string' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/GetScimSyncJobResponse' + description: 'SCIM directory sync job' + '401': + content: + application/json: + example: + error: + code: 401 + message: 'Missing Authentication header' + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Authentication required or invalid credentials' + '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: 'Get SCIM directory sync status' + tags: + - 'SCIM' + x-speakeasy-name-override: 'getSyncJob' + parameters: + - $ref: "#/components/parameters/AppIdentifier" + - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" /videos: post: description: 'Submits a video generation request and returns a polling URL to check status' diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 11926e7a..7a79fa4a 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -2,8 +2,8 @@ speakeasyVersion: 1.787.0 sources: OpenRouter API: sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:a96978f94ecbed7c8a443648aa788583c0e319d8bc852ded3915e3e4df71d836 - sourceBlobDigest: sha256:c2b8d66c7926b883eeea511f3f9e07b4c271d3682ab7b6aefb6036abf320a3d7 + sourceRevisionDigest: sha256:1aedcfb94f66b52fb2bde9c7cd3ce301c7d8e14cec4936b490df48dc2370fac8 + sourceBlobDigest: sha256:3d47f04125c0b15adf1ea7b905278094f3a1d4e80a6df17e62e9fad7cf882cb7 tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: open-router: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:a96978f94ecbed7c8a443648aa788583c0e319d8bc852ded3915e3e4df71d836 - sourceBlobDigest: sha256:c2b8d66c7926b883eeea511f3f9e07b4c271d3682ab7b6aefb6036abf320a3d7 + sourceRevisionDigest: sha256:1aedcfb94f66b52fb2bde9c7cd3ce301c7d8e14cec4936b490df48dc2370fac8 + sourceBlobDigest: sha256:3d47f04125c0b15adf1ea7b905278094f3a1d4e80a6df17e62e9fad7cf882cb7 codeSamplesNamespace: open-router-python-code-samples - codeSamplesRevisionDigest: sha256:5e583cb23b685a6344bf4202d9c03f33d81de8e8799607d9242504d1ac84a3db + codeSamplesRevisionDigest: sha256:2f2b93a68a46b87b676a42bfbf4b32fe18a97fa132c88979f7911c6cb445172f workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.787.0 diff --git a/RELEASES.md b/RELEASES.md index 3e35c405..700bd94e 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -2019,4 +2019,14 @@ Based on: ### Generated - [python v1.1.123] . ### Releases -- [PyPI v1.1.123] https://pypi.org/project/openrouter/1.1.123 - . \ No newline at end of file +- [PyPI v1.1.123] https://pypi.org/project/openrouter/1.1.123 - . + +## 2026-09-04 18:33:31 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v1.1.124] . +### Releases +- [PyPI v1.1.124] https://pypi.org/project/openrouter/1.1.124 - . \ No newline at end of file diff --git a/docs/components/createscimsyncjobresponse.mdx b/docs/components/createscimsyncjobresponse.mdx new file mode 100644 index 00000000..578411c9 --- /dev/null +++ b/docs/components/createscimsyncjobresponse.mdx @@ -0,0 +1,9 @@ +--- +title: "CreateScimSyncJobResponse" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | +| `data` | [components.ScimSyncJob](../components/scimsyncjob.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/getscimsyncjobresponse.mdx b/docs/components/getscimsyncjobresponse.mdx new file mode 100644 index 00000000..e671eabc --- /dev/null +++ b/docs/components/getscimsyncjobresponse.mdx @@ -0,0 +1,9 @@ +--- +title: "GetScimSyncJobResponse" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | +| `data` | [components.ScimSyncJob](../components/scimsyncjob.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/scimsyncjob.mdx b/docs/components/scimsyncjob.mdx new file mode 100644 index 00000000..8d852b65 --- /dev/null +++ b/docs/components/scimsyncjob.mdx @@ -0,0 +1,16 @@ +--- +title: "ScimSyncJob" +--- + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `created_at` | *str* | :heavy_check_mark: | Time when the sync job was created. | +| `deleted_groups` | *Nullable[int]* | :heavy_check_mark: | Number of groups deleted, when the job completed successfully. | +| `error_message` | *Nullable[str]* | :heavy_check_mark: | Stable error message when the job failed. | +| `finished_at` | *Nullable[str]* | :heavy_check_mark: | Time when synchronization finished. | +| `id` | *str* | :heavy_check_mark: | Unique identifier for the sync job. | +| `started_at` | *Nullable[str]* | :heavy_check_mark: | Time when synchronization started. | +| `status` | [components.ScimSyncJobStatus](../components/scimsyncjobstatus.mdx) | :heavy_check_mark: | Current status of the sync job: queued, running, succeeded, or failed. | +| `synced_groups` | *Nullable[int]* | :heavy_check_mark: | Number of groups synchronized, when the job completed successfully. | \ No newline at end of file diff --git a/docs/components/scimsyncjobstatus.mdx b/docs/components/scimsyncjobstatus.mdx new file mode 100644 index 00000000..a319422a --- /dev/null +++ b/docs/components/scimsyncjobstatus.mdx @@ -0,0 +1,24 @@ +--- +title: "ScimSyncJobStatus" +--- + +Current status of the sync job: queued, running, succeeded, or failed. + +## Example Usage + +```python +from openrouter.components import ScimSyncJobStatus + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: ScimSyncJobStatus = "queued" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"queued"` +- `"running"` +- `"succeeded"` +- `"failed"` diff --git a/docs/operations/createscimsyncjobglobals.mdx b/docs/operations/createscimsyncjobglobals.mdx new file mode 100644 index 00000000..5a954d8d --- /dev/null +++ b/docs/operations/createscimsyncjobglobals.mdx @@ -0,0 +1,11 @@ +--- +title: "CreateScimSyncJobGlobals" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | 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]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | 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/createscimsyncjobrequest.mdx b/docs/operations/createscimsyncjobrequest.mdx new file mode 100644 index 00000000..46f2d75c --- /dev/null +++ b/docs/operations/createscimsyncjobrequest.mdx @@ -0,0 +1,11 @@ +--- +title: "CreateScimSyncJobRequest" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | 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]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | 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/createscimsyncjobresponse.mdx b/docs/operations/createscimsyncjobresponse.mdx new file mode 100644 index 00000000..1832b155 --- /dev/null +++ b/docs/operations/createscimsyncjobresponse.mdx @@ -0,0 +1,10 @@ +--- +title: "CreateScimSyncJobResponse" +--- + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `headers` | Dict[str, List[*str*]] | :heavy_check_mark: | N/A | +| `result` | [components.CreateScimSyncJobResponse](../components/createscimsyncjobresponse.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/operations/getscimsyncjobglobals.mdx b/docs/operations/getscimsyncjobglobals.mdx new file mode 100644 index 00000000..43e7a43d --- /dev/null +++ b/docs/operations/getscimsyncjobglobals.mdx @@ -0,0 +1,11 @@ +--- +title: "GetScimSyncJobGlobals" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | 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]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | 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/getscimsyncjobrequest.mdx b/docs/operations/getscimsyncjobrequest.mdx new file mode 100644 index 00000000..6cf043da --- /dev/null +++ b/docs/operations/getscimsyncjobrequest.mdx @@ -0,0 +1,12 @@ +--- +title: "GetScimSyncJobRequest" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | 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]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| +| `id` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdks/scim/README.mdx b/docs/sdks/scim/README.mdx index 6fe10f47..bdfdb8fc 100644 --- a/docs/sdks/scim/README.mdx +++ b/docs/sdks/scim/README.mdx @@ -15,6 +15,8 @@ SCIM endpoints * [read](#read) - Get a SCIM group mapping * [update](#update) - Update a SCIM group mapping * [list_groups](#list_groups) - List SCIM groups +* [create_sync_job](#create_sync_job) - Start a SCIM directory sync +* [get_sync_job](#get_sync_job) - Get SCIM directory sync status ## list_mappings @@ -311,6 +313,101 @@ with OpenRouter( ### Errors +| Error Type | Status Code | Content Type | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | +| errors.UnauthorizedResponseError | 401 | application/json | +| errors.NotFoundResponseError | 404 | 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. + +### 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_sync_job() + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | 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]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[operations.CreateScimSyncJobResponse](../../operations/createscimsyncjobresponse.mdx)** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | +| errors.UnauthorizedResponseError | 401 | application/json | +| errors.NotFoundResponseError | 404 | application/json | +| errors.InternalServerResponseError | 500 | application/json | +| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | + +## get_sync_job + +Get SCIM directory sync status. [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.get_sync_job(id="11506961-3c26-4184-a388-53273cc64c83") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | N/A | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | 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]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[components.GetScimSyncJobResponse](../../components/getscimsyncjobresponse.mdx)** + +### Errors + | Error Type | Status Code | Content Type | | ---------------------------------- | ---------------------------------- | ---------------------------------- | | errors.UnauthorizedResponseError | 401 | application/json | diff --git a/pyproject.toml b/pyproject.toml index 39da79f2..0dc56792 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openrouter" -version = "1.1.123" +version = "1.1.124" 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 8093dd8c..ae345133 100644 --- a/src/openrouter/_version.py +++ b/src/openrouter/_version.py @@ -3,10 +3,10 @@ import importlib.metadata __title__: str = "openrouter" -__version__: str = "1.1.123" +__version__: str = "1.1.124" __openapi_doc_version__: str = "1.0.0" __gen_version__: str = "2.914.0" -__user_agent__: str = "speakeasy-sdk/python 1.1.123 2.914.0 1.0.0 openrouter" +__user_agent__: str = "speakeasy-sdk/python 1.1.124 2.914.0 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 18024225..28614d87 100644 --- a/src/openrouter/components/__init__.py +++ b/src/openrouter/components/__init__.py @@ -892,6 +892,10 @@ CreateScimGroupMappingResponse, CreateScimGroupMappingResponseTypedDict, ) + from .createscimsyncjobresponse import ( + CreateScimSyncJobResponse, + CreateScimSyncJobResponseTypedDict, + ) from .createworkspacerequest import ( CreateWorkspaceRequest, CreateWorkspaceRequestTypedDict, @@ -1264,6 +1268,10 @@ GetScimGroupMappingResponse, GetScimGroupMappingResponseTypedDict, ) + from .getscimsyncjobresponse import ( + GetScimSyncJobResponse, + GetScimSyncJobResponseTypedDict, + ) from .getworkspacebudgetresponse import ( GetWorkspaceBudgetResponse, GetWorkspaceBudgetResponseTypedDict, @@ -2728,6 +2736,7 @@ ScimGroupMappingRole, ScimGroupMappingTypedDict, ) + from .scimsyncjob import ScimSyncJob, ScimSyncJobStatus, ScimSyncJobTypedDict from .searchcontextsizeenum import SearchContextSizeEnum from .searchmodelsservertool_openrouter import ( SearchModelsServerToolOpenRouter, @@ -3859,6 +3868,8 @@ "CreateScimGroupMappingRequestTypedDict", "CreateScimGroupMappingResponse", "CreateScimGroupMappingResponseTypedDict", + "CreateScimSyncJobResponse", + "CreateScimSyncJobResponseTypedDict", "CreateWorkspaceRequest", "CreateWorkspaceRequestTypedDict", "CreateWorkspaceResponse", @@ -4123,6 +4134,8 @@ "GetPresetVersionResponseTypedDict", "GetScimGroupMappingResponse", "GetScimGroupMappingResponseTypedDict", + "GetScimSyncJobResponse", + "GetScimSyncJobResponseTypedDict", "GetWorkspaceBudgetResponse", "GetWorkspaceBudgetResponseTypedDict", "GetWorkspaceResponse", @@ -5139,6 +5152,9 @@ "ScimGroupMappingRole", "ScimGroupMappingTypedDict", "ScimGroupTypedDict", + "ScimSyncJob", + "ScimSyncJobStatus", + "ScimSyncJobTypedDict", "Scope", "SearchContextSizeEnum", "SearchModelsServerToolConfig", @@ -6192,6 +6208,8 @@ "CreateScimGroupMappingRequestTypedDict": ".createscimgroupmappingrequest", "CreateScimGroupMappingResponse": ".createscimgroupmappingresponse", "CreateScimGroupMappingResponseTypedDict": ".createscimgroupmappingresponse", + "CreateScimSyncJobResponse": ".createscimsyncjobresponse", + "CreateScimSyncJobResponseTypedDict": ".createscimsyncjobresponse", "CreateWorkspaceRequest": ".createworkspacerequest", "CreateWorkspaceRequestTypedDict": ".createworkspacerequest", "CreateWorkspaceResponse": ".createworkspaceresponse", @@ -6469,6 +6487,8 @@ "GetPresetVersionResponseTypedDict": ".getpresetversionresponse", "GetScimGroupMappingResponse": ".getscimgroupmappingresponse", "GetScimGroupMappingResponseTypedDict": ".getscimgroupmappingresponse", + "GetScimSyncJobResponse": ".getscimsyncjobresponse", + "GetScimSyncJobResponseTypedDict": ".getscimsyncjobresponse", "GetWorkspaceBudgetResponse": ".getworkspacebudgetresponse", "GetWorkspaceBudgetResponseTypedDict": ".getworkspacebudgetresponse", "GetWorkspaceResponse": ".getworkspaceresponse", @@ -7601,6 +7621,9 @@ "ScimGroupMapping": ".scimgroupmapping", "ScimGroupMappingRole": ".scimgroupmapping", "ScimGroupMappingTypedDict": ".scimgroupmapping", + "ScimSyncJob": ".scimsyncjob", + "ScimSyncJobStatus": ".scimsyncjob", + "ScimSyncJobTypedDict": ".scimsyncjob", "SearchContextSizeEnum": ".searchcontextsizeenum", "SearchModelsServerToolOpenRouter": ".searchmodelsservertool_openrouter", "SearchModelsServerToolOpenRouterType": ".searchmodelsservertool_openrouter", diff --git a/src/openrouter/components/createscimsyncjobresponse.py b/src/openrouter/components/createscimsyncjobresponse.py new file mode 100644 index 00000000..3a03248b --- /dev/null +++ b/src/openrouter/components/createscimsyncjobresponse.py @@ -0,0 +1,14 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .scimsyncjob import ScimSyncJob, ScimSyncJobTypedDict +from openrouter.types import BaseModel +from typing_extensions import TypedDict + + +class CreateScimSyncJobResponseTypedDict(TypedDict): + data: ScimSyncJobTypedDict + + +class CreateScimSyncJobResponse(BaseModel): + data: ScimSyncJob diff --git a/src/openrouter/components/getscimsyncjobresponse.py b/src/openrouter/components/getscimsyncjobresponse.py new file mode 100644 index 00000000..0512c0e4 --- /dev/null +++ b/src/openrouter/components/getscimsyncjobresponse.py @@ -0,0 +1,14 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .scimsyncjob import ScimSyncJob, ScimSyncJobTypedDict +from openrouter.types import BaseModel +from typing_extensions import TypedDict + + +class GetScimSyncJobResponseTypedDict(TypedDict): + data: ScimSyncJobTypedDict + + +class GetScimSyncJobResponse(BaseModel): + data: ScimSyncJob diff --git a/src/openrouter/components/scimsyncjob.py b/src/openrouter/components/scimsyncjob.py new file mode 100644 index 00000000..cc7c404f --- /dev/null +++ b/src/openrouter/components/scimsyncjob.py @@ -0,0 +1,78 @@ +"""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 + + +ScimSyncJobStatus = Union[ + Literal[ + "queued", + "running", + "succeeded", + "failed", + ], + UnrecognizedStr, +] +r"""Current status of the sync job: queued, running, succeeded, or failed.""" + + +class ScimSyncJobTypedDict(TypedDict): + created_at: str + r"""Time when the sync job was created.""" + deleted_groups: Nullable[int] + r"""Number of groups deleted, when the job completed successfully.""" + error_message: Nullable[str] + r"""Stable error message when the job failed.""" + finished_at: Nullable[str] + r"""Time when synchronization finished.""" + id: str + r"""Unique identifier for the sync job.""" + started_at: Nullable[str] + r"""Time when synchronization started.""" + status: ScimSyncJobStatus + r"""Current status of the sync job: queued, running, succeeded, or failed.""" + synced_groups: Nullable[int] + r"""Number of groups synchronized, when the job completed successfully.""" + + +class ScimSyncJob(BaseModel): + created_at: str + r"""Time when the sync job was created.""" + + deleted_groups: Nullable[int] + r"""Number of groups deleted, when the job completed successfully.""" + + error_message: Nullable[str] + r"""Stable error message when the job failed.""" + + finished_at: Nullable[str] + r"""Time when synchronization finished.""" + + id: str + r"""Unique identifier for the sync job.""" + + started_at: Nullable[str] + r"""Time when synchronization started.""" + + status: ScimSyncJobStatus + r"""Current status of the sync job: queued, running, succeeded, or failed.""" + + synced_groups: Nullable[int] + r"""Number of groups synchronized, when the job completed successfully.""" + + @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 ceac9dee..036bec20 100644 --- a/src/openrouter/operations/__init__.py +++ b/src/openrouter/operations/__init__.py @@ -217,6 +217,14 @@ CreateScimGroupMappingRequest, CreateScimGroupMappingRequestTypedDict, ) + from .createscimsyncjob import ( + CreateScimSyncJobGlobals, + CreateScimSyncJobGlobalsTypedDict, + CreateScimSyncJobRequest, + CreateScimSyncJobRequestTypedDict, + CreateScimSyncJobResponse, + CreateScimSyncJobResponseTypedDict, + ) from .createvideos import ( CreateVideosGlobals, CreateVideosGlobalsTypedDict, @@ -465,6 +473,12 @@ GetScimGroupMappingRequest, GetScimGroupMappingRequestTypedDict, ) + from .getscimsyncjob import ( + GetScimSyncJobGlobals, + GetScimSyncJobGlobalsTypedDict, + GetScimSyncJobRequest, + GetScimSyncJobRequestTypedDict, + ) from .getsessioncost import ( GetSessionCostGlobals, GetSessionCostGlobalsTypedDict, @@ -1010,6 +1024,12 @@ "CreateScimGroupMappingGlobalsTypedDict", "CreateScimGroupMappingRequest", "CreateScimGroupMappingRequestTypedDict", + "CreateScimSyncJobGlobals", + "CreateScimSyncJobGlobalsTypedDict", + "CreateScimSyncJobRequest", + "CreateScimSyncJobRequestTypedDict", + "CreateScimSyncJobResponse", + "CreateScimSyncJobResponseTypedDict", "CreateVideosGlobals", "CreateVideosGlobalsTypedDict", "CreateVideosRequest", @@ -1185,6 +1205,10 @@ "GetScimGroupMappingGlobalsTypedDict", "GetScimGroupMappingRequest", "GetScimGroupMappingRequestTypedDict", + "GetScimSyncJobGlobals", + "GetScimSyncJobGlobalsTypedDict", + "GetScimSyncJobRequest", + "GetScimSyncJobRequestTypedDict", "GetSessionCostGlobals", "GetSessionCostGlobalsTypedDict", "GetSessionCostRequest", @@ -1680,6 +1704,12 @@ "CreateScimGroupMappingGlobalsTypedDict": ".createscimgroupmapping", "CreateScimGroupMappingRequest": ".createscimgroupmapping", "CreateScimGroupMappingRequestTypedDict": ".createscimgroupmapping", + "CreateScimSyncJobGlobals": ".createscimsyncjob", + "CreateScimSyncJobGlobalsTypedDict": ".createscimsyncjob", + "CreateScimSyncJobRequest": ".createscimsyncjob", + "CreateScimSyncJobRequestTypedDict": ".createscimsyncjob", + "CreateScimSyncJobResponse": ".createscimsyncjob", + "CreateScimSyncJobResponseTypedDict": ".createscimsyncjob", "CreateVideosGlobals": ".createvideos", "CreateVideosGlobalsTypedDict": ".createvideos", "CreateVideosRequest": ".createvideos", @@ -1866,6 +1896,10 @@ "GetScimGroupMappingGlobalsTypedDict": ".getscimgroupmapping", "GetScimGroupMappingRequest": ".getscimgroupmapping", "GetScimGroupMappingRequestTypedDict": ".getscimgroupmapping", + "GetScimSyncJobGlobals": ".getscimsyncjob", + "GetScimSyncJobGlobalsTypedDict": ".getscimsyncjob", + "GetScimSyncJobRequest": ".getscimsyncjob", + "GetScimSyncJobRequestTypedDict": ".getscimsyncjob", "GetSessionCostGlobals": ".getsessioncost", "GetSessionCostGlobalsTypedDict": ".getsessioncost", "GetSessionCostRequest": ".getsessioncost", diff --git a/src/openrouter/operations/createscimsyncjob.py b/src/openrouter/operations/createscimsyncjob.py new file mode 100644 index 00000000..bafc8873 --- /dev/null +++ b/src/openrouter/operations/createscimsyncjob.py @@ -0,0 +1,151 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.components import ( + createscimsyncjobresponse as components_createscimsyncjobresponse, +) +from openrouter.types import BaseModel, UNSET_SENTINEL +from openrouter.utils import FieldMetadata, HeaderMetadata +import pydantic +from pydantic import model_serializer +from typing import Dict, List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class CreateScimSyncJobGlobalsTypedDict(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 CreateScimSyncJobGlobals(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 CreateScimSyncJobRequestTypedDict(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 CreateScimSyncJobRequest(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 CreateScimSyncJobResponseTypedDict(TypedDict): + headers: Dict[str, List[str]] + result: components_createscimsyncjobresponse.CreateScimSyncJobResponseTypedDict + + +class CreateScimSyncJobResponse(BaseModel): + headers: Dict[str, List[str]] + + result: components_createscimsyncjobresponse.CreateScimSyncJobResponse diff --git a/src/openrouter/operations/getscimsyncjob.py b/src/openrouter/operations/getscimsyncjob.py new file mode 100644 index 00000000..dac49707 --- /dev/null +++ b/src/openrouter/operations/getscimsyncjob.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 GetScimSyncJobGlobalsTypedDict(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 GetScimSyncJobGlobals(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 GetScimSyncJobRequestTypedDict(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 GetScimSyncJobRequest(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/scim.py b/src/openrouter/scim.py index 31215372..716b78f3 100644 --- a/src/openrouter/scim.py +++ b/src/openrouter/scim.py @@ -1812,3 +1812,519 @@ async def empty_result(): ) raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + + def create_sync_job( + 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, + ) -> operations.CreateScimSyncJobResponse: + r"""Start a SCIM directory sync + + Start a SCIM directory sync. [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.CreateScimSyncJobRequest( + 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="POST", + path="/scim/sync-jobs", + 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.CreateScimSyncJobGlobals( + 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="createScimSyncJob", + 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, "202", "application/json"): + return operations.CreateScimSyncJobResponse( + result=unmarshal_json_response( + components.CreateScimSyncJobResponse, http_res + ), + headers=utils.get_response_headers(http_res.headers), + ) + 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, "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 create_sync_job_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, + ) -> operations.CreateScimSyncJobResponse: + r"""Start a SCIM directory sync + + Start a SCIM directory sync. [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.CreateScimSyncJobRequest( + 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="POST", + path="/scim/sync-jobs", + 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.CreateScimSyncJobGlobals( + 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="createScimSyncJob", + 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, "202", "application/json"): + return operations.CreateScimSyncJobResponse( + result=unmarshal_json_response( + components.CreateScimSyncJobResponse, http_res + ), + headers=utils.get_response_headers(http_res.headers), + ) + 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, "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 get_sync_job( + 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.GetScimSyncJobResponse: + r"""Get SCIM directory sync status + + Get SCIM directory sync status. [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.GetScimSyncJobRequest( + 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="GET", + path="/scim/sync-jobs/{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.GetScimSyncJobGlobals( + 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="getScimSyncJob", + 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.GetScimSyncJobResponse, 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, "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 get_sync_job_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.GetScimSyncJobResponse: + r"""Get SCIM directory sync status + + Get SCIM directory sync status. [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.GetScimSyncJobRequest( + 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="GET", + path="/scim/sync-jobs/{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.GetScimSyncJobGlobals( + 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="getScimSyncJob", + 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.GetScimSyncJobResponse, 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, "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) diff --git a/uv.lock b/uv.lock index e6f17a22..1adb88b3 100644 --- a/uv.lock +++ b/uv.lock @@ -213,7 +213,7 @@ wheels = [ [[package]] name = "openrouter" -version = "1.1.123" +version = "1.1.124" source = { editable = "." } dependencies = [ { name = "httpcore" }, From 0549be81cfae6362e4f222dbaccedd9c563e1eda Mon Sep 17 00:00:00 2001 From: "speakeasy-github[bot]" <128539517+speakeasy-github[bot]@users.noreply.github.com> Date: Fri, 4 Sep 2026 18:35:52 +0000 Subject: [PATCH 2/2] empty commit to trigger [run-tests] workflow