diff --git a/openapi/openapi.yaml b/openapi/openapi.yaml index a0cc7369..37e4b5ae 100644 --- a/openapi/openapi.yaml +++ b/openapi/openapi.yaml @@ -37,6 +37,8 @@ tags: description: Service keys for function invocation and database admin access - name: Variables description: Environment variable management + - name: Variable Environments + description: Project-owned variable Environment identity and lifecycle management - name: Databases description: PostgreSQL database provisioning and management - name: Database Branches @@ -78,7 +80,7 @@ tags: - name: Realtime description: WebSocket realtime configuration and monitoring - name: System - description: System health and monitoring endpoints + description: System health, capability discovery, and monitoring endpoints - name: CLI Authentication description: | Browser-based CLI login flow for automatic token provisioning. @@ -7016,6 +7018,262 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + /projects/{id}/variable-environments: + get: + tags: + - Variable Environments + summary: List variable Environments + operationId: listVariableEnvironments + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + responses: + '200': + description: Variable Environments, with Global first and custom Environments ordered by name + content: + application/json: + schema: + $ref: '#/components/schemas/VariableEnvironmentList' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: Project not owned by the caller + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: Failed to list variable Environments + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + post: + tags: + - Variable Environments + summary: Create a variable Environment + operationId: createVariableEnvironment + description: Creates a custom variable Environment. Global is reserved and already exists. A Project may have at most 100 custom Environments. + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateVariableEnvironmentRequest' + responses: + '201': + description: Variable Environment created + content: + application/json: + schema: + $ref: '#/components/schemas/VariableEnvironment' + '400': + description: | + Invalid name, or the reserved Global name. Schema-invalid names + return the generic invalid-request error; a reserved name returns + `invalid_variable_environment`. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: Project not owned by the caller + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Project no longer exists + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '409': + description: | + A case-insensitive name conflict or the 100-custom-Environment + limit has been reached, or the Project is being deleted. Tell them + apart with `code`, which is `variable_environment_conflict`, + `variable_environment_limit_reached`, or `project_deleting`. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: Failed to create the variable Environment + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /projects/{id}/variable-environments/{environmentId}: + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/VariableEnvironmentId' + get: + tags: + - Variable Environments + summary: Get a variable Environment + operationId: getVariableEnvironment + security: + - UserToken: [] + - ProjectAccessToken: [] + responses: + '200': + description: Variable Environment details + content: + application/json: + schema: + $ref: '#/components/schemas/VariableEnvironment' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: Project not owned by the caller + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Variable Environment not found in this Project + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: Failed to get the variable Environment + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + patch: + tags: + - Variable Environments + summary: Rename a variable Environment + operationId: renameVariableEnvironment + description: Renames a custom Environment without changing its stable ID. Global cannot be renamed. + security: + - UserToken: [] + - ProjectAccessToken: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/RenameVariableEnvironmentRequest' + responses: + '200': + description: Variable Environment renamed + content: + application/json: + schema: + $ref: '#/components/schemas/VariableEnvironment' + '400': + description: | + Invalid name, or the reserved Global name. Schema-invalid names + return the generic invalid-request error; a reserved name returns + `invalid_variable_environment`. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: Project not owned by the caller + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Variable Environment not found in this Project + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '409': + description: | + A case-insensitive name conflict, an attempt to rename Global, or + a Project being deleted. Tell them apart with `code`, which is + `variable_environment_conflict`, + `variable_environment_immutable`, or `project_deleting`. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: Failed to rename the variable Environment + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + delete: + tags: + - Variable Environments + summary: Delete a variable Environment + operationId: deleteVariableEnvironment + description: Deletes a custom Environment. Global cannot be deleted. + security: + - UserToken: [] + - ProjectAccessToken: [] + responses: + '204': + description: Variable Environment deleted + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: Project not owned by the caller + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Variable Environment not found in this Project + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '409': + description: | + Global is protected, or the Project is being deleted. Tell them + apart with `code`, which is `variable_environment_immutable` or + `project_deleting`. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: Failed to delete the variable Environment + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /projects/{id}/variables: get: tags: @@ -11074,7 +11332,8 @@ paths: `subject` field is ignored. Sending `subject` alone (no bodies) is rejected with 400 to avoid a silently-dropped subject or a blank message. Also rejects with 400 if - `email_enabled=false` or `smtp_host` is empty. + `email_enabled=false`, `smtp_host` is empty, or the saved + `smtp_password` can't be read and must be set again. operationId: testEmailConfig security: - UserToken: [] @@ -14632,6 +14891,45 @@ paths: schema: type: string example: OK + /capabilities: + get: + tags: + - System + summary: List capabilities + description: | + Lists which product capabilities accept new work in this environment. Check it + to decide what to offer, instead of calling a route to see whether it fails. + + | ID | Covers | + | --- | --- | + | `sandboxes` | The Sandbox API: presets, templates, sessions, and executions | + | `sandboxes.sessions` | Starting and resuming sessions, and one-shot executions | + | `sandboxes.custom_templates` | Deploying a custom template; its validation waits while `sandboxes.sessions` is unavailable | + + A capability missing from the list is unavailable, and a capability under + another, such as `sandboxes.sessions`, is unavailable whenever its parent is. + While a capability is unavailable, requests that start new work answer `404` + or `400` with code `feature_unavailable`; refresh this list when you receive + that code. Reading, deleting, and terminating what already exists keep + working unless the whole feature is absent from the environment. Every caller + in an environment gets the same answer. + operationId: listCapabilities + security: [] + responses: + '200': + description: Capabilities in this environment + content: + application/json: + schema: + $ref: '#/components/schemas/CapabilityList' + example: + data: + - id: sandboxes + status: available + - id: sandboxes.sessions + status: available + - id: sandboxes.custom_templates + status: unavailable /openapi.json: get: tags: @@ -15001,6 +15299,14 @@ components: type: string format: uuid description: Frontend deployment ID + VariableEnvironmentId: + name: environmentId + in: path + required: true + schema: + type: string + format: uuid + description: Variable Environment ID FrontendId: name: frontendId in: path @@ -15421,6 +15727,8 @@ components: sandbox_id: type: string format: uuid + nullable: true + description: Explicit template used to create the session. Null when created directly from a preset. state: type: string enum: @@ -15451,6 +15759,8 @@ components: expires_at: type: string format: date-time + nullable: true + description: Absolute VM expiry. Null means unlimited in local mode. required: - id - project_id @@ -15481,15 +15791,10 @@ components: pattern: ^(aws-)?[a-z]{2}(-[a-z]+)+-[0-9]+$ description: Region such as `us-east-1`. Region IDs issued by earlier versions of the API are still accepted. max_duration_seconds: - type: integer - minimum: 30 - maximum: 28800 - description: Inherits the template TTL when omitted (3600 seconds for a new template). - idle_timeout_seconds: type: integer minimum: 0 - maximum: 28800 - description: Inherits the template idle timeout when omitted, capped at the session duration. Set zero to disable idle timeout. + maximum: 2147483647 + description: Inherits the template TTL when omitted (cloud default 3600 seconds; local default 0, unlimited). Cloud accepts 30–28800 seconds; local accepts 0 for unlimited or a positive lifetime. required: - region oneOf: @@ -15513,9 +15818,9 @@ components: maxLength: 65536 timeout_seconds: type: integer - minimum: 1 - maximum: 3600 - default: 60 + minimum: 0 + maximum: 2147483647 + description: Command execution time from process start. Cloud defaults to 60 seconds and accepts 1–28800; local defaults to 0 (unlimited) and accepts nonnegative values. VM expiry always takes precedence. Cloud synchronous requests must return within the public connection idle limit (1000 seconds); use a session with a background process and short polling requests for longer work. environment: type: object additionalProperties: @@ -15542,15 +15847,20 @@ components: type: string pattern: ^(aws-)?[a-z]{2}(-[a-z]+)+-[0-9]+$ description: Region such as `us-east-1`. Region IDs issued by earlier versions of the API are still accepted. + max_duration_seconds: + type: integer + minimum: 0 + maximum: 2147483647 + description: Absolute VM lifetime including startup, bounded by environment capacity policy. Inherits the template TTL when omitted (cloud default 3600 seconds; local default 0, unlimited). Cloud accepts 30–28800 seconds; local accepts 0 for unlimited or a positive lifetime. The VM is reclaimed early when the command finishes. command: type: string minLength: 1 maxLength: 65536 timeout_seconds: type: integer - minimum: 1 - maximum: 60 - default: 60 + minimum: 0 + maximum: 2147483647 + description: Command execution time from process start. Cloud defaults to 60 seconds and accepts 1–28800; local defaults to 0 (unlimited) and accepts nonnegative values. VM expiry always takes precedence. Cloud synchronous requests must return within the public connection idle limit (1000 seconds); use a session with a background process and short polling requests for longer work. environment: type: object additionalProperties: @@ -15805,6 +16115,36 @@ components: $ref: '#/components/schemas/SandboxPreset' required: - data + Capability: + type: object + additionalProperties: false + description: A product capability and whether it accepts new work in this environment. + properties: + id: + type: string + description: Stable capability ID, such as `sandboxes`, `sandboxes.sessions`, or `sandboxes.custom_templates`. New IDs may appear at any time. + example: sandboxes.sessions + status: + $ref: '#/components/schemas/CapabilityStatus' + required: + - id + - status + CapabilityStatus: + type: string + enum: + - available + - unavailable + description: '`available` means the capability accepts new work; a temporary outage still answers `503`. `unavailable` means requests that start new work answer `404` or `400` with code `feature_unavailable`. Treat any other value as `unavailable`.' + CapabilityList: + type: object + additionalProperties: false + properties: + data: + type: array + items: + $ref: '#/components/schemas/Capability' + required: + - data SandboxCapacity: type: object additionalProperties: false @@ -15906,6 +16246,10 @@ components: type: integer description: Refresh token lifetime in seconds default: 2592000 + refresh_token_reuse_interval: + type: integer + description: A refresh within this many seconds of the refresh token being issued returns the same refresh token instead of rotating it, so concurrent refreshes from several tabs all succeed + default: 10 inactivity_timeout: type: integer description: Force re-login after inactivity (seconds, 0=never) @@ -15954,6 +16298,10 @@ components: type: integer description: Refreshes per hour per IP default: 1000 + rate_limit_password_reset: + type: integer + description: Password reset requests per hour per IP. Unlike the other limits, 0 applies the default of 10 instead of turning the limit off. + default: 10 cors_enabled: type: boolean default: false @@ -16090,6 +16438,12 @@ components: the built-in managed device page. Lets a CLI surface the project's own RFC 8628 approval page. Empty falls back to the managed page. example: https://app.acme.com/device + created_at: + type: string + format: date-time + updated_at: + type: string + format: date-time required: - password_policy AuthInsightsInterval: @@ -17068,6 +17422,67 @@ components: required: - name - value + VariableEnvironment: + type: object + description: Stable identity for a Project-owned variable Environment. + properties: + id: + type: string + format: uuid + project_id: + type: string + format: uuid + name: + type: string + pattern: ^[A-Za-z0-9_-]{1,64}$ + minLength: 1 + maxLength: 64 + is_global: + type: boolean + description: Whether this is the reserved Global Environment. + created_at: + type: string + format: date-time + updated_at: + type: string + format: date-time + required: + - id + - project_id + - name + - is_global + - created_at + - updated_at + VariableEnvironmentList: + type: object + properties: + data: + type: array + maxItems: 101 + items: + $ref: '#/components/schemas/VariableEnvironment' + required: + - data + CreateVariableEnvironmentRequest: + type: object + additionalProperties: false + properties: + name: + type: string + description: Leading and trailing ASCII whitespace is trimmed before validating 1–64 ASCII letters, digits, underscores, or hyphens. Global is reserved. + pattern: ^[ \t\n\f\r]*[A-Za-z0-9_-]{1,64}[ \t\n\f\r]*$ + required: + - name + RenameVariableEnvironmentRequest: + type: object + additionalProperties: false + properties: + name: + type: string + description: Leading and trailing ASCII whitespace is trimmed before validating 1–64 ASCII letters, digits, underscores, or hyphens. Global is reserved. + pattern: ^[ \t\n\f\r]*[A-Za-z0-9_-]{1,64}[ \t\n\f\r]*$ + required: + - name Database: type: object description: | @@ -18886,6 +19301,7 @@ components: description: Failure category, present only when managed TLS setup has failed. Current values are provider, certificate, ownership, and internal; ownership means another account has already claimed the hostname through ownership verification. Treat unrecognized values as internal. verification_records: type: array + description: DNS records to publish now. For a managed domain whose hostname the account already owns, the create response names the `_acme-challenge` CNAME that authorizes certificate issuance and renewal. Otherwise it names the `_volcano` TXT record that proves ownership of the hostname's registrable domain, and reads return the CNAME once Volcano sees that record. Usually empty for BYOC. items: $ref: '#/components/schemas/FrontendDomainVerificationRecord' required_routing_record: @@ -20862,9 +21278,14 @@ components: type: string maxLength: 4000 details: + x-go-type: json.RawMessage + x-go-type-skip-optional-pointer: true description: | - Any JSON value to show the person deciding. The whole request is - limited to 64 KiB. + Any JSON value to show the person deciding. A number's exponent must + be between -324 and 324, and a number too large or too precise to + store is refused with `400`. Numbers are read back written out in + full, so the exponents' absolute values may total at most 65,536. + The whole request is limited to 64 KiB. required: - execution_ref - callback_id @@ -23007,10 +23428,17 @@ components: type: integer refresh_token_lifetime: type: integer + refresh_token_reuse_interval: + type: integer inactivity_timeout: type: integer max_session_duration: type: integer + platform_token_ttl: + type: integer + description: TTL in seconds for platform tokens minted via `/auth/platform/exchange`. From 3600 (1 hour) to 31536000 (365 days). + minimum: 3600 + maximum: 31536000 min_password_length: type: integer minimum: 15 @@ -23035,6 +23463,19 @@ components: type: integer rate_limit_token_refresh: type: integer + rate_limit_password_reset: + type: integer + description: Password reset requests per hour per IP. Unlike the other limits, 0 applies the default of 10 instead of turning the limit off. + cors_enabled: + type: boolean + cors_allowed_origins: + type: array + description: Replaces the allowed origins list. + items: + type: string + example: + - https://myapp.com + - http://localhost:3000 cors_allow_credentials: type: boolean cors_max_age: @@ -23673,16 +24114,11 @@ components: type: integer minimum: 1 maximum: 65532 - idle_timeout_seconds: - type: integer - minimum: 0 - maximum: 28800 - description: Default idle timeout for new sessions when the caller omits it. ttl_seconds: type: integer - minimum: 30 - maximum: 28800 - description: Default absolute lifetime for new sessions when the caller omits it. + minimum: 0 + maximum: 2147483647 + description: Default absolute lifetime for new sessions when the caller omits it. Cloud accepts 30–28800 seconds; local accepts 0 for unlimited or a positive lifetime. DatabaseQueryPerformanceDatabase: type: object properties: diff --git a/src/volcano_sdk/_generated/api/auth_configuration/test_email_config.py b/src/volcano_sdk/_generated/api/auth_configuration/test_email_config.py index ba7fe59c..c65d5579 100644 --- a/src/volcano_sdk/_generated/api/auth_configuration/test_email_config.py +++ b/src/volcano_sdk/_generated/api/auth_configuration/test_email_config.py @@ -105,7 +105,8 @@ def sync_detailed( `subject` field is ignored. Sending `subject` alone (no bodies) is rejected with 400 to avoid a silently-dropped subject or a blank message. Also rejects with 400 if - `email_enabled=false` or `smtp_host` is empty. + `email_enabled=false`, `smtp_host` is empty, or the saved + `smtp_password` can't be read and must be set again. Args: id (UUID): @@ -159,7 +160,8 @@ def sync( `subject` field is ignored. Sending `subject` alone (no bodies) is rejected with 400 to avoid a silently-dropped subject or a blank message. Also rejects with 400 if - `email_enabled=false` or `smtp_host` is empty. + `email_enabled=false`, `smtp_host` is empty, or the saved + `smtp_password` can't be read and must be set again. Args: id (UUID): @@ -208,7 +210,8 @@ async def asyncio_detailed( `subject` field is ignored. Sending `subject` alone (no bodies) is rejected with 400 to avoid a silently-dropped subject or a blank message. Also rejects with 400 if - `email_enabled=false` or `smtp_host` is empty. + `email_enabled=false`, `smtp_host` is empty, or the saved + `smtp_password` can't be read and must be set again. Args: id (UUID): @@ -262,7 +265,8 @@ async def asyncio( `subject` field is ignored. Sending `subject` alone (no bodies) is rejected with 400 to avoid a silently-dropped subject or a blank message. Also rejects with 400 if - `email_enabled=false` or `smtp_host` is empty. + `email_enabled=false`, `smtp_host` is empty, or the saved + `smtp_password` can't be read and must be set again. Args: id (UUID): diff --git a/src/volcano_sdk/_generated/api/system/list_capabilities.py b/src/volcano_sdk/_generated/api/system/list_capabilities.py new file mode 100644 index 00000000..9acf3c20 --- /dev/null +++ b/src/volcano_sdk/_generated/api/system/list_capabilities.py @@ -0,0 +1,222 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.capability_list import CapabilityList +from typing import cast + + + +def request_kwargs( + +) -> dict[str, Any]: + + + + + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/capabilities", + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> CapabilityList | None: + if response.status_code == 200: + response_200 = CapabilityList.from_dict(response.json()) + + + + return response_200 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[CapabilityList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + +) -> Response[CapabilityList]: + """ List capabilities + + Lists which product capabilities accept new work in this environment. Check it + to decide what to offer, instead of calling a route to see whether it fails. + + | ID | Covers | + | --- | --- | + | `sandboxes` | The Sandbox API: presets, templates, sessions, and executions | + | `sandboxes.sessions` | Starting and resuming sessions, and one-shot executions | + | `sandboxes.custom_templates` | Deploying a custom template; its validation waits while + `sandboxes.sessions` is unavailable | + + A capability missing from the list is unavailable, and a capability under + another, such as `sandboxes.sessions`, is unavailable whenever its parent is. + While a capability is unavailable, requests that start new work answer `404` + or `400` with code `feature_unavailable`; refresh this list when you receive + that code. Reading, deleting, and terminating what already exists keep + working unless the whole feature is absent from the environment. Every caller + in an environment gets the same answer. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CapabilityList] + """ + + + kwargs = request_kwargs( + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient | Client, + +) -> CapabilityList | None: + """ List capabilities + + Lists which product capabilities accept new work in this environment. Check it + to decide what to offer, instead of calling a route to see whether it fails. + + | ID | Covers | + | --- | --- | + | `sandboxes` | The Sandbox API: presets, templates, sessions, and executions | + | `sandboxes.sessions` | Starting and resuming sessions, and one-shot executions | + | `sandboxes.custom_templates` | Deploying a custom template; its validation waits while + `sandboxes.sessions` is unavailable | + + A capability missing from the list is unavailable, and a capability under + another, such as `sandboxes.sessions`, is unavailable whenever its parent is. + While a capability is unavailable, requests that start new work answer `404` + or `400` with code `feature_unavailable`; refresh this list when you receive + that code. Reading, deleting, and terminating what already exists keep + working unless the whole feature is absent from the environment. Every caller + in an environment gets the same answer. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CapabilityList + """ + + + return sync_detailed( + client=client, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + +) -> Response[CapabilityList]: + """ List capabilities + + Lists which product capabilities accept new work in this environment. Check it + to decide what to offer, instead of calling a route to see whether it fails. + + | ID | Covers | + | --- | --- | + | `sandboxes` | The Sandbox API: presets, templates, sessions, and executions | + | `sandboxes.sessions` | Starting and resuming sessions, and one-shot executions | + | `sandboxes.custom_templates` | Deploying a custom template; its validation waits while + `sandboxes.sessions` is unavailable | + + A capability missing from the list is unavailable, and a capability under + another, such as `sandboxes.sessions`, is unavailable whenever its parent is. + While a capability is unavailable, requests that start new work answer `404` + or `400` with code `feature_unavailable`; refresh this list when you receive + that code. Reading, deleting, and terminating what already exists keep + working unless the whole feature is absent from the environment. Every caller + in an environment gets the same answer. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CapabilityList] + """ + + + kwargs = request_kwargs( + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient | Client, + +) -> CapabilityList | None: + """ List capabilities + + Lists which product capabilities accept new work in this environment. Check it + to decide what to offer, instead of calling a route to see whether it fails. + + | ID | Covers | + | --- | --- | + | `sandboxes` | The Sandbox API: presets, templates, sessions, and executions | + | `sandboxes.sessions` | Starting and resuming sessions, and one-shot executions | + | `sandboxes.custom_templates` | Deploying a custom template; its validation waits while + `sandboxes.sessions` is unavailable | + + A capability missing from the list is unavailable, and a capability under + another, such as `sandboxes.sessions`, is unavailable whenever its parent is. + While a capability is unavailable, requests that start new work answer `404` + or `400` with code `feature_unavailable`; refresh this list when you receive + that code. Reading, deleting, and terminating what already exists keep + working unless the whole feature is absent from the environment. Every caller + in an environment gets the same answer. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CapabilityList + """ + + + return (await asyncio_detailed( + client=client, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/variable_environments/__init__.py b/src/volcano_sdk/_generated/api/variable_environments/__init__.py new file mode 100644 index 00000000..c9921b5f --- /dev/null +++ b/src/volcano_sdk/_generated/api/variable_environments/__init__.py @@ -0,0 +1 @@ +""" Contains endpoint functions for accessing the API """ diff --git a/src/volcano_sdk/_generated/api/variable_environments/create_variable_environment.py b/src/volcano_sdk/_generated/api/variable_environments/create_variable_environment.py new file mode 100644 index 00000000..6197caae --- /dev/null +++ b/src/volcano_sdk/_generated/api/variable_environments/create_variable_environment.py @@ -0,0 +1,247 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.create_variable_environment_request import CreateVariableEnvironmentRequest +from ...models.error import Error +from ...models.variable_environment import VariableEnvironment +from typing import cast +from uuid import UUID + + + +def request_kwargs( + id: UUID | str, + *, + body: CreateVariableEnvironmentRequest, + +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + + + + + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/projects/{id}/variable-environments".format(id=quote(str(id), safe=""),), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | VariableEnvironment | None: + if response.status_code == 201: + response_201 = VariableEnvironment.from_dict(response.json()) + + + + return response_201 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if response.status_code == 409: + response_409 = Error.from_dict(response.json()) + + + + return response_409 + + if response.status_code == 500: + response_500 = Error.from_dict(response.json()) + + + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | VariableEnvironment]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID | str, + *, + client: AuthenticatedClient, + body: CreateVariableEnvironmentRequest, + +) -> Response[Error | VariableEnvironment]: + """ Create a variable Environment + + Creates a custom variable Environment. Global is reserved and already exists. A Project may have at + most 100 custom Environments. + + Args: + id (UUID): + body (CreateVariableEnvironmentRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | VariableEnvironment] + """ + + + kwargs = request_kwargs( + id=id, +body=body, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + id: UUID | str, + *, + client: AuthenticatedClient, + body: CreateVariableEnvironmentRequest, + +) -> Error | VariableEnvironment | None: + """ Create a variable Environment + + Creates a custom variable Environment. Global is reserved and already exists. A Project may have at + most 100 custom Environments. + + Args: + id (UUID): + body (CreateVariableEnvironmentRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | VariableEnvironment + """ + + + return sync_detailed( + id=id, +client=client, +body=body, + + ).parsed + +async def asyncio_detailed( + id: UUID | str, + *, + client: AuthenticatedClient, + body: CreateVariableEnvironmentRequest, + +) -> Response[Error | VariableEnvironment]: + """ Create a variable Environment + + Creates a custom variable Environment. Global is reserved and already exists. A Project may have at + most 100 custom Environments. + + Args: + id (UUID): + body (CreateVariableEnvironmentRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | VariableEnvironment] + """ + + + kwargs = request_kwargs( + id=id, +body=body, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + id: UUID | str, + *, + client: AuthenticatedClient, + body: CreateVariableEnvironmentRequest, + +) -> Error | VariableEnvironment | None: + """ Create a variable Environment + + Creates a custom variable Environment. Global is reserved and already exists. A Project may have at + most 100 custom Environments. + + Args: + id (UUID): + body (CreateVariableEnvironmentRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | VariableEnvironment + """ + + + return (await asyncio_detailed( + id=id, +client=client, +body=body, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/variable_environments/delete_variable_environment.py b/src/volcano_sdk/_generated/api/variable_environments/delete_variable_environment.py new file mode 100644 index 00000000..b033baa3 --- /dev/null +++ b/src/volcano_sdk/_generated/api/variable_environments/delete_variable_environment.py @@ -0,0 +1,225 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from typing import cast +from uuid import UUID + + + +def request_kwargs( + id: UUID | str, + environment_id: UUID | str, + +) -> dict[str, Any]: + + + + + + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/projects/{id}/variable-environments/{environment_id}".format(id=quote(str(id), safe=""),environment_id=quote(str(environment_id), safe=""),), + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | Error | None: + if response.status_code == 204: + response_204 = cast(Any, None) + return response_204 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if response.status_code == 409: + response_409 = Error.from_dict(response.json()) + + + + return response_409 + + if response.status_code == 500: + response_500 = Error.from_dict(response.json()) + + + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any | Error]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID | str, + environment_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Response[Any | Error]: + """ Delete a variable Environment + + Deletes a custom Environment. Global cannot be deleted. + + Args: + id (UUID): + environment_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | Error] + """ + + + kwargs = request_kwargs( + id=id, +environment_id=environment_id, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + id: UUID | str, + environment_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Any | Error | None: + """ Delete a variable Environment + + Deletes a custom Environment. Global cannot be deleted. + + Args: + id (UUID): + environment_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | Error + """ + + + return sync_detailed( + id=id, +environment_id=environment_id, +client=client, + + ).parsed + +async def asyncio_detailed( + id: UUID | str, + environment_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Response[Any | Error]: + """ Delete a variable Environment + + Deletes a custom Environment. Global cannot be deleted. + + Args: + id (UUID): + environment_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | Error] + """ + + + kwargs = request_kwargs( + id=id, +environment_id=environment_id, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + id: UUID | str, + environment_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Any | Error | None: + """ Delete a variable Environment + + Deletes a custom Environment. Global cannot be deleted. + + Args: + id (UUID): + environment_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | Error + """ + + + return (await asyncio_detailed( + id=id, +environment_id=environment_id, +client=client, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/variable_environments/get_variable_environment.py b/src/volcano_sdk/_generated/api/variable_environments/get_variable_environment.py new file mode 100644 index 00000000..b2ee4cf4 --- /dev/null +++ b/src/volcano_sdk/_generated/api/variable_environments/get_variable_environment.py @@ -0,0 +1,214 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from ...models.variable_environment import VariableEnvironment +from typing import cast +from uuid import UUID + + + +def request_kwargs( + id: UUID | str, + environment_id: UUID | str, + +) -> dict[str, Any]: + + + + + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/projects/{id}/variable-environments/{environment_id}".format(id=quote(str(id), safe=""),environment_id=quote(str(environment_id), safe=""),), + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | VariableEnvironment | None: + if response.status_code == 200: + response_200 = VariableEnvironment.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if response.status_code == 500: + response_500 = Error.from_dict(response.json()) + + + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | VariableEnvironment]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID | str, + environment_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Response[Error | VariableEnvironment]: + """ Get a variable Environment + + Args: + id (UUID): + environment_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | VariableEnvironment] + """ + + + kwargs = request_kwargs( + id=id, +environment_id=environment_id, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + id: UUID | str, + environment_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Error | VariableEnvironment | None: + """ Get a variable Environment + + Args: + id (UUID): + environment_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | VariableEnvironment + """ + + + return sync_detailed( + id=id, +environment_id=environment_id, +client=client, + + ).parsed + +async def asyncio_detailed( + id: UUID | str, + environment_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Response[Error | VariableEnvironment]: + """ Get a variable Environment + + Args: + id (UUID): + environment_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | VariableEnvironment] + """ + + + kwargs = request_kwargs( + id=id, +environment_id=environment_id, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + id: UUID | str, + environment_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Error | VariableEnvironment | None: + """ Get a variable Environment + + Args: + id (UUID): + environment_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | VariableEnvironment + """ + + + return (await asyncio_detailed( + id=id, +environment_id=environment_id, +client=client, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/variable_environments/list_variable_environments.py b/src/volcano_sdk/_generated/api/variable_environments/list_variable_environments.py new file mode 100644 index 00000000..1da597c9 --- /dev/null +++ b/src/volcano_sdk/_generated/api/variable_environments/list_variable_environments.py @@ -0,0 +1,194 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from ...models.variable_environment_list import VariableEnvironmentList +from typing import cast +from uuid import UUID + + + +def request_kwargs( + id: UUID | str, + +) -> dict[str, Any]: + + + + + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/projects/{id}/variable-environments".format(id=quote(str(id), safe=""),), + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | VariableEnvironmentList | None: + if response.status_code == 200: + response_200 = VariableEnvironmentList.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 500: + response_500 = Error.from_dict(response.json()) + + + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | VariableEnvironmentList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Response[Error | VariableEnvironmentList]: + """ List variable Environments + + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | VariableEnvironmentList] + """ + + + kwargs = request_kwargs( + id=id, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Error | VariableEnvironmentList | None: + """ List variable Environments + + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | VariableEnvironmentList + """ + + + return sync_detailed( + id=id, +client=client, + + ).parsed + +async def asyncio_detailed( + id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Response[Error | VariableEnvironmentList]: + """ List variable Environments + + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | VariableEnvironmentList] + """ + + + kwargs = request_kwargs( + id=id, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Error | VariableEnvironmentList | None: + """ List variable Environments + + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | VariableEnvironmentList + """ + + + return (await asyncio_detailed( + id=id, +client=client, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/variable_environments/rename_variable_environment.py b/src/volcano_sdk/_generated/api/variable_environments/rename_variable_environment.py new file mode 100644 index 00000000..a450eb02 --- /dev/null +++ b/src/volcano_sdk/_generated/api/variable_environments/rename_variable_environment.py @@ -0,0 +1,256 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from ...models.rename_variable_environment_request import RenameVariableEnvironmentRequest +from ...models.variable_environment import VariableEnvironment +from typing import cast +from uuid import UUID + + + +def request_kwargs( + id: UUID | str, + environment_id: UUID | str, + *, + body: RenameVariableEnvironmentRequest, + +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + + + + + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": "/projects/{id}/variable-environments/{environment_id}".format(id=quote(str(id), safe=""),environment_id=quote(str(environment_id), safe=""),), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | VariableEnvironment | None: + if response.status_code == 200: + response_200 = VariableEnvironment.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if response.status_code == 409: + response_409 = Error.from_dict(response.json()) + + + + return response_409 + + if response.status_code == 500: + response_500 = Error.from_dict(response.json()) + + + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | VariableEnvironment]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID | str, + environment_id: UUID | str, + *, + client: AuthenticatedClient, + body: RenameVariableEnvironmentRequest, + +) -> Response[Error | VariableEnvironment]: + """ Rename a variable Environment + + Renames a custom Environment without changing its stable ID. Global cannot be renamed. + + Args: + id (UUID): + environment_id (UUID): + body (RenameVariableEnvironmentRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | VariableEnvironment] + """ + + + kwargs = request_kwargs( + id=id, +environment_id=environment_id, +body=body, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + id: UUID | str, + environment_id: UUID | str, + *, + client: AuthenticatedClient, + body: RenameVariableEnvironmentRequest, + +) -> Error | VariableEnvironment | None: + """ Rename a variable Environment + + Renames a custom Environment without changing its stable ID. Global cannot be renamed. + + Args: + id (UUID): + environment_id (UUID): + body (RenameVariableEnvironmentRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | VariableEnvironment + """ + + + return sync_detailed( + id=id, +environment_id=environment_id, +client=client, +body=body, + + ).parsed + +async def asyncio_detailed( + id: UUID | str, + environment_id: UUID | str, + *, + client: AuthenticatedClient, + body: RenameVariableEnvironmentRequest, + +) -> Response[Error | VariableEnvironment]: + """ Rename a variable Environment + + Renames a custom Environment without changing its stable ID. Global cannot be renamed. + + Args: + id (UUID): + environment_id (UUID): + body (RenameVariableEnvironmentRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | VariableEnvironment] + """ + + + kwargs = request_kwargs( + id=id, +environment_id=environment_id, +body=body, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + id: UUID | str, + environment_id: UUID | str, + *, + client: AuthenticatedClient, + body: RenameVariableEnvironmentRequest, + +) -> Error | VariableEnvironment | None: + """ Rename a variable Environment + + Renames a custom Environment without changing its stable ID. Global cannot be renamed. + + Args: + id (UUID): + environment_id (UUID): + body (RenameVariableEnvironmentRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | VariableEnvironment + """ + + + return (await asyncio_detailed( + id=id, +environment_id=environment_id, +client=client, +body=body, + + )).parsed diff --git a/src/volcano_sdk/_generated/models/__init__.py b/src/volcano_sdk/_generated/models/__init__.py index cfd528b8..37fe34e2 100644 --- a/src/volcano_sdk/_generated/models/__init__.py +++ b/src/volcano_sdk/_generated/models/__init__.py @@ -111,6 +111,9 @@ from .call_o_auth_provider_api_provider import CallOAuthProviderApiProvider from .call_o_auth_provider_api_response_200 import CallOAuthProviderApiResponse200 from .call_o_auth_provider_api_response_200_provider import CallOAuthProviderApiResponse200Provider +from .capability import Capability +from .capability_list import CapabilityList +from .capability_status import CapabilityStatus from .complete_upload_session_response import CompleteUploadSessionResponse from .configure_auth_methods_body import ConfigureAuthMethodsBody from .configure_auth_methods_body_oauth_providers_item import ConfigureAuthMethodsBodyOauthProvidersItem @@ -152,6 +155,7 @@ from .create_storage_policy_request_operation import CreateStoragePolicyRequestOperation from .create_upload_session_request import CreateUploadSessionRequest from .create_upload_session_response import CreateUploadSessionResponse +from .create_variable_environment_request import CreateVariableEnvironmentRequest from .create_variable_request import CreateVariableRequest from .created_project_access_token import CreatedProjectAccessToken from .database import Database @@ -519,6 +523,7 @@ from .realtime_stats import RealtimeStats from .refresh_o_auth_provider_token_provider import RefreshOAuthProviderTokenProvider from .refresh_o_auth_provider_token_response_200 import RefreshOAuthProviderTokenResponse200 +from .rename_variable_environment_request import RenameVariableEnvironmentRequest from .render_default_managed_auth_page_action import RenderDefaultManagedAuthPageAction from .replace_frontend_shared_variables_body import ReplaceFrontendSharedVariablesBody from .replace_shared_variables_body import ReplaceSharedVariablesBody @@ -607,6 +612,8 @@ from .usage_data_point import UsageDataPoint from .variable import Variable from .variable_deploy_source import VariableDeploySource +from .variable_environment import VariableEnvironment +from .variable_environment_list import VariableEnvironmentList from .variable_status import VariableStatus from .verified_domain import VerifiedDomain from .verified_domains_response import VerifiedDomainsResponse @@ -724,6 +731,9 @@ "CallOAuthProviderApiProvider", "CallOAuthProviderApiResponse200", "CallOAuthProviderApiResponse200Provider", + "Capability", + "CapabilityList", + "CapabilityStatus", "CompleteUploadSessionResponse", "ConfigureAuthMethodsBody", "ConfigureAuthMethodsBodyOauthProvidersItem", @@ -766,6 +776,7 @@ "CreateStoragePolicyRequestOperation", "CreateUploadSessionRequest", "CreateUploadSessionResponse", + "CreateVariableEnvironmentRequest", "CreateVariableRequest", "Database", "DatabaseBackup", @@ -1132,6 +1143,7 @@ "RealtimeStats", "RefreshOAuthProviderTokenProvider", "RefreshOAuthProviderTokenResponse200", + "RenameVariableEnvironmentRequest", "RenderDefaultManagedAuthPageAction", "ReplaceFrontendSharedVariablesBody", "ReplaceSharedVariablesBody", @@ -1220,6 +1232,8 @@ "UsageDataPoint", "Variable", "VariableDeploySource", + "VariableEnvironment", + "VariableEnvironmentList", "VariableStatus", "VerifiedDomain", "VerifiedDomainsResponse", diff --git a/src/volcano_sdk/_generated/models/auth_config.py b/src/volcano_sdk/_generated/models/auth_config.py index 00aa9339..f096393d 100644 --- a/src/volcano_sdk/_generated/models/auth_config.py +++ b/src/volcano_sdk/_generated/models/auth_config.py @@ -13,6 +13,7 @@ from ..types import UNSET, Unset from typing import cast from uuid import UUID +import datetime if TYPE_CHECKING: from ..models.auth_password_policy import AuthPasswordPolicy @@ -33,6 +34,9 @@ class AuthConfig: project_id (UUID | Unset): access_token_lifetime (int | Unset): Access token lifetime in seconds Default: 3600. refresh_token_lifetime (int | Unset): Refresh token lifetime in seconds Default: 2592000. + refresh_token_reuse_interval (int | Unset): A refresh within this many seconds of the refresh token being issued + returns the same refresh token instead of rotating it, so concurrent refreshes from several tabs all succeed + Default: 10. inactivity_timeout (int | Unset): Force re-login after inactivity (seconds, 0=never) Default: 0. max_session_duration (int | Unset): Force re-login after duration (seconds, 0=never) Default: 0. min_password_length (int | Unset): Configured minimum password length in Unicode characters. Default: 15. @@ -45,6 +49,8 @@ class AuthConfig: rate_limit_signup (int | Unset): Signups per hour per IP Default: 100. rate_limit_signin (int | Unset): Signins per hour per IP Default: 100. rate_limit_token_refresh (int | Unset): Refreshes per hour per IP Default: 1000. + rate_limit_password_reset (int | Unset): Password reset requests per hour per IP. Unlike the other limits, 0 + applies the default of 10 instead of turning the limit off. Default: 10. cors_enabled (bool | Unset): Default: False. cors_allowed_origins (list[str] | Unset): Example: ['https://myapp.com', 'http://localhost:3000']. enable_anonymous_signins (bool | Unset): Allow creating users without email/password Default: False. @@ -105,12 +111,15 @@ class AuthConfig: the built-in managed device page. Lets a CLI surface the project's own RFC 8628 approval page. Empty falls back to the managed page. Example: https://app.acme.com/device. + created_at (datetime.datetime | Unset): + updated_at (datetime.datetime | Unset): """ password_policy: AuthPasswordPolicy project_id: UUID | Unset = UNSET access_token_lifetime: int | Unset = 3600 refresh_token_lifetime: int | Unset = 2592000 + refresh_token_reuse_interval: int | Unset = 10 inactivity_timeout: int | Unset = 0 max_session_duration: int | Unset = 0 min_password_length: int | Unset = 15 @@ -123,6 +132,7 @@ class AuthConfig: rate_limit_signup: int | Unset = 100 rate_limit_signin: int | Unset = 100 rate_limit_token_refresh: int | Unset = 1000 + rate_limit_password_reset: int | Unset = 10 cors_enabled: bool | Unset = False cors_allowed_origins: list[str] | Unset = UNSET enable_anonymous_signins: bool | Unset = False @@ -153,6 +163,8 @@ class AuthConfig: allowed_redirect_urls: list[str] | Unset = UNSET post_logout_redirect_url: str | Unset = UNSET device_verification_url: str | Unset = UNSET + created_at: datetime.datetime | Unset = UNSET + updated_at: datetime.datetime | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -171,6 +183,8 @@ def to_dict(self) -> dict[str, Any]: refresh_token_lifetime = self.refresh_token_lifetime + refresh_token_reuse_interval = self.refresh_token_reuse_interval + inactivity_timeout = self.inactivity_timeout max_session_duration = self.max_session_duration @@ -195,6 +209,8 @@ def to_dict(self) -> dict[str, Any]: rate_limit_token_refresh = self.rate_limit_token_refresh + rate_limit_password_reset = self.rate_limit_password_reset + cors_enabled = self.cors_enabled cors_allowed_origins: list[str] | Unset = UNSET @@ -270,6 +286,14 @@ def to_dict(self) -> dict[str, Any]: device_verification_url = self.device_verification_url + created_at: str | Unset = UNSET + if not isinstance(self.created_at, Unset): + created_at = self.created_at.isoformat() + + updated_at: str | Unset = UNSET + if not isinstance(self.updated_at, Unset): + updated_at = self.updated_at.isoformat() + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -282,6 +306,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["access_token_lifetime"] = access_token_lifetime if refresh_token_lifetime is not UNSET: field_dict["refresh_token_lifetime"] = refresh_token_lifetime + if refresh_token_reuse_interval is not UNSET: + field_dict["refresh_token_reuse_interval"] = refresh_token_reuse_interval if inactivity_timeout is not UNSET: field_dict["inactivity_timeout"] = inactivity_timeout if max_session_duration is not UNSET: @@ -306,6 +332,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["rate_limit_signin"] = rate_limit_signin if rate_limit_token_refresh is not UNSET: field_dict["rate_limit_token_refresh"] = rate_limit_token_refresh + if rate_limit_password_reset is not UNSET: + field_dict["rate_limit_password_reset"] = rate_limit_password_reset if cors_enabled is not UNSET: field_dict["cors_enabled"] = cors_enabled if cors_allowed_origins is not UNSET: @@ -366,6 +394,10 @@ def to_dict(self) -> dict[str, Any]: field_dict["post_logout_redirect_url"] = post_logout_redirect_url if device_verification_url is not UNSET: field_dict["device_verification_url"] = device_verification_url + if created_at is not UNSET: + field_dict["created_at"] = created_at + if updated_at is not UNSET: + field_dict["updated_at"] = updated_at return field_dict @@ -394,6 +426,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: refresh_token_lifetime = d.pop("refresh_token_lifetime", UNSET) + refresh_token_reuse_interval = d.pop("refresh_token_reuse_interval", UNSET) + inactivity_timeout = d.pop("inactivity_timeout", UNSET) max_session_duration = d.pop("max_session_duration", UNSET) @@ -418,6 +452,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: rate_limit_token_refresh = d.pop("rate_limit_token_refresh", UNSET) + rate_limit_password_reset = d.pop("rate_limit_password_reset", UNSET) + cors_enabled = d.pop("cors_enabled", UNSET) cors_allowed_origins = cast(list[str], d.pop("cors_allowed_origins", UNSET)) @@ -489,11 +525,32 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: device_verification_url = d.pop("device_verification_url", UNSET) + _created_at = d.pop("created_at", UNSET) + created_at: datetime.datetime | Unset + if isinstance(_created_at, Unset): + created_at = UNSET + else: + created_at = datetime.datetime.fromisoformat(_created_at) + + + + + _updated_at = d.pop("updated_at", UNSET) + updated_at: datetime.datetime | Unset + if isinstance(_updated_at, Unset): + updated_at = UNSET + else: + updated_at = datetime.datetime.fromisoformat(_updated_at) + + + + auth_config = cls( password_policy=password_policy, project_id=project_id, access_token_lifetime=access_token_lifetime, refresh_token_lifetime=refresh_token_lifetime, + refresh_token_reuse_interval=refresh_token_reuse_interval, inactivity_timeout=inactivity_timeout, max_session_duration=max_session_duration, min_password_length=min_password_length, @@ -506,6 +563,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: rate_limit_signup=rate_limit_signup, rate_limit_signin=rate_limit_signin, rate_limit_token_refresh=rate_limit_token_refresh, + rate_limit_password_reset=rate_limit_password_reset, cors_enabled=cors_enabled, cors_allowed_origins=cors_allowed_origins, enable_anonymous_signins=enable_anonymous_signins, @@ -536,6 +594,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: allowed_redirect_urls=allowed_redirect_urls, post_logout_redirect_url=post_logout_redirect_url, device_verification_url=device_verification_url, + created_at=created_at, + updated_at=updated_at, ) diff --git a/src/volcano_sdk/_generated/models/capability.py b/src/volcano_sdk/_generated/models/capability.py new file mode 100644 index 00000000..395d6353 --- /dev/null +++ b/src/volcano_sdk/_generated/models/capability.py @@ -0,0 +1,76 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.capability_status import CapabilityStatus +from ..models.capability_status import check_capability_status +from typing import cast + + + + + + +T = TypeVar("T", bound="Capability") + + + +@_attrs_define +class Capability: + """ A product capability and whether it accepts new work in this environment. + + Attributes: + id (str): Stable capability ID, such as `sandboxes`, `sandboxes.sessions`, or `sandboxes.custom_templates`. New + IDs may appear at any time. Example: sandboxes.sessions. + status (CapabilityStatus): `available` means the capability accepts new work; a temporary outage still answers + `503`. `unavailable` means requests that start new work answer `404` or `400` with code `feature_unavailable`. + Treat any other value as `unavailable`. + """ + + id: str + status: CapabilityStatus + + + + + + def to_dict(self) -> dict[str, Any]: + id = self.id + + status: str = self.status + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "id": id, + "status": status, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + status = check_capability_status(d.pop("status")) + + + + + capability = cls( + id=id, + status=status, + ) + + return capability + diff --git a/src/volcano_sdk/_generated/models/capability_list.py b/src/volcano_sdk/_generated/models/capability_list.py new file mode 100644 index 00000000..203f8b24 --- /dev/null +++ b/src/volcano_sdk/_generated/models/capability_list.py @@ -0,0 +1,76 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast + +if TYPE_CHECKING: + from ..models.capability import Capability + + + + + +T = TypeVar("T", bound="CapabilityList") + + + +@_attrs_define +class CapabilityList: + """ + Attributes: + data (list[Capability]): + """ + + data: list[Capability] + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.capability import Capability # noqa: PLC0415 + data = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "data": data, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.capability import Capability # noqa: PLC0415 + d = dict(src_dict) + data = [] + _data = d.pop("data") + for data_item_data in (_data): + data_item = Capability.from_dict(data_item_data) + + + + data.append(data_item) + + + capability_list = cls( + data=data, + ) + + return capability_list + diff --git a/src/volcano_sdk/_generated/models/capability_status.py b/src/volcano_sdk/_generated/models/capability_status.py new file mode 100644 index 00000000..c0e99672 --- /dev/null +++ b/src/volcano_sdk/_generated/models/capability_status.py @@ -0,0 +1,10 @@ +from typing import Literal + +CapabilityStatus = Literal['available', 'unavailable'] + +CAPABILITY_STATUS_VALUES: set[CapabilityStatus] = { 'available', 'unavailable', } + +def check_capability_status(value: str) -> CapabilityStatus: + if value in CAPABILITY_STATUS_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {CAPABILITY_STATUS_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/create_variable_environment_request.py b/src/volcano_sdk/_generated/models/create_variable_environment_request.py new file mode 100644 index 00000000..fc1a732a --- /dev/null +++ b/src/volcano_sdk/_generated/models/create_variable_environment_request.py @@ -0,0 +1,59 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + + + + + + + +T = TypeVar("T", bound="CreateVariableEnvironmentRequest") + + + +@_attrs_define +class CreateVariableEnvironmentRequest: + """ + Attributes: + name (str): Leading and trailing ASCII whitespace is trimmed before validating 1–64 ASCII letters, digits, + underscores, or hyphens. Global is reserved. + """ + + name: str + + + + + + def to_dict(self) -> dict[str, Any]: + name = self.name + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "name": name, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + name = d.pop("name") + + create_variable_environment_request = cls( + name=name, + ) + + return create_variable_environment_request + diff --git a/src/volcano_sdk/_generated/models/frontend_custom_domain_response.py b/src/volcano_sdk/_generated/models/frontend_custom_domain_response.py index d04b3329..2f4659f0 100644 --- a/src/volcano_sdk/_generated/models/frontend_custom_domain_response.py +++ b/src/volcano_sdk/_generated/models/frontend_custom_domain_response.py @@ -47,7 +47,11 @@ class FrontendCustomDomainResponse: failure_reason (str | Unset): Failure category, present only when managed TLS setup has failed. Current values are provider, certificate, ownership, and internal; ownership means another account has already claimed the hostname through ownership verification. Treat unrecognized values as internal. - verification_records (list[FrontendDomainVerificationRecord] | Unset): + verification_records (list[FrontendDomainVerificationRecord] | Unset): DNS records to publish now. For a managed + domain whose hostname the account already owns, the create response names the `_acme-challenge` CNAME that + authorizes certificate issuance and renewal. Otherwise it names the `_volcano` TXT record that proves ownership + of the hostname's registrable domain, and reads return the CNAME once Volcano sees that record. Usually empty + for BYOC. required_routing_record (FrontendDomainRoutingRecord | Unset): routing_target_hostname (str | Unset): DNS routing target hostname for this frontend. The DNS record type depends on whether the custom domain is a zone apex. diff --git a/src/volcano_sdk/_generated/models/project_config_sandbox.py b/src/volcano_sdk/_generated/models/project_config_sandbox.py index 23751cdd..615fa067 100644 --- a/src/volcano_sdk/_generated/models/project_config_sandbox.py +++ b/src/volcano_sdk/_generated/models/project_config_sandbox.py @@ -30,14 +30,13 @@ class ProjectConfigSandbox: memory_mb (ProjectConfigSandboxMemoryMb | Unset): Immutable deployed memory profile; config apply asserts it and Git deploy builds it. ports (list[int] | Unset): Service readiness ports; config apply asserts them and Git deploy builds them. - idle_timeout_seconds (int | Unset): Default idle timeout for new sessions when the caller omits it. - ttl_seconds (int | Unset): Default absolute lifetime for new sessions when the caller omits it. + ttl_seconds (int | Unset): Default absolute lifetime for new sessions when the caller omits it. Cloud accepts + 30–28800 seconds; local accepts 0 for unlimited or a positive lifetime. """ name: str memory_mb: ProjectConfigSandboxMemoryMb | Unset = UNSET ports: list[int] | Unset = UNSET - idle_timeout_seconds: int | Unset = UNSET ttl_seconds: int | Unset = UNSET @@ -58,8 +57,6 @@ def to_dict(self) -> dict[str, Any]: - idle_timeout_seconds = self.idle_timeout_seconds - ttl_seconds = self.ttl_seconds @@ -72,8 +69,6 @@ def to_dict(self) -> dict[str, Any]: field_dict["memory_mb"] = memory_mb if ports is not UNSET: field_dict["ports"] = ports - if idle_timeout_seconds is not UNSET: - field_dict["idle_timeout_seconds"] = idle_timeout_seconds if ttl_seconds is not UNSET: field_dict["ttl_seconds"] = ttl_seconds @@ -99,15 +94,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ports = cast(list[int], d.pop("ports", UNSET)) - idle_timeout_seconds = d.pop("idle_timeout_seconds", UNSET) - ttl_seconds = d.pop("ttl_seconds", UNSET) project_config_sandbox = cls( name=name, memory_mb=memory_mb, ports=ports, - idle_timeout_seconds=idle_timeout_seconds, ttl_seconds=ttl_seconds, ) diff --git a/src/volcano_sdk/_generated/models/project_frontend_custom_domain.py b/src/volcano_sdk/_generated/models/project_frontend_custom_domain.py index 3eb1e683..743b05dc 100644 --- a/src/volcano_sdk/_generated/models/project_frontend_custom_domain.py +++ b/src/volcano_sdk/_generated/models/project_frontend_custom_domain.py @@ -50,7 +50,11 @@ class ProjectFrontendCustomDomain: failure_reason (str | Unset): Failure category, present only when managed TLS setup has failed. Current values are provider, certificate, ownership, and internal; ownership means another account has already claimed the hostname through ownership verification. Treat unrecognized values as internal. - verification_records (list[FrontendDomainVerificationRecord] | Unset): + verification_records (list[FrontendDomainVerificationRecord] | Unset): DNS records to publish now. For a managed + domain whose hostname the account already owns, the create response names the `_acme-challenge` CNAME that + authorizes certificate issuance and renewal. Otherwise it names the `_volcano` TXT record that proves ownership + of the hostname's registrable domain, and reads return the CNAME once Volcano sees that record. Usually empty + for BYOC. required_routing_record (FrontendDomainRoutingRecord | Unset): routing_target_hostname (str | Unset): DNS routing target hostname for this frontend. The DNS record type depends on whether the custom domain is a zone apex. diff --git a/src/volcano_sdk/_generated/models/rename_variable_environment_request.py b/src/volcano_sdk/_generated/models/rename_variable_environment_request.py new file mode 100644 index 00000000..029d2c9a --- /dev/null +++ b/src/volcano_sdk/_generated/models/rename_variable_environment_request.py @@ -0,0 +1,59 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + + + + + + + +T = TypeVar("T", bound="RenameVariableEnvironmentRequest") + + + +@_attrs_define +class RenameVariableEnvironmentRequest: + """ + Attributes: + name (str): Leading and trailing ASCII whitespace is trimmed before validating 1–64 ASCII letters, digits, + underscores, or hyphens. Global is reserved. + """ + + name: str + + + + + + def to_dict(self) -> dict[str, Any]: + name = self.name + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "name": name, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + name = d.pop("name") + + rename_variable_environment_request = cls( + name=name, + ) + + return rename_variable_environment_request + diff --git a/src/volcano_sdk/_generated/models/request_durable_approval_request.py b/src/volcano_sdk/_generated/models/request_durable_approval_request.py index 043cff5e..fb4aa5f1 100644 --- a/src/volcano_sdk/_generated/models/request_durable_approval_request.py +++ b/src/volcano_sdk/_generated/models/request_durable_approval_request.py @@ -28,8 +28,11 @@ class RequestDurableApprovalRequest: name (str): title (str): description (str | Unset): - details (Any | Unset): Any JSON value to show the person deciding. The whole request is - limited to 64 KiB. + details (Any | Unset): Any JSON value to show the person deciding. A number's exponent must + be between -324 and 324, and a number too large or too precise to + store is refused with `400`. Numbers are read back written out in + full, so the exponents' absolute values may total at most 65,536. + The whole request is limited to 64 KiB. """ execution_ref: str diff --git a/src/volcano_sdk/_generated/models/sandbox_command_request.py b/src/volcano_sdk/_generated/models/sandbox_command_request.py index d52926fd..7c8e31dc 100644 --- a/src/volcano_sdk/_generated/models/sandbox_command_request.py +++ b/src/volcano_sdk/_generated/models/sandbox_command_request.py @@ -27,12 +27,15 @@ class SandboxCommandRequest: """ Attributes: command (str): - timeout_seconds (int | Unset): Default: 60. + timeout_seconds (int | Unset): Command execution time from process start. Cloud defaults to 60 seconds and + accepts 1–28800; local defaults to 0 (unlimited) and accepts nonnegative values. VM expiry always takes + precedence. Cloud synchronous requests must return within the public connection idle limit (1000 seconds); use a + session with a background process and short polling requests for longer work. environment (SandboxCommandRequestEnvironment | Unset): """ command: str - timeout_seconds: int | Unset = 60 + timeout_seconds: int | Unset = UNSET environment: SandboxCommandRequestEnvironment | Unset = UNSET diff --git a/src/volcano_sdk/_generated/models/sandbox_session.py b/src/volcano_sdk/_generated/models/sandbox_session.py index 5eb7f7b3..9cc9b99e 100644 --- a/src/volcano_sdk/_generated/models/sandbox_session.py +++ b/src/volcano_sdk/_generated/models/sandbox_session.py @@ -32,25 +32,26 @@ class SandboxSession: Attributes: id (UUID): project_id (UUID): - sandbox_id (UUID): + sandbox_id (None | UUID): Explicit template used to create the session. Null when created directly from a + preset. state (SandboxSessionState): desired_state (SandboxSessionDesiredState): region (str): memory_mb (int): created_at (datetime.datetime): - expires_at (datetime.datetime): + expires_at (datetime.datetime | None): Absolute VM expiry. Null means unlimited in local mode. started_at (datetime.datetime | Unset): """ id: UUID project_id: UUID - sandbox_id: UUID + sandbox_id: None | UUID state: SandboxSessionState desired_state: SandboxSessionDesiredState region: str memory_mb: int created_at: datetime.datetime - expires_at: datetime.datetime + expires_at: datetime.datetime | None started_at: datetime.datetime | Unset = UNSET @@ -62,7 +63,11 @@ def to_dict(self) -> dict[str, Any]: project_id = str(self.project_id) - sandbox_id = str(self.sandbox_id) + sandbox_id: None | str + if isinstance(self.sandbox_id, UUID): + sandbox_id = str(self.sandbox_id) + else: + sandbox_id = self.sandbox_id state: str = self.state @@ -74,7 +79,11 @@ def to_dict(self) -> dict[str, Any]: created_at = self.created_at.isoformat() - expires_at = self.expires_at.isoformat() + expires_at: None | str + if isinstance(self.expires_at, datetime.datetime): + expires_at = self.expires_at.isoformat() + else: + expires_at = self.expires_at started_at: str | Unset = UNSET if not isinstance(self.started_at, Unset): @@ -114,9 +123,22 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - sandbox_id = UUID(d.pop("sandbox_id")) + def _parse_sandbox_id(data: object) -> None | UUID: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + sandbox_id_type_0 = UUID(data) + + return sandbox_id_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | UUID, data) + + sandbox_id = _parse_sandbox_id(d.pop("sandbox_id")) state = check_sandbox_session_state(d.pop("state")) @@ -138,9 +160,22 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - expires_at = datetime.datetime.fromisoformat(d.pop("expires_at")) + def _parse_expires_at(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + expires_at_type_0 = datetime.datetime.fromisoformat(data) + + + return expires_at_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + expires_at = _parse_expires_at(d.pop("expires_at")) _started_at = d.pop("started_at", UNSET) diff --git a/src/volcano_sdk/_generated/models/update_auth_config_request.py b/src/volcano_sdk/_generated/models/update_auth_config_request.py index b1e1fb3f..7da93df3 100644 --- a/src/volcano_sdk/_generated/models/update_auth_config_request.py +++ b/src/volcano_sdk/_generated/models/update_auth_config_request.py @@ -30,8 +30,11 @@ class UpdateAuthConfigRequest: Attributes: access_token_lifetime (int | Unset): refresh_token_lifetime (int | Unset): + refresh_token_reuse_interval (int | Unset): inactivity_timeout (int | Unset): max_session_duration (int | Unset): + platform_token_ttl (int | Unset): TTL in seconds for platform tokens minted via `/auth/platform/exchange`. From + 3600 (1 hour) to 31536000 (365 days). min_password_length (int | Unset): require_uppercase (bool | Unset): require_lowercase (bool | Unset): @@ -42,6 +45,11 @@ class UpdateAuthConfigRequest: rate_limit_signup (int | Unset): rate_limit_signin (int | Unset): rate_limit_token_refresh (int | Unset): + rate_limit_password_reset (int | Unset): Password reset requests per hour per IP. Unlike the other limits, 0 + applies the default of 10 instead of turning the limit off. + cors_enabled (bool | Unset): + cors_allowed_origins (list[str] | Unset): Replaces the allowed origins list. Example: ['https://myapp.com', + 'http://localhost:3000']. cors_allow_credentials (bool | Unset): cors_max_age (int | Unset): enable_anonymous_signins (bool | Unset): @@ -94,8 +102,10 @@ class UpdateAuthConfigRequest: access_token_lifetime: int | Unset = UNSET refresh_token_lifetime: int | Unset = UNSET + refresh_token_reuse_interval: int | Unset = UNSET inactivity_timeout: int | Unset = UNSET max_session_duration: int | Unset = UNSET + platform_token_ttl: int | Unset = UNSET min_password_length: int | Unset = UNSET require_uppercase: bool | Unset = UNSET require_lowercase: bool | Unset = UNSET @@ -106,6 +116,9 @@ class UpdateAuthConfigRequest: rate_limit_signup: int | Unset = UNSET rate_limit_signin: int | Unset = UNSET rate_limit_token_refresh: int | Unset = UNSET + rate_limit_password_reset: int | Unset = UNSET + cors_enabled: bool | Unset = UNSET + cors_allowed_origins: list[str] | Unset = UNSET cors_allow_credentials: bool | Unset = UNSET cors_max_age: int | Unset = UNSET enable_anonymous_signins: bool | Unset = UNSET @@ -144,10 +157,14 @@ def to_dict(self) -> dict[str, Any]: refresh_token_lifetime = self.refresh_token_lifetime + refresh_token_reuse_interval = self.refresh_token_reuse_interval + inactivity_timeout = self.inactivity_timeout max_session_duration = self.max_session_duration + platform_token_ttl = self.platform_token_ttl + min_password_length = self.min_password_length require_uppercase = self.require_uppercase @@ -168,6 +185,16 @@ def to_dict(self) -> dict[str, Any]: rate_limit_token_refresh = self.rate_limit_token_refresh + rate_limit_password_reset = self.rate_limit_password_reset + + cors_enabled = self.cors_enabled + + cors_allowed_origins: list[str] | Unset = UNSET + if not isinstance(self.cors_allowed_origins, Unset): + cors_allowed_origins = self.cors_allowed_origins + + + cors_allow_credentials = self.cors_allow_credentials cors_max_age = self.cors_max_age @@ -242,10 +269,14 @@ def to_dict(self) -> dict[str, Any]: field_dict["access_token_lifetime"] = access_token_lifetime if refresh_token_lifetime is not UNSET: field_dict["refresh_token_lifetime"] = refresh_token_lifetime + if refresh_token_reuse_interval is not UNSET: + field_dict["refresh_token_reuse_interval"] = refresh_token_reuse_interval if inactivity_timeout is not UNSET: field_dict["inactivity_timeout"] = inactivity_timeout if max_session_duration is not UNSET: field_dict["max_session_duration"] = max_session_duration + if platform_token_ttl is not UNSET: + field_dict["platform_token_ttl"] = platform_token_ttl if min_password_length is not UNSET: field_dict["min_password_length"] = min_password_length if require_uppercase is not UNSET: @@ -266,6 +297,12 @@ def to_dict(self) -> dict[str, Any]: field_dict["rate_limit_signin"] = rate_limit_signin if rate_limit_token_refresh is not UNSET: field_dict["rate_limit_token_refresh"] = rate_limit_token_refresh + if rate_limit_password_reset is not UNSET: + field_dict["rate_limit_password_reset"] = rate_limit_password_reset + if cors_enabled is not UNSET: + field_dict["cors_enabled"] = cors_enabled + if cors_allowed_origins is not UNSET: + field_dict["cors_allowed_origins"] = cors_allowed_origins if cors_allow_credentials is not UNSET: field_dict["cors_allow_credentials"] = cors_allow_credentials if cors_max_age is not UNSET: @@ -332,10 +369,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: refresh_token_lifetime = d.pop("refresh_token_lifetime", UNSET) + refresh_token_reuse_interval = d.pop("refresh_token_reuse_interval", UNSET) + inactivity_timeout = d.pop("inactivity_timeout", UNSET) max_session_duration = d.pop("max_session_duration", UNSET) + platform_token_ttl = d.pop("platform_token_ttl", UNSET) + min_password_length = d.pop("min_password_length", UNSET) require_uppercase = d.pop("require_uppercase", UNSET) @@ -356,6 +397,13 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: rate_limit_token_refresh = d.pop("rate_limit_token_refresh", UNSET) + rate_limit_password_reset = d.pop("rate_limit_password_reset", UNSET) + + cors_enabled = d.pop("cors_enabled", UNSET) + + cors_allowed_origins = cast(list[str], d.pop("cors_allowed_origins", UNSET)) + + cors_allow_credentials = d.pop("cors_allow_credentials", UNSET) cors_max_age = d.pop("cors_max_age", UNSET) @@ -423,8 +471,10 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: update_auth_config_request = cls( access_token_lifetime=access_token_lifetime, refresh_token_lifetime=refresh_token_lifetime, + refresh_token_reuse_interval=refresh_token_reuse_interval, inactivity_timeout=inactivity_timeout, max_session_duration=max_session_duration, + platform_token_ttl=platform_token_ttl, min_password_length=min_password_length, require_uppercase=require_uppercase, require_lowercase=require_lowercase, @@ -435,6 +485,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: rate_limit_signup=rate_limit_signup, rate_limit_signin=rate_limit_signin, rate_limit_token_refresh=rate_limit_token_refresh, + rate_limit_password_reset=rate_limit_password_reset, + cors_enabled=cors_enabled, + cors_allowed_origins=cors_allowed_origins, cors_allow_credentials=cors_allow_credentials, cors_max_age=cors_max_age, enable_anonymous_signins=enable_anonymous_signins, diff --git a/src/volcano_sdk/_generated/models/variable_environment.py b/src/volcano_sdk/_generated/models/variable_environment.py new file mode 100644 index 00000000..0ca687f5 --- /dev/null +++ b/src/volcano_sdk/_generated/models/variable_environment.py @@ -0,0 +1,132 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast +from uuid import UUID +import datetime + + + + + + +T = TypeVar("T", bound="VariableEnvironment") + + + +@_attrs_define +class VariableEnvironment: + """ Stable identity for a Project-owned variable Environment. + + Attributes: + id (UUID): + project_id (UUID): + name (str): + is_global (bool): Whether this is the reserved Global Environment. + created_at (datetime.datetime): + updated_at (datetime.datetime): + """ + + id: UUID + project_id: UUID + name: str + is_global: bool + created_at: datetime.datetime + updated_at: datetime.datetime + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + id = str(self.id) + + project_id = str(self.project_id) + + name = self.name + + is_global = self.is_global + + created_at = self.created_at.isoformat() + + updated_at = self.updated_at.isoformat() + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "id": id, + "project_id": project_id, + "name": name, + "is_global": is_global, + "created_at": created_at, + "updated_at": updated_at, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = UUID(d.pop("id")) + + + + + project_id = UUID(d.pop("project_id")) + + + + + name = d.pop("name") + + is_global = d.pop("is_global") + + created_at = datetime.datetime.fromisoformat(d.pop("created_at")) + + + + + updated_at = datetime.datetime.fromisoformat(d.pop("updated_at")) + + + + + variable_environment = cls( + id=id, + project_id=project_id, + name=name, + is_global=is_global, + created_at=created_at, + updated_at=updated_at, + ) + + + variable_environment.additional_properties = d + return variable_environment + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/variable_environment_list.py b/src/volcano_sdk/_generated/models/variable_environment_list.py new file mode 100644 index 00000000..1327b764 --- /dev/null +++ b/src/volcano_sdk/_generated/models/variable_environment_list.py @@ -0,0 +1,94 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast + +if TYPE_CHECKING: + from ..models.variable_environment import VariableEnvironment + + + + + +T = TypeVar("T", bound="VariableEnvironmentList") + + + +@_attrs_define +class VariableEnvironmentList: + """ + Attributes: + data (list[VariableEnvironment]): + """ + + data: list[VariableEnvironment] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.variable_environment import VariableEnvironment # noqa: PLC0415 + data = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "data": data, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.variable_environment import VariableEnvironment # noqa: PLC0415 + d = dict(src_dict) + data = [] + _data = d.pop("data") + for data_item_data in (_data): + data_item = VariableEnvironment.from_dict(data_item_data) + + + + data.append(data_item) + + + variable_environment_list = cls( + data=data, + ) + + + variable_environment_list.additional_properties = d + return variable_environment_list + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties