From 6b6ea84c87a74b7d616633edc4e251adb69f1b04 Mon Sep 17 00:00:00 2001 From: "kong[bot]" <123129154+kong[bot]@users.noreply.github.com> Date: Fri, 16 Oct 2026 18:55:26 +0000 Subject: [PATCH] chore(api): sync OpenAPI contract --- openapi/openapi.yaml | 1812 +++++++++++++++-- .../authentication/auth_forgot_password.py | 40 + .../auth_get_password_policy.py | 52 +- .../api/authentication/auth_logout.py | 117 +- .../api/authentication/auth_refresh.py | 32 + .../api/authentication/auth_reset_password.py | 33 + .../api/authentication/auth_signin.py | 33 + .../api/authentication/auth_signup.py | 33 + .../authentication/auth_signup_anonymous.py | 60 +- .../_generated/api/autofix/get_autofix_run.py | 224 ++ .../api/autofix/list_autofix_runs.py | 294 +++ .../api/autofix/start_autofix_run.py | 291 +++ .../list_durable_message_waits.py | 226 ++ .../list_durable_messages.py | 322 +++ .../list_durable_messages_from_application.py | 359 ++++ .../open_durable_message_session.py | 272 +++ .../publish_durable_message.py | 298 +++ .../register_durable_message_wait.py | 272 +++ .../durable_functions/send_durable_message.py | 321 +++ .../send_durable_message_from_application.py | 394 ++++ .../api/frontends/create_frontend.py | 16 +- .../api/functions/invoke_function.py | 24 + .../auth_o_auth_exchange.py | 33 + .../api/projects/get_project_health.py | 12 +- .../storage_policies/delete_storage_policy.py | 86 +- src/volcano_sdk/_generated/models/__init__.py | 58 + .../_generated/models/autofix_diagnosis.py | 132 ++ .../models/autofix_diagnosis_confidence.py | 10 + .../_generated/models/autofix_edit.py | 75 + .../_generated/models/autofix_evidence.py | 82 + .../models/autofix_evidence_kind.py | 10 + .../_generated/models/autofix_patch.py | 86 + .../_generated/models/autofix_pull_request.py | 131 ++ .../models/autofix_pull_request_skipped.py | 10 + .../models/autofix_pull_request_state.py | 10 + .../_generated/models/autofix_run.py | 362 ++++ .../_generated/models/autofix_run_status.py | 10 + .../_generated/models/autofix_run_trigger.py | 10 + .../_generated/models/autofix_run_usage.py | 83 + .../models/create_service_key_body.py | 4 +- .../_generated/models/durable_execution.py | 11 + .../_generated/models/durable_message.py | 205 ++ .../models/durable_message_direction.py | 10 + .../_generated/models/durable_message_list.py | 103 + .../models/durable_message_sender.py | 100 + .../models/durable_message_sender_type.py | 10 + .../durable_message_session_registration.py | 82 + .../models/durable_message_status.py | 10 + .../_generated/models/durable_message_wait.py | 146 ++ .../models/durable_message_wait_list.py | 94 + .../durable_message_wait_registration.py | 127 ++ .../models/durable_message_wait_status.py | 10 + .../models/function_invocation_request.py | 3 + .../function_invocation_request_payload.py | 3 + .../open_durable_message_session_request.py | 66 + .../models/paginated_autofix_runs.py | 120 ++ .../_generated/models/project_health_check.py | 7 +- .../models/project_health_resource_type.py | 4 +- .../models/project_health_response.py | 7 +- .../models/project_health_status.py | 4 +- .../models/project_health_summary.py | 7 +- .../models/publish_durable_message_request.py | 69 + .../register_durable_message_wait_request.py | 75 + .../models/send_durable_message_request.py | 69 + 64 files changed, 7853 insertions(+), 218 deletions(-) create mode 100644 src/volcano_sdk/_generated/api/autofix/get_autofix_run.py create mode 100644 src/volcano_sdk/_generated/api/autofix/list_autofix_runs.py create mode 100644 src/volcano_sdk/_generated/api/autofix/start_autofix_run.py create mode 100644 src/volcano_sdk/_generated/api/durable_functions/list_durable_message_waits.py create mode 100644 src/volcano_sdk/_generated/api/durable_functions/list_durable_messages.py create mode 100644 src/volcano_sdk/_generated/api/durable_functions/list_durable_messages_from_application.py create mode 100644 src/volcano_sdk/_generated/api/durable_functions/open_durable_message_session.py create mode 100644 src/volcano_sdk/_generated/api/durable_functions/publish_durable_message.py create mode 100644 src/volcano_sdk/_generated/api/durable_functions/register_durable_message_wait.py create mode 100644 src/volcano_sdk/_generated/api/durable_functions/send_durable_message.py create mode 100644 src/volcano_sdk/_generated/api/durable_functions/send_durable_message_from_application.py create mode 100644 src/volcano_sdk/_generated/models/autofix_diagnosis.py create mode 100644 src/volcano_sdk/_generated/models/autofix_diagnosis_confidence.py create mode 100644 src/volcano_sdk/_generated/models/autofix_edit.py create mode 100644 src/volcano_sdk/_generated/models/autofix_evidence.py create mode 100644 src/volcano_sdk/_generated/models/autofix_evidence_kind.py create mode 100644 src/volcano_sdk/_generated/models/autofix_patch.py create mode 100644 src/volcano_sdk/_generated/models/autofix_pull_request.py create mode 100644 src/volcano_sdk/_generated/models/autofix_pull_request_skipped.py create mode 100644 src/volcano_sdk/_generated/models/autofix_pull_request_state.py create mode 100644 src/volcano_sdk/_generated/models/autofix_run.py create mode 100644 src/volcano_sdk/_generated/models/autofix_run_status.py create mode 100644 src/volcano_sdk/_generated/models/autofix_run_trigger.py create mode 100644 src/volcano_sdk/_generated/models/autofix_run_usage.py create mode 100644 src/volcano_sdk/_generated/models/durable_message.py create mode 100644 src/volcano_sdk/_generated/models/durable_message_direction.py create mode 100644 src/volcano_sdk/_generated/models/durable_message_list.py create mode 100644 src/volcano_sdk/_generated/models/durable_message_sender.py create mode 100644 src/volcano_sdk/_generated/models/durable_message_sender_type.py create mode 100644 src/volcano_sdk/_generated/models/durable_message_session_registration.py create mode 100644 src/volcano_sdk/_generated/models/durable_message_status.py create mode 100644 src/volcano_sdk/_generated/models/durable_message_wait.py create mode 100644 src/volcano_sdk/_generated/models/durable_message_wait_list.py create mode 100644 src/volcano_sdk/_generated/models/durable_message_wait_registration.py create mode 100644 src/volcano_sdk/_generated/models/durable_message_wait_status.py create mode 100644 src/volcano_sdk/_generated/models/open_durable_message_session_request.py create mode 100644 src/volcano_sdk/_generated/models/paginated_autofix_runs.py create mode 100644 src/volcano_sdk/_generated/models/publish_durable_message_request.py create mode 100644 src/volcano_sdk/_generated/models/register_durable_message_wait_request.py create mode 100644 src/volcano_sdk/_generated/models/send_durable_message_request.py diff --git a/openapi/openapi.yaml b/openapi/openapi.yaml index 31feffa2..85c5c25f 100644 --- a/openapi/openapi.yaml +++ b/openapi/openapi.yaml @@ -2252,7 +2252,8 @@ paths: Returns a fast control-plane health snapshot for the project and its deployed resources. The endpoint does not run live provider probes. A successful request returns 200 even when the project status is - `unhealthy`; transport and authorization failures use HTTP errors. + `degraded` or `critical`; transport and authorization failures use HTTP + errors. operationId: getProjectHealth security: - UserToken: [] @@ -4188,6 +4189,12 @@ paths: - Function must have `visibility: public` - Function receives payload only (no `__volcano_auth`) + **Reserved payload keys:** the top-level `__volcano_auth` and + `__volcano_http` keys are reserved. Volcano removes caller-supplied + values for both before the function runs; only an auth user token adds + a server-built `__volcano_auth`, and only HTTP-mode ingress sets + `__volcano_http: true`. + **Transport and CORS:** - This operation is the authenticated direct RPC endpoint and always uses the POST `{payload: ...}` contract, including for functions whose DNS ingress is @@ -4462,7 +4469,9 @@ paths: description: | Function is not deployed yet, or has no deployed region. Also returned when two starts under the same execution name raced and - both released it, which is retryable as it stands. + both released it, which is retryable as it stands, and with `code` + `execution_name_held` when an unfinished start this caller may not + resume holds the execution name, which needs a name of its own. content: application/json: schema: @@ -4496,6 +4505,205 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + /durable-functions/{functionId}/executions/{executionId}/messages: + post: + tags: + - Durable Functions + summary: Send a message to a durable execution from an application + description: | + Sends a named message to a running execution. The workflow receives it + from `ctx.waitForMessage` with the same name. A message sent before + anything waits for its name is kept, and each wait takes the oldest + one, so messages arrive in the order they were sent. + + Messages never decide an approval: a workflow waiting in + `ctx.waitForApproval` is not resumed by one. + + **With a service key:** any execution in the project. + + **With an auth user token:** an execution the user started, or one + whose `X-Volcano-Client-Token` the request carries, of a durable + function whose `visibility` is `authenticated` or `public`. + + **With an anon key:** an execution whose `X-Volcano-Client-Token` the + request carries, of a function with `visibility: public`. + + Any other execution answers `404`, as a missing one does. + + Send `Idempotency-Key` to make a retry safe: a repeat with a key the + same sender has used on the execution returns the first message with + `200` and sends nothing. + operationId: sendDurableMessageFromApplication + security: + - AnonKey: [] + - ServiceRoleKey: [] + - AuthUserAccessToken: [] + parameters: + - $ref: '#/components/parameters/DurableFunctionId' + - $ref: '#/components/parameters/DurableExecutionId' + - $ref: '#/components/parameters/DurableMessageIdempotencyKey' + - $ref: '#/components/parameters/DurableClientToken' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SendDurableMessageRequest' + responses: + '200': + description: A message with this `Idempotency-Key` was already sent; it is returned + content: + application/json: + schema: + $ref: '#/components/schemas/DurableMessage' + '201': + description: | + Message sent. `status` is `delivered` when a wait took it at once, + `delivering` when a wait took it and the handover is still being + confirmed, and `queued` when it is kept for the next wait. + content: + application/json: + schema: + $ref: '#/components/schemas/DurableMessage' + '400': + description: The name, data or idempotency key is invalid + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Missing or invalid credential + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: | + The anon key lacks `functions.invoke`, the service key is scoped + without it, or the function is `authenticated` and the request + carries an anon key. Also returned when the request's origin is + refused by the project's CORS policy. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: | + Durable function or execution not found, or the credential cannot + reach the execution. A `private` function answers every credential + but a service key this way. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '409': + description: | + The message cannot be sent. `code` says why: + + - `execution_not_running`: the execution has finished. + - `too_many_queued_messages`: the execution already holds the + maximum number of messages nothing has taken. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '413': + description: The request body is larger than 72 KiB + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + description: | + Too many messages sent to this execution, the function's or the + project's function rate limit, which sends share with invocations + and starts, or the project is over its bandwidth cap. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '503': + description: The plan terms for the request could not be read. Retry with backoff. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + get: + tags: + - Durable Functions + summary: List a durable execution's messages from an application + description: | + Lists the messages sent to and published by an execution, oldest + first. Pass the last `seq` you read as `after` to read only what came + next; that is how a client catches up after a live subscription + reconnects. + + Access follows the same rules as sending. + operationId: listDurableMessagesFromApplication + security: + - AnonKey: [] + - ServiceRoleKey: [] + - AuthUserAccessToken: [] + parameters: + - $ref: '#/components/parameters/DurableFunctionId' + - $ref: '#/components/parameters/DurableExecutionId' + - $ref: '#/components/parameters/DurableClientToken' + - $ref: '#/components/parameters/DurableMessageDirectionFilter' + - $ref: '#/components/parameters/DurableMessageNameFilter' + - $ref: '#/components/parameters/DurableMessageAfter' + - $ref: '#/components/parameters/DurableMessageLimit' + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/DurableMessageList' + '400': + description: A filter is invalid + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Missing or invalid credential + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: | + The anon key lacks `functions.invoke`, the service key is scoped + without it, or the function is `authenticated` and the request + carries an anon key. Also returned when the request's origin is + refused by the project's CORS policy. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: | + Durable function or execution not found, or the credential cannot + reach the execution. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + description: | + The function's or the project's function rate limit, which lists + share with invocations and starts, or the project is over its + bandwidth cap. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '503': + description: The plan terms for the request could not be read. Retry with backoff. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /functions/resolve: get: tags: @@ -5827,202 +6035,597 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - /durable-approvals: + /projects/{id}/durable-functions/{functionId}/executions/{executionId}/messages: post: tags: - Durable Functions - summary: Request an approval from inside a workflow + summary: Send a message to a durable execution description: | - Registers an approval request for a running durable execution. The - Volcano SDK calls this from `ctx.waitForApproval`; applications do not - call it directly. - - `execution_ref` and `callback_id` are opaque values the SDK reads from - the running workflow. Together they are the request's credential, so - the operation takes no other authentication. The approval belongs to - the project that owns the execution, and expires when the workflow's - own approval timeout does. + Sends a named message to a running execution, as + `POST /durable-functions/{functionId}/executions/{executionId}/messages` + does for an application. The workflow receives it from + `ctx.waitForMessage` with the same name; until then it is kept, and + waits take messages oldest first. - Retrying is safe: a request for an approval that is already registered - returns it with `200`. - operationId: requestDurableApproval - security: [] + Project access tokens can send messages, but read-only ones cannot. + A message never decides an approval. + operationId: sendDurableMessage + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/DurableFunctionId' + - $ref: '#/components/parameters/DurableExecutionId' + - $ref: '#/components/parameters/DurableMessageIdempotencyKey' requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/RequestDurableApprovalRequest' + $ref: '#/components/schemas/SendDurableMessageRequest' responses: '200': - description: The approval was already registered + description: A message with this `Idempotency-Key` was already sent; it is returned content: application/json: schema: - $ref: '#/components/schemas/DurableApprovalRegistration' + $ref: '#/components/schemas/DurableMessage' '201': - description: Approval registered + description: | + Message sent. `status` is `delivered`, `delivering`, or `queued`, + as on the application route. content: application/json: schema: - $ref: '#/components/schemas/DurableApprovalRegistration' + $ref: '#/components/schemas/DurableMessage' '400': - description: The request body is invalid + description: The name, data or idempotency key is invalid + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: The request used a `read_only` project access token content: application/json: schema: $ref: '#/components/schemas/Error' '404': - description: No running durable execution matches `execution_ref` + description: Durable function or execution not found content: application/json: schema: $ref: '#/components/schemas/Error' '409': description: | - The approval cannot be registered now. `code` says why: - - - `approval_not_ready`: the workflow has not finished opening the - approval yet. Retry with a short backoff; the SDK does. - - `approval_closed`: the workflow is no longer waiting on it. - - `execution_ended`: the execution has finished. - - `too_many_pending_approvals`: the execution already has the - maximum number of pending approvals. + The message cannot be sent. `code` is `execution_not_running` or + `too_many_queued_messages`. content: application/json: schema: $ref: '#/components/schemas/Error' '413': - description: The request body is larger than 64 KiB + description: The request body is larger than 72 KiB content: application/json: schema: $ref: '#/components/schemas/Error' '429': - description: Too many approval requests from this execution or address + description: Too many messages sent to this execution content: application/json: schema: $ref: '#/components/schemas/Error' - '503': - description: | - The approval could not be confirmed with the workflow right now. - Retry with backoff. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /projects/{id}/issues: get: tags: - - Issues - summary: List issues + - Durable Functions + summary: List a durable execution's messages 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. + Lists the messages sent to and published by an execution, oldest + first. Pass the last `seq` you read as `after` to read only what came + next. - Project access tokens can list issues, including read-only ones. - operationId: listIssues + Project access tokens can list messages, including read-only ones. + operationId: listDurableMessages 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 + - $ref: '#/components/parameters/DurableFunctionId' + - $ref: '#/components/parameters/DurableExecutionId' + - $ref: '#/components/parameters/DurableMessageDirectionFilter' + - $ref: '#/components/parameters/DurableMessageNameFilter' + - $ref: '#/components/parameters/DurableMessageAfter' + - $ref: '#/components/parameters/DurableMessageLimit' responses: '200': description: Successful response content: application/json: schema: - $ref: '#/components/schemas/PaginatedIssues' + $ref: '#/components/schemas/DurableMessageList' '400': - description: A filter or the cursor is invalid + description: A filter 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. + description: Durable function or execution not found content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/issues/{issueId}: + /projects/{id}/durable-functions/{functionId}/executions/{executionId}/message-waits: get: tags: - - Issues - summary: Get an issue + - Durable Functions + summary: List a durable execution's open message waits description: | - Returns one issue: the resource that raised it, how often and when it - was seen, and its status. + Lists the waits an execution has open in `ctx.waitForMessage`, oldest + first, so you can see which message names it is waiting for. - Project access tokens can read issues, including read-only ones. - operationId: getIssue + Project access tokens can list waits, including read-only ones. + operationId: listDurableMessageWaits security: - UserToken: [] - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/IssueId' + - $ref: '#/components/parameters/DurableFunctionId' + - $ref: '#/components/parameters/DurableExecutionId' responses: '200': description: Successful response content: application/json: schema: - $ref: '#/components/schemas/Issue' + $ref: '#/components/schemas/DurableMessageWaitList' '404': - description: Issue not found. Code `feature_unavailable` means issues are not available in this environment. + description: Durable function or execution not found content: application/json: schema: $ref: '#/components/schemas/Error' - patch: + /durable-messages/waits: + post: tags: - - Issues - summary: Update an issue + - Durable Functions + summary: Wait for a message from inside a workflow 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. + Registers a wait for a named message. The Volcano SDK calls this from + `ctx.waitForMessage`; applications do not call it directly. - 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' + `execution_ref` and `callback_id` are opaque values the SDK reads from + the running workflow. Together they are the request's credential, so + the operation takes no other authentication. When a message for the + name is already queued, the wait takes the oldest one at once. + + Retrying is safe: a request for a wait that is already registered + returns it with `200`. + operationId: registerDurableMessageWait + security: [] requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/UpdateIssueRequest' + $ref: '#/components/schemas/RegisterDurableMessageWaitRequest' responses: '200': - description: Updated + description: The wait was already registered content: application/json: schema: - $ref: '#/components/schemas/Issue' + $ref: '#/components/schemas/DurableMessageWaitRegistration' + '201': + description: Wait registered + content: + application/json: + schema: + $ref: '#/components/schemas/DurableMessageWaitRegistration' + '400': + description: The request body is invalid + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: No running durable execution matches `execution_ref` + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '409': + description: | + The wait cannot be registered now. `code` says why: + + - `callback_not_ready`: the workflow has not finished opening the + wait yet. Retry with a short backoff; the SDK does. + - `callback_closed`: the workflow is no longer waiting on it. + - `callback_taken`: the callback is already registered as an + approval or a messages session. + - `execution_ended`: the execution has finished. + - `too_many_message_waits`: the execution already has the maximum + number of open waits. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '413': + description: The request body is larger than 8 KiB + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + description: Too many requests from this execution + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '503': + description: | + The wait could not be confirmed with the workflow right now. Retry + with backoff. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /durable-messages/sessions: + post: + tags: + - Durable Functions + summary: Open a messages session from inside a workflow + description: | + Opens the session a workflow publishes messages with. The Volcano SDK + calls this once per workflow context, on its first `ctx.publish`; + applications do not call it directly. + + As for a wait, `execution_ref` and `callback_id` are the credential. + The session's token is delivered to the workflow itself and never + appears in a response. + + Retrying is safe: a request for a session that is already registered + returns it with `200`. + operationId: openDurableMessageSession + security: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/OpenDurableMessageSessionRequest' + responses: + '200': + description: The session was already registered + content: + application/json: + schema: + $ref: '#/components/schemas/DurableMessageSessionRegistration' + '201': + description: Session opened + content: + application/json: + schema: + $ref: '#/components/schemas/DurableMessageSessionRegistration' + '400': + description: The request body is invalid + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: No running durable execution matches `execution_ref` + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '409': + description: | + The session cannot be opened now. `code` is `callback_not_ready`, + `callback_closed`, `callback_taken` (the callback is already + registered as an approval or a message wait), `execution_ended`, + or `too_many_message_sessions`. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '413': + description: The request body is larger than 8 KiB + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + description: Too many requests from this execution + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '503': + description: | + The session could not be confirmed with the workflow right now. + Retry with backoff. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /durable-messages/publish: + post: + tags: + - Durable Functions + summary: Publish a message from inside a workflow + description: | + Publishes a named message from a running workflow. The Volcano SDK + calls this from `ctx.publish`; applications do not call it directly. + + The message is stored, listed with the execution's messages, and + delivered live to clients subscribed to the execution. Live delivery + counts against the project's Realtime messages. + + The SDK sends an `Idempotency-Key` that a rerun of the publishing step + repeats, so a step that runs again returns the first message with + `200` and stores nothing new. That message is delivered live again, + and counts again, because the first run may have stopped before + subscribers got it. The SDKs deliver it to a subscriber once. + operationId: publishDurableMessage + security: [] + parameters: + - name: X-Volcano-Durable-Session + in: header + required: true + description: The session token the workflow received when its session opened. + schema: + type: string + minLength: 1 + maxLength: 128 + - $ref: '#/components/parameters/DurableMessageIdempotencyKey' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PublishDurableMessageRequest' + responses: + '200': + description: A message with this `Idempotency-Key` was already published; it is returned + content: + application/json: + schema: + $ref: '#/components/schemas/DurableMessage' + '201': + description: Message published + content: + application/json: + schema: + $ref: '#/components/schemas/DurableMessage' + '400': + description: The session token header is missing, or the name, data or idempotency key is invalid + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: The session token is not valid + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '409': + description: | + The message cannot be published. `code` is + `execution_not_running` or `too_many_published_messages`. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '413': + description: The request body is larger than 72 KiB + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /durable-approvals: + post: + tags: + - Durable Functions + summary: Request an approval from inside a workflow + description: | + Registers an approval request for a running durable execution. The + Volcano SDK calls this from `ctx.waitForApproval`; applications do not + call it directly. + + `execution_ref` and `callback_id` are opaque values the SDK reads from + the running workflow. Together they are the request's credential, so + the operation takes no other authentication. The approval belongs to + the project that owns the execution, and expires when the workflow's + own approval timeout does. + + Retrying is safe: a request for an approval that is already registered + returns it with `200`. + operationId: requestDurableApproval + security: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/RequestDurableApprovalRequest' + responses: + '200': + description: The approval was already registered + content: + application/json: + schema: + $ref: '#/components/schemas/DurableApprovalRegistration' + '201': + description: Approval registered + content: + application/json: + schema: + $ref: '#/components/schemas/DurableApprovalRegistration' + '400': + description: The request body is invalid + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: No running durable execution matches `execution_ref` + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '409': + description: | + The approval cannot be registered now. `code` says why: + + - `approval_not_ready`: the workflow has not finished opening the + approval yet. Retry with a short backoff; the SDK does. + - `approval_closed`: the workflow is no longer waiting on it. + - `callback_taken`: the callback is already registered as a + message wait or a messages session. + - `execution_ended`: the execution has finished. + - `too_many_pending_approvals`: the execution already has the + maximum number of pending approvals. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '413': + description: The request body is larger than 64 KiB + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + description: Too many approval requests from this execution or address + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '503': + description: | + The approval could not be confirmed with the workflow right now. + Retry with backoff. + content: + 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: @@ -6154,47 +6757,214 @@ paths: 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: + '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}/issues/{issueId}/autofix-runs: + post: + tags: + - Autofix + summary: Diagnose an issue + description: | + Queues a run that diagnoses the issue with AI. The run reads the + issue's runtime logs and, when a push to the project's connected + repository built the deployment that was live when the issue was + last seen, its source at that commit. Poll the run until its status is + `succeeded`, `failed`, or `canceled`. + + Autofix must be on for the project. An issue has at most one queued or + running run, a project runs one at a time, and a project starts at most + 25 runs, manual and automatic, in any 24 hours. + + Project access tokens are refused. A run spends model tokens on the + project's provider, so a person starts it with a platform token or in + the dashboard. + operationId: startAutofixRun + security: + - UserToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/IssueId' + responses: + '202': + description: Queued + content: + application/json: + schema: + $ref: '#/components/schemas/AutofixRun' + '400': + description: Code `feature_unavailable` means the project's provider is `volcano` and 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. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Project or issue not found. Code `feature_unavailable` means autofix is not available in this environment. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '409': + description: Autofix is off for the project, or the issue already has a queued or running run. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + description: The project started its limit of runs in the last 24 hours. + 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' + /projects/{id}/autofix-runs: + get: + tags: + - Autofix + summary: List autofix runs + description: | + Lists the project's autofix runs, newest first. Runs stay readable after + autofix is turned off, and where autofix is not available. + + Project access tokens can list runs, including read-only ones. + operationId: listAutofixRuns + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/Limit' + - $ref: '#/components/parameters/IssueCursor' + - name: issue_id + in: query + required: false + description: Return only runs for this issue. + schema: + type: string + format: uuid + - name: status + in: query + required: false + description: Return only runs in this status. + schema: + $ref: '#/components/schemas/AutofixRunStatus' + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedAutofixRuns' + '400': + description: A filter or the cursor is invalid + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Project not found. + 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}/autofix-runs/{runId}: + get: tags: - Autofix - summary: Delete the API key + summary: Get an autofix run 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. + Returns one run: its status, the diagnosis once it succeeds, why it + failed or was canceled, and the model tokens it used. Runs stay readable + where autofix is not available. - Project access tokens are refused. - operationId: deleteAutofixAPIKey + Project access tokens can read runs, including read-only ones. + operationId: getAutofixRun security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/AutofixRunId' 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. + description: Successful response content: application/json: schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/schemas/AutofixRun' '404': - description: Project not found. Code `feature_unavailable` means autofix is not available in this environment and the project never saved settings. + description: Project or run not found. content: application/json: schema: @@ -6560,7 +7330,7 @@ paths: 22.x or 24.x. The Node.js runtime is inferred from `package.json` `engines.node`; if omitted, Volcano uses Node.js 22.x. The selected Node.js family must also satisfy the installed Next.js package's - `engines.node` constraint. Volcano tests Next 15.5.27 (`^18.18.0 || ^19.8.0 || >=20.0.0`) and Next 16.4.0 (`>=20.9.0`). + `engines.node` constraint. Volcano tests Next 15.5.28 (`^18.18.0 || ^19.8.0 || >=20.0.0`) and Next 16.4.2 (`>=20.9.0`). Source archive size is enforced by the API with `SOURCE_ARCHIVE_SIZE_LIMIT_MB`; the CLI does not apply its own source archive size limit. After the final container images are built, the publish build enforces `LAMBDA_TARGET_CONTAINER_SIZE_LIMIT_MB` before pushing. @@ -9814,6 +10584,9 @@ paths: operationId: authGetPasswordPolicy security: - AnonKey: [] + parameters: + - $ref: '#/components/parameters/AuthProxyAuthorization' + - $ref: '#/components/parameters/AuthProxyClientIP' responses: '200': description: Effective password policy @@ -9822,7 +10595,7 @@ paths: schema: $ref: '#/components/schemas/AuthPasswordPolicy' '401': - description: Invalid, missing, or revoked anon key + description: Invalid, missing, or revoked anon key; or invalid auth proxy metadata content: application/json: schema: @@ -9854,6 +10627,9 @@ paths: operationId: authSignup security: - AnonKey: [] + parameters: + - $ref: '#/components/parameters/AuthProxyAuthorization' + - $ref: '#/components/parameters/AuthProxyClientIP' requestBody: required: true content: @@ -9888,7 +10664,9 @@ paths: description: Invalid input (bad email/password format) '401': description: | - Unauthorized - Invalid, tampered, revoked, or wrong-project anon key + Unauthorized - Invalid, tampered, revoked, or wrong-project anon key. + Also returned for invalid, repeated, or under-scoped auth proxy metadata + (`invalid auth proxy metadata`). '403': description: | Forbidden - Signups disabled, anon key lacks signup permission, or the @@ -9920,6 +10698,9 @@ paths: operationId: authSignin security: - AnonKey: [] + parameters: + - $ref: '#/components/parameters/AuthProxyAuthorization' + - $ref: '#/components/parameters/AuthProxyClientIP' requestBody: required: true content: @@ -9950,7 +10731,7 @@ paths: '401': description: | Unauthorized - Invalid credentials, invalid/tampered/revoked anon key, - or account banned/deleted + or account banned/deleted; or invalid auth proxy metadata '403': description: | Forbidden - Anon key lacks signin permission, or the email domain is @@ -9976,6 +10757,9 @@ paths: operationId: authRefresh security: - AnonKey: [] + parameters: + - $ref: '#/components/parameters/AuthProxyAuthorization' + - $ref: '#/components/parameters/AuthProxyClientIP' requestBody: required: false content: @@ -9997,7 +10781,7 @@ paths: schema: $ref: '#/components/schemas/AuthTokenResponse' '401': - description: Invalid or expired refresh token + description: Invalid or expired refresh token; or invalid auth proxy metadata content: application/json: schema: @@ -10031,6 +10815,9 @@ paths: operationId: authLogout security: - AnonKey: [] + parameters: + - $ref: '#/components/parameters/AuthProxyAuthorization' + - $ref: '#/components/parameters/AuthProxyClientIP' requestBody: required: false content: @@ -10047,6 +10834,12 @@ paths: responses: '204': description: Logged out successfully + '401': + description: Missing, invalid, or revoked anon key; or invalid, repeated, or under-scoped auth proxy metadata + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /auth/forgot-password: post: tags: @@ -10059,6 +10852,9 @@ paths: operationId: authForgotPassword security: - AnonKey: [] + parameters: + - $ref: '#/components/parameters/AuthProxyAuthorization' + - $ref: '#/components/parameters/AuthProxyClientIP' requestBody: required: true content: @@ -10082,6 +10878,12 @@ paths: message: type: string example: If the email exists, a password reset link has been sent + '401': + description: Missing, invalid, or revoked anon key; or invalid, repeated, or under-scoped auth proxy metadata + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '403': description: Password reset is disabled for this project content: @@ -10105,6 +10907,9 @@ paths: operationId: authResetPassword security: - AnonKey: [] + parameters: + - $ref: '#/components/parameters/AuthProxyAuthorization' + - $ref: '#/components/parameters/AuthProxyClientIP' requestBody: required: true content: @@ -10136,7 +10941,7 @@ paths: '400': description: Password doesn't meet requirements '401': - description: Invalid or expired token + description: Invalid or expired token; or invalid auth proxy metadata '503': description: Compromised-password screening is temporarily unavailable content: @@ -10247,6 +11052,9 @@ paths: operationId: authSignupAnonymous security: - AnonKey: [] + parameters: + - $ref: '#/components/parameters/AuthProxyAuthorization' + - $ref: '#/components/parameters/AuthProxyClientIP' requestBody: description: Optional user metadata content: @@ -10268,6 +11076,12 @@ paths: application/json: schema: $ref: '#/components/schemas/AuthTokenResponse' + '401': + description: Missing, invalid, or revoked anon key; or invalid, repeated, or under-scoped auth proxy metadata + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '403': description: Anonymous signins disabled /auth/user/convert-anonymous: @@ -12702,6 +13516,9 @@ paths: operationId: authOAuthExchange security: - AnonKey: [] + parameters: + - $ref: '#/components/parameters/AuthProxyAuthorization' + - $ref: '#/components/parameters/AuthProxyClientIP' requestBody: required: true content: @@ -12727,7 +13544,7 @@ paths: '400': description: Invalid, expired, consumed, or redirect-mismatched code '401': - description: Missing or invalid project anon key + description: Missing or invalid project anon key; or invalid auth proxy metadata '403': description: | Email confirmation is now required, or the account's email domain is not @@ -13982,7 +14799,9 @@ paths: for backward compatibility. Provide an explicit list (e.g. ["functions.invoke", "locks.manage"]) to restrict the key; "*" grants everything. Scope enforcement applies to function invocation, - storage object operations, and project locks. + storage object operations, project locks, and server-side auth proxy + metadata (auth.signin, auth.signup, auth.refresh, auth.logout, + auth.password_reset). example: - functions.invoke - locks.manage @@ -14256,6 +15075,12 @@ paths: responses: '200': description: Policy deleted + '404': + description: Project, bucket, or policy not found. Also returned when the policy ID is malformed or belongs to another bucket. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /projects/{id}/storage/objects: get: tags: @@ -15577,6 +16402,32 @@ components: project access token cannot create, list, read, or revoke project access tokens. parameters: + AuthProxyAuthorization: + name: X-Volcano-Proxy-Authorization + in: header + required: false + description: | + Trusted server-side auth proxy credential in `Bearer SERVICE_KEY` + form. When supplied, `X-Volcano-Client-IP` is also required. The service + key must belong to the anon key's project and hold this operation's scope: + `auth.signup` for signup and anonymous signup, `auth.signin` for signin + and OAuth code exchange, `auth.refresh` for refresh, `auth.logout` for + logout, and `auth.password_reset` for forgot-password and reset-password. + The password policy accepts any service key for the project. Never expose + a service key to browser code. + schema: + type: string + AuthProxyClientIP: + name: X-Volcano-Client-IP + in: header + required: false + description: | + Original browser IPv4 or IPv6 address supplied by a trusted server-side + auth proxy. The proxy must derive this value from its platform-verified + request metadata, never from a browser-supplied header. Requires a valid + `X-Volcano-Proxy-Authorization` header. + schema: + type: string BackupName: name: backupName in: path @@ -15723,6 +16574,14 @@ components: description: | Opaque cursor from a previous response's `next_cursor`. Pages forward; keep the same filters while paging. + AutofixRunId: + name: runId + in: path + required: true + schema: + type: string + format: uuid + description: Autofix run ID DurableApprovalFunctionFilter: name: function in: query @@ -15735,6 +16594,64 @@ components: Only approvals requested by this durable function, given by id or by name. A name also matches approvals from a deleted function of that name. + DurableMessageIdempotencyKey: + name: Idempotency-Key + in: header + required: false + description: | + Makes a send safe to retry. A repeat with a key the same sender has + used on the execution returns the first message and sends nothing. + Keys of different senders never collide. Up to 255 printable ASCII + characters. + schema: + type: string + minLength: 1 + maxLength: 255 + pattern: ^[ -~]+$ + DurableClientToken: + name: X-Volcano-Client-Token + in: header + required: false + description: | + The `client_token` the execution's start returned. Lets an anon key, + or a user who did not start the execution, reach it. + schema: + type: string + maxLength: 128 + DurableMessageDirectionFilter: + name: direction + in: query + required: false + description: Return only messages travelling this way. + schema: + $ref: '#/components/schemas/DurableMessageDirection' + DurableMessageNameFilter: + name: name + in: query + required: false + description: Return only messages with this name. + schema: + $ref: '#/components/schemas/DurableMessageName' + DurableMessageAfter: + name: after + in: query + required: false + description: Return only messages whose `seq` is greater than this. + schema: + type: integer + format: int64 + minimum: 0 + default: 0 + DurableMessageLimit: + name: limit + in: query + required: false + description: Most messages to return. + schema: + type: integer + minimum: 1 + maximum: 500 + default: 100 Limit: name: limit in: query @@ -20382,6 +21299,12 @@ components: type: string format: date-time description: Present once the execution has reached a terminal status. + client_token: + type: string + description: | + Lets a browser read and send the execution's messages. Returned only + by the start whose input the execution runs, never by a repeat under + the same name or by a read. Send it as `X-Volcano-Client-Token`. required: - id - function_id @@ -20742,6 +21665,9 @@ components: } } ``` + + The top-level `__volcano_auth` and `__volcano_http` keys are reserved; + Volcano removes caller-supplied values for both. FunctionInvocationResponse: type: object description: Raw function response body returned by the invoked function. @@ -21659,7 +22585,203 @@ components: maxLength: 2000 description: A note for the workflow and the approval's history. additionalProperties: false - RequestDurableApprovalRequest: + RequestDurableApprovalRequest: + type: object + properties: + execution_ref: + type: string + minLength: 1 + maxLength: 2048 + description: Opaque reference to the running execution, supplied by the SDK. + callback_id: + type: string + minLength: 1 + maxLength: 1024 + description: Opaque approval reference, supplied by the SDK. + name: + type: string + minLength: 1 + maxLength: 255 + title: + type: string + minLength: 1 + maxLength: 200 + description: + 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. 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 + - name + - title + additionalProperties: false + PaginatedDurableApprovals: + type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/DurableApproval' + page: + type: integer + description: Current page number (1-indexed) + limit: + type: integer + description: Number of items per page + total: + type: integer + description: Total number of items across all pages + has_more: + type: boolean + description: Whether there are more pages available + required: + - data + - page + - limit + - total + - has_more + DurableMessageName: + type: string + minLength: 1 + maxLength: 237 + pattern: ^[ -~]+$ + description: | + The name a workflow waits on or publishes under: up to 237 printable + ASCII characters. + DurableMessageDirection: + type: string + enum: + - in + - out + x-enum-varnames: + - DurableMessageDirectionIn + - DurableMessageDirectionOut + description: | + `in` is a message sent to the execution. `out` is one the execution + published. + DurableMessage: + type: object + description: A message sent to, or published by, a durable execution. + properties: + id: + type: string + format: uuid + execution_id: + type: string + format: uuid + direction: + $ref: '#/components/schemas/DurableMessageDirection' + seq: + type: integer + format: int64 + description: | + Orders the execution's messages in both directions. It increases + with every message but can skip numbers. Pass the last one you read + as `after` to read what came next. + name: + type: string + data: + x-go-type: json.RawMessage + x-go-type-skip-optional-pointer: true + nullable: true + description: The JSON value sent or published, or null. + sender: + $ref: '#/components/schemas/DurableMessageSender' + status: + $ref: '#/components/schemas/DurableMessageStatus' + delivered_at: + type: string + format: date-time + nullable: true + description: When the execution received the message. Null until then, and for `out` messages. + sent_at: + type: string + format: date-time + required: + - id + - execution_id + - direction + - seq + - name + - data + - sender + - status + - delivered_at + - sent_at + DurableMessageList: + type: object + properties: + data: + type: array + description: Messages after `after`, oldest first. + items: + $ref: '#/components/schemas/DurableMessage' + has_more: + type: boolean + description: | + Whether more messages follow. Read them with `after` set to the + last message's `seq`. + required: + - data + - has_more + DurableMessageWait: + type: object + description: A wait an execution has open for a message. + properties: + id: + type: string + format: uuid + name: + type: string + status: + $ref: '#/components/schemas/DurableMessageWaitStatus' + expires_at: + type: string + format: date-time + nullable: true + description: When the wait times out. Null when the workflow set no timeout. + created_at: + type: string + format: date-time + required: + - id + - name + - status + - expires_at + - created_at + DurableMessageWaitList: + type: object + properties: + data: + type: array + description: Open waits, oldest first. + items: + $ref: '#/components/schemas/DurableMessageWait' + required: + - data + SendDurableMessageRequest: + type: object + properties: + name: + $ref: '#/components/schemas/DurableMessageName' + data: + x-go-type: json.RawMessage + x-go-type-skip-optional-pointer: true + nullable: true + description: Any JSON value, up to 64 KiB. Omitted means null. + required: + - name + additionalProperties: false + RegisterDurableMessageWaitRequest: type: object properties: execution_ref: @@ -21671,58 +22793,72 @@ components: type: string minLength: 1 maxLength: 1024 - description: Opaque approval reference, supplied by the SDK. + description: Opaque wait reference, supplied by the SDK. name: + $ref: '#/components/schemas/DurableMessageName' + required: + - execution_ref + - callback_id + - name + additionalProperties: false + DurableMessageWaitRegistration: + type: object + description: The registered wait, as the waiting workflow sees it. + properties: + id: type: string - minLength: 1 - maxLength: 255 - title: + format: uuid + status: + $ref: '#/components/schemas/DurableMessageWaitStatus' + expires_at: + type: string + format: date-time + nullable: true + required: + - id + - status + - expires_at + OpenDurableMessageSessionRequest: + type: object + properties: + execution_ref: type: string minLength: 1 - maxLength: 200 - description: + maxLength: 2048 + description: Opaque reference to the running execution, supplied by the SDK. + callback_id: 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. 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. + minLength: 1 + maxLength: 1024 + description: Opaque session reference, supplied by the SDK. required: - execution_ref - callback_id - - name - - title additionalProperties: false - PaginatedDurableApprovals: + DurableMessageSessionRegistration: + type: object + description: | + The registered session. Its token reaches the workflow through the + workflow itself, never in this response. + properties: + id: + type: string + format: uuid + required: + - id + PublishDurableMessageRequest: type: object properties: + name: + $ref: '#/components/schemas/DurableMessageName' data: - type: array - items: - $ref: '#/components/schemas/DurableApproval' - page: - type: integer - description: Current page number (1-indexed) - limit: - type: integer - description: Number of items per page - total: - type: integer - description: Total number of items across all pages - has_more: - type: boolean - description: Whether there are more pages available + x-go-type: json.RawMessage + x-go-type-skip-optional-pointer: true + nullable: true + description: Any JSON value, up to 64 KiB. Omitted means null. required: - - data - - page - - limit - - total - - has_more + - name + additionalProperties: false Issue: type: object description: Runtime errors from one function or frontend, grouped by error type and stack. @@ -21936,6 +23072,289 @@ components: 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 + AutofixRunStatus: + type: string + enum: + - queued + - running + - succeeded + - failed + - canceled + x-enum-varnames: + - AutofixRunStatusQueued + - AutofixRunStatusRunning + - AutofixRunStatusSucceeded + - AutofixRunStatusFailed + - AutofixRunStatusCanceled + description: Where a run is. `canceled` means the project's settings or plan stopped allowing the run before it finished; `failure_code` says which. + AutofixRunTrigger: + type: string + enum: + - manual + - new_issue + - regression + x-enum-varnames: + - AutofixRunTriggerManual + - AutofixRunTriggerNewIssue + - AutofixRunTriggerRegression + description: What started the run. `manual` is a request; `new_issue` and `regression` are automatic runs for an issue that appeared or reopened. + AutofixEvidence: + type: object + additionalProperties: false + properties: + kind: + type: string + enum: + - log + - code + - other + x-enum-varnames: + - AutofixEvidenceKindLog + - AutofixEvidenceKindCode + - AutofixEvidenceKindOther + detail: + type: string + location: + type: string + description: A file and line, or a log timestamp. Absent when the evidence has none. + required: + - kind + - detail + AutofixDiagnosis: + type: object + additionalProperties: false + properties: + summary: + type: string + description: One or two sentences on what goes wrong. + root_cause: + type: string + evidence: + type: array + items: + $ref: '#/components/schemas/AutofixEvidence' + suggested_fix: + type: string + confidence: + type: string + enum: + - low + - medium + - high + x-enum-varnames: + - AutofixConfidenceLow + - AutofixConfidenceMedium + - AutofixConfidenceHigh + fixable: + type: boolean + description: Whether a change to the project's code would fix the issue. + files: + type: array + description: Repository paths a fix would change. + items: + type: string + required: + - summary + - root_cause + - evidence + - suggested_fix + - confidence + - fixable + - files + AutofixRunUsage: + type: object + additionalProperties: false + description: Model tokens the run used across every attempt. + properties: + input_tokens: + type: integer + format: int64 + output_tokens: + type: integer + format: int64 + cache_read_input_tokens: + type: integer + format: int64 + cache_creation_input_tokens: + type: integer + format: int64 + required: + - input_tokens + - output_tokens + - cache_read_input_tokens + - cache_creation_input_tokens + AutofixEdit: + type: object + additionalProperties: false + description: One exact text replacement. An empty `old_text` creates the file. + properties: + path: + type: string + old_text: + type: string + new_text: + type: string + required: + - path + - old_text + - new_text + AutofixPatch: + type: object + additionalProperties: false + description: The fix the model proposed, applied to the deployed commit. Present whenever the run opened a pull request, and when a valid fix could not be published. + properties: + title: + type: string + edits: + type: array + items: + $ref: '#/components/schemas/AutofixEdit' + required: + - title + - edits + AutofixPullRequestState: + type: string + enum: + - open + - merged + - closed + x-enum-varnames: + - AutofixPullRequestStateOpen + - AutofixPullRequestStateMerged + - AutofixPullRequestStateClosed + AutofixPullRequest: + type: object + additionalProperties: false + description: The draft pull request the run opened on the connected repository. + properties: + number: + type: integer + format: int64 + url: + type: string + format: uri + branch: + type: string + description: The branch the fix is on, `volcano/autofix/`. + state: + $ref: '#/components/schemas/AutofixPullRequestState' + closed_at: + type: string + format: date-time + description: When the pull request was merged or closed. + deployed_at: + type: string + format: date-time + description: When a deployment that includes the merged fix went live. The issue resolves then, unless it occurred again since. When more than 20 deployments went live after the merge before Volcano checked, it is the merge time instead. + required: + - number + - url + - branch + - state + AutofixPullRequestSkipped: + type: string + enum: + - source_unavailable + - pull_request_open + - not_fixable + - low_confidence + - no_patch + - permission_missing + - repository_changed + - publish_failed + x-enum-varnames: + - AutofixPullRequestSkippedSourceUnavailable + - AutofixPullRequestSkippedPullRequestOpen + - AutofixPullRequestSkippedNotFixable + - AutofixPullRequestSkippedLowConfidence + - AutofixPullRequestSkippedNoPatch + - AutofixPullRequestSkippedPermissionMissing + - AutofixPullRequestSkippedRepositoryChanged + - AutofixPullRequestSkippedPublishFailed + description: Why a run whose `max_stage` is `pull_request` opened no pull request. The diagnosis stands either way. + AutofixRun: + type: object + additionalProperties: false + properties: + id: + type: string + format: uuid + project_id: + type: string + format: uuid + issue_id: + type: string + format: uuid + trigger: + $ref: '#/components/schemas/AutofixRunTrigger' + status: + $ref: '#/components/schemas/AutofixRunStatus' + max_stage: + $ref: '#/components/schemas/AutofixStage' + stage_reached: + $ref: '#/components/schemas/AutofixStage' + provider: + $ref: '#/components/schemas/AutofixProvider' + model: + $ref: '#/components/schemas/AutofixModel' + diagnosis: + $ref: '#/components/schemas/AutofixDiagnosis' + patch: + $ref: '#/components/schemas/AutofixPatch' + pull_request: + $ref: '#/components/schemas/AutofixPullRequest' + pull_request_skipped: + $ref: '#/components/schemas/AutofixPullRequestSkipped' + commit_sha: + type: string + description: The commit the diagnosis read, when a push to the connected repository deployed the resource. Absent when the run read logs only. + failure_code: + type: string + description: Why the run failed or was canceled, or why its last attempt will be retried. One of `api_key_rejected`, `model_request_rejected`, `model_unavailable`, `model_refused`, `no_diagnosis`, `budget_exhausted`, `timed_out`, `attempts_exhausted`, `autofix_disabled`, `plan_required`, `managed_models_unavailable`, `settings_changed`, `issue_not_found`, or `internal_error`. + failure_message: + type: string + usage: + $ref: '#/components/schemas/AutofixRunUsage' + created_at: + type: string + format: date-time + started_at: + type: string + format: date-time + completed_at: + type: string + format: date-time + required: + - id + - project_id + - issue_id + - trigger + - status + - max_stage + - provider + - model + - usage + - created_at + PaginatedAutofixRuns: + type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/AutofixRun' + 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 PaginatedProjectCustomDomains: type: object properties: @@ -23118,6 +24537,7 @@ components: - function - frontend - database + - database_branch id: type: string format: uuid @@ -23206,8 +24626,11 @@ components: - findings ProjectHealthStatus: type: string + description: empty means no functions, frontends, databases, storage, Volcano Auth users, or Sandbox resources are listed. needs_attention means an operation needs review without confirmed service impairment, or a serving frontend whose edge recovery gave up needs a redeploy. degraded means a resource is only partly available or is unavailable for an expected, temporary reason, such as a frontend whose edge synchronization did not complete or a database being restored; critical means use is blocked. A failed workflow or deployment record alone does not establish an outage. Findings remain available for empty projects. enum: + - empty - healthy + - needs_attention - degraded - critical - unknown @@ -24885,6 +26308,42 @@ components: - elapsed_seconds - phases - updated_at + DurableMessageSender: + type: object + description: Who sent the message. + properties: + type: + type: string + enum: + - service_key + - user + - anon + - project + - execution + description: | + The credential the message was sent with. `project` is the + project's owner or one of its access tokens, and `execution` is the + execution itself publishing. + user_id: + type: string + nullable: true + description: The auth user who sent it. Null unless `type` is `user`. + required: + - type + - user_id + DurableMessageStatus: + type: string + enum: + - queued + - delivering + - delivered + - dropped + - published + description: | + An `in` message is `queued` until a wait for its name takes it, + `delivering` while it is handed over, and `delivered` once the + execution has it. It is `dropped` if the execution ended before any + wait took it. Every `out` message is `published`. LogDeploymentRequestSelector: type: object description: Deployment log selector for deployable resources. @@ -25015,6 +26474,19 @@ components: description: Deployment stage that produced the log event, when available. required: - id + DurableMessageWaitStatus: + type: string + enum: + - waiting + - matched + - delivered + - expired + - cancelled + description: | + `waiting` until a message for its name arrives, `matched` while that + message is handed over, then `delivered`. `expired` means the wait's + timeout passed first, and `cancelled` that the execution stopped + waiting. DurableApprovalFunction: type: object description: | diff --git a/src/volcano_sdk/_generated/api/authentication/auth_forgot_password.py b/src/volcano_sdk/_generated/api/authentication/auth_forgot_password.py index 8e99a5c9..570079cd 100644 --- a/src/volcano_sdk/_generated/api/authentication/auth_forgot_password.py +++ b/src/volcano_sdk/_generated/api/authentication/auth_forgot_password.py @@ -11,6 +11,7 @@ from ...models.auth_forgot_password_body import AuthForgotPasswordBody from ...models.auth_forgot_password_response_200 import AuthForgotPasswordResponse200 from ...models.error import Error +from ...types import UNSET, Unset from typing import cast @@ -18,9 +19,17 @@ def request_kwargs( *, body: AuthForgotPasswordBody, + x_volcano_proxy_authorization: str | Unset = UNSET, + x_volcano_client_ip: str | Unset = UNSET, ) -> dict[str, Any]: headers: dict[str, Any] = {} + if not isinstance(x_volcano_proxy_authorization, Unset): + headers["X-Volcano-Proxy-Authorization"] = x_volcano_proxy_authorization + + if not isinstance(x_volcano_client_ip, Unset): + headers["X-Volcano-Client-IP"] = x_volcano_client_ip + @@ -49,6 +58,13 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res 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()) @@ -82,6 +98,8 @@ def sync_detailed( *, client: AuthenticatedClient, body: AuthForgotPasswordBody, + x_volcano_proxy_authorization: str | Unset = UNSET, + x_volcano_client_ip: str | Unset = UNSET, ) -> Response[AuthForgotPasswordResponse200 | Error]: """ Request password reset @@ -91,6 +109,8 @@ def sync_detailed( Project is identified via the anon key. Args: + x_volcano_proxy_authorization (str | Unset): + x_volcano_client_ip (str | Unset): body (AuthForgotPasswordBody): Raises: @@ -104,6 +124,8 @@ def sync_detailed( kwargs = request_kwargs( body=body, +x_volcano_proxy_authorization=x_volcano_proxy_authorization, +x_volcano_client_ip=x_volcano_client_ip, ) @@ -117,6 +139,8 @@ def sync( *, client: AuthenticatedClient, body: AuthForgotPasswordBody, + x_volcano_proxy_authorization: str | Unset = UNSET, + x_volcano_client_ip: str | Unset = UNSET, ) -> AuthForgotPasswordResponse200 | Error | None: """ Request password reset @@ -126,6 +150,8 @@ def sync( Project is identified via the anon key. Args: + x_volcano_proxy_authorization (str | Unset): + x_volcano_client_ip (str | Unset): body (AuthForgotPasswordBody): Raises: @@ -140,6 +166,8 @@ def sync( return sync_detailed( client=client, body=body, +x_volcano_proxy_authorization=x_volcano_proxy_authorization, +x_volcano_client_ip=x_volcano_client_ip, ).parsed @@ -147,6 +175,8 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: AuthForgotPasswordBody, + x_volcano_proxy_authorization: str | Unset = UNSET, + x_volcano_client_ip: str | Unset = UNSET, ) -> Response[AuthForgotPasswordResponse200 | Error]: """ Request password reset @@ -156,6 +186,8 @@ async def asyncio_detailed( Project is identified via the anon key. Args: + x_volcano_proxy_authorization (str | Unset): + x_volcano_client_ip (str | Unset): body (AuthForgotPasswordBody): Raises: @@ -169,6 +201,8 @@ async def asyncio_detailed( kwargs = request_kwargs( body=body, +x_volcano_proxy_authorization=x_volcano_proxy_authorization, +x_volcano_client_ip=x_volcano_client_ip, ) @@ -182,6 +216,8 @@ async def asyncio( *, client: AuthenticatedClient, body: AuthForgotPasswordBody, + x_volcano_proxy_authorization: str | Unset = UNSET, + x_volcano_client_ip: str | Unset = UNSET, ) -> AuthForgotPasswordResponse200 | Error | None: """ Request password reset @@ -191,6 +227,8 @@ async def asyncio( Project is identified via the anon key. Args: + x_volcano_proxy_authorization (str | Unset): + x_volcano_client_ip (str | Unset): body (AuthForgotPasswordBody): Raises: @@ -205,5 +243,7 @@ async def asyncio( return (await asyncio_detailed( client=client, body=body, +x_volcano_proxy_authorization=x_volcano_proxy_authorization, +x_volcano_client_ip=x_volcano_client_ip, )).parsed diff --git a/src/volcano_sdk/_generated/api/authentication/auth_get_password_policy.py b/src/volcano_sdk/_generated/api/authentication/auth_get_password_policy.py index e54e0304..0afc3245 100644 --- a/src/volcano_sdk/_generated/api/authentication/auth_get_password_policy.py +++ b/src/volcano_sdk/_generated/api/authentication/auth_get_password_policy.py @@ -10,14 +10,25 @@ from ...models.auth_password_policy import AuthPasswordPolicy from ...models.error import Error +from ...types import UNSET, Unset from typing import cast def request_kwargs( - + *, + x_volcano_proxy_authorization: str | Unset = UNSET, + x_volcano_client_ip: str | Unset = UNSET, + ) -> dict[str, Any]: - + headers: dict[str, Any] = {} + if not isinstance(x_volcano_proxy_authorization, Unset): + headers["X-Volcano-Proxy-Authorization"] = x_volcano_proxy_authorization + + if not isinstance(x_volcano_client_ip, Unset): + headers["X-Volcano-Client-IP"] = x_volcano_client_ip + + @@ -29,6 +40,7 @@ def request_kwargs( } + _kwargs["headers"] = headers return _kwargs @@ -73,6 +85,8 @@ def build_response(*, client: AuthenticatedClient | Client, response: httpx.Resp def sync_detailed( *, client: AuthenticatedClient, + x_volcano_proxy_authorization: str | Unset = UNSET, + x_volcano_client_ip: str | Unset = UNSET, ) -> Response[AuthPasswordPolicy | Error]: """ Get the effective password policy @@ -81,6 +95,10 @@ def sync_detailed( screening status for the project identified by the anon key. A valid anon key is required, but no route-specific auth permission is needed. + Args: + x_volcano_proxy_authorization (str | Unset): + x_volcano_client_ip (str | 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. @@ -91,7 +109,9 @@ def sync_detailed( kwargs = request_kwargs( - + x_volcano_proxy_authorization=x_volcano_proxy_authorization, +x_volcano_client_ip=x_volcano_client_ip, + ) response = client.get_httpx_client().request( @@ -103,6 +123,8 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, + x_volcano_proxy_authorization: str | Unset = UNSET, + x_volcano_client_ip: str | Unset = UNSET, ) -> AuthPasswordPolicy | Error | None: """ Get the effective password policy @@ -111,6 +133,10 @@ def sync( screening status for the project identified by the anon key. A valid anon key is required, but no route-specific auth permission is needed. + Args: + x_volcano_proxy_authorization (str | Unset): + x_volcano_client_ip (str | 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. @@ -122,12 +148,16 @@ def sync( return sync_detailed( client=client, +x_volcano_proxy_authorization=x_volcano_proxy_authorization, +x_volcano_client_ip=x_volcano_client_ip, ).parsed async def asyncio_detailed( *, client: AuthenticatedClient, + x_volcano_proxy_authorization: str | Unset = UNSET, + x_volcano_client_ip: str | Unset = UNSET, ) -> Response[AuthPasswordPolicy | Error]: """ Get the effective password policy @@ -136,6 +166,10 @@ async def asyncio_detailed( screening status for the project identified by the anon key. A valid anon key is required, but no route-specific auth permission is needed. + Args: + x_volcano_proxy_authorization (str | Unset): + x_volcano_client_ip (str | 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. @@ -146,7 +180,9 @@ async def asyncio_detailed( kwargs = request_kwargs( - + x_volcano_proxy_authorization=x_volcano_proxy_authorization, +x_volcano_client_ip=x_volcano_client_ip, + ) response = await client.get_async_httpx_client().request( @@ -158,6 +194,8 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, + x_volcano_proxy_authorization: str | Unset = UNSET, + x_volcano_client_ip: str | Unset = UNSET, ) -> AuthPasswordPolicy | Error | None: """ Get the effective password policy @@ -166,6 +204,10 @@ async def asyncio( screening status for the project identified by the anon key. A valid anon key is required, but no route-specific auth permission is needed. + Args: + x_volcano_proxy_authorization (str | Unset): + x_volcano_client_ip (str | 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. @@ -177,5 +219,7 @@ async def asyncio( return (await asyncio_detailed( client=client, +x_volcano_proxy_authorization=x_volcano_proxy_authorization, +x_volcano_client_ip=x_volcano_client_ip, )).parsed diff --git a/src/volcano_sdk/_generated/api/authentication/auth_logout.py b/src/volcano_sdk/_generated/api/authentication/auth_logout.py index 39c21187..8a0e74c9 100644 --- a/src/volcano_sdk/_generated/api/authentication/auth_logout.py +++ b/src/volcano_sdk/_generated/api/authentication/auth_logout.py @@ -9,6 +9,7 @@ from ... import errors from ...models.auth_logout_body import AuthLogoutBody +from ...models.error import Error from ...types import UNSET, Unset from typing import cast @@ -17,9 +18,17 @@ def request_kwargs( *, body: AuthLogoutBody | Unset = UNSET, + x_volcano_proxy_authorization: str | Unset = UNSET, + x_volcano_client_ip: str | Unset = UNSET, ) -> dict[str, Any]: headers: dict[str, Any] = {} + if not isinstance(x_volcano_proxy_authorization, Unset): + headers["X-Volcano-Proxy-Authorization"] = x_volcano_proxy_authorization + + if not isinstance(x_volcano_client_ip, Unset): + headers["X-Volcano-Client-IP"] = x_volcano_client_ip + @@ -42,9 +51,17 @@ def request_kwargs( -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | Error | None: if response.status_code == 204: - return None + response_204 = cast(Any, None) + return response_204 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -52,7 +69,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any]: +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any | Error]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -65,8 +82,10 @@ def sync_detailed( *, client: AuthenticatedClient, body: AuthLogoutBody | Unset = UNSET, + x_volcano_proxy_authorization: str | Unset = UNSET, + x_volcano_client_ip: str | Unset = UNSET, -) -> Response[Any]: +) -> Response[Any | Error]: """ Logout (revoke refresh token) Invalidate a refresh token. Requires an anon key. @@ -76,6 +95,8 @@ def sync_detailed( token; logout remains idempotent when the cookie is missing or expired. Args: + x_volcano_proxy_authorization (str | Unset): + x_volcano_client_ip (str | Unset): body (AuthLogoutBody | Unset): Raises: @@ -83,12 +104,14 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any] + Response[Any | Error] """ kwargs = request_kwargs( body=body, +x_volcano_proxy_authorization=x_volcano_proxy_authorization, +x_volcano_client_ip=x_volcano_client_ip, ) @@ -98,13 +121,52 @@ def sync_detailed( return build_response(client=client, response=response) +def sync( + *, + client: AuthenticatedClient, + body: AuthLogoutBody | Unset = UNSET, + x_volcano_proxy_authorization: str | Unset = UNSET, + x_volcano_client_ip: str | Unset = UNSET, + +) -> Any | Error | None: + """ Logout (revoke refresh token) + + Invalidate a refresh token. Requires an anon key. + + Send `refresh_token` for the default flow. An eligible cookie-mode + browser request may instead send `session_mode: cookie` with an empty + token; logout remains idempotent when the cookie is missing or expired. + + Args: + x_volcano_proxy_authorization (str | Unset): + x_volcano_client_ip (str | Unset): + body (AuthLogoutBody | 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: + Any | Error + """ + + + return sync_detailed( + client=client, +body=body, +x_volcano_proxy_authorization=x_volcano_proxy_authorization, +x_volcano_client_ip=x_volcano_client_ip, + + ).parsed async def asyncio_detailed( *, client: AuthenticatedClient, body: AuthLogoutBody | Unset = UNSET, + x_volcano_proxy_authorization: str | Unset = UNSET, + x_volcano_client_ip: str | Unset = UNSET, -) -> Response[Any]: +) -> Response[Any | Error]: """ Logout (revoke refresh token) Invalidate a refresh token. Requires an anon key. @@ -114,6 +176,8 @@ async def asyncio_detailed( token; logout remains idempotent when the cookie is missing or expired. Args: + x_volcano_proxy_authorization (str | Unset): + x_volcano_client_ip (str | Unset): body (AuthLogoutBody | Unset): Raises: @@ -121,12 +185,14 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any] + Response[Any | Error] """ kwargs = request_kwargs( body=body, +x_volcano_proxy_authorization=x_volcano_proxy_authorization, +x_volcano_client_ip=x_volcano_client_ip, ) @@ -136,3 +202,40 @@ async def asyncio_detailed( return build_response(client=client, response=response) +async def asyncio( + *, + client: AuthenticatedClient, + body: AuthLogoutBody | Unset = UNSET, + x_volcano_proxy_authorization: str | Unset = UNSET, + x_volcano_client_ip: str | Unset = UNSET, + +) -> Any | Error | None: + """ Logout (revoke refresh token) + + Invalidate a refresh token. Requires an anon key. + + Send `refresh_token` for the default flow. An eligible cookie-mode + browser request may instead send `session_mode: cookie` with an empty + token; logout remains idempotent when the cookie is missing or expired. + + Args: + x_volcano_proxy_authorization (str | Unset): + x_volcano_client_ip (str | Unset): + body (AuthLogoutBody | 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: + Any | Error + """ + + + return (await asyncio_detailed( + client=client, +body=body, +x_volcano_proxy_authorization=x_volcano_proxy_authorization, +x_volcano_client_ip=x_volcano_client_ip, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/authentication/auth_refresh.py b/src/volcano_sdk/_generated/api/authentication/auth_refresh.py index bb68bd60..ff639f08 100644 --- a/src/volcano_sdk/_generated/api/authentication/auth_refresh.py +++ b/src/volcano_sdk/_generated/api/authentication/auth_refresh.py @@ -19,9 +19,17 @@ def request_kwargs( *, body: AuthRefreshBody | Unset = UNSET, + x_volcano_proxy_authorization: str | Unset = UNSET, + x_volcano_client_ip: str | Unset = UNSET, ) -> dict[str, Any]: headers: dict[str, Any] = {} + if not isinstance(x_volcano_proxy_authorization, Unset): + headers["X-Volcano-Proxy-Authorization"] = x_volcano_proxy_authorization + + if not isinstance(x_volcano_client_ip, Unset): + headers["X-Volcano-Client-IP"] = x_volcano_client_ip + @@ -92,6 +100,8 @@ def sync_detailed( *, client: AuthenticatedClient, body: AuthRefreshBody | Unset = UNSET, + x_volcano_proxy_authorization: str | Unset = UNSET, + x_volcano_client_ip: str | Unset = UNSET, ) -> Response[AuthTokenResponse | Error]: """ Refresh access token @@ -105,6 +115,8 @@ def sync_detailed( response. Args: + x_volcano_proxy_authorization (str | Unset): + x_volcano_client_ip (str | Unset): body (AuthRefreshBody | Unset): Raises: @@ -118,6 +130,8 @@ def sync_detailed( kwargs = request_kwargs( body=body, +x_volcano_proxy_authorization=x_volcano_proxy_authorization, +x_volcano_client_ip=x_volcano_client_ip, ) @@ -131,6 +145,8 @@ def sync( *, client: AuthenticatedClient, body: AuthRefreshBody | Unset = UNSET, + x_volcano_proxy_authorization: str | Unset = UNSET, + x_volcano_client_ip: str | Unset = UNSET, ) -> AuthTokenResponse | Error | None: """ Refresh access token @@ -144,6 +160,8 @@ def sync( response. Args: + x_volcano_proxy_authorization (str | Unset): + x_volcano_client_ip (str | Unset): body (AuthRefreshBody | Unset): Raises: @@ -158,6 +176,8 @@ def sync( return sync_detailed( client=client, body=body, +x_volcano_proxy_authorization=x_volcano_proxy_authorization, +x_volcano_client_ip=x_volcano_client_ip, ).parsed @@ -165,6 +185,8 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: AuthRefreshBody | Unset = UNSET, + x_volcano_proxy_authorization: str | Unset = UNSET, + x_volcano_client_ip: str | Unset = UNSET, ) -> Response[AuthTokenResponse | Error]: """ Refresh access token @@ -178,6 +200,8 @@ async def asyncio_detailed( response. Args: + x_volcano_proxy_authorization (str | Unset): + x_volcano_client_ip (str | Unset): body (AuthRefreshBody | Unset): Raises: @@ -191,6 +215,8 @@ async def asyncio_detailed( kwargs = request_kwargs( body=body, +x_volcano_proxy_authorization=x_volcano_proxy_authorization, +x_volcano_client_ip=x_volcano_client_ip, ) @@ -204,6 +230,8 @@ async def asyncio( *, client: AuthenticatedClient, body: AuthRefreshBody | Unset = UNSET, + x_volcano_proxy_authorization: str | Unset = UNSET, + x_volcano_client_ip: str | Unset = UNSET, ) -> AuthTokenResponse | Error | None: """ Refresh access token @@ -217,6 +245,8 @@ async def asyncio( response. Args: + x_volcano_proxy_authorization (str | Unset): + x_volcano_client_ip (str | Unset): body (AuthRefreshBody | Unset): Raises: @@ -231,5 +261,7 @@ async def asyncio( return (await asyncio_detailed( client=client, body=body, +x_volcano_proxy_authorization=x_volcano_proxy_authorization, +x_volcano_client_ip=x_volcano_client_ip, )).parsed diff --git a/src/volcano_sdk/_generated/api/authentication/auth_reset_password.py b/src/volcano_sdk/_generated/api/authentication/auth_reset_password.py index fa12e70a..4147b7cc 100644 --- a/src/volcano_sdk/_generated/api/authentication/auth_reset_password.py +++ b/src/volcano_sdk/_generated/api/authentication/auth_reset_password.py @@ -11,6 +11,7 @@ from ...models.auth_reset_password_body import AuthResetPasswordBody from ...models.auth_reset_password_response_200 import AuthResetPasswordResponse200 from ...models.error import Error +from ...types import UNSET, Unset from typing import cast @@ -18,9 +19,17 @@ def request_kwargs( *, body: AuthResetPasswordBody, + x_volcano_proxy_authorization: str | Unset = UNSET, + x_volcano_client_ip: str | Unset = UNSET, ) -> dict[str, Any]: headers: dict[str, Any] = {} + if not isinstance(x_volcano_proxy_authorization, Unset): + headers["X-Volcano-Proxy-Authorization"] = x_volcano_proxy_authorization + + if not isinstance(x_volcano_client_ip, Unset): + headers["X-Volcano-Client-IP"] = x_volcano_client_ip + @@ -83,6 +92,8 @@ def sync_detailed( *, client: AuthenticatedClient, body: AuthResetPasswordBody, + x_volcano_proxy_authorization: str | Unset = UNSET, + x_volcano_client_ip: str | Unset = UNSET, ) -> Response[Any | AuthResetPasswordResponse200 | Error]: """ Reset password with recovery token @@ -91,6 +102,8 @@ def sync_detailed( Revokes all existing sessions for security. Args: + x_volcano_proxy_authorization (str | Unset): + x_volcano_client_ip (str | Unset): body (AuthResetPasswordBody): Raises: @@ -104,6 +117,8 @@ def sync_detailed( kwargs = request_kwargs( body=body, +x_volcano_proxy_authorization=x_volcano_proxy_authorization, +x_volcano_client_ip=x_volcano_client_ip, ) @@ -117,6 +132,8 @@ def sync( *, client: AuthenticatedClient, body: AuthResetPasswordBody, + x_volcano_proxy_authorization: str | Unset = UNSET, + x_volcano_client_ip: str | Unset = UNSET, ) -> Any | AuthResetPasswordResponse200 | Error | None: """ Reset password with recovery token @@ -125,6 +142,8 @@ def sync( Revokes all existing sessions for security. Args: + x_volcano_proxy_authorization (str | Unset): + x_volcano_client_ip (str | Unset): body (AuthResetPasswordBody): Raises: @@ -139,6 +158,8 @@ def sync( return sync_detailed( client=client, body=body, +x_volcano_proxy_authorization=x_volcano_proxy_authorization, +x_volcano_client_ip=x_volcano_client_ip, ).parsed @@ -146,6 +167,8 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: AuthResetPasswordBody, + x_volcano_proxy_authorization: str | Unset = UNSET, + x_volcano_client_ip: str | Unset = UNSET, ) -> Response[Any | AuthResetPasswordResponse200 | Error]: """ Reset password with recovery token @@ -154,6 +177,8 @@ async def asyncio_detailed( Revokes all existing sessions for security. Args: + x_volcano_proxy_authorization (str | Unset): + x_volcano_client_ip (str | Unset): body (AuthResetPasswordBody): Raises: @@ -167,6 +192,8 @@ async def asyncio_detailed( kwargs = request_kwargs( body=body, +x_volcano_proxy_authorization=x_volcano_proxy_authorization, +x_volcano_client_ip=x_volcano_client_ip, ) @@ -180,6 +207,8 @@ async def asyncio( *, client: AuthenticatedClient, body: AuthResetPasswordBody, + x_volcano_proxy_authorization: str | Unset = UNSET, + x_volcano_client_ip: str | Unset = UNSET, ) -> Any | AuthResetPasswordResponse200 | Error | None: """ Reset password with recovery token @@ -188,6 +217,8 @@ async def asyncio( Revokes all existing sessions for security. Args: + x_volcano_proxy_authorization (str | Unset): + x_volcano_client_ip (str | Unset): body (AuthResetPasswordBody): Raises: @@ -202,5 +233,7 @@ async def asyncio( return (await asyncio_detailed( client=client, body=body, +x_volcano_proxy_authorization=x_volcano_proxy_authorization, +x_volcano_client_ip=x_volcano_client_ip, )).parsed diff --git a/src/volcano_sdk/_generated/api/authentication/auth_signin.py b/src/volcano_sdk/_generated/api/authentication/auth_signin.py index 8bf251a6..bf84ceca 100644 --- a/src/volcano_sdk/_generated/api/authentication/auth_signin.py +++ b/src/volcano_sdk/_generated/api/authentication/auth_signin.py @@ -10,6 +10,7 @@ from ...models.auth_signin_body import AuthSigninBody from ...models.auth_token_response import AuthTokenResponse +from ...types import UNSET, Unset from typing import cast @@ -17,9 +18,17 @@ def request_kwargs( *, body: AuthSigninBody, + x_volcano_proxy_authorization: str | Unset = UNSET, + x_volcano_client_ip: str | Unset = UNSET, ) -> dict[str, Any]: headers: dict[str, Any] = {} + if not isinstance(x_volcano_proxy_authorization, Unset): + headers["X-Volcano-Proxy-Authorization"] = x_volcano_proxy_authorization + + if not isinstance(x_volcano_client_ip, Unset): + headers["X-Volcano-Client-IP"] = x_volcano_client_ip + @@ -83,6 +92,8 @@ def sync_detailed( *, client: AuthenticatedClient, body: AuthSigninBody, + x_volcano_proxy_authorization: str | Unset = UNSET, + x_volcano_client_ip: str | Unset = UNSET, ) -> Response[Any | AuthTokenResponse]: """ Sign in an auth user @@ -97,6 +108,8 @@ def sync_detailed( token. Args: + x_volcano_proxy_authorization (str | Unset): + x_volcano_client_ip (str | Unset): body (AuthSigninBody): Raises: @@ -110,6 +123,8 @@ def sync_detailed( kwargs = request_kwargs( body=body, +x_volcano_proxy_authorization=x_volcano_proxy_authorization, +x_volcano_client_ip=x_volcano_client_ip, ) @@ -123,6 +138,8 @@ def sync( *, client: AuthenticatedClient, body: AuthSigninBody, + x_volcano_proxy_authorization: str | Unset = UNSET, + x_volcano_client_ip: str | Unset = UNSET, ) -> Any | AuthTokenResponse | None: """ Sign in an auth user @@ -137,6 +154,8 @@ def sync( token. Args: + x_volcano_proxy_authorization (str | Unset): + x_volcano_client_ip (str | Unset): body (AuthSigninBody): Raises: @@ -151,6 +170,8 @@ def sync( return sync_detailed( client=client, body=body, +x_volcano_proxy_authorization=x_volcano_proxy_authorization, +x_volcano_client_ip=x_volcano_client_ip, ).parsed @@ -158,6 +179,8 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: AuthSigninBody, + x_volcano_proxy_authorization: str | Unset = UNSET, + x_volcano_client_ip: str | Unset = UNSET, ) -> Response[Any | AuthTokenResponse]: """ Sign in an auth user @@ -172,6 +195,8 @@ async def asyncio_detailed( token. Args: + x_volcano_proxy_authorization (str | Unset): + x_volcano_client_ip (str | Unset): body (AuthSigninBody): Raises: @@ -185,6 +210,8 @@ async def asyncio_detailed( kwargs = request_kwargs( body=body, +x_volcano_proxy_authorization=x_volcano_proxy_authorization, +x_volcano_client_ip=x_volcano_client_ip, ) @@ -198,6 +225,8 @@ async def asyncio( *, client: AuthenticatedClient, body: AuthSigninBody, + x_volcano_proxy_authorization: str | Unset = UNSET, + x_volcano_client_ip: str | Unset = UNSET, ) -> Any | AuthTokenResponse | None: """ Sign in an auth user @@ -212,6 +241,8 @@ async def asyncio( token. Args: + x_volcano_proxy_authorization (str | Unset): + x_volcano_client_ip (str | Unset): body (AuthSigninBody): Raises: @@ -226,5 +257,7 @@ async def asyncio( return (await asyncio_detailed( client=client, body=body, +x_volcano_proxy_authorization=x_volcano_proxy_authorization, +x_volcano_client_ip=x_volcano_client_ip, )).parsed diff --git a/src/volcano_sdk/_generated/api/authentication/auth_signup.py b/src/volcano_sdk/_generated/api/authentication/auth_signup.py index 6db72ccd..6fec9bab 100644 --- a/src/volcano_sdk/_generated/api/authentication/auth_signup.py +++ b/src/volcano_sdk/_generated/api/authentication/auth_signup.py @@ -11,6 +11,7 @@ from ...models.auth_signup_body import AuthSignupBody from ...models.auth_signup_response import AuthSignupResponse from ...models.error import Error +from ...types import UNSET, Unset from typing import cast @@ -18,9 +19,17 @@ def request_kwargs( *, body: AuthSignupBody, + x_volcano_proxy_authorization: str | Unset = UNSET, + x_volcano_client_ip: str | Unset = UNSET, ) -> dict[str, Any]: headers: dict[str, Any] = {} + if not isinstance(x_volcano_proxy_authorization, Unset): + headers["X-Volcano-Proxy-Authorization"] = x_volcano_proxy_authorization + + if not isinstance(x_volcano_client_ip, Unset): + headers["X-Volcano-Client-IP"] = x_volcano_client_ip + @@ -91,6 +100,8 @@ def sync_detailed( *, client: AuthenticatedClient, body: AuthSignupBody, + x_volcano_proxy_authorization: str | Unset = UNSET, + x_volcano_client_ip: str | Unset = UNSET, ) -> Response[Any | AuthSignupResponse | Error]: """ Sign up a new auth user @@ -109,6 +120,8 @@ def sync_detailed( response cannot be used to discover which emails are registered. Args: + x_volcano_proxy_authorization (str | Unset): + x_volcano_client_ip (str | Unset): body (AuthSignupBody): Raises: @@ -122,6 +135,8 @@ def sync_detailed( kwargs = request_kwargs( body=body, +x_volcano_proxy_authorization=x_volcano_proxy_authorization, +x_volcano_client_ip=x_volcano_client_ip, ) @@ -135,6 +150,8 @@ def sync( *, client: AuthenticatedClient, body: AuthSignupBody, + x_volcano_proxy_authorization: str | Unset = UNSET, + x_volcano_client_ip: str | Unset = UNSET, ) -> Any | AuthSignupResponse | Error | None: """ Sign up a new auth user @@ -153,6 +170,8 @@ def sync( response cannot be used to discover which emails are registered. Args: + x_volcano_proxy_authorization (str | Unset): + x_volcano_client_ip (str | Unset): body (AuthSignupBody): Raises: @@ -167,6 +186,8 @@ def sync( return sync_detailed( client=client, body=body, +x_volcano_proxy_authorization=x_volcano_proxy_authorization, +x_volcano_client_ip=x_volcano_client_ip, ).parsed @@ -174,6 +195,8 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: AuthSignupBody, + x_volcano_proxy_authorization: str | Unset = UNSET, + x_volcano_client_ip: str | Unset = UNSET, ) -> Response[Any | AuthSignupResponse | Error]: """ Sign up a new auth user @@ -192,6 +215,8 @@ async def asyncio_detailed( response cannot be used to discover which emails are registered. Args: + x_volcano_proxy_authorization (str | Unset): + x_volcano_client_ip (str | Unset): body (AuthSignupBody): Raises: @@ -205,6 +230,8 @@ async def asyncio_detailed( kwargs = request_kwargs( body=body, +x_volcano_proxy_authorization=x_volcano_proxy_authorization, +x_volcano_client_ip=x_volcano_client_ip, ) @@ -218,6 +245,8 @@ async def asyncio( *, client: AuthenticatedClient, body: AuthSignupBody, + x_volcano_proxy_authorization: str | Unset = UNSET, + x_volcano_client_ip: str | Unset = UNSET, ) -> Any | AuthSignupResponse | Error | None: """ Sign up a new auth user @@ -236,6 +265,8 @@ async def asyncio( response cannot be used to discover which emails are registered. Args: + x_volcano_proxy_authorization (str | Unset): + x_volcano_client_ip (str | Unset): body (AuthSignupBody): Raises: @@ -250,5 +281,7 @@ async def asyncio( return (await asyncio_detailed( client=client, body=body, +x_volcano_proxy_authorization=x_volcano_proxy_authorization, +x_volcano_client_ip=x_volcano_client_ip, )).parsed diff --git a/src/volcano_sdk/_generated/api/authentication/auth_signup_anonymous.py b/src/volcano_sdk/_generated/api/authentication/auth_signup_anonymous.py index 620257a7..4ab1e4a2 100644 --- a/src/volcano_sdk/_generated/api/authentication/auth_signup_anonymous.py +++ b/src/volcano_sdk/_generated/api/authentication/auth_signup_anonymous.py @@ -10,6 +10,7 @@ from ...models.auth_signup_anonymous_body import AuthSignupAnonymousBody from ...models.auth_token_response import AuthTokenResponse +from ...models.error import Error from ...types import UNSET, Unset from typing import cast @@ -18,9 +19,17 @@ def request_kwargs( *, body: AuthSignupAnonymousBody | Unset = UNSET, + x_volcano_proxy_authorization: str | Unset = UNSET, + x_volcano_client_ip: str | Unset = UNSET, ) -> dict[str, Any]: headers: dict[str, Any] = {} + if not isinstance(x_volcano_proxy_authorization, Unset): + headers["X-Volcano-Proxy-Authorization"] = x_volcano_proxy_authorization + + if not isinstance(x_volcano_client_ip, Unset): + headers["X-Volcano-Client-IP"] = x_volcano_client_ip + @@ -43,7 +52,7 @@ def request_kwargs( -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | AuthTokenResponse | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | AuthTokenResponse | Error | None: if response.status_code == 201: response_201 = AuthTokenResponse.from_dict(response.json()) @@ -51,6 +60,13 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return response_201 + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + if response.status_code == 403: response_403 = cast(Any, None) return response_403 @@ -61,7 +77,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any | AuthTokenResponse]: +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any | AuthTokenResponse | Error]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -74,8 +90,10 @@ def sync_detailed( *, client: AuthenticatedClient, body: AuthSignupAnonymousBody | Unset = UNSET, + x_volcano_proxy_authorization: str | Unset = UNSET, + x_volcano_client_ip: str | Unset = UNSET, -) -> Response[Any | AuthTokenResponse]: +) -> Response[Any | AuthTokenResponse | Error]: """ Create anonymous user Create guest user without email/password. @@ -84,6 +102,8 @@ def sync_detailed( Requires enable_anonymous_signins to be true. Args: + x_volcano_proxy_authorization (str | Unset): + x_volcano_client_ip (str | Unset): body (AuthSignupAnonymousBody | Unset): Raises: @@ -91,12 +111,14 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | AuthTokenResponse] + Response[Any | AuthTokenResponse | Error] """ kwargs = request_kwargs( body=body, +x_volcano_proxy_authorization=x_volcano_proxy_authorization, +x_volcano_client_ip=x_volcano_client_ip, ) @@ -110,8 +132,10 @@ def sync( *, client: AuthenticatedClient, body: AuthSignupAnonymousBody | Unset = UNSET, + x_volcano_proxy_authorization: str | Unset = UNSET, + x_volcano_client_ip: str | Unset = UNSET, -) -> Any | AuthTokenResponse | None: +) -> Any | AuthTokenResponse | Error | None: """ Create anonymous user Create guest user without email/password. @@ -120,6 +144,8 @@ def sync( Requires enable_anonymous_signins to be true. Args: + x_volcano_proxy_authorization (str | Unset): + x_volcano_client_ip (str | Unset): body (AuthSignupAnonymousBody | Unset): Raises: @@ -127,13 +153,15 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | AuthTokenResponse + Any | AuthTokenResponse | Error """ return sync_detailed( client=client, body=body, +x_volcano_proxy_authorization=x_volcano_proxy_authorization, +x_volcano_client_ip=x_volcano_client_ip, ).parsed @@ -141,8 +169,10 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: AuthSignupAnonymousBody | Unset = UNSET, + x_volcano_proxy_authorization: str | Unset = UNSET, + x_volcano_client_ip: str | Unset = UNSET, -) -> Response[Any | AuthTokenResponse]: +) -> Response[Any | AuthTokenResponse | Error]: """ Create anonymous user Create guest user without email/password. @@ -151,6 +181,8 @@ async def asyncio_detailed( Requires enable_anonymous_signins to be true. Args: + x_volcano_proxy_authorization (str | Unset): + x_volcano_client_ip (str | Unset): body (AuthSignupAnonymousBody | Unset): Raises: @@ -158,12 +190,14 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | AuthTokenResponse] + Response[Any | AuthTokenResponse | Error] """ kwargs = request_kwargs( body=body, +x_volcano_proxy_authorization=x_volcano_proxy_authorization, +x_volcano_client_ip=x_volcano_client_ip, ) @@ -177,8 +211,10 @@ async def asyncio( *, client: AuthenticatedClient, body: AuthSignupAnonymousBody | Unset = UNSET, + x_volcano_proxy_authorization: str | Unset = UNSET, + x_volcano_client_ip: str | Unset = UNSET, -) -> Any | AuthTokenResponse | None: +) -> Any | AuthTokenResponse | Error | None: """ Create anonymous user Create guest user without email/password. @@ -187,6 +223,8 @@ async def asyncio( Requires enable_anonymous_signins to be true. Args: + x_volcano_proxy_authorization (str | Unset): + x_volcano_client_ip (str | Unset): body (AuthSignupAnonymousBody | Unset): Raises: @@ -194,12 +232,14 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | AuthTokenResponse + Any | AuthTokenResponse | Error """ return (await asyncio_detailed( client=client, body=body, +x_volcano_proxy_authorization=x_volcano_proxy_authorization, +x_volcano_client_ip=x_volcano_client_ip, )).parsed diff --git a/src/volcano_sdk/_generated/api/autofix/get_autofix_run.py b/src/volcano_sdk/_generated/api/autofix/get_autofix_run.py new file mode 100644 index 00000000..d79f218c --- /dev/null +++ b/src/volcano_sdk/_generated/api/autofix/get_autofix_run.py @@ -0,0 +1,224 @@ +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_run import AutofixRun +from ...models.error import Error +from typing import cast +from uuid import UUID + + + +def request_kwargs( + id: UUID | str, + run_id: UUID | str, + +) -> dict[str, Any]: + + + + + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/projects/{id}/autofix-runs/{run_id}".format(id=quote(str(id), safe=""),run_id=quote(str(run_id), safe=""),), + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> AutofixRun | Error | None: + if response.status_code == 200: + response_200 = AutofixRun.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 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[AutofixRun | 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, + run_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Response[AutofixRun | Error]: + """ Get an autofix run + + Returns one run: its status, the diagnosis once it succeeds, why it + failed or was canceled, and the model tokens it used. Runs stay readable + where autofix is not available. + + Project access tokens can read runs, including read-only ones. + + Args: + id (UUID): + run_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[AutofixRun | Error] + """ + + + kwargs = request_kwargs( + id=id, +run_id=run_id, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + id: UUID | str, + run_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> AutofixRun | Error | None: + """ Get an autofix run + + Returns one run: its status, the diagnosis once it succeeds, why it + failed or was canceled, and the model tokens it used. Runs stay readable + where autofix is not available. + + Project access tokens can read runs, including read-only ones. + + Args: + id (UUID): + run_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: + AutofixRun | Error + """ + + + return sync_detailed( + id=id, +run_id=run_id, +client=client, + + ).parsed + +async def asyncio_detailed( + id: UUID | str, + run_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Response[AutofixRun | Error]: + """ Get an autofix run + + Returns one run: its status, the diagnosis once it succeeds, why it + failed or was canceled, and the model tokens it used. Runs stay readable + where autofix is not available. + + Project access tokens can read runs, including read-only ones. + + Args: + id (UUID): + run_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[AutofixRun | Error] + """ + + + kwargs = request_kwargs( + id=id, +run_id=run_id, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + id: UUID | str, + run_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> AutofixRun | Error | None: + """ Get an autofix run + + Returns one run: its status, the diagnosis once it succeeds, why it + failed or was canceled, and the model tokens it used. Runs stay readable + where autofix is not available. + + Project access tokens can read runs, including read-only ones. + + Args: + id (UUID): + run_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: + AutofixRun | Error + """ + + + return (await asyncio_detailed( + id=id, +run_id=run_id, +client=client, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/autofix/list_autofix_runs.py b/src/volcano_sdk/_generated/api/autofix/list_autofix_runs.py new file mode 100644 index 00000000..0d90897a --- /dev/null +++ b/src/volcano_sdk/_generated/api/autofix/list_autofix_runs.py @@ -0,0 +1,294 @@ +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_run_status import AutofixRunStatus +from ...models.autofix_run_status import check_autofix_run_status +from ...models.error import Error +from ...models.paginated_autofix_runs import PaginatedAutofixRuns +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, + issue_id: UUID | str | Unset = UNSET, + status: AutofixRunStatus | Unset = UNSET, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + params["limit"] = limit + + params["cursor"] = cursor + + json_issue_id: str | Unset = UNSET + if not isinstance(issue_id, Unset): + json_issue_id = str(issue_id) + params["issue_id"] = json_issue_id + + json_status: str | Unset = UNSET + if not isinstance(status, Unset): + json_status = status + + params["status"] = json_status + + + 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}/autofix-runs".format(id=quote(str(id), safe=""),), + "params": params, + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | PaginatedAutofixRuns | None: + if response.status_code == 200: + response_200 = PaginatedAutofixRuns.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 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[Error | PaginatedAutofixRuns]: + 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, + issue_id: UUID | str | Unset = UNSET, + status: AutofixRunStatus | Unset = UNSET, + +) -> Response[Error | PaginatedAutofixRuns]: + """ List autofix runs + + Lists the project's autofix runs, newest first. Runs stay readable after + autofix is turned off, and where autofix is not available. + + Project access tokens can list runs, including read-only ones. + + Args: + id (UUID): + limit (int | Unset): Default: 10. + cursor (str | Unset): + issue_id (UUID | Unset): + status (AutofixRunStatus | Unset): Where a run is. `canceled` means the project's settings + or plan stopped allowing the run before it finished; `failure_code` says which. + + 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 | PaginatedAutofixRuns] + """ + + + kwargs = request_kwargs( + id=id, +limit=limit, +cursor=cursor, +issue_id=issue_id, +status=status, + + ) + + 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, + issue_id: UUID | str | Unset = UNSET, + status: AutofixRunStatus | Unset = UNSET, + +) -> Error | PaginatedAutofixRuns | None: + """ List autofix runs + + Lists the project's autofix runs, newest first. Runs stay readable after + autofix is turned off, and where autofix is not available. + + Project access tokens can list runs, including read-only ones. + + Args: + id (UUID): + limit (int | Unset): Default: 10. + cursor (str | Unset): + issue_id (UUID | Unset): + status (AutofixRunStatus | Unset): Where a run is. `canceled` means the project's settings + or plan stopped allowing the run before it finished; `failure_code` says which. + + 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 | PaginatedAutofixRuns + """ + + + return sync_detailed( + id=id, +client=client, +limit=limit, +cursor=cursor, +issue_id=issue_id, +status=status, + + ).parsed + +async def asyncio_detailed( + id: UUID | str, + *, + client: AuthenticatedClient, + limit: int | Unset = 10, + cursor: str | Unset = UNSET, + issue_id: UUID | str | Unset = UNSET, + status: AutofixRunStatus | Unset = UNSET, + +) -> Response[Error | PaginatedAutofixRuns]: + """ List autofix runs + + Lists the project's autofix runs, newest first. Runs stay readable after + autofix is turned off, and where autofix is not available. + + Project access tokens can list runs, including read-only ones. + + Args: + id (UUID): + limit (int | Unset): Default: 10. + cursor (str | Unset): + issue_id (UUID | Unset): + status (AutofixRunStatus | Unset): Where a run is. `canceled` means the project's settings + or plan stopped allowing the run before it finished; `failure_code` says which. + + 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 | PaginatedAutofixRuns] + """ + + + kwargs = request_kwargs( + id=id, +limit=limit, +cursor=cursor, +issue_id=issue_id, +status=status, + + ) + + 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, + issue_id: UUID | str | Unset = UNSET, + status: AutofixRunStatus | Unset = UNSET, + +) -> Error | PaginatedAutofixRuns | None: + """ List autofix runs + + Lists the project's autofix runs, newest first. Runs stay readable after + autofix is turned off, and where autofix is not available. + + Project access tokens can list runs, including read-only ones. + + Args: + id (UUID): + limit (int | Unset): Default: 10. + cursor (str | Unset): + issue_id (UUID | Unset): + status (AutofixRunStatus | Unset): Where a run is. `canceled` means the project's settings + or plan stopped allowing the run before it finished; `failure_code` says which. + + 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 | PaginatedAutofixRuns + """ + + + return (await asyncio_detailed( + id=id, +client=client, +limit=limit, +cursor=cursor, +issue_id=issue_id, +status=status, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/autofix/start_autofix_run.py b/src/volcano_sdk/_generated/api/autofix/start_autofix_run.py new file mode 100644 index 00000000..0fee78e8 --- /dev/null +++ b/src/volcano_sdk/_generated/api/autofix/start_autofix_run.py @@ -0,0 +1,291 @@ +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_run import AutofixRun +from ...models.error import Error +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": "post", + "url": "/projects/{id}/issues/{issue_id}/autofix-runs".format(id=quote(str(id), safe=""),issue_id=quote(str(issue_id), safe=""),), + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> AutofixRun | Error | None: + if response.status_code == 202: + response_202 = AutofixRun.from_dict(response.json()) + + + + return response_202 + + 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 == 409: + response_409 = Error.from_dict(response.json()) + + + + return response_409 + + if response.status_code == 429: + response_429 = Error.from_dict(response.json()) + + + + return response_429 + + 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[AutofixRun | 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, + issue_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Response[AutofixRun | Error]: + """ Diagnose an issue + + Queues a run that diagnoses the issue with AI. The run reads the + issue's runtime logs and, when a push to the project's connected + repository built the deployment that was live when the issue was + last seen, its source at that commit. Poll the run until its status is + `succeeded`, `failed`, or `canceled`. + + Autofix must be on for the project. An issue has at most one queued or + running run, a project runs one at a time, and a project starts at most + 25 runs, manual and automatic, in any 24 hours. + + Project access tokens are refused. A run spends model tokens on the + project's provider, so a person starts it with a platform token or in + the dashboard. + + 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[AutofixRun | Error] + """ + + + 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, + +) -> AutofixRun | Error | None: + """ Diagnose an issue + + Queues a run that diagnoses the issue with AI. The run reads the + issue's runtime logs and, when a push to the project's connected + repository built the deployment that was live when the issue was + last seen, its source at that commit. Poll the run until its status is + `succeeded`, `failed`, or `canceled`. + + Autofix must be on for the project. An issue has at most one queued or + running run, a project runs one at a time, and a project starts at most + 25 runs, manual and automatic, in any 24 hours. + + Project access tokens are refused. A run spends model tokens on the + project's provider, so a person starts it with a platform token or in + the dashboard. + + 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: + AutofixRun | Error + """ + + + 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[AutofixRun | Error]: + """ Diagnose an issue + + Queues a run that diagnoses the issue with AI. The run reads the + issue's runtime logs and, when a push to the project's connected + repository built the deployment that was live when the issue was + last seen, its source at that commit. Poll the run until its status is + `succeeded`, `failed`, or `canceled`. + + Autofix must be on for the project. An issue has at most one queued or + running run, a project runs one at a time, and a project starts at most + 25 runs, manual and automatic, in any 24 hours. + + Project access tokens are refused. A run spends model tokens on the + project's provider, so a person starts it with a platform token or in + the dashboard. + + 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[AutofixRun | Error] + """ + + + 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, + +) -> AutofixRun | Error | None: + """ Diagnose an issue + + Queues a run that diagnoses the issue with AI. The run reads the + issue's runtime logs and, when a push to the project's connected + repository built the deployment that was live when the issue was + last seen, its source at that commit. Poll the run until its status is + `succeeded`, `failed`, or `canceled`. + + Autofix must be on for the project. An issue has at most one queued or + running run, a project runs one at a time, and a project starts at most + 25 runs, manual and automatic, in any 24 hours. + + Project access tokens are refused. A run spends model tokens on the + project's provider, so a person starts it with a platform token or in + the dashboard. + + 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: + AutofixRun | Error + """ + + + return (await asyncio_detailed( + id=id, +issue_id=issue_id, +client=client, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/durable_functions/list_durable_message_waits.py b/src/volcano_sdk/_generated/api/durable_functions/list_durable_message_waits.py new file mode 100644 index 00000000..205aa25e --- /dev/null +++ b/src/volcano_sdk/_generated/api/durable_functions/list_durable_message_waits.py @@ -0,0 +1,226 @@ +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.durable_message_wait_list import DurableMessageWaitList +from ...models.error import Error +from typing import cast +from uuid import UUID + + + +def request_kwargs( + id: UUID | str, + function_id: str, + execution_id: UUID | str, + +) -> dict[str, Any]: + + + + + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/projects/{id}/durable-functions/{function_id}/executions/{execution_id}/message-waits".format(id=quote(str(id), safe=""),function_id=quote(str(function_id), safe=""),execution_id=quote(str(execution_id), safe=""),), + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> DurableMessageWaitList | Error | None: + if response.status_code == 200: + response_200 = DurableMessageWaitList.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[DurableMessageWaitList | 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, + function_id: str, + execution_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Response[DurableMessageWaitList | Error]: + """ List a durable execution's open message waits + + Lists the waits an execution has open in `ctx.waitForMessage`, oldest + first, so you can see which message names it is waiting for. + + Project access tokens can list waits, including read-only ones. + + Args: + id (UUID): + function_id (str): + execution_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[DurableMessageWaitList | Error] + """ + + + kwargs = request_kwargs( + id=id, +function_id=function_id, +execution_id=execution_id, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + id: UUID | str, + function_id: str, + execution_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> DurableMessageWaitList | Error | None: + """ List a durable execution's open message waits + + Lists the waits an execution has open in `ctx.waitForMessage`, oldest + first, so you can see which message names it is waiting for. + + Project access tokens can list waits, including read-only ones. + + Args: + id (UUID): + function_id (str): + execution_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: + DurableMessageWaitList | Error + """ + + + return sync_detailed( + id=id, +function_id=function_id, +execution_id=execution_id, +client=client, + + ).parsed + +async def asyncio_detailed( + id: UUID | str, + function_id: str, + execution_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Response[DurableMessageWaitList | Error]: + """ List a durable execution's open message waits + + Lists the waits an execution has open in `ctx.waitForMessage`, oldest + first, so you can see which message names it is waiting for. + + Project access tokens can list waits, including read-only ones. + + Args: + id (UUID): + function_id (str): + execution_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[DurableMessageWaitList | Error] + """ + + + kwargs = request_kwargs( + id=id, +function_id=function_id, +execution_id=execution_id, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + id: UUID | str, + function_id: str, + execution_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> DurableMessageWaitList | Error | None: + """ List a durable execution's open message waits + + Lists the waits an execution has open in `ctx.waitForMessage`, oldest + first, so you can see which message names it is waiting for. + + Project access tokens can list waits, including read-only ones. + + Args: + id (UUID): + function_id (str): + execution_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: + DurableMessageWaitList | Error + """ + + + return (await asyncio_detailed( + id=id, +function_id=function_id, +execution_id=execution_id, +client=client, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/durable_functions/list_durable_messages.py b/src/volcano_sdk/_generated/api/durable_functions/list_durable_messages.py new file mode 100644 index 00000000..d0fa92d5 --- /dev/null +++ b/src/volcano_sdk/_generated/api/durable_functions/list_durable_messages.py @@ -0,0 +1,322 @@ +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.durable_message_direction import check_durable_message_direction +from ...models.durable_message_direction import DurableMessageDirection +from ...models.durable_message_list import DurableMessageList +from ...models.error import Error +from ...types import UNSET, Unset +from typing import cast +from uuid import UUID + + + +def request_kwargs( + id: UUID | str, + function_id: str, + execution_id: UUID | str, + *, + direction: DurableMessageDirection | Unset = UNSET, + name: str | Unset = UNSET, + after: int | Unset = 0, + limit: int | Unset = 100, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + json_direction: str | Unset = UNSET + if not isinstance(direction, Unset): + json_direction = direction + + params["direction"] = json_direction + + params["name"] = name + + params["after"] = after + + params["limit"] = limit + + + 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}/durable-functions/{function_id}/executions/{execution_id}/messages".format(id=quote(str(id), safe=""),function_id=quote(str(function_id), safe=""),execution_id=quote(str(execution_id), safe=""),), + "params": params, + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> DurableMessageList | Error | None: + if response.status_code == 200: + response_200 = DurableMessageList.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[DurableMessageList | 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, + function_id: str, + execution_id: UUID | str, + *, + client: AuthenticatedClient, + direction: DurableMessageDirection | Unset = UNSET, + name: str | Unset = UNSET, + after: int | Unset = 0, + limit: int | Unset = 100, + +) -> Response[DurableMessageList | Error]: + """ List a durable execution's messages + + Lists the messages sent to and published by an execution, oldest + first. Pass the last `seq` you read as `after` to read only what came + next. + + Project access tokens can list messages, including read-only ones. + + Args: + id (UUID): + function_id (str): + execution_id (UUID): + direction (DurableMessageDirection | Unset): `in` is a message sent to the execution. + `out` is one the execution + published. + name (str | Unset): The name a workflow waits on or publishes under: up to 237 printable + ASCII characters. + after (int | Unset): Default: 0. + limit (int | Unset): Default: 100. + + 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[DurableMessageList | Error] + """ + + + kwargs = request_kwargs( + id=id, +function_id=function_id, +execution_id=execution_id, +direction=direction, +name=name, +after=after, +limit=limit, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + id: UUID | str, + function_id: str, + execution_id: UUID | str, + *, + client: AuthenticatedClient, + direction: DurableMessageDirection | Unset = UNSET, + name: str | Unset = UNSET, + after: int | Unset = 0, + limit: int | Unset = 100, + +) -> DurableMessageList | Error | None: + """ List a durable execution's messages + + Lists the messages sent to and published by an execution, oldest + first. Pass the last `seq` you read as `after` to read only what came + next. + + Project access tokens can list messages, including read-only ones. + + Args: + id (UUID): + function_id (str): + execution_id (UUID): + direction (DurableMessageDirection | Unset): `in` is a message sent to the execution. + `out` is one the execution + published. + name (str | Unset): The name a workflow waits on or publishes under: up to 237 printable + ASCII characters. + after (int | Unset): Default: 0. + limit (int | Unset): Default: 100. + + 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: + DurableMessageList | Error + """ + + + return sync_detailed( + id=id, +function_id=function_id, +execution_id=execution_id, +client=client, +direction=direction, +name=name, +after=after, +limit=limit, + + ).parsed + +async def asyncio_detailed( + id: UUID | str, + function_id: str, + execution_id: UUID | str, + *, + client: AuthenticatedClient, + direction: DurableMessageDirection | Unset = UNSET, + name: str | Unset = UNSET, + after: int | Unset = 0, + limit: int | Unset = 100, + +) -> Response[DurableMessageList | Error]: + """ List a durable execution's messages + + Lists the messages sent to and published by an execution, oldest + first. Pass the last `seq` you read as `after` to read only what came + next. + + Project access tokens can list messages, including read-only ones. + + Args: + id (UUID): + function_id (str): + execution_id (UUID): + direction (DurableMessageDirection | Unset): `in` is a message sent to the execution. + `out` is one the execution + published. + name (str | Unset): The name a workflow waits on or publishes under: up to 237 printable + ASCII characters. + after (int | Unset): Default: 0. + limit (int | Unset): Default: 100. + + 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[DurableMessageList | Error] + """ + + + kwargs = request_kwargs( + id=id, +function_id=function_id, +execution_id=execution_id, +direction=direction, +name=name, +after=after, +limit=limit, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + id: UUID | str, + function_id: str, + execution_id: UUID | str, + *, + client: AuthenticatedClient, + direction: DurableMessageDirection | Unset = UNSET, + name: str | Unset = UNSET, + after: int | Unset = 0, + limit: int | Unset = 100, + +) -> DurableMessageList | Error | None: + """ List a durable execution's messages + + Lists the messages sent to and published by an execution, oldest + first. Pass the last `seq` you read as `after` to read only what came + next. + + Project access tokens can list messages, including read-only ones. + + Args: + id (UUID): + function_id (str): + execution_id (UUID): + direction (DurableMessageDirection | Unset): `in` is a message sent to the execution. + `out` is one the execution + published. + name (str | Unset): The name a workflow waits on or publishes under: up to 237 printable + ASCII characters. + after (int | Unset): Default: 0. + limit (int | Unset): Default: 100. + + 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: + DurableMessageList | Error + """ + + + return (await asyncio_detailed( + id=id, +function_id=function_id, +execution_id=execution_id, +client=client, +direction=direction, +name=name, +after=after, +limit=limit, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/durable_functions/list_durable_messages_from_application.py b/src/volcano_sdk/_generated/api/durable_functions/list_durable_messages_from_application.py new file mode 100644 index 00000000..2cf358eb --- /dev/null +++ b/src/volcano_sdk/_generated/api/durable_functions/list_durable_messages_from_application.py @@ -0,0 +1,359 @@ +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.durable_message_direction import check_durable_message_direction +from ...models.durable_message_direction import DurableMessageDirection +from ...models.durable_message_list import DurableMessageList +from ...models.error import Error +from ...types import UNSET, Unset +from typing import cast +from uuid import UUID + + + +def request_kwargs( + function_id: str, + execution_id: UUID | str, + *, + direction: DurableMessageDirection | Unset = UNSET, + name: str | Unset = UNSET, + after: int | Unset = 0, + limit: int | Unset = 100, + x_volcano_client_token: str | Unset = UNSET, + +) -> dict[str, Any]: + headers: dict[str, Any] = {} + if not isinstance(x_volcano_client_token, Unset): + headers["X-Volcano-Client-Token"] = x_volcano_client_token + + + + + + params: dict[str, Any] = {} + + json_direction: str | Unset = UNSET + if not isinstance(direction, Unset): + json_direction = direction + + params["direction"] = json_direction + + params["name"] = name + + params["after"] = after + + params["limit"] = limit + + + 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": "/durable-functions/{function_id}/executions/{execution_id}/messages".format(function_id=quote(str(function_id), safe=""),execution_id=quote(str(execution_id), safe=""),), + "params": params, + } + + + _kwargs["headers"] = headers + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> DurableMessageList | Error | None: + if response.status_code == 200: + response_200 = DurableMessageList.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 == 429: + response_429 = Error.from_dict(response.json()) + + + + return response_429 + + 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[DurableMessageList | 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( + function_id: str, + execution_id: UUID | str, + *, + client: AuthenticatedClient, + direction: DurableMessageDirection | Unset = UNSET, + name: str | Unset = UNSET, + after: int | Unset = 0, + limit: int | Unset = 100, + x_volcano_client_token: str | Unset = UNSET, + +) -> Response[DurableMessageList | Error]: + """ List a durable execution's messages from an application + + Lists the messages sent to and published by an execution, oldest + first. Pass the last `seq` you read as `after` to read only what came + next; that is how a client catches up after a live subscription + reconnects. + + Access follows the same rules as sending. + + Args: + function_id (str): + execution_id (UUID): + direction (DurableMessageDirection | Unset): `in` is a message sent to the execution. + `out` is one the execution + published. + name (str | Unset): The name a workflow waits on or publishes under: up to 237 printable + ASCII characters. + after (int | Unset): Default: 0. + limit (int | Unset): Default: 100. + x_volcano_client_token (str | 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[DurableMessageList | Error] + """ + + + kwargs = request_kwargs( + function_id=function_id, +execution_id=execution_id, +direction=direction, +name=name, +after=after, +limit=limit, +x_volcano_client_token=x_volcano_client_token, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + function_id: str, + execution_id: UUID | str, + *, + client: AuthenticatedClient, + direction: DurableMessageDirection | Unset = UNSET, + name: str | Unset = UNSET, + after: int | Unset = 0, + limit: int | Unset = 100, + x_volcano_client_token: str | Unset = UNSET, + +) -> DurableMessageList | Error | None: + """ List a durable execution's messages from an application + + Lists the messages sent to and published by an execution, oldest + first. Pass the last `seq` you read as `after` to read only what came + next; that is how a client catches up after a live subscription + reconnects. + + Access follows the same rules as sending. + + Args: + function_id (str): + execution_id (UUID): + direction (DurableMessageDirection | Unset): `in` is a message sent to the execution. + `out` is one the execution + published. + name (str | Unset): The name a workflow waits on or publishes under: up to 237 printable + ASCII characters. + after (int | Unset): Default: 0. + limit (int | Unset): Default: 100. + x_volcano_client_token (str | 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: + DurableMessageList | Error + """ + + + return sync_detailed( + function_id=function_id, +execution_id=execution_id, +client=client, +direction=direction, +name=name, +after=after, +limit=limit, +x_volcano_client_token=x_volcano_client_token, + + ).parsed + +async def asyncio_detailed( + function_id: str, + execution_id: UUID | str, + *, + client: AuthenticatedClient, + direction: DurableMessageDirection | Unset = UNSET, + name: str | Unset = UNSET, + after: int | Unset = 0, + limit: int | Unset = 100, + x_volcano_client_token: str | Unset = UNSET, + +) -> Response[DurableMessageList | Error]: + """ List a durable execution's messages from an application + + Lists the messages sent to and published by an execution, oldest + first. Pass the last `seq` you read as `after` to read only what came + next; that is how a client catches up after a live subscription + reconnects. + + Access follows the same rules as sending. + + Args: + function_id (str): + execution_id (UUID): + direction (DurableMessageDirection | Unset): `in` is a message sent to the execution. + `out` is one the execution + published. + name (str | Unset): The name a workflow waits on or publishes under: up to 237 printable + ASCII characters. + after (int | Unset): Default: 0. + limit (int | Unset): Default: 100. + x_volcano_client_token (str | 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[DurableMessageList | Error] + """ + + + kwargs = request_kwargs( + function_id=function_id, +execution_id=execution_id, +direction=direction, +name=name, +after=after, +limit=limit, +x_volcano_client_token=x_volcano_client_token, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + function_id: str, + execution_id: UUID | str, + *, + client: AuthenticatedClient, + direction: DurableMessageDirection | Unset = UNSET, + name: str | Unset = UNSET, + after: int | Unset = 0, + limit: int | Unset = 100, + x_volcano_client_token: str | Unset = UNSET, + +) -> DurableMessageList | Error | None: + """ List a durable execution's messages from an application + + Lists the messages sent to and published by an execution, oldest + first. Pass the last `seq` you read as `after` to read only what came + next; that is how a client catches up after a live subscription + reconnects. + + Access follows the same rules as sending. + + Args: + function_id (str): + execution_id (UUID): + direction (DurableMessageDirection | Unset): `in` is a message sent to the execution. + `out` is one the execution + published. + name (str | Unset): The name a workflow waits on or publishes under: up to 237 printable + ASCII characters. + after (int | Unset): Default: 0. + limit (int | Unset): Default: 100. + x_volcano_client_token (str | 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: + DurableMessageList | Error + """ + + + return (await asyncio_detailed( + function_id=function_id, +execution_id=execution_id, +client=client, +direction=direction, +name=name, +after=after, +limit=limit, +x_volcano_client_token=x_volcano_client_token, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/durable_functions/open_durable_message_session.py b/src/volcano_sdk/_generated/api/durable_functions/open_durable_message_session.py new file mode 100644 index 00000000..91c5c8ad --- /dev/null +++ b/src/volcano_sdk/_generated/api/durable_functions/open_durable_message_session.py @@ -0,0 +1,272 @@ +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.durable_message_session_registration import DurableMessageSessionRegistration +from ...models.error import Error +from ...models.open_durable_message_session_request import OpenDurableMessageSessionRequest +from typing import cast + + + +def request_kwargs( + *, + body: OpenDurableMessageSessionRequest, + +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + + + + + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/durable-messages/sessions", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> DurableMessageSessionRegistration | Error | None: + if response.status_code == 200: + response_200 = DurableMessageSessionRegistration.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 201: + response_201 = DurableMessageSessionRegistration.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 == 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 == 413: + response_413 = Error.from_dict(response.json()) + + + + return response_413 + + if response.status_code == 429: + response_429 = Error.from_dict(response.json()) + + + + return response_429 + + 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[DurableMessageSessionRegistration | 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( + *, + client: AuthenticatedClient | Client, + body: OpenDurableMessageSessionRequest, + +) -> Response[DurableMessageSessionRegistration | Error]: + """ Open a messages session from inside a workflow + + Opens the session a workflow publishes messages with. The Volcano SDK + calls this once per workflow context, on its first `ctx.publish`; + applications do not call it directly. + + As for a wait, `execution_ref` and `callback_id` are the credential. + The session's token is delivered to the workflow itself and never + appears in a response. + + Retrying is safe: a request for a session that is already registered + returns it with `200`. + + Args: + body (OpenDurableMessageSessionRequest): + + 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[DurableMessageSessionRegistration | Error] + """ + + + kwargs = request_kwargs( + body=body, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient | Client, + body: OpenDurableMessageSessionRequest, + +) -> DurableMessageSessionRegistration | Error | None: + """ Open a messages session from inside a workflow + + Opens the session a workflow publishes messages with. The Volcano SDK + calls this once per workflow context, on its first `ctx.publish`; + applications do not call it directly. + + As for a wait, `execution_ref` and `callback_id` are the credential. + The session's token is delivered to the workflow itself and never + appears in a response. + + Retrying is safe: a request for a session that is already registered + returns it with `200`. + + Args: + body (OpenDurableMessageSessionRequest): + + 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: + DurableMessageSessionRegistration | Error + """ + + + return sync_detailed( + client=client, +body=body, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + body: OpenDurableMessageSessionRequest, + +) -> Response[DurableMessageSessionRegistration | Error]: + """ Open a messages session from inside a workflow + + Opens the session a workflow publishes messages with. The Volcano SDK + calls this once per workflow context, on its first `ctx.publish`; + applications do not call it directly. + + As for a wait, `execution_ref` and `callback_id` are the credential. + The session's token is delivered to the workflow itself and never + appears in a response. + + Retrying is safe: a request for a session that is already registered + returns it with `200`. + + Args: + body (OpenDurableMessageSessionRequest): + + 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[DurableMessageSessionRegistration | Error] + """ + + + kwargs = request_kwargs( + body=body, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient | Client, + body: OpenDurableMessageSessionRequest, + +) -> DurableMessageSessionRegistration | Error | None: + """ Open a messages session from inside a workflow + + Opens the session a workflow publishes messages with. The Volcano SDK + calls this once per workflow context, on its first `ctx.publish`; + applications do not call it directly. + + As for a wait, `execution_ref` and `callback_id` are the credential. + The session's token is delivered to the workflow itself and never + appears in a response. + + Retrying is safe: a request for a session that is already registered + returns it with `200`. + + Args: + body (OpenDurableMessageSessionRequest): + + 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: + DurableMessageSessionRegistration | Error + """ + + + return (await asyncio_detailed( + client=client, +body=body, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/durable_functions/publish_durable_message.py b/src/volcano_sdk/_generated/api/durable_functions/publish_durable_message.py new file mode 100644 index 00000000..c2227628 --- /dev/null +++ b/src/volcano_sdk/_generated/api/durable_functions/publish_durable_message.py @@ -0,0 +1,298 @@ +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.durable_message import DurableMessage +from ...models.error import Error +from ...models.publish_durable_message_request import PublishDurableMessageRequest +from ...types import UNSET, Unset +from typing import cast + + + +def request_kwargs( + *, + body: PublishDurableMessageRequest, + x_volcano_durable_session: str, + idempotency_key: str | Unset = UNSET, + +) -> dict[str, Any]: + headers: dict[str, Any] = {} + headers["X-Volcano-Durable-Session"] = x_volcano_durable_session + + if not isinstance(idempotency_key, Unset): + headers["Idempotency-Key"] = idempotency_key + + + + + + + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/durable-messages/publish", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> DurableMessage | Error | None: + if response.status_code == 200: + response_200 = DurableMessage.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 201: + response_201 = DurableMessage.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 == 409: + response_409 = Error.from_dict(response.json()) + + + + return response_409 + + if response.status_code == 413: + response_413 = Error.from_dict(response.json()) + + + + return response_413 + + 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[DurableMessage | 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( + *, + client: AuthenticatedClient | Client, + body: PublishDurableMessageRequest, + x_volcano_durable_session: str, + idempotency_key: str | Unset = UNSET, + +) -> Response[DurableMessage | Error]: + """ Publish a message from inside a workflow + + Publishes a named message from a running workflow. The Volcano SDK + calls this from `ctx.publish`; applications do not call it directly. + + The message is stored, listed with the execution's messages, and + delivered live to clients subscribed to the execution. Live delivery + counts against the project's Realtime messages. + + The SDK sends an `Idempotency-Key` that a rerun of the publishing step + repeats, so a step that runs again returns the first message with + `200` and stores nothing new. That message is delivered live again, + and counts again, because the first run may have stopped before + subscribers got it. The SDKs deliver it to a subscriber once. + + Args: + x_volcano_durable_session (str): + idempotency_key (str | Unset): + body (PublishDurableMessageRequest): + + 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[DurableMessage | Error] + """ + + + kwargs = request_kwargs( + body=body, +x_volcano_durable_session=x_volcano_durable_session, +idempotency_key=idempotency_key, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient | Client, + body: PublishDurableMessageRequest, + x_volcano_durable_session: str, + idempotency_key: str | Unset = UNSET, + +) -> DurableMessage | Error | None: + """ Publish a message from inside a workflow + + Publishes a named message from a running workflow. The Volcano SDK + calls this from `ctx.publish`; applications do not call it directly. + + The message is stored, listed with the execution's messages, and + delivered live to clients subscribed to the execution. Live delivery + counts against the project's Realtime messages. + + The SDK sends an `Idempotency-Key` that a rerun of the publishing step + repeats, so a step that runs again returns the first message with + `200` and stores nothing new. That message is delivered live again, + and counts again, because the first run may have stopped before + subscribers got it. The SDKs deliver it to a subscriber once. + + Args: + x_volcano_durable_session (str): + idempotency_key (str | Unset): + body (PublishDurableMessageRequest): + + 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: + DurableMessage | Error + """ + + + return sync_detailed( + client=client, +body=body, +x_volcano_durable_session=x_volcano_durable_session, +idempotency_key=idempotency_key, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + body: PublishDurableMessageRequest, + x_volcano_durable_session: str, + idempotency_key: str | Unset = UNSET, + +) -> Response[DurableMessage | Error]: + """ Publish a message from inside a workflow + + Publishes a named message from a running workflow. The Volcano SDK + calls this from `ctx.publish`; applications do not call it directly. + + The message is stored, listed with the execution's messages, and + delivered live to clients subscribed to the execution. Live delivery + counts against the project's Realtime messages. + + The SDK sends an `Idempotency-Key` that a rerun of the publishing step + repeats, so a step that runs again returns the first message with + `200` and stores nothing new. That message is delivered live again, + and counts again, because the first run may have stopped before + subscribers got it. The SDKs deliver it to a subscriber once. + + Args: + x_volcano_durable_session (str): + idempotency_key (str | Unset): + body (PublishDurableMessageRequest): + + 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[DurableMessage | Error] + """ + + + kwargs = request_kwargs( + body=body, +x_volcano_durable_session=x_volcano_durable_session, +idempotency_key=idempotency_key, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient | Client, + body: PublishDurableMessageRequest, + x_volcano_durable_session: str, + idempotency_key: str | Unset = UNSET, + +) -> DurableMessage | Error | None: + """ Publish a message from inside a workflow + + Publishes a named message from a running workflow. The Volcano SDK + calls this from `ctx.publish`; applications do not call it directly. + + The message is stored, listed with the execution's messages, and + delivered live to clients subscribed to the execution. Live delivery + counts against the project's Realtime messages. + + The SDK sends an `Idempotency-Key` that a rerun of the publishing step + repeats, so a step that runs again returns the first message with + `200` and stores nothing new. That message is delivered live again, + and counts again, because the first run may have stopped before + subscribers got it. The SDKs deliver it to a subscriber once. + + Args: + x_volcano_durable_session (str): + idempotency_key (str | Unset): + body (PublishDurableMessageRequest): + + 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: + DurableMessage | Error + """ + + + return (await asyncio_detailed( + client=client, +body=body, +x_volcano_durable_session=x_volcano_durable_session, +idempotency_key=idempotency_key, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/durable_functions/register_durable_message_wait.py b/src/volcano_sdk/_generated/api/durable_functions/register_durable_message_wait.py new file mode 100644 index 00000000..e5d4fc2e --- /dev/null +++ b/src/volcano_sdk/_generated/api/durable_functions/register_durable_message_wait.py @@ -0,0 +1,272 @@ +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.durable_message_wait_registration import DurableMessageWaitRegistration +from ...models.error import Error +from ...models.register_durable_message_wait_request import RegisterDurableMessageWaitRequest +from typing import cast + + + +def request_kwargs( + *, + body: RegisterDurableMessageWaitRequest, + +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + + + + + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/durable-messages/waits", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> DurableMessageWaitRegistration | Error | None: + if response.status_code == 200: + response_200 = DurableMessageWaitRegistration.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 201: + response_201 = DurableMessageWaitRegistration.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 == 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 == 413: + response_413 = Error.from_dict(response.json()) + + + + return response_413 + + if response.status_code == 429: + response_429 = Error.from_dict(response.json()) + + + + return response_429 + + 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[DurableMessageWaitRegistration | 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( + *, + client: AuthenticatedClient | Client, + body: RegisterDurableMessageWaitRequest, + +) -> Response[DurableMessageWaitRegistration | Error]: + """ Wait for a message from inside a workflow + + Registers a wait for a named message. The Volcano SDK calls this from + `ctx.waitForMessage`; applications do not call it directly. + + `execution_ref` and `callback_id` are opaque values the SDK reads from + the running workflow. Together they are the request's credential, so + the operation takes no other authentication. When a message for the + name is already queued, the wait takes the oldest one at once. + + Retrying is safe: a request for a wait that is already registered + returns it with `200`. + + Args: + body (RegisterDurableMessageWaitRequest): + + 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[DurableMessageWaitRegistration | Error] + """ + + + kwargs = request_kwargs( + body=body, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient | Client, + body: RegisterDurableMessageWaitRequest, + +) -> DurableMessageWaitRegistration | Error | None: + """ Wait for a message from inside a workflow + + Registers a wait for a named message. The Volcano SDK calls this from + `ctx.waitForMessage`; applications do not call it directly. + + `execution_ref` and `callback_id` are opaque values the SDK reads from + the running workflow. Together they are the request's credential, so + the operation takes no other authentication. When a message for the + name is already queued, the wait takes the oldest one at once. + + Retrying is safe: a request for a wait that is already registered + returns it with `200`. + + Args: + body (RegisterDurableMessageWaitRequest): + + 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: + DurableMessageWaitRegistration | Error + """ + + + return sync_detailed( + client=client, +body=body, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + body: RegisterDurableMessageWaitRequest, + +) -> Response[DurableMessageWaitRegistration | Error]: + """ Wait for a message from inside a workflow + + Registers a wait for a named message. The Volcano SDK calls this from + `ctx.waitForMessage`; applications do not call it directly. + + `execution_ref` and `callback_id` are opaque values the SDK reads from + the running workflow. Together they are the request's credential, so + the operation takes no other authentication. When a message for the + name is already queued, the wait takes the oldest one at once. + + Retrying is safe: a request for a wait that is already registered + returns it with `200`. + + Args: + body (RegisterDurableMessageWaitRequest): + + 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[DurableMessageWaitRegistration | Error] + """ + + + kwargs = request_kwargs( + body=body, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient | Client, + body: RegisterDurableMessageWaitRequest, + +) -> DurableMessageWaitRegistration | Error | None: + """ Wait for a message from inside a workflow + + Registers a wait for a named message. The Volcano SDK calls this from + `ctx.waitForMessage`; applications do not call it directly. + + `execution_ref` and `callback_id` are opaque values the SDK reads from + the running workflow. Together they are the request's credential, so + the operation takes no other authentication. When a message for the + name is already queued, the wait takes the oldest one at once. + + Retrying is safe: a request for a wait that is already registered + returns it with `200`. + + Args: + body (RegisterDurableMessageWaitRequest): + + 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: + DurableMessageWaitRegistration | Error + """ + + + return (await asyncio_detailed( + client=client, +body=body, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/durable_functions/send_durable_message.py b/src/volcano_sdk/_generated/api/durable_functions/send_durable_message.py new file mode 100644 index 00000000..2a49a741 --- /dev/null +++ b/src/volcano_sdk/_generated/api/durable_functions/send_durable_message.py @@ -0,0 +1,321 @@ +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.durable_message import DurableMessage +from ...models.error import Error +from ...models.send_durable_message_request import SendDurableMessageRequest +from ...types import UNSET, Unset +from typing import cast +from uuid import UUID + + + +def request_kwargs( + id: UUID | str, + function_id: str, + execution_id: UUID | str, + *, + body: SendDurableMessageRequest, + idempotency_key: str | Unset = UNSET, + +) -> dict[str, Any]: + headers: dict[str, Any] = {} + if not isinstance(idempotency_key, Unset): + headers["Idempotency-Key"] = idempotency_key + + + + + + + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/projects/{id}/durable-functions/{function_id}/executions/{execution_id}/messages".format(id=quote(str(id), safe=""),function_id=quote(str(function_id), safe=""),execution_id=quote(str(execution_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) -> DurableMessage | Error | None: + if response.status_code == 200: + response_200 = DurableMessage.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 201: + response_201 = DurableMessage.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 == 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 == 413: + response_413 = Error.from_dict(response.json()) + + + + return response_413 + + if response.status_code == 429: + response_429 = Error.from_dict(response.json()) + + + + return response_429 + + 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[DurableMessage | 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, + function_id: str, + execution_id: UUID | str, + *, + client: AuthenticatedClient, + body: SendDurableMessageRequest, + idempotency_key: str | Unset = UNSET, + +) -> Response[DurableMessage | Error]: + """ Send a message to a durable execution + + Sends a named message to a running execution, as + `POST /durable-functions/{functionId}/executions/{executionId}/messages` + does for an application. The workflow receives it from + `ctx.waitForMessage` with the same name; until then it is kept, and + waits take messages oldest first. + + Project access tokens can send messages, but read-only ones cannot. + A message never decides an approval. + + Args: + id (UUID): + function_id (str): + execution_id (UUID): + idempotency_key (str | Unset): + body (SendDurableMessageRequest): + + 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[DurableMessage | Error] + """ + + + kwargs = request_kwargs( + id=id, +function_id=function_id, +execution_id=execution_id, +body=body, +idempotency_key=idempotency_key, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + id: UUID | str, + function_id: str, + execution_id: UUID | str, + *, + client: AuthenticatedClient, + body: SendDurableMessageRequest, + idempotency_key: str | Unset = UNSET, + +) -> DurableMessage | Error | None: + """ Send a message to a durable execution + + Sends a named message to a running execution, as + `POST /durable-functions/{functionId}/executions/{executionId}/messages` + does for an application. The workflow receives it from + `ctx.waitForMessage` with the same name; until then it is kept, and + waits take messages oldest first. + + Project access tokens can send messages, but read-only ones cannot. + A message never decides an approval. + + Args: + id (UUID): + function_id (str): + execution_id (UUID): + idempotency_key (str | Unset): + body (SendDurableMessageRequest): + + 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: + DurableMessage | Error + """ + + + return sync_detailed( + id=id, +function_id=function_id, +execution_id=execution_id, +client=client, +body=body, +idempotency_key=idempotency_key, + + ).parsed + +async def asyncio_detailed( + id: UUID | str, + function_id: str, + execution_id: UUID | str, + *, + client: AuthenticatedClient, + body: SendDurableMessageRequest, + idempotency_key: str | Unset = UNSET, + +) -> Response[DurableMessage | Error]: + """ Send a message to a durable execution + + Sends a named message to a running execution, as + `POST /durable-functions/{functionId}/executions/{executionId}/messages` + does for an application. The workflow receives it from + `ctx.waitForMessage` with the same name; until then it is kept, and + waits take messages oldest first. + + Project access tokens can send messages, but read-only ones cannot. + A message never decides an approval. + + Args: + id (UUID): + function_id (str): + execution_id (UUID): + idempotency_key (str | Unset): + body (SendDurableMessageRequest): + + 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[DurableMessage | Error] + """ + + + kwargs = request_kwargs( + id=id, +function_id=function_id, +execution_id=execution_id, +body=body, +idempotency_key=idempotency_key, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + id: UUID | str, + function_id: str, + execution_id: UUID | str, + *, + client: AuthenticatedClient, + body: SendDurableMessageRequest, + idempotency_key: str | Unset = UNSET, + +) -> DurableMessage | Error | None: + """ Send a message to a durable execution + + Sends a named message to a running execution, as + `POST /durable-functions/{functionId}/executions/{executionId}/messages` + does for an application. The workflow receives it from + `ctx.waitForMessage` with the same name; until then it is kept, and + waits take messages oldest first. + + Project access tokens can send messages, but read-only ones cannot. + A message never decides an approval. + + Args: + id (UUID): + function_id (str): + execution_id (UUID): + idempotency_key (str | Unset): + body (SendDurableMessageRequest): + + 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: + DurableMessage | Error + """ + + + return (await asyncio_detailed( + id=id, +function_id=function_id, +execution_id=execution_id, +client=client, +body=body, +idempotency_key=idempotency_key, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/durable_functions/send_durable_message_from_application.py b/src/volcano_sdk/_generated/api/durable_functions/send_durable_message_from_application.py new file mode 100644 index 00000000..bed60a85 --- /dev/null +++ b/src/volcano_sdk/_generated/api/durable_functions/send_durable_message_from_application.py @@ -0,0 +1,394 @@ +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.durable_message import DurableMessage +from ...models.error import Error +from ...models.send_durable_message_request import SendDurableMessageRequest +from ...types import UNSET, Unset +from typing import cast +from uuid import UUID + + + +def request_kwargs( + function_id: str, + execution_id: UUID | str, + *, + body: SendDurableMessageRequest, + idempotency_key: str | Unset = UNSET, + x_volcano_client_token: str | Unset = UNSET, + +) -> dict[str, Any]: + headers: dict[str, Any] = {} + if not isinstance(idempotency_key, Unset): + headers["Idempotency-Key"] = idempotency_key + + if not isinstance(x_volcano_client_token, Unset): + headers["X-Volcano-Client-Token"] = x_volcano_client_token + + + + + + + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/durable-functions/{function_id}/executions/{execution_id}/messages".format(function_id=quote(str(function_id), safe=""),execution_id=quote(str(execution_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) -> DurableMessage | Error | None: + if response.status_code == 200: + response_200 = DurableMessage.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 201: + response_201 = DurableMessage.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 == 413: + response_413 = Error.from_dict(response.json()) + + + + return response_413 + + if response.status_code == 429: + response_429 = Error.from_dict(response.json()) + + + + return response_429 + + 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[DurableMessage | 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( + function_id: str, + execution_id: UUID | str, + *, + client: AuthenticatedClient, + body: SendDurableMessageRequest, + idempotency_key: str | Unset = UNSET, + x_volcano_client_token: str | Unset = UNSET, + +) -> Response[DurableMessage | Error]: + """ Send a message to a durable execution from an application + + Sends a named message to a running execution. The workflow receives it + from `ctx.waitForMessage` with the same name. A message sent before + anything waits for its name is kept, and each wait takes the oldest + one, so messages arrive in the order they were sent. + + Messages never decide an approval: a workflow waiting in + `ctx.waitForApproval` is not resumed by one. + + **With a service key:** any execution in the project. + + **With an auth user token:** an execution the user started, or one + whose `X-Volcano-Client-Token` the request carries, of a durable + function whose `visibility` is `authenticated` or `public`. + + **With an anon key:** an execution whose `X-Volcano-Client-Token` the + request carries, of a function with `visibility: public`. + + Any other execution answers `404`, as a missing one does. + + Send `Idempotency-Key` to make a retry safe: a repeat with a key the + same sender has used on the execution returns the first message with + `200` and sends nothing. + + Args: + function_id (str): + execution_id (UUID): + idempotency_key (str | Unset): + x_volcano_client_token (str | Unset): + body (SendDurableMessageRequest): + + 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[DurableMessage | Error] + """ + + + kwargs = request_kwargs( + function_id=function_id, +execution_id=execution_id, +body=body, +idempotency_key=idempotency_key, +x_volcano_client_token=x_volcano_client_token, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + function_id: str, + execution_id: UUID | str, + *, + client: AuthenticatedClient, + body: SendDurableMessageRequest, + idempotency_key: str | Unset = UNSET, + x_volcano_client_token: str | Unset = UNSET, + +) -> DurableMessage | Error | None: + """ Send a message to a durable execution from an application + + Sends a named message to a running execution. The workflow receives it + from `ctx.waitForMessage` with the same name. A message sent before + anything waits for its name is kept, and each wait takes the oldest + one, so messages arrive in the order they were sent. + + Messages never decide an approval: a workflow waiting in + `ctx.waitForApproval` is not resumed by one. + + **With a service key:** any execution in the project. + + **With an auth user token:** an execution the user started, or one + whose `X-Volcano-Client-Token` the request carries, of a durable + function whose `visibility` is `authenticated` or `public`. + + **With an anon key:** an execution whose `X-Volcano-Client-Token` the + request carries, of a function with `visibility: public`. + + Any other execution answers `404`, as a missing one does. + + Send `Idempotency-Key` to make a retry safe: a repeat with a key the + same sender has used on the execution returns the first message with + `200` and sends nothing. + + Args: + function_id (str): + execution_id (UUID): + idempotency_key (str | Unset): + x_volcano_client_token (str | Unset): + body (SendDurableMessageRequest): + + 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: + DurableMessage | Error + """ + + + return sync_detailed( + function_id=function_id, +execution_id=execution_id, +client=client, +body=body, +idempotency_key=idempotency_key, +x_volcano_client_token=x_volcano_client_token, + + ).parsed + +async def asyncio_detailed( + function_id: str, + execution_id: UUID | str, + *, + client: AuthenticatedClient, + body: SendDurableMessageRequest, + idempotency_key: str | Unset = UNSET, + x_volcano_client_token: str | Unset = UNSET, + +) -> Response[DurableMessage | Error]: + """ Send a message to a durable execution from an application + + Sends a named message to a running execution. The workflow receives it + from `ctx.waitForMessage` with the same name. A message sent before + anything waits for its name is kept, and each wait takes the oldest + one, so messages arrive in the order they were sent. + + Messages never decide an approval: a workflow waiting in + `ctx.waitForApproval` is not resumed by one. + + **With a service key:** any execution in the project. + + **With an auth user token:** an execution the user started, or one + whose `X-Volcano-Client-Token` the request carries, of a durable + function whose `visibility` is `authenticated` or `public`. + + **With an anon key:** an execution whose `X-Volcano-Client-Token` the + request carries, of a function with `visibility: public`. + + Any other execution answers `404`, as a missing one does. + + Send `Idempotency-Key` to make a retry safe: a repeat with a key the + same sender has used on the execution returns the first message with + `200` and sends nothing. + + Args: + function_id (str): + execution_id (UUID): + idempotency_key (str | Unset): + x_volcano_client_token (str | Unset): + body (SendDurableMessageRequest): + + 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[DurableMessage | Error] + """ + + + kwargs = request_kwargs( + function_id=function_id, +execution_id=execution_id, +body=body, +idempotency_key=idempotency_key, +x_volcano_client_token=x_volcano_client_token, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + function_id: str, + execution_id: UUID | str, + *, + client: AuthenticatedClient, + body: SendDurableMessageRequest, + idempotency_key: str | Unset = UNSET, + x_volcano_client_token: str | Unset = UNSET, + +) -> DurableMessage | Error | None: + """ Send a message to a durable execution from an application + + Sends a named message to a running execution. The workflow receives it + from `ctx.waitForMessage` with the same name. A message sent before + anything waits for its name is kept, and each wait takes the oldest + one, so messages arrive in the order they were sent. + + Messages never decide an approval: a workflow waiting in + `ctx.waitForApproval` is not resumed by one. + + **With a service key:** any execution in the project. + + **With an auth user token:** an execution the user started, or one + whose `X-Volcano-Client-Token` the request carries, of a durable + function whose `visibility` is `authenticated` or `public`. + + **With an anon key:** an execution whose `X-Volcano-Client-Token` the + request carries, of a function with `visibility: public`. + + Any other execution answers `404`, as a missing one does. + + Send `Idempotency-Key` to make a retry safe: a repeat with a key the + same sender has used on the execution returns the first message with + `200` and sends nothing. + + Args: + function_id (str): + execution_id (UUID): + idempotency_key (str | Unset): + x_volcano_client_token (str | Unset): + body (SendDurableMessageRequest): + + 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: + DurableMessage | Error + """ + + + return (await asyncio_detailed( + function_id=function_id, +execution_id=execution_id, +client=client, +body=body, +idempotency_key=idempotency_key, +x_volcano_client_token=x_volcano_client_token, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/frontends/create_frontend.py b/src/volcano_sdk/_generated/api/frontends/create_frontend.py index 7c94b624..1509d39f 100644 --- a/src/volcano_sdk/_generated/api/frontends/create_frontend.py +++ b/src/volcano_sdk/_generated/api/frontends/create_frontend.py @@ -152,8 +152,8 @@ def sync_detailed( 22.x or 24.x. The Node.js runtime is inferred from `package.json` `engines.node`; if omitted, Volcano uses Node.js 22.x. The selected Node.js family must also satisfy the installed Next.js package's - `engines.node` constraint. Volcano tests Next 15.5.27 (`^18.18.0 || ^19.8.0 || >=20.0.0`) and Next - 16.4.0 (`>=20.9.0`). + `engines.node` constraint. Volcano tests Next 15.5.28 (`^18.18.0 || ^19.8.0 || >=20.0.0`) and Next + 16.4.2 (`>=20.9.0`). Source archive size is enforced by the API with `SOURCE_ARCHIVE_SIZE_LIMIT_MB`; the CLI does not apply its own source archive size limit. After the final container images are built, the publish build enforces `LAMBDA_TARGET_CONTAINER_SIZE_LIMIT_MB` before pushing. @@ -216,8 +216,8 @@ def sync( 22.x or 24.x. The Node.js runtime is inferred from `package.json` `engines.node`; if omitted, Volcano uses Node.js 22.x. The selected Node.js family must also satisfy the installed Next.js package's - `engines.node` constraint. Volcano tests Next 15.5.27 (`^18.18.0 || ^19.8.0 || >=20.0.0`) and Next - 16.4.0 (`>=20.9.0`). + `engines.node` constraint. Volcano tests Next 15.5.28 (`^18.18.0 || ^19.8.0 || >=20.0.0`) and Next + 16.4.2 (`>=20.9.0`). Source archive size is enforced by the API with `SOURCE_ARCHIVE_SIZE_LIMIT_MB`; the CLI does not apply its own source archive size limit. After the final container images are built, the publish build enforces `LAMBDA_TARGET_CONTAINER_SIZE_LIMIT_MB` before pushing. @@ -275,8 +275,8 @@ async def asyncio_detailed( 22.x or 24.x. The Node.js runtime is inferred from `package.json` `engines.node`; if omitted, Volcano uses Node.js 22.x. The selected Node.js family must also satisfy the installed Next.js package's - `engines.node` constraint. Volcano tests Next 15.5.27 (`^18.18.0 || ^19.8.0 || >=20.0.0`) and Next - 16.4.0 (`>=20.9.0`). + `engines.node` constraint. Volcano tests Next 15.5.28 (`^18.18.0 || ^19.8.0 || >=20.0.0`) and Next + 16.4.2 (`>=20.9.0`). Source archive size is enforced by the API with `SOURCE_ARCHIVE_SIZE_LIMIT_MB`; the CLI does not apply its own source archive size limit. After the final container images are built, the publish build enforces `LAMBDA_TARGET_CONTAINER_SIZE_LIMIT_MB` before pushing. @@ -339,8 +339,8 @@ async def asyncio( 22.x or 24.x. The Node.js runtime is inferred from `package.json` `engines.node`; if omitted, Volcano uses Node.js 22.x. The selected Node.js family must also satisfy the installed Next.js package's - `engines.node` constraint. Volcano tests Next 15.5.27 (`^18.18.0 || ^19.8.0 || >=20.0.0`) and Next - 16.4.0 (`>=20.9.0`). + `engines.node` constraint. Volcano tests Next 15.5.28 (`^18.18.0 || ^19.8.0 || >=20.0.0`) and Next + 16.4.2 (`>=20.9.0`). Source archive size is enforced by the API with `SOURCE_ARCHIVE_SIZE_LIMIT_MB`; the CLI does not apply its own source archive size limit. After the final container images are built, the publish build enforces `LAMBDA_TARGET_CONTAINER_SIZE_LIMIT_MB` before pushing. diff --git a/src/volcano_sdk/_generated/api/functions/invoke_function.py b/src/volcano_sdk/_generated/api/functions/invoke_function.py index 55bf0ed8..bed45f2a 100644 --- a/src/volcano_sdk/_generated/api/functions/invoke_function.py +++ b/src/volcano_sdk/_generated/api/functions/invoke_function.py @@ -151,6 +151,12 @@ def sync_detailed( - Function must have `visibility: public` - Function receives payload only (no `__volcano_auth`) + **Reserved payload keys:** the top-level `__volcano_auth` and + `__volcano_http` keys are reserved. Volcano removes caller-supplied + values for both before the function runs; only an auth user token adds + a server-built `__volcano_auth`, and only HTTP-mode ingress sets + `__volcano_http: true`. + **Transport and CORS:** - This operation is the authenticated direct RPC endpoint and always uses the POST `{payload: ...}` contract, including for functions whose DNS ingress is @@ -236,6 +242,12 @@ def sync( - Function must have `visibility: public` - Function receives payload only (no `__volcano_auth`) + **Reserved payload keys:** the top-level `__volcano_auth` and + `__volcano_http` keys are reserved. Volcano removes caller-supplied + values for both before the function runs; only an auth user token adds + a server-built `__volcano_auth`, and only HTTP-mode ingress sets + `__volcano_http: true`. + **Transport and CORS:** - This operation is the authenticated direct RPC endpoint and always uses the POST `{payload: ...}` contract, including for functions whose DNS ingress is @@ -316,6 +328,12 @@ async def asyncio_detailed( - Function must have `visibility: public` - Function receives payload only (no `__volcano_auth`) + **Reserved payload keys:** the top-level `__volcano_auth` and + `__volcano_http` keys are reserved. Volcano removes caller-supplied + values for both before the function runs; only an auth user token adds + a server-built `__volcano_auth`, and only HTTP-mode ingress sets + `__volcano_http: true`. + **Transport and CORS:** - This operation is the authenticated direct RPC endpoint and always uses the POST `{payload: ...}` contract, including for functions whose DNS ingress is @@ -401,6 +419,12 @@ async def asyncio( - Function must have `visibility: public` - Function receives payload only (no `__volcano_auth`) + **Reserved payload keys:** the top-level `__volcano_auth` and + `__volcano_http` keys are reserved. Volcano removes caller-supplied + values for both before the function runs; only an auth user token adds + a server-built `__volcano_auth`, and only HTTP-mode ingress sets + `__volcano_http: true`. + **Transport and CORS:** - This operation is the authenticated direct RPC endpoint and always uses the POST `{payload: ...}` contract, including for functions whose DNS ingress is diff --git a/src/volcano_sdk/_generated/api/o_auth_authentication/auth_o_auth_exchange.py b/src/volcano_sdk/_generated/api/o_auth_authentication/auth_o_auth_exchange.py index 27018310..24d84ce8 100644 --- a/src/volcano_sdk/_generated/api/o_auth_authentication/auth_o_auth_exchange.py +++ b/src/volcano_sdk/_generated/api/o_auth_authentication/auth_o_auth_exchange.py @@ -10,6 +10,7 @@ from ...models.auth_o_auth_exchange_body import AuthOAuthExchangeBody from ...models.auth_token_response import AuthTokenResponse +from ...types import UNSET, Unset from typing import cast @@ -17,9 +18,17 @@ def request_kwargs( *, body: AuthOAuthExchangeBody, + x_volcano_proxy_authorization: str | Unset = UNSET, + x_volcano_client_ip: str | Unset = UNSET, ) -> dict[str, Any]: headers: dict[str, Any] = {} + if not isinstance(x_volcano_proxy_authorization, Unset): + headers["X-Volcano-Proxy-Authorization"] = x_volcano_proxy_authorization + + if not isinstance(x_volcano_client_ip, Unset): + headers["X-Volcano-Client-IP"] = x_volcano_client_ip + @@ -83,6 +92,8 @@ def sync_detailed( *, client: AuthenticatedClient, body: AuthOAuthExchangeBody, + x_volcano_proxy_authorization: str | Unset = UNSET, + x_volcano_client_ip: str | Unset = UNSET, ) -> Response[Any | AuthTokenResponse]: """ Exchange OAuth authorization code @@ -92,6 +103,8 @@ def sync_detailed( redirect_url that initiated the flow. Args: + x_volcano_proxy_authorization (str | Unset): + x_volcano_client_ip (str | Unset): body (AuthOAuthExchangeBody): Raises: @@ -105,6 +118,8 @@ def sync_detailed( kwargs = request_kwargs( body=body, +x_volcano_proxy_authorization=x_volcano_proxy_authorization, +x_volcano_client_ip=x_volcano_client_ip, ) @@ -118,6 +133,8 @@ def sync( *, client: AuthenticatedClient, body: AuthOAuthExchangeBody, + x_volcano_proxy_authorization: str | Unset = UNSET, + x_volcano_client_ip: str | Unset = UNSET, ) -> Any | AuthTokenResponse | None: """ Exchange OAuth authorization code @@ -127,6 +144,8 @@ def sync( redirect_url that initiated the flow. Args: + x_volcano_proxy_authorization (str | Unset): + x_volcano_client_ip (str | Unset): body (AuthOAuthExchangeBody): Raises: @@ -141,6 +160,8 @@ def sync( return sync_detailed( client=client, body=body, +x_volcano_proxy_authorization=x_volcano_proxy_authorization, +x_volcano_client_ip=x_volcano_client_ip, ).parsed @@ -148,6 +169,8 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: AuthOAuthExchangeBody, + x_volcano_proxy_authorization: str | Unset = UNSET, + x_volcano_client_ip: str | Unset = UNSET, ) -> Response[Any | AuthTokenResponse]: """ Exchange OAuth authorization code @@ -157,6 +180,8 @@ async def asyncio_detailed( redirect_url that initiated the flow. Args: + x_volcano_proxy_authorization (str | Unset): + x_volcano_client_ip (str | Unset): body (AuthOAuthExchangeBody): Raises: @@ -170,6 +195,8 @@ async def asyncio_detailed( kwargs = request_kwargs( body=body, +x_volcano_proxy_authorization=x_volcano_proxy_authorization, +x_volcano_client_ip=x_volcano_client_ip, ) @@ -183,6 +210,8 @@ async def asyncio( *, client: AuthenticatedClient, body: AuthOAuthExchangeBody, + x_volcano_proxy_authorization: str | Unset = UNSET, + x_volcano_client_ip: str | Unset = UNSET, ) -> Any | AuthTokenResponse | None: """ Exchange OAuth authorization code @@ -192,6 +221,8 @@ async def asyncio( redirect_url that initiated the flow. Args: + x_volcano_proxy_authorization (str | Unset): + x_volcano_client_ip (str | Unset): body (AuthOAuthExchangeBody): Raises: @@ -206,5 +237,7 @@ async def asyncio( return (await asyncio_detailed( client=client, body=body, +x_volcano_proxy_authorization=x_volcano_proxy_authorization, +x_volcano_client_ip=x_volcano_client_ip, )).parsed diff --git a/src/volcano_sdk/_generated/api/projects/get_project_health.py b/src/volcano_sdk/_generated/api/projects/get_project_health.py index d7d5ba24..baabcc82 100644 --- a/src/volcano_sdk/_generated/api/projects/get_project_health.py +++ b/src/volcano_sdk/_generated/api/projects/get_project_health.py @@ -97,7 +97,8 @@ def sync_detailed( Returns a fast control-plane health snapshot for the project and its deployed resources. The endpoint does not run live provider probes. A successful request returns 200 even when the project status is - `unhealthy`; transport and authorization failures use HTTP errors. + `degraded` or `critical`; transport and authorization failures use HTTP + errors. Args: id (UUID): @@ -133,7 +134,8 @@ def sync( Returns a fast control-plane health snapshot for the project and its deployed resources. The endpoint does not run live provider probes. A successful request returns 200 even when the project status is - `unhealthy`; transport and authorization failures use HTTP errors. + `degraded` or `critical`; transport and authorization failures use HTTP + errors. Args: id (UUID): @@ -164,7 +166,8 @@ async def asyncio_detailed( Returns a fast control-plane health snapshot for the project and its deployed resources. The endpoint does not run live provider probes. A successful request returns 200 even when the project status is - `unhealthy`; transport and authorization failures use HTTP errors. + `degraded` or `critical`; transport and authorization failures use HTTP + errors. Args: id (UUID): @@ -200,7 +203,8 @@ async def asyncio( Returns a fast control-plane health snapshot for the project and its deployed resources. The endpoint does not run live provider probes. A successful request returns 200 even when the project status is - `unhealthy`; transport and authorization failures use HTTP errors. + `degraded` or `critical`; transport and authorization failures use HTTP + errors. Args: id (UUID): diff --git a/src/volcano_sdk/_generated/api/storage_policies/delete_storage_policy.py b/src/volcano_sdk/_generated/api/storage_policies/delete_storage_policy.py index 5e572294..4b9c0404 100644 --- a/src/volcano_sdk/_generated/api/storage_policies/delete_storage_policy.py +++ b/src/volcano_sdk/_generated/api/storage_policies/delete_storage_policy.py @@ -8,6 +8,8 @@ from ...types import Response, UNSET from ... import errors +from ...models.error import Error +from typing import cast from uuid import UUID @@ -34,9 +36,17 @@ def request_kwargs( -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | Error | None: if response.status_code == 200: - return None + response_200 = cast(Any, None) + 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) @@ -44,7 +54,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any]: +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any | Error]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -60,7 +70,7 @@ def sync_detailed( *, client: AuthenticatedClient, -) -> Response[Any]: +) -> Response[Any | Error]: """ Delete a storage policy Args: @@ -73,7 +83,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any] + Response[Any | Error] """ @@ -90,6 +100,37 @@ def sync_detailed( return build_response(client=client, response=response) +def sync( + id: UUID | str, + bucket_name: str, + policy_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Any | Error | None: + """ Delete a storage policy + + Args: + id (UUID): + bucket_name (str): + policy_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, +bucket_name=bucket_name, +policy_id=policy_id, +client=client, + + ).parsed async def asyncio_detailed( id: UUID | str, @@ -98,7 +139,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, -) -> Response[Any]: +) -> Response[Any | Error]: """ Delete a storage policy Args: @@ -111,7 +152,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any] + Response[Any | Error] """ @@ -128,3 +169,34 @@ async def asyncio_detailed( return build_response(client=client, response=response) +async def asyncio( + id: UUID | str, + bucket_name: str, + policy_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Any | Error | None: + """ Delete a storage policy + + Args: + id (UUID): + bucket_name (str): + policy_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, +bucket_name=bucket_name, +policy_id=policy_id, +client=client, + + )).parsed diff --git a/src/volcano_sdk/_generated/models/__init__.py b/src/volcano_sdk/_generated/models/__init__.py index 15421c77..065ba8cc 100644 --- a/src/volcano_sdk/_generated/models/__init__.py +++ b/src/volcano_sdk/_generated/models/__init__.py @@ -90,8 +90,21 @@ from .auth_user_app_metadata import AuthUserAppMetadata from .auth_user_status import AuthUserStatus from .auth_user_user_metadata import AuthUserUserMetadata +from .autofix_diagnosis import AutofixDiagnosis +from .autofix_diagnosis_confidence import AutofixDiagnosisConfidence +from .autofix_edit import AutofixEdit +from .autofix_evidence import AutofixEvidence +from .autofix_evidence_kind import AutofixEvidenceKind from .autofix_model import AutofixModel +from .autofix_patch import AutofixPatch from .autofix_provider import AutofixProvider +from .autofix_pull_request import AutofixPullRequest +from .autofix_pull_request_skipped import AutofixPullRequestSkipped +from .autofix_pull_request_state import AutofixPullRequestState +from .autofix_run import AutofixRun +from .autofix_run_status import AutofixRunStatus +from .autofix_run_trigger import AutofixRunTrigger +from .autofix_run_usage import AutofixRunUsage from .autofix_settings import AutofixSettings from .autofix_stage import AutofixStage from .ban_auth_user_body import BanAuthUserBody @@ -236,6 +249,17 @@ from .durable_function import DurableFunction from .durable_function_config import DurableFunctionConfig from .durable_function_status import DurableFunctionStatus +from .durable_message import DurableMessage +from .durable_message_direction import DurableMessageDirection +from .durable_message_list import DurableMessageList +from .durable_message_sender import DurableMessageSender +from .durable_message_sender_type import DurableMessageSenderType +from .durable_message_session_registration import DurableMessageSessionRegistration +from .durable_message_status import DurableMessageStatus +from .durable_message_wait import DurableMessageWait +from .durable_message_wait_list import DurableMessageWaitList +from .durable_message_wait_registration import DurableMessageWaitRegistration +from .durable_message_wait_status import DurableMessageWaitStatus from .email_template import EmailTemplate from .email_template_template_type import EmailTemplateTemplateType from .error import Error @@ -371,7 +395,9 @@ from .o_auth_config_provider import OAuthConfigProvider from .o_auth_error_response import OAuthErrorResponse from .open_api_spec_document import OpenAPISpecDocument +from .open_durable_message_session_request import OpenDurableMessageSessionRequest from .paginated_auth_users import PaginatedAuthUsers +from .paginated_autofix_runs import PaginatedAutofixRuns from .paginated_databases import PaginatedDatabases from .paginated_durable_approvals import PaginatedDurableApprovals from .paginated_durable_executions import PaginatedDurableExecutions @@ -524,6 +550,7 @@ from .project_template_installation_phase import ProjectTemplateInstallationPhase from .project_template_installation_status import ProjectTemplateInstallationStatus from .project_usage_response import ProjectUsageResponse +from .publish_durable_message_request import PublishDurableMessageRequest from .publish_sandbox_preset_request import PublishSandboxPresetRequest from .publish_sandbox_preset_request_memory_mb import PublishSandboxPresetRequestMemoryMb from .publish_sandbox_preset_request_preset import PublishSandboxPresetRequestPreset @@ -532,6 +559,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 .register_durable_message_wait_request import RegisterDurableMessageWaitRequest from .rename_variable_environment_request import RenameVariableEnvironmentRequest from .render_default_managed_auth_page_action import RenderDefaultManagedAuthPageAction from .replace_frontend_shared_variables_body import ReplaceFrontendSharedVariablesBody @@ -570,6 +598,7 @@ from .sandbox_template_status import SandboxTemplateStatus from .schedule_request import ScheduleRequest from .schedule_request_kind import ScheduleRequestKind +from .send_durable_message_request import SendDurableMessageRequest from .service_key import ServiceKey from .set_project_git_production_branch_request import SetProjectGitProductionBranchRequest from .start_git_connect_provider import StartGitConnectProvider @@ -721,8 +750,21 @@ "AuthUserAppMetadata", "AuthUserStatus", "AuthUserUserMetadata", + "AutofixDiagnosis", + "AutofixDiagnosisConfidence", + "AutofixEdit", + "AutofixEvidence", + "AutofixEvidenceKind", "AutofixModel", + "AutofixPatch", "AutofixProvider", + "AutofixPullRequest", + "AutofixPullRequestSkipped", + "AutofixPullRequestState", + "AutofixRun", + "AutofixRunStatus", + "AutofixRunTrigger", + "AutofixRunUsage", "AutofixSettings", "AutofixStage", "BanAuthUserBody", @@ -867,6 +909,17 @@ "DurableFunction", "DurableFunctionConfig", "DurableFunctionStatus", + "DurableMessage", + "DurableMessageDirection", + "DurableMessageList", + "DurableMessageSender", + "DurableMessageSenderType", + "DurableMessageSessionRegistration", + "DurableMessageStatus", + "DurableMessageWait", + "DurableMessageWaitList", + "DurableMessageWaitRegistration", + "DurableMessageWaitStatus", "EmailTemplate", "EmailTemplateTemplateType", "Error", @@ -1002,7 +1055,9 @@ "OAuthConfigProvider", "OAuthErrorResponse", "OpenAPISpecDocument", + "OpenDurableMessageSessionRequest", "PaginatedAuthUsers", + "PaginatedAutofixRuns", "PaginatedDatabases", "PaginatedDurableApprovals", "PaginatedDurableExecutions", @@ -1155,6 +1210,7 @@ "ProjectTemplateInstallationPhase", "ProjectTemplateInstallationStatus", "ProjectUsageResponse", + "PublishDurableMessageRequest", "PublishSandboxPresetRequest", "PublishSandboxPresetRequestMemoryMb", "PublishSandboxPresetRequestPreset", @@ -1163,6 +1219,7 @@ "RealtimeStats", "RefreshOAuthProviderTokenProvider", "RefreshOAuthProviderTokenResponse200", + "RegisterDurableMessageWaitRequest", "RenameVariableEnvironmentRequest", "RenderDefaultManagedAuthPageAction", "ReplaceFrontendSharedVariablesBody", @@ -1201,6 +1258,7 @@ "SandboxTemplateStatus", "ScheduleRequest", "ScheduleRequestKind", + "SendDurableMessageRequest", "ServiceKey", "SetProjectGitProductionBranchRequest", "StartGitConnectProvider", diff --git a/src/volcano_sdk/_generated/models/autofix_diagnosis.py b/src/volcano_sdk/_generated/models/autofix_diagnosis.py new file mode 100644 index 00000000..26bacf89 --- /dev/null +++ b/src/volcano_sdk/_generated/models/autofix_diagnosis.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 ..models.autofix_diagnosis_confidence import AutofixDiagnosisConfidence +from ..models.autofix_diagnosis_confidence import check_autofix_diagnosis_confidence +from typing import cast + +if TYPE_CHECKING: + from ..models.autofix_evidence import AutofixEvidence + + + + + +T = TypeVar("T", bound="AutofixDiagnosis") + + + +@_attrs_define +class AutofixDiagnosis: + """ + Attributes: + summary (str): One or two sentences on what goes wrong. + root_cause (str): + evidence (list[AutofixEvidence]): + suggested_fix (str): + confidence (AutofixDiagnosisConfidence): + fixable (bool): Whether a change to the project's code would fix the issue. + files (list[str]): Repository paths a fix would change. + """ + + summary: str + root_cause: str + evidence: list[AutofixEvidence] + suggested_fix: str + confidence: AutofixDiagnosisConfidence + fixable: bool + files: list[str] + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.autofix_evidence import AutofixEvidence # noqa: PLC0415 + summary = self.summary + + root_cause = self.root_cause + + evidence = [] + for evidence_item_data in self.evidence: + evidence_item = evidence_item_data.to_dict() + evidence.append(evidence_item) + + + + suggested_fix = self.suggested_fix + + confidence: str = self.confidence + + fixable = self.fixable + + files = self.files + + + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "summary": summary, + "root_cause": root_cause, + "evidence": evidence, + "suggested_fix": suggested_fix, + "confidence": confidence, + "fixable": fixable, + "files": files, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.autofix_evidence import AutofixEvidence # noqa: PLC0415 + d = dict(src_dict) + summary = d.pop("summary") + + root_cause = d.pop("root_cause") + + evidence = [] + _evidence = d.pop("evidence") + for evidence_item_data in (_evidence): + evidence_item = AutofixEvidence.from_dict(evidence_item_data) + + + + evidence.append(evidence_item) + + + suggested_fix = d.pop("suggested_fix") + + confidence = check_autofix_diagnosis_confidence(d.pop("confidence")) + + + + + fixable = d.pop("fixable") + + files = cast(list[str], d.pop("files")) + + + autofix_diagnosis = cls( + summary=summary, + root_cause=root_cause, + evidence=evidence, + suggested_fix=suggested_fix, + confidence=confidence, + fixable=fixable, + files=files, + ) + + return autofix_diagnosis + diff --git a/src/volcano_sdk/_generated/models/autofix_diagnosis_confidence.py b/src/volcano_sdk/_generated/models/autofix_diagnosis_confidence.py new file mode 100644 index 00000000..eeec57dd --- /dev/null +++ b/src/volcano_sdk/_generated/models/autofix_diagnosis_confidence.py @@ -0,0 +1,10 @@ +from typing import Literal + +AutofixDiagnosisConfidence = Literal['high', 'low', 'medium'] + +AUTOFIX_DIAGNOSIS_CONFIDENCE_VALUES: set[AutofixDiagnosisConfidence] = { 'high', 'low', 'medium', } + +def check_autofix_diagnosis_confidence(value: str) -> AutofixDiagnosisConfidence: + if value in AUTOFIX_DIAGNOSIS_CONFIDENCE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {AUTOFIX_DIAGNOSIS_CONFIDENCE_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/autofix_edit.py b/src/volcano_sdk/_generated/models/autofix_edit.py new file mode 100644 index 00000000..2bcb071d --- /dev/null +++ b/src/volcano_sdk/_generated/models/autofix_edit.py @@ -0,0 +1,75 @@ +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="AutofixEdit") + + + +@_attrs_define +class AutofixEdit: + """ One exact text replacement. An empty `old_text` creates the file. + + Attributes: + path (str): + old_text (str): + new_text (str): + """ + + path: str + old_text: str + new_text: str + + + + + + def to_dict(self) -> dict[str, Any]: + path = self.path + + old_text = self.old_text + + new_text = self.new_text + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "path": path, + "old_text": old_text, + "new_text": new_text, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + path = d.pop("path") + + old_text = d.pop("old_text") + + new_text = d.pop("new_text") + + autofix_edit = cls( + path=path, + old_text=old_text, + new_text=new_text, + ) + + return autofix_edit + diff --git a/src/volcano_sdk/_generated/models/autofix_evidence.py b/src/volcano_sdk/_generated/models/autofix_evidence.py new file mode 100644 index 00000000..4acd5a3d --- /dev/null +++ b/src/volcano_sdk/_generated/models/autofix_evidence.py @@ -0,0 +1,82 @@ +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_evidence_kind import AutofixEvidenceKind +from ..models.autofix_evidence_kind import check_autofix_evidence_kind +from ..types import UNSET, Unset +from typing import cast + + + + + + +T = TypeVar("T", bound="AutofixEvidence") + + + +@_attrs_define +class AutofixEvidence: + """ + Attributes: + kind (AutofixEvidenceKind): + detail (str): + location (str | Unset): A file and line, or a log timestamp. Absent when the evidence has none. + """ + + kind: AutofixEvidenceKind + detail: str + location: str | Unset = UNSET + + + + + + def to_dict(self) -> dict[str, Any]: + kind: str = self.kind + + detail = self.detail + + location = self.location + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "kind": kind, + "detail": detail, + }) + if location is not UNSET: + field_dict["location"] = location + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + kind = check_autofix_evidence_kind(d.pop("kind")) + + + + + detail = d.pop("detail") + + location = d.pop("location", UNSET) + + autofix_evidence = cls( + kind=kind, + detail=detail, + location=location, + ) + + return autofix_evidence + diff --git a/src/volcano_sdk/_generated/models/autofix_evidence_kind.py b/src/volcano_sdk/_generated/models/autofix_evidence_kind.py new file mode 100644 index 00000000..0723fe78 --- /dev/null +++ b/src/volcano_sdk/_generated/models/autofix_evidence_kind.py @@ -0,0 +1,10 @@ +from typing import Literal + +AutofixEvidenceKind = Literal['code', 'log', 'other'] + +AUTOFIX_EVIDENCE_KIND_VALUES: set[AutofixEvidenceKind] = { 'code', 'log', 'other', } + +def check_autofix_evidence_kind(value: str) -> AutofixEvidenceKind: + if value in AUTOFIX_EVIDENCE_KIND_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {AUTOFIX_EVIDENCE_KIND_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/autofix_patch.py b/src/volcano_sdk/_generated/models/autofix_patch.py new file mode 100644 index 00000000..62ee2b03 --- /dev/null +++ b/src/volcano_sdk/_generated/models/autofix_patch.py @@ -0,0 +1,86 @@ +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.autofix_edit import AutofixEdit + + + + + +T = TypeVar("T", bound="AutofixPatch") + + + +@_attrs_define +class AutofixPatch: + """ The fix the model proposed, applied to the deployed commit. Present whenever the run opened a pull request, and when + a valid fix could not be published. + + Attributes: + title (str): + edits (list[AutofixEdit]): + """ + + title: str + edits: list[AutofixEdit] + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.autofix_edit import AutofixEdit # noqa: PLC0415 + title = self.title + + edits = [] + for edits_item_data in self.edits: + edits_item = edits_item_data.to_dict() + edits.append(edits_item) + + + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "title": title, + "edits": edits, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.autofix_edit import AutofixEdit # noqa: PLC0415 + d = dict(src_dict) + title = d.pop("title") + + edits = [] + _edits = d.pop("edits") + for edits_item_data in (_edits): + edits_item = AutofixEdit.from_dict(edits_item_data) + + + + edits.append(edits_item) + + + autofix_patch = cls( + title=title, + edits=edits, + ) + + return autofix_patch + diff --git a/src/volcano_sdk/_generated/models/autofix_pull_request.py b/src/volcano_sdk/_generated/models/autofix_pull_request.py new file mode 100644 index 00000000..a8b58ae9 --- /dev/null +++ b/src/volcano_sdk/_generated/models/autofix_pull_request.py @@ -0,0 +1,131 @@ +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_pull_request_state import AutofixPullRequestState +from ..models.autofix_pull_request_state import check_autofix_pull_request_state +from ..types import UNSET, Unset +from typing import cast +import datetime + + + + + + +T = TypeVar("T", bound="AutofixPullRequest") + + + +@_attrs_define +class AutofixPullRequest: + """ The draft pull request the run opened on the connected repository. + + Attributes: + number (int): + url (str): + branch (str): The branch the fix is on, `volcano/autofix/`. + state (AutofixPullRequestState): + closed_at (datetime.datetime | Unset): When the pull request was merged or closed. + deployed_at (datetime.datetime | Unset): When a deployment that includes the merged fix went live. The issue + resolves then, unless it occurred again since. When more than 20 deployments went live after the merge before + Volcano checked, it is the merge time instead. + """ + + number: int + url: str + branch: str + state: AutofixPullRequestState + closed_at: datetime.datetime | Unset = UNSET + deployed_at: datetime.datetime | Unset = UNSET + + + + + + def to_dict(self) -> dict[str, Any]: + number = self.number + + url = self.url + + branch = self.branch + + state: str = self.state + + closed_at: str | Unset = UNSET + if not isinstance(self.closed_at, Unset): + closed_at = self.closed_at.isoformat() + + deployed_at: str | Unset = UNSET + if not isinstance(self.deployed_at, Unset): + deployed_at = self.deployed_at.isoformat() + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "number": number, + "url": url, + "branch": branch, + "state": state, + }) + if closed_at is not UNSET: + field_dict["closed_at"] = closed_at + if deployed_at is not UNSET: + field_dict["deployed_at"] = deployed_at + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + number = d.pop("number") + + url = d.pop("url") + + branch = d.pop("branch") + + state = check_autofix_pull_request_state(d.pop("state")) + + + + + _closed_at = d.pop("closed_at", UNSET) + closed_at: datetime.datetime | Unset + if isinstance(_closed_at, Unset): + closed_at = UNSET + else: + closed_at = datetime.datetime.fromisoformat(_closed_at) + + + + + _deployed_at = d.pop("deployed_at", UNSET) + deployed_at: datetime.datetime | Unset + if isinstance(_deployed_at, Unset): + deployed_at = UNSET + else: + deployed_at = datetime.datetime.fromisoformat(_deployed_at) + + + + + autofix_pull_request = cls( + number=number, + url=url, + branch=branch, + state=state, + closed_at=closed_at, + deployed_at=deployed_at, + ) + + return autofix_pull_request + diff --git a/src/volcano_sdk/_generated/models/autofix_pull_request_skipped.py b/src/volcano_sdk/_generated/models/autofix_pull_request_skipped.py new file mode 100644 index 00000000..81b39fad --- /dev/null +++ b/src/volcano_sdk/_generated/models/autofix_pull_request_skipped.py @@ -0,0 +1,10 @@ +from typing import Literal + +AutofixPullRequestSkipped = Literal['low_confidence', 'no_patch', 'not_fixable', 'permission_missing', 'publish_failed', 'pull_request_open', 'repository_changed', 'source_unavailable'] + +AUTOFIX_PULL_REQUEST_SKIPPED_VALUES: set[AutofixPullRequestSkipped] = { 'low_confidence', 'no_patch', 'not_fixable', 'permission_missing', 'publish_failed', 'pull_request_open', 'repository_changed', 'source_unavailable', } + +def check_autofix_pull_request_skipped(value: str) -> AutofixPullRequestSkipped: + if value in AUTOFIX_PULL_REQUEST_SKIPPED_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {AUTOFIX_PULL_REQUEST_SKIPPED_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/autofix_pull_request_state.py b/src/volcano_sdk/_generated/models/autofix_pull_request_state.py new file mode 100644 index 00000000..5a7764b9 --- /dev/null +++ b/src/volcano_sdk/_generated/models/autofix_pull_request_state.py @@ -0,0 +1,10 @@ +from typing import Literal + +AutofixPullRequestState = Literal['closed', 'merged', 'open'] + +AUTOFIX_PULL_REQUEST_STATE_VALUES: set[AutofixPullRequestState] = { 'closed', 'merged', 'open', } + +def check_autofix_pull_request_state(value: str) -> AutofixPullRequestState: + if value in AUTOFIX_PULL_REQUEST_STATE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {AUTOFIX_PULL_REQUEST_STATE_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/autofix_run.py b/src/volcano_sdk/_generated/models/autofix_run.py new file mode 100644 index 00000000..4fb1f1cb --- /dev/null +++ b/src/volcano_sdk/_generated/models/autofix_run.py @@ -0,0 +1,362 @@ +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_pull_request_skipped import AutofixPullRequestSkipped +from ..models.autofix_pull_request_skipped import check_autofix_pull_request_skipped +from ..models.autofix_run_status import AutofixRunStatus +from ..models.autofix_run_status import check_autofix_run_status +from ..models.autofix_run_trigger import AutofixRunTrigger +from ..models.autofix_run_trigger import check_autofix_run_trigger +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 + +if TYPE_CHECKING: + from ..models.autofix_diagnosis import AutofixDiagnosis + from ..models.autofix_patch import AutofixPatch + from ..models.autofix_pull_request import AutofixPullRequest + from ..models.autofix_run_usage import AutofixRunUsage + + + + + +T = TypeVar("T", bound="AutofixRun") + + + +@_attrs_define +class AutofixRun: + """ + Attributes: + id (UUID): + project_id (UUID): + issue_id (UUID): + trigger (AutofixRunTrigger): What started the run. `manual` is a request; `new_issue` and `regression` are + automatic runs for an issue that appeared or reopened. + status (AutofixRunStatus): Where a run is. `canceled` means the project's settings or plan stopped allowing the + run before it finished; `failure_code` says which. + 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. + 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. + usage (AutofixRunUsage): Model tokens the run used across every attempt. + created_at (datetime.datetime): + stage_reached (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. + diagnosis (AutofixDiagnosis | Unset): + patch (AutofixPatch | Unset): The fix the model proposed, applied to the deployed commit. Present whenever the + run opened a pull request, and when a valid fix could not be published. + pull_request (AutofixPullRequest | Unset): The draft pull request the run opened on the connected repository. + pull_request_skipped (AutofixPullRequestSkipped | Unset): Why a run whose `max_stage` is `pull_request` opened + no pull request. The diagnosis stands either way. + commit_sha (str | Unset): The commit the diagnosis read, when a push to the connected repository deployed the + resource. Absent when the run read logs only. + failure_code (str | Unset): Why the run failed or was canceled, or why its last attempt will be retried. One of + `api_key_rejected`, `model_request_rejected`, `model_unavailable`, `model_refused`, `no_diagnosis`, + `budget_exhausted`, `timed_out`, `attempts_exhausted`, `autofix_disabled`, `plan_required`, + `managed_models_unavailable`, `settings_changed`, `issue_not_found`, or `internal_error`. + failure_message (str | Unset): + started_at (datetime.datetime | Unset): + completed_at (datetime.datetime | Unset): + """ + + id: UUID + project_id: UUID + issue_id: UUID + trigger: AutofixRunTrigger + status: AutofixRunStatus + max_stage: AutofixStage + provider: AutofixProvider + model: AutofixModel + usage: AutofixRunUsage + created_at: datetime.datetime + stage_reached: AutofixStage | Unset = UNSET + diagnosis: AutofixDiagnosis | Unset = UNSET + patch: AutofixPatch | Unset = UNSET + pull_request: AutofixPullRequest | Unset = UNSET + pull_request_skipped: AutofixPullRequestSkipped | Unset = UNSET + commit_sha: str | Unset = UNSET + failure_code: str | Unset = UNSET + failure_message: str | Unset = UNSET + started_at: datetime.datetime | Unset = UNSET + completed_at: datetime.datetime | Unset = UNSET + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.autofix_diagnosis import AutofixDiagnosis # noqa: PLC0415 + from ..models.autofix_patch import AutofixPatch # noqa: PLC0415 + from ..models.autofix_pull_request import AutofixPullRequest # noqa: PLC0415 + from ..models.autofix_run_usage import AutofixRunUsage # noqa: PLC0415 + id = str(self.id) + + project_id = str(self.project_id) + + issue_id = str(self.issue_id) + + trigger: str = self.trigger + + status: str = self.status + + max_stage: str = self.max_stage + + provider: str = self.provider + + model: str = self.model + + usage = self.usage.to_dict() + + created_at = self.created_at.isoformat() + + stage_reached: str | Unset = UNSET + if not isinstance(self.stage_reached, Unset): + stage_reached = self.stage_reached + + + diagnosis: dict[str, Any] | Unset = UNSET + if not isinstance(self.diagnosis, Unset): + diagnosis = self.diagnosis.to_dict() + + patch: dict[str, Any] | Unset = UNSET + if not isinstance(self.patch, Unset): + patch = self.patch.to_dict() + + pull_request: dict[str, Any] | Unset = UNSET + if not isinstance(self.pull_request, Unset): + pull_request = self.pull_request.to_dict() + + pull_request_skipped: str | Unset = UNSET + if not isinstance(self.pull_request_skipped, Unset): + pull_request_skipped = self.pull_request_skipped + + + commit_sha = self.commit_sha + + failure_code = self.failure_code + + failure_message = self.failure_message + + started_at: str | Unset = UNSET + if not isinstance(self.started_at, Unset): + started_at = self.started_at.isoformat() + + completed_at: str | Unset = UNSET + if not isinstance(self.completed_at, Unset): + completed_at = self.completed_at.isoformat() + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "id": id, + "project_id": project_id, + "issue_id": issue_id, + "trigger": trigger, + "status": status, + "max_stage": max_stage, + "provider": provider, + "model": model, + "usage": usage, + "created_at": created_at, + }) + if stage_reached is not UNSET: + field_dict["stage_reached"] = stage_reached + if diagnosis is not UNSET: + field_dict["diagnosis"] = diagnosis + if patch is not UNSET: + field_dict["patch"] = patch + if pull_request is not UNSET: + field_dict["pull_request"] = pull_request + if pull_request_skipped is not UNSET: + field_dict["pull_request_skipped"] = pull_request_skipped + if commit_sha is not UNSET: + field_dict["commit_sha"] = commit_sha + if failure_code is not UNSET: + field_dict["failure_code"] = failure_code + if failure_message is not UNSET: + field_dict["failure_message"] = failure_message + if started_at is not UNSET: + field_dict["started_at"] = started_at + if completed_at is not UNSET: + field_dict["completed_at"] = completed_at + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.autofix_diagnosis import AutofixDiagnosis # noqa: PLC0415 + from ..models.autofix_patch import AutofixPatch # noqa: PLC0415 + from ..models.autofix_pull_request import AutofixPullRequest # noqa: PLC0415 + from ..models.autofix_run_usage import AutofixRunUsage # noqa: PLC0415 + d = dict(src_dict) + id = UUID(d.pop("id")) + + + + + project_id = UUID(d.pop("project_id")) + + + + + issue_id = UUID(d.pop("issue_id")) + + + + + trigger = check_autofix_run_trigger(d.pop("trigger")) + + + + + status = check_autofix_run_status(d.pop("status")) + + + + + max_stage = check_autofix_stage(d.pop("max_stage")) + + + + + provider = check_autofix_provider(d.pop("provider")) + + + + + model = check_autofix_model(d.pop("model")) + + + + + usage = AutofixRunUsage.from_dict(d.pop("usage")) + + + + + created_at = datetime.datetime.fromisoformat(d.pop("created_at")) + + + + + _stage_reached = d.pop("stage_reached", UNSET) + stage_reached: AutofixStage | Unset + if isinstance(_stage_reached, Unset): + stage_reached = UNSET + else: + stage_reached = check_autofix_stage(_stage_reached) + + + + + _diagnosis = d.pop("diagnosis", UNSET) + diagnosis: AutofixDiagnosis | Unset + if isinstance(_diagnosis, Unset): + diagnosis = UNSET + else: + diagnosis = AutofixDiagnosis.from_dict(_diagnosis) + + + + + _patch = d.pop("patch", UNSET) + patch: AutofixPatch | Unset + if isinstance(_patch, Unset): + patch = UNSET + else: + patch = AutofixPatch.from_dict(_patch) + + + + + _pull_request = d.pop("pull_request", UNSET) + pull_request: AutofixPullRequest | Unset + if isinstance(_pull_request, Unset): + pull_request = UNSET + else: + pull_request = AutofixPullRequest.from_dict(_pull_request) + + + + + _pull_request_skipped = d.pop("pull_request_skipped", UNSET) + pull_request_skipped: AutofixPullRequestSkipped | Unset + if isinstance(_pull_request_skipped, Unset): + pull_request_skipped = UNSET + else: + pull_request_skipped = check_autofix_pull_request_skipped(_pull_request_skipped) + + + + + commit_sha = d.pop("commit_sha", UNSET) + + failure_code = d.pop("failure_code", UNSET) + + failure_message = d.pop("failure_message", UNSET) + + _started_at = d.pop("started_at", UNSET) + started_at: datetime.datetime | Unset + if isinstance(_started_at, Unset): + started_at = UNSET + else: + started_at = datetime.datetime.fromisoformat(_started_at) + + + + + _completed_at = d.pop("completed_at", UNSET) + completed_at: datetime.datetime | Unset + if isinstance(_completed_at, Unset): + completed_at = UNSET + else: + completed_at = datetime.datetime.fromisoformat(_completed_at) + + + + + autofix_run = cls( + id=id, + project_id=project_id, + issue_id=issue_id, + trigger=trigger, + status=status, + max_stage=max_stage, + provider=provider, + model=model, + usage=usage, + created_at=created_at, + stage_reached=stage_reached, + diagnosis=diagnosis, + patch=patch, + pull_request=pull_request, + pull_request_skipped=pull_request_skipped, + commit_sha=commit_sha, + failure_code=failure_code, + failure_message=failure_message, + started_at=started_at, + completed_at=completed_at, + ) + + return autofix_run + diff --git a/src/volcano_sdk/_generated/models/autofix_run_status.py b/src/volcano_sdk/_generated/models/autofix_run_status.py new file mode 100644 index 00000000..e74d65c8 --- /dev/null +++ b/src/volcano_sdk/_generated/models/autofix_run_status.py @@ -0,0 +1,10 @@ +from typing import Literal + +AutofixRunStatus = Literal['canceled', 'failed', 'queued', 'running', 'succeeded'] + +AUTOFIX_RUN_STATUS_VALUES: set[AutofixRunStatus] = { 'canceled', 'failed', 'queued', 'running', 'succeeded', } + +def check_autofix_run_status(value: str) -> AutofixRunStatus: + if value in AUTOFIX_RUN_STATUS_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {AUTOFIX_RUN_STATUS_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/autofix_run_trigger.py b/src/volcano_sdk/_generated/models/autofix_run_trigger.py new file mode 100644 index 00000000..c4a8be9f --- /dev/null +++ b/src/volcano_sdk/_generated/models/autofix_run_trigger.py @@ -0,0 +1,10 @@ +from typing import Literal + +AutofixRunTrigger = Literal['manual', 'new_issue', 'regression'] + +AUTOFIX_RUN_TRIGGER_VALUES: set[AutofixRunTrigger] = { 'manual', 'new_issue', 'regression', } + +def check_autofix_run_trigger(value: str) -> AutofixRunTrigger: + if value in AUTOFIX_RUN_TRIGGER_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {AUTOFIX_RUN_TRIGGER_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/autofix_run_usage.py b/src/volcano_sdk/_generated/models/autofix_run_usage.py new file mode 100644 index 00000000..a93a2e78 --- /dev/null +++ b/src/volcano_sdk/_generated/models/autofix_run_usage.py @@ -0,0 +1,83 @@ +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="AutofixRunUsage") + + + +@_attrs_define +class AutofixRunUsage: + """ Model tokens the run used across every attempt. + + Attributes: + input_tokens (int): + output_tokens (int): + cache_read_input_tokens (int): + cache_creation_input_tokens (int): + """ + + input_tokens: int + output_tokens: int + cache_read_input_tokens: int + cache_creation_input_tokens: int + + + + + + def to_dict(self) -> dict[str, Any]: + input_tokens = self.input_tokens + + output_tokens = self.output_tokens + + cache_read_input_tokens = self.cache_read_input_tokens + + cache_creation_input_tokens = self.cache_creation_input_tokens + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "input_tokens": input_tokens, + "output_tokens": output_tokens, + "cache_read_input_tokens": cache_read_input_tokens, + "cache_creation_input_tokens": cache_creation_input_tokens, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + input_tokens = d.pop("input_tokens") + + output_tokens = d.pop("output_tokens") + + cache_read_input_tokens = d.pop("cache_read_input_tokens") + + cache_creation_input_tokens = d.pop("cache_creation_input_tokens") + + autofix_run_usage = cls( + input_tokens=input_tokens, + output_tokens=output_tokens, + cache_read_input_tokens=cache_read_input_tokens, + cache_creation_input_tokens=cache_creation_input_tokens, + ) + + return autofix_run_usage + diff --git a/src/volcano_sdk/_generated/models/create_service_key_body.py b/src/volcano_sdk/_generated/models/create_service_key_body.py index f4ce6430..875d490a 100644 --- a/src/volcano_sdk/_generated/models/create_service_key_body.py +++ b/src/volcano_sdk/_generated/models/create_service_key_body.py @@ -32,7 +32,9 @@ class CreateServiceKeyBody: for backward compatibility. Provide an explicit list (e.g. ["functions.invoke", "locks.manage"]) to restrict the key; "*" grants everything. Scope enforcement applies to function invocation, - storage object operations, and project locks. + storage object operations, project locks, and server-side auth proxy + metadata (auth.signin, auth.signup, auth.refresh, auth.logout, + auth.password_reset). Example: ['functions.invoke', 'locks.manage']. """ diff --git a/src/volcano_sdk/_generated/models/durable_execution.py b/src/volcano_sdk/_generated/models/durable_execution.py index 7c379ac8..c45737cf 100644 --- a/src/volcano_sdk/_generated/models/durable_execution.py +++ b/src/volcano_sdk/_generated/models/durable_execution.py @@ -68,6 +68,9 @@ class DurableExecution: unset, so it reads like a function that returned nothing. error (DurableExecutionError | Unset): Why a failed or timed-out execution ended. completed_at (datetime.datetime | Unset): Present once the execution has reached a terminal status. + client_token (str | Unset): Lets a browser read and send the execution's messages. Returned only + by the start whose input the execution runs, never by a repeat under + the same name or by a read. Send it as `X-Volcano-Client-Token`. """ id: UUID @@ -80,6 +83,7 @@ class DurableExecution: result_expired: bool | Unset = UNSET error: DurableExecutionError | Unset = UNSET completed_at: datetime.datetime | Unset = UNSET + client_token: str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -112,6 +116,8 @@ def to_dict(self) -> dict[str, Any]: if not isinstance(self.completed_at, Unset): completed_at = self.completed_at.isoformat() + client_token = self.client_token + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -131,6 +137,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["error"] = error if completed_at is not UNSET: field_dict["completed_at"] = completed_at + if client_token is not UNSET: + field_dict["client_token"] = client_token return field_dict @@ -188,6 +196,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + client_token = d.pop("client_token", UNSET) + durable_execution = cls( id=id, function_id=function_id, @@ -199,6 +209,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: result_expired=result_expired, error=error, completed_at=completed_at, + client_token=client_token, ) diff --git a/src/volcano_sdk/_generated/models/durable_message.py b/src/volcano_sdk/_generated/models/durable_message.py new file mode 100644 index 00000000..ade4b4a4 --- /dev/null +++ b/src/volcano_sdk/_generated/models/durable_message.py @@ -0,0 +1,205 @@ +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.durable_message_direction import check_durable_message_direction +from ..models.durable_message_direction import DurableMessageDirection +from ..models.durable_message_status import check_durable_message_status +from ..models.durable_message_status import DurableMessageStatus +from typing import cast +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.durable_message_sender import DurableMessageSender + + + + + +T = TypeVar("T", bound="DurableMessage") + + + +@_attrs_define +class DurableMessage: + """ A message sent to, or published by, a durable execution. + + Attributes: + id (UUID): + execution_id (UUID): + direction (DurableMessageDirection): `in` is a message sent to the execution. `out` is one the execution + published. + seq (int): Orders the execution's messages in both directions. It increases + with every message but can skip numbers. Pass the last one you read + as `after` to read what came next. + name (str): + data (Any): The JSON value sent or published, or null. + sender (DurableMessageSender): Who sent the message. + status (DurableMessageStatus): An `in` message is `queued` until a wait for its name takes it, + `delivering` while it is handed over, and `delivered` once the + execution has it. It is `dropped` if the execution ended before any + wait took it. Every `out` message is `published`. + delivered_at (datetime.datetime | None): When the execution received the message. Null until then, and for `out` + messages. + sent_at (datetime.datetime): + """ + + id: UUID + execution_id: UUID + direction: DurableMessageDirection + seq: int + name: str + data: Any + sender: DurableMessageSender + status: DurableMessageStatus + delivered_at: datetime.datetime | None + sent_at: datetime.datetime + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.durable_message_sender import DurableMessageSender # noqa: PLC0415 + id = str(self.id) + + execution_id = str(self.execution_id) + + direction: str = self.direction + + seq = self.seq + + name = self.name + + data = self.data + + sender = self.sender.to_dict() + + status: str = self.status + + delivered_at: None | str + if isinstance(self.delivered_at, datetime.datetime): + delivered_at = self.delivered_at.isoformat() + else: + delivered_at = self.delivered_at + + sent_at = self.sent_at.isoformat() + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "id": id, + "execution_id": execution_id, + "direction": direction, + "seq": seq, + "name": name, + "data": data, + "sender": sender, + "status": status, + "delivered_at": delivered_at, + "sent_at": sent_at, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.durable_message_sender import DurableMessageSender # noqa: PLC0415 + d = dict(src_dict) + id = UUID(d.pop("id")) + + + + + execution_id = UUID(d.pop("execution_id")) + + + + + direction = check_durable_message_direction(d.pop("direction")) + + + + + seq = d.pop("seq") + + name = d.pop("name") + + data = d.pop("data") + + sender = DurableMessageSender.from_dict(d.pop("sender")) + + + + + status = check_durable_message_status(d.pop("status")) + + + + + def _parse_delivered_at(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + delivered_at_type_0 = datetime.datetime.fromisoformat(data) + + + + return delivered_at_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + delivered_at = _parse_delivered_at(d.pop("delivered_at")) + + + sent_at = datetime.datetime.fromisoformat(d.pop("sent_at")) + + + + + durable_message = cls( + id=id, + execution_id=execution_id, + direction=direction, + seq=seq, + name=name, + data=data, + sender=sender, + status=status, + delivered_at=delivered_at, + sent_at=sent_at, + ) + + + durable_message.additional_properties = d + return durable_message + + @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/durable_message_direction.py b/src/volcano_sdk/_generated/models/durable_message_direction.py new file mode 100644 index 00000000..ed28a71e --- /dev/null +++ b/src/volcano_sdk/_generated/models/durable_message_direction.py @@ -0,0 +1,10 @@ +from typing import Literal + +DurableMessageDirection = Literal['in', 'out'] + +DURABLE_MESSAGE_DIRECTION_VALUES: set[DurableMessageDirection] = { 'in', 'out', } + +def check_durable_message_direction(value: str) -> DurableMessageDirection: + if value in DURABLE_MESSAGE_DIRECTION_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {DURABLE_MESSAGE_DIRECTION_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/durable_message_list.py b/src/volcano_sdk/_generated/models/durable_message_list.py new file mode 100644 index 00000000..be34a0ca --- /dev/null +++ b/src/volcano_sdk/_generated/models/durable_message_list.py @@ -0,0 +1,103 @@ +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.durable_message import DurableMessage + + + + + +T = TypeVar("T", bound="DurableMessageList") + + + +@_attrs_define +class DurableMessageList: + """ + Attributes: + data (list[DurableMessage]): Messages after `after`, oldest first. + has_more (bool): Whether more messages follow. Read them with `after` set to the + last message's `seq`. + """ + + data: list[DurableMessage] + has_more: bool + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.durable_message import DurableMessage # noqa: PLC0415 + data = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + + + has_more = self.has_more + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "data": data, + "has_more": has_more, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.durable_message import DurableMessage # noqa: PLC0415 + d = dict(src_dict) + data = [] + _data = d.pop("data") + for data_item_data in (_data): + data_item = DurableMessage.from_dict(data_item_data) + + + + data.append(data_item) + + + has_more = d.pop("has_more") + + durable_message_list = cls( + data=data, + has_more=has_more, + ) + + + durable_message_list.additional_properties = d + return durable_message_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 diff --git a/src/volcano_sdk/_generated/models/durable_message_sender.py b/src/volcano_sdk/_generated/models/durable_message_sender.py new file mode 100644 index 00000000..7c7c2175 --- /dev/null +++ b/src/volcano_sdk/_generated/models/durable_message_sender.py @@ -0,0 +1,100 @@ +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.durable_message_sender_type import check_durable_message_sender_type +from ..models.durable_message_sender_type import DurableMessageSenderType +from typing import cast + + + + + + +T = TypeVar("T", bound="DurableMessageSender") + + + +@_attrs_define +class DurableMessageSender: + """ Who sent the message. + + Attributes: + type_ (DurableMessageSenderType): The credential the message was sent with. `project` is the + project's owner or one of its access tokens, and `execution` is the + execution itself publishing. + user_id (None | str): The auth user who sent it. Null unless `type` is `user`. + """ + + type_: DurableMessageSenderType + user_id: None | str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + type_: str = self.type_ + + user_id: None | str + user_id = self.user_id + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "type": type_, + "user_id": user_id, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + type_ = check_durable_message_sender_type(d.pop("type")) + + + + + def _parse_user_id(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + user_id = _parse_user_id(d.pop("user_id")) + + + durable_message_sender = cls( + type_=type_, + user_id=user_id, + ) + + + durable_message_sender.additional_properties = d + return durable_message_sender + + @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/durable_message_sender_type.py b/src/volcano_sdk/_generated/models/durable_message_sender_type.py new file mode 100644 index 00000000..df1eedf3 --- /dev/null +++ b/src/volcano_sdk/_generated/models/durable_message_sender_type.py @@ -0,0 +1,10 @@ +from typing import Literal + +DurableMessageSenderType = Literal['anon', 'execution', 'project', 'service_key', 'user'] + +DURABLE_MESSAGE_SENDER_TYPE_VALUES: set[DurableMessageSenderType] = { 'anon', 'execution', 'project', 'service_key', 'user', } + +def check_durable_message_sender_type(value: str) -> DurableMessageSenderType: + if value in DURABLE_MESSAGE_SENDER_TYPE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {DURABLE_MESSAGE_SENDER_TYPE_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/durable_message_session_registration.py b/src/volcano_sdk/_generated/models/durable_message_session_registration.py new file mode 100644 index 00000000..b888927a --- /dev/null +++ b/src/volcano_sdk/_generated/models/durable_message_session_registration.py @@ -0,0 +1,82 @@ +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 uuid import UUID + + + + + + +T = TypeVar("T", bound="DurableMessageSessionRegistration") + + + +@_attrs_define +class DurableMessageSessionRegistration: + """ The registered session. Its token reaches the workflow through the + workflow itself, never in this response. + + Attributes: + id (UUID): + """ + + id: UUID + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + id = str(self.id) + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "id": id, + }) + + 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")) + + + + + durable_message_session_registration = cls( + id=id, + ) + + + durable_message_session_registration.additional_properties = d + return durable_message_session_registration + + @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/durable_message_status.py b/src/volcano_sdk/_generated/models/durable_message_status.py new file mode 100644 index 00000000..a6b2a36b --- /dev/null +++ b/src/volcano_sdk/_generated/models/durable_message_status.py @@ -0,0 +1,10 @@ +from typing import Literal + +DurableMessageStatus = Literal['delivered', 'delivering', 'dropped', 'published', 'queued'] + +DURABLE_MESSAGE_STATUS_VALUES: set[DurableMessageStatus] = { 'delivered', 'delivering', 'dropped', 'published', 'queued', } + +def check_durable_message_status(value: str) -> DurableMessageStatus: + if value in DURABLE_MESSAGE_STATUS_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {DURABLE_MESSAGE_STATUS_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/durable_message_wait.py b/src/volcano_sdk/_generated/models/durable_message_wait.py new file mode 100644 index 00000000..1ec42494 --- /dev/null +++ b/src/volcano_sdk/_generated/models/durable_message_wait.py @@ -0,0 +1,146 @@ +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.durable_message_wait_status import check_durable_message_wait_status +from ..models.durable_message_wait_status import DurableMessageWaitStatus +from typing import cast +from uuid import UUID +import datetime + + + + + + +T = TypeVar("T", bound="DurableMessageWait") + + + +@_attrs_define +class DurableMessageWait: + """ A wait an execution has open for a message. + + Attributes: + id (UUID): + name (str): + status (DurableMessageWaitStatus): `waiting` until a message for its name arrives, `matched` while that + message is handed over, then `delivered`. `expired` means the wait's + timeout passed first, and `cancelled` that the execution stopped + waiting. + expires_at (datetime.datetime | None): When the wait times out. Null when the workflow set no timeout. + created_at (datetime.datetime): + """ + + id: UUID + name: str + status: DurableMessageWaitStatus + expires_at: datetime.datetime | None + created_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) + + name = self.name + + status: str = self.status + + expires_at: None | str + if isinstance(self.expires_at, datetime.datetime): + expires_at = self.expires_at.isoformat() + else: + expires_at = self.expires_at + + created_at = self.created_at.isoformat() + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "id": id, + "name": name, + "status": status, + "expires_at": expires_at, + "created_at": created_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")) + + + + + name = d.pop("name") + + status = check_durable_message_wait_status(d.pop("status")) + + + + + 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")) + + + created_at = datetime.datetime.fromisoformat(d.pop("created_at")) + + + + + durable_message_wait = cls( + id=id, + name=name, + status=status, + expires_at=expires_at, + created_at=created_at, + ) + + + durable_message_wait.additional_properties = d + return durable_message_wait + + @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/durable_message_wait_list.py b/src/volcano_sdk/_generated/models/durable_message_wait_list.py new file mode 100644 index 00000000..cdc3f6ae --- /dev/null +++ b/src/volcano_sdk/_generated/models/durable_message_wait_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.durable_message_wait import DurableMessageWait + + + + + +T = TypeVar("T", bound="DurableMessageWaitList") + + + +@_attrs_define +class DurableMessageWaitList: + """ + Attributes: + data (list[DurableMessageWait]): Open waits, oldest first. + """ + + data: list[DurableMessageWait] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.durable_message_wait import DurableMessageWait # 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.durable_message_wait import DurableMessageWait # noqa: PLC0415 + d = dict(src_dict) + data = [] + _data = d.pop("data") + for data_item_data in (_data): + data_item = DurableMessageWait.from_dict(data_item_data) + + + + data.append(data_item) + + + durable_message_wait_list = cls( + data=data, + ) + + + durable_message_wait_list.additional_properties = d + return durable_message_wait_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 diff --git a/src/volcano_sdk/_generated/models/durable_message_wait_registration.py b/src/volcano_sdk/_generated/models/durable_message_wait_registration.py new file mode 100644 index 00000000..70127a1a --- /dev/null +++ b/src/volcano_sdk/_generated/models/durable_message_wait_registration.py @@ -0,0 +1,127 @@ +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.durable_message_wait_status import check_durable_message_wait_status +from ..models.durable_message_wait_status import DurableMessageWaitStatus +from typing import cast +from uuid import UUID +import datetime + + + + + + +T = TypeVar("T", bound="DurableMessageWaitRegistration") + + + +@_attrs_define +class DurableMessageWaitRegistration: + """ The registered wait, as the waiting workflow sees it. + + Attributes: + id (UUID): + status (DurableMessageWaitStatus): `waiting` until a message for its name arrives, `matched` while that + message is handed over, then `delivered`. `expired` means the wait's + timeout passed first, and `cancelled` that the execution stopped + waiting. + expires_at (datetime.datetime | None): + """ + + id: UUID + status: DurableMessageWaitStatus + expires_at: datetime.datetime | None + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + id = str(self.id) + + status: str = self.status + + expires_at: None | str + if isinstance(self.expires_at, datetime.datetime): + expires_at = self.expires_at.isoformat() + else: + expires_at = self.expires_at + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "id": id, + "status": status, + "expires_at": expires_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")) + + + + + status = check_durable_message_wait_status(d.pop("status")) + + + + + 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")) + + + durable_message_wait_registration = cls( + id=id, + status=status, + expires_at=expires_at, + ) + + + durable_message_wait_registration.additional_properties = d + return durable_message_wait_registration + + @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/durable_message_wait_status.py b/src/volcano_sdk/_generated/models/durable_message_wait_status.py new file mode 100644 index 00000000..39d00a85 --- /dev/null +++ b/src/volcano_sdk/_generated/models/durable_message_wait_status.py @@ -0,0 +1,10 @@ +from typing import Literal + +DurableMessageWaitStatus = Literal['cancelled', 'delivered', 'expired', 'matched', 'waiting'] + +DURABLE_MESSAGE_WAIT_STATUS_VALUES: set[DurableMessageWaitStatus] = { 'cancelled', 'delivered', 'expired', 'matched', 'waiting', } + +def check_durable_message_wait_status(value: str) -> DurableMessageWaitStatus: + if value in DURABLE_MESSAGE_WAIT_STATUS_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {DURABLE_MESSAGE_WAIT_STATUS_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/function_invocation_request.py b/src/volcano_sdk/_generated/models/function_invocation_request.py index 6bc4909b..2853a9af 100644 --- a/src/volcano_sdk/_generated/models/function_invocation_request.py +++ b/src/volcano_sdk/_generated/models/function_invocation_request.py @@ -40,6 +40,9 @@ class FunctionInvocationRequest: } } ``` + + The top-level `__volcano_auth` and `__volcano_http` keys are reserved; + Volcano removes caller-supplied values for both. """ payload: FunctionInvocationRequestPayload | Unset = UNSET diff --git a/src/volcano_sdk/_generated/models/function_invocation_request_payload.py b/src/volcano_sdk/_generated/models/function_invocation_request_payload.py index f9422124..7457d0fd 100644 --- a/src/volcano_sdk/_generated/models/function_invocation_request_payload.py +++ b/src/volcano_sdk/_generated/models/function_invocation_request_payload.py @@ -35,6 +35,9 @@ class FunctionInvocationRequestPayload: } ``` + The top-level `__volcano_auth` and `__volcano_http` keys are reserved; + Volcano removes caller-supplied values for both. + """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) diff --git a/src/volcano_sdk/_generated/models/open_durable_message_session_request.py b/src/volcano_sdk/_generated/models/open_durable_message_session_request.py new file mode 100644 index 00000000..68915df7 --- /dev/null +++ b/src/volcano_sdk/_generated/models/open_durable_message_session_request.py @@ -0,0 +1,66 @@ +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="OpenDurableMessageSessionRequest") + + + +@_attrs_define +class OpenDurableMessageSessionRequest: + """ + Attributes: + execution_ref (str): Opaque reference to the running execution, supplied by the SDK. + callback_id (str): Opaque session reference, supplied by the SDK. + """ + + execution_ref: str + callback_id: str + + + + + + def to_dict(self) -> dict[str, Any]: + execution_ref = self.execution_ref + + callback_id = self.callback_id + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "execution_ref": execution_ref, + "callback_id": callback_id, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + execution_ref = d.pop("execution_ref") + + callback_id = d.pop("callback_id") + + open_durable_message_session_request = cls( + execution_ref=execution_ref, + callback_id=callback_id, + ) + + return open_durable_message_session_request + diff --git a/src/volcano_sdk/_generated/models/paginated_autofix_runs.py b/src/volcano_sdk/_generated/models/paginated_autofix_runs.py new file mode 100644 index 00000000..a61325e1 --- /dev/null +++ b/src/volcano_sdk/_generated/models/paginated_autofix_runs.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.autofix_run import AutofixRun + + + + + +T = TypeVar("T", bound="PaginatedAutofixRuns") + + + +@_attrs_define +class PaginatedAutofixRuns: + """ + Attributes: + data (list[AutofixRun]): + 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[AutofixRun] + 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.autofix_run import AutofixRun # 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.autofix_run import AutofixRun # noqa: PLC0415 + d = dict(src_dict) + data = [] + _data = d.pop("data") + for data_item_data in (_data): + data_item = AutofixRun.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_autofix_runs = cls( + data=data, + limit=limit, + has_more=has_more, + next_cursor=next_cursor, + ) + + + paginated_autofix_runs.additional_properties = d + return paginated_autofix_runs + + @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_health_check.py b/src/volcano_sdk/_generated/models/project_health_check.py index 00998a52..f6046fb6 100644 --- a/src/volcano_sdk/_generated/models/project_health_check.py +++ b/src/volcano_sdk/_generated/models/project_health_check.py @@ -32,7 +32,12 @@ class ProjectHealthCheck: Attributes: id (str): category (ProjectHealthCategory): - status (ProjectHealthStatus): + status (ProjectHealthStatus): empty means no functions, frontends, databases, storage, Volcano Auth users, or + Sandbox resources are listed. needs_attention means an operation needs review without confirmed service + impairment, or a serving frontend whose edge recovery gave up needs a redeploy. degraded means a resource is + only partly available or is unavailable for an expected, temporary reason, such as a frontend whose edge + synchronization did not complete or a database being restored; critical means use is blocked. A failed workflow + or deployment record alone does not establish an outage. Findings remain available for empty projects. reason_code (str): scope (ProjectHealthScope): evidence (ProjectHealthEvidence): diff --git a/src/volcano_sdk/_generated/models/project_health_resource_type.py b/src/volcano_sdk/_generated/models/project_health_resource_type.py index 89cf9f74..f925e539 100644 --- a/src/volcano_sdk/_generated/models/project_health_resource_type.py +++ b/src/volcano_sdk/_generated/models/project_health_resource_type.py @@ -1,8 +1,8 @@ from typing import Literal -ProjectHealthResourceType = Literal['database', 'frontend', 'function', 'project'] +ProjectHealthResourceType = Literal['database', 'database_branch', 'frontend', 'function', 'project'] -PROJECT_HEALTH_RESOURCE_TYPE_VALUES: set[ProjectHealthResourceType] = { 'database', 'frontend', 'function', 'project', } +PROJECT_HEALTH_RESOURCE_TYPE_VALUES: set[ProjectHealthResourceType] = { 'database', 'database_branch', 'frontend', 'function', 'project', } def check_project_health_resource_type(value: str) -> ProjectHealthResourceType: if value in PROJECT_HEALTH_RESOURCE_TYPE_VALUES: diff --git a/src/volcano_sdk/_generated/models/project_health_response.py b/src/volcano_sdk/_generated/models/project_health_response.py index 6887d281..e156ee10 100644 --- a/src/volcano_sdk/_generated/models/project_health_response.py +++ b/src/volcano_sdk/_generated/models/project_health_response.py @@ -32,7 +32,12 @@ class ProjectHealthResponse: """ Attributes: project_id (UUID): - status (ProjectHealthStatus): + status (ProjectHealthStatus): empty means no functions, frontends, databases, storage, Volcano Auth users, or + Sandbox resources are listed. needs_attention means an operation needs review without confirmed service + impairment, or a serving frontend whose edge recovery gave up needs a redeploy. degraded means a resource is + only partly available or is unavailable for an expected, temporary reason, such as a frontend whose edge + synchronization did not complete or a database being restored; critical means use is blocked. A failed workflow + or deployment record alone does not establish an outage. Findings remain available for empty projects. observed_at (datetime.datetime): fresh_through (datetime.datetime): data_status (ProjectHealthDataStatus): diff --git a/src/volcano_sdk/_generated/models/project_health_status.py b/src/volcano_sdk/_generated/models/project_health_status.py index c299dfb9..4d4ff43f 100644 --- a/src/volcano_sdk/_generated/models/project_health_status.py +++ b/src/volcano_sdk/_generated/models/project_health_status.py @@ -1,8 +1,8 @@ from typing import Literal -ProjectHealthStatus = Literal['critical', 'degraded', 'healthy', 'unknown'] +ProjectHealthStatus = Literal['critical', 'degraded', 'empty', 'healthy', 'needs_attention', 'unknown'] -PROJECT_HEALTH_STATUS_VALUES: set[ProjectHealthStatus] = { 'critical', 'degraded', 'healthy', 'unknown', } +PROJECT_HEALTH_STATUS_VALUES: set[ProjectHealthStatus] = { 'critical', 'degraded', 'empty', 'healthy', 'needs_attention', 'unknown', } def check_project_health_status(value: str) -> ProjectHealthStatus: if value in PROJECT_HEALTH_STATUS_VALUES: diff --git a/src/volcano_sdk/_generated/models/project_health_summary.py b/src/volcano_sdk/_generated/models/project_health_summary.py index 804a732f..1553141c 100644 --- a/src/volcano_sdk/_generated/models/project_health_summary.py +++ b/src/volcano_sdk/_generated/models/project_health_summary.py @@ -25,7 +25,12 @@ class ProjectHealthSummary: """ Attributes: - status (ProjectHealthStatus): + status (ProjectHealthStatus): empty means no functions, frontends, databases, storage, Volcano Auth users, or + Sandbox resources are listed. needs_attention means an operation needs review without confirmed service + impairment, or a serving frontend whose edge recovery gave up needs a redeploy. degraded means a resource is + only partly available or is unavailable for an expected, temporary reason, such as a frontend whose edge + synchronization did not complete or a database being restored; critical means use is blocked. A failed workflow + or deployment record alone does not establish an outage. Findings remain available for empty projects. """ status: ProjectHealthStatus diff --git a/src/volcano_sdk/_generated/models/publish_durable_message_request.py b/src/volcano_sdk/_generated/models/publish_durable_message_request.py new file mode 100644 index 00000000..8e728393 --- /dev/null +++ b/src/volcano_sdk/_generated/models/publish_durable_message_request.py @@ -0,0 +1,69 @@ +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 + + + + + + +T = TypeVar("T", bound="PublishDurableMessageRequest") + + + +@_attrs_define +class PublishDurableMessageRequest: + """ + Attributes: + name (str): The name a workflow waits on or publishes under: up to 237 printable + ASCII characters. + data (Any | Unset): Any JSON value, up to 64 KiB. Omitted means null. + """ + + name: str + data: Any | Unset = UNSET + + + + + + def to_dict(self) -> dict[str, Any]: + name = self.name + + data = self.data + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "name": name, + }) + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + name = d.pop("name") + + data = d.pop("data", UNSET) + + publish_durable_message_request = cls( + name=name, + data=data, + ) + + return publish_durable_message_request + diff --git a/src/volcano_sdk/_generated/models/register_durable_message_wait_request.py b/src/volcano_sdk/_generated/models/register_durable_message_wait_request.py new file mode 100644 index 00000000..40d88bce --- /dev/null +++ b/src/volcano_sdk/_generated/models/register_durable_message_wait_request.py @@ -0,0 +1,75 @@ +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="RegisterDurableMessageWaitRequest") + + + +@_attrs_define +class RegisterDurableMessageWaitRequest: + """ + Attributes: + execution_ref (str): Opaque reference to the running execution, supplied by the SDK. + callback_id (str): Opaque wait reference, supplied by the SDK. + name (str): The name a workflow waits on or publishes under: up to 237 printable + ASCII characters. + """ + + execution_ref: str + callback_id: str + name: str + + + + + + def to_dict(self) -> dict[str, Any]: + execution_ref = self.execution_ref + + callback_id = self.callback_id + + name = self.name + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "execution_ref": execution_ref, + "callback_id": callback_id, + "name": name, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + execution_ref = d.pop("execution_ref") + + callback_id = d.pop("callback_id") + + name = d.pop("name") + + register_durable_message_wait_request = cls( + execution_ref=execution_ref, + callback_id=callback_id, + name=name, + ) + + return register_durable_message_wait_request + diff --git a/src/volcano_sdk/_generated/models/send_durable_message_request.py b/src/volcano_sdk/_generated/models/send_durable_message_request.py new file mode 100644 index 00000000..1430556e --- /dev/null +++ b/src/volcano_sdk/_generated/models/send_durable_message_request.py @@ -0,0 +1,69 @@ +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 + + + + + + +T = TypeVar("T", bound="SendDurableMessageRequest") + + + +@_attrs_define +class SendDurableMessageRequest: + """ + Attributes: + name (str): The name a workflow waits on or publishes under: up to 237 printable + ASCII characters. + data (Any | Unset): Any JSON value, up to 64 KiB. Omitted means null. + """ + + name: str + data: Any | Unset = UNSET + + + + + + def to_dict(self) -> dict[str, Any]: + name = self.name + + data = self.data + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "name": name, + }) + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + name = d.pop("name") + + data = d.pop("data", UNSET) + + send_durable_message_request = cls( + name=name, + data=data, + ) + + return send_durable_message_request +