diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 0527cece..f6442c7a 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: b0b519b1-d1d3-43b2-82dd-b4292eadd4b0 management: - docChecksum: 6c6e24cc570ee7f26269ffaf57ab867a + docChecksum: 29de89c5206efbdc7ca51981624f0a8e docVersion: 0.4.0 - speakeasyVersion: 1.462.2 - generationVersion: 2.486.1 - releaseVersion: 7.0.0-rc.2 - configChecksum: 07992011caf9f99ff590ca4c58d854c1 + speakeasyVersion: 1.469.1 + generationVersion: 2.493.21 + releaseVersion: 7.0.0-rc.3 + configChecksum: 0bb14d421fd67b548796c8b7dba041a6 repoURL: https://github.com/speakeasy-api/speakeasy-client-sdk-python.git repoSubDirectory: . installationURL: https://github.com/speakeasy-api/speakeasy-client-sdk-python.git @@ -15,9 +15,10 @@ features: python: acceptHeaders: 3.0.0 additionalDependencies: 1.0.0 - core: 5.7.4 + core: 5.10.2 + deepObjectParams: 0.1.0 defaultEnabledRetries: 0.2.0 - deprecations: 3.0.1 + deprecations: 3.0.2 downloadStreams: 1.0.1 enumUnions: 0.1.0 envVarSecurityUsage: 0.3.2 @@ -38,7 +39,6 @@ generatedFiles: - .gitattributes - .python-version - .vscode/settings.json - - CONTRIBUTING.md - USAGE.md - docs/models/errors/error.md - docs/models/internal/globals.md @@ -138,6 +138,7 @@ generatedFiles: - docs/models/operations/linkgithubaccessresponse.md - docs/models/operations/listremotesourcesrequest.md - docs/models/operations/listremotesourcesresponse.md + - docs/models/operations/methodpaths.md - docs/models/operations/posttagsrequest.md - docs/models/operations/posttagsresponse.md - docs/models/operations/postworkspaceeventsglobals.md @@ -154,6 +155,7 @@ generatedFiles: - docs/models/operations/setvisibilityrequest.md - docs/models/operations/setvisibilityrequestbody.md - docs/models/operations/setvisibilityresponse.md + - docs/models/operations/setworkspacefeatureflagsresponse.md - docs/models/operations/suggestitemsresponse.md - docs/models/operations/suggestopenapiregistryrequest.md - docs/models/operations/suggestopenapiregistryresponse.md @@ -202,6 +204,7 @@ generatedFiles: - docs/models/shared/githubsetupstateresponse.md - docs/models/shared/githubstorepublishingsecretsrequest.md - docs/models/shared/githubtriggeractionrequest.md + - docs/models/shared/httpmethod.md - docs/models/shared/interactiontype.md - docs/models/shared/level.md - docs/models/shared/license.md @@ -216,6 +219,7 @@ generatedFiles: - docs/models/shared/organizationusageresponse.md - docs/models/shared/preflightrequest.md - docs/models/shared/preflighttoken.md + - docs/models/shared/pullrequestmetadata.md - docs/models/shared/relationship.md - docs/models/shared/remotedocument.md - docs/models/shared/remotesource.md @@ -242,6 +246,8 @@ generatedFiles: - docs/models/shared/workflowdocument.md - docs/models/shared/workspace.md - docs/models/shared/workspaceandorganization.md + - docs/models/shared/workspacefeatureflag.md + - docs/models/shared/workspacefeatureflagrequest.md - docs/models/shared/workspacefeatureflagresponse.md - docs/models/shared/workspaceinviteresponse.md - docs/models/shared/workspaces.md @@ -340,6 +346,7 @@ generatedFiles: - src/speakeasy_client_sdk_python/models/operations/revokeuseraccesstoworkspace.py - src/speakeasy_client_sdk_python/models/operations/searchworkspaceevents.py - src/speakeasy_client_sdk_python/models/operations/setvisibility.py + - src/speakeasy_client_sdk_python/models/operations/setworkspacefeatureflags.py - src/speakeasy_client_sdk_python/models/operations/suggest.py - src/speakeasy_client_sdk_python/models/operations/suggestitems.py - src/speakeasy_client_sdk_python/models/operations/suggestopenapi.py @@ -373,6 +380,7 @@ generatedFiles: - src/speakeasy_client_sdk_python/models/shared/githubsetupstateresponse.py - src/speakeasy_client_sdk_python/models/shared/githubstorepublishingsecretsrequest.py - src/speakeasy_client_sdk_python/models/shared/githubtriggeractionrequest.py + - src/speakeasy_client_sdk_python/models/shared/httpmethod.py - src/speakeasy_client_sdk_python/models/shared/interactiontype.py - src/speakeasy_client_sdk_python/models/shared/manifest.py - src/speakeasy_client_sdk_python/models/shared/namespace.py @@ -404,6 +412,8 @@ generatedFiles: - src/speakeasy_client_sdk_python/models/shared/workflowdocument.py - src/speakeasy_client_sdk_python/models/shared/workspace.py - src/speakeasy_client_sdk_python/models/shared/workspaceandorganization.py + - src/speakeasy_client_sdk_python/models/shared/workspacefeatureflag.py + - src/speakeasy_client_sdk_python/models/shared/workspacefeatureflagrequest.py - src/speakeasy_client_sdk_python/models/shared/workspacefeatureflagresponse.py - src/speakeasy_client_sdk_python/models/shared/workspaceinviteresponse.py - src/speakeasy_client_sdk_python/models/shared/workspacesettings.py @@ -452,6 +462,8 @@ examples: responses: 4XX: application/json: {"message": "", "status_code": 115307} + 2XX: + application/octet-stream: "x-file: example.file" getManifest: speakeasy-default-get-manifest: parameters: @@ -538,7 +550,7 @@ examples: workspace_id: "" responses: 2XX: - application/json: {"access_token": ""} + application/json: {"access_token": "", "claims": {}, "user": {}} 4XX: application/json: {"message": "", "status_code": 299050} getUser: @@ -562,6 +574,11 @@ examples: responses: 4XX: application/json: {"message": "", "status_code": 140843} + "200": + application/json: "x-file: example.file" + application/x-yaml: "x-file: example.file" + 5XX: + application/json: {"message": "", "status_code": 569513} generateCodeSamplePreviewAsync: speakeasy-default-generate-code-sample-preview-async: requestBody: @@ -571,6 +588,8 @@ examples: application/json: {"job_id": "", "status": "pending"} 4XX: application/json: {"message": "", "status_code": 282243} + 5XX: + application/json: {"message": "", "status_code": 727495} getCodeSamples: speakeasy-default-get-code-samples: parameters: @@ -581,6 +600,28 @@ examples: application/json: {"snippets": [{"code": "", "language": "", "operationId": ""}, {"code": "", "language": "", "operationId": ""}, {"code": "", "language": "", "operationId": ""}]} 4XX: application/json: {"message": "", "status_code": 458049} + "": + parameters: + query: + registry_url: "https://spec.speakeasy.com/my-org/my-workspace/my-source" + operation_ids: ["getPets"] + method_paths: [{"method": "get", "path": "/pets"}] + languages: ["python", "javascript"] + responses: + 2XX: + application/json: {"snippets": [{"code": "", "language": "", "method": "", "operationId": "", "path": "/sbin"}, {"code": "", "language": "", "method": "", "operationId": "", "path": "/root"}]} + 4XX: + application/json: {"message": "", "status_code": 521235} + default: + parameters: + query: + registry_url: "https://spec.speakeasy.com/my-org/my-workspace/my-source" + operation_ids: ["getPets"] + method_paths: [{"method": "get", "path": "/pets"}] + languages: ["python", "javascript"] + responses: + 2XX: + application/json: {"snippets": [{"code": "import { Petstore } from \"petstore-sdk\";\n\nconst petstore = new Petstore({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await petstore.pet.getById({\n id: 137396,\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();", "language": "typescript", "method": "get", "operationId": "getPetById", "path": "/pet/{id}"}]} getCodeSamplePreviewAsync: speakeasy-default-get-code-sample-preview-async: parameters: @@ -591,6 +632,11 @@ examples: application/json: {"status": "pending"} 4XX: application/json: {"message": "", "status_code": 44984} + "200": + application/json: "x-file: example.file" + application/x-yaml: "x-file: example.file" + 5XX: + application/json: {"message": "", "status_code": 91014} checkGithubAccess: speakeasy-default-check-github-access: parameters: @@ -744,7 +790,7 @@ examples: uploadReport: speakeasy-default-upload-report: requestBody: - multipart/form-data: {"file": {"": "example.file"}} + multipart/form-data: {"data": {}, "file": {"": "example.file"}} responses: 2XX: application/json: {"url": "https://cluttered-stall.info"} @@ -779,7 +825,10 @@ examples: header: x-session-id: "" requestBody: - application/json: {"diagnostics": [{"message": "", "path": ["/opt/include", "/opt/share"], "type": ""}, {"message": "", "path": [], "type": ""}], "oas_summary": {"info": {"description": "amid traffic the unfortunately underneath what father lovely out", "summary": "", "title": "", "version": ""}, "operations": [{"description": "times dull than except", "method": "", "operation_id": "", "path": "/mnt", "tags": ["", ""]}]}, "suggestion_type": "diagnostics-only"} + application/json: {"diagnostics": [{"message": "", "path": ["/opt/include", "/opt/share"], "type": ""}, {"message": "", "path": [], "type": ""}], "oas_summary": {"info": {"description": "amid traffic the unfortunately underneath what father lovely out", "license": {}, "summary": "", "title": "", "version": ""}, "operations": [{"description": "times dull than except", "method": "", "operation_id": "", "path": "/mnt", "tags": ["", ""]}]}, "suggestion_type": "diagnostics-only"} + responses: + 2XX: + application/json: "x-file: example.file" suggestItems: speakeasy-default-suggest-items: requestBody: @@ -794,6 +843,9 @@ examples: x-session-id: "" requestBody: multipart/form-data: {"schema": {"": "example.file"}} + responses: + 2XX: + application/json: "x-file: example.file" suggestOpenAPIRegistry: speakeasy-default-suggest-open-API-registry: parameters: @@ -802,6 +854,9 @@ examples: revision_reference: "" header: x-session-id: "" + responses: + 2XX: + application/json: "x-file: example.file" createWorkspace: speakeasy-default-create-workspace: requestBody: @@ -985,4 +1040,13 @@ examples: application/json: [{"created_at": "2024-01-24T23:49:11.608Z", "execution_id": "", "id": "", "interaction_type": "LINT", "local_started_at": "2023-03-09T07:00:10.489Z", "speakeasy_api_key_name": "", "speakeasy_version": "", "success": true, "workspace_id": ""}] 5XX: application/json: {"message": "", "status_code": 238575} + setWorkspaceFeatureFlags: + speakeasy-default-set-workspace-feature-flags: + requestBody: + application/json: {"feature_flags": ["skip_schema_registry", "webhooks"]} + responses: + "200": + application/json: {} + 5XX: + application/json: {"message": "", "status_code": 264889} generatedTests: {} diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index b2e5b8f6..1791a383 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -11,7 +11,7 @@ generation: oAuth2ClientCredentialsEnabled: false oAuth2PasswordEnabled: false python: - version: 7.0.0-rc.2 + version: 7.0.0-rc.3 additionalDependencies: dev: {} main: {} @@ -20,6 +20,7 @@ python: clientServerStatusCodesAsErrors: true defaultErrorName: SDKError description: Speakeasy API Client SDK for Python + enableCustomCodeRegions: false enumFormat: enum fixFlags: responseRequiredSep2024: false diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 5e339eff..a1da65f0 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,21 +1,21 @@ -speakeasyVersion: 1.462.2 +speakeasyVersion: 1.469.1 sources: speakeasy-openapi: sourceNamespace: speakeasy-openapi - sourceRevisionDigest: sha256:79fa1cda10dbe045bf4d56fd367cebff8244f2cf789740c759e44ba91be16cef - sourceBlobDigest: sha256:3a6d2e7825969575182762eba53f1b78039986d5c80ff7644aa6faafd5ce4c69 + sourceRevisionDigest: sha256:addec54a7e3429ab9056447e727b513603eb77ee6c154a525ffb4c6ea8ad5394 + sourceBlobDigest: sha256:e64e244a53afa3cbefd06a7c0e669a32db2473febe3566a2c0d1c3d7c2e0c711 tags: - latest - - speakeasy-sdk-regen-1736136609 + - speakeasy-sdk-regen-1736555226 - 0.4.0 targets: speakeasy-client-sdk-python: source: speakeasy-openapi sourceNamespace: speakeasy-openapi - sourceRevisionDigest: sha256:79fa1cda10dbe045bf4d56fd367cebff8244f2cf789740c759e44ba91be16cef - sourceBlobDigest: sha256:3a6d2e7825969575182762eba53f1b78039986d5c80ff7644aa6faafd5ce4c69 + sourceRevisionDigest: sha256:addec54a7e3429ab9056447e727b513603eb77ee6c154a525ffb4c6ea8ad5394 + sourceBlobDigest: sha256:e64e244a53afa3cbefd06a7c0e669a32db2473febe3566a2c0d1c3d7c2e0c711 codeSamplesNamespace: code-samples-python-speakeasy-client-sdk-python - codeSamplesRevisionDigest: sha256:91eef570ebdc3cfb58537d237f79b7e36c765d7fdd43e0a385f0ea4ede4f8289 + codeSamplesRevisionDigest: sha256:8443d6030c11265da395578204b33b70ca40d1154d53908a3833b46935422049 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index 66dc9051..d58cd3b5 100644 --- a/README.md +++ b/README.md @@ -1 +1,403 @@ -undefined \ No newline at end of file +undefine + + + + + +## Summary + +Speakeasy API: The Subscriptions API manages subscriptions for CLI and registry events + +For more information about the API: [The Speakeasy Platform Documentation](/docs) + + + +## Table of Contents + + * [IDE Support](#ide-support) + * [Authentication](#authentication) + * [Global Parameters](#global-parameters) + * [File uploads](#file-uploads) + * [Retries](#retries) + * [Error Handling](#error-handling) + * [Server Selection](#server-selection) + * [Custom HTTP Client](#custom-http-client) + * [Debugging](#debugging) + + + + +## IDE Support + +### PyCharm + +Generally, the SDK will work well with most IDEs out of the box. However, when using PyCharm, you can enjoy much better integration with Pydantic by installing an additional plugin. + +- [PyCharm Pydantic Plugin](https://docs.pydantic.dev/latest/integrations/pycharm/) + + + +## Authentication + +### Per-Client Security Schemes + +This SDK supports the following security schemes globally: + +| Name | Type | Scheme | +| ---------------------- | ------ | ----------- | +| `api_key` | apiKey | API key | +| `bearer` | http | HTTP Bearer | +| `workspace_identifier` | apiKey | API key | + +You can set the security parameters through the `security` optional parameter when initializing the SDK client instance. The selected scheme will be used by default to authenticate with the API for all operations that support it. For example: +```python +from speakeasy_client_sdk_python import Speakeasy +from speakeasy_client_sdk_python.models import shared + +with Speakeasy( + security=shared.Security( + api_key="", + ), +) as speakeasy: + + res = speakeasy.artifacts.create_remote_source() + + assert res is not None + + # Handle response + print(res) + +``` + + + +## Global Parameters + +A parameter is configured globally. This parameter may be set on the SDK client instance itself during initialization. When configured as an option during SDK initialization, This global value will be used as the default on the operations that use it. When such operations are called, there is a place in each to override the global value, if needed. + +For example, you can set `workspace_id` to `""` at SDK initialization and then you do not have to pass the same value on calls to operations like `get_access_token`. But if you want to do so you may, which will locally override the global setting. See the example code below for a demonstration. + + +### Available Globals + +The following global parameter is available. + +| Name | Type | Description | +| ------------ | ---- | --------------------------- | +| workspace_id | str | The workspace_id parameter. | + +### Example + +```python +from speakeasy_client_sdk_python import Speakeasy + +with Speakeasy() as speakeasy: + + res = speakeasy.auth.get_access_token(request={ + "workspace_id": "", + }) + + assert res.access_token is not None + + # Handle response + print(res.access_token) + +``` + + + +## File uploads + +Certain SDK methods accept file objects as part of a request body or multi-part request. It is possible and typically recommended to upload files as a stream rather than reading the entire contents into memory. This avoids excessive memory consumption and potentially crashing with out-of-memory errors when working with very large files. The following example demonstrates how to attach a file stream to a request. + +> [!TIP] +> +> For endpoints that handle file uploads bytes arrays can also be used. However, using streams is recommended for large files. +> + +```python +from speakeasy_client_sdk_python import Speakeasy +from speakeasy_client_sdk_python.models import shared + +with Speakeasy( + security=shared.Security( + api_key="", + ), +) as speakeasy: + + res = speakeasy.code_samples.generate_code_sample_preview(request={ + "languages": [ + "", + "", + ], + "schema_file": { + "content": open("example.file", "rb"), + "file_name": "example.file", + }, + }) + + assert res.two_hundred_application_json_response_stream is not None + + # Handle response + print(res.two_hundred_application_json_response_stream) + +``` + + + +## Retries + +Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK. + +To change the default retry strategy for a single API call, simply provide a `RetryConfig` object to the call: +```python +from speakeasy_client_sdk_python import Speakeasy +from speakeasy_client_sdk_python.models import shared +from speakeasy_client_sdk_python.utils import BackoffStrategy, RetryConfig + +with Speakeasy( + security=shared.Security( + api_key="", + ), +) as speakeasy: + + res = speakeasy.artifacts.create_remote_source(, + RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False)) + + assert res is not None + + # Handle response + print(res) + +``` + +If you'd like to override the default retry strategy for all operations that support retries, you can use the `retry_config` optional parameter when initializing the SDK: +```python +from speakeasy_client_sdk_python import Speakeasy +from speakeasy_client_sdk_python.models import shared +from speakeasy_client_sdk_python.utils import BackoffStrategy, RetryConfig + +with Speakeasy( + retry_config=RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False), + security=shared.Security( + api_key="", + ), +) as speakeasy: + + res = speakeasy.artifacts.create_remote_source() + + assert res is not None + + # Handle response + print(res) + +``` + + + +## Error Handling + +Handling errors in this SDK should largely match your expectations. All operations return a response object or raise an exception. + +By default, an API error will raise a errors.SDKError exception, which has the following properties: + +| Property | Type | Description | +|-----------------|------------------|-----------------------| +| `.status_code` | *int* | The HTTP status code | +| `.message` | *str* | The error message | +| `.raw_response` | *httpx.Response* | The raw HTTP response | +| `.body` | *str* | The response content | + +When custom error responses are specified for an operation, the SDK may also raise their associated exceptions. You can refer to respective *Errors* tables in SDK docs for more details on possible exception types for each operation. For example, the `create_remote_source_async` method may raise the following exceptions: + +| Error Type | Status Code | Content Type | +| --------------- | ----------- | ---------------- | +| errors.Error | 4XX | application/json | +| errors.SDKError | 5XX | \*/\* | + +### Example + +```python +from speakeasy_client_sdk_python import Speakeasy +from speakeasy_client_sdk_python.models import errors, shared + +with Speakeasy( + security=shared.Security( + api_key="", + ), +) as speakeasy: + res = None + try: + + res = speakeasy.artifacts.create_remote_source() + + assert res is not None + + # Handle response + print(res) + + except errors.Error as e: + # handle e.data: errors.ErrorData + raise(e) + except errors.SDKError as e: + # handle exception + raise(e) +``` + + + +## Server Selection + +### Select Server by Name + +You can override the default server globally by passing a server name to the `server: str` optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the names associated with the available servers: + +| Name | Server | +| ------ | ----------------------------------- | +| `prod` | `https://api.prod.speakeasyapi.dev` | + +#### Example + +```python +from speakeasy_client_sdk_python import Speakeasy +from speakeasy_client_sdk_python.models import shared + +with Speakeasy( + server="prod", + security=shared.Security( + api_key="", + ), +) as speakeasy: + + res = speakeasy.artifacts.create_remote_source() + + assert res is not None + + # Handle response + print(res) + +``` + +### Override Server URL Per-Client + +The default server can also be overridden globally by passing a URL to the `server_url: str` optional parameter when initializing the SDK client instance. For example: +```python +from speakeasy_client_sdk_python import Speakeasy +from speakeasy_client_sdk_python.models import shared + +with Speakeasy( + server_url="https://api.prod.speakeasyapi.dev", + security=shared.Security( + api_key="", + ), +) as speakeasy: + + res = speakeasy.artifacts.create_remote_source() + + assert res is not None + + # Handle response + print(res) + +``` + + + +## Custom HTTP Client + +The Python SDK makes API calls using the [httpx](https://www.python-httpx.org/) HTTP library. In order to provide a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration, you can initialize the SDK client with your own HTTP client instance. +Depending on whether you are using the sync or async version of the SDK, you can pass an instance of `HttpClient` or `AsyncHttpClient` respectively, which are Protocol's ensuring that the client has the necessary methods to make API calls. +This allows you to wrap the client with your own custom logic, such as adding custom headers, logging, or error handling, or you can just pass an instance of `httpx.Client` or `httpx.AsyncClient` directly. + +For example, you could specify a header for every request that this sdk makes as follows: +```python +from speakeasy_client_sdk_python import Speakeasy +import httpx + +http_client = httpx.Client(headers={"x-custom-header": "someValue"}) +s = Speakeasy(client=http_client) +``` + +or you could wrap the client with your own custom logic: +```python +from speakeasy_client_sdk_python import Speakeasy +from speakeasy_client_sdk_python.httpclient import AsyncHttpClient +import httpx + +class CustomClient(AsyncHttpClient): + client: AsyncHttpClient + + def __init__(self, client: AsyncHttpClient): + self.client = client + + async def send( + self, + request: httpx.Request, + *, + stream: bool = False, + auth: Union[ + httpx._types.AuthTypes, httpx._client.UseClientDefault, None + ] = httpx.USE_CLIENT_DEFAULT, + follow_redirects: Union[ + bool, httpx._client.UseClientDefault + ] = httpx.USE_CLIENT_DEFAULT, + ) -> httpx.Response: + request.headers["Client-Level-Header"] = "added by client" + + return await self.client.send( + request, stream=stream, auth=auth, follow_redirects=follow_redirects + ) + + def build_request( + self, + method: str, + url: httpx._types.URLTypes, + *, + content: Optional[httpx._types.RequestContent] = None, + data: Optional[httpx._types.RequestData] = None, + files: Optional[httpx._types.RequestFiles] = None, + json: Optional[Any] = None, + params: Optional[httpx._types.QueryParamTypes] = None, + headers: Optional[httpx._types.HeaderTypes] = None, + cookies: Optional[httpx._types.CookieTypes] = None, + timeout: Union[ + httpx._types.TimeoutTypes, httpx._client.UseClientDefault + ] = httpx.USE_CLIENT_DEFAULT, + extensions: Optional[httpx._types.RequestExtensions] = None, + ) -> httpx.Request: + return self.client.build_request( + method, + url, + content=content, + data=data, + files=files, + json=json, + params=params, + headers=headers, + cookies=cookies, + timeout=timeout, + extensions=extensions, + ) + +s = Speakeasy(async_client=CustomClient(httpx.AsyncClient())) +``` + + + +## Debugging + +You can setup your SDK to emit debug logs for SDK requests and responses. + +You can pass your own logger class directly into your SDK. +```python +from speakeasy_client_sdk_python import Speakeasy +import logging + +logging.basicConfig(level=logging.DEBUG) +s = Speakeasy(debug_logger=logging.getLogger("speakeasy_client_sdk_python")) +``` + + + + +d \ No newline at end of file diff --git a/RELEASES.md b/RELEASES.md index 542f5dbb..5cadfe46 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1796,4 +1796,14 @@ Based on: ### Generated - [python v7.0.0-rc.2] . ### Releases -- [PyPI v7.0.0-rc.2] https://pypi.org/project/speakeasy-client-sdk-python/7.0.0-rc.2 - . \ No newline at end of file +- [PyPI v7.0.0-rc.2] https://pypi.org/project/speakeasy-client-sdk-python/7.0.0-rc.2 - . + +## 2025-01-19 00:28:36 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.469.1 (2.493.21) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v7.0.0-rc.3] . +### Releases +- [PyPI v7.0.0-rc.3] https://pypi.org/project/speakeasy-client-sdk-python/7.0.0-rc.3 - . \ No newline at end of file diff --git a/codeSamples.yaml b/codeSamples.yaml index ef9e8a1a..092630c5 100644 --- a/codeSamples.yaml +++ b/codeSamples.yaml @@ -236,7 +236,20 @@ actions: ) as speakeasy: res = speakeasy.code_samples.get(request={ - "registry_url": "https://normal-making.name", + "registry_url": "https://spec.speakeasy.com/my-org/my-workspace/my-source", + "operation_ids": [ + "getPets", + ], + "method_paths": [ + { + "method": shared.HTTPMethod.GET, + "path": "/pets", + }, + ], + "languages": [ + "python", + "javascript", + ], }) assert res.usage_snippets is not None @@ -924,7 +937,7 @@ actions: res = speakeasy.suggest.suggest_items(request={ "prompt": "", "items": [ - "", + ], }) @@ -1013,26 +1026,12 @@ actions: "license": {}, }, "operations": [ - { - "method": "", - "path": "/rescue", - "operation_id": "", - "description": "kielbasa psst stitcher cannon devoted blindly apropos low", - "tags": [ - "", - ], - }, + ], }, "suggestion_type": shared.SuggestRequestBodySuggestionType.DIAGNOSTICS_ONLY, "diagnostics": [ - { - "message": "", - "path": [ - "/opt/share", - ], - "type": "", - }, + ], }, }) @@ -1155,6 +1154,32 @@ actions: # Handle response print(res.target_sdk_list) + - target: $["paths"]["/v1/workspace/feature_flags"]["post"] + update: + x-codeSamples: + - lang: python + label: setWorkspaceFeatureFlags + source: |- + from speakeasy_client_sdk_python import Speakeasy + from speakeasy_client_sdk_python.models import shared + + with Speakeasy( + security=shared.Security( + api_key="", + ), + ) as speakeasy: + + res = speakeasy.workspaces.set_feature_flags(request={ + "feature_flags": [ + shared.WorkspaceFeatureFlag.SKIP_SCHEMA_REGISTRY, + shared.WorkspaceFeatureFlag.WEBHOOKS, + ], + }) + + assert res.workspace_feature_flag_response is not None + + # Handle response + print(res.workspace_feature_flag_response) - target: $["paths"]["/v1/workspace/{workspace_id}"]["get"] update: x-codeSamples: diff --git a/docs/models/operations/getcodesamplesrequest.md b/docs/models/operations/getcodesamplesrequest.md index 4a5da3d6..7080ffc7 100644 --- a/docs/models/operations/getcodesamplesrequest.md +++ b/docs/models/operations/getcodesamplesrequest.md @@ -3,8 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | -| `registry_url` | *str* | :heavy_check_mark: | The registry URL from which to retrieve the snippets. E.g. https://spec.speakeasy.com/org/ws/my-source | -| `operation_ids` | List[*str*] | :heavy_minus_sign: | N/A | -| `languages` | List[*str*] | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `registry_url` | *str* | :heavy_check_mark: | The registry URL from which to retrieve the snippets. | https://spec.speakeasy.com/my-org/my-workspace/my-source | +| `operation_ids` | List[*str*] | :heavy_minus_sign: | The operation IDs to retrieve snippets for. | getPets | +| `method_paths` | List[[operations.MethodPaths](../../models/operations/methodpaths.md)] | :heavy_minus_sign: | The method paths to retrieve snippets for. | [
{
"method": "get",
"path": "/pets"
}
] | +| `languages` | List[*str*] | :heavy_minus_sign: | The languages to retrieve snippets for. | [
"python",
"javascript"
] | \ No newline at end of file diff --git a/docs/models/operations/methodpaths.md b/docs/models/operations/methodpaths.md new file mode 100644 index 00000000..afea22cf --- /dev/null +++ b/docs/models/operations/methodpaths.md @@ -0,0 +1,9 @@ +# MethodPaths + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | +| `method` | [shared.HTTPMethod](../../models/shared/httpmethod.md) | :heavy_check_mark: | N/A | +| `path` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/setworkspacefeatureflagsresponse.md b/docs/models/operations/setworkspacefeatureflagsresponse.md new file mode 100644 index 00000000..93b37e92 --- /dev/null +++ b/docs/models/operations/setworkspacefeatureflagsresponse.md @@ -0,0 +1,11 @@ +# SetWorkspaceFeatureFlagsResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | +| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `workspace_feature_flag_response` | [Optional[shared.WorkspaceFeatureFlagResponse]](../../models/shared/workspacefeatureflagresponse.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/docs/models/shared/featureflag.md b/docs/models/shared/featureflag.md index 5dc0208f..632f8f2c 100644 --- a/docs/models/shared/featureflag.md +++ b/docs/models/shared/featureflag.md @@ -5,7 +5,7 @@ A feature flag is a key-value pair that can be used to enable or disable feature ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -| `feature_flag` | *str* | :heavy_check_mark: | N/A | -| `trial_ends_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `feature_flag` | [shared.WorkspaceFeatureFlag](../../models/shared/workspacefeatureflag.md) | :heavy_check_mark: | enum value workspace feature flag | +| `trial_ends_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/githubpublishingprresponse.md b/docs/models/shared/githubpublishingprresponse.md index 436eefa9..022ac721 100644 --- a/docs/models/shared/githubpublishingprresponse.md +++ b/docs/models/shared/githubpublishingprresponse.md @@ -5,7 +5,8 @@ Open generation PRs pending publishing ## Fields -| Field | Type | Required | Description | -| ------------------------- | ------------------------- | ------------------------- | ------------------------- | -| `generation_pull_request` | *Optional[str]* | :heavy_minus_sign: | N/A | -| `pending_version` | *Optional[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `pending_version` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `pull_request` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `pull_request_metadata` | [Optional[shared.PullRequestMetadata]](../../models/shared/pullrequestmetadata.md) | :heavy_minus_sign: | This can only be populated when the github app is installed for a repo | \ No newline at end of file diff --git a/docs/models/shared/httpmethod.md b/docs/models/shared/httpmethod.md new file mode 100644 index 00000000..6106d000 --- /dev/null +++ b/docs/models/shared/httpmethod.md @@ -0,0 +1,15 @@ +# HTTPMethod + + +## Values + +| Name | Value | +| --------- | --------- | +| `GET` | get | +| `POST` | post | +| `PUT` | put | +| `PATCH` | patch | +| `DELETE` | delete | +| `HEAD` | head | +| `OPTIONS` | options | +| `TRACE` | trace | \ No newline at end of file diff --git a/docs/models/shared/pullrequestmetadata.md b/docs/models/shared/pullrequestmetadata.md new file mode 100644 index 00000000..20ca5ff0 --- /dev/null +++ b/docs/models/shared/pullrequestmetadata.md @@ -0,0 +1,18 @@ +# PullRequestMetadata + +This can only be populated when the github app is installed for a repo + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `base_branch` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `can_merge` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | +| `description` | *Optional[str]* | :heavy_minus_sign: | truncated to first 1000 characters | +| `head_branch` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `labels` | List[*str*] | :heavy_minus_sign: | List of github labels | +| `requested_reviewers` | List[*str*] | :heavy_minus_sign: | List of github handles | +| `status` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `title` | *Optional[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/usagesnippet.md b/docs/models/shared/usagesnippet.md index 0a27546a..75050fa9 100644 --- a/docs/models/shared/usagesnippet.md +++ b/docs/models/shared/usagesnippet.md @@ -7,4 +7,6 @@ | -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | | `code` | *str* | :heavy_check_mark: | The code snippet | | `language` | *str* | :heavy_check_mark: | The language of the snippet | -| `operation_id` | *str* | :heavy_check_mark: | The operation ID for the snippet | \ No newline at end of file +| `method` | *Any* | :heavy_check_mark: | The HTTP method of the operation | +| `operation_id` | *str* | :heavy_check_mark: | The operation ID for the snippet | +| `path` | *str* | :heavy_check_mark: | The path of the operation | \ No newline at end of file diff --git a/docs/models/shared/user.md b/docs/models/shared/user.md index cabf4853..98876a7f 100644 --- a/docs/models/shared/user.md +++ b/docs/models/shared/user.md @@ -18,4 +18,5 @@ | `github_handle` | *OptionalNullable[str]* | :heavy_minus_sign: | GitHub handle of the user. | | `internal` | *Optional[bool]* | :heavy_minus_sign: | Indicates whether the user is internal. | | `last_login_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Timestamp of the last login. | -| `photo_url` | *OptionalNullable[str]* | :heavy_minus_sign: | URL of the user's photo. | \ No newline at end of file +| `photo_url` | *OptionalNullable[str]* | :heavy_minus_sign: | URL of the user's photo. | +| `pylon_identity_hash` | *Optional[str]* | :heavy_minus_sign: | Hash used for pylon identity verification returned on v1/user. | \ No newline at end of file diff --git a/docs/models/shared/workspacefeatureflag.md b/docs/models/shared/workspacefeatureflag.md new file mode 100644 index 00000000..07aa4139 --- /dev/null +++ b/docs/models/shared/workspacefeatureflag.md @@ -0,0 +1,13 @@ +# WorkspaceFeatureFlag + +enum value workspace feature flag + + +## Values + +| Name | Value | +| ---------------------- | ---------------------- | +| `SCHEMA_REGISTRY` | schema_registry | +| `CHANGES_REPORT` | changes_report | +| `SKIP_SCHEMA_REGISTRY` | skip_schema_registry | +| `WEBHOOKS` | webhooks | \ No newline at end of file diff --git a/docs/models/shared/workspacefeatureflagrequest.md b/docs/models/shared/workspacefeatureflagrequest.md new file mode 100644 index 00000000..0aaee5d1 --- /dev/null +++ b/docs/models/shared/workspacefeatureflagrequest.md @@ -0,0 +1,10 @@ +# WorkspaceFeatureFlagRequest + +A request to add workspace feature flags + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `feature_flags` | List[[shared.WorkspaceFeatureFlag](../../models/shared/workspacefeatureflag.md)] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdks/codesamples/README.md b/docs/sdks/codesamples/README.md index 66acddb0..8fa9e345 100644 --- a/docs/sdks/codesamples/README.md +++ b/docs/sdks/codesamples/README.md @@ -9,7 +9,7 @@ REST APIs for retrieving Code Samples * [generate_code_sample_preview](#generate_code_sample_preview) - Generate Code Sample previews from a file and configuration parameters. * [generate_code_sample_preview_asynchronous](#generate_code_sample_preview_asynchronous) - Initiate asynchronous Code Sample preview generation from a file and configuration parameters, receiving an async JobID response for polling. -* [get](#get) - Retrieve usage snippets from document stored in the registry +* [get](#get) - Retrieve usage snippets * [get_code_sample_preview_async](#get_code_sample_preview_async) - Poll for the result of an asynchronous Code Sample preview generation. ## generate_code_sample_preview @@ -61,7 +61,8 @@ with Speakeasy( | Error Type | Status Code | Content Type | | ---------------- | ---------------- | ---------------- | -| errors.Error | 4XX, 5XX | application/json | +| errors.Error | 4XX | application/json | +| errors.Error | 5XX | application/json | ## generate_code_sample_preview_asynchronous @@ -112,11 +113,12 @@ with Speakeasy( | Error Type | Status Code | Content Type | | ---------------- | ---------------- | ---------------- | -| errors.Error | 4XX, 5XX | application/json | +| errors.Error | 4XX | application/json | +| errors.Error | 5XX | application/json | ## get -Retrieve usage snippets from document stored in the registry. Supports filtering by language and operation ID. +Retrieve usage snippets from an OpenAPI document stored in the registry. Supports filtering by language and operation ID. ### Example Usage @@ -131,7 +133,20 @@ with Speakeasy( ) as speakeasy: res = speakeasy.code_samples.get(request={ - "registry_url": "https://normal-making.name", + "registry_url": "https://spec.speakeasy.com/my-org/my-workspace/my-source", + "operation_ids": [ + "getPets", + ], + "method_paths": [ + { + "method": shared.HTTPMethod.GET, + "path": "/pets", + }, + ], + "languages": [ + "python", + "javascript", + ], }) assert res.usage_snippets is not None @@ -201,4 +216,5 @@ with Speakeasy( | Error Type | Status Code | Content Type | | ---------------- | ---------------- | ---------------- | -| errors.Error | 4XX, 5XX | application/json | \ No newline at end of file +| errors.Error | 4XX | application/json | +| errors.Error | 5XX | application/json | \ No newline at end of file diff --git a/docs/sdks/suggest/README.md b/docs/sdks/suggest/README.md index 16f1ec6c..7acb9693 100644 --- a/docs/sdks/suggest/README.md +++ b/docs/sdks/suggest/README.md @@ -43,7 +43,7 @@ with Speakeasy( { "message": "", "path": [ - "/rescue", + ], "type": "", }, @@ -115,7 +115,7 @@ with Speakeasy( res = speakeasy.suggest.suggest_items(request={ "items": [ - "", + ], "prompt": "", }) diff --git a/docs/sdks/workspaces/README.md b/docs/sdks/workspaces/README.md index cbe539b9..63ec6c26 100644 --- a/docs/sdks/workspaces/README.md +++ b/docs/sdks/workspaces/README.md @@ -19,6 +19,7 @@ REST APIs for managing Workspaces (speakeasy tenancy) * [get_tokens](#get_tokens) - Get tokens for a particular workspace * [grant_access](#grant_access) - Grant a user access to a particular workspace * [revoke_access](#revoke_access) - Revoke a user's access to a particular workspace +* [set_feature_flags](#set_feature_flags) - Set workspace feature flags * [update](#update) - Update workspace details * [update_settings](#update_settings) - Update workspace settings @@ -575,6 +576,54 @@ with Speakeasy( | errors.Error | 4XX | application/json | | errors.SDKError | 5XX | \*/\* | +## set_feature_flags + +Set workspace feature flags + +### Example Usage + +```python +from speakeasy_client_sdk_python import Speakeasy +from speakeasy_client_sdk_python.models import shared + +with Speakeasy( + security=shared.Security( + api_key="", + ), +) as speakeasy: + + res = speakeasy.workspaces.set_feature_flags(request={ + "feature_flags": [ + shared.WorkspaceFeatureFlag.SKIP_SCHEMA_REGISTRY, + shared.WorkspaceFeatureFlag.WEBHOOKS, + ], + }) + + assert res.workspace_feature_flag_response is not None + + # Handle response + print(res.workspace_feature_flag_response) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `request` | [shared.WorkspaceFeatureFlagRequest](../../models/shared/workspacefeatureflagrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[operations.SetWorkspaceFeatureFlagsResponse](../../models/operations/setworkspacefeatureflagsresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------- | ---------------- | ---------------- | +| errors.Error | 5XX | application/json | +| errors.SDKError | 4XX | \*/\* | + ## update Update information about a particular workspace. diff --git a/poetry.lock b/poetry.lock index c409f2e2..ef96dca4 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. +# This file is automatically @generated by Poetry 2.0.1 and should not be changed by hand. [[package]] name = "annotated-types" @@ -6,20 +6,19 @@ version = "0.7.0" description = "Reusable constraint types to use with typing.Annotated" optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "annotated_types-0.7.0-py3-none-any.whl", hash = "sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53"}, {file = "annotated_types-0.7.0.tar.gz", hash = "sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89"}, ] -[package.dependencies] -typing-extensions = {version = ">=4.0.0", markers = "python_version < \"3.9\""} - [[package]] name = "anyio" version = "4.4.0" description = "High level compatibility layer for multiple asynchronous event loop implementations" optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "anyio-4.4.0-py3-none-any.whl", hash = "sha256:c1b2d8f46a8a812513012e1107cb0e68c17159a7a594208005a57dc776e1bdc7"}, {file = "anyio-4.4.0.tar.gz", hash = "sha256:5aadc6a1bbb7cdb0bede386cac5e2940f5e2ff3aa20277e991cf028e0585ce94"}, @@ -42,6 +41,7 @@ version = "3.2.2" description = "An abstract syntax tree for Python with inference support." optional = false python-versions = ">=3.8.0" +groups = ["dev"] files = [ {file = "astroid-3.2.2-py3-none-any.whl", hash = "sha256:e8a0083b4bb28fcffb6207a3bfc9e5d0a68be951dd7e336d5dcf639c682388c0"}, {file = "astroid-3.2.2.tar.gz", hash = "sha256:8ead48e31b92b2e217b6c9733a21afafe479d52d6e164dd25fb1a770c7c3cf94"}, @@ -56,6 +56,7 @@ version = "2024.7.4" description = "Python package for providing Mozilla's CA Bundle." optional = false python-versions = ">=3.6" +groups = ["main"] files = [ {file = "certifi-2024.7.4-py3-none-any.whl", hash = "sha256:c198e21b1289c2ab85ee4e67bb4b4ef3ead0892059901a8d5b622f24a1101e90"}, {file = "certifi-2024.7.4.tar.gz", hash = "sha256:5a1e7645bc0ec61a09e26c36f6106dd4cf40c6db3a1fb6352b0244e7fb057c7b"}, @@ -67,6 +68,8 @@ version = "0.4.6" description = "Cross-platform colored terminal text." optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" +groups = ["dev"] +markers = "sys_platform == \"win32\"" files = [ {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, @@ -78,6 +81,7 @@ version = "0.3.8" description = "serialize all of Python" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "dill-0.3.8-py3-none-any.whl", hash = "sha256:c36ca9ffb54365bdd2f8eb3eff7d2a21237f8452b57ace88b1ac615b7e815bd7"}, {file = "dill-0.3.8.tar.gz", hash = "sha256:3ebe3c479ad625c4553aca177444d89b486b1d84982eeacded644afc0cf797ca"}, @@ -93,6 +97,7 @@ version = "0.2.0" description = "Like `typing._eval_type`, but lets older Python versions use newer typing features." optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "eval_type_backport-0.2.0-py3-none-any.whl", hash = "sha256:ac2f73d30d40c5a30a80b8739a789d6bb5e49fdffa66d7912667e2015d9c9933"}, {file = "eval_type_backport-0.2.0.tar.gz", hash = "sha256:68796cfbc7371ebf923f03bdf7bef415f3ec098aeced24e054b253a0e78f7b37"}, @@ -107,6 +112,8 @@ version = "1.2.1" description = "Backport of PEP 654 (exception groups)" optional = false python-versions = ">=3.7" +groups = ["main"] +markers = "python_version < \"3.11\"" files = [ {file = "exceptiongroup-1.2.1-py3-none-any.whl", hash = "sha256:5258b9ed329c5bbdd31a309f53cbfb0b155341807f6ff7606a1e801a891b29ad"}, {file = "exceptiongroup-1.2.1.tar.gz", hash = "sha256:a4785e48b045528f5bfe627b6ad554ff32def154f42372786903b7abcfe1aa16"}, @@ -121,6 +128,7 @@ version = "0.14.0" description = "A pure-Python, bring-your-own-I/O implementation of HTTP/1.1" optional = false python-versions = ">=3.7" +groups = ["main"] files = [ {file = "h11-0.14.0-py3-none-any.whl", hash = "sha256:e3fe4ac4b851c468cc8363d500db52c2ead036020723024a109d37346efaa761"}, {file = "h11-0.14.0.tar.gz", hash = "sha256:8f19fbbe99e72420ff35c00b27a34cb9937e902a8b810e2c88300c6f0a3b699d"}, @@ -132,6 +140,7 @@ version = "1.0.5" description = "A minimal low-level HTTP client." optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "httpcore-1.0.5-py3-none-any.whl", hash = "sha256:421f18bac248b25d310f3cacd198d55b8e6125c107797b609ff9b7a6ba7991b5"}, {file = "httpcore-1.0.5.tar.gz", hash = "sha256:34a38e2f9291467ee3b44e89dd52615370e152954ba21721378a87b2960f7a61"}, @@ -153,6 +162,7 @@ version = "0.28.1" description = "The next generation HTTP client." optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "httpx-0.28.1-py3-none-any.whl", hash = "sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad"}, {file = "httpx-0.28.1.tar.gz", hash = "sha256:75e98c5f16b0f35b567856f597f06ff2270a374470a5c2392242528e3e3e42fc"}, @@ -177,6 +187,7 @@ version = "3.7" description = "Internationalized Domain Names in Applications (IDNA)" optional = false python-versions = ">=3.5" +groups = ["main"] files = [ {file = "idna-3.7-py3-none-any.whl", hash = "sha256:82fee1fc78add43492d3a1898bfa6d8a904cc97d8427f683ed8e798d07761aa0"}, {file = "idna-3.7.tar.gz", hash = "sha256:028ff3aadf0609c1fd278d8ea3089299412a7a8b9bd005dd08b9f8285bcb5cfc"}, @@ -188,6 +199,7 @@ version = "5.13.2" description = "A Python utility / library to sort Python imports." optional = false python-versions = ">=3.8.0" +groups = ["dev"] files = [ {file = "isort-5.13.2-py3-none-any.whl", hash = "sha256:8ca5e72a8d85860d5a3fa69b8745237f2939afe12dbf656afbcb47fe72d947a6"}, {file = "isort-5.13.2.tar.gz", hash = "sha256:48fdfcb9face5d58a4f6dde2e72a1fb8dcaf8ab26f95ab49fab84c2ddefb0109"}, @@ -202,6 +214,7 @@ version = "1.0.6" description = "A more powerful JSONPath implementation in modern python" optional = false python-versions = ">=3.6" +groups = ["main"] files = [ {file = "jsonpath-python-1.0.6.tar.gz", hash = "sha256:dd5be4a72d8a2995c3f583cf82bf3cd1a9544cfdabf2d22595b67aff07349666"}, {file = "jsonpath_python-1.0.6-py3-none-any.whl", hash = "sha256:1e3b78df579f5efc23565293612decee04214609208a2335884b3ee3f786b575"}, @@ -213,6 +226,7 @@ version = "0.7.0" description = "McCabe checker, plugin for flake8" optional = false python-versions = ">=3.6" +groups = ["dev"] files = [ {file = "mccabe-0.7.0-py2.py3-none-any.whl", hash = "sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e"}, {file = "mccabe-0.7.0.tar.gz", hash = "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325"}, @@ -220,49 +234,56 @@ files = [ [[package]] name = "mypy" -version = "1.13.0" +version = "1.14.1" description = "Optional static typing for Python" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ - {file = "mypy-1.13.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:6607e0f1dd1fb7f0aca14d936d13fd19eba5e17e1cd2a14f808fa5f8f6d8f60a"}, - {file = "mypy-1.13.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:8a21be69bd26fa81b1f80a61ee7ab05b076c674d9b18fb56239d72e21d9f4c80"}, - {file = "mypy-1.13.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7b2353a44d2179846a096e25691d54d59904559f4232519d420d64da6828a3a7"}, - {file = "mypy-1.13.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:0730d1c6a2739d4511dc4253f8274cdd140c55c32dfb0a4cf8b7a43f40abfa6f"}, - {file = "mypy-1.13.0-cp310-cp310-win_amd64.whl", hash = "sha256:c5fc54dbb712ff5e5a0fca797e6e0aa25726c7e72c6a5850cfd2adbc1eb0a372"}, - {file = "mypy-1.13.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:581665e6f3a8a9078f28d5502f4c334c0c8d802ef55ea0e7276a6e409bc0d82d"}, - {file = "mypy-1.13.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:3ddb5b9bf82e05cc9a627e84707b528e5c7caaa1c55c69e175abb15a761cec2d"}, - {file = "mypy-1.13.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:20c7ee0bc0d5a9595c46f38beb04201f2620065a93755704e141fcac9f59db2b"}, - {file = "mypy-1.13.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:3790ded76f0b34bc9c8ba4def8f919dd6a46db0f5a6610fb994fe8efdd447f73"}, - {file = "mypy-1.13.0-cp311-cp311-win_amd64.whl", hash = "sha256:51f869f4b6b538229c1d1bcc1dd7d119817206e2bc54e8e374b3dfa202defcca"}, - {file = "mypy-1.13.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:5c7051a3461ae84dfb5dd15eff5094640c61c5f22257c8b766794e6dd85e72d5"}, - {file = "mypy-1.13.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:39bb21c69a5d6342f4ce526e4584bc5c197fd20a60d14a8624d8743fffb9472e"}, - {file = "mypy-1.13.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:164f28cb9d6367439031f4c81e84d3ccaa1e19232d9d05d37cb0bd880d3f93c2"}, - {file = "mypy-1.13.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:a4c1bfcdbce96ff5d96fc9b08e3831acb30dc44ab02671eca5953eadad07d6d0"}, - {file = "mypy-1.13.0-cp312-cp312-win_amd64.whl", hash = "sha256:a0affb3a79a256b4183ba09811e3577c5163ed06685e4d4b46429a271ba174d2"}, - {file = "mypy-1.13.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:a7b44178c9760ce1a43f544e595d35ed61ac2c3de306599fa59b38a6048e1aa7"}, - {file = "mypy-1.13.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:5d5092efb8516d08440e36626f0153b5006d4088c1d663d88bf79625af3d1d62"}, - {file = "mypy-1.13.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:de2904956dac40ced10931ac967ae63c5089bd498542194b436eb097a9f77bc8"}, - {file = "mypy-1.13.0-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:7bfd8836970d33c2105562650656b6846149374dc8ed77d98424b40b09340ba7"}, - {file = "mypy-1.13.0-cp313-cp313-win_amd64.whl", hash = "sha256:9f73dba9ec77acb86457a8fc04b5239822df0c14a082564737833d2963677dbc"}, - {file = "mypy-1.13.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:100fac22ce82925f676a734af0db922ecfea991e1d7ec0ceb1e115ebe501301a"}, - {file = "mypy-1.13.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:7bcb0bb7f42a978bb323a7c88f1081d1b5dee77ca86f4100735a6f541299d8fb"}, - {file = "mypy-1.13.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:bde31fc887c213e223bbfc34328070996061b0833b0a4cfec53745ed61f3519b"}, - {file = "mypy-1.13.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:07de989f89786f62b937851295ed62e51774722e5444a27cecca993fc3f9cd74"}, - {file = "mypy-1.13.0-cp38-cp38-win_amd64.whl", hash = "sha256:4bde84334fbe19bad704b3f5b78c4abd35ff1026f8ba72b29de70dda0916beb6"}, - {file = "mypy-1.13.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:0246bcb1b5de7f08f2826451abd947bf656945209b140d16ed317f65a17dc7dc"}, - {file = "mypy-1.13.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:7f5b7deae912cf8b77e990b9280f170381fdfbddf61b4ef80927edd813163732"}, - {file = "mypy-1.13.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7029881ec6ffb8bc233a4fa364736789582c738217b133f1b55967115288a2bc"}, - {file = "mypy-1.13.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:3e38b980e5681f28f033f3be86b099a247b13c491f14bb8b1e1e134d23bb599d"}, - {file = "mypy-1.13.0-cp39-cp39-win_amd64.whl", hash = "sha256:a6789be98a2017c912ae6ccb77ea553bbaf13d27605d2ca20a76dfbced631b24"}, - {file = "mypy-1.13.0-py3-none-any.whl", hash = "sha256:9c250883f9fd81d212e0952c92dbfcc96fc237f4b7c92f56ac81fd48460b3e5a"}, - {file = "mypy-1.13.0.tar.gz", hash = "sha256:0291a61b6fbf3e6673e3405cfcc0e7650bebc7939659fdca2702958038bd835e"}, + {file = "mypy-1.14.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:52686e37cf13d559f668aa398dd7ddf1f92c5d613e4f8cb262be2fb4fedb0fcb"}, + {file = "mypy-1.14.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:1fb545ca340537d4b45d3eecdb3def05e913299ca72c290326be19b3804b39c0"}, + {file = "mypy-1.14.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:90716d8b2d1f4cd503309788e51366f07c56635a3309b0f6a32547eaaa36a64d"}, + {file = "mypy-1.14.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:2ae753f5c9fef278bcf12e1a564351764f2a6da579d4a81347e1d5a15819997b"}, + {file = "mypy-1.14.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:e0fe0f5feaafcb04505bcf439e991c6d8f1bf8b15f12b05feeed96e9e7bf1427"}, + {file = "mypy-1.14.1-cp310-cp310-win_amd64.whl", hash = "sha256:7d54bd85b925e501c555a3227f3ec0cfc54ee8b6930bd6141ec872d1c572f81f"}, + {file = "mypy-1.14.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:f995e511de847791c3b11ed90084a7a0aafdc074ab88c5a9711622fe4751138c"}, + {file = "mypy-1.14.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:d64169ec3b8461311f8ce2fd2eb5d33e2d0f2c7b49116259c51d0d96edee48d1"}, + {file = "mypy-1.14.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ba24549de7b89b6381b91fbc068d798192b1b5201987070319889e93038967a8"}, + {file = "mypy-1.14.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:183cf0a45457d28ff9d758730cd0210419ac27d4d3f285beda038c9083363b1f"}, + {file = "mypy-1.14.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:f2a0ecc86378f45347f586e4163d1769dd81c5a223d577fe351f26b179e148b1"}, + {file = "mypy-1.14.1-cp311-cp311-win_amd64.whl", hash = "sha256:ad3301ebebec9e8ee7135d8e3109ca76c23752bac1e717bc84cd3836b4bf3eae"}, + {file = "mypy-1.14.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:30ff5ef8519bbc2e18b3b54521ec319513a26f1bba19a7582e7b1f58a6e69f14"}, + {file = "mypy-1.14.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:cb9f255c18052343c70234907e2e532bc7e55a62565d64536dbc7706a20b78b9"}, + {file = "mypy-1.14.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:8b4e3413e0bddea671012b063e27591b953d653209e7a4fa5e48759cda77ca11"}, + {file = "mypy-1.14.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:553c293b1fbdebb6c3c4030589dab9fafb6dfa768995a453d8a5d3b23784af2e"}, + {file = "mypy-1.14.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:fad79bfe3b65fe6a1efaed97b445c3d37f7be9fdc348bdb2d7cac75579607c89"}, + {file = "mypy-1.14.1-cp312-cp312-win_amd64.whl", hash = "sha256:8fa2220e54d2946e94ab6dbb3ba0a992795bd68b16dc852db33028df2b00191b"}, + {file = "mypy-1.14.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:92c3ed5afb06c3a8e188cb5da4984cab9ec9a77ba956ee419c68a388b4595255"}, + {file = "mypy-1.14.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:dbec574648b3e25f43d23577309b16534431db4ddc09fda50841f1e34e64ed34"}, + {file = "mypy-1.14.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:8c6d94b16d62eb3e947281aa7347d78236688e21081f11de976376cf010eb31a"}, + {file = "mypy-1.14.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d4b19b03fdf54f3c5b2fa474c56b4c13c9dbfb9a2db4370ede7ec11a2c5927d9"}, + {file = "mypy-1.14.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:0c911fde686394753fff899c409fd4e16e9b294c24bfd5e1ea4675deae1ac6fd"}, + {file = "mypy-1.14.1-cp313-cp313-win_amd64.whl", hash = "sha256:8b21525cb51671219f5307be85f7e646a153e5acc656e5cebf64bfa076c50107"}, + {file = "mypy-1.14.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:7084fb8f1128c76cd9cf68fe5971b37072598e7c31b2f9f95586b65c741a9d31"}, + {file = "mypy-1.14.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:8f845a00b4f420f693f870eaee5f3e2692fa84cc8514496114649cfa8fd5e2c6"}, + {file = "mypy-1.14.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:44bf464499f0e3a2d14d58b54674dee25c031703b2ffc35064bd0df2e0fac319"}, + {file = "mypy-1.14.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c99f27732c0b7dc847adb21c9d47ce57eb48fa33a17bc6d7d5c5e9f9e7ae5bac"}, + {file = "mypy-1.14.1-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:bce23c7377b43602baa0bd22ea3265c49b9ff0b76eb315d6c34721af4cdf1d9b"}, + {file = "mypy-1.14.1-cp38-cp38-win_amd64.whl", hash = "sha256:8edc07eeade7ebc771ff9cf6b211b9a7d93687ff892150cb5692e4f4272b0837"}, + {file = "mypy-1.14.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:3888a1816d69f7ab92092f785a462944b3ca16d7c470d564165fe703b0970c35"}, + {file = "mypy-1.14.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:46c756a444117c43ee984bd055db99e498bc613a70bbbc120272bd13ca579fbc"}, + {file = "mypy-1.14.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:27fc248022907e72abfd8e22ab1f10e903915ff69961174784a3900a8cba9ad9"}, + {file = "mypy-1.14.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:499d6a72fb7e5de92218db961f1a66d5f11783f9ae549d214617edab5d4dbdbb"}, + {file = "mypy-1.14.1-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:57961db9795eb566dc1d1b4e9139ebc4c6b0cb6e7254ecde69d1552bf7613f60"}, + {file = "mypy-1.14.1-cp39-cp39-win_amd64.whl", hash = "sha256:07ba89fdcc9451f2ebb02853deb6aaaa3d2239a236669a63ab3801bbf923ef5c"}, + {file = "mypy-1.14.1-py3-none-any.whl", hash = "sha256:b66a60cc4073aeb8ae00057f9c1f64d49e90f918fbcef9a977eb121da8b8f1d1"}, + {file = "mypy-1.14.1.tar.gz", hash = "sha256:7ec88144fe9b510e8475ec2f5f251992690fcf89ccb4500b214b4226abcd32d6"}, ] [package.dependencies] -mypy-extensions = ">=1.0.0" +mypy_extensions = ">=1.0.0" tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} -typing-extensions = ">=4.6.0" +typing_extensions = ">=4.6.0" [package.extras] dmypy = ["psutil (>=4.0)"] @@ -277,6 +298,7 @@ version = "1.0.0" description = "Type system extensions for programs checked with the mypy type checker." optional = false python-versions = ">=3.5" +groups = ["main", "dev"] files = [ {file = "mypy_extensions-1.0.0-py3-none-any.whl", hash = "sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d"}, {file = "mypy_extensions-1.0.0.tar.gz", hash = "sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782"}, @@ -288,6 +310,7 @@ version = "4.2.2" description = "A small Python package for determining appropriate platform-specific dirs, e.g. a `user data dir`." optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "platformdirs-4.2.2-py3-none-any.whl", hash = "sha256:2d7a1657e36a80ea911db832a8a6ece5ee53d8de21edd5cc5879af6530b1bfee"}, {file = "platformdirs-4.2.2.tar.gz", hash = "sha256:38b7b51f512eed9e84a22788b4bce1de17c0adb134d6becb09836e37d8654cd3"}, @@ -304,6 +327,7 @@ version = "2.10.4" description = "Data validation using Python type hints" optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "pydantic-2.10.4-py3-none-any.whl", hash = "sha256:597e135ea68be3a37552fb524bc7d0d66dcf93d395acd93a00682f1efcb8ee3d"}, {file = "pydantic-2.10.4.tar.gz", hash = "sha256:82f12e9723da6de4fe2ba888b5971157b3be7ad914267dea8f05f82b28254f06"}, @@ -324,6 +348,7 @@ version = "2.27.2" description = "Core functionality for Pydantic validation and serialization" optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "pydantic_core-2.27.2-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:2d367ca20b2f14095a8f4fa1210f5a7b78b8a20009ecced6b12818f455b1e9fa"}, {file = "pydantic_core-2.27.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:491a2b73db93fab69731eaee494f320faa4e093dbed776be1a829c2eb222c34c"}, @@ -436,6 +461,7 @@ version = "3.2.3" description = "python code static checker" optional = false python-versions = ">=3.8.0" +groups = ["dev"] files = [ {file = "pylint-3.2.3-py3-none-any.whl", hash = "sha256:b3d7d2708a3e04b4679e02d99e72329a8b7ee8afb8d04110682278781f889fa8"}, {file = "pylint-3.2.3.tar.gz", hash = "sha256:02f6c562b215582386068d52a30f520d84fdbcf2a95fc7e855b816060d048b60"}, @@ -466,6 +492,7 @@ version = "2.9.0.post0" description = "Extensions to the standard Python datetime module" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" +groups = ["main"] files = [ {file = "python-dateutil-2.9.0.post0.tar.gz", hash = "sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3"}, {file = "python_dateutil-2.9.0.post0-py2.py3-none-any.whl", hash = "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427"}, @@ -480,6 +507,7 @@ version = "1.16.0" description = "Python 2 and 3 compatibility utilities" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" +groups = ["main"] files = [ {file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"}, {file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"}, @@ -491,6 +519,7 @@ version = "1.3.1" description = "Sniff out which async library your code is running under" optional = false python-versions = ">=3.7" +groups = ["main"] files = [ {file = "sniffio-1.3.1-py3-none-any.whl", hash = "sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2"}, {file = "sniffio-1.3.1.tar.gz", hash = "sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc"}, @@ -502,6 +531,8 @@ version = "2.0.1" description = "A lil' TOML parser" optional = false python-versions = ">=3.7" +groups = ["dev"] +markers = "python_version < \"3.11\"" files = [ {file = "tomli-2.0.1-py3-none-any.whl", hash = "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc"}, {file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"}, @@ -513,6 +544,7 @@ version = "0.12.5" description = "Style preserving TOML library" optional = false python-versions = ">=3.7" +groups = ["dev"] files = [ {file = "tomlkit-0.12.5-py3-none-any.whl", hash = "sha256:af914f5a9c59ed9d0762c7b64d3b5d5df007448eb9cd2edc8a46b1eafead172f"}, {file = "tomlkit-0.12.5.tar.gz", hash = "sha256:eef34fba39834d4d6b73c9ba7f3e4d1c417a4e56f89a7e96e090dd0d24b8fb3c"}, @@ -524,6 +556,7 @@ version = "2.9.0.20240316" description = "Typing stubs for python-dateutil" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "types-python-dateutil-2.9.0.20240316.tar.gz", hash = "sha256:5d2f2e240b86905e40944dd787db6da9263f0deabef1076ddaed797351ec0202"}, {file = "types_python_dateutil-2.9.0.20240316-py3-none-any.whl", hash = "sha256:6b8cb66d960771ce5ff974e9dd45e38facb81718cc1e208b10b1baccbfdbee3b"}, @@ -535,6 +568,7 @@ version = "4.12.2" description = "Backported and Experimental Type Hints for Python 3.8+" optional = false python-versions = ">=3.8" +groups = ["main", "dev"] files = [ {file = "typing_extensions-4.12.2-py3-none-any.whl", hash = "sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d"}, {file = "typing_extensions-4.12.2.tar.gz", hash = "sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8"}, @@ -546,6 +580,7 @@ version = "0.9.0" description = "Runtime inspection utilities for typing module." optional = false python-versions = "*" +groups = ["main"] files = [ {file = "typing_inspect-0.9.0-py3-none-any.whl", hash = "sha256:9ee6fc59062311ef8547596ab6b955e1b8aa46242d854bfc78f4f6b0eff35f9f"}, {file = "typing_inspect-0.9.0.tar.gz", hash = "sha256:b23fc42ff6f6ef6954e4852c1fb512cdd18dbea03134f91f856a95ccc9461f78"}, @@ -556,6 +591,6 @@ mypy-extensions = ">=0.3.0" typing-extensions = ">=3.7.4" [metadata] -lock-version = "2.0" -python-versions = "^3.8" -content-hash = "231d09484040ca8e2e4ea801ceedb0b672113dd483caa7cb13d217c3e92d7655" +lock-version = "2.1" +python-versions = ">=3.9" +content-hash = "1bd4e6f40bcdc58f113fbd67b7c65821133d23a04876c22cf3119c1bc9a5fb6b" diff --git a/pylintrc b/pylintrc index 50800386..f2385e87 100644 --- a/pylintrc +++ b/pylintrc @@ -89,7 +89,7 @@ persistent=yes # Minimum Python version to use for version dependent checks. Will default to # the version used to run pylint. -py-version=3.8 +py-version=3.9 # Discover python modules and packages in the file system subtree. recursive=no diff --git a/pyproject.toml b/pyproject.toml index a4a8a51e..e30c3e77 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,9 +1,20 @@ -[tool.poetry] +[project] name = "speakeasy-client-sdk-python" -version = "7.0.0-rc.2" +version = "7.0.0-rc.3" description = "Speakeasy API Client SDK for Python" -authors = ["Speakeasy",] +authors = [{ name = "Speakeasy" },] readme = "README-PYPI.md" +requires-python = ">=3.9" +dependencies = [ + "eval-type-backport (>=0.2.0,<0.3.0)", + "httpx (>=0.28.1,<0.29.0)", + "jsonpath-python (>=1.0.6,<2.0.0)", + "pydantic (>=2.10.3,<2.11.0)", + "python-dateutil (>=2.8.2,<3.0.0)", + "typing-inspect (>=0.9.0,<0.10.0)", +] + +[tool.poetry] repository = "https://github.com/speakeasy-api/speakeasy-client-sdk-python.git" packages = [ { include = "speakeasy_client_sdk_python", from = "src" } @@ -16,17 +27,8 @@ include = ["py.typed", "src/speakeasy_client_sdk_python/py.typed"] [virtualenvs] in-project = true -[tool.poetry.dependencies] -python = "^3.8" -eval-type-backport = "^0.2.0" -httpx = "^0.28.1" -jsonpath-python = "^1.0.6" -pydantic = "~2.10.3" -python-dateutil = "^2.8.2" -typing-inspect = "^0.9.0" - [tool.poetry.group.dev.dependencies] -mypy = "==1.13.0" +mypy = "==1.14.1" pylint = "==3.2.3" types-python-dateutil = "^2.9.0.20240316" diff --git a/src/speakeasy_client_sdk_python/__init__.py b/src/speakeasy_client_sdk_python/__init__.py index 5c349179..833c68cd 100644 --- a/src/speakeasy_client_sdk_python/__init__.py +++ b/src/speakeasy_client_sdk_python/__init__.py @@ -1,8 +1,17 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" -from ._version import __title__, __version__ +from ._version import ( + __title__, + __version__, + __openapi_doc_version__, + __gen_version__, + __user_agent__, +) from .sdk import * from .sdkconfiguration import * VERSION: str = __version__ +OPENAPI_DOC_VERSION = __openapi_doc_version__ +SPEAKEASY_GENERATOR_VERSION = __gen_version__ +USER_AGENT = __user_agent__ diff --git a/src/speakeasy_client_sdk_python/_version.py b/src/speakeasy_client_sdk_python/_version.py index a34ba7c8..26cbdba2 100644 --- a/src/speakeasy_client_sdk_python/_version.py +++ b/src/speakeasy_client_sdk_python/_version.py @@ -3,7 +3,12 @@ import importlib.metadata __title__: str = "speakeasy-client-sdk-python" -__version__: str = "7.0.0-rc.2" +__version__: str = "7.0.0-rc.3" +__openapi_doc_version__: str = "0.4.0" +__gen_version__: str = "2.493.21" +__user_agent__: str = ( + "speakeasy-sdk/python 7.0.0-rc.3 2.493.21 0.4.0 speakeasy-client-sdk-python" +) try: if __package__ is not None: diff --git a/src/speakeasy_client_sdk_python/auth.py b/src/speakeasy_client_sdk_python/auth.py index ab019e6f..f3cca870 100644 --- a/src/speakeasy_client_sdk_python/auth.py +++ b/src/speakeasy_client_sdk_python/auth.py @@ -93,7 +93,12 @@ def get_access( content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -190,7 +195,12 @@ async def get_access_async( content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res diff --git a/src/speakeasy_client_sdk_python/codesamples.py b/src/speakeasy_client_sdk_python/codesamples.py index da258743..7a57d61d 100644 --- a/src/speakeasy_client_sdk_python/codesamples.py +++ b/src/speakeasy_client_sdk_python/codesamples.py @@ -113,7 +113,11 @@ def generate_code_sample_preview( content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) - if utils.match_response(http_res, ["4XX", "5XX"], "application/json"): + if utils.match_response(http_res, "4XX", "application/json"): + http_res_text = utils.stream_to_text(http_res) + data = utils.unmarshal_json(http_res_text, errors.ErrorData) + raise errors.Error(data=data) + if utils.match_response(http_res, "5XX", "application/json"): http_res_text = utils.stream_to_text(http_res) data = utils.unmarshal_json(http_res_text, errors.ErrorData) raise errors.Error(data=data) @@ -218,7 +222,11 @@ async def generate_code_sample_preview_async( content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) - if utils.match_response(http_res, ["4XX", "5XX"], "application/json"): + if utils.match_response(http_res, "4XX", "application/json"): + http_res_text = await utils.stream_to_text_async(http_res) + data = utils.unmarshal_json(http_res_text, errors.ErrorData) + raise errors.Error(data=data) + if utils.match_response(http_res, "5XX", "application/json"): http_res_text = await utils.stream_to_text_async(http_res) data = utils.unmarshal_json(http_res_text, errors.ErrorData) raise errors.Error(data=data) @@ -314,7 +322,10 @@ def generate_code_sample_previewhronous( content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) - if utils.match_response(http_res, ["4XX", "5XX"], "application/json"): + if utils.match_response(http_res, "4XX", "application/json"): + data = utils.unmarshal_json(http_res.text, errors.ErrorData) + raise errors.Error(data=data) + if utils.match_response(http_res, "5XX", "application/json"): data = utils.unmarshal_json(http_res.text, errors.ErrorData) raise errors.Error(data=data) @@ -409,7 +420,10 @@ async def generate_code_sample_preview_asynchronous_async( content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) - if utils.match_response(http_res, ["4XX", "5XX"], "application/json"): + if utils.match_response(http_res, "4XX", "application/json"): + data = utils.unmarshal_json(http_res.text, errors.ErrorData) + raise errors.Error(data=data) + if utils.match_response(http_res, "5XX", "application/json"): data = utils.unmarshal_json(http_res.text, errors.ErrorData) raise errors.Error(data=data) @@ -433,9 +447,9 @@ def get( timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GetCodeSamplesResponse: - r"""Retrieve usage snippets from document stored in the registry + r"""Retrieve usage snippets - Retrieve usage snippets from document stored in the registry. Supports filtering by language and operation ID. + Retrieve usage snippets from an OpenAPI document stored in the registry. Supports filtering by language and operation ID. :param request: The request object to send. :param retries: Override the default retry configuration for this method @@ -529,9 +543,9 @@ async def get_async( timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GetCodeSamplesResponse: - r"""Retrieve usage snippets from document stored in the registry + r"""Retrieve usage snippets - Retrieve usage snippets from document stored in the registry. Supports filtering by language and operation ID. + Retrieve usage snippets from an OpenAPI document stored in the registry. Supports filtering by language and operation ID. :param request: The request object to send. :param retries: Override the default retry configuration for this method @@ -716,7 +730,11 @@ def get_code_sample_preview( content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) - if utils.match_response(http_res, ["4XX", "5XX"], "application/json"): + if utils.match_response(http_res, "4XX", "application/json"): + http_res_text = utils.stream_to_text(http_res) + data = utils.unmarshal_json(http_res_text, errors.ErrorData) + raise errors.Error(data=data) + if utils.match_response(http_res, "5XX", "application/json"): http_res_text = utils.stream_to_text(http_res) data = utils.unmarshal_json(http_res_text, errors.ErrorData) raise errors.Error(data=data) @@ -832,7 +850,11 @@ async def get_code_sample_preview_async_async( content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) - if utils.match_response(http_res, ["4XX", "5XX"], "application/json"): + if utils.match_response(http_res, "4XX", "application/json"): + http_res_text = await utils.stream_to_text_async(http_res) + data = utils.unmarshal_json(http_res_text, errors.ErrorData) + raise errors.Error(data=data) + if utils.match_response(http_res, "5XX", "application/json"): http_res_text = await utils.stream_to_text_async(http_res) data = utils.unmarshal_json(http_res_text, errors.ErrorData) raise errors.Error(data=data) diff --git a/src/speakeasy_client_sdk_python/models/errors/__init__.py b/src/speakeasy_client_sdk_python/models/errors/__init__.py index ebdc9b39..e0ea76e1 100644 --- a/src/speakeasy_client_sdk_python/models/errors/__init__.py +++ b/src/speakeasy_client_sdk_python/models/errors/__init__.py @@ -3,4 +3,5 @@ from .error import Error, ErrorData from .sdkerror import SDKError + __all__ = ["Error", "ErrorData", "SDKError"] diff --git a/src/speakeasy_client_sdk_python/models/internal/__init__.py b/src/speakeasy_client_sdk_python/models/internal/__init__.py index 9e3dfb7a..d49aa0f3 100644 --- a/src/speakeasy_client_sdk_python/models/internal/__init__.py +++ b/src/speakeasy_client_sdk_python/models/internal/__init__.py @@ -2,4 +2,5 @@ from .globals import Globals, GlobalsTypedDict + __all__ = ["Globals", "GlobalsTypedDict"] diff --git a/src/speakeasy_client_sdk_python/models/operations/__init__.py b/src/speakeasy_client_sdk_python/models/operations/__init__.py index 80581f33..0f07dacd 100644 --- a/src/speakeasy_client_sdk_python/models/operations/__init__.py +++ b/src/speakeasy_client_sdk_python/models/operations/__init__.py @@ -87,6 +87,8 @@ GetCodeSamplesRequestTypedDict, GetCodeSamplesResponse, GetCodeSamplesResponseTypedDict, + MethodPaths, + MethodPathsTypedDict, ) from .getgithubaction import ( GetGitHubActionRequest, @@ -312,6 +314,10 @@ SetVisibilityResponse, SetVisibilityResponseTypedDict, ) +from .setworkspacefeatureflags import ( + SetWorkspaceFeatureFlagsResponse, + SetWorkspaceFeatureFlagsResponseTypedDict, +) from .suggest import ( SuggestRequest, SuggestRequestTypedDict, @@ -363,6 +369,7 @@ ) from .validateapikey import ValidateAPIKeyResponse, ValidateAPIKeyResponseTypedDict + __all__ = [ "ActivateSubscriptionNamespaceRequest", "ActivateSubscriptionNamespaceRequestTypedDict", @@ -556,6 +563,8 @@ "ListRemoteSourcesRequestTypedDict", "ListRemoteSourcesResponse", "ListRemoteSourcesResponseTypedDict", + "MethodPaths", + "MethodPathsTypedDict", "PostTagsRequest", "PostTagsRequestTypedDict", "PostTagsResponse", @@ -588,6 +597,8 @@ "SetVisibilityRequestTypedDict", "SetVisibilityResponse", "SetVisibilityResponseTypedDict", + "SetWorkspaceFeatureFlagsResponse", + "SetWorkspaceFeatureFlagsResponseTypedDict", "SuggestItemsResponse", "SuggestItemsResponseTypedDict", "SuggestOpenAPIRegistryRequest", diff --git a/src/speakeasy_client_sdk_python/models/operations/getcodesamples.py b/src/speakeasy_client_sdk_python/models/operations/getcodesamples.py index 34e5af95..efa954e5 100644 --- a/src/speakeasy_client_sdk_python/models/operations/getcodesamples.py +++ b/src/speakeasy_client_sdk_python/models/operations/getcodesamples.py @@ -3,6 +3,7 @@ from __future__ import annotations import httpx from speakeasy_client_sdk_python.models.shared import ( + httpmethod as shared_httpmethod, usagesnippets as shared_usagesnippets, ) from speakeasy_client_sdk_python.types import BaseModel @@ -11,28 +12,51 @@ from typing_extensions import Annotated, NotRequired, TypedDict +class MethodPathsTypedDict(TypedDict): + method: shared_httpmethod.HTTPMethod + path: str + + +class MethodPaths(BaseModel): + method: Annotated[shared_httpmethod.HTTPMethod, FieldMetadata(query=True)] + + path: Annotated[str, FieldMetadata(query=True)] + + class GetCodeSamplesRequestTypedDict(TypedDict): registry_url: str - r"""The registry URL from which to retrieve the snippets. E.g. https://spec.speakeasy.com/org/ws/my-source""" + r"""The registry URL from which to retrieve the snippets.""" operation_ids: NotRequired[List[str]] + r"""The operation IDs to retrieve snippets for.""" + method_paths: NotRequired[List[MethodPathsTypedDict]] + r"""The method paths to retrieve snippets for.""" languages: NotRequired[List[str]] + r"""The languages to retrieve snippets for.""" class GetCodeSamplesRequest(BaseModel): registry_url: Annotated[ str, FieldMetadata(query=QueryParamMetadata(style="form", explode=True)) ] - r"""The registry URL from which to retrieve the snippets. E.g. https://spec.speakeasy.com/org/ws/my-source""" + r"""The registry URL from which to retrieve the snippets.""" operation_ids: Annotated[ Optional[List[str]], FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), ] = None + r"""The operation IDs to retrieve snippets for.""" + + method_paths: Annotated[ + Optional[List[MethodPaths]], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""The method paths to retrieve snippets for.""" languages: Annotated[ Optional[List[str]], FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), ] = None + r"""The languages to retrieve snippets for.""" class GetCodeSamplesResponseTypedDict(TypedDict): diff --git a/src/speakeasy_client_sdk_python/models/operations/setworkspacefeatureflags.py b/src/speakeasy_client_sdk_python/models/operations/setworkspacefeatureflags.py new file mode 100644 index 00000000..d6076121 --- /dev/null +++ b/src/speakeasy_client_sdk_python/models/operations/setworkspacefeatureflags.py @@ -0,0 +1,39 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +import httpx +from speakeasy_client_sdk_python.models.shared import ( + workspacefeatureflagresponse as shared_workspacefeatureflagresponse, +) +from speakeasy_client_sdk_python.types import BaseModel +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class SetWorkspaceFeatureFlagsResponseTypedDict(TypedDict): + content_type: str + r"""HTTP response content type for this operation""" + status_code: int + r"""HTTP response status code for this operation""" + raw_response: httpx.Response + r"""Raw HTTP response; suitable for custom response parsing""" + workspace_feature_flag_response: NotRequired[ + shared_workspacefeatureflagresponse.WorkspaceFeatureFlagResponseTypedDict + ] + r"""Success""" + + +class SetWorkspaceFeatureFlagsResponse(BaseModel): + content_type: str + r"""HTTP response content type for this operation""" + + status_code: int + r"""HTTP response status code for this operation""" + + raw_response: httpx.Response + r"""Raw HTTP response; suitable for custom response parsing""" + + workspace_feature_flag_response: Optional[ + shared_workspacefeatureflagresponse.WorkspaceFeatureFlagResponse + ] = None + r"""Success""" diff --git a/src/speakeasy_client_sdk_python/models/shared/__init__.py b/src/speakeasy_client_sdk_python/models/shared/__init__.py index 1c839643..3a12922f 100644 --- a/src/speakeasy_client_sdk_python/models/shared/__init__.py +++ b/src/speakeasy_client_sdk_python/models/shared/__init__.py @@ -55,6 +55,8 @@ from .githubpublishingprresponse import ( GithubPublishingPRResponse, GithubPublishingPRResponseTypedDict, + PullRequestMetadata, + PullRequestMetadataTypedDict, ) from .githubsetupstateresponse import ( Actions, @@ -72,6 +74,7 @@ GithubTriggerActionRequest, GithubTriggerActionRequestTypedDict, ) +from .httpmethod import HTTPMethod from .interactiontype import InteractionType from .manifest import Manifest, ManifestTypedDict from .namespace import ( @@ -129,6 +132,11 @@ WorkspaceAndOrganization, WorkspaceAndOrganizationTypedDict, ) +from .workspacefeatureflag import WorkspaceFeatureFlag +from .workspacefeatureflagrequest import ( + WorkspaceFeatureFlagRequest, + WorkspaceFeatureFlagRequestTypedDict, +) from .workspacefeatureflagresponse import ( WorkspaceFeatureFlagResponse, WorkspaceFeatureFlagResponseTypedDict, @@ -143,6 +151,7 @@ from .workspaceteamresponse import WorkspaceTeamResponse, WorkspaceTeamResponseTypedDict from .workspacetoken import WorkspaceToken, WorkspaceTokenTypedDict + __all__ = [ "APIKeyDetails", "APIKeyDetailsTypedDict", @@ -201,6 +210,7 @@ "GithubStorePublishingSecretsRequestTypedDict", "GithubTriggerActionRequest", "GithubTriggerActionRequestTypedDict", + "HTTPMethod", "InteractionType", "Level", "License", @@ -226,6 +236,8 @@ "PreflightRequestTypedDict", "PreflightToken", "PreflightTokenTypedDict", + "PullRequestMetadata", + "PullRequestMetadataTypedDict", "Relationship", "RelationshipTypedDict", "RemoteDocument", @@ -274,6 +286,9 @@ "Workspace", "WorkspaceAndOrganization", "WorkspaceAndOrganizationTypedDict", + "WorkspaceFeatureFlag", + "WorkspaceFeatureFlagRequest", + "WorkspaceFeatureFlagRequestTypedDict", "WorkspaceFeatureFlagResponse", "WorkspaceFeatureFlagResponseTypedDict", "WorkspaceInviteResponse", diff --git a/src/speakeasy_client_sdk_python/models/shared/featureflag.py b/src/speakeasy_client_sdk_python/models/shared/featureflag.py index 3fc81057..a27afc5d 100644 --- a/src/speakeasy_client_sdk_python/models/shared/featureflag.py +++ b/src/speakeasy_client_sdk_python/models/shared/featureflag.py @@ -1,8 +1,10 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations +from .workspacefeatureflag import WorkspaceFeatureFlag from datetime import datetime from pydantic import model_serializer +from pydantic.functional_validators import PlainValidator from speakeasy_client_sdk_python.types import ( BaseModel, Nullable, @@ -10,20 +12,25 @@ UNSET, UNSET_SENTINEL, ) -from typing_extensions import NotRequired, TypedDict +from speakeasy_client_sdk_python.utils import validate_open_enum +from typing_extensions import Annotated, NotRequired, TypedDict class FeatureFlagTypedDict(TypedDict): r"""A feature flag is a key-value pair that can be used to enable or disable features.""" - feature_flag: str + feature_flag: WorkspaceFeatureFlag + r"""enum value workspace feature flag""" trial_ends_at: NotRequired[Nullable[datetime]] class FeatureFlag(BaseModel): r"""A feature flag is a key-value pair that can be used to enable or disable features.""" - feature_flag: str + feature_flag: Annotated[ + WorkspaceFeatureFlag, PlainValidator(validate_open_enum(False)) + ] + r"""enum value workspace feature flag""" trial_ends_at: OptionalNullable[datetime] = UNSET diff --git a/src/speakeasy_client_sdk_python/models/shared/githubpublishingprresponse.py b/src/speakeasy_client_sdk_python/models/shared/githubpublishingprresponse.py index 562354d1..82aed2d2 100644 --- a/src/speakeasy_client_sdk_python/models/shared/githubpublishingprresponse.py +++ b/src/speakeasy_client_sdk_python/models/shared/githubpublishingprresponse.py @@ -1,21 +1,69 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations +from datetime import datetime from speakeasy_client_sdk_python.types import BaseModel -from typing import Optional +from typing import List, Optional from typing_extensions import NotRequired, TypedDict +class PullRequestMetadataTypedDict(TypedDict): + r"""This can only be populated when the github app is installed for a repo""" + + base_branch: NotRequired[str] + can_merge: NotRequired[bool] + created_at: NotRequired[datetime] + description: NotRequired[str] + r"""truncated to first 1000 characters""" + head_branch: NotRequired[str] + labels: NotRequired[List[str]] + r"""List of github labels""" + requested_reviewers: NotRequired[List[str]] + r"""List of github handles""" + status: NotRequired[str] + title: NotRequired[str] + + +class PullRequestMetadata(BaseModel): + r"""This can only be populated when the github app is installed for a repo""" + + base_branch: Optional[str] = None + + can_merge: Optional[bool] = None + + created_at: Optional[datetime] = None + + description: Optional[str] = None + r"""truncated to first 1000 characters""" + + head_branch: Optional[str] = None + + labels: Optional[List[str]] = None + r"""List of github labels""" + + requested_reviewers: Optional[List[str]] = None + r"""List of github handles""" + + status: Optional[str] = None + + title: Optional[str] = None + + class GithubPublishingPRResponseTypedDict(TypedDict): r"""Open generation PRs pending publishing""" - generation_pull_request: NotRequired[str] pending_version: NotRequired[str] + pull_request: NotRequired[str] + pull_request_metadata: NotRequired[PullRequestMetadataTypedDict] + r"""This can only be populated when the github app is installed for a repo""" class GithubPublishingPRResponse(BaseModel): r"""Open generation PRs pending publishing""" - generation_pull_request: Optional[str] = None - pending_version: Optional[str] = None + + pull_request: Optional[str] = None + + pull_request_metadata: Optional[PullRequestMetadata] = None + r"""This can only be populated when the github app is installed for a repo""" diff --git a/src/speakeasy_client_sdk_python/models/shared/httpmethod.py b/src/speakeasy_client_sdk_python/models/shared/httpmethod.py new file mode 100644 index 00000000..b943efaa --- /dev/null +++ b/src/speakeasy_client_sdk_python/models/shared/httpmethod.py @@ -0,0 +1,15 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class HTTPMethod(str, Enum): + GET = "get" + POST = "post" + PUT = "put" + PATCH = "patch" + DELETE = "delete" + HEAD = "head" + OPTIONS = "options" + TRACE = "trace" diff --git a/src/speakeasy_client_sdk_python/models/shared/usagesnippet.py b/src/speakeasy_client_sdk_python/models/shared/usagesnippet.py index b7ed66ff..011ea49b 100644 --- a/src/speakeasy_client_sdk_python/models/shared/usagesnippet.py +++ b/src/speakeasy_client_sdk_python/models/shared/usagesnippet.py @@ -3,6 +3,7 @@ from __future__ import annotations import pydantic from speakeasy_client_sdk_python.types import BaseModel +from typing import Any from typing_extensions import Annotated, TypedDict @@ -11,8 +12,12 @@ class UsageSnippetTypedDict(TypedDict): r"""The code snippet""" language: str r"""The language of the snippet""" + method: Any + r"""The HTTP method of the operation""" operation_id: str r"""The operation ID for the snippet""" + path: str + r"""The path of the operation""" class UsageSnippet(BaseModel): @@ -22,5 +27,11 @@ class UsageSnippet(BaseModel): language: str r"""The language of the snippet""" + method: Any + r"""The HTTP method of the operation""" + operation_id: Annotated[str, pydantic.Field(alias="operationId")] r"""The operation ID for the snippet""" + + path: str + r"""The path of the operation""" diff --git a/src/speakeasy_client_sdk_python/models/shared/user.py b/src/speakeasy_client_sdk_python/models/shared/user.py index f250ddb5..ef19485a 100644 --- a/src/speakeasy_client_sdk_python/models/shared/user.py +++ b/src/speakeasy_client_sdk_python/models/shared/user.py @@ -43,6 +43,8 @@ class UserTypedDict(TypedDict): r"""Timestamp of the last login.""" photo_url: NotRequired[Nullable[str]] r"""URL of the user's photo.""" + pylon_identity_hash: NotRequired[str] + r"""Hash used for pylon identity verification returned on v1/user.""" class User(BaseModel): @@ -88,6 +90,9 @@ class User(BaseModel): photo_url: OptionalNullable[str] = UNSET r"""URL of the user's photo.""" + pylon_identity_hash: Optional[str] = None + r"""Hash used for pylon identity verification returned on v1/user.""" + @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = [ @@ -96,6 +101,7 @@ def serialize_model(self, handler): "internal", "last_login_at", "photo_url", + "pylon_identity_hash", ] nullable_fields = [ "default_workspace_id", diff --git a/src/speakeasy_client_sdk_python/models/shared/workspacefeatureflag.py b/src/speakeasy_client_sdk_python/models/shared/workspacefeatureflag.py new file mode 100644 index 00000000..f445ac9a --- /dev/null +++ b/src/speakeasy_client_sdk_python/models/shared/workspacefeatureflag.py @@ -0,0 +1,14 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum +from speakeasy_client_sdk_python import utils + + +class WorkspaceFeatureFlag(str, Enum, metaclass=utils.OpenEnumMeta): + r"""enum value workspace feature flag""" + + SCHEMA_REGISTRY = "schema_registry" + CHANGES_REPORT = "changes_report" + SKIP_SCHEMA_REGISTRY = "skip_schema_registry" + WEBHOOKS = "webhooks" diff --git a/src/speakeasy_client_sdk_python/models/shared/workspacefeatureflagrequest.py b/src/speakeasy_client_sdk_python/models/shared/workspacefeatureflagrequest.py new file mode 100644 index 00000000..a448a2d2 --- /dev/null +++ b/src/speakeasy_client_sdk_python/models/shared/workspacefeatureflagrequest.py @@ -0,0 +1,23 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .workspacefeatureflag import WorkspaceFeatureFlag +from pydantic.functional_validators import PlainValidator +from speakeasy_client_sdk_python.types import BaseModel +from speakeasy_client_sdk_python.utils import validate_open_enum +from typing import List +from typing_extensions import Annotated, TypedDict + + +class WorkspaceFeatureFlagRequestTypedDict(TypedDict): + r"""A request to add workspace feature flags""" + + feature_flags: List[WorkspaceFeatureFlag] + + +class WorkspaceFeatureFlagRequest(BaseModel): + r"""A request to add workspace feature flags""" + + feature_flags: List[ + Annotated[WorkspaceFeatureFlag, PlainValidator(validate_open_enum(False))] + ] diff --git a/src/speakeasy_client_sdk_python/reports.py b/src/speakeasy_client_sdk_python/reports.py index 3caa2e8d..d40b33b5 100644 --- a/src/speakeasy_client_sdk_python/reports.py +++ b/src/speakeasy_client_sdk_python/reports.py @@ -90,7 +90,12 @@ def get_changes_report_signed_url( content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -184,7 +189,12 @@ async def get_changes_report_signed_url_async( content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -278,7 +288,12 @@ def get_linting_report_signed_url( content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -372,7 +387,12 @@ async def get_linting_report_signed_url_async( content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -466,7 +486,12 @@ def upload_report( content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -560,7 +585,12 @@ async def upload_report_async( content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res diff --git a/src/speakeasy_client_sdk_python/sdkconfiguration.py b/src/speakeasy_client_sdk_python/sdkconfiguration.py index bf614611..c86b4d2c 100644 --- a/src/speakeasy_client_sdk_python/sdkconfiguration.py +++ b/src/speakeasy_client_sdk_python/sdkconfiguration.py @@ -1,6 +1,12 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from ._hooks import SDKHooks +from ._version import ( + __gen_version__, + __openapi_doc_version__, + __user_agent__, + __version__, +) from .httpclient import AsyncHttpClient, HttpClient from .utils import Logger, RetryConfig, remove_suffix from dataclasses import dataclass @@ -27,12 +33,10 @@ class SDKConfiguration: server_url: Optional[str] = "" server: Optional[str] = "" language: str = "python" - openapi_doc_version: str = "0.4.0" - sdk_version: str = "7.0.0-rc.2" - gen_version: str = "2.486.1" - user_agent: str = ( - "speakeasy-sdk/python 7.0.0-rc.2 2.486.1 0.4.0 speakeasy-client-sdk-python" - ) + openapi_doc_version: str = __openapi_doc_version__ + sdk_version: str = __version__ + gen_version: str = __gen_version__ + user_agent: str = __user_agent__ retry_config: OptionalNullable[RetryConfig] = Field(default_factory=lambda: UNSET) timeout_ms: Optional[int] = None diff --git a/src/speakeasy_client_sdk_python/shorturls.py b/src/speakeasy_client_sdk_python/shorturls.py index 31220d9c..99be1fce 100644 --- a/src/speakeasy_client_sdk_python/shorturls.py +++ b/src/speakeasy_client_sdk_python/shorturls.py @@ -89,7 +89,12 @@ def create( content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -182,7 +187,12 @@ async def create_async( content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res diff --git a/src/speakeasy_client_sdk_python/suggest.py b/src/speakeasy_client_sdk_python/suggest.py index 9c37b0b6..54042592 100644 --- a/src/speakeasy_client_sdk_python/suggest.py +++ b/src/speakeasy_client_sdk_python/suggest.py @@ -92,7 +92,12 @@ def suggest( content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -188,7 +193,12 @@ async def suggest_async( content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -279,7 +289,12 @@ def suggest_items( content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -370,7 +385,12 @@ async def suggest_items_async( content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -468,7 +488,12 @@ def suggest_open_api( content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -566,7 +591,12 @@ async def suggest_open_api_async( content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -665,7 +695,12 @@ def suggest_open_api_registry( content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -764,7 +799,12 @@ async def suggest_open_api_registry_async( content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res diff --git a/src/speakeasy_client_sdk_python/workspaces.py b/src/speakeasy_client_sdk_python/workspaces.py index 65477b00..d00b712c 100644 --- a/src/speakeasy_client_sdk_python/workspaces.py +++ b/src/speakeasy_client_sdk_python/workspaces.py @@ -2323,6 +2323,202 @@ async def revoke_access_async( http_res, ) + def set_feature_flags( + self, + *, + request: Union[ + shared.WorkspaceFeatureFlagRequest, + shared.WorkspaceFeatureFlagRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.SetWorkspaceFeatureFlagsResponse: + r"""Set workspace feature flags + + :param request: The request object to send. + :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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, shared.WorkspaceFeatureFlagRequest) + request = cast(shared.WorkspaceFeatureFlagRequest, request) + + req = self._build_request( + method="POST", + path="/v1/workspace/feature_flags", + 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, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", shared.WorkspaceFeatureFlagRequest + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="setWorkspaceFeatureFlags", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["4XX", "5XX"], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return operations.SetWorkspaceFeatureFlagsResponse( + workspace_feature_flag_response=utils.unmarshal_json( + http_res.text, Optional[shared.WorkspaceFeatureFlagResponse] + ), + status_code=http_res.status_code, + content_type=http_res.headers.get("Content-Type") or "", + raw_response=http_res, + ) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "application/json"): + data = utils.unmarshal_json(http_res.text, errors.ErrorData) + raise errors.Error(data=data) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def set_feature_flags_async( + self, + *, + request: Union[ + shared.WorkspaceFeatureFlagRequest, + shared.WorkspaceFeatureFlagRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.SetWorkspaceFeatureFlagsResponse: + r"""Set workspace feature flags + + :param request: The request object to send. + :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 + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, shared.WorkspaceFeatureFlagRequest) + request = cast(shared.WorkspaceFeatureFlagRequest, request) + + req = self._build_request_async( + method="POST", + path="/v1/workspace/feature_flags", + 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, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", shared.WorkspaceFeatureFlagRequest + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="setWorkspaceFeatureFlags", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["4XX", "5XX"], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return operations.SetWorkspaceFeatureFlagsResponse( + workspace_feature_flag_response=utils.unmarshal_json( + http_res.text, Optional[shared.WorkspaceFeatureFlagResponse] + ), + status_code=http_res.status_code, + content_type=http_res.headers.get("Content-Type") or "", + raw_response=http_res, + ) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "application/json"): + data = utils.unmarshal_json(http_res.text, errors.ErrorData) + raise errors.Error(data=data) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + def update( self, *,