diff --git a/docs/sandboxes.md b/docs/sandboxes.md index d0edd8cb..0877a3a9 100644 --- a/docs/sandboxes.md +++ b/docs/sandboxes.md @@ -153,3 +153,17 @@ its sessions and requires the `sandboxes.terminate` permission. History page limits range from 1 to 100. Archives are limited to 32 MiB compressed and expanded. Custom deployments accept at most 16 unique ports, from 1 through 65532. + +## Runtime billing + +Confirmed cloud running time is measured using baseline memory times observed +running duration and consumes the account's Sandbox allowance. Paid overage is +purchased in 5 GBh blocks at 25 credits per block; unused purchased capacity +carries forward. Usage is not rounded up to a whole hour per session. +Suspended and uncertain time are uncharged, snapshot costs are included, and +burst resources are not billed separately. Local sessions consume no cloud +allowance or credits. + +Plan and allowance refusals use `sandbox_plan_limit_exceeded` and +`sandbox_allowance_exhausted`. Retrying these errors with a fresh request ID +does not bypass the plan or account limit. diff --git a/openapi/openapi.yaml b/openapi/openapi.yaml index a0cc7369..31feffa2 100644 --- a/openapi/openapi.yaml +++ b/openapi/openapi.yaml @@ -21,6 +21,10 @@ tags: description: Project management operations - name: Logs description: Project-scoped log search and activity APIs + - name: Issues + description: 'Preview, not generally available: runtime errors grouped into issues. Where issues are not available, every endpoint answers `404` with code `feature_unavailable`.' + - name: Autofix + description: 'Preview, not generally available: AI diagnosis of a project''s issues and draft pull requests that fix them. Where autofix is not available, turning it on, or any request for a project that never saved settings, answers `404` with code `feature_unavailable`. Autofix is not available in local mode.' - name: Functions description: Function deployment and management - name: Durable Functions @@ -37,6 +41,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 +84,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. @@ -115,6 +121,7 @@ paths: security: - UserToken: [] - ServiceRoleKey: [] + - ProjectAccessToken: [] parameters: - name: id in: path @@ -145,6 +152,7 @@ paths: security: - UserToken: [] - ServiceRoleKey: [] + - ProjectAccessToken: [] parameters: - name: id in: path @@ -186,6 +194,7 @@ paths: security: - UserToken: [] - ServiceRoleKey: [] + - ProjectAccessToken: [] parameters: - name: id in: path @@ -220,6 +229,7 @@ paths: security: - UserToken: [] - ServiceRoleKey: [] + - ProjectAccessToken: [] parameters: - name: id in: path @@ -260,6 +270,7 @@ paths: security: - UserToken: [] - ServiceRoleKey: [] + - ProjectAccessToken: [] parameters: - name: id in: path @@ -292,6 +303,7 @@ paths: security: - UserToken: [] - ServiceRoleKey: [] + - ProjectAccessToken: [] parameters: - name: id in: path @@ -358,6 +370,7 @@ paths: security: - UserToken: [] - ServiceRoleKey: [] + - ProjectAccessToken: [] parameters: - name: id in: path @@ -395,6 +408,7 @@ paths: security: - UserToken: [] - ServiceRoleKey: [] + - ProjectAccessToken: [] parameters: - name: id in: path @@ -436,6 +450,7 @@ paths: security: - UserToken: [] - ServiceRoleKey: [] + - ProjectAccessToken: [] parameters: - name: id in: path @@ -495,6 +510,7 @@ paths: security: - UserToken: [] - ServiceRoleKey: [] + - ProjectAccessToken: [] parameters: - name: id in: path @@ -537,6 +553,7 @@ paths: security: - UserToken: [] - ServiceRoleKey: [] + - ProjectAccessToken: [] parameters: - name: id in: path @@ -567,6 +584,7 @@ paths: security: - UserToken: [] - ServiceRoleKey: [] + - ProjectAccessToken: [] parameters: - name: id in: path @@ -594,7 +612,7 @@ paths: schema: $ref: '#/components/schemas/SandboxSession' default: - description: Request refused or unavailable. Errors include invalid input (400), unauthenticated (401), forbidden (403), not found (404), conflicting retry (409), capacity exhausted (429), and temporarily unavailable (503). Code `feature_unavailable` with 404 means sandboxes are not available in this environment. + description: Request refused or unavailable. Errors include invalid input (400), unauthenticated (401), forbidden (403), not found (404), conflicting retry (409), capacity exhausted (429), and temporarily unavailable (503). Code `feature_unavailable` with 404 means sandboxes are not available in this environment. Code `sandbox_plan_limit_exceeded` (403) means the requested resources exceed the plan. Code `sandbox_allowance_exhausted` (429) means the remaining allowance or credits cannot admit the operation. content: application/json: schema: @@ -608,6 +626,7 @@ paths: security: - UserToken: [] - ServiceRoleKey: [] + - ProjectAccessToken: [] parameters: - name: id in: path @@ -635,7 +654,7 @@ paths: schema: $ref: '#/components/schemas/SandboxExecutionResult' default: - description: Request refused or unavailable. Errors include invalid input (400), unauthenticated (401), forbidden (403), not found (404), conflicting retry (409), capacity exhausted (429), and temporarily unavailable (503). Code `feature_unavailable` with 404 means sandboxes are not available in this environment. + description: Request refused or unavailable. Errors include invalid input (400), unauthenticated (401), forbidden (403), not found (404), conflicting retry (409), capacity exhausted (429), and temporarily unavailable (503). Code `feature_unavailable` with 404 means sandboxes are not available in this environment. Code `sandbox_plan_limit_exceeded` (403) means the requested resources exceed the plan. Code `sandbox_allowance_exhausted` (429) means the remaining allowance or credits cannot admit the operation. content: application/json: schema: @@ -649,6 +668,7 @@ paths: security: - UserToken: [] - ServiceRoleKey: [] + - ProjectAccessToken: [] - AuthUserAccessToken: [] parameters: - name: sessionId @@ -678,6 +698,7 @@ paths: security: - UserToken: [] - ServiceRoleKey: [] + - ProjectAccessToken: [] parameters: - name: sessionId in: path @@ -707,6 +728,7 @@ paths: security: - UserToken: [] - ServiceRoleKey: [] + - ProjectAccessToken: [] parameters: - name: sessionId in: path @@ -736,6 +758,7 @@ paths: security: - UserToken: [] - ServiceRoleKey: [] + - ProjectAccessToken: [] parameters: - name: sessionId in: path @@ -751,7 +774,7 @@ paths: schema: $ref: '#/components/schemas/SandboxSession' default: - description: Request refused or unavailable. Errors include invalid input (400), unauthenticated (401), forbidden (403), not found (404), conflicting retry (409), capacity exhausted (429), and temporarily unavailable (503). Code `feature_unavailable` with 404 means sandboxes are not available in this environment. + description: Request refused or unavailable. Errors include invalid input (400), unauthenticated (401), forbidden (403), not found (404), conflicting retry (409), capacity exhausted (429), and temporarily unavailable (503). Code `feature_unavailable` with 404 means sandboxes are not available in this environment. Code `sandbox_plan_limit_exceeded` (403) means the requested resources exceed the plan. Code `sandbox_allowance_exhausted` (429) means the remaining allowance or credits cannot admit the operation. content: application/json: schema: @@ -765,6 +788,7 @@ paths: security: - UserToken: [] - ServiceRoleKey: [] + - ProjectAccessToken: [] - AuthUserAccessToken: [] parameters: - name: sessionId @@ -807,6 +831,7 @@ paths: security: - UserToken: [] - ServiceRoleKey: [] + - ProjectAccessToken: [] - AuthUserAccessToken: [] parameters: - name: sessionId @@ -843,6 +868,7 @@ paths: security: - UserToken: [] - ServiceRoleKey: [] + - ProjectAccessToken: [] - AuthUserAccessToken: [] parameters: - name: sessionId @@ -1839,13 +1865,15 @@ paths: Publish a TXT record named `_volcano.`, then send this request. Without the record, the response is `409` with `code: ownership_verification_required` and the `required_record` to - publish. Its value is the same on every request. The record must be - served at that name itself; a record reached through a CNAME does not - count. + publish. Its value stays the same until Volcano rotates the key it is + derived from. The record must be served at that name itself; a record + reached through a CNAME does not count. When another account verified the domain, publishing your record moves the domain to your account once that account's record is no longer - published. Keep your record published so the domain stays yours. + published. Keep your record published so the domain stays yours. After + Volcano rotates the key the value is derived from, only a record with + the new value counts. Verifying a domain the account already verified returns `200`. operationId: verifyDomain @@ -5884,6 +5912,299 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + /projects/{id}/issues: + get: + tags: + - Issues + summary: List issues + description: | + Lists the project's issues, most recently seen first. An issue groups + the runtime errors one function or frontend raised with the same error + type and stack, or the same message when there is no stack. + + Project access tokens can list issues, including read-only ones. + operationId: listIssues + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/Limit' + - $ref: '#/components/parameters/IssueCursor' + - name: status + in: query + required: false + description: Return only issues in this status. + schema: + $ref: '#/components/schemas/IssueStatus' + - name: resource_id + in: query + required: false + description: Return only issues raised by this function or frontend. + schema: + type: string + format: uuid + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedIssues' + '400': + description: A filter or the cursor is invalid + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Project not found. Code `feature_unavailable` means issues are not available in this environment. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /projects/{id}/issues/{issueId}: + get: + tags: + - Issues + summary: Get an issue + description: | + Returns one issue: the resource that raised it, how often and when it + was seen, and its status. + + Project access tokens can read issues, including read-only ones. + operationId: getIssue + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/IssueId' + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/Issue' + '404': + description: Issue not found. Code `feature_unavailable` means issues are not available in this environment. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + patch: + tags: + - Issues + summary: Update an issue + description: | + Sets an issue's status. A resolved issue that is seen again after it + was resolved reopens, and `regressed_at` records when. An ignored issue + stays ignored while it keeps being counted. + + Setting the status an issue already has is safe to repeat. + operationId: updateIssue + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/IssueId' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateIssueRequest' + responses: + '200': + description: Updated + content: + application/json: + schema: + $ref: '#/components/schemas/Issue' + '400': + description: The request body is invalid + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Issue not found. Code `feature_unavailable` means issues are not available in this environment. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /projects/{id}/autofix: + get: + tags: + - Autofix + summary: Get autofix settings + description: | + Returns whether Volcano diagnoses the project's issues with AI, how far + a run may go, and which model it uses. A project that never saved + settings returns the defaults, with autofix off. + + Your API key is never returned. `api_key_configured`, + `api_key_provider`, and `api_key_last4` show whether one is set and + which provider it belongs to. + + Where autofix is not available, saved settings stay readable. A project + that never saved any answers `404` with code `feature_unavailable`. + operationId: getAutofixSettings + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/AutofixSettings' + '404': + description: Project not found. Code `feature_unavailable` means autofix is not available in this environment and the project never saved settings. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '501': + description: Autofix is not available in local mode. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '503': + description: The owner's plan could not be resolved. Retry later. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + put: + tags: + - Autofix + summary: Replace autofix settings + description: | + Replaces the project's autofix settings. Omitted fields take their + defaults, except three: an omitted `provider` or `model` keeps its saved + value, and an omitted `api_key` keeps the stored key. So + `{"enabled": false}` turns autofix off and keeps the key. + + Project access tokens are refused. Autofix opens pull requests in the + project's repository, so a person turns it on with a platform token or + in the dashboard. + + Turning autofix on needs a plan that includes it. Settings that are + already on stay stored after a downgrade, and saving them again is not + refused, but no run starts until the plan includes autofix again. Other + saves need no plan. + + Provider `anthropic` runs on your own API key. A key belongs to the + provider it was saved with, and turning autofix on with a provider that + runs on your own key needs one for it. Turning autofix off or switching + providers keeps the stored key; only + `DELETE /projects/{id}/autofix/api-key` removes it. Turning autofix on + with provider `volcano` needs the `autofix.managed_models` capability; + without it the request answers `400` with code `feature_unavailable`. + + Where autofix is not available, a project with saved settings can + still change them with `enabled: false`. Turning autofix on answers + `404` with code `feature_unavailable`. + operationId: updateAutofixSettings + security: + - UserToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateAutofixSettingsRequest' + responses: + '200': + description: Saved + content: + application/json: + schema: + $ref: '#/components/schemas/AutofixSettings' + '400': + description: The request body is invalid, the key does not fit the provider, or turning autofix on with a provider that runs on your own key has no key for it. Code `feature_unavailable` means Volcano-managed models are not available in this environment. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: The owner's plan does not include autofix, or the request used a project access token. Only a person changes autofix settings. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Project not found. Code `feature_unavailable` means autofix is not available in this environment, which refuses turning it on and a project's first save. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '501': + description: Autofix is not available in local mode. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '503': + description: Turning autofix on needs the owner's plan, which could not be resolved. Nothing was saved. Retry later. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /projects/{id}/autofix/api-key: + delete: + tags: + - Autofix + summary: Delete the API key + description: | + Deletes the project's stored API key and returns the settings. Autofix + on the key's provider runs on that key, so it turns off; on another + provider it stays as it is. Deleting when no key is stored succeeds. + + Turning autofix off or switching providers never deletes the key, and + neither does applying a project configuration. This works where + autofix is not available, for a project that saved settings. + + Project access tokens are refused. + operationId: deleteAutofixAPIKey + security: + - UserToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + responses: + '200': + description: Deleted + content: + application/json: + schema: + $ref: '#/components/schemas/AutofixSettings' + '403': + description: The request used a project access token. Only a person deletes the key. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Project not found. Code `feature_unavailable` means autofix is not available in this environment and the project never saved settings. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '501': + description: Autofix is not available in local mode. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /projects/{id}/durable-approvals: get: tags: @@ -6585,6 +6906,8 @@ paths: The account must own the hostname: it must have verified the hostname or a domain above it (see `POST /user/domains`). A certificate does not prove ownership. When the account owns no domain covering the hostname, Volcano asks for a TXT record at `_volcano.`, such as `_volcano.example.com`. Publishing it verifies the whole domain, so later subdomains need no record. A managed TLS request reserves the hostname and returns that record in `verification_records`; the reservation expires after 72 hours unless the record is published. A BYOC request gets `409` with `code: ownership_verification_required` and the record in `required_record`; publish it and send the same request again. Managed TLS then returns the CNAME that authorizes certificate issuance and renewal. + To move an active BYOC domain to managed TLS without downtime, send `tls.mode: managed` for the same hostname. The response is `200` with the CNAME to publish; the uploaded certificate keeps serving until Volcano issues the managed one, and `serving_certificate` changes from `uploaded` to `managed`. + To move an active managed domain to BYOC without downtime, send `tls.mode: byoc` with the certificate for the same hostname. The response is `200`; the uploaded certificate replaces the managed one at once, and Volcano stops renewing the managed certificate. An unverified reservation does not block an account that proves ownership. When another account holds one, a request gets `409` with `code: ownership_verification_required` and the caller's own `required_record`; after publishing it, the same request takes over the reservation. When another account verified the domain, the same `409` names the record that moves the domain to the caller once the other account's record is no longer published. A hostname below a domain another account owns otherwise returns `409` without `code`. operationId: createFrontendCustomDomain security: @@ -6601,7 +6924,7 @@ paths: $ref: '#/components/schemas/CreateFrontendCustomDomainRequest' responses: '200': - description: Custom domain already configured with same hostname + description: 'Custom domain already configured with the same hostname. A request with the other TLS mode for the frontend''s active domain switches it in place. To managed TLS, the uploaded certificate keeps serving, with `serving_certificate: uploaded`, until Volcano issues the managed certificate. To BYOC, the uploaded certificate replaces the managed one at once.' content: application/json: schema: @@ -6637,7 +6960,12 @@ paths: schema: $ref: '#/components/schemas/Error' '409': - description: Conflict - ownership not verified, custom domain owned or reserved by another account, already in use, still detaching, or frontend already has a custom domain + description: 'Conflict - ownership not verified, custom domain owned or reserved by another account, already in use, still detaching, or frontend already has a custom domain. While a removed domain detaches and Volcano releases it (about a minute for BYOC, a few minutes for managed TLS), adding its hostname to any frontend, or any domain to its frontend, returns `code: custom_domain_releasing` and a `Retry-After` header; send the same request again after that many seconds. A release that will not finish within a few minutes returns the conflict without `code`.' + headers: + Retry-After: + description: Seconds to wait before sending the same request again. Sent only with code `custom_domain_releasing`. + schema: + type: integer content: application/json: schema: @@ -6692,6 +7020,12 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + '409': + description: The custom domain switched TLS mode while the request ran. Send it again. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': description: Internal server error content: @@ -7016,6 +7350,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: @@ -10317,14 +10907,22 @@ paths: summary: Get auth user insights description: | Returns current and deleted auth-user totals, rolling 24-hour and 30-day - active users, and zero-filled signup, deletion, net-growth, and successful - sign-in counts for an inclusive UTC date range. Weeks start on Monday. - Signups remain counted after deletion; net growth is signups minus - deletions. Deleted users contribute to active counts until their last - activity leaves the rolling window. Token refreshes affect active users - but not the sign-in series. Collection starts at deployment, with signup - history backfilled from accounts still present then. Earlier hard-deleted - accounts cannot be recovered. + active users, and zero-filled daily activity and account-retention counts + for an inclusive UTC date range. Weeks start on Monday. + The existing deletions series counts accounts by deletion date; net_growth + remains signups minus deletions and is not affected by bans. + The banned_users, deleted_users, and available_users fields describe the + current state of users registered in each bucket. Banned users exclude + deleted users and expired bans. Available users are signups minus + banned_users minus deleted_users. Unban and expiry restore availability in + the original signup bucket. These current-state cohorts can change after + the requested dates have passed, without rewriting activity counts. + Sign-in counts remain grouped by session creation date. Deleted users + contribute to active counts until their last activity leaves the rolling + window. Token refreshes affect active users but not the sign-in series. + Signup history is backfilled from accounts present when collection was + deployed. Accounts hard-deleted before deletion-history collection cannot + be recovered. Current bans require no separate event-history collection. operationId: getAuthInsights security: - UserToken: [] @@ -10372,6 +10970,9 @@ paths: signups: 12 signins: 97 deletions: 3 + banned_users: 2 + deleted_users: 3 + available_users: 7 net_growth: 9 is_partial: true '400': @@ -11074,7 +11675,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 +15234,54 @@ 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 | + | `issues` | The Issues API: listing, reading, and updating grouped runtime errors | + | `autofix` | The Autofix API: a project's AI diagnosis and fix settings | + | `autofix.managed_models` | Turning autofix on with Volcano-managed models instead of your own API key | + + 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 + - id: issues + status: available + - id: autofix + status: available + - id: autofix.managed_models + status: unavailable /openapi.json: get: tags: @@ -15001,6 +15651,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 @@ -15048,6 +15706,23 @@ components: type: string format: uuid description: Durable approval ID + IssueId: + name: issueId + in: path + required: true + schema: + type: string + format: uuid + description: Issue ID + IssueCursor: + name: cursor + in: query + required: false + schema: + type: string + description: | + Opaque cursor from a previous response's `next_cursor`. Pages forward; + keep the same filters while paging. DurableApprovalFunctionFilter: name: function in: query @@ -15421,6 +16096,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 +16128,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 @@ -15472,6 +16151,7 @@ components: type: string format: uuid memory_mb: + description: Baseline memory in MiB. Cloud HOBBY supports 1024; SUPERAGENT supports 1024 or 2048. Omission uses the preset or template default; a template requiring more than the plan permits is rejected. Local sessions are exempt from cloud plan limits. type: integer enum: - 1024 @@ -15481,15 +16161,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 HOBBY accepts 30–3600 seconds; SUPERAGENT accepts 30–28800 seconds. Inherited template defaults are clamped to the plan limit; explicit values above it are rejected. Local accepts 0 for unlimited or a positive lifetime. required: - region oneOf: @@ -15513,9 +16188,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: @@ -15534,6 +16209,7 @@ components: type: string format: uuid memory_mb: + description: Baseline memory in MiB. Cloud HOBBY supports 1024; SUPERAGENT supports 1024 or 2048. Omission uses the preset or template default; a template requiring more than the plan permits is rejected. Local sessions are exempt from cloud plan limits. type: integer enum: - 1024 @@ -15542,15 +16218,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 HOBBY accepts 30–3600 seconds; SUPERAGENT accepts 30–28800 seconds. Inherited template defaults are clamped to the plan limit; explicit values above it are rejected. 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 +16486,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`, `sandboxes.custom_templates`, `issues`, or `autofix`. 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 +16617,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 +16669,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 +16809,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: @@ -16139,6 +16864,21 @@ components: format: int64 minimum: 0 description: Successful session creations during the bucket. + banned_users: + type: integer + format: int64 + minimum: 0 + description: Users registered in this bucket who are currently banned. Excludes deleted users, lifted bans, expired temporary bans, and internal test identities. + deleted_users: + type: integer + format: int64 + minimum: 0 + description: Users registered in this bucket who are now deleted, counted once across soft and hard deletion. Grouped by signup date, not deletion date. + available_users: + type: integer + format: int64 + minimum: 0 + description: Currently available users registered in this bucket (signups minus banned_users minus deleted_users). Unban or expiry restores availability in the original signup bucket. This measures account availability, not return activity. deletions: type: integer format: int64 @@ -16147,7 +16887,7 @@ components: net_growth: type: integer format: int64 - description: Registrations minus deletions during this bucket. May be negative. + description: Registrations minus deletions during this bucket. May be negative. Bans do not affect this value. is_partial: type: boolean description: Whether the requested window or observation time clips this bucket. @@ -16157,6 +16897,9 @@ components: - signins - is_partial - deletions + - banned_users + - deleted_users + - available_users - net_growth AuthInsightsSummary: type: object @@ -17068,6 +17811,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: | @@ -18714,6 +19518,10 @@ components: Paths on this frontend that forward to a public function, ordered from most to least specific. Anyone who can load the frontend can reach the target function at these paths without a credential. + last_deployed_at: + type: string + format: date-time + description: Recorded completion time of the most recent deploy or redeploy with status active. Omitted when no such deployment has a recorded completion time. Site traffic, pending deployments, degraded deployments, failed deployments, and deletion do not change this value. last_invoked_at: type: string format: date-time @@ -18881,11 +19689,18 @@ components: - verified - failed description: '`verified`: the domain is served by a validated certificate. `pending`: it is not served yet, is being re-validated after its certificate material was withdrawn, or Volcano is retrying after a failure. `failed`: a failure left the domain unserved, alongside `domain_status: failed`; managed domains report the cause in `failure_reason`.' + serving_certificate: + type: string + enum: + - uploaded + - managed + description: 'Certificate the domain serves, present only while it is active. `uploaded`: the BYOC certificate, including after the domain switched to managed TLS and until Volcano issues the managed one; `failure_reason` then reports an issuance failure. `managed`: a certificate Volcano issued.' failure_reason: type: string - 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. + description: Failure category, present when managed TLS setup has failed, or when issuance is failing for a domain that switched to managed TLS and still serves its uploaded certificate. 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: @@ -19022,7 +19837,7 @@ components: - type - value FrontendCustomDomainConflictError: - description: 'Domain ownership conflict. With `code: ownership_verification_required`, the account has not proven it owns the domain: publish `required_record` in DNS and send the same request again. The retry succeeds once Volcano can see the record. Other conflicts omit both fields.' + description: 'Domain ownership conflict. With `code: ownership_verification_required`, the account has not proven it owns the domain: publish `required_record` in DNS and send the same request again. The retry succeeds once Volcano can see the record. With `code: custom_domain_releasing`, a removed domain still holds the hostname or the frontend while Volcano releases it: send the same request again after the response''s `Retry-After` seconds. A release that will not finish within a few minutes is a plain conflict. Other conflicts omit both fields.' allOf: - $ref: '#/components/schemas/Error' - type: object @@ -20374,12 +21189,19 @@ components: at times the time it spent running, in megabyte-seconds; the allowance for it is published in gigabyte-seconds, which is 1024 of these. "Sandbox Running (MiB-Seconds)", "Sandbox Suspended (Seconds)", and - "Sandbox Uncertain (MiB-Seconds)" are preview-only usage; they do not - debit credits. Running reports configured memory times observed runtime, - not measured CPU or elastic memory consumption. Uncertain includes - observation gaps and unconfirmed state transitions. Suspended reports - duration, not snapshot size. Local sessions do not contribute. - Totals are rounded down after aggregating millisecond measurements. + "Sandbox Uncertain (MiB-Seconds)" report cloud Sandbox usage. Running + reports configured baseline memory times confirmed runtime, not measured + CPU or elastic memory consumption. For sessions admitted after the pricing + release, confirmed running time consumes the account's runtime allowance; + SUPERAGENT overage debits credits according to the account's pricing terms. + Suspended time and uncertain usage do not consume runtime allowance or + debit credits. Uncertain includes observation gaps and unconfirmed state + transitions. Suspended reports duration, not snapshot size; snapshot costs + are included in runtime pricing. Local and platform image-validation + sessions do not contribute. Existing preview sessions remain unbilled, + and preview history is never charged retroactively. Displayed totals are + rounded down after aggregating millisecond measurements; billing uses + unrounded measurements in the monthly account billing cycle. "Database Storage (Bytes)" is a current observed gauge, not a cumulative counter. It is the sum of the latest samples exposed as `storage_bytes` by the project's database list, so it includes what each @@ -20862,9 +21684,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 @@ -20896,6 +21723,219 @@ components: - limit - total - has_more + Issue: + type: object + description: Runtime errors from one function or frontend, grouped by error type and stack. + properties: + id: + type: string + format: uuid + project_id: + type: string + format: uuid + resource: + $ref: '#/components/schemas/ResourceReference' + title: + type: string + description: | + The error type and message, with values such as IDs, numbers, and + URLs replaced by placeholders like `` and ``. + error_type: + type: string + description: The exception class, such as `TypeError`. Omitted when the error has none. + culprit: + type: string + description: The innermost frame of your code in the stack, as `function (file)`. Omitted without a stack. + status: + $ref: '#/components/schemas/IssueStatus' + event_count: + type: integer + format: int64 + description: Errors counted in this issue. A retried delivery can count an error twice. + first_seen_at: + type: string + format: date-time + last_seen_at: + type: string + format: date-time + last_region: + type: string + description: The region that served the latest error, such as `us-east-1`. + sample_event_id: + type: string + description: The ID of the latest error's log event, while logs retain it. + sample_event_at: + type: string + format: date-time + description: When the latest error's log event was written. + resolved_at: + type: string + format: date-time + description: When the issue was resolved. Present only while it is resolved. + regressed_at: + type: string + format: date-time + description: When a resolved issue was last seen again and reopened. + created_at: + type: string + format: date-time + updated_at: + type: string + format: date-time + required: + - id + - project_id + - resource + - title + - status + - event_count + - first_seen_at + - last_seen_at + - created_at + - updated_at + IssueStatus: + type: string + enum: + - open + - resolved + - ignored + description: | + `open` until someone resolves or ignores the issue. A resolved issue + seen again reopens. + PaginatedIssues: + type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/Issue' + limit: + type: integer + description: Number of items per page + has_more: + type: boolean + description: Whether a next page exists + next_cursor: + type: string + description: Opaque cursor for the next page (present if has_more is true) + required: + - data + - limit + - has_more + UpdateIssueRequest: + type: object + additionalProperties: false + properties: + status: + $ref: '#/components/schemas/IssueStatus' + required: + - status + AutofixSettings: + type: object + additionalProperties: false + properties: + project_id: + type: string + format: uuid + enabled: + type: boolean + description: Whether Volcano diagnoses the project's issues with AI. + max_stage: + $ref: '#/components/schemas/AutofixStage' + auto_trigger: + type: boolean + description: Whether a new or reopened issue starts a run on its own. When false, runs start only on request. + provider: + $ref: '#/components/schemas/AutofixProvider' + model: + $ref: '#/components/schemas/AutofixModel' + api_key_configured: + type: boolean + description: Whether your own API key is stored. The key itself is never returned. + api_key_provider: + allOf: + - $ref: '#/components/schemas/AutofixProvider' + description: The provider the stored key belongs to, present when one is stored. + api_key_last4: + type: string + description: The stored key's last four characters, present when one is stored. + plan_includes_autofix: + type: boolean + description: Whether the owner's plan includes autofix. When false, saved settings stay stored and no run starts. Absent when a save that needed no plan succeeded but the plan could not be resolved. + updated_at: + type: string + format: date-time + description: When the settings were last saved. Absent until the first save. + required: + - project_id + - enabled + - max_stage + - auto_trigger + - provider + - model + - api_key_configured + AutofixStage: + type: string + enum: + - diagnose + - pull_request + x-enum-varnames: + - AutofixStageDiagnose + - AutofixStagePullRequest + description: How far a run may go. `diagnose` stops at a root-cause diagnosis. `pull_request` may also open a draft pull request with a fix in the project's connected repository. + AutofixProvider: + type: string + enum: + - volcano + - anthropic + x-enum-varnames: + - AutofixProviderVolcano + - AutofixProviderAnthropic + description: Who serves the model. `volcano` runs on Volcano's models. `anthropic` runs on your own Anthropic API key. + AutofixModel: + type: string + enum: + - claude-fable-5-1 + - claude-opus-5-5 + - claude-sonnet-5-5 + - claude-haiku-5-5 + - claude-opus-5 + - claude-sonnet-5 + - claude-haiku-4-5 + x-enum-varnames: + - AutofixModelClaudeFable51 + - AutofixModelClaudeOpus55 + - AutofixModelClaudeSonnet55 + - AutofixModelClaudeHaiku55 + - AutofixModelClaudeOpus5 + - AutofixModelClaudeSonnet5 + - AutofixModelClaudeHaiku45 + description: The Claude model a run uses. `claude-opus-5-5` is the default. + UpdateAutofixSettingsRequest: + type: object + additionalProperties: false + properties: + enabled: + type: boolean + max_stage: + $ref: '#/components/schemas/AutofixStage' + auto_trigger: + type: boolean + default: false + provider: + $ref: '#/components/schemas/AutofixProvider' + model: + $ref: '#/components/schemas/AutofixModel' + api_key: + type: string + format: password + writeOnly: true + minLength: 20 + maxLength: 512 + pattern: ^[!-~]+$ + description: Your own API key for `provider`, such as an Anthropic key for `anthropic`. Omit it to keep the stored key. Encrypted at rest and never returned. + required: + - enabled PaginatedProjectCustomDomains: type: object properties: @@ -21243,6 +22283,8 @@ components: $ref: '#/components/schemas/ProjectConfigBucket' realtime: $ref: '#/components/schemas/ProjectConfigRealtime' + autofix: + $ref: '#/components/schemas/ProjectConfigAutofix' auth: $ref: '#/components/schemas/ProjectConfigAuth' functions: @@ -21641,8 +22683,9 @@ components: domain, omitting `tls` or sending only `tls.mode` keeps the stored certificate; new BYOC material for the same domain rotates the certificate in place (zero downtime). Changing `tls.mode` for the same - hostname, or the hostname of a managed domain, requires deleting the - domain first. BYOC TLS material is write-only; exports render only + hostname switches an active domain in place (zero downtime); a domain + that is not yet active, or a managed domain changing hostname, must be + deleted first. BYOC TLS material is write-only; exports render only `tls.mode`. properties: domain: @@ -21969,6 +23012,21 @@ components: type: boolean postgres_changes_enabled: type: boolean + ProjectConfigAutofix: + type: object + additionalProperties: false + description: 'AI diagnosis and fix settings. Omitted fields keep their current value. Your API key is never part of the manifest, and an apply never sets or deletes it: set it with `PUT /projects/{id}/autofix` before turning on a provider that runs on your own key.' + properties: + enabled: + type: boolean + max_stage: + $ref: '#/components/schemas/AutofixStage' + auto_trigger: + type: boolean + provider: + $ref: '#/components/schemas/AutofixProvider' + model: + $ref: '#/components/schemas/AutofixModel' ProjectConfigScheduler: type: object additionalProperties: false @@ -23007,10 +24065,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 +24100,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 +24751,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 templates accept 30–28800 seconds; inherited lifetimes are clamped to the session plan limit (3600 for HOBBY, 28800 for SUPERAGENT). Local accepts 0 for unlimited or a positive lifetime. DatabaseQueryPerformanceDatabase: type: object properties: diff --git a/src/volcano_sdk/_generated/api/auth_admin/get_auth_insights.py b/src/volcano_sdk/_generated/api/auth_admin/get_auth_insights.py index e5f6b001..655af8b1 100644 --- a/src/volcano_sdk/_generated/api/auth_admin/get_auth_insights.py +++ b/src/volcano_sdk/_generated/api/auth_admin/get_auth_insights.py @@ -134,14 +134,22 @@ def sync_detailed( """ Get auth user insights Returns current and deleted auth-user totals, rolling 24-hour and 30-day - active users, and zero-filled signup, deletion, net-growth, and successful - sign-in counts for an inclusive UTC date range. Weeks start on Monday. - Signups remain counted after deletion; net growth is signups minus - deletions. Deleted users contribute to active counts until their last - activity leaves the rolling window. Token refreshes affect active users - but not the sign-in series. Collection starts at deployment, with signup - history backfilled from accounts still present then. Earlier hard-deleted - accounts cannot be recovered. + active users, and zero-filled daily activity and account-retention counts + for an inclusive UTC date range. Weeks start on Monday. + The existing deletions series counts accounts by deletion date; net_growth + remains signups minus deletions and is not affected by bans. + The banned_users, deleted_users, and available_users fields describe the + current state of users registered in each bucket. Banned users exclude + deleted users and expired bans. Available users are signups minus + banned_users minus deleted_users. Unban and expiry restore availability in + the original signup bucket. These current-state cohorts can change after + the requested dates have passed, without rewriting activity counts. + Sign-in counts remain grouped by session creation date. Deleted users + contribute to active counts until their last activity leaves the rolling + window. Token refreshes affect active users but not the sign-in series. + Signup history is backfilled from accounts present when collection was + deployed. Accounts hard-deleted before deletion-history collection cannot + be recovered. Current bans require no separate event-history collection. Args: id (UUID): @@ -184,14 +192,22 @@ def sync( """ Get auth user insights Returns current and deleted auth-user totals, rolling 24-hour and 30-day - active users, and zero-filled signup, deletion, net-growth, and successful - sign-in counts for an inclusive UTC date range. Weeks start on Monday. - Signups remain counted after deletion; net growth is signups minus - deletions. Deleted users contribute to active counts until their last - activity leaves the rolling window. Token refreshes affect active users - but not the sign-in series. Collection starts at deployment, with signup - history backfilled from accounts still present then. Earlier hard-deleted - accounts cannot be recovered. + active users, and zero-filled daily activity and account-retention counts + for an inclusive UTC date range. Weeks start on Monday. + The existing deletions series counts accounts by deletion date; net_growth + remains signups minus deletions and is not affected by bans. + The banned_users, deleted_users, and available_users fields describe the + current state of users registered in each bucket. Banned users exclude + deleted users and expired bans. Available users are signups minus + banned_users minus deleted_users. Unban and expiry restore availability in + the original signup bucket. These current-state cohorts can change after + the requested dates have passed, without rewriting activity counts. + Sign-in counts remain grouped by session creation date. Deleted users + contribute to active counts until their last activity leaves the rolling + window. Token refreshes affect active users but not the sign-in series. + Signup history is backfilled from accounts present when collection was + deployed. Accounts hard-deleted before deletion-history collection cannot + be recovered. Current bans require no separate event-history collection. Args: id (UUID): @@ -229,14 +245,22 @@ async def asyncio_detailed( """ Get auth user insights Returns current and deleted auth-user totals, rolling 24-hour and 30-day - active users, and zero-filled signup, deletion, net-growth, and successful - sign-in counts for an inclusive UTC date range. Weeks start on Monday. - Signups remain counted after deletion; net growth is signups minus - deletions. Deleted users contribute to active counts until their last - activity leaves the rolling window. Token refreshes affect active users - but not the sign-in series. Collection starts at deployment, with signup - history backfilled from accounts still present then. Earlier hard-deleted - accounts cannot be recovered. + active users, and zero-filled daily activity and account-retention counts + for an inclusive UTC date range. Weeks start on Monday. + The existing deletions series counts accounts by deletion date; net_growth + remains signups minus deletions and is not affected by bans. + The banned_users, deleted_users, and available_users fields describe the + current state of users registered in each bucket. Banned users exclude + deleted users and expired bans. Available users are signups minus + banned_users minus deleted_users. Unban and expiry restore availability in + the original signup bucket. These current-state cohorts can change after + the requested dates have passed, without rewriting activity counts. + Sign-in counts remain grouped by session creation date. Deleted users + contribute to active counts until their last activity leaves the rolling + window. Token refreshes affect active users but not the sign-in series. + Signup history is backfilled from accounts present when collection was + deployed. Accounts hard-deleted before deletion-history collection cannot + be recovered. Current bans require no separate event-history collection. Args: id (UUID): @@ -279,14 +303,22 @@ async def asyncio( """ Get auth user insights Returns current and deleted auth-user totals, rolling 24-hour and 30-day - active users, and zero-filled signup, deletion, net-growth, and successful - sign-in counts for an inclusive UTC date range. Weeks start on Monday. - Signups remain counted after deletion; net growth is signups minus - deletions. Deleted users contribute to active counts until their last - activity leaves the rolling window. Token refreshes affect active users - but not the sign-in series. Collection starts at deployment, with signup - history backfilled from accounts still present then. Earlier hard-deleted - accounts cannot be recovered. + active users, and zero-filled daily activity and account-retention counts + for an inclusive UTC date range. Weeks start on Monday. + The existing deletions series counts accounts by deletion date; net_growth + remains signups minus deletions and is not affected by bans. + The banned_users, deleted_users, and available_users fields describe the + current state of users registered in each bucket. Banned users exclude + deleted users and expired bans. Available users are signups minus + banned_users minus deleted_users. Unban and expiry restore availability in + the original signup bucket. These current-state cohorts can change after + the requested dates have passed, without rewriting activity counts. + Sign-in counts remain grouped by session creation date. Deleted users + contribute to active counts until their last activity leaves the rolling + window. Token refreshes affect active users but not the sign-in series. + Signup history is backfilled from accounts present when collection was + deployed. Accounts hard-deleted before deletion-history collection cannot + be recovered. Current bans require no separate event-history collection. Args: id (UUID): 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/autofix/__init__.py b/src/volcano_sdk/_generated/api/autofix/__init__.py new file mode 100644 index 00000000..c9921b5f --- /dev/null +++ b/src/volcano_sdk/_generated/api/autofix/__init__.py @@ -0,0 +1 @@ +""" Contains endpoint functions for accessing the API """ diff --git a/src/volcano_sdk/_generated/api/autofix/delete_autofix_api_key.py b/src/volcano_sdk/_generated/api/autofix/delete_autofix_api_key.py new file mode 100644 index 00000000..55698d32 --- /dev/null +++ b/src/volcano_sdk/_generated/api/autofix/delete_autofix_api_key.py @@ -0,0 +1,234 @@ +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.autofix_settings import AutofixSettings +from ...models.error import Error +from typing import cast +from uuid import UUID + + + +def request_kwargs( + id: UUID | str, + +) -> dict[str, Any]: + + + + + + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/projects/{id}/autofix/api-key".format(id=quote(str(id), safe=""),), + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> AutofixSettings | Error | None: + if response.status_code == 200: + response_200 = AutofixSettings.from_dict(response.json()) + + + + return response_200 + + 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 == 501: + response_501 = Error.from_dict(response.json()) + + + + return response_501 + + 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[AutofixSettings | 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, + *, + client: AuthenticatedClient, + +) -> Response[AutofixSettings | Error]: + """ Delete the API key + + Deletes the project's stored API key and returns the settings. Autofix + on the key's provider runs on that key, so it turns off; on another + provider it stays as it is. Deleting when no key is stored succeeds. + + Turning autofix off or switching providers never deletes the key, and + neither does applying a project configuration. This works where + autofix is not available, for a project that saved settings. + + Project access tokens are refused. + + 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[AutofixSettings | Error] + """ + + + 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, + +) -> AutofixSettings | Error | None: + """ Delete the API key + + Deletes the project's stored API key and returns the settings. Autofix + on the key's provider runs on that key, so it turns off; on another + provider it stays as it is. Deleting when no key is stored succeeds. + + Turning autofix off or switching providers never deletes the key, and + neither does applying a project configuration. This works where + autofix is not available, for a project that saved settings. + + Project access tokens are refused. + + 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: + AutofixSettings | Error + """ + + + return sync_detailed( + id=id, +client=client, + + ).parsed + +async def asyncio_detailed( + id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Response[AutofixSettings | Error]: + """ Delete the API key + + Deletes the project's stored API key and returns the settings. Autofix + on the key's provider runs on that key, so it turns off; on another + provider it stays as it is. Deleting when no key is stored succeeds. + + Turning autofix off or switching providers never deletes the key, and + neither does applying a project configuration. This works where + autofix is not available, for a project that saved settings. + + Project access tokens are refused. + + 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[AutofixSettings | Error] + """ + + + 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, + +) -> AutofixSettings | Error | None: + """ Delete the API key + + Deletes the project's stored API key and returns the settings. Autofix + on the key's provider runs on that key, so it turns off; on another + provider it stays as it is. Deleting when no key is stored succeeds. + + Turning autofix off or switching providers never deletes the key, and + neither does applying a project configuration. This works where + autofix is not available, for a project that saved settings. + + Project access tokens are refused. + + 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: + AutofixSettings | Error + """ + + + return (await asyncio_detailed( + id=id, +client=client, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/autofix/get_autofix_settings.py b/src/volcano_sdk/_generated/api/autofix/get_autofix_settings.py new file mode 100644 index 00000000..35eeeff4 --- /dev/null +++ b/src/volcano_sdk/_generated/api/autofix/get_autofix_settings.py @@ -0,0 +1,238 @@ +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.autofix_settings import AutofixSettings +from ...models.error import Error +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}/autofix".format(id=quote(str(id), safe=""),), + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> AutofixSettings | Error | None: + if response.status_code == 200: + response_200 = AutofixSettings.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if response.status_code == 501: + response_501 = Error.from_dict(response.json()) + + + + return response_501 + + if response.status_code == 503: + response_503 = Error.from_dict(response.json()) + + + + return response_503 + + 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[AutofixSettings | 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, + *, + client: AuthenticatedClient, + +) -> Response[AutofixSettings | Error]: + """ Get autofix settings + + Returns whether Volcano diagnoses the project's issues with AI, how far + a run may go, and which model it uses. A project that never saved + settings returns the defaults, with autofix off. + + Your API key is never returned. `api_key_configured`, + `api_key_provider`, and `api_key_last4` show whether one is set and + which provider it belongs to. + + Where autofix is not available, saved settings stay readable. A project + that never saved any answers `404` with code `feature_unavailable`. + + 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[AutofixSettings | Error] + """ + + + 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, + +) -> AutofixSettings | Error | None: + """ Get autofix settings + + Returns whether Volcano diagnoses the project's issues with AI, how far + a run may go, and which model it uses. A project that never saved + settings returns the defaults, with autofix off. + + Your API key is never returned. `api_key_configured`, + `api_key_provider`, and `api_key_last4` show whether one is set and + which provider it belongs to. + + Where autofix is not available, saved settings stay readable. A project + that never saved any answers `404` with code `feature_unavailable`. + + 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: + AutofixSettings | Error + """ + + + return sync_detailed( + id=id, +client=client, + + ).parsed + +async def asyncio_detailed( + id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Response[AutofixSettings | Error]: + """ Get autofix settings + + Returns whether Volcano diagnoses the project's issues with AI, how far + a run may go, and which model it uses. A project that never saved + settings returns the defaults, with autofix off. + + Your API key is never returned. `api_key_configured`, + `api_key_provider`, and `api_key_last4` show whether one is set and + which provider it belongs to. + + Where autofix is not available, saved settings stay readable. A project + that never saved any answers `404` with code `feature_unavailable`. + + 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[AutofixSettings | Error] + """ + + + 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, + +) -> AutofixSettings | Error | None: + """ Get autofix settings + + Returns whether Volcano diagnoses the project's issues with AI, how far + a run may go, and which model it uses. A project that never saved + settings returns the defaults, with autofix off. + + Your API key is never returned. `api_key_configured`, + `api_key_provider`, and `api_key_last4` show whether one is set and + which provider it belongs to. + + Where autofix is not available, saved settings stay readable. A project + that never saved any answers `404` with code `feature_unavailable`. + + 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: + AutofixSettings | Error + """ + + + return (await asyncio_detailed( + id=id, +client=client, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/autofix/update_autofix_settings.py b/src/volcano_sdk/_generated/api/autofix/update_autofix_settings.py new file mode 100644 index 00000000..0949213d --- /dev/null +++ b/src/volcano_sdk/_generated/api/autofix/update_autofix_settings.py @@ -0,0 +1,332 @@ +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.autofix_settings import AutofixSettings +from ...models.error import Error +from ...models.update_autofix_settings_request import UpdateAutofixSettingsRequest +from typing import cast +from uuid import UUID + + + +def request_kwargs( + id: UUID | str, + *, + body: UpdateAutofixSettingsRequest, + +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + + + + + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/projects/{id}/autofix".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) -> AutofixSettings | Error | None: + if response.status_code == 200: + response_200 = AutofixSettings.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 == 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 == 501: + response_501 = Error.from_dict(response.json()) + + + + return response_501 + + if response.status_code == 503: + response_503 = Error.from_dict(response.json()) + + + + return response_503 + + 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[AutofixSettings | 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, + *, + client: AuthenticatedClient, + body: UpdateAutofixSettingsRequest, + +) -> Response[AutofixSettings | Error]: + """ Replace autofix settings + + Replaces the project's autofix settings. Omitted fields take their + defaults, except three: an omitted `provider` or `model` keeps its saved + value, and an omitted `api_key` keeps the stored key. So + `{"enabled": false}` turns autofix off and keeps the key. + + Project access tokens are refused. Autofix opens pull requests in the + project's repository, so a person turns it on with a platform token or + in the dashboard. + + Turning autofix on needs a plan that includes it. Settings that are + already on stay stored after a downgrade, and saving them again is not + refused, but no run starts until the plan includes autofix again. Other + saves need no plan. + + Provider `anthropic` runs on your own API key. A key belongs to the + provider it was saved with, and turning autofix on with a provider that + runs on your own key needs one for it. Turning autofix off or switching + providers keeps the stored key; only + `DELETE /projects/{id}/autofix/api-key` removes it. Turning autofix on + with provider `volcano` needs the `autofix.managed_models` capability; + without it the request answers `400` with code `feature_unavailable`. + + Where autofix is not available, a project with saved settings can + still change them with `enabled: false`. Turning autofix on answers + `404` with code `feature_unavailable`. + + Args: + id (UUID): + body (UpdateAutofixSettingsRequest): + + 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[AutofixSettings | Error] + """ + + + 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: UpdateAutofixSettingsRequest, + +) -> AutofixSettings | Error | None: + """ Replace autofix settings + + Replaces the project's autofix settings. Omitted fields take their + defaults, except three: an omitted `provider` or `model` keeps its saved + value, and an omitted `api_key` keeps the stored key. So + `{"enabled": false}` turns autofix off and keeps the key. + + Project access tokens are refused. Autofix opens pull requests in the + project's repository, so a person turns it on with a platform token or + in the dashboard. + + Turning autofix on needs a plan that includes it. Settings that are + already on stay stored after a downgrade, and saving them again is not + refused, but no run starts until the plan includes autofix again. Other + saves need no plan. + + Provider `anthropic` runs on your own API key. A key belongs to the + provider it was saved with, and turning autofix on with a provider that + runs on your own key needs one for it. Turning autofix off or switching + providers keeps the stored key; only + `DELETE /projects/{id}/autofix/api-key` removes it. Turning autofix on + with provider `volcano` needs the `autofix.managed_models` capability; + without it the request answers `400` with code `feature_unavailable`. + + Where autofix is not available, a project with saved settings can + still change them with `enabled: false`. Turning autofix on answers + `404` with code `feature_unavailable`. + + Args: + id (UUID): + body (UpdateAutofixSettingsRequest): + + 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: + AutofixSettings | Error + """ + + + return sync_detailed( + id=id, +client=client, +body=body, + + ).parsed + +async def asyncio_detailed( + id: UUID | str, + *, + client: AuthenticatedClient, + body: UpdateAutofixSettingsRequest, + +) -> Response[AutofixSettings | Error]: + """ Replace autofix settings + + Replaces the project's autofix settings. Omitted fields take their + defaults, except three: an omitted `provider` or `model` keeps its saved + value, and an omitted `api_key` keeps the stored key. So + `{"enabled": false}` turns autofix off and keeps the key. + + Project access tokens are refused. Autofix opens pull requests in the + project's repository, so a person turns it on with a platform token or + in the dashboard. + + Turning autofix on needs a plan that includes it. Settings that are + already on stay stored after a downgrade, and saving them again is not + refused, but no run starts until the plan includes autofix again. Other + saves need no plan. + + Provider `anthropic` runs on your own API key. A key belongs to the + provider it was saved with, and turning autofix on with a provider that + runs on your own key needs one for it. Turning autofix off or switching + providers keeps the stored key; only + `DELETE /projects/{id}/autofix/api-key` removes it. Turning autofix on + with provider `volcano` needs the `autofix.managed_models` capability; + without it the request answers `400` with code `feature_unavailable`. + + Where autofix is not available, a project with saved settings can + still change them with `enabled: false`. Turning autofix on answers + `404` with code `feature_unavailable`. + + Args: + id (UUID): + body (UpdateAutofixSettingsRequest): + + 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[AutofixSettings | Error] + """ + + + 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: UpdateAutofixSettingsRequest, + +) -> AutofixSettings | Error | None: + """ Replace autofix settings + + Replaces the project's autofix settings. Omitted fields take their + defaults, except three: an omitted `provider` or `model` keeps its saved + value, and an omitted `api_key` keeps the stored key. So + `{"enabled": false}` turns autofix off and keeps the key. + + Project access tokens are refused. Autofix opens pull requests in the + project's repository, so a person turns it on with a platform token or + in the dashboard. + + Turning autofix on needs a plan that includes it. Settings that are + already on stay stored after a downgrade, and saving them again is not + refused, but no run starts until the plan includes autofix again. Other + saves need no plan. + + Provider `anthropic` runs on your own API key. A key belongs to the + provider it was saved with, and turning autofix on with a provider that + runs on your own key needs one for it. Turning autofix off or switching + providers keeps the stored key; only + `DELETE /projects/{id}/autofix/api-key` removes it. Turning autofix on + with provider `volcano` needs the `autofix.managed_models` capability; + without it the request answers `400` with code `feature_unavailable`. + + Where autofix is not available, a project with saved settings can + still change them with `enabled: false`. Turning autofix on answers + `404` with code `feature_unavailable`. + + Args: + id (UUID): + body (UpdateAutofixSettingsRequest): + + 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: + AutofixSettings | Error + """ + + + return (await asyncio_detailed( + id=id, +client=client, +body=body, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/frontends/create_frontend_custom_domain.py b/src/volcano_sdk/_generated/api/frontends/create_frontend_custom_domain.py index 8c655110..85ce955c 100644 --- a/src/volcano_sdk/_generated/api/frontends/create_frontend_custom_domain.py +++ b/src/volcano_sdk/_generated/api/frontends/create_frontend_custom_domain.py @@ -146,6 +146,13 @@ def sync_detailed( published. A BYOC request gets `409` with `code: ownership_verification_required` and the record in `required_record`; publish it and send the same request again. Managed TLS then returns the CNAME that authorizes certificate issuance and renewal. + To move an active BYOC domain to managed TLS without downtime, send `tls.mode: managed` for the same + hostname. The response is `200` with the CNAME to publish; the uploaded certificate keeps serving + until Volcano issues the managed one, and `serving_certificate` changes from `uploaded` to + `managed`. + To move an active managed domain to BYOC without downtime, send `tls.mode: byoc` with the + certificate for the same hostname. The response is `200`; the uploaded certificate replaces the + managed one at once, and Volcano stops renewing the managed certificate. An unverified reservation does not block an account that proves ownership. When another account holds one, a request gets `409` with `code: ownership_verification_required` and the caller's own `required_record`; after publishing it, the same request takes over the reservation. When another @@ -202,6 +209,13 @@ def sync( published. A BYOC request gets `409` with `code: ownership_verification_required` and the record in `required_record`; publish it and send the same request again. Managed TLS then returns the CNAME that authorizes certificate issuance and renewal. + To move an active BYOC domain to managed TLS without downtime, send `tls.mode: managed` for the same + hostname. The response is `200` with the CNAME to publish; the uploaded certificate keeps serving + until Volcano issues the managed one, and `serving_certificate` changes from `uploaded` to + `managed`. + To move an active managed domain to BYOC without downtime, send `tls.mode: byoc` with the + certificate for the same hostname. The response is `200`; the uploaded certificate replaces the + managed one at once, and Volcano stops renewing the managed certificate. An unverified reservation does not block an account that proves ownership. When another account holds one, a request gets `409` with `code: ownership_verification_required` and the caller's own `required_record`; after publishing it, the same request takes over the reservation. When another @@ -253,6 +267,13 @@ async def asyncio_detailed( published. A BYOC request gets `409` with `code: ownership_verification_required` and the record in `required_record`; publish it and send the same request again. Managed TLS then returns the CNAME that authorizes certificate issuance and renewal. + To move an active BYOC domain to managed TLS without downtime, send `tls.mode: managed` for the same + hostname. The response is `200` with the CNAME to publish; the uploaded certificate keeps serving + until Volcano issues the managed one, and `serving_certificate` changes from `uploaded` to + `managed`. + To move an active managed domain to BYOC without downtime, send `tls.mode: byoc` with the + certificate for the same hostname. The response is `200`; the uploaded certificate replaces the + managed one at once, and Volcano stops renewing the managed certificate. An unverified reservation does not block an account that proves ownership. When another account holds one, a request gets `409` with `code: ownership_verification_required` and the caller's own `required_record`; after publishing it, the same request takes over the reservation. When another @@ -309,6 +330,13 @@ async def asyncio( published. A BYOC request gets `409` with `code: ownership_verification_required` and the record in `required_record`; publish it and send the same request again. Managed TLS then returns the CNAME that authorizes certificate issuance and renewal. + To move an active BYOC domain to managed TLS without downtime, send `tls.mode: managed` for the same + hostname. The response is `200` with the CNAME to publish; the uploaded certificate keeps serving + until Volcano issues the managed one, and `serving_certificate` changes from `uploaded` to + `managed`. + To move an active managed domain to BYOC without downtime, send `tls.mode: byoc` with the + certificate for the same hostname. The response is `200`; the uploaded certificate replaces the + managed one at once, and Volcano stops renewing the managed certificate. An unverified reservation does not block an account that proves ownership. When another account holds one, a request gets `409` with `code: ownership_verification_required` and the caller's own `required_record`; after publishing it, the same request takes over the reservation. When another diff --git a/src/volcano_sdk/_generated/api/frontends/delete_frontend_custom_domain.py b/src/volcano_sdk/_generated/api/frontends/delete_frontend_custom_domain.py index 485f17b5..216768e1 100644 --- a/src/volcano_sdk/_generated/api/frontends/delete_frontend_custom_domain.py +++ b/src/volcano_sdk/_generated/api/frontends/delete_frontend_custom_domain.py @@ -68,6 +68,13 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res 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()) diff --git a/src/volcano_sdk/_generated/api/issues/__init__.py b/src/volcano_sdk/_generated/api/issues/__init__.py new file mode 100644 index 00000000..c9921b5f --- /dev/null +++ b/src/volcano_sdk/_generated/api/issues/__init__.py @@ -0,0 +1 @@ +""" Contains endpoint functions for accessing the API """ diff --git a/src/volcano_sdk/_generated/api/issues/get_issue.py b/src/volcano_sdk/_generated/api/issues/get_issue.py new file mode 100644 index 00000000..100f78b9 --- /dev/null +++ b/src/volcano_sdk/_generated/api/issues/get_issue.py @@ -0,0 +1,213 @@ +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.issue import Issue +from typing import cast +from uuid import UUID + + + +def request_kwargs( + id: UUID | str, + issue_id: UUID | str, + +) -> dict[str, Any]: + + + + + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/projects/{id}/issues/{issue_id}".format(id=quote(str(id), safe=""),issue_id=quote(str(issue_id), safe=""),), + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | Issue | None: + if response.status_code == 200: + response_200 = Issue.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + 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 | Issue]: + 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, + issue_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Response[Error | Issue]: + """ Get an issue + + Returns one issue: the resource that raised it, how often and when it + was seen, and its status. + + Project access tokens can read issues, including read-only ones. + + Args: + id (UUID): + issue_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 | Issue] + """ + + + kwargs = request_kwargs( + id=id, +issue_id=issue_id, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + id: UUID | str, + issue_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Error | Issue | None: + """ Get an issue + + Returns one issue: the resource that raised it, how often and when it + was seen, and its status. + + Project access tokens can read issues, including read-only ones. + + Args: + id (UUID): + issue_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 | Issue + """ + + + return sync_detailed( + id=id, +issue_id=issue_id, +client=client, + + ).parsed + +async def asyncio_detailed( + id: UUID | str, + issue_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Response[Error | Issue]: + """ Get an issue + + Returns one issue: the resource that raised it, how often and when it + was seen, and its status. + + Project access tokens can read issues, including read-only ones. + + Args: + id (UUID): + issue_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 | Issue] + """ + + + kwargs = request_kwargs( + id=id, +issue_id=issue_id, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + id: UUID | str, + issue_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Error | Issue | None: + """ Get an issue + + Returns one issue: the resource that raised it, how often and when it + was seen, and its status. + + Project access tokens can read issues, including read-only ones. + + Args: + id (UUID): + issue_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 | Issue + """ + + + return (await asyncio_detailed( + id=id, +issue_id=issue_id, +client=client, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/issues/list_issues.py b/src/volcano_sdk/_generated/api/issues/list_issues.py new file mode 100644 index 00000000..cdfbeef0 --- /dev/null +++ b/src/volcano_sdk/_generated/api/issues/list_issues.py @@ -0,0 +1,295 @@ +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.issue_status import check_issue_status +from ...models.issue_status import IssueStatus +from ...models.paginated_issues import PaginatedIssues +from ...types import UNSET, Unset +from typing import cast +from uuid import UUID + + + +def request_kwargs( + id: UUID | str, + *, + limit: int | Unset = 10, + cursor: str | Unset = UNSET, + status: IssueStatus | Unset = UNSET, + resource_id: UUID | str | Unset = UNSET, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + params["limit"] = limit + + params["cursor"] = cursor + + json_status: str | Unset = UNSET + if not isinstance(status, Unset): + json_status = status + + params["status"] = json_status + + json_resource_id: str | Unset = UNSET + if not isinstance(resource_id, Unset): + json_resource_id = str(resource_id) + params["resource_id"] = json_resource_id + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/projects/{id}/issues".format(id=quote(str(id), safe=""),), + "params": params, + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | PaginatedIssues | None: + if response.status_code == 200: + response_200 = PaginatedIssues.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 == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + 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 | PaginatedIssues]: + 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, + limit: int | Unset = 10, + cursor: str | Unset = UNSET, + status: IssueStatus | Unset = UNSET, + resource_id: UUID | str | Unset = UNSET, + +) -> Response[Error | PaginatedIssues]: + """ List issues + + Lists the project's issues, most recently seen first. An issue groups + the runtime errors one function or frontend raised with the same error + type and stack, or the same message when there is no stack. + + Project access tokens can list issues, including read-only ones. + + Args: + id (UUID): + limit (int | Unset): Default: 10. + cursor (str | Unset): + status (IssueStatus | Unset): `open` until someone resolves or ignores the issue. A + resolved issue + seen again reopens. + resource_id (UUID | Unset): + + 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 | PaginatedIssues] + """ + + + kwargs = request_kwargs( + id=id, +limit=limit, +cursor=cursor, +status=status, +resource_id=resource_id, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + id: UUID | str, + *, + client: AuthenticatedClient, + limit: int | Unset = 10, + cursor: str | Unset = UNSET, + status: IssueStatus | Unset = UNSET, + resource_id: UUID | str | Unset = UNSET, + +) -> Error | PaginatedIssues | None: + """ List issues + + Lists the project's issues, most recently seen first. An issue groups + the runtime errors one function or frontend raised with the same error + type and stack, or the same message when there is no stack. + + Project access tokens can list issues, including read-only ones. + + Args: + id (UUID): + limit (int | Unset): Default: 10. + cursor (str | Unset): + status (IssueStatus | Unset): `open` until someone resolves or ignores the issue. A + resolved issue + seen again reopens. + resource_id (UUID | Unset): + + 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 | PaginatedIssues + """ + + + return sync_detailed( + id=id, +client=client, +limit=limit, +cursor=cursor, +status=status, +resource_id=resource_id, + + ).parsed + +async def asyncio_detailed( + id: UUID | str, + *, + client: AuthenticatedClient, + limit: int | Unset = 10, + cursor: str | Unset = UNSET, + status: IssueStatus | Unset = UNSET, + resource_id: UUID | str | Unset = UNSET, + +) -> Response[Error | PaginatedIssues]: + """ List issues + + Lists the project's issues, most recently seen first. An issue groups + the runtime errors one function or frontend raised with the same error + type and stack, or the same message when there is no stack. + + Project access tokens can list issues, including read-only ones. + + Args: + id (UUID): + limit (int | Unset): Default: 10. + cursor (str | Unset): + status (IssueStatus | Unset): `open` until someone resolves or ignores the issue. A + resolved issue + seen again reopens. + resource_id (UUID | Unset): + + 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 | PaginatedIssues] + """ + + + kwargs = request_kwargs( + id=id, +limit=limit, +cursor=cursor, +status=status, +resource_id=resource_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, + limit: int | Unset = 10, + cursor: str | Unset = UNSET, + status: IssueStatus | Unset = UNSET, + resource_id: UUID | str | Unset = UNSET, + +) -> Error | PaginatedIssues | None: + """ List issues + + Lists the project's issues, most recently seen first. An issue groups + the runtime errors one function or frontend raised with the same error + type and stack, or the same message when there is no stack. + + Project access tokens can list issues, including read-only ones. + + Args: + id (UUID): + limit (int | Unset): Default: 10. + cursor (str | Unset): + status (IssueStatus | Unset): `open` until someone resolves or ignores the issue. A + resolved issue + seen again reopens. + resource_id (UUID | Unset): + + 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 | PaginatedIssues + """ + + + return (await asyncio_detailed( + id=id, +client=client, +limit=limit, +cursor=cursor, +status=status, +resource_id=resource_id, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/issues/update_issue.py b/src/volcano_sdk/_generated/api/issues/update_issue.py new file mode 100644 index 00000000..5f98b2b8 --- /dev/null +++ b/src/volcano_sdk/_generated/api/issues/update_issue.py @@ -0,0 +1,244 @@ +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.issue import Issue +from ...models.update_issue_request import UpdateIssueRequest +from typing import cast +from uuid import UUID + + + +def request_kwargs( + id: UUID | str, + issue_id: UUID | str, + *, + body: UpdateIssueRequest, + +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + + + + + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": "/projects/{id}/issues/{issue_id}".format(id=quote(str(id), safe=""),issue_id=quote(str(issue_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 | Issue | None: + if response.status_code == 200: + response_200 = Issue.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 == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + 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 | Issue]: + 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, + issue_id: UUID | str, + *, + client: AuthenticatedClient, + body: UpdateIssueRequest, + +) -> Response[Error | Issue]: + """ Update an issue + + Sets an issue's status. A resolved issue that is seen again after it + was resolved reopens, and `regressed_at` records when. An ignored issue + stays ignored while it keeps being counted. + + Setting the status an issue already has is safe to repeat. + + Args: + id (UUID): + issue_id (UUID): + body (UpdateIssueRequest): + + 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 | Issue] + """ + + + kwargs = request_kwargs( + id=id, +issue_id=issue_id, +body=body, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + id: UUID | str, + issue_id: UUID | str, + *, + client: AuthenticatedClient, + body: UpdateIssueRequest, + +) -> Error | Issue | None: + """ Update an issue + + Sets an issue's status. A resolved issue that is seen again after it + was resolved reopens, and `regressed_at` records when. An ignored issue + stays ignored while it keeps being counted. + + Setting the status an issue already has is safe to repeat. + + Args: + id (UUID): + issue_id (UUID): + body (UpdateIssueRequest): + + 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 | Issue + """ + + + return sync_detailed( + id=id, +issue_id=issue_id, +client=client, +body=body, + + ).parsed + +async def asyncio_detailed( + id: UUID | str, + issue_id: UUID | str, + *, + client: AuthenticatedClient, + body: UpdateIssueRequest, + +) -> Response[Error | Issue]: + """ Update an issue + + Sets an issue's status. A resolved issue that is seen again after it + was resolved reopens, and `regressed_at` records when. An ignored issue + stays ignored while it keeps being counted. + + Setting the status an issue already has is safe to repeat. + + Args: + id (UUID): + issue_id (UUID): + body (UpdateIssueRequest): + + 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 | Issue] + """ + + + kwargs = request_kwargs( + id=id, +issue_id=issue_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, + issue_id: UUID | str, + *, + client: AuthenticatedClient, + body: UpdateIssueRequest, + +) -> Error | Issue | None: + """ Update an issue + + Sets an issue's status. A resolved issue that is seen again after it + was resolved reopens, and `regressed_at` records when. An ignored issue + stays ignored while it keeps being counted. + + Setting the status an issue already has is safe to repeat. + + Args: + id (UUID): + issue_id (UUID): + body (UpdateIssueRequest): + + 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 | Issue + """ + + + return (await asyncio_detailed( + id=id, +issue_id=issue_id, +client=client, +body=body, + + )).parsed 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..32aeb7ad --- /dev/null +++ b/src/volcano_sdk/_generated/api/system/list_capabilities.py @@ -0,0 +1,238 @@ +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 | + | `issues` | The Issues API: listing, reading, and updating grouped runtime errors | + | `autofix` | The Autofix API: a project's AI diagnosis and fix settings | + | `autofix.managed_models` | Turning autofix on with Volcano-managed models instead of your own API + key | + + 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 | + | `issues` | The Issues API: listing, reading, and updating grouped runtime errors | + | `autofix` | The Autofix API: a project's AI diagnosis and fix settings | + | `autofix.managed_models` | Turning autofix on with Volcano-managed models instead of your own API + key | + + 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 | + | `issues` | The Issues API: listing, reading, and updating grouped runtime errors | + | `autofix` | The Autofix API: a project's AI diagnosis and fix settings | + | `autofix.managed_models` | Turning autofix on with Volcano-managed models instead of your own API + key | + + 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 | + | `issues` | The Issues API: listing, reading, and updating grouped runtime errors | + | `autofix` | The Autofix API: a project's AI diagnosis and fix settings | + | `autofix.managed_models` | Turning autofix on with Volcano-managed models instead of your own API + key | + + 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/api/verified_domains/verify_domain.py b/src/volcano_sdk/_generated/api/verified_domains/verify_domain.py index fedb5cbe..7388c39f 100644 --- a/src/volcano_sdk/_generated/api/verified_domains/verify_domain.py +++ b/src/volcano_sdk/_generated/api/verified_domains/verify_domain.py @@ -129,13 +129,15 @@ def sync_detailed( Publish a TXT record named `_volcano.`, then send this request. Without the record, the response is `409` with `code: ownership_verification_required` and the `required_record` to - publish. Its value is the same on every request. The record must be - served at that name itself; a record reached through a CNAME does not - count. + publish. Its value stays the same until Volcano rotates the key it is + derived from. The record must be served at that name itself; a record + reached through a CNAME does not count. When another account verified the domain, publishing your record moves the domain to your account once that account's record is no longer - published. Keep your record published so the domain stays yours. + published. Keep your record published so the domain stays yours. After + Volcano rotates the key the value is derived from, only a record with + the new value counts. Verifying a domain the account already verified returns `200`. @@ -177,13 +179,15 @@ def sync( Publish a TXT record named `_volcano.`, then send this request. Without the record, the response is `409` with `code: ownership_verification_required` and the `required_record` to - publish. Its value is the same on every request. The record must be - served at that name itself; a record reached through a CNAME does not - count. + publish. Its value stays the same until Volcano rotates the key it is + derived from. The record must be served at that name itself; a record + reached through a CNAME does not count. When another account verified the domain, publishing your record moves the domain to your account once that account's record is no longer - published. Keep your record published so the domain stays yours. + published. Keep your record published so the domain stays yours. After + Volcano rotates the key the value is derived from, only a record with + the new value counts. Verifying a domain the account already verified returns `200`. @@ -220,13 +224,15 @@ async def asyncio_detailed( Publish a TXT record named `_volcano.`, then send this request. Without the record, the response is `409` with `code: ownership_verification_required` and the `required_record` to - publish. Its value is the same on every request. The record must be - served at that name itself; a record reached through a CNAME does not - count. + publish. Its value stays the same until Volcano rotates the key it is + derived from. The record must be served at that name itself; a record + reached through a CNAME does not count. When another account verified the domain, publishing your record moves the domain to your account once that account's record is no longer - published. Keep your record published so the domain stays yours. + published. Keep your record published so the domain stays yours. After + Volcano rotates the key the value is derived from, only a record with + the new value counts. Verifying a domain the account already verified returns `200`. @@ -268,13 +274,15 @@ async def asyncio( Publish a TXT record named `_volcano.`, then send this request. Without the record, the response is `409` with `code: ownership_verification_required` and the `required_record` to - publish. Its value is the same on every request. The record must be - served at that name itself; a record reached through a CNAME does not - count. + publish. Its value stays the same until Volcano rotates the key it is + derived from. The record must be served at that name itself; a record + reached through a CNAME does not count. When another account verified the domain, publishing your record moves the domain to your account once that account's record is no longer - published. Keep your record published so the domain stays yours. + published. Keep your record published so the domain stays yours. After + Volcano rotates the key the value is derived from, only a record with + the new value counts. Verifying a domain the account already verified returns `200`. diff --git a/src/volcano_sdk/_generated/models/__init__.py b/src/volcano_sdk/_generated/models/__init__.py index cfd528b8..15421c77 100644 --- a/src/volcano_sdk/_generated/models/__init__.py +++ b/src/volcano_sdk/_generated/models/__init__.py @@ -90,6 +90,10 @@ from .auth_user_app_metadata import AuthUserAppMetadata from .auth_user_status import AuthUserStatus from .auth_user_user_metadata import AuthUserUserMetadata +from .autofix_model import AutofixModel +from .autofix_provider import AutofixProvider +from .autofix_settings import AutofixSettings +from .autofix_stage import AutofixStage from .ban_auth_user_body import BanAuthUserBody from .ban_user_response import BanUserResponse from .ban_user_response_status import BanUserResponseStatus @@ -111,6 +115,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 +159,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 @@ -236,6 +244,7 @@ from .frontend_custom_domain_conflict_error import FrontendCustomDomainConflictError from .frontend_custom_domain_response import FrontendCustomDomainResponse from .frontend_custom_domain_response_domain_status import FrontendCustomDomainResponseDomainStatus +from .frontend_custom_domain_response_serving_certificate import FrontendCustomDomainResponseServingCertificate from .frontend_custom_domain_response_tls_mode import FrontendCustomDomainResponseTlsMode from .frontend_custom_domain_response_verification_status import FrontendCustomDomainResponseVerificationStatus from .frontend_custom_domain_status import FrontendCustomDomainStatus @@ -309,6 +318,8 @@ from .import_provider import ImportProvider from .import_source import ImportSource from .import_sources_response import ImportSourcesResponse +from .issue import Issue +from .issue_status import IssueStatus from .list_anon_keys_response_200 import ListAnonKeysResponse200 from .list_auth_users_status import ListAuthUsersStatus from .list_available_o_auth_providers_response_200 import ListAvailableOAuthProvidersResponse200 @@ -369,6 +380,7 @@ from .paginated_frontends import PaginatedFrontends from .paginated_function_deployments import PaginatedFunctionDeployments from .paginated_functions import PaginatedFunctions +from .paginated_issues import PaginatedIssues from .paginated_project_access_tokens import PaginatedProjectAccessTokens from .paginated_project_custom_domains import PaginatedProjectCustomDomains from .paginated_project_deployments import PaginatedProjectDeployments @@ -411,6 +423,7 @@ from .project_config_auth_signup import ProjectConfigAuthSignup from .project_config_auth_signup_allowed_email_domains_mode import ProjectConfigAuthSignupAllowedEmailDomainsMode from .project_config_auth_tokens import ProjectConfigAuthTokens +from .project_config_autofix import ProjectConfigAutofix from .project_config_bucket import ProjectConfigBucket from .project_config_bucket_policy import ProjectConfigBucketPolicy from .project_config_bucket_policy_operation import ProjectConfigBucketPolicyOperation @@ -519,6 +532,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 @@ -581,6 +595,7 @@ from .update_auth_hosted_page_request import UpdateAuthHostedPageRequest from .update_auth_page_layout_request import UpdateAuthPageLayoutRequest from .update_auth_page_theme_request import UpdateAuthPageThemeRequest +from .update_autofix_settings_request import UpdateAutofixSettingsRequest from .update_database_branch_request import UpdateDatabaseBranchRequest from .update_database_type_request import UpdateDatabaseTypeRequest from .update_database_type_request_database_type import UpdateDatabaseTypeRequestDatabaseType @@ -590,6 +605,7 @@ from .update_function_request_openapi_spec_type_0 import UpdateFunctionRequestOpenapiSpecType0 from .update_function_scheduler_request import UpdateFunctionSchedulerRequest from .update_function_scheduler_request_payload import UpdateFunctionSchedulerRequestPayload +from .update_issue_request import UpdateIssueRequest from .update_o_auth_config_provider import UpdateOAuthConfigProvider from .update_o_auth_config_request import UpdateOAuthConfigRequest from .update_project_git_deploy_settings_request import UpdateProjectGitDeploySettingsRequest @@ -607,6 +623,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 @@ -703,6 +721,10 @@ "AuthUserAppMetadata", "AuthUserStatus", "AuthUserUserMetadata", + "AutofixModel", + "AutofixProvider", + "AutofixSettings", + "AutofixStage", "BanAuthUserBody", "BanUserResponse", "BanUserResponseStatus", @@ -724,6 +746,9 @@ "CallOAuthProviderApiProvider", "CallOAuthProviderApiResponse200", "CallOAuthProviderApiResponse200Provider", + "Capability", + "CapabilityList", + "CapabilityStatus", "CompleteUploadSessionResponse", "ConfigureAuthMethodsBody", "ConfigureAuthMethodsBodyOauthProvidersItem", @@ -766,6 +791,7 @@ "CreateStoragePolicyRequestOperation", "CreateUploadSessionRequest", "CreateUploadSessionResponse", + "CreateVariableEnvironmentRequest", "CreateVariableRequest", "Database", "DatabaseBackup", @@ -849,6 +875,7 @@ "FrontendCustomDomainConflictError", "FrontendCustomDomainResponse", "FrontendCustomDomainResponseDomainStatus", + "FrontendCustomDomainResponseServingCertificate", "FrontendCustomDomainResponseTlsMode", "FrontendCustomDomainResponseVerificationStatus", "FrontendCustomDomainStatus", @@ -922,6 +949,8 @@ "ImportProvider", "ImportSource", "ImportSourcesResponse", + "Issue", + "IssueStatus", "ListAnonKeysResponse200", "ListAuthUsersStatus", "ListAvailableOAuthProvidersResponse200", @@ -982,6 +1011,7 @@ "PaginatedFrontends", "PaginatedFunctionDeployments", "PaginatedFunctions", + "PaginatedIssues", "PaginatedProjectAccessTokens", "PaginatedProjectCustomDomains", "PaginatedProjectDeployments", @@ -1024,6 +1054,7 @@ "ProjectConfigAuthSignup", "ProjectConfigAuthSignupAllowedEmailDomainsMode", "ProjectConfigAuthTokens", + "ProjectConfigAutofix", "ProjectConfigBucket", "ProjectConfigBucketPolicy", "ProjectConfigBucketPolicyOperation", @@ -1132,6 +1163,7 @@ "RealtimeStats", "RefreshOAuthProviderTokenProvider", "RefreshOAuthProviderTokenResponse200", + "RenameVariableEnvironmentRequest", "RenderDefaultManagedAuthPageAction", "ReplaceFrontendSharedVariablesBody", "ReplaceSharedVariablesBody", @@ -1194,6 +1226,7 @@ "UpdateAuthHostedPageRequest", "UpdateAuthPageLayoutRequest", "UpdateAuthPageThemeRequest", + "UpdateAutofixSettingsRequest", "UpdateDatabaseBranchRequest", "UpdateDatabaseTypeRequest", "UpdateDatabaseTypeRequestDatabaseType", @@ -1203,6 +1236,7 @@ "UpdateFunctionRequestOpenapiSpecType0", "UpdateFunctionSchedulerRequest", "UpdateFunctionSchedulerRequestPayload", + "UpdateIssueRequest", "UpdateOAuthConfigProvider", "UpdateOAuthConfigRequest", "UpdateProjectGitDeploySettingsRequest", @@ -1220,6 +1254,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/auth_insights_series_point.py b/src/volcano_sdk/_generated/models/auth_insights_series_point.py index 2a4f47b6..a5f10a4a 100644 --- a/src/volcano_sdk/_generated/models/auth_insights_series_point.py +++ b/src/volcano_sdk/_generated/models/auth_insights_series_point.py @@ -28,14 +28,25 @@ class AuthInsightsSeriesPoint: signups (int): Registrations during the bucket. Subsequent deletion does not subtract from this count. Historical counts removed before deletion-history collection cannot be reconstructed. signins (int): Successful session creations during the bucket. + banned_users (int): Users registered in this bucket who are currently banned. Excludes deleted users, lifted + bans, expired temporary bans, and internal test identities. + deleted_users (int): Users registered in this bucket who are now deleted, counted once across soft and hard + deletion. Grouped by signup date, not deletion date. + available_users (int): Currently available users registered in this bucket (signups minus banned_users minus + deleted_users). Unban or expiry restores availability in the original signup bucket. This measures account + availability, not return activity. deletions (int): Accounts deleted during this bucket, counted once across soft and hard deletion. - net_growth (int): Registrations minus deletions during this bucket. May be negative. + net_growth (int): Registrations minus deletions during this bucket. May be negative. Bans do not affect this + value. is_partial (bool): Whether the requested window or observation time clips this bucket. """ bucket_start: datetime.date signups: int signins: int + banned_users: int + deleted_users: int + available_users: int deletions: int net_growth: int is_partial: bool @@ -51,6 +62,12 @@ def to_dict(self) -> dict[str, Any]: signins = self.signins + banned_users = self.banned_users + + deleted_users = self.deleted_users + + available_users = self.available_users + deletions = self.deletions net_growth = self.net_growth @@ -64,6 +81,9 @@ def to_dict(self) -> dict[str, Any]: "bucket_start": bucket_start, "signups": signups, "signins": signins, + "banned_users": banned_users, + "deleted_users": deleted_users, + "available_users": available_users, "deletions": deletions, "net_growth": net_growth, "is_partial": is_partial, @@ -85,6 +105,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: signins = d.pop("signins") + banned_users = d.pop("banned_users") + + deleted_users = d.pop("deleted_users") + + available_users = d.pop("available_users") + deletions = d.pop("deletions") net_growth = d.pop("net_growth") @@ -95,6 +121,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: bucket_start=bucket_start, signups=signups, signins=signins, + banned_users=banned_users, + deleted_users=deleted_users, + available_users=available_users, deletions=deletions, net_growth=net_growth, is_partial=is_partial, diff --git a/src/volcano_sdk/_generated/models/autofix_model.py b/src/volcano_sdk/_generated/models/autofix_model.py new file mode 100644 index 00000000..55871e52 --- /dev/null +++ b/src/volcano_sdk/_generated/models/autofix_model.py @@ -0,0 +1,10 @@ +from typing import Literal + +AutofixModel = Literal['claude-fable-5-1', 'claude-haiku-4-5', 'claude-haiku-5-5', 'claude-opus-5', 'claude-opus-5-5', 'claude-sonnet-5', 'claude-sonnet-5-5'] + +AUTOFIX_MODEL_VALUES: set[AutofixModel] = { 'claude-fable-5-1', 'claude-haiku-4-5', 'claude-haiku-5-5', 'claude-opus-5', 'claude-opus-5-5', 'claude-sonnet-5', 'claude-sonnet-5-5', } + +def check_autofix_model(value: str) -> AutofixModel: + if value in AUTOFIX_MODEL_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {AUTOFIX_MODEL_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/autofix_provider.py b/src/volcano_sdk/_generated/models/autofix_provider.py new file mode 100644 index 00000000..a9c25ca7 --- /dev/null +++ b/src/volcano_sdk/_generated/models/autofix_provider.py @@ -0,0 +1,10 @@ +from typing import Literal + +AutofixProvider = Literal['anthropic', 'volcano'] + +AUTOFIX_PROVIDER_VALUES: set[AutofixProvider] = { 'anthropic', 'volcano', } + +def check_autofix_provider(value: str) -> AutofixProvider: + if value in AUTOFIX_PROVIDER_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {AUTOFIX_PROVIDER_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/autofix_settings.py b/src/volcano_sdk/_generated/models/autofix_settings.py new file mode 100644 index 00000000..99ff6fbc --- /dev/null +++ b/src/volcano_sdk/_generated/models/autofix_settings.py @@ -0,0 +1,190 @@ +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.autofix_model import AutofixModel +from ..models.autofix_model import check_autofix_model +from ..models.autofix_provider import AutofixProvider +from ..models.autofix_provider import check_autofix_provider +from ..models.autofix_stage import AutofixStage +from ..models.autofix_stage import check_autofix_stage +from ..types import UNSET, Unset +from typing import cast +from uuid import UUID +import datetime + + + + + + +T = TypeVar("T", bound="AutofixSettings") + + + +@_attrs_define +class AutofixSettings: + """ + Attributes: + project_id (UUID): + enabled (bool): Whether Volcano diagnoses the project's issues with AI. + max_stage (AutofixStage): How far a run may go. `diagnose` stops at a root-cause diagnosis. `pull_request` may + also open a draft pull request with a fix in the project's connected repository. + auto_trigger (bool): Whether a new or reopened issue starts a run on its own. When false, runs start only on + request. + provider (AutofixProvider): Who serves the model. `volcano` runs on Volcano's models. `anthropic` runs on your + own Anthropic API key. + model (AutofixModel): The Claude model a run uses. `claude-opus-5-5` is the default. + api_key_configured (bool): Whether your own API key is stored. The key itself is never returned. + api_key_provider (AutofixProvider | Unset): Who serves the model. `volcano` runs on Volcano's models. + `anthropic` runs on your own Anthropic API key. + api_key_last4 (str | Unset): The stored key's last four characters, present when one is stored. + plan_includes_autofix (bool | Unset): Whether the owner's plan includes autofix. When false, saved settings stay + stored and no run starts. Absent when a save that needed no plan succeeded but the plan could not be resolved. + updated_at (datetime.datetime | Unset): When the settings were last saved. Absent until the first save. + """ + + project_id: UUID + enabled: bool + max_stage: AutofixStage + auto_trigger: bool + provider: AutofixProvider + model: AutofixModel + api_key_configured: bool + api_key_provider: AutofixProvider | Unset = UNSET + api_key_last4: str | Unset = UNSET + plan_includes_autofix: bool | Unset = UNSET + updated_at: datetime.datetime | Unset = UNSET + + + + + + def to_dict(self) -> dict[str, Any]: + project_id = str(self.project_id) + + enabled = self.enabled + + max_stage: str = self.max_stage + + auto_trigger = self.auto_trigger + + provider: str = self.provider + + model: str = self.model + + api_key_configured = self.api_key_configured + + api_key_provider: str | Unset = UNSET + if not isinstance(self.api_key_provider, Unset): + api_key_provider = self.api_key_provider + + + api_key_last4 = self.api_key_last4 + + plan_includes_autofix = self.plan_includes_autofix + + 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({ + "project_id": project_id, + "enabled": enabled, + "max_stage": max_stage, + "auto_trigger": auto_trigger, + "provider": provider, + "model": model, + "api_key_configured": api_key_configured, + }) + if api_key_provider is not UNSET: + field_dict["api_key_provider"] = api_key_provider + if api_key_last4 is not UNSET: + field_dict["api_key_last4"] = api_key_last4 + if plan_includes_autofix is not UNSET: + field_dict["plan_includes_autofix"] = plan_includes_autofix + if updated_at is not UNSET: + field_dict["updated_at"] = updated_at + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + project_id = UUID(d.pop("project_id")) + + + + + enabled = d.pop("enabled") + + max_stage = check_autofix_stage(d.pop("max_stage")) + + + + + auto_trigger = d.pop("auto_trigger") + + provider = check_autofix_provider(d.pop("provider")) + + + + + model = check_autofix_model(d.pop("model")) + + + + + api_key_configured = d.pop("api_key_configured") + + _api_key_provider = d.pop("api_key_provider", UNSET) + api_key_provider: AutofixProvider | Unset + if isinstance(_api_key_provider, Unset): + api_key_provider = UNSET + else: + api_key_provider = check_autofix_provider(_api_key_provider) + + + + + api_key_last4 = d.pop("api_key_last4", UNSET) + + plan_includes_autofix = d.pop("plan_includes_autofix", UNSET) + + _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) + + + + + autofix_settings = cls( + project_id=project_id, + enabled=enabled, + max_stage=max_stage, + auto_trigger=auto_trigger, + provider=provider, + model=model, + api_key_configured=api_key_configured, + api_key_provider=api_key_provider, + api_key_last4=api_key_last4, + plan_includes_autofix=plan_includes_autofix, + updated_at=updated_at, + ) + + return autofix_settings + diff --git a/src/volcano_sdk/_generated/models/autofix_stage.py b/src/volcano_sdk/_generated/models/autofix_stage.py new file mode 100644 index 00000000..feec56e0 --- /dev/null +++ b/src/volcano_sdk/_generated/models/autofix_stage.py @@ -0,0 +1,10 @@ +from typing import Literal + +AutofixStage = Literal['diagnose', 'pull_request'] + +AUTOFIX_STAGE_VALUES: set[AutofixStage] = { 'diagnose', 'pull_request', } + +def check_autofix_stage(value: str) -> AutofixStage: + if value in AUTOFIX_STAGE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {AUTOFIX_STAGE_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/capability.py b/src/volcano_sdk/_generated/models/capability.py new file mode 100644 index 00000000..da1a7a9d --- /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`, `sandboxes.custom_templates`, + `issues`, or `autofix`. 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.py b/src/volcano_sdk/_generated/models/frontend.py index 40d2cdd3..dc40a193 100644 --- a/src/volcano_sdk/_generated/models/frontend.py +++ b/src/volcano_sdk/_generated/models/frontend.py @@ -66,6 +66,9 @@ class Frontend: site_url (str | Unset): custom_domain (str | Unset): Active custom domain hostname when configured custom_domain_status (FrontendCustomDomainStatus | Unset): Current custom domain lifecycle status + last_deployed_at (datetime.datetime | Unset): Recorded completion time of the most recent deploy or redeploy + with status active. Omitted when no such deployment has a recorded completion time. Site traffic, pending + deployments, degraded deployments, failed deployments, and deletion do not change this value. last_invoked_at (datetime.datetime | Unset): """ @@ -87,6 +90,7 @@ class Frontend: site_url: str | Unset = UNSET custom_domain: str | Unset = UNSET custom_domain_status: FrontendCustomDomainStatus | Unset = UNSET + last_deployed_at: datetime.datetime | Unset = UNSET last_invoked_at: datetime.datetime | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -155,6 +159,10 @@ def to_dict(self) -> dict[str, Any]: custom_domain_status = self.custom_domain_status + last_deployed_at: str | Unset = UNSET + if not isinstance(self.last_deployed_at, Unset): + last_deployed_at = self.last_deployed_at.isoformat() + last_invoked_at: str | Unset = UNSET if not isinstance(self.last_invoked_at, Unset): last_invoked_at = self.last_invoked_at.isoformat() @@ -191,6 +199,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["custom_domain"] = custom_domain if custom_domain_status is not UNSET: field_dict["custom_domain_status"] = custom_domain_status + if last_deployed_at is not UNSET: + field_dict["last_deployed_at"] = last_deployed_at if last_invoked_at is not UNSET: field_dict["last_invoked_at"] = last_invoked_at @@ -306,6 +316,16 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + _last_deployed_at = d.pop("last_deployed_at", UNSET) + last_deployed_at: datetime.datetime | Unset + if isinstance(_last_deployed_at, Unset): + last_deployed_at = UNSET + else: + last_deployed_at = datetime.datetime.fromisoformat(_last_deployed_at) + + + + _last_invoked_at = d.pop("last_invoked_at", UNSET) last_invoked_at: datetime.datetime | Unset if isinstance(_last_invoked_at, Unset): @@ -335,6 +355,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: site_url=site_url, custom_domain=custom_domain, custom_domain_status=custom_domain_status, + last_deployed_at=last_deployed_at, last_invoked_at=last_invoked_at, ) diff --git a/src/volcano_sdk/_generated/models/frontend_custom_domain_conflict_error.py b/src/volcano_sdk/_generated/models/frontend_custom_domain_conflict_error.py index ae8bd93a..48324ad0 100644 --- a/src/volcano_sdk/_generated/models/frontend_custom_domain_conflict_error.py +++ b/src/volcano_sdk/_generated/models/frontend_custom_domain_conflict_error.py @@ -26,7 +26,9 @@ class FrontendCustomDomainConflictError: """ Domain ownership conflict. With `code: ownership_verification_required`, the account has not proven it owns the domain: publish `required_record` in DNS and send the same request again. The retry succeeds once Volcano can see - the record. Other conflicts omit both fields. + the record. With `code: custom_domain_releasing`, a removed domain still holds the hostname or the frontend while + Volcano releases it: send the same request again after the response's `Retry-After` seconds. A release that will not + finish within a few minutes is a plain conflict. Other conflicts omit both fields. Attributes: error (str): 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..7a58f669 100644 --- a/src/volcano_sdk/_generated/models/frontend_custom_domain_response.py +++ b/src/volcano_sdk/_generated/models/frontend_custom_domain_response.py @@ -10,6 +10,8 @@ from ..models.frontend_custom_domain_response_domain_status import check_frontend_custom_domain_response_domain_status from ..models.frontend_custom_domain_response_domain_status import FrontendCustomDomainResponseDomainStatus +from ..models.frontend_custom_domain_response_serving_certificate import check_frontend_custom_domain_response_serving_certificate +from ..models.frontend_custom_domain_response_serving_certificate import FrontendCustomDomainResponseServingCertificate from ..models.frontend_custom_domain_response_tls_mode import check_frontend_custom_domain_response_tls_mode from ..models.frontend_custom_domain_response_tls_mode import FrontendCustomDomainResponseTlsMode from ..models.frontend_custom_domain_response_verification_status import check_frontend_custom_domain_response_verification_status @@ -44,10 +46,19 @@ class FrontendCustomDomainResponse: effective_urls (list[str]): created_at (datetime.datetime): updated_at (datetime.datetime): - 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): + serving_certificate (FrontendCustomDomainResponseServingCertificate | Unset): Certificate the domain serves, + present only while it is active. `uploaded`: the BYOC certificate, including after the domain switched to + managed TLS and until Volcano issues the managed one; `failure_reason` then reports an issuance failure. + `managed`: a certificate Volcano issued. + failure_reason (str | Unset): Failure category, present when managed TLS setup has failed, or when issuance is + failing for a domain that switched to managed TLS and still serves its uploaded certificate. 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): 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. @@ -60,6 +71,7 @@ class FrontendCustomDomainResponse: effective_urls: list[str] created_at: datetime.datetime updated_at: datetime.datetime + serving_certificate: FrontendCustomDomainResponseServingCertificate | Unset = UNSET failure_reason: str | Unset = UNSET verification_records: list[FrontendDomainVerificationRecord] | Unset = UNSET required_routing_record: FrontendDomainRoutingRecord | Unset = UNSET @@ -89,6 +101,11 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at.isoformat() + serving_certificate: str | Unset = UNSET + if not isinstance(self.serving_certificate, Unset): + serving_certificate = self.serving_certificate + + failure_reason = self.failure_reason verification_records: list[dict[str, Any]] | Unset = UNSET @@ -118,6 +135,8 @@ def to_dict(self) -> dict[str, Any]: "created_at": created_at, "updated_at": updated_at, }) + if serving_certificate is not UNSET: + field_dict["serving_certificate"] = serving_certificate if failure_reason is not UNSET: field_dict["failure_reason"] = failure_reason if verification_records is not UNSET: @@ -166,6 +185,16 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + _serving_certificate = d.pop("serving_certificate", UNSET) + serving_certificate: FrontendCustomDomainResponseServingCertificate | Unset + if isinstance(_serving_certificate, Unset): + serving_certificate = UNSET + else: + serving_certificate = check_frontend_custom_domain_response_serving_certificate(_serving_certificate) + + + + failure_reason = d.pop("failure_reason", UNSET) _verification_records = d.pop("verification_records", UNSET) @@ -200,6 +229,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: effective_urls=effective_urls, created_at=created_at, updated_at=updated_at, + serving_certificate=serving_certificate, failure_reason=failure_reason, verification_records=verification_records, required_routing_record=required_routing_record, diff --git a/src/volcano_sdk/_generated/models/frontend_custom_domain_response_serving_certificate.py b/src/volcano_sdk/_generated/models/frontend_custom_domain_response_serving_certificate.py new file mode 100644 index 00000000..a2298cbc --- /dev/null +++ b/src/volcano_sdk/_generated/models/frontend_custom_domain_response_serving_certificate.py @@ -0,0 +1,10 @@ +from typing import Literal + +FrontendCustomDomainResponseServingCertificate = Literal['managed', 'uploaded'] + +FRONTEND_CUSTOM_DOMAIN_RESPONSE_SERVING_CERTIFICATE_VALUES: set[FrontendCustomDomainResponseServingCertificate] = { 'managed', 'uploaded', } + +def check_frontend_custom_domain_response_serving_certificate(value: str) -> FrontendCustomDomainResponseServingCertificate: + if value in FRONTEND_CUSTOM_DOMAIN_RESPONSE_SERVING_CERTIFICATE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {FRONTEND_CUSTOM_DOMAIN_RESPONSE_SERVING_CERTIFICATE_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/issue.py b/src/volcano_sdk/_generated/models/issue.py new file mode 100644 index 00000000..18eddb2d --- /dev/null +++ b/src/volcano_sdk/_generated/models/issue.py @@ -0,0 +1,279 @@ +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.issue_status import check_issue_status +from ..models.issue_status import IssueStatus +from ..types import UNSET, Unset +from typing import cast +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.resource_reference import ResourceReference + + + + + +T = TypeVar("T", bound="Issue") + + + +@_attrs_define +class Issue: + """ Runtime errors from one function or frontend, grouped by error type and stack. + + Attributes: + id (UUID): + project_id (UUID): + resource (ResourceReference): Stable reference to a Volcano resource. + title (str): The error type and message, with values such as IDs, numbers, and + URLs replaced by placeholders like `` and ``. + status (IssueStatus): `open` until someone resolves or ignores the issue. A resolved issue + seen again reopens. + event_count (int): Errors counted in this issue. A retried delivery can count an error twice. + first_seen_at (datetime.datetime): + last_seen_at (datetime.datetime): + created_at (datetime.datetime): + updated_at (datetime.datetime): + error_type (str | Unset): The exception class, such as `TypeError`. Omitted when the error has none. + culprit (str | Unset): The innermost frame of your code in the stack, as `function (file)`. Omitted without a + stack. + last_region (str | Unset): The region that served the latest error, such as `us-east-1`. + sample_event_id (str | Unset): The ID of the latest error's log event, while logs retain it. + sample_event_at (datetime.datetime | Unset): When the latest error's log event was written. + resolved_at (datetime.datetime | Unset): When the issue was resolved. Present only while it is resolved. + regressed_at (datetime.datetime | Unset): When a resolved issue was last seen again and reopened. + """ + + id: UUID + project_id: UUID + resource: ResourceReference + title: str + status: IssueStatus + event_count: int + first_seen_at: datetime.datetime + last_seen_at: datetime.datetime + created_at: datetime.datetime + updated_at: datetime.datetime + error_type: str | Unset = UNSET + culprit: str | Unset = UNSET + last_region: str | Unset = UNSET + sample_event_id: str | Unset = UNSET + sample_event_at: datetime.datetime | Unset = UNSET + resolved_at: datetime.datetime | Unset = UNSET + regressed_at: datetime.datetime | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.resource_reference import ResourceReference # noqa: PLC0415 + id = str(self.id) + + project_id = str(self.project_id) + + resource = self.resource.to_dict() + + title = self.title + + status: str = self.status + + event_count = self.event_count + + first_seen_at = self.first_seen_at.isoformat() + + last_seen_at = self.last_seen_at.isoformat() + + created_at = self.created_at.isoformat() + + updated_at = self.updated_at.isoformat() + + error_type = self.error_type + + culprit = self.culprit + + last_region = self.last_region + + sample_event_id = self.sample_event_id + + sample_event_at: str | Unset = UNSET + if not isinstance(self.sample_event_at, Unset): + sample_event_at = self.sample_event_at.isoformat() + + resolved_at: str | Unset = UNSET + if not isinstance(self.resolved_at, Unset): + resolved_at = self.resolved_at.isoformat() + + regressed_at: str | Unset = UNSET + if not isinstance(self.regressed_at, Unset): + regressed_at = self.regressed_at.isoformat() + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "id": id, + "project_id": project_id, + "resource": resource, + "title": title, + "status": status, + "event_count": event_count, + "first_seen_at": first_seen_at, + "last_seen_at": last_seen_at, + "created_at": created_at, + "updated_at": updated_at, + }) + if error_type is not UNSET: + field_dict["error_type"] = error_type + if culprit is not UNSET: + field_dict["culprit"] = culprit + if last_region is not UNSET: + field_dict["last_region"] = last_region + if sample_event_id is not UNSET: + field_dict["sample_event_id"] = sample_event_id + if sample_event_at is not UNSET: + field_dict["sample_event_at"] = sample_event_at + if resolved_at is not UNSET: + field_dict["resolved_at"] = resolved_at + if regressed_at is not UNSET: + field_dict["regressed_at"] = regressed_at + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.resource_reference import ResourceReference # noqa: PLC0415 + d = dict(src_dict) + id = UUID(d.pop("id")) + + + + + project_id = UUID(d.pop("project_id")) + + + + + resource = ResourceReference.from_dict(d.pop("resource")) + + + + + title = d.pop("title") + + status = check_issue_status(d.pop("status")) + + + + + event_count = d.pop("event_count") + + first_seen_at = datetime.datetime.fromisoformat(d.pop("first_seen_at")) + + + + + last_seen_at = datetime.datetime.fromisoformat(d.pop("last_seen_at")) + + + + + created_at = datetime.datetime.fromisoformat(d.pop("created_at")) + + + + + updated_at = datetime.datetime.fromisoformat(d.pop("updated_at")) + + + + + error_type = d.pop("error_type", UNSET) + + culprit = d.pop("culprit", UNSET) + + last_region = d.pop("last_region", UNSET) + + sample_event_id = d.pop("sample_event_id", UNSET) + + _sample_event_at = d.pop("sample_event_at", UNSET) + sample_event_at: datetime.datetime | Unset + if isinstance(_sample_event_at, Unset): + sample_event_at = UNSET + else: + sample_event_at = datetime.datetime.fromisoformat(_sample_event_at) + + + + + _resolved_at = d.pop("resolved_at", UNSET) + resolved_at: datetime.datetime | Unset + if isinstance(_resolved_at, Unset): + resolved_at = UNSET + else: + resolved_at = datetime.datetime.fromisoformat(_resolved_at) + + + + + _regressed_at = d.pop("regressed_at", UNSET) + regressed_at: datetime.datetime | Unset + if isinstance(_regressed_at, Unset): + regressed_at = UNSET + else: + regressed_at = datetime.datetime.fromisoformat(_regressed_at) + + + + + issue = cls( + id=id, + project_id=project_id, + resource=resource, + title=title, + status=status, + event_count=event_count, + first_seen_at=first_seen_at, + last_seen_at=last_seen_at, + created_at=created_at, + updated_at=updated_at, + error_type=error_type, + culprit=culprit, + last_region=last_region, + sample_event_id=sample_event_id, + sample_event_at=sample_event_at, + resolved_at=resolved_at, + regressed_at=regressed_at, + ) + + + issue.additional_properties = d + return issue + + @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/issue_status.py b/src/volcano_sdk/_generated/models/issue_status.py new file mode 100644 index 00000000..3c9b1963 --- /dev/null +++ b/src/volcano_sdk/_generated/models/issue_status.py @@ -0,0 +1,10 @@ +from typing import Literal + +IssueStatus = Literal['ignored', 'open', 'resolved'] + +ISSUE_STATUS_VALUES: set[IssueStatus] = { 'ignored', 'open', 'resolved', } + +def check_issue_status(value: str) -> IssueStatus: + if value in ISSUE_STATUS_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {ISSUE_STATUS_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/metric_usage_data.py b/src/volcano_sdk/_generated/models/metric_usage_data.py index 9f58ef12..e961121e 100644 --- a/src/volcano_sdk/_generated/models/metric_usage_data.py +++ b/src/volcano_sdk/_generated/models/metric_usage_data.py @@ -40,12 +40,19 @@ class MetricUsageData: at times the time it spent running, in megabyte-seconds; the allowance for it is published in gigabyte-seconds, which is 1024 of these. "Sandbox Running (MiB-Seconds)", "Sandbox Suspended (Seconds)", and - "Sandbox Uncertain (MiB-Seconds)" are preview-only usage; they do not - debit credits. Running reports configured memory times observed runtime, - not measured CPU or elastic memory consumption. Uncertain includes - observation gaps and unconfirmed state transitions. Suspended reports - duration, not snapshot size. Local sessions do not contribute. - Totals are rounded down after aggregating millisecond measurements. + "Sandbox Uncertain (MiB-Seconds)" report cloud Sandbox usage. Running + reports configured baseline memory times confirmed runtime, not measured + CPU or elastic memory consumption. For sessions admitted after the pricing + release, confirmed running time consumes the account's runtime allowance; + SUPERAGENT overage debits credits according to the account's pricing terms. + Suspended time and uncertain usage do not consume runtime allowance or + debit credits. Uncertain includes observation gaps and unconfirmed state + transitions. Suspended reports duration, not snapshot size; snapshot costs + are included in runtime pricing. Local and platform image-validation + sessions do not contribute. Existing preview sessions remain unbilled, + and preview history is never charged retroactively. Displayed totals are + rounded down after aggregating millisecond measurements; billing uses + unrounded measurements in the monthly account billing cycle. "Database Storage (Bytes)" is a current observed gauge, not a cumulative counter. It is the sum of the latest samples exposed as `storage_bytes` by the project's database list, so it includes what each diff --git a/src/volcano_sdk/_generated/models/paginated_issues.py b/src/volcano_sdk/_generated/models/paginated_issues.py new file mode 100644 index 00000000..533b9e55 --- /dev/null +++ b/src/volcano_sdk/_generated/models/paginated_issues.py @@ -0,0 +1,120 @@ +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 ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.issue import Issue + + + + + +T = TypeVar("T", bound="PaginatedIssues") + + + +@_attrs_define +class PaginatedIssues: + """ + Attributes: + data (list[Issue]): + limit (int): Number of items per page + has_more (bool): Whether a next page exists + next_cursor (str | Unset): Opaque cursor for the next page (present if has_more is true) + """ + + data: list[Issue] + limit: int + has_more: bool + next_cursor: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.issue import Issue # noqa: PLC0415 + data = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + + + limit = self.limit + + has_more = self.has_more + + next_cursor = self.next_cursor + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "data": data, + "limit": limit, + "has_more": has_more, + }) + if next_cursor is not UNSET: + field_dict["next_cursor"] = next_cursor + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.issue import Issue # noqa: PLC0415 + d = dict(src_dict) + data = [] + _data = d.pop("data") + for data_item_data in (_data): + data_item = Issue.from_dict(data_item_data) + + + + data.append(data_item) + + + limit = d.pop("limit") + + has_more = d.pop("has_more") + + next_cursor = d.pop("next_cursor", UNSET) + + paginated_issues = cls( + data=data, + limit=limit, + has_more=has_more, + next_cursor=next_cursor, + ) + + + paginated_issues.additional_properties = d + return paginated_issues + + @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/project_config.py b/src/volcano_sdk/_generated/models/project_config.py index 6f3b103d..ead8f893 100644 --- a/src/volcano_sdk/_generated/models/project_config.py +++ b/src/volcano_sdk/_generated/models/project_config.py @@ -15,6 +15,7 @@ if TYPE_CHECKING: from ..models.project_config_auth import ProjectConfigAuth + from ..models.project_config_autofix import ProjectConfigAutofix from ..models.project_config_bucket import ProjectConfigBucket from ..models.project_config_database import ProjectConfigDatabase from ..models.project_config_frontend import ProjectConfigFrontend @@ -58,6 +59,9 @@ class ProjectConfig: are deleted. buckets (list[ProjectConfigBucket] | Unset): realtime (ProjectConfigRealtime | Unset): + autofix (ProjectConfigAutofix | Unset): AI diagnosis and fix settings. Omitted fields keep their current value. + Your API key is never part of the manifest, and an apply never sets or deletes it: set it with `PUT + /projects/{id}/autofix` before turning on a provider that runs on your own key. auth (ProjectConfigAuth | Unset): Authentication settings, grouped like the dashboard auth-settings tabs. functions (list[ProjectConfigFunction] | Unset): frontends (list[ProjectConfigFrontend] | Unset): @@ -73,6 +77,7 @@ class ProjectConfig: variables: list[ProjectConfigVariable] | Unset = UNSET buckets: list[ProjectConfigBucket] | Unset = UNSET realtime: ProjectConfigRealtime | Unset = UNSET + autofix: ProjectConfigAutofix | Unset = UNSET auth: ProjectConfigAuth | Unset = UNSET functions: list[ProjectConfigFunction] | Unset = UNSET frontends: list[ProjectConfigFrontend] | Unset = UNSET @@ -84,6 +89,7 @@ class ProjectConfig: def to_dict(self) -> dict[str, Any]: from ..models.project_config_auth import ProjectConfigAuth # noqa: PLC0415 + from ..models.project_config_autofix import ProjectConfigAutofix # noqa: PLC0415 from ..models.project_config_bucket import ProjectConfigBucket # noqa: PLC0415 from ..models.project_config_database import ProjectConfigDatabase # noqa: PLC0415 from ..models.project_config_frontend import ProjectConfigFrontend # noqa: PLC0415 @@ -141,6 +147,10 @@ def to_dict(self) -> dict[str, Any]: if not isinstance(self.realtime, Unset): realtime = self.realtime.to_dict() + autofix: dict[str, Any] | Unset = UNSET + if not isinstance(self.autofix, Unset): + autofix = self.autofix.to_dict() + auth: dict[str, Any] | Unset = UNSET if not isinstance(self.auth, Unset): auth = self.auth.to_dict() @@ -192,6 +202,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["buckets"] = buckets if realtime is not UNSET: field_dict["realtime"] = realtime + if autofix is not UNSET: + field_dict["autofix"] = autofix if auth is not UNSET: field_dict["auth"] = auth if functions is not UNSET: @@ -208,6 +220,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.project_config_auth import ProjectConfigAuth # noqa: PLC0415 + from ..models.project_config_autofix import ProjectConfigAutofix # noqa: PLC0415 from ..models.project_config_bucket import ProjectConfigBucket # noqa: PLC0415 from ..models.project_config_database import ProjectConfigDatabase # noqa: PLC0415 from ..models.project_config_frontend import ProjectConfigFrontend # noqa: PLC0415 @@ -284,6 +297,16 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + _autofix = d.pop("autofix", UNSET) + autofix: ProjectConfigAutofix | Unset + if isinstance(_autofix, Unset): + autofix = UNSET + else: + autofix = ProjectConfigAutofix.from_dict(_autofix) + + + + _auth = d.pop("auth", UNSET) auth: ProjectConfigAuth | Unset if isinstance(_auth, Unset): @@ -339,6 +362,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: variables=variables, buckets=buckets, realtime=realtime, + autofix=autofix, auth=auth, functions=functions, frontends=frontends, diff --git a/src/volcano_sdk/_generated/models/project_config_autofix.py b/src/volcano_sdk/_generated/models/project_config_autofix.py new file mode 100644 index 00000000..9e5c4161 --- /dev/null +++ b/src/volcano_sdk/_generated/models/project_config_autofix.py @@ -0,0 +1,141 @@ +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.autofix_model import AutofixModel +from ..models.autofix_model import check_autofix_model +from ..models.autofix_provider import AutofixProvider +from ..models.autofix_provider import check_autofix_provider +from ..models.autofix_stage import AutofixStage +from ..models.autofix_stage import check_autofix_stage +from ..types import UNSET, Unset +from typing import cast + + + + + + +T = TypeVar("T", bound="ProjectConfigAutofix") + + + +@_attrs_define +class ProjectConfigAutofix: + """ AI diagnosis and fix settings. Omitted fields keep their current value. Your API key is never part of the manifest, + and an apply never sets or deletes it: set it with `PUT /projects/{id}/autofix` before turning on a provider that + runs on your own key. + + Attributes: + enabled (bool | Unset): + max_stage (AutofixStage | Unset): How far a run may go. `diagnose` stops at a root-cause diagnosis. + `pull_request` may also open a draft pull request with a fix in the project's connected repository. + auto_trigger (bool | Unset): + provider (AutofixProvider | Unset): Who serves the model. `volcano` runs on Volcano's models. `anthropic` runs + on your own Anthropic API key. + model (AutofixModel | Unset): The Claude model a run uses. `claude-opus-5-5` is the default. + """ + + enabled: bool | Unset = UNSET + max_stage: AutofixStage | Unset = UNSET + auto_trigger: bool | Unset = UNSET + provider: AutofixProvider | Unset = UNSET + model: AutofixModel | Unset = UNSET + + + + + + def to_dict(self) -> dict[str, Any]: + enabled = self.enabled + + max_stage: str | Unset = UNSET + if not isinstance(self.max_stage, Unset): + max_stage = self.max_stage + + + auto_trigger = self.auto_trigger + + provider: str | Unset = UNSET + if not isinstance(self.provider, Unset): + provider = self.provider + + + model: str | Unset = UNSET + if not isinstance(self.model, Unset): + model = self.model + + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + }) + if enabled is not UNSET: + field_dict["enabled"] = enabled + if max_stage is not UNSET: + field_dict["max_stage"] = max_stage + if auto_trigger is not UNSET: + field_dict["auto_trigger"] = auto_trigger + if provider is not UNSET: + field_dict["provider"] = provider + if model is not UNSET: + field_dict["model"] = model + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + enabled = d.pop("enabled", UNSET) + + _max_stage = d.pop("max_stage", UNSET) + max_stage: AutofixStage | Unset + if isinstance(_max_stage, Unset): + max_stage = UNSET + else: + max_stage = check_autofix_stage(_max_stage) + + + + + auto_trigger = d.pop("auto_trigger", UNSET) + + _provider = d.pop("provider", UNSET) + provider: AutofixProvider | Unset + if isinstance(_provider, Unset): + provider = UNSET + else: + provider = check_autofix_provider(_provider) + + + + + _model = d.pop("model", UNSET) + model: AutofixModel | Unset + if isinstance(_model, Unset): + model = UNSET + else: + model = check_autofix_model(_model) + + + + + project_config_autofix = cls( + enabled=enabled, + max_stage=max_stage, + auto_trigger=auto_trigger, + provider=provider, + model=model, + ) + + return project_config_autofix + diff --git a/src/volcano_sdk/_generated/models/project_config_custom_domain.py b/src/volcano_sdk/_generated/models/project_config_custom_domain.py index f74c5a75..6bf44f24 100644 --- a/src/volcano_sdk/_generated/models/project_config_custom_domain.py +++ b/src/volcano_sdk/_generated/models/project_config_custom_domain.py @@ -30,8 +30,9 @@ class ProjectConfigCustomDomain: domain, omitting `tls` or sending only `tls.mode` keeps the stored certificate; new BYOC material for the same domain rotates the certificate in place (zero downtime). Changing `tls.mode` for the same - hostname, or the hostname of a managed domain, requires deleting the - domain first. BYOC TLS material is write-only; exports render only + hostname switches an active domain in place (zero downtime); a domain + that is not yet active, or a managed domain changing hostname, must be + deleted first. BYOC TLS material is write-only; exports render only `tls.mode`. Attributes: diff --git a/src/volcano_sdk/_generated/models/project_config_frontend.py b/src/volcano_sdk/_generated/models/project_config_frontend.py index 1210709a..8664d9cf 100644 --- a/src/volcano_sdk/_generated/models/project_config_frontend.py +++ b/src/volcano_sdk/_generated/models/project_config_frontend.py @@ -43,8 +43,9 @@ class ProjectConfigFrontend: domain, omitting `tls` or sending only `tls.mode` keeps the stored certificate; new BYOC material for the same domain rotates the certificate in place (zero downtime). Changing `tls.mode` for the same - hostname, or the hostname of a managed domain, requires deleting the - domain first. BYOC TLS material is write-only; exports render only + hostname switches an active domain in place (zero downtime); a domain + that is not yet active, or a managed domain changing hostname, must be + deleted first. BYOC TLS material is write-only; exports render only `tls.mode`. function_routes (list[ProjectConfigFrontendFunctionRoute] | Unset): Complete set of same-origin Function path mappings when declared. Omission preserves existing mappings; an empty list deletes all mappings. diff --git a/src/volcano_sdk/_generated/models/project_config_sandbox.py b/src/volcano_sdk/_generated/models/project_config_sandbox.py index 23751cdd..6e96fd0f 100644 --- a/src/volcano_sdk/_generated/models/project_config_sandbox.py +++ b/src/volcano_sdk/_generated/models/project_config_sandbox.py @@ -30,14 +30,14 @@ 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 templates + accept 30–28800 seconds; inherited lifetimes are clamped to the session plan limit (3600 for HOBBY, 28800 for + SUPERAGENT). 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 +58,6 @@ def to_dict(self) -> dict[str, Any]: - idle_timeout_seconds = self.idle_timeout_seconds - ttl_seconds = self.ttl_seconds @@ -72,8 +70,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 +95,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..eeee1384 100644 --- a/src/volcano_sdk/_generated/models/project_frontend_custom_domain.py +++ b/src/volcano_sdk/_generated/models/project_frontend_custom_domain.py @@ -10,6 +10,8 @@ from ..models.frontend_custom_domain_response_domain_status import check_frontend_custom_domain_response_domain_status from ..models.frontend_custom_domain_response_domain_status import FrontendCustomDomainResponseDomainStatus +from ..models.frontend_custom_domain_response_serving_certificate import check_frontend_custom_domain_response_serving_certificate +from ..models.frontend_custom_domain_response_serving_certificate import FrontendCustomDomainResponseServingCertificate from ..models.frontend_custom_domain_response_tls_mode import check_frontend_custom_domain_response_tls_mode from ..models.frontend_custom_domain_response_tls_mode import FrontendCustomDomainResponseTlsMode from ..models.frontend_custom_domain_response_verification_status import check_frontend_custom_domain_response_verification_status @@ -47,10 +49,19 @@ class ProjectFrontendCustomDomain: updated_at (datetime.datetime): frontend (ProjectFrontendCustomDomainFrontend): The frontend this custom domain is attached to. Inlined to avoid a second fetch from the project-scoped feed. - 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): + serving_certificate (FrontendCustomDomainResponseServingCertificate | Unset): Certificate the domain serves, + present only while it is active. `uploaded`: the BYOC certificate, including after the domain switched to + managed TLS and until Volcano issues the managed one; `failure_reason` then reports an issuance failure. + `managed`: a certificate Volcano issued. + failure_reason (str | Unset): Failure category, present when managed TLS setup has failed, or when issuance is + failing for a domain that switched to managed TLS and still serves its uploaded certificate. 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): 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. @@ -64,6 +75,7 @@ class ProjectFrontendCustomDomain: created_at: datetime.datetime updated_at: datetime.datetime frontend: ProjectFrontendCustomDomainFrontend + serving_certificate: FrontendCustomDomainResponseServingCertificate | Unset = UNSET failure_reason: str | Unset = UNSET verification_records: list[FrontendDomainVerificationRecord] | Unset = UNSET required_routing_record: FrontendDomainRoutingRecord | Unset = UNSET @@ -96,6 +108,11 @@ def to_dict(self) -> dict[str, Any]: frontend = self.frontend.to_dict() + serving_certificate: str | Unset = UNSET + if not isinstance(self.serving_certificate, Unset): + serving_certificate = self.serving_certificate + + failure_reason = self.failure_reason verification_records: list[dict[str, Any]] | Unset = UNSET @@ -126,6 +143,8 @@ def to_dict(self) -> dict[str, Any]: "updated_at": updated_at, "frontend": frontend, }) + if serving_certificate is not UNSET: + field_dict["serving_certificate"] = serving_certificate if failure_reason is not UNSET: field_dict["failure_reason"] = failure_reason if verification_records is not UNSET: @@ -180,6 +199,16 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + _serving_certificate = d.pop("serving_certificate", UNSET) + serving_certificate: FrontendCustomDomainResponseServingCertificate | Unset + if isinstance(_serving_certificate, Unset): + serving_certificate = UNSET + else: + serving_certificate = check_frontend_custom_domain_response_serving_certificate(_serving_certificate) + + + + failure_reason = d.pop("failure_reason", UNSET) _verification_records = d.pop("verification_records", UNSET) @@ -215,6 +244,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: created_at=created_at, updated_at=updated_at, frontend=frontend, + serving_certificate=serving_certificate, failure_reason=failure_reason, verification_records=verification_records, required_routing_record=required_routing_record, 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/update_autofix_settings_request.py b/src/volcano_sdk/_generated/models/update_autofix_settings_request.py new file mode 100644 index 00000000..272b6b10 --- /dev/null +++ b/src/volcano_sdk/_generated/models/update_autofix_settings_request.py @@ -0,0 +1,147 @@ +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.autofix_model import AutofixModel +from ..models.autofix_model import check_autofix_model +from ..models.autofix_provider import AutofixProvider +from ..models.autofix_provider import check_autofix_provider +from ..models.autofix_stage import AutofixStage +from ..models.autofix_stage import check_autofix_stage +from ..types import UNSET, Unset +from typing import cast + + + + + + +T = TypeVar("T", bound="UpdateAutofixSettingsRequest") + + + +@_attrs_define +class UpdateAutofixSettingsRequest: + """ + Attributes: + enabled (bool): + max_stage (AutofixStage | Unset): How far a run may go. `diagnose` stops at a root-cause diagnosis. + `pull_request` may also open a draft pull request with a fix in the project's connected repository. + auto_trigger (bool | Unset): Default: False. + provider (AutofixProvider | Unset): Who serves the model. `volcano` runs on Volcano's models. `anthropic` runs + on your own Anthropic API key. + model (AutofixModel | Unset): The Claude model a run uses. `claude-opus-5-5` is the default. + api_key (str | Unset): Your own API key for `provider`, such as an Anthropic key for `anthropic`. Omit it to + keep the stored key. Encrypted at rest and never returned. + """ + + enabled: bool + max_stage: AutofixStage | Unset = UNSET + auto_trigger: bool | Unset = False + provider: AutofixProvider | Unset = UNSET + model: AutofixModel | Unset = UNSET + api_key: str | Unset = UNSET + + + + + + def to_dict(self) -> dict[str, Any]: + enabled = self.enabled + + max_stage: str | Unset = UNSET + if not isinstance(self.max_stage, Unset): + max_stage = self.max_stage + + + auto_trigger = self.auto_trigger + + provider: str | Unset = UNSET + if not isinstance(self.provider, Unset): + provider = self.provider + + + model: str | Unset = UNSET + if not isinstance(self.model, Unset): + model = self.model + + + api_key = self.api_key + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "enabled": enabled, + }) + if max_stage is not UNSET: + field_dict["max_stage"] = max_stage + if auto_trigger is not UNSET: + field_dict["auto_trigger"] = auto_trigger + if provider is not UNSET: + field_dict["provider"] = provider + if model is not UNSET: + field_dict["model"] = model + if api_key is not UNSET: + field_dict["api_key"] = api_key + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + enabled = d.pop("enabled") + + _max_stage = d.pop("max_stage", UNSET) + max_stage: AutofixStage | Unset + if isinstance(_max_stage, Unset): + max_stage = UNSET + else: + max_stage = check_autofix_stage(_max_stage) + + + + + auto_trigger = d.pop("auto_trigger", UNSET) + + _provider = d.pop("provider", UNSET) + provider: AutofixProvider | Unset + if isinstance(_provider, Unset): + provider = UNSET + else: + provider = check_autofix_provider(_provider) + + + + + _model = d.pop("model", UNSET) + model: AutofixModel | Unset + if isinstance(_model, Unset): + model = UNSET + else: + model = check_autofix_model(_model) + + + + + api_key = d.pop("api_key", UNSET) + + update_autofix_settings_request = cls( + enabled=enabled, + max_stage=max_stage, + auto_trigger=auto_trigger, + provider=provider, + model=model, + api_key=api_key, + ) + + return update_autofix_settings_request + diff --git a/src/volcano_sdk/_generated/models/update_issue_request.py b/src/volcano_sdk/_generated/models/update_issue_request.py new file mode 100644 index 00000000..4ac87a7c --- /dev/null +++ b/src/volcano_sdk/_generated/models/update_issue_request.py @@ -0,0 +1,65 @@ +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.issue_status import check_issue_status +from ..models.issue_status import IssueStatus +from typing import cast + + + + + + +T = TypeVar("T", bound="UpdateIssueRequest") + + + +@_attrs_define +class UpdateIssueRequest: + """ + Attributes: + status (IssueStatus): `open` until someone resolves or ignores the issue. A resolved issue + seen again reopens. + """ + + status: IssueStatus + + + + + + def to_dict(self) -> dict[str, Any]: + status: str = self.status + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "status": status, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + status = check_issue_status(d.pop("status")) + + + + + update_issue_request = cls( + status=status, + ) + + return update_issue_request + 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