From 5d5e79501320891f789f8c1d7b52d5f72188422c Mon Sep 17 00:00:00 2001 From: D1-3105 Date: Wed, 2 Sep 2026 22:15:11 +0000 Subject: [PATCH 1/2] Fix appSource conflict issue --- api/serverless/openapi.yaml | 2118 +++++- internal/api/serverless/client.go | 4 +- internal/api/serverless/client_test.go | 5 +- internal/api/serverless/gen/client.gen.go | 7938 +++++++++++++++------ internal/api/serverless/sourceuploads.go | 195 + internal/cmd/serverless/deploy.go | 18 +- internal/cmd/serverless/pack.go | 21 +- internal/cmd/serverless/pack_test.go | 17 +- internal/cmd/serverless/upload.go | 62 + internal/cmd/serverless/upload_test.go | 244 + 10 files changed, 8187 insertions(+), 2435 deletions(-) create mode 100644 internal/api/serverless/sourceuploads.go create mode 100644 internal/cmd/serverless/upload.go create mode 100644 internal/cmd/serverless/upload_test.go diff --git a/api/serverless/openapi.yaml b/api/serverless/openapi.yaml index a002e5e..88bc827 100644 --- a/api/serverless/openapi.yaml +++ b/api/serverless/openapi.yaml @@ -4,13 +4,12 @@ servers: info: title: Serverless API - version: 0.4.0 + version: 0.6.0 license: name: Proprietary description: > Control plane and task-ingestion API for the Runware Serverless platform. - A Runware organisation is the tenant boundary. Apps are addressed as `/v1/apps/{appId}` and endpoints are invoked as `/v1/apps/{appId}/invoke-async/{endpointPath}` (async invocation) or @@ -34,6 +33,8 @@ tags: description: Submit work to app endpoints and inspect task status - name: Apps description: Manage apps and their lifecycle + - name: SourceUploads + description: Stage source archives for future app create and update integration - name: Builds description: Immutable builds - name: Versions @@ -50,6 +51,10 @@ tags: description: Plain-text environment variables scoped to an app - name: Observability description: Usage, events and errors + - name: Tenancy + description: > + Platform-only organisation tenancy (ADR-019). Restricted to the Runware + platform organisation. Admin-api calls these when serverlessAccess changes. paths: # --------------------------------------------------------------------------- @@ -376,9 +381,16 @@ paths: description: > Starts a new async task on `appId`, routing the request body payload to an available worker. The task runs asynchronously and the response is `202`; poll - `GET /v1/apps/{appId}/tasks/{taskId}` for completion. Apps in + `GET /v1/apps/{appId}/tasks/{taskId}` for completion. Resubmitting a task id is + answered with the task it already names rather than starting a second one, so the + `202` can carry a task that has already finished: read its `status` instead of + assuming `pending`, and note it may name a different `appId`. Apps in `initializing`, `active`, or `stopping` accept invocation. `stopped`, `deleting`, and `failed` return `409 Conflict`; unknown or deleted apps return `404 Not Found`. + Endpoint membership is checked against the active version's endpoint set before + the task is accepted: an endpoint the app does not declare returns `404` whose + `endpointPath` extension member carries the rejected path, distinguishing it + from an unknown app, and the task never enters the queue. operationId: startAsyncTask security: - ApiKeyAuth: [] @@ -386,7 +398,7 @@ paths: - $ref: '#/components/parameters/AppId' - $ref: '#/components/parameters/EndpointPath' requestBody: - $ref: '#/components/requestBodies/TaskPayload' + $ref: '#/components/requestBodies/TaskInvocation' responses: '202': $ref: '#/components/responses/TaskAccepted' @@ -412,11 +424,21 @@ paths: summary: Start a new sync task description: > Starts a new sync task on `appId`, routing the request body payload to an available - worker. The request blocks until the task is terminal and returns the result inline (`200`), - or `504` if it does not complete within the wait window. When the accepted task ID is - available, the response includes `taskId` for polling. Apps in `initializing`, - `active`, or `stopping` accept invocation. `stopped`, `deleting`, and `failed` return - `409 Conflict`; unknown or deleted apps return `404 Not Found`. + worker. The request blocks until the task is terminal and returns the result inline (`200`). + Resubmitting a task id waits on the task it already names rather than starting a second + one, so the `200` carries that task's result and may name a different `appId` — poll it + under the one returned. A task that outlives the wait window is **not** a failure: the + task is still queued or running, and the response is `202` carrying that task with + `status: pending` — the same shape `invoke-async` returns, and it names the owning + `appId` on a resubmission just as the `200` does. Poll + `GET /v1/apps/{appId}/tasks/{taskId}` for its result. A request the platform cannot + attribute to an accepted task fails instead, with no task to poll. Apps in + `initializing`, `active`, or `stopping` accept invocation. `stopped`, `deleting`, and + `failed` return `409 Conflict`; unknown or deleted apps return `404 Not Found`. Endpoint + membership is checked against the active version's endpoint set before the task + is accepted: an endpoint the app does not declare returns `404` whose + `endpointPath` extension member carries the rejected path, distinguishing it + from an unknown app, and the task never enters the queue. operationId: startSyncTask security: - ApiKeyAuth: [] @@ -424,10 +446,12 @@ paths: - $ref: '#/components/parameters/AppId' - $ref: '#/components/parameters/EndpointPath' requestBody: - $ref: '#/components/requestBodies/TaskPayload' + $ref: '#/components/requestBodies/TaskInvocation' responses: '200': $ref: '#/components/responses/Task' + '202': + $ref: '#/components/responses/TaskAccepted' '401': $ref: '#/components/responses/Unauthorized' '503': @@ -442,8 +466,6 @@ paths: $ref: '#/components/responses/BadRequest' '422': $ref: '#/components/responses/ValidationError' - '504': - $ref: '#/components/responses/Timeout' /v1/apps/{appId}/tasks/{taskId}: get: @@ -467,9 +489,9 @@ paths: - name: taskId in: path required: true + description: Task identifier, supplied by the caller when the task was submitted. schema: - type: string - description: Opaque task identifier returned by the execution backend. + $ref: '#/components/schemas/TaskId' responses: '200': $ref: '#/components/responses/Task' @@ -494,8 +516,8 @@ paths: configured recovery window. A page can be empty and still have `nextCursor`; continue until it is null. Pending entries are best effort and may disappear if the recovery store restarts; tracked tasks reappear on completion. This is - not persisted task history. Each submission has a new task id, so client retries - can appear as separate tasks. If the app is `stopped`, `deleting`, or `failed`, + not persisted task history. A task id names one task, so resubmitting one + does not add a second entry here. If the app is `stopped`, `deleting`, or `failed`, recovery stays available. Unknown or deleted apps return `404 Not Found`. operationId: listTasks security: @@ -546,7 +568,8 @@ paths: summary: List apps description: > Returns a page of the organisation's apps. Filters combine with AND; soft-deleted - apps are excluded unless `status=deleted` is requested explicitly. + apps are excluded unless `status=deleted` is requested explicitly. Favourited apps + appear before non-favourited apps, with the selected ordering applied within each group. A `cursor` is only valid for the `sort` and filters it was issued under — reusing one @@ -625,17 +648,25 @@ paths: points at that version. If the build, validation, or rollout fails the app is marked `failed`. - - `container` source: no build step, so the version carries no `buildId`. No worker runs - from a container source yet, so the app stays `initializing` and does not serve - inference — poll `active` only for a `code` source. + - `container` source: the submitted zip (wrapper `Dockerfile` + `container.yaml`) + goes through the same build pipeline — the wrapper image is built, published and + deployed, so the version carries a `buildId` and the app follows the same + lifecycle as a code source. An invalid `container.yaml` rejects the create + before any build capacity is spent — `400` where the document could not be + parsed at all, `422` where it parsed and broke a rule. `activeVersionId` is null until a rollout completes: a version records what should run, and only a finished deploy says what does. - `secrets` is accepted by the schema but not yet applied, so supplying it returns `422` - rather than silently dropping it. + `secrets` attaches organisation secrets that already exist. It is the app's initial + attachment set, so the first rollout carries their values into the worker. This + route does not create a secret — use `POST /v1/secrets` first. A name that is + unknown to the organisation, or that is not `active`, returns `404`. A name that + collides with a key in `environmentVariables`, a repeated name and a set that goes + past the binding limit each return `422`. The whole set is checked before any build + capacity is spent. operationId: createApp requestBody: required: true @@ -660,6 +691,8 @@ paths: $ref: '#/components/responses/Conflict' '400': $ref: '#/components/responses/BadRequest' + '404': + $ref: '#/components/responses/NotFound' '422': $ref: '#/components/responses/ValidationError' @@ -668,6 +701,11 @@ paths: tags: - Apps summary: Get an app + description: > + Returns the app the authenticated organisation owns under this `appId`. An unknown + app and a soft-deleted one both return `404 Not Found`: a deleted app is gone to + its owner, and its rows are retained only for billing and audit. To read deleted + apps, list them with `status=deleted`. operationId: getApp parameters: - $ref: '#/components/parameters/AppId' @@ -696,27 +734,44 @@ paths: (changes apply on `resume`). Lifecycle transitions use the dedicated `deploy`, `stop`, `resume`, and `delete` operations. - - **Currently persisted:** `appName` and `configuration` only. Supplying - `appSource`, `secrets`, `environmentVariables`, or `endpoints` returns `422` - (bulk env-var replace is not wired — use the dedicated `/environment-variables` - endpoints for individual keys). - - - Target behaviour (once fully wired): - - - `configuration`: applied on the next Scaler cycle; triggers a rollout so workers - restart with the new configuration. If the rollout fails, the app remains on - the previous configuration. - - - `appSource`: triggers a build (for `code` sources) or image validation (for `container` - sources); on success the new version is deployed automatically. If the build or - validation fails, the app remains on the previous version. - - - `secrets` / `environmentVariables` / `endpoints`: the supplied array **replaces** the - current set — any item absent from the request is deleted. Endpoints take effect - immediately. Changes to secrets or environment variables trigger a rollout so workers - restart and pick up the new values. + A configuration or `environmentVariables` change records a new version with + the same image. If that image is deployable, the update pins it as + `activeVersionId` and rolls the workload when the app is `active` or + `initializing`. A `failed` app is moved to `initializing` and rolled, the + same as `POST /deploy`. If the image is not deployable, the version is + recorded and `activeVersionId` is left unchanged. If the roll fails, + `activeVersionId` is restored and the previous configuration keeps serving. + A name-only change records a version and does not pin. A `stopped` or + `stopping` app pins the version and rolls it on `resume`. A + configuration, `environmentVariables`, or `appSource` change while a + create or resume rollout is already in progress returns `409 Conflict`. + A name-only or `secrets`-only change does not. + + `appSource` starts a build and records version N+1 with a new image tag. + The deploy queue carries the build-then-deploy tail; `activeVersionId` + moves only when that rollout completes. A builder rejection (400 where + a container document's parser refused it, 422 where it parsed and broke + a rule) leaves the app on its current version and writes no version row + and no build row. After the builder accepts, version N+1 is recorded + even if a concurrent secret deactivation or env/secret collision + prevents this request's env/secrets overlay; in that case the previous + environmentVariables and attachment set stay in place and are what the + new version snapshots. + + `environmentVariables` replaces the whole set: a key absent from the map + is deleted, and a null value omits that key from the new set. The + resolved map is snapshotted onto the new version. + + `secrets` replaces the whole attachment set. An attachment absent from + the array is detached. Injected names must not collide with a plain + environment variable on the app; the combined set of plain variables and + attachments is capped at 100. This is a control-plane record only — + secret values do not reach a pod, and the version snapshot carries no + secrets — so a secrets-only change does not roll the workload. + + Endpoints are not a field of this contract: the set belongs to the app + source, so it changes only when a new version with a new source builds + and deploys. operationId: updateApp parameters: - $ref: '#/components/parameters/AppId' @@ -758,6 +813,12 @@ paths: `status` becomes `deleted` once all workers stop. All rows are retained for billing finalisation, audit, and usage history. Idempotent if the app is already `deleting`. + + + The `appId` is released once `status` reaches `deleted`, and not before: while the app + is `deleting` its workload is still being torn down and the name stays taken. A new app + created under a released name is a new app and inherits nothing — no version, no build, + no event history, and no workers. operationId: deleteApp parameters: - $ref: '#/components/parameters/AppId' @@ -777,6 +838,149 @@ paths: '404': $ref: '#/components/responses/NotFound' + /v1/apps/{appId}/source-uploads: + post: + tags: + - SourceUploads + summary: Create a source upload + description: > + Creates an upload session for source intended for `appId`. The app does not need + to exist yet. The response contains a short-lived transfer instruction for one + exact staging object. Repeating the request with the same idempotency key and + declaration while the session is pending and unexpired returns the same upload + resource with a refreshed transfer instruction. Replays with a different declaration + or after the session becomes ready, rejected, consumed, expired, or deleted return `409`. + operationId: createSourceUpload + parameters: + - $ref: '#/components/parameters/AppId' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SourceUploadCreate' + responses: + '201': + description: Source upload created + content: + application/json: + schema: + $ref: '#/components/schemas/SourceUploadCreation' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '409': + $ref: '#/components/responses/Conflict' + '422': + $ref: '#/components/responses/ValidationError' + '502': + $ref: '#/components/responses/BadGateway' + '503': + $ref: '#/components/responses/ServiceUnavailable' + + /v1/apps/{appId}/source-uploads/{uploadId}: + get: + tags: + - SourceUploads + summary: Get a source upload + description: > + Returns the upload session belonging to the authenticated organization and + `appId`. An upload belonging to another organization or app returns `404`. + operationId: getSourceUpload + parameters: + - $ref: '#/components/parameters/AppId' + - $ref: '#/components/parameters/SourceUploadId' + responses: + '200': + description: Source upload + content: + application/json: + schema: + $ref: '#/components/schemas/SourceUpload' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '422': + $ref: '#/components/responses/ValidationError' + '503': + $ref: '#/components/responses/ServiceUnavailable' + delete: + tags: + - SourceUploads + summary: Abort a source upload + description: > + Aborts an unconsumed upload and removes its staging object. The session remains as + a deleted tombstone so its object key cannot be reused. Repeating a successful + abort is idempotent. + operationId: deleteSourceUpload + parameters: + - $ref: '#/components/parameters/AppId' + - $ref: '#/components/parameters/SourceUploadId' + responses: + '204': + description: Source upload aborted + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' + '422': + $ref: '#/components/responses/ValidationError' + '502': + $ref: '#/components/responses/BadGateway' + '503': + $ref: '#/components/responses/ServiceUnavailable' + + /v1/apps/{appId}/source-uploads/{uploadId}/complete: + post: + tags: + - SourceUploads + summary: Complete a source upload + description: > + Verifies the staging object's length, content type, and SHA-256 digest against the + session declaration. A successful retry returns the existing ready resource. A + rejected upload keeps its rejection so later retries return the same result. + operationId: completeSourceUpload + parameters: + - $ref: '#/components/parameters/AppId' + - $ref: '#/components/parameters/SourceUploadId' + responses: + '200': + description: Source upload ready + content: + application/json: + schema: + $ref: '#/components/schemas/SourceUpload' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' + '422': + $ref: '#/components/responses/ValidationError' + '502': + $ref: '#/components/responses/BadGateway' + '503': + $ref: '#/components/responses/ServiceUnavailable' + /v1/apps/{appId}/deploy: post: tags: @@ -785,7 +989,7 @@ paths: description: > Activates a `ready` version by number, setting `activeVersionId` and returning `202` once that intent is persisted. Worker rollout, routing switch, and cancelling - in-progress builds (`failed` with `error: "superseded"`) are performed asynchronously + in-progress builds (`superseded`) are performed asynchronously by the deployer/Scaler. Permitted in any addressable status, including `initializing` and `failed`. @@ -810,7 +1014,6 @@ paths: Errors: - Deploy to a `deleting` app returns `409 Conflict` - `versionNumber` not found or not `ready` returns `409 Conflict` - - A `container`-source version returns `409 Conflict` until container apps are supported - Deploy to a non-existent or `deleted` app returns `404 Not Found` operationId: deployVersion parameters: @@ -972,8 +1175,9 @@ paths: summary: App summary metrics for the authenticated organisation description: > Aggregate dashboard metrics across all apps owned by the authenticated organisation. - Metrics whose backing system is not yet available are omitted from the - response rather than reported as zero. + App and worker tallies are always present. Request and error-rate totals come from + the metrics store and are omitted when that hop cannot answer rather than reported + as zero. Spend is omitted until billing rollups exist. operationId: getAppSummary responses: '200': @@ -1004,18 +1208,23 @@ paths: - $ref: '#/components/parameters/Cursor' responses: '200': - description: A page of builds + description: A page of builds, plus a collection summary that is independent of the page. content: application/json: schema: allOf: - $ref: '#/components/schemas/Page' - type: object + required: + - data + - summary properties: data: type: array items: $ref: '#/components/schemas/Build' + summary: + $ref: '#/components/schemas/BuildListSummary' '401': $ref: '#/components/responses/Unauthorized' '503': @@ -1054,6 +1263,44 @@ paths: $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' + delete: + tags: + - Builds + summary: Delete or cancel a build + description: > + Cancels a queued or running build and records it as `superseded`. Deleting + a queued or running build ends its current rollout without activating the + cancelled build, so any previous version keeps serving. A terminal build can + be deleted once no live rollout still needs it. Ready builds remain while a + version references them. + operationId: deleteBuild + parameters: + - $ref: '#/components/parameters/AppId' + - name: buildId + in: path + required: true + schema: + type: string + format: uuid + responses: + '204': + description: Build cancelled or deleted + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '422': + $ref: '#/components/responses/ValidationError' + '503': + $ref: '#/components/responses/ServiceUnavailable' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' + '502': + $ref: '#/components/responses/BadGateway' # --------------------------------------------------------------------------- # Versions @@ -1070,18 +1317,23 @@ paths: - $ref: '#/components/parameters/Cursor' responses: '200': - description: A page of versions + description: A page of versions, plus a collection summary that is independent of the page. content: application/json: schema: allOf: - $ref: '#/components/schemas/Page' - type: object + required: + - data + - summary properties: data: type: array items: $ref: '#/components/schemas/Version' + summary: + $ref: '#/components/schemas/ListSummary' '401': $ref: '#/components/responses/Unauthorized' '503': @@ -1120,6 +1372,40 @@ paths: $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' + delete: + tags: + - Versions + summary: Delete a version + description: > + Deletes an unused version while retaining its immutable history. + Deleted versions are omitted from version lists, return `404` from + version reads, and cannot be deployed. Returns `409` while the app is + deleting, or when the version is active, is the app's only remaining + version, has a non-stopped worker, or is targeted by a live rollout. + Deleting an already deleted version returns `404`. This operation does + not remove the version's OCI image. + operationId: deleteVersion + parameters: + - $ref: '#/components/parameters/AppId' + - name: versionNumber + in: path + required: true + schema: + type: integer + format: int32 + responses: + '204': + description: Version deleted + '401': + $ref: '#/components/responses/Unauthorized' + '503': + $ref: '#/components/responses/ServiceUnavailable' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' # --------------------------------------------------------------------------- # Endpoints @@ -1129,6 +1415,13 @@ paths: tags: - Endpoints summary: List endpoints + description: > + Lists the endpoints of the app's active version. The set is written by the + source itself — a code build's introspection, or a container's config + document — and is replaced atomically whenever a version activates, so a + deploy of a newer version or a rollback to an older one is immediately + reflected here. Empty while the app is `initializing`: nothing is routable + until its first build is ready and deployed. operationId: listEndpoints parameters: - $ref: '#/components/parameters/AppId' @@ -1205,13 +1498,25 @@ paths: summary: List workers description: > Returns a newest-first page of workers observed for the app (including - terminal `stopped` rows until purged). Optional `status` narrows the page; - a cursor must be replayed under the same status filter it was issued with. + terminal `stopped` rows until purged). Optional `state` and `status` narrow the + page; a cursor must be replayed under the same filters it was issued with. operationId: listWorkers parameters: - $ref: '#/components/parameters/AppId' - $ref: '#/components/parameters/Limit' - $ref: '#/components/parameters/Cursor' + - name: state + in: query + required: false + description: > + Narrow the page by worker state. The default, `all`, keeps the terminal + `stopped` rows in the page; `live` drops them. + + + A `state` of `live` with a `status` of `stopped` is a contradiction and is + refused, because an empty page would read as "this app has never run". + schema: + $ref: '#/components/schemas/WorkerStateFilter' - name: status in: query required: false @@ -1323,8 +1628,10 @@ paths: already in use — including when a secret of that name is `pending_destroy`. List only shows active secrets, so a name can appear free while create still conflicts for as long as that row remains. - Hard deletion of `pending_destroy` rows (which would release the name) - is not performed by this API yet. Recreate-while-deleting may later + A `pending_destroy` row is removed, and its name released, by a + background sweep once no running worker can still hold the value — + there is no deadline on that wait, so a continuously busy app can hold + a name for as long as it runs. Recreate-while-deleting may later reuse the pending row with the new value (same name, new ciphertext). operationId: createSecret requestBody: @@ -1392,13 +1699,15 @@ paths: summary: Delete a secret description: > Soft-deletes a secret: marks the row `pending_destroy` and bumps - revision. This API does not hard-delete the row; a future GC path is - expected to remove unattached `pending_destroy` secrets and release the - name, but that sweep is not implemented yet. Returns `409` while any + revision. This API does not hard-delete the row. A background sweep + removes the row and releases the name once no running worker can still + hold the value — the value travels inside the worker's own environment, + which is fixed when the container starts, so a worker keeps it until it + stops. There is no deadline on that wait. Returns `409` while any app still attaches it — cascade-detach is not performed here; detach each holder with - `DELETE .../apps/{id}/secrets/{name}` first. Attach/detach are - control-plane records only in this release (they do not roll workers). + `DELETE .../apps/{id}/secrets/{name}` first. Attach and detach change + the secret set for the next rollout. Neither operation rolls workers. While the row remains `pending_destroy` the name stays reserved, so create may return `409` even though list no longer shows the secret. Retries on an already-pending name are safe when no attachments remain @@ -1424,6 +1733,60 @@ paths: '422': $ref: '#/components/responses/ValidationError' + # --------------------------------------------------------------------------- + # Organisation tenancy (ADR-019 Option 2b) + # --------------------------------------------------------------------------- + /v1/org-tenancies: + put: + tags: + - Tenancy + summary: Set an organisation's serverless tenancy state + description: > + Idempotent upsert for one customer organisation. The customer UUID + is in the body — public paths never carry an organisation identifier + (the authenticated API key names the *caller*, which for this route + must be the Runware platform organisation). + + + `state: active` runs Ensure: a Cloud KMS CryptoKey named after the + organisation UUID, a Kubernetes service account `org-` in the + shared app namespace, and a decrypt IAM binding on that key for the + KSA principal. `state: disabled` runs teardown: disable the key's + primary version, drop the decrypt binding, delete the KSA. The key + itself is not destroyed — a destroyed key makes every ciphertext + under it permanently unreadable. The local row stays as a tombstone + so a later Ensure converges on the same names. + + + A retry after a partial failure converges rather than duplicating + objects. `200` returns the resulting receipt. `503` when Cloud KMS + key-admin is rate-limited (60 writes/min) or otherwise unavailable; + the caller (admin-api Messenger) retries the same PUT. + operationId: upsertOrgTenancy + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/OrgTenancyUpsert' + responses: + '200': + description: Tenancy is in the requested state (created, already present, or disabled) + content: + application/json: + schema: + $ref: '#/components/schemas/OrgTenancy' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '503': + $ref: '#/components/responses/ServiceUnavailable' + '400': + $ref: '#/components/responses/BadRequest' + '422': + $ref: '#/components/responses/ValidationError' + # --------------------------------------------------------------------------- # App <-> secret attachments # --------------------------------------------------------------------------- @@ -1469,15 +1832,15 @@ paths: summary: Attach a secret to an app description: > Records that an organisation secret is attached to an app under a - resolved env-var name. This is a control-plane association only in this - release — it does not roll workers or inject values into pods yet - (ADR-019 in-pod unseal is separate). Returns `409` if the secret is - already attached, or if another attach would use the same env-var name. + resolved env-var name. The next rollout injects the value into the + worker. This operation does not roll workers. Returns `409` if the + secret is already attached, or if another attach would use the same + env-var name. The resolved name (`envVarName`, or `secretName` when omitted) must not already exist as a plain environment variable on this app - (`deployment_configs.key`). Both sources are reserved for the same - future pod env namespace, so the server rejects the collision with `422` + (`deployment_configs.key`). Both sources use the same pod env namespace, + so the server rejects the collision with `422` instead of allowing a last-wins override later. The reverse check applies when setting a plain environment variable. @@ -1518,8 +1881,8 @@ paths: - Secrets summary: Detach a secret from an app description: > - Removes the control-plane attachment. Does not roll workers in this - release. + Removes the attachment from the next rollout. This operation does not + roll workers. Existing workers keep the value until they stop. operationId: detachAppSecret parameters: - $ref: '#/components/parameters/AppId' @@ -1746,46 +2109,221 @@ paths: '403': $ref: '#/components/responses/Forbidden' -components: - securitySchemes: - ApiKeyAuth: - type: http - scheme: bearer - description: > - Runware API key supplied as a bearer token. Validated server-to-server against the - existing Runware platform; the key identifies the organisation. - OrgJwtAuth: - type: http - scheme: bearer - bearerFormat: JWT + # --------------------------------------------------------------------------- + # Insights: customer-facing metrics and logs + # + # No path here names a tenant. The organization comes from the authenticated + # credential and nothing else, and it is what the stores are read under, so a caller + # cannot ask for another organization's data by naming it. + # + # Nothing on these routes accepts a query expression or a label matcher. A caller + # names a query from the catalogue and narrows it with selectors from a closed set; + # how that becomes a read is decided downstream (ADR-023). + # --------------------------------------------------------------------------- + /v1/metrics/queries: + get: + tags: + - Observability + summary: List the metric and log queries this build can answer description: > - Org-scoped JWT supplied as a bearer token, minted by the Runware platform for one - user acting in one organisation and verified locally against the platform's - published JWKS. Serves the web app; the CLI and SDK use ApiKeyAuth. + The catalogue: every named query, its unit and aggregation, the selectors it + accepts, the series it returns, and the windows actually backed by stored series. - parameters: - AppId: - name: appId - in: path - required: true - description: Immutable app identifier, unique within the authenticated organisation. - schema: - $ref: '#/components/schemas/AppId' - GpuTypeId: - name: gpuTypeId - in: path - required: true - description: Public catalogue code for a GPU type (e.g. `h100`), not the internal row UUID. - schema: - $ref: '#/components/schemas/GpuTypeId' - WorkerId: - name: workerId - in: path - required: true + + This is the source of query ids. Clients discover ids here rather than carrying a + list of their own, and render window tabs from `windows` rather than from the full + ladder, so a window whose storage tier has no backing series stays invisible + instead of rendering a tab with nothing behind it. + operationId: listInsightsQueries + responses: + '200': + description: The catalogue for this build + content: + application/json: + schema: + $ref: '#/components/schemas/QueryCatalogue' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '502': + $ref: '#/components/responses/BadGateway' + '503': + $ref: '#/components/responses/ServiceUnavailable' + '504': + $ref: '#/components/responses/GatewayTimeout' + + /v1/metrics/queries/{queryId}/series: + get: + tags: + - Observability + summary: Read one named metric query description: > - Worker identifier — the Kubernetes pod UID recorded by the reconciler. - schema: - type: string + Returns one chart's data: a single timestamp axis shared by every series, and one + dense value array per series aligned to it. + + + Values are dense and positionally aligned to `t`, with an explicit `null` wherever + there was no sample. Each timestamp is the END of its bucket, so `window.to` is + inclusive and equals the last timestamp in `t`, while `window.from` is exclusive + and is one `step_s` before the first. + + + An organization with no metrics yet is answered with the full axis and all-null + series rather than an error. + + + `apps_request_volume` returns one series per app: 24 hourly request counts over + `window=24h` (`step_s` 3600, unit `requests`). Repeat `appId` once per id on the + current list page to pad idle apps with all-null series, in request order. Hours + that started before that live app's `createdAt` are null, so a reused app id does + not inherit the previous generation's traffic still in the 24h store. The same + `appId` pad applies to the list-scoped `apps_error_volume` and + `apps_request_duration` queries. Other queries reject `appId`. Other windows + are not available for these queries. + + + `endpoints_request_volume` is the endpoints-list counterpart: 24 hourly request + counts per endpoint over `window=24h` (`step_s` 3600, unit `requests`). It + requires `deployment` (the public app id, rewritten to the live deployment + UUID). Repeat `endpointId` once per id on the current `listEndpoints` page to + pad idle endpoints with all-null series, in request order. Hours that started + before that endpoint row's `createdAt` are null, so a removed-then-readded path + does not inherit the previous row's traffic. Other queries reject `endpointId`. + Other windows are not available for this query. + operationId: getMetricSeries + parameters: + - $ref: '#/components/parameters/QueryId' + - $ref: '#/components/parameters/MetricWindow' + - $ref: '#/components/parameters/PinnedTo' + - $ref: '#/components/parameters/SelectorDeployment' + - $ref: '#/components/parameters/SelectorEndpoint' + - $ref: '#/components/parameters/SelectorStatusClass' + - $ref: '#/components/parameters/SelectorRegion' + - $ref: '#/components/parameters/SeriesAppId' + - $ref: '#/components/parameters/SeriesEndpointId' + responses: + '200': + description: One chart's data + content: + application/json: + schema: + $ref: '#/components/schemas/MetricSeries' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '422': + $ref: '#/components/responses/ValidationError' + '429': + $ref: '#/components/responses/TooManyRequests' + '502': + $ref: '#/components/responses/BadGateway' + '503': + $ref: '#/components/responses/ServiceUnavailable' + '504': + $ref: '#/components/responses/GatewayTimeout' + + /v1/logs/queries/{queryId}/entries: + get: + tags: + - Observability + summary: Read one page of a named log query + description: > + Returns one page of log entries, newest first, with an opaque cursor for the next + page when one exists. + + + No query is registered yet: live tail, retention tiers and log quotas are decided + in a follow-up ADR, so every request currently answers `404`. The route exists so + the contract is fixed before the templates land. + operationId: getLogEntries + parameters: + - $ref: '#/components/parameters/QueryId' + - $ref: '#/components/parameters/MetricWindow' + - $ref: '#/components/parameters/Limit' + - $ref: '#/components/parameters/Cursor' + - $ref: '#/components/parameters/SelectorDeployment' + - $ref: '#/components/parameters/SelectorEndpoint' + responses: + '200': + description: One page of log entries + content: + application/json: + schema: + $ref: '#/components/schemas/LogEntryPage' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '422': + $ref: '#/components/responses/ValidationError' + '429': + $ref: '#/components/responses/TooManyRequests' + '502': + $ref: '#/components/responses/BadGateway' + '503': + $ref: '#/components/responses/ServiceUnavailable' + '504': + $ref: '#/components/responses/GatewayTimeout' + +components: + securitySchemes: + ApiKeyAuth: + type: http + scheme: bearer + description: > + Runware API key supplied as a bearer token. Validated server-to-server against the + existing Runware platform; the key identifies the organisation. + OrgJwtAuth: + type: http + scheme: bearer + bearerFormat: JWT + description: > + Org-scoped JWT supplied as a bearer token, minted by the Runware platform for one + user acting in one organisation and verified locally against the platform's + published JWKS. Serves the web app; the CLI and SDK use ApiKeyAuth. + + parameters: + AppId: + name: appId + in: path + required: true + description: > + Immutable app identifier, unique among the authenticated organisation's live apps. + schema: + $ref: '#/components/schemas/AppId' + SourceUploadId: + name: uploadId + in: path + required: true + description: Source upload session identifier. + schema: + $ref: '#/components/schemas/SourceUploadId' + GpuTypeId: + name: gpuTypeId + in: path + required: true + description: Public catalogue code for a GPU type (e.g. `h100`), not the internal row UUID. + schema: + $ref: '#/components/schemas/GpuTypeId' + WorkerId: + name: workerId + in: path + required: true + description: > + Worker identifier — the Kubernetes pod UID recorded by the reconciler. This is the + stable key to address a worker with; `podName` is the value to show a person. + schema: + type: string format: uuid EndpointPath: name: endpointPath @@ -1795,10 +2333,7 @@ components: Path of the endpoint to route the task to, as returned by `listEndpoints`: a bare lowercase segment such as `generate`, with no leading slash. schema: - type: string - minLength: 1 - maxLength: 64 - pattern: '^[a-z]([a-z0-9-]{0,62}[a-z0-9])?$' + $ref: '#/components/schemas/EndpointPath' SecretName: name: secretName in: path @@ -1825,15 +2360,128 @@ components: schema: type: string + QueryId: + name: queryId + in: path + required: true + description: > + A query id from the catalogue. Deliberately not an enum: the downstream registry is + the source of ids, and an enum here would be a second list to keep in step with it. + schema: + type: string + pattern: '^[a-z][a-z0-9_]{0,63}$' + MetricWindow: + name: window + in: query + required: true + description: > + The time window. A closed set rather than a free-form range, because every distinct + range defeats the server-side cache alignment that makes a sliding window cheap. + Only the windows a query lists in the catalogue can be asked of it. + schema: + type: string + enum: [1h, 6h, 24h, 7d, 30d] + PinnedTo: + name: pinnedTo + in: query + required: false + description: > + Fixes the window's inclusive end, the last timestamp in `t`, so that several calls + making up one visual share an axis instead of racing the clock between them. Must + be aligned to the window's step, no newer than the newest readable edge, and inside + retention. + schema: + type: integer + format: int64 + SelectorDeployment: + name: deployment + in: query + required: false + description: Narrow to one app. + schema: + $ref: '#/components/schemas/AppId' + SelectorEndpoint: + name: endpoint + in: query + required: false + description: > + Narrow to one endpoint within a deployment. The value is the allocated + `endpoints.id` (UUID), never the customer-authored path. A query that + does not declare this selector rejects it rather than ignoring it. + schema: + type: string + format: uuid + SelectorStatusClass: + name: statusClass + in: query + required: false + description: Narrow to one response class. + schema: + type: string + enum: ['2xx', '4xx', '5xx'] + SelectorRegion: + name: region + in: query + required: false + description: > + Narrow to one region. No series carries a region label yet, so no query currently + accepts this and supplying it is rejected rather than ignored. + schema: + type: string + pattern: '^[a-z0-9_-]{1,32}$' + SeriesAppId: + name: appId + in: query + required: false + style: form + explode: true + description: > + Restrict expand-by-`app_id` queries (`apps_request_volume`, + `apps_error_volume`, `apps_request_duration`) to these app ids: one series + per id, in request order, with all-null series for apps that had no samples. + Values are hourly over `window=24h`. Hours that started before that live + app's `createdAt` are null. Repeat the parameter once per id on the current + list page (at most 100, matching `listApps`). Omit it to receive every app + in the organisation that had data, unless that set is larger than this + query will expand: then the call is a `422` on `appId` and the list page + should name the apps it is showing. Other queries reject this parameter. + schema: + type: array + maxItems: 100 + items: + $ref: '#/components/schemas/AppId' + SeriesEndpointId: + name: endpointId + in: query + required: false + style: form + explode: true + description: > + Restrict `endpoints_request_volume` to these endpoint ids: one series per id, + in request order, with all-null series for endpoints that had no traffic. + Values are hourly request counts over `window=24h`. Hours that started + before that endpoint row's `createdAt` are null. Repeat the parameter once + per id on the current list page (at most 100, matching `listEndpoints`). + Omit it to receive every endpoint on the selected app that had data, unless + that set is larger than this query will expand: then the call is a `422` + on `endpointId` and the list page should name the endpoints it is showing. + Other queries reject this parameter. Requires `deployment`. + schema: + type: array + maxItems: 100 + items: + type: string + format: uuid requestBodies: - TaskPayload: + TaskInvocation: required: true - description: Arbitrary JSON payload forwarded to the endpoint's RPC handler. + description: > + The invocation envelope. `taskId` is the client's own identifier for this + task and `payload` is the body the endpoint's handler receives. content: application/json: schema: - type: object - additionalProperties: true + $ref: '#/components/schemas/TaskInvocation' responses: Task: @@ -1843,7 +2491,10 @@ components: schema: $ref: '#/components/schemas/Task' TaskAccepted: - description: Task accepted and pending + description: > + Task accepted. Normally `pending`, but a resubmitted task id is answered + with the task it already names, which may have finished — read `status` + rather than assuming. content: application/json: schema: @@ -1895,21 +2546,216 @@ components: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' - Timeout: - description: Task timed out; `taskId` is present when the accepted task is known. + TooManyRequests: + description: > + The organization's read allowance is exhausted. `Retry-After` says how long to wait; + a client that ignores it will keep being refused. + headers: + Retry-After: + description: Seconds to wait before retrying. + required: true + schema: + type: integer + format: int32 + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + BadGateway: + description: An upstream service was unreachable or refused the request + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + GatewayTimeout: + description: An upstream service did not answer in time content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' - schemas: AppId: type: string - description: Immutable app identifier, unique within the authenticated organisation. + description: > + Immutable app identifier. Unique among the authenticated organisation's live apps: + it cannot be changed after creation, and it becomes available again once the app it + named reaches `deleted`. minLength: 6 maxLength: 30 pattern: '^[a-z][a-z0-9-]{4,28}[a-z0-9]$' + SourceUploadId: + type: string + format: uuid + + AppSourceType: + type: string + enum: [code, container] + x-enum-varnames: + - Code + - Container + + SourceUploadState: + type: string + enum: [pending, ready, rejected, consumed, expired, deleted] + x-enum-varnames: + - SourceUploadStatePending + - SourceUploadStateReady + - SourceUploadStateRejected + - SourceUploadStateConsumed + - SourceUploadStateExpired + - SourceUploadStateDeleted + + SourceUploadCreate: + type: object + additionalProperties: false + required: + - declaredByteLength + - idempotencyKey + - sha256 + - sourceType + properties: + declaredByteLength: + type: integer + format: int64 + minimum: 1 + maximum: 10485760 + description: Exact archive size in bytes with a 10 MiB MVP limit. + idempotencyKey: + type: string + minLength: 1 + maxLength: 255 + pattern: '^\S+$' + description: Client-generated key used to make session creation safe to retry. + sha256: + type: string + pattern: '^[a-f0-9]{64}$' + description: Lowercase SHA-256 digest of the complete archive. + sourceType: + $ref: '#/components/schemas/AppSourceType' + modelFile: + type: string + minLength: 1 + maxLength: 512 + pattern: '^[^/\\\s]\S*$' + description: > + Path of the MLflow model entry point inside the archive, relative to its root + (e.g. `model.py`). Required for a `code` upload and refused for a `container` + one, whose required files the contract names rather than the client. + + + It is declared here rather than at app creation because upload completion is + the last thing that opens the archive: `POST /v1/apps` consumes a ready upload + and never reads the object, so an entry point named there could only be proved + against the archive by reading it a second time. The pattern refuses a leading + separator; a path that escapes the archive root is refused by completion. + + SourceUpload: + type: object + additionalProperties: false + required: + - id + - appId + - declaredByteLength + - sha256 + - sourceType + - state + - expiresAt + - createdAt + - updatedAt + properties: + id: + $ref: '#/components/schemas/SourceUploadId' + appId: + $ref: '#/components/schemas/AppId' + declaredByteLength: + type: integer + format: int64 + minimum: 1 + sha256: + type: string + pattern: '^[a-f0-9]{64}$' + sourceType: + $ref: '#/components/schemas/AppSourceType' + state: + $ref: '#/components/schemas/SourceUploadState' + rejectionReason: + type: string + nullable: true + description: Reason completion rejected the archive, when state is `rejected`. + expiresAt: + type: string + format: date-time + createdAt: + type: string + format: date-time + updatedAt: + type: string + format: date-time + + SourceUploadTransfer: + oneOf: + - $ref: '#/components/schemas/SourceUploadSinglePutTransfer' + discriminator: + propertyName: mode + mapping: + singlePut: '#/components/schemas/SourceUploadSinglePutTransfer' + + SourceUploadSinglePutTransfer: + type: object + additionalProperties: false + required: + - mode + - method + - url + - headers + - expiresAt + properties: + mode: + type: string + enum: [singlePut] + x-enum-varnames: + - SourceUploadTransferModeSinglePut + method: + type: string + enum: [PUT] + x-enum-varnames: + - SourceUploadTransferMethodPut + url: + type: string + format: uri + description: Short-lived URL for this upload's exact staging object. + headers: + type: object + additionalProperties: + type: string + description: Headers the client must include in the upload request. + expiresAt: + type: string + format: date-time + description: Time after which the transfer instruction is no longer valid. + + SourceUploadCreation: + type: object + additionalProperties: false + required: + - upload + - transfer + properties: + upload: + $ref: '#/components/schemas/SourceUpload' + transfer: + $ref: '#/components/schemas/SourceUploadTransfer' + + EndpointPath: + type: string + description: > + Path of the endpoint to route the task to: a bare lowercase segment such + as `generate`, with no leading slash. + minLength: 1 + maxLength: 64 + pattern: '^[a-z]([a-z0-9-]{0,62}[a-z0-9])?$' + AppName: type: string description: > @@ -1966,7 +2812,8 @@ components: AppSort: type: string description: > - Ordering for `listApps`. Every ordering is total (ties broken by + Ordering for `listApps`. Favourited apps appear before non-favourited apps, and the + selected ordering applies within each group. Every ordering is total (ties broken by `appId`), so a page is reproducible and its cursor stable. @@ -2020,6 +2867,41 @@ components: - draining - stopping - stopped + # Pins the generated Go constant names. Without it, oapi-codegen prefixes + # an enum's constants only while some *other* enum shares a value with it, + # so adding an unrelated enum elsewhere in this spec silently renames all + # of these — which is exactly how WorkerStatusReady once became a bare + # Ready when new enums absorbed the conflicts that had forced the prefix. + x-enum-varnames: + - WorkerStatusPending + - WorkerStatusPulling + - WorkerStatusLoading + - WorkerStatusReady + - WorkerStatusBusy + - WorkerStatusUnhealthy + - WorkerStatusDraining + - WorkerStatusStopping + - WorkerStatusStopped + WorkerStateFilter: + type: string + description: > + Which worker states a page covers. `live` is every status other than + `stopped`, so it is the page a dashboard wants and the one `status` + alone can only ask for one value at a time. `all` includes the terminal + rows that are kept as history. + enum: + - live + - all + # oapi-codegen names an enum member after its value alone and prefixes the + # type only where two members collide, so `live` and `all` would generate + # as package-scope `Live` and `All`. Both read as belonging to nothing, and + # the next enum with a member of either name renames these two under the + # generator's own collision rule. Naming them here is the same spelling + # every other enum in this spec ends up with. + x-enum-varnames: + - WorkerStateFilterLive + - WorkerStateFilterAll + default: all TaskStatus: type: string enum: @@ -2054,6 +2936,16 @@ components: maxLength: 64 pattern: '^[a-z][a-z0-9_-]{0,63}$' + GpuTypeIdOrEmpty: + type: string + description: > + A `GpuTypeId`, or the empty string. Optional fallback GPU fields accept + `""` because forms bind an unselected dropdown as empty rather than + omitting the key. A non-empty value has the same shape as `GpuTypeId` — + keep this pattern aligned when the catalogue-code format changes. + maxLength: 64 + pattern: '^$|^[a-z][a-z0-9_-]{0,63}$' + GpuAvailability: type: string description: Scheduler provisioning availability for this GPU type. @@ -2290,6 +3182,49 @@ components: nullable: true description: Cursor for the next page; null when there are no more items. + ListSummary: + type: object + additionalProperties: false + description: > + Collection totals for a paged list. Independent of the page: + `total` is the COUNT of items in the collection and is the same value + on every page, including a cursor that seeks past the last row. + required: + - total + properties: + total: + type: integer + format: int64 + minimum: 0 + description: Number of items in the collection this page was drawn from. + + BuildListSummary: + type: object + additionalProperties: false + description: > + Collection totals for this app's builds list. Independent of the page: + the same values on every cursor, including a seek past the last row. + `total` counts builds. `versions` counts versions on the same app — + the same predicate as `listVersions` `summary.total`, excluding + soft-deleted versions. + required: + - total + - versions + properties: + total: + type: integer + format: int64 + minimum: 0 + description: Number of builds recorded for this app. + versions: + type: integer + format: int64 + minimum: 0 + description: > + Number of versions recorded for this app. Same value as + `listVersions` `summary.total`. A config-only update increments + this without incrementing `total`. + # ---- Money ------------------------------------------------------------- Currency: type: string @@ -2320,9 +3255,9 @@ components: description: > Aggregate dashboard metrics for every app in the authenticated organisation. App and worker tallies are always present (zero when - empty). Traffic and spend metrics whose backing system is not yet - available are omitted (rendered as "no data" by the frontend) rather - than reported as zero. + empty). Request and error-rate totals are omitted when the metrics + store cannot be read, rather than reported as zero. Spend is omitted + until billing rollups exist. required: - totalApps - activeApps @@ -2352,11 +3287,15 @@ components: requests24h: type: integer format: int64 - description: Requests served in the last 24h. Omitted until request metrics are available. + description: > + Requests served in the last 24 hours across every app. Omitted when + metrics cannot be read. Zero when the organisation had no traffic. errorRate24h: type: number format: double - description: Error ratio (0–1) over the last 24h. Omitted until request metrics are available. + description: > + Error ratio (4xx + 5xx over requests) for the last 24 hours, in 0–1. + Omitted when metrics cannot be read or when `requests24h` is zero. spendToday: allOf: - $ref: '#/components/schemas/MoneyAmount' @@ -2368,12 +3307,67 @@ components: format: date-time description: When these metrics were computed. + AppRuntime: + type: object + additionalProperties: false + description: > + Observed state for one app at `calculatedAt`. Desired worker scale remains + in `configuration`. Worker and GPU counts are always present; traffic and + duration fields are omitted when their backing data is unavailable. + required: + - activeWorkers + - provisionedGpuCount + - calculatedAt + properties: + activeWorkers: + type: integer + format: int64 + minimum: 0 + description: > + Non-terminal workers (`status` other than `stopped`) on this app. + Pending workers count because they still hold capacity. + provisionedGpuCount: + type: integer + format: int64 + minimum: 0 + description: > + Sum of `gpuCount` across those workers. A pending worker contributes + zero until Kubernetes schedules it onto a node. + calculatedAt: + type: string + format: date-time + description: When this runtime snapshot was read from the database. + requests24h: + type: integer + format: int64 + minimum: 0 + description: Requests served by this app in the last 24 hours. Omitted until available. + errorRate24h: + type: number + format: double + minimum: 0 + maximum: 1 + description: > + Error ratio (4xx + 5xx over requests) for this app in the last 24 + hours, in 0–1. Omitted when metrics cannot be read or when the app + had no requests in the window. + averageRequestDuration24h: + type: number + format: double + minimum: 0 + description: > + Mean inference request duration in seconds over the last 24 hours + (all requests; the duration histogram has no status class). Omitted + when metrics cannot be read, when the app had no requests, or when + the duration series has no samples for the app in the window. + App: type: object required: - appId - appName - configuration + - runtime - secrets - environmentVariables - status @@ -2389,6 +3383,8 @@ components: allOf: - $ref: '#/components/schemas/WorkerConfig' description: Live worker configuration. Updated via `PATCH /apps/{appId}`. + runtime: + $ref: '#/components/schemas/AppRuntime' secrets: type: array description: > @@ -2413,8 +3409,8 @@ components: isFavourite: type: boolean description: > - Whether the authenticated organisation has favourited this app. Drives the - console Favourites section; toggled via `PUT`/`DELETE` + Whether the authenticated organisation has favourited this app. Favourited apps + sort ahead of non-favourited apps; toggled via `PUT`/`DELETE` `/v1/apps/{appId}/favourite`. activeVersionId: type: string @@ -2472,23 +3468,24 @@ components: - `code`: the codebase is submitted to the build pipeline; a new image is built and deployed once ready. - - `container`: no build step — the version names the image reference supplied here. - No worker runs from a container source yet, so the app stays `initializing`. + - `container`: the submitted zip is built into a wrapper image by the same + pipeline and deployed once ready; the version records the built image, not a + customer-supplied reference. - Either way the version is recorded with the app. A code-source app transitions - to `active` once its first version is ready, or to `failed` if the build, validation, - or rollout fails. + Either way the version is recorded with the app, and the app transitions + to `active` once its first version is ready, or to `failed` if the build, + validation, or rollout fails. secrets: type: array description: > Existing organisation secrets to attach to this app, with an - optional env-var name override per entry. Not persisted yet — - supplying this field returns `422`, rather than accepting a set - nothing attaches to the workload. Shape matches - `POST /apps/{appId}/secrets` so create and attach - share one contract. When wired, each injected name must not collide - with a key in `environmentVariables` (or an existing - `deployment_configs` row) — see `SecretAttach`. + optional env-var name override per entry. This is the app's initial + attachment set, so the first rollout carries the values into the + worker. The secret must already exist and be `active`; this route + does not create one, and an unknown or inactive name returns `404`. + Shape matches `POST /apps/{appId}/secrets` so create and attach + share one contract. Each injected name must not collide with a key + in `environmentVariables` — see `SecretAttach`. items: $ref: '#/components/schemas/SecretAttach' environmentVariables: @@ -2517,16 +3514,6 @@ components: the sandboxed application. Use these for downloaded weights and caches that must stay outside the checkpointed root filesystem. Paths must be unique and non-overlapping. The set is frozen into each immutable app version. - endpoints: - type: array - description: > - Invocable routes to expose on the app. Paths are unique within an - app: repeating one in this array is rejected rather than collapsed, - since there would be no answer to which entry a request meant. - uniqueItems: true - maxItems: 20 - items: - $ref: '#/components/schemas/EndpointCreate' AppUpdate: type: object @@ -2535,17 +3522,27 @@ components: omitted fields are left unchanged. Lifecycle transitions (stop/resume/delete/deploy) use their dedicated operations. - A successful update records a new version carrying the updated configuration and the - same image, so what to deploy is always a version rather than the current state of a - mutable row. `activeVersionId` does not move: the running workload is unchanged until - that version is deployed. - - **Currently applied:** `appName` and `configuration`. Supplying - `appSource`, `secrets`, `environmentVariables`, or `endpoints` returns `422` - (bulk env-var replace is not wired — use the dedicated `/environment-variables` - endpoints for individual keys). When wired, configuration/secret/endpoint changes - take effect on the next Scaler cycle; `appSource` triggers a new build and - rollout. + A successful configuration or `environmentVariables` update records a new + version carrying the updated values and the same image. If that image is + deployable, the update pins it as `activeVersionId` and rolls the workload + when the app can take one (`active`, `initializing`, or `failed` which + becomes `initializing`). If the image is not deployable, the version is + recorded and `activeVersionId` is left unchanged. A name-only update + records a version and does not pin. If the roll of a live app fails, + `activeVersionId` is restored so the field keeps naming the running + configuration. + + `appSource` starts a build and records version N+1 with a new image. + The deploy queue rolls that version once the build is ready; + `activeVersionId` moves only then. A builder rejection leaves the app + on its current version. After accept, a late overlay race leaves + the new version recorded and the previous attachments in place. + + `secrets` replaces the attachment set and does not roll the workload. + Endpoints are not a field of this contract at all: the set belongs to + the app source, so it changes only when a new version with a new source + builds and deploys, and an unknown `endpoints` field is rejected like + any other. additionalProperties: false properties: appName: @@ -2561,38 +3558,46 @@ components: allOf: - $ref: '#/components/schemas/AppSourceUpsert' description: > - Write-only. New source to build and deploy; not returned in the App response. - Use the `/builds` endpoints to inspect build status. Triggers a build (for `code` - sources) or image validation (for `container` sources); on success the resulting - version is deployed automatically. On failure the app remains on the previous - version. Not persisted yet — supplying this field returns `422`. + Write-only. New source to build and deploy; not returned in the App + response. Use the `/builds` endpoints to inspect build status. + Triggers a build (for `code` sources) or validates `container.yaml` + then builds (for `container` sources). On accept the resulting + version is recorded with a new image tag and rolled through the + deploy queue. A builder rejection leaves the app on the previous + version and writes no version or build row. After accept, a + concurrent secret deactivation or env/secret collision leaves + version N+1 recorded and the previous attachment set in place. + `activeVersionId` moves only when that rollout completes. Not + valid on a `stopped` or `stopping` app — there is nothing to roll + the new version onto, and `resume` rolls the pinned one — so + supplying it in those statuses returns `409 Conflict`. secrets: type: array description: > Replaces the app's secret attachments. Same `SecretAttach` - shape as create and - `POST /apps/{appId}/secrets`. Not persisted yet — - supplying this field returns `422`. When wired, injected names must - not collide with plain environment variables on the app. + shape as create and `POST /apps/{appId}/secrets`. An attachment + absent from the array is detached. Injected names must not collide + with a plain environment variable on the app. Control-plane record + only — secret values do not reach a pod, and the version snapshot + carries no secrets — so this field does not roll the workload. + An app holds at most 100 environment bindings in total; this + array cannot exceed that ceiling on its own. + maxItems: 100 items: $ref: '#/components/schemas/SecretAttach' environmentVariables: type: object description: > - Map with environment variables. Keys are the environment variable names, values - are the environment variable values. Setting the value of an environment variable - to null deletes the environment variable from the app. Not persisted yet — - supplying this field returns `422`. + Replaces the app's environment variables. Keys are the variable + names, values are the values. A key absent from the map is deleted. + A null value omits that key from the new set. The resolved map is + snapshotted onto the version this update records, so a deploy + applies it. When the copied image is deployable the update pins + and rolls, the same as a configuration change. additionalProperties: type: string nullable: true - endpoints: - type: array - description: > - Replaces the app's endpoints. Not persisted yet — supplying this field - returns `422`. - items: - $ref: '#/components/schemas/EndpointCreate' + maxProperties: 100 WorkerConfig: type: object @@ -2632,6 +3637,7 @@ components: type: integer format: int32 default: 1 + description: One GPU per worker is currently supported. Historical apps may contain another value. minWorkers: type: integer format: int32 @@ -2647,12 +3653,12 @@ components: format: int32 nullable: true minimum: 0 - description: Minimum number of available (idle) workers kept as a pre-emptive buffer. + description: Reserved for future idle-worker buffer support. availableWorkersPct: type: integer format: int32 nullable: true - description: Scaling buffer as a percentage of incoming task load. + description: Reserved for future percentage-based buffer support. idleTtlSecs: type: integer format: int32 @@ -2703,13 +3709,22 @@ components: fallbackGpuType: type: string allOf: - - $ref: '#/components/schemas/GpuTypeId' + - $ref: '#/components/schemas/GpuTypeIdOrEmpty' nullable: true + description: > + Secondary GPU type used if the preferred type is unavailable. Omit, + send JSON null, or send an empty string for no fallback — forms bind + an unselected dropdown as `""`, which is not a `GpuTypeId`. A + non-empty value must be an active catalogue code. Unlike `gpuType` + this is an existence check only: it does not require admitted + capacity, so the code may not appear in the customer + `GET /v1/gpu-types` list. gpusPerWorker: type: integer format: int32 minimum: 0 default: 1 + description: Only 1 is currently supported. Any other value returns 422. minWorkers: type: integer format: int32 @@ -2724,12 +3739,14 @@ components: format: int32 minimum: 0 nullable: true + description: A non-null value returns 422 because this setting is not supported yet. availableWorkersPct: type: integer format: int32 minimum: 0 maximum: 100 nullable: true + description: A non-null value returns 422 because this setting is not supported yet. idleTtlSecs: type: integer format: int32 @@ -2748,9 +3765,10 @@ components: type: object description: > Partial worker configuration. Any field present overwrites the live value; omitted - fields are left unchanged. Clearing a nullable live field (setting it to null) is not - supported — omit the field to leave it unchanged. `computeType` is create-time only and - cannot be patched. Changing `gpuType` or `gpusPerWorker` affects only newly created workers. + fields are left unchanged. Clearing a nullable live field (setting it to null) is + not supported — omit the field to leave it unchanged. `fallbackGpuType` is the + exception: send an empty string to clear it. `computeType` is create-time only + and cannot be patched. Changing `gpuType` affects only newly created workers. additionalProperties: false properties: gpuType: @@ -2764,12 +3782,20 @@ components: fallbackGpuType: type: string allOf: - - $ref: '#/components/schemas/GpuTypeId' - description: Secondary GPU type. Omit to leave unchanged. + - $ref: '#/components/schemas/GpuTypeIdOrEmpty' + description: > + Secondary GPU type. Omit to leave unchanged. Send an empty string + to clear — forms bind an unselected dropdown as `""`. JSON null is + rejected: this field is not nullable, so a client that meant to + clear must send `""` rather than null. A non-empty value must be + an active catalogue code. Unlike `gpuType` this is an existence + check only: it does not require admitted capacity, so the code + may not appear in the customer `GET /v1/gpu-types` list. gpusPerWorker: type: integer format: int32 minimum: 0 + description: Only 1 is currently supported. Any other value returns 422. minWorkers: type: integer format: int32 @@ -2782,13 +3808,13 @@ components: type: integer format: int32 minimum: 0 - description: Pre-emptive idle-worker buffer. Omit to leave unchanged. + description: Reserved for future use. Supplying it returns 422. availableWorkersPct: type: integer format: int32 minimum: 0 maximum: 100 - description: Scaling buffer as a percentage of load. Omit to leave unchanged. + description: Reserved for future use. Supplying it returns 422. idleTtlSecs: type: integer format: int32 @@ -2802,51 +3828,250 @@ components: format: int32 minimum: 1 - Version: + Version: + type: object + description: > + An immutable record of what to deploy. One is created with the app and one on + every update, so a rollout always names a version rather than reading configuration + that may since have changed. `listVersions` and `getVersion` return this same shape. + The version internally pins the exact image digest its build pushed, and everything + the version references — the built image and the submitted source — is retained for + the life of the version. + + Computed fields: + + - `buildDurationMs` is the wall-clock duration of the build this version names. + Null while the build is running or when no completion time is available. A + config-only update carries the image — and therefore this duration — forward. + + - `changes` is the structured diff against the previous version. Null on version 1 + (no predecessor). A name-only update still inserts a version; `changes` is then + present with `imageChanged` false and no field diffs. + required: + - id + - appId + - versionNumber + - createdAt + properties: + id: + type: string + format: uuid + appId: + $ref: '#/components/schemas/AppId' + versionNumber: + type: integer + format: int32 + description: Monotonically increasing per app. + buildId: + type: string + format: uuid + nullable: true + description: > + The build that produced this version's image. Both source types build — a + `code` source bakes an image around a submitted codebase, a `container` source + builds the customer's own wrapper Dockerfile. A version created by an update + carries the image, and therefore this build, forward. + gpuType: + type: string + allOf: + - $ref: '#/components/schemas/GpuTypeId' + nullable: true + description: > + Preferred GPU type of this version, taken from the config snapshot. + author: + type: object + allOf: + - $ref: '#/components/schemas/TriggeredBy' + nullable: true + description: > + Who created this version — the authenticated user (JWT) or the API key. + `displayName` is the name captured at write time. + buildDurationMs: + type: integer + format: int64 + nullable: true + description: > + Wall-clock milliseconds of the named build (`completedAt - createdAt` on that + build). Null while the build is running or when no completion time is + available. Bytes and units are not included; this is a raw millisecond count. + changes: + type: object + allOf: + - $ref: '#/components/schemas/VersionChanges' + nullable: true + description: > + Structured diff against the previous version. Null on version 1. + createdAt: + type: string + format: date-time + + VersionChanges: + type: object + additionalProperties: false + description: > + How this version differs from the previous one. Environment-variable *values* + never appear — only keys — so a secret-bearing env var cannot leak through the + versions list. Numeric worker-config fields are rendered as decimal-free + integer strings (the same spelling the event log uses). Empty collections are + omitted: a name-only update is `{ "imageChanged": false }`. + required: + - imageChanged + properties: + imageChanged: + type: boolean + description: > + True when this version names a different image than the previous one + (`buildId` or `imageRef` changed). False for a config-only update, which + carries the image forward. + workerConfig: + type: array + items: + $ref: '#/components/schemas/VersionConfigChange' + environmentVariables: + $ref: '#/components/schemas/VersionKeySetDiff' + endpoints: + $ref: '#/components/schemas/VersionKeySetDiff' + volumes: + $ref: '#/components/schemas/VersionKeySetDiff' + + VersionConfigChange: type: object + additionalProperties: false description: > - An immutable record of what to deploy. One is created with the app and one on - every update, so a rollout always names a version rather than reading configuration - that may since have changed. + One worker-config field that changed. `field` is the public JSON name + (`gpuType`, `minWorkers`, `idleTtlSecs`, …). `from` / `to` are strings; + null means the field was unset on that side. required: - - id - - appId - - versionNumber - - createdAt + - field + - from + - to properties: - id: + field: type: string - format: uuid - appId: - $ref: '#/components/schemas/AppId' - versionNumber: - type: integer - format: int32 - description: Monotonically increasing per app. - buildId: + from: + type: string + nullable: true + to: type: string - format: uuid nullable: true + + VersionKeySetDiff: + type: object + additionalProperties: false + description: > + Keys added, removed, or changed between consecutive versions. For + environment variables, `changed` is keys whose *value* changed (the value + itself is never returned). For endpoints the key is the path; for volumes + it is `mountPath`. `changed` is omitted on those two (a path either exists + or does not). + properties: + added: + type: array + items: + type: string + removed: + type: array + items: + type: string + changed: + type: array + items: + type: string + + BuildPhase: + type: object + description: > + One observed step of a build, in execution order. The phase list is open: + which phases a build reports depends on its kind and on how it ran, so + clients must not assume a fixed set of names or a fixed count. + required: + - name + - startedAt + - outcome + properties: + name: + type: string description: > - The build that produced this version's image. Null for a `container` source, - which names an image the customer already built and so has no build. A version - created by an update carries the image, and therefore this build, forward. - createdAt: + Phase identifier, e.g. `prepare`, `build`, `index`. Deliberately not + an enum — new build kinds report new phases without a contract change. + startedAt: type: string format: date-time + completedAt: + type: string + format: date-time + nullable: true + description: Null while the phase is still running. + outcome: + type: string + enum: + - running + - succeeded + - failed Build: type: object - description: Details of a code build or container validation. + description: > + Details of a build. Both source types build, and `kind` says which pipeline ran: + a `code` submission or a customer's own wrapper Dockerfile. Phase lists differ by + kind, so never assume a fixed one. `listBuilds` and `getBuild` return this same + shape. + + + Nullability: + + - `error` is null while the build is running (`queued`, `building`), on success + (`ready`), and on `superseded` (a newer version took over — the `status` conveys + that, and it is not a failure); it is present only on `failed`. + + - `completedAt` and `durationMs` are null while the build is running and set once it + reaches a terminal status (`ready`/`failed`/`superseded`). They are also null for + terminal builds that finished before completion timestamps were tracked. + + - `exitCode` is null while running. On a terminal build it carries the build Job's + exit code when the builder still had it to report; it can remain null on a terminal + build whose Job aged out before the code was read. + + - `versionId` / `versionNumber` name the version this build produced. A code build's + version is created together with the build, so these are populated from the moment + the build exists, in every status; they are null only when no version references the + build. When later config updates carry the build forward onto new versions, this is + the earliest — the one the build actually produced. + + - `triggeredBy` names the user or API key that submitted the build; it is null only + for builds created before the actor was recorded. required: - id - status + - source + - phases properties: id: type: string format: uuid + appId: + $ref: '#/components/schemas/AppId' + source: + $ref: '#/components/schemas/BuildSource' + triggeredBy: + $ref: '#/components/schemas/TriggeredBy' status: $ref: "#/components/schemas/BuildStatus" + versionId: + type: string + format: uuid + nullable: true + description: > + The version this build produced. A code build's version is created together with + the build, so this is populated in every status; it is null only when no version + references the build. A code update carries an image — and so its build — forward + onto a new version, so a build may be named by several versions; this is the + earliest, the one the build actually produced. + versionNumber: + type: integer + format: int32 + nullable: true + description: Version number of `versionId`; null when `versionId` is null. error: type: string nullable: true @@ -2855,57 +4080,139 @@ components: type: integer format: int32 nullable: true + description: > + Exit code of the build container: 0 on success, its non-zero code on a build + failure. Null while running, on a terminal build whose exit code the builder + could no longer report, and when the build container never ran (e.g. an init + container such as dockerfile generation failed first). logTail: type: string nullable: true description: Trailing build log output. + durationMs: + type: integer + format: int64 + nullable: true + description: > + Wall-clock milliseconds from `createdAt` to `completedAt`; null while the build is + still running or when no completion time was recorded. + phases: + type: array + items: + $ref: "#/components/schemas/BuildPhase" + description: > + Observed build phases with their timings, recorded once the build is + terminal; empty until then. Phase lists differ by `source.type`; + never assume a fixed list. createdAt: type: string format: date-time + completedAt: + type: string + format: date-time + nullable: true + description: > + When the build reached a terminal status (`ready`/`failed`/`superseded`); null + while running or for terminal builds recorded before this was tracked. - ContainerSource: + BuildSource: type: object + description: > + Where a build's source came from: `code` for a customer code submission, `container` + for a customer wrapper Dockerfile. `repository` and `revision` are not yet recorded + (both sources are zip uploads) and will be added when the platform stores that + provenance. required: - - imageRef + - type properties: - imageRef: - type: string - minLength: 1 - maxLength: 512 - pattern: '^\S+$' - description: Registry URI of a pre-built image, e.g. `ghcr.io/acme/model:v2`. - registrySecretName: + type: type: string - nullable: true - minLength: 1 - maxLength: 253 - pattern: '^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$' description: > - Pull-credential name for a private image registry. Omit for a public - registry. Parked on the version until image-pull custody has its own - ADR — it is not a `secrets` row (ADR-019 covers only env-var secrets - unsealed in-pod; the kubelet needs the credential before any - container starts). + The kind of source that produced this build — `code` or `container`, straight + from the build record. Build phases differ by kind, so clients must not assume + a fixed phase list. Not modelled as an enum so adding a kind later does not + churn the existing source-type constants this API shares. + + TriggeredBy: + type: object + description: > + Who performed an action — the authenticated user (JWT) or the API key. + `kind` says which, so `id` (that actor's UUID) is resolvable to the right thing; + `displayName` is its name captured at write time, so it renders as it was even if + the user or key is later renamed. Used as `Build.triggeredBy` and `Version.author`. + required: + - kind + - id + - displayName + properties: + kind: + type: string + enum: [user, apiKey] + description: Whether the actor is a user (JWT) or an API key. + id: + type: string + format: uuid + displayName: + type: string - When wired, the name becomes a Kubernetes Secret name, so it must be - a DNS-1123 subdomain: lower-case alphanumerics, `-` and `.`, starting - and ending alphanumeric, at most 253 characters. That is a hard - requirement of what the name is used for, not a Runware naming policy. + ContainerSource: + type: object + # Rejects the retired zipBase64 (and any other stray field) at the edge: + # without this, a payload carrying both a valid uploadId and the old + # inline archive would still be accepted. + additionalProperties: false + required: + - uploadId + properties: + uploadId: + allOf: + - $ref: '#/components/schemas/SourceUploadId' + # The pattern is what the request validator enforces on the body: + # kin-openapi treats `format` as advisory, so without it a non-uuid + # uploadId would pass the edge and fail deeper with a worse error. + # On the body only — a malformed *path* id stays the parse-time 400. + pattern: '^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$' + description: > + Id of a ready, unexpired source upload created for this app via + `POST /v1/apps/{appId}/source-uploads` and completed. The archive + it names carries a wrapper `Dockerfile` and a `container.yaml` + config document at its root, plus any build-context files the + Dockerfile copies in. Runware builds the image from it — resolving + the Dockerfile's public base images to immutable digests — and + hosts the result, so no image reference or pull credential is + supplied: a private base image is not supported until a build-time + credential mechanism exists. An invalid `container.yaml` rejects the + create — `400` where the document could not be parsed, `422` where it + parsed and broke a rule — with `errors[]` entries carrying + `configPointer` into the document; the endpoint set it declares + becomes visible once the first build is ready and deployed. The + operation consumes the upload atomically with the version it + creates (version 1 on create, the next version on a source + update); a consumed upload cannot back a second app or version. CodebaseSource: type: object + # Same edge rejection of the retired zipBase64 (and modelFile, which now + # lives on the upload declaration) as ContainerSource. + additionalProperties: false required: - - zipBase64 - - modelFile + - uploadId properties: - zipBase64: - type: string + uploadId: + allOf: + - $ref: '#/components/schemas/SourceUploadId' + # Same edge enforcement as the container source's uploadId: `format` + # alone is advisory to the request validator. + pattern: '^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$' description: > - Base64-encoded zip archive of the customer's code. - Note: move to presigned URL upload for production — base64 bloats the request body for large codebases. - modelFile: - type: string - description: Path within the zip to the MLflow model entry point (e.g. `model.py`). + Id of a ready, unexpired source upload created for this app via + `POST /v1/apps/{appId}/source-uploads` and completed. The archive + it names is the zip of the customer's code, and the upload's own + declaration carries the model entry point (`modelFile`), verified + against the archive at completion — it is not repeated here. The + operation consumes the upload atomically with the version it + creates (version 1 on create, the next version on a source + update); a consumed upload cannot back a second app or version. AppSourceUpsert: type: object @@ -2914,11 +4221,12 @@ components: - source properties: type: - type: string - enum: [code, container] + allOf: + - $ref: '#/components/schemas/AppSourceType' description: > Selects the version creation path. `code` submits customer source code to - the Image Build Service; `container` references a pre-built OCI image. + the Image Build Service; `container` submits a wrapper `Dockerfile` and + `container.yaml` for Runware to build into a hosted image. source: oneOf: - $ref: '#/components/schemas/CodeSourceUpsert' @@ -2978,30 +4286,20 @@ components: type: string format: date-time - EndpointCreate: - type: object - required: - - path - properties: - path: - type: string - minLength: 1 - maxLength: 64 - pattern: '^[a-z]([a-z0-9-]{0,62}[a-z0-9])?$' - description: > - The endpoint's identity within the app: a bare lowercase URL - segment, e.g. `generate` — a letter first, then letters, digits and - hyphens, ending with a letter or digit, max 64 characters. No leading - slash: documentation may display `/generate`, but the stored and - addressed form is `generate`, so it drops into the invocation URL with - no encoding. Unique within the app. All invocations are POST; - the HTTP method is not part of endpoint identity. - Worker: type: object description: > A worker instance observed from Kubernetes. Read-only runtime state written by the reconciler; `id` is the pod UID. + + + Address a worker by `id`, which is stable for the life of the pod, and show + `podName`, which is the name the same pod has in the cluster. There is no + separate short identifier. + + + Uptime is derived, not carried: a worker has been up from `createdAt` until + `statusOccurredAt` once its `status` is `stopped`, and until now before that. required: - id - appId @@ -3010,6 +4308,10 @@ components: - status - gpuCount - statusOccurredAt + # Required because the uptime derivation above rests on it, and the column it + # comes from is NOT NULL. updatedAt is always sent too but carries no such + # contract, so it stays optional. + - createdAt properties: id: type: string @@ -3036,7 +4338,9 @@ components: statusOccurredAt: type: string format: date-time - description: When the worker entered its current status. + description: > + When the worker entered its current status. For a `stopped` worker this is + when it stopped, so it is also the end of the worker's uptime. gpuCount: type: integer format: int32 @@ -3048,6 +4352,16 @@ components: - $ref: '#/components/schemas/GpuTypeId' nullable: true description: GPU catalogue code snapshotted at observation time; omitted for CPU workers. + gpuAvailability: + type: string + allOf: + - $ref: '#/components/schemas/GpuAvailability' + nullable: true + description: > + How the catalogue currently provisions this worker's `gpuType`. Omitted for a + CPU worker and for a code the catalogue no longer holds. Unlike `gpuType` this + is read now rather than snapshotted, so it tells you how that GPU is supplied + today, not how it was supplied when the worker started. lastSeenAt: type: string format: date-time @@ -3058,11 +4372,65 @@ components: createdAt: type: string format: date-time - description: Pod creation time (`metadata.creationTimestamp`), not insert time. + description: > + Pod creation time (`metadata.creationTimestamp`), not insert time. It is also + the start of the worker's uptime. updatedAt: type: string format: date-time + OrgTenancyDesiredState: + type: string + description: > + Client-writable tenancy state. `active` runs Ensure; `disabled` runs + teardown. `pending` is server-only on the receipt and is rejected. + enum: + - active + - disabled + OrgTenancyUpsert: + type: object + additionalProperties: false + description: > + Desired serverless tenancy for a customer organisation. The UUID is + the organisation being provisioned, not the authenticated caller. + required: + - organizationUuid + - state + properties: + organizationUuid: + type: string + format: uuid + state: + $ref: '#/components/schemas/OrgTenancyDesiredState' + OrgTenancy: + type: object + description: > + Receipt that an organisation has been provisioned for serverless + (ADR-019). Names are derived from the organisation UUID; this object + is the state machine, not a directory. + required: + - organizationUuid + - state + - ksaName + properties: + organizationUuid: + type: string + format: uuid + state: + type: string + description: > + `pending` while Ensure is in flight, `active` when key, KSA and + bindings have converged, `disabled` after teardown. Rows are + tombstones — disable does not delete. + enum: + - pending + - active + - disabled + ksaName: + type: string + description: Kubernetes service account in the shared app namespace (`org-`). + pattern: '^[a-z0-9]([-a-z0-9]*[a-z0-9])?$' + Secret: type: object description: Secret metadata. The encrypted value is never returned. @@ -3112,12 +4480,12 @@ components: SecretAttach: type: object description: > - Attach an organisation secret to an app (control-plane record - only in this release). The resolved name (`envVarName`, or `secretName` - when omitted) is stored as one NOT NULL column. It must be unique among - this app's secret attaches and must not collide with a plain - environment variable key on the same app — both names are - reserved for the same future pod env namespace. Reserved platform names + Attach an organisation secret to an app. The resolved name + (`envVarName`, or `secretName` when omitted) is the environment variable + the secret is injected as, and the next rollout carries the value into + the worker. It must be unique among this app's secret attaches and must + not collide with a plain environment variable key on the same app — + both names land in the same pod env namespace. Reserved platform names are rejected as on `SecretName`. required: - secretName @@ -3130,11 +4498,11 @@ components: - $ref: '#/components/schemas/EnvironmentVariableName' nullable: true description: > - Environment variable name to use when the secret is eventually - injected. Omit or null to use `secretName`; the server resolves and - stores the final name. Same reserved-name rules as `SecretName` - (`422` if reserved). The resolved name must also not collide with - `deployment_configs.key` on this app (`422`). + Environment variable name the secret is injected as. Omit or null to + use `secretName`; the server resolves and stores the final name. Same + reserved-name rules as `SecretName` (`422` if reserved). The resolved + name must also not collide with a plain environment variable key on + this app (`422`). SecretCreate: type: object @@ -3220,21 +4588,60 @@ components: what the Kubernetes API server accepts — the same `maxLength` create applies, so one path cannot be used to exceed the other. + TaskInvocation: + type: object + additionalProperties: false + required: + - taskId + - payload + description: > + The request body for both invoke routes. The endpoint's own input schema + describes `payload`, never the whole body, so no platform field can + collide with one of the app's own. Unknown top-level members are rejected + rather than ignored: the envelope is the platform's to extend, and + silently accepting a stray member would make a later addition breaking. + properties: + taskId: + $ref: '#/components/schemas/TaskId' + payload: + type: object + additionalProperties: true + description: > + The body the endpoint's handler receives, validated against the + endpoint's declared input schema. An endpoint that declares none + takes it unvalidated. + + TaskId: + type: string + format: uuid + minLength: 36 + maxLength: 36 + pattern: '^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$' + description: > + Client-generated task identifier, canonical lowercase UUID. One id is one + task: resubmitting it is answered with the task it already names rather + than starting a second, so a request whose response was lost can be sent + again without paying for the work twice. Reusing an id for a different + request returns the first task, so the id is the caller's to keep unique. + Task: type: object required: - id - status - appId + - endpointPath - createdAt properties: id: type: string - description: Opaque task identifier returned by the execution backend. + description: Task identifier, supplied by the caller when the task was submitted. status: $ref: '#/components/schemas/TaskStatus' appId: $ref: '#/components/schemas/AppId' + endpointPath: + $ref: '#/components/schemas/EndpointPath' output: type: object additionalProperties: true @@ -3371,11 +4778,6 @@ components: description: > Extension member. Correlation id for this request, echoed in the `X-Request-Id` response header; quote it when reporting problems. - taskId: - type: string - description: > - Extension member. Present on synchronous inference timeouts when the - accepted task can be polled for its eventual result. endpointPath: type: string description: > @@ -3407,4 +4809,154 @@ components: description: > JSON Pointer (RFC 6901) to the offending field in the request body, e.g. `/configuration/maxWorkers`. Absent for non-body parameters. - example: /configuration/maxWorkers \ No newline at end of file + example: /configuration/maxWorkers + configPointer: + type: string + description: > + JSON Pointer (RFC 6901) to the offending field inside a document the + request carried, rather than in the request body itself: a container + source's `container.yaml`. On such a rejection `pointer` names where + the archive sat in the request body and this member names the field + inside the document. A rejection about the archive rather than the + document carries no `configPointer`, because nothing was parsed. + example: /endpoints/0/path + QueryCatalogue: + type: object + required: [metrics, logs] + properties: + metrics: + type: array + items: + $ref: '#/components/schemas/CatalogueEntry' + logs: + type: array + items: + $ref: '#/components/schemas/CatalogueEntry' + CatalogueEntry: + type: object + required: [id, unit, aggregation, windows, selectors, series] + properties: + id: + type: string + description: The value to pass as `queryId`. + unit: + type: string + description: The unit of every value in this query's series, e.g. `req/min`. + aggregation: + type: string + description: > + How each bucket was reduced, e.g. `avg` or `p50`. Carried so a tooltip can say + what a point means rather than presenting a bucket reduction as an instant + reading. + windows: + type: array + description: > + The windows this query can answer. A window absent here has no stored series + behind it, so a client should not offer it. + items: + type: string + selectors: + type: array + description: The narrowings this query accepts. Anything else is rejected. + items: + type: string + series: + type: array + description: > + The stable series ids this query returns. Empty when those ids are not known + until the request (`apps_request_volume` keys each line on an app id). + items: + type: string + MetricSeries: + type: object + required: [query, unit, step_s, aggregation, window, t, series] + properties: + query: + type: string + unit: + type: string + step_s: + type: integer + format: int64 + description: Seconds between adjacent timestamps in `t`. + aggregation: + type: string + window: + $ref: '#/components/schemas/MetricWindowRange' + t: + type: array + description: > + The timestamp axis, shared by every series. Each value is the END of its + bucket, in unix seconds: a point at `t[i]` is the aggregate over + `(t[i] - step_s, t[i]]`, which is what the underlying range functions compute. + items: + type: integer + format: int64 + series: + type: array + items: + $ref: '#/components/schemas/MetricSeriesEntry' + MetricWindowRange: + type: object + required: [from, to] + properties: + from: + type: integer + format: int64 + description: > + EXCLUSIVE: one `step_s` before the first timestamp in `t`. Nothing is sampled + at `from` itself. + to: + type: integer + format: int64 + description: INCLUSIVE, and equal to the last timestamp in `t`. + description: The range covered, as `(from, to]`. + MetricSeriesEntry: + type: object + required: [id, label, v] + properties: + id: + type: string + description: > + Stable identifier for this line. For chart queries it does not change, so a + client can map it to a colour or legend position. For `apps_request_volume` + it is the app id of that line. + label: + type: string + description: Display text. May change without notice; do not switch on it. + v: + type: array + description: > + Values, positionally aligned to `t` and always the same length. `null` is a + genuine absence of data, never a zero, and is sent explicitly rather than + omitted so a gap draws as a gap instead of a line across an outage. + items: + type: number + format: double + nullable: true + LogEntryPage: + type: object + required: [entries] + properties: + entries: + type: array + items: + $ref: '#/components/schemas/LogEntry' + nextCursor: + type: string + description: Opaque; absent on the last page. + LogEntry: + type: object + required: [time, body] + properties: + time: + type: integer + format: int64 + level: + type: string + body: + type: string + fields: + type: object + additionalProperties: + type: string diff --git a/internal/api/serverless/client.go b/internal/api/serverless/client.go index 23eda55..cace384 100644 --- a/internal/api/serverless/client.go +++ b/internal/api/serverless/client.go @@ -499,7 +499,7 @@ func (c *Client) ListVersions(ctx context.Context, appID string, params *ListVer if resp.JSON200 == nil { return pageOf[Version](nil, nil), nil } - return pageOf(resp.JSON200.Data, resp.JSON200.NextCursor), nil + return pageOf(&resp.JSON200.Data, resp.JSON200.NextCursor), nil case http.StatusUnauthorized: return Page[Version]{}, problemToError(resp.ApplicationproblemJSON401, http.StatusUnauthorized) case http.StatusForbidden: @@ -559,7 +559,7 @@ func (c *Client) ListBuilds(ctx context.Context, appID string, params *ListBuild if resp.JSON200 == nil { return pageOf[Build](nil, nil), nil } - return pageOf(resp.JSON200.Data, resp.JSON200.NextCursor), nil + return pageOf(&resp.JSON200.Data, resp.JSON200.NextCursor), nil case http.StatusUnauthorized: return Page[Build]{}, problemToError(resp.ApplicationproblemJSON401, http.StatusUnauthorized) case http.StatusForbidden: diff --git a/internal/api/serverless/client_test.go b/internal/api/serverless/client_test.go index 47aad8e..536d9d8 100644 --- a/internal/api/serverless/client_test.go +++ b/internal/api/serverless/client_test.go @@ -165,8 +165,7 @@ func TestCreateApp(t *testing.T) { source, err := NewCodeAppSource(CodeSourceUpsert{ BaseImage: "python:3.11-slim", Codebase: CodebaseSource{ - ModelFile: "app.py", - ZipBase64: "Zm9v", + UploadId: uuid.MustParse("019c7654-8b21-7abc-9123-abcdef123456"), }, }) if err != nil { @@ -452,7 +451,7 @@ func TestUpdateApp(t *testing.T) { if body.Configuration == nil || body.Configuration.MaxWorkers == nil || *body.Configuration.MaxWorkers != maxWorkers { t.Errorf("unexpected body: %s", raw) } - if body.AppName != nil || body.AppSource != nil || body.Secrets != nil || body.EnvironmentVariables != nil || body.Endpoints != nil { + if body.AppName != nil || body.AppSource != nil || body.Secrets != nil || body.EnvironmentVariables != nil { t.Errorf("patch included out-of-scope fields: %s", raw) } var rawMap map[string]json.RawMessage diff --git a/internal/api/serverless/gen/client.gen.go b/internal/api/serverless/gen/client.gen.go index 44fca2e..d755b80 100644 --- a/internal/api/serverless/gen/client.gen.go +++ b/internal/api/serverless/gen/client.gen.go @@ -7,6 +7,7 @@ import ( "bytes" "context" "encoding/json" + "errors" "fmt" "io" "net/http" @@ -66,14 +67,14 @@ func (e AppSort) Valid() bool { } } -// Defines values for AppSourceUpsertType. +// Defines values for AppSourceType. const ( - Code AppSourceUpsertType = "code" - Container AppSourceUpsertType = "container" + Code AppSourceType = "code" + Container AppSourceType = "container" ) -// Valid indicates whether the value is a known member of the AppSourceUpsertType enum. -func (e AppSourceUpsertType) Valid() bool { +// Valid indicates whether the value is a known member of the AppSourceType enum. +func (e AppSourceType) Valid() bool { switch e { case Code: return true @@ -117,6 +118,27 @@ func (e AppStatus) Valid() bool { } } +// Defines values for BuildPhaseOutcome. +const ( + BuildPhaseOutcomeFailed BuildPhaseOutcome = "failed" + BuildPhaseOutcomeRunning BuildPhaseOutcome = "running" + BuildPhaseOutcomeSucceeded BuildPhaseOutcome = "succeeded" +) + +// Valid indicates whether the value is a known member of the BuildPhaseOutcome enum. +func (e BuildPhaseOutcome) Valid() bool { + switch e { + case BuildPhaseOutcomeFailed: + return true + case BuildPhaseOutcomeRunning: + return true + case BuildPhaseOutcomeSucceeded: + return true + default: + return false + } +} + // Defines values for BuildStatus. const ( BuildStatusBuilding BuildStatus = "building" @@ -195,6 +217,45 @@ func (e GpuAvailability) Valid() bool { } } +// Defines values for OrgTenancyState. +const ( + OrgTenancyStateActive OrgTenancyState = "active" + OrgTenancyStateDisabled OrgTenancyState = "disabled" + OrgTenancyStatePending OrgTenancyState = "pending" +) + +// Valid indicates whether the value is a known member of the OrgTenancyState enum. +func (e OrgTenancyState) Valid() bool { + switch e { + case OrgTenancyStateActive: + return true + case OrgTenancyStateDisabled: + return true + case OrgTenancyStatePending: + return true + default: + return false + } +} + +// Defines values for OrgTenancyDesiredState. +const ( + OrgTenancyDesiredStateActive OrgTenancyDesiredState = "active" + OrgTenancyDesiredStateDisabled OrgTenancyDesiredState = "disabled" +) + +// Valid indicates whether the value is a known member of the OrgTenancyDesiredState enum. +func (e OrgTenancyDesiredState) Valid() bool { + switch e { + case OrgTenancyDesiredStateActive: + return true + case OrgTenancyDesiredStateDisabled: + return true + default: + return false + } +} + // Defines values for SecretType. const ( Generic SecretType = "generic" @@ -210,6 +271,66 @@ func (e SecretType) Valid() bool { } } +// Defines values for SourceUploadSinglePutTransferMethod. +const ( + SourceUploadTransferMethodPut SourceUploadSinglePutTransferMethod = "PUT" +) + +// Valid indicates whether the value is a known member of the SourceUploadSinglePutTransferMethod enum. +func (e SourceUploadSinglePutTransferMethod) Valid() bool { + switch e { + case SourceUploadTransferMethodPut: + return true + default: + return false + } +} + +// Defines values for SourceUploadSinglePutTransferMode. +const ( + SourceUploadTransferModeSinglePut SourceUploadSinglePutTransferMode = "singlePut" +) + +// Valid indicates whether the value is a known member of the SourceUploadSinglePutTransferMode enum. +func (e SourceUploadSinglePutTransferMode) Valid() bool { + switch e { + case SourceUploadTransferModeSinglePut: + return true + default: + return false + } +} + +// Defines values for SourceUploadState. +const ( + SourceUploadStateConsumed SourceUploadState = "consumed" + SourceUploadStateDeleted SourceUploadState = "deleted" + SourceUploadStateExpired SourceUploadState = "expired" + SourceUploadStatePending SourceUploadState = "pending" + SourceUploadStateReady SourceUploadState = "ready" + SourceUploadStateRejected SourceUploadState = "rejected" +) + +// Valid indicates whether the value is a known member of the SourceUploadState enum. +func (e SourceUploadState) Valid() bool { + switch e { + case SourceUploadStateConsumed: + return true + case SourceUploadStateDeleted: + return true + case SourceUploadStateExpired: + return true + case SourceUploadStatePending: + return true + case SourceUploadStateReady: + return true + case SourceUploadStateRejected: + return true + default: + return false + } +} + // Defines values for TaskStatus. const ( TaskStatusCompleted TaskStatus = "completed" @@ -231,6 +352,42 @@ func (e TaskStatus) Valid() bool { } } +// Defines values for TriggeredByKind. +const ( + ApiKey TriggeredByKind = "apiKey" + User TriggeredByKind = "user" +) + +// Valid indicates whether the value is a known member of the TriggeredByKind enum. +func (e TriggeredByKind) Valid() bool { + switch e { + case ApiKey: + return true + case User: + return true + default: + return false + } +} + +// Defines values for WorkerStateFilter. +const ( + WorkerStateFilterAll WorkerStateFilter = "all" + WorkerStateFilterLive WorkerStateFilter = "live" +) + +// Valid indicates whether the value is a known member of the WorkerStateFilter enum. +func (e WorkerStateFilter) Valid() bool { + switch e { + case WorkerStateFilterAll: + return true + case WorkerStateFilterLive: + return true + default: + return false + } +} + // Defines values for WorkerStatus. const ( WorkerStatusBusy WorkerStatus = "busy" @@ -270,12 +427,135 @@ func (e WorkerStatus) Valid() bool { } } +// Defines values for MetricWindow. +const ( + MetricWindowN1h MetricWindow = "1h" + MetricWindowN24h MetricWindow = "24h" + MetricWindowN30d MetricWindow = "30d" + MetricWindowN6h MetricWindow = "6h" + MetricWindowN7d MetricWindow = "7d" +) + +// Valid indicates whether the value is a known member of the MetricWindow enum. +func (e MetricWindow) Valid() bool { + switch e { + case MetricWindowN1h: + return true + case MetricWindowN24h: + return true + case MetricWindowN30d: + return true + case MetricWindowN6h: + return true + case MetricWindowN7d: + return true + default: + return false + } +} + +// Defines values for SelectorStatusClass. +const ( + SelectorStatusClassN2xx SelectorStatusClass = "2xx" + SelectorStatusClassN4xx SelectorStatusClass = "4xx" + SelectorStatusClassN5xx SelectorStatusClass = "5xx" +) + +// Valid indicates whether the value is a known member of the SelectorStatusClass enum. +func (e SelectorStatusClass) Valid() bool { + switch e { + case SelectorStatusClassN2xx: + return true + case SelectorStatusClassN4xx: + return true + case SelectorStatusClassN5xx: + return true + default: + return false + } +} + +// Defines values for GetLogEntriesParamsWindow. +const ( + GetLogEntriesParamsWindowN1h GetLogEntriesParamsWindow = "1h" + GetLogEntriesParamsWindowN24h GetLogEntriesParamsWindow = "24h" + GetLogEntriesParamsWindowN30d GetLogEntriesParamsWindow = "30d" + GetLogEntriesParamsWindowN6h GetLogEntriesParamsWindow = "6h" + GetLogEntriesParamsWindowN7d GetLogEntriesParamsWindow = "7d" +) + +// Valid indicates whether the value is a known member of the GetLogEntriesParamsWindow enum. +func (e GetLogEntriesParamsWindow) Valid() bool { + switch e { + case GetLogEntriesParamsWindowN1h: + return true + case GetLogEntriesParamsWindowN24h: + return true + case GetLogEntriesParamsWindowN30d: + return true + case GetLogEntriesParamsWindowN6h: + return true + case GetLogEntriesParamsWindowN7d: + return true + default: + return false + } +} + +// Defines values for GetMetricSeriesParamsWindow. +const ( + GetMetricSeriesParamsWindowN1h GetMetricSeriesParamsWindow = "1h" + GetMetricSeriesParamsWindowN24h GetMetricSeriesParamsWindow = "24h" + GetMetricSeriesParamsWindowN30d GetMetricSeriesParamsWindow = "30d" + GetMetricSeriesParamsWindowN6h GetMetricSeriesParamsWindow = "6h" + GetMetricSeriesParamsWindowN7d GetMetricSeriesParamsWindow = "7d" +) + +// Valid indicates whether the value is a known member of the GetMetricSeriesParamsWindow enum. +func (e GetMetricSeriesParamsWindow) Valid() bool { + switch e { + case GetMetricSeriesParamsWindowN1h: + return true + case GetMetricSeriesParamsWindowN24h: + return true + case GetMetricSeriesParamsWindowN30d: + return true + case GetMetricSeriesParamsWindowN6h: + return true + case GetMetricSeriesParamsWindowN7d: + return true + default: + return false + } +} + +// Defines values for GetMetricSeriesParamsStatusClass. +const ( + GetMetricSeriesParamsStatusClassN2xx GetMetricSeriesParamsStatusClass = "2xx" + GetMetricSeriesParamsStatusClassN4xx GetMetricSeriesParamsStatusClass = "4xx" + GetMetricSeriesParamsStatusClassN5xx GetMetricSeriesParamsStatusClass = "5xx" +) + +// Valid indicates whether the value is a known member of the GetMetricSeriesParamsStatusClass enum. +func (e GetMetricSeriesParamsStatusClass) Valid() bool { + switch e { + case GetMetricSeriesParamsStatusClassN2xx: + return true + case GetMetricSeriesParamsStatusClassN4xx: + return true + case GetMetricSeriesParamsStatusClassN5xx: + return true + default: + return false + } +} + // App defines model for App. type App struct { // ActiveVersionId Current deployed version; null until the first version is successfully deployed. ActiveVersionId *openapi_types.UUID `json:"activeVersionId,omitempty"` - // AppId Immutable app identifier, unique within the authenticated organisation. + // AppId Immutable app identifier. Unique among the authenticated organisation's live apps: it cannot be changed after creation, and it becomes available again once the app it named reaches `deleted`. AppId AppId `json:"appId"` // AppName Mutable display name. Must contain at least one non-whitespace character: it is what the console renders and what `sort=name` orders on, and it is not required to be unique. Unlike `appId` the pattern is unanchored, so interior spaces are allowed — only an entirely blank name is rejected. @@ -288,9 +568,12 @@ type App struct { // EnvironmentVariables Plain-text environment variables for this app. Populated on single-app responses (get, update, stop, resume, delete, deploy, favourite). List of apps returns an empty array to avoid an N+1 per page row — use the `/environment-variables` endpoints to page the set. EnvironmentVariables []EnvironmentVariable `json:"environmentVariables"` - // IsFavourite Whether the authenticated organisation has favourited this app. Drives the console Favourites section; toggled via `PUT`/`DELETE` `/v1/apps/{appId}/favourite`. + // IsFavourite Whether the authenticated organisation has favourited this app. Favourited apps sort ahead of non-favourited apps; toggled via `PUT`/`DELETE` `/v1/apps/{appId}/favourite`. IsFavourite bool `json:"isFavourite"` + // Runtime Observed state for one app at `calculatedAt`. Desired worker scale remains in `configuration`. Worker and GPU counts are always present; traffic and duration fields are omitted when their backing data is unavailable. + Runtime AppRuntime `json:"runtime"` + // Secrets Secrets attached to this app, including any env-var name override. Populated on single-app responses; list of apps returns an empty array to avoid an N+1 — use `/apps/{appId}/secrets` to page the set. Secrets []SecretAttachment `json:"secrets"` Status AppStatus `json:"status"` @@ -299,7 +582,7 @@ type App struct { // AppCreate defines model for AppCreate. type AppCreate struct { - // AppId Immutable app identifier, unique within the authenticated organisation. + // AppId Immutable app identifier. Unique among the authenticated organisation's live apps: it cannot be changed after creation, and it becomes available again once the app it named reaches `deleted`. AppId AppId `json:"appId"` // AppName Mutable display name. Must contain at least one non-whitespace character: it is what the console renders and what `sort=name` orders on, and it is not required to be unique. Unlike `appId` the pattern is unanchored, so interior spaces are allowed — only an entirely blank name is rejected. @@ -309,21 +592,19 @@ type AppCreate struct { // - `code`: the codebase is submitted to the build pipeline; a new image is built and // deployed once ready. // - // - `container`: no build step — the version names the image reference supplied here. - // No worker runs from a container source yet, so the app stays `initializing`. + // - `container`: the submitted zip is built into a wrapper image by the same + // pipeline and deployed once ready; the version records the built image, not a + // customer-supplied reference. // - // Either way the version is recorded with the app. A code-source app transitions to `active` once its first version is ready, or to `failed` if the build, validation, or rollout fails. + // Either way the version is recorded with the app, and the app transitions to `active` once its first version is ready, or to `failed` if the build, validation, or rollout fails. AppSource AppSourceUpsert `json:"appSource"` Configuration WorkerConfigCreate `json:"configuration"` - // Endpoints Invocable routes to expose on the app. Paths are unique within an app: repeating one in this array is rejected rather than collapsed, since there would be no answer to which entry a request meant. - Endpoints *[]EndpointCreate `json:"endpoints,omitempty"` - // EnvironmentVariables Map with environment variables. Keys are the environment variable names, values are the environment variable values. Use the dedicated `/environment-variables` endpoints to change them after the app exists. // Each key must satisfy `EnvironmentVariableName` — POSIX-style, at most 128 characters. OpenAPI 3.0 cannot constrain map keys, so a bad one is rejected by the server rather than by the schema. Keys must also not collide with a secret's injected env var name on the same app (see `attachAppSecret`). EnvironmentVariables *map[string]string `json:"environmentVariables,omitempty"` - // Secrets Existing organisation secrets to attach to this app, with an optional env-var name override per entry. Not persisted yet — supplying this field returns `422`, rather than accepting a set nothing attaches to the workload. Shape matches `POST /apps/{appId}/secrets` so create and attach share one contract. When wired, each injected name must not collide with a key in `environmentVariables` (or an existing `deployment_configs` row) — see `SecretAttach`. + // Secrets Existing organisation secrets to attach to this app, with an optional env-var name override per entry. This is the app's initial attachment set, so the first rollout carries the values into the worker. The secret must already exist and be `active`; this route does not create one, and an unknown or inactive name returns `404`. Shape matches `POST /apps/{appId}/secrets` so create and attach share one contract. Each injected name must not collide with a key in `environmentVariables` — see `SecretAttach`. Secrets *[]SecretAttach `json:"secrets,omitempty"` // Volumes Persistent node-local directories bind-mounted through the checkpointer into the sandboxed application. Use these for downloaded weights and caches that must stay outside the checkpointed root filesystem. Paths must be unique and non-overlapping. The set is frozen into each immutable app version. @@ -332,7 +613,7 @@ type AppCreate struct { // AppEvent defines model for AppEvent. type AppEvent struct { - // AppId Immutable app identifier, unique within the authenticated organisation. + // AppId Immutable app identifier. Unique among the authenticated organisation's live apps: it cannot be changed after creation, and it becomes available again once the app it named reaches `deleted`. AppId AppId `json:"appId"` CreatedAt *time.Time `json:"createdAt,omitempty"` EndpointId *openapi_types.UUID `json:"endpointId,omitempty"` @@ -347,13 +628,34 @@ type AppEvent struct { // AppEventType defines model for AppEventType. type AppEventType string -// AppId Immutable app identifier, unique within the authenticated organisation. +// AppId Immutable app identifier. Unique among the authenticated organisation's live apps: it cannot be changed after creation, and it becomes available again once the app it named reaches `deleted`. type AppId = string // AppName Mutable display name. Must contain at least one non-whitespace character: it is what the console renders and what `sort=name` orders on, and it is not required to be unique. Unlike `appId` the pattern is unanchored, so interior spaces are allowed — only an entirely blank name is rejected. type AppName = string -// AppSort Ordering for `listApps`. Every ordering is total (ties broken by `appId`), so a page is reproducible and its cursor stable. +// AppRuntime Observed state for one app at `calculatedAt`. Desired worker scale remains in `configuration`. Worker and GPU counts are always present; traffic and duration fields are omitted when their backing data is unavailable. +type AppRuntime struct { + // ActiveWorkers Non-terminal workers (`status` other than `stopped`) on this app. Pending workers count because they still hold capacity. + ActiveWorkers int64 `json:"activeWorkers"` + + // AverageRequestDuration24h Mean inference request duration in seconds over the last 24 hours (all requests; the duration histogram has no status class). Omitted when metrics cannot be read, when the app had no requests, or when the duration series has no samples for the app in the window. + AverageRequestDuration24h *float64 `json:"averageRequestDuration24h,omitempty"` + + // CalculatedAt When this runtime snapshot was read from the database. + CalculatedAt time.Time `json:"calculatedAt"` + + // ErrorRate24h Error ratio (4xx + 5xx over requests) for this app in the last 24 hours, in 0–1. Omitted when metrics cannot be read or when the app had no requests in the window. + ErrorRate24h *float64 `json:"errorRate24h,omitempty"` + + // ProvisionedGpuCount Sum of `gpuCount` across those workers. A pending worker contributes zero until Kubernetes schedules it onto a node. + ProvisionedGpuCount int64 `json:"provisionedGpuCount"` + + // Requests24h Requests served by this app in the last 24 hours. Omitted until available. + Requests24h *int64 `json:"requests24h,omitempty"` +} + +// AppSort Ordering for `listApps`. Favourited apps appear before non-favourited apps, and the selected ordering applies within each group. Every ordering is total (ties broken by `appId`), so a page is reproducible and its cursor stable. // // - `createdAt`: newest first. The default. // - `name`: `appName` A–Z, case-insensitive. @@ -363,12 +665,15 @@ type AppName = string // `activity` and `errorRate` rank on per-app traffic metrics, which are not collected yet; requesting either returns `422` until they are. type AppSort string +// AppSourceType defines model for AppSourceType. +type AppSourceType string + // AppSourceUpsert defines model for AppSourceUpsert. type AppSourceUpsert struct { Source AppSourceUpsert_Source `json:"source"` - // Type Selects the version creation path. `code` submits customer source code to the Image Build Service; `container` references a pre-built OCI image. - Type AppSourceUpsertType `json:"type"` + // Type Selects the version creation path. `code` submits customer source code to the Image Build Service; `container` submits a wrapper `Dockerfile` and `container.yaml` for Runware to build into a hosted image. + Type AppSourceType `json:"type"` } // AppSourceUpsert_Source defines model for AppSourceUpsert.Source. @@ -376,13 +681,10 @@ type AppSourceUpsert_Source struct { union json.RawMessage } -// AppSourceUpsertType Selects the version creation path. `code` submits customer source code to the Image Build Service; `container` references a pre-built OCI image. -type AppSourceUpsertType string - // AppStatus defines model for AppStatus. type AppStatus string -// AppSummary Aggregate dashboard metrics for every app in the authenticated organisation. App and worker tallies are always present (zero when empty). Traffic and spend metrics whose backing system is not yet available are omitted (rendered as "no data" by the frontend) rather than reported as zero. +// AppSummary Aggregate dashboard metrics for every app in the authenticated organisation. App and worker tallies are always present (zero when empty). Request and error-rate totals are omitted when the metrics store cannot be read, rather than reported as zero. Spend is omitted until billing rollups exist. type AppSummary struct { // ActiveApps Apps currently in the `active` status. ActiveApps int64 `json:"activeApps"` @@ -393,13 +695,13 @@ type AppSummary struct { // CalculatedAt When these metrics were computed. CalculatedAt time.Time `json:"calculatedAt"` - // ErrorRate24h Error ratio (0–1) over the last 24h. Omitted until request metrics are available. + // ErrorRate24h Error ratio (4xx + 5xx over requests) for the last 24 hours, in 0–1. Omitted when metrics cannot be read or when `requests24h` is zero. ErrorRate24h *float64 `json:"errorRate24h,omitempty"` // ProvisionedGpuCount Sum of `gpuCount` across those same non-terminal workers. ProvisionedGpuCount int64 `json:"provisionedGpuCount"` - // Requests24h Requests served in the last 24h. Omitted until request metrics are available. + // Requests24h Requests served in the last 24 hours across every app. Omitted when metrics cannot be read. Zero when the organisation had no traffic. Requests24h *int64 `json:"requests24h,omitempty"` // SpendToday Estimated spend since 00:00 UTC. Omitted until billing rollups are available. @@ -410,25 +712,23 @@ type AppSummary struct { } // AppUpdate Updates one or more aspects of an app in place. All fields are optional; omitted fields are left unchanged. Lifecycle transitions (stop/resume/delete/deploy) use their dedicated operations. -// A successful update records a new version carrying the updated configuration and the same image, so what to deploy is always a version rather than the current state of a mutable row. `activeVersionId` does not move: the running workload is unchanged until that version is deployed. -// **Currently applied:** `appName` and `configuration`. Supplying `appSource`, `secrets`, `environmentVariables`, or `endpoints` returns `422` (bulk env-var replace is not wired — use the dedicated `/environment-variables` endpoints for individual keys). When wired, configuration/secret/endpoint changes take effect on the next Scaler cycle; `appSource` triggers a new build and rollout. +// A successful configuration or `environmentVariables` update records a new version carrying the updated values and the same image. If that image is deployable, the update pins it as `activeVersionId` and rolls the workload when the app can take one (`active`, `initializing`, or `failed` which becomes `initializing`). If the image is not deployable, the version is recorded and `activeVersionId` is left unchanged. A name-only update records a version and does not pin. If the roll of a live app fails, `activeVersionId` is restored so the field keeps naming the running configuration. +// `appSource` starts a build and records version N+1 with a new image. The deploy queue rolls that version once the build is ready; `activeVersionId` moves only then. A builder rejection leaves the app on its current version. After accept, a late overlay race leaves the new version recorded and the previous attachments in place. +// `secrets` replaces the attachment set and does not roll the workload. Endpoints are not a field of this contract at all: the set belongs to the app source, so it changes only when a new version with a new source builds and deploys, and an unknown `endpoints` field is rejected like any other. type AppUpdate struct { // AppName Mutable display name; does not affect app identity or routing. Omit to leave unchanged — an explicit blank value is rejected, not treated as a clear. AppName *AppName `json:"appName,omitempty"` - // AppSource Write-only. New source to build and deploy; not returned in the App response. Use the `/builds` endpoints to inspect build status. Triggers a build (for `code` sources) or image validation (for `container` sources); on success the resulting version is deployed automatically. On failure the app remains on the previous version. Not persisted yet — supplying this field returns `422`. + // AppSource Write-only. New source to build and deploy; not returned in the App response. Use the `/builds` endpoints to inspect build status. Triggers a build (for `code` sources) or validates `container.yaml` then builds (for `container` sources). On accept the resulting version is recorded with a new image tag and rolled through the deploy queue. A builder rejection leaves the app on the previous version and writes no version or build row. After accept, a concurrent secret deactivation or env/secret collision leaves version N+1 recorded and the previous attachment set in place. `activeVersionId` moves only when that rollout completes. Not valid on a `stopped` or `stopping` app — there is nothing to roll the new version onto, and `resume` rolls the pinned one — so supplying it in those statuses returns `409 Conflict`. AppSource *AppSourceUpsert `json:"appSource,omitempty"` - // Configuration Partial worker configuration. Any field present overwrites the live value; omitted fields are left unchanged. Clearing a nullable live field (setting it to null) is not supported — omit the field to leave it unchanged. `computeType` is create-time only and cannot be patched. Changing `gpuType` or `gpusPerWorker` affects only newly created workers. + // Configuration Partial worker configuration. Any field present overwrites the live value; omitted fields are left unchanged. Clearing a nullable live field (setting it to null) is not supported — omit the field to leave it unchanged. `fallbackGpuType` is the exception: send an empty string to clear it. `computeType` is create-time only and cannot be patched. Changing `gpuType` affects only newly created workers. Configuration *WorkerConfigPatch `json:"configuration,omitempty"` - // Endpoints Replaces the app's endpoints. Not persisted yet — supplying this field returns `422`. - Endpoints *[]EndpointCreate `json:"endpoints,omitempty"` - - // EnvironmentVariables Map with environment variables. Keys are the environment variable names, values are the environment variable values. Setting the value of an environment variable to null deletes the environment variable from the app. Not persisted yet — supplying this field returns `422`. + // EnvironmentVariables Replaces the app's environment variables. Keys are the variable names, values are the values. A key absent from the map is deleted. A null value omits that key from the new set. The resolved map is snapshotted onto the version this update records, so a deploy applies it. When the copied image is deployable the update pins and rolls, the same as a configuration change. EnvironmentVariables *map[string]*string `json:"environmentVariables,omitempty"` - // Secrets Replaces the app's secret attachments. Same `SecretAttach` shape as create and `POST /apps/{appId}/secrets`. Not persisted yet — supplying this field returns `422`. When wired, injected names must not collide with plain environment variables on the app. + // Secrets Replaces the app's secret attachments. Same `SecretAttach` shape as create and `POST /apps/{appId}/secrets`. An attachment absent from the array is detached. Injected names must not collide with a plain environment variable on the app. Control-plane record only — secret values do not reach a pod, and the version snapshot carries no secrets — so this field does not roll the workload. An app holds at most 100 environment bindings in total; this array cannot exceed that ceiling on its own. Secrets *[]SecretAttach `json:"secrets,omitempty"` } @@ -438,25 +738,123 @@ type AppVolume struct { MountPath string `json:"mountPath"` } -// Build Details of a code build or container validation. +// Build Details of a build. Both source types build, and `kind` says which pipeline ran: a `code` submission or a customer's own wrapper Dockerfile. Phase lists differ by kind, so never assume a fixed one. `listBuilds` and `getBuild` return this same shape. +// +// Nullability: +// +// - `error` is null while the build is running (`queued`, `building`), on success +// (`ready`), and on `superseded` (a newer version took over — the `status` conveys +// that, and it is not a failure); it is present only on `failed`. +// +// - `completedAt` and `durationMs` are null while the build is running and set once it +// reaches a terminal status (`ready`/`failed`/`superseded`). They are also null for +// terminal builds that finished before completion timestamps were tracked. +// +// - `exitCode` is null while running. On a terminal build it carries the build Job's +// exit code when the builder still had it to report; it can remain null on a terminal +// build whose Job aged out before the code was read. +// +// - `versionId` / `versionNumber` name the version this build produced. A code build's +// version is created together with the build, so these are populated from the moment +// the build exists, in every status; they are null only when no version references the +// build. When later config updates carry the build forward onto new versions, this is +// the earliest — the one the build actually produced. +// +// - `triggeredBy` names the user or API key that submitted the build; it is null only +// for builds created before the actor was recorded. type Build struct { - CreatedAt *time.Time `json:"createdAt,omitempty"` + // AppId Immutable app identifier. Unique among the authenticated organisation's live apps: it cannot be changed after creation, and it becomes available again once the app it named reaches `deleted`. + AppId *AppId `json:"appId,omitempty"` + + // CompletedAt When the build reached a terminal status (`ready`/`failed`/`superseded`); null while running or for terminal builds recorded before this was tracked. + CompletedAt *time.Time `json:"completedAt,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + + // DurationMs Wall-clock milliseconds from `createdAt` to `completedAt`; null while the build is still running or when no completion time was recorded. + DurationMs *int64 `json:"durationMs,omitempty"` // Error Error message or failure reason; null when the build is still running or succeeded. - Error *string `json:"error,omitempty"` + Error *string `json:"error,omitempty"` + + // ExitCode Exit code of the build container: 0 on success, its non-zero code on a build failure. Null while running, on a terminal build whose exit code the builder could no longer report, and when the build container never ran (e.g. an init container such as dockerfile generation failed first). ExitCode *int32 `json:"exitCode,omitempty"` Id openapi_types.UUID `json:"id"` // LogTail Trailing build log output. LogTail *string `json:"logTail,omitempty"` + // Phases Observed build phases with their timings, recorded once the build is terminal; empty until then. Phase lists differ by `source.type`; never assume a fixed list. + Phases []BuildPhase `json:"phases"` + + // Source Where a build's source came from: `code` for a customer code submission, `container` for a customer wrapper Dockerfile. `repository` and `revision` are not yet recorded (both sources are zip uploads) and will be added when the platform stores that provenance. + Source BuildSource `json:"source"` + // Status Build/validation lifecycle status. Status BuildStatus `json:"status"` + + // TriggeredBy Who performed an action — the authenticated user (JWT) or the API key. `kind` says which, so `id` (that actor's UUID) is resolvable to the right thing; `displayName` is its name captured at write time, so it renders as it was even if the user or key is later renamed. Used as `Build.triggeredBy` and `Version.author`. + TriggeredBy *TriggeredBy `json:"triggeredBy,omitempty"` + + // VersionId The version this build produced. A code build's version is created together with the build, so this is populated in every status; it is null only when no version references the build. A code update carries an image — and so its build — forward onto a new version, so a build may be named by several versions; this is the earliest, the one the build actually produced. + VersionId *openapi_types.UUID `json:"versionId,omitempty"` + + // VersionNumber Version number of `versionId`; null when `versionId` is null. + VersionNumber *int32 `json:"versionNumber,omitempty"` +} + +// BuildListSummary Collection totals for this app's builds list. Independent of the page: the same values on every cursor, including a seek past the last row. `total` counts builds. `versions` counts versions on the same app — the same predicate as `listVersions` `summary.total`, excluding soft-deleted versions. +type BuildListSummary struct { + // Total Number of builds recorded for this app. + Total int64 `json:"total"` + + // Versions Number of versions recorded for this app. Same value as `listVersions` `summary.total`. A config-only update increments this without incrementing `total`. + Versions int64 `json:"versions"` +} + +// BuildPhase One observed step of a build, in execution order. The phase list is open: which phases a build reports depends on its kind and on how it ran, so clients must not assume a fixed set of names or a fixed count. +type BuildPhase struct { + // CompletedAt Null while the phase is still running. + CompletedAt *time.Time `json:"completedAt,omitempty"` + + // Name Phase identifier, e.g. `prepare`, `build`, `index`. Deliberately not an enum — new build kinds report new phases without a contract change. + Name string `json:"name"` + Outcome BuildPhaseOutcome `json:"outcome"` + StartedAt time.Time `json:"startedAt"` +} + +// BuildPhaseOutcome defines model for BuildPhase.Outcome. +type BuildPhaseOutcome string + +// BuildSource Where a build's source came from: `code` for a customer code submission, `container` for a customer wrapper Dockerfile. `repository` and `revision` are not yet recorded (both sources are zip uploads) and will be added when the platform stores that provenance. +type BuildSource struct { + // Type The kind of source that produced this build — `code` or `container`, straight from the build record. Build phases differ by kind, so clients must not assume a fixed phase list. Not modelled as an enum so adding a kind later does not churn the existing source-type constants this API shares. + Type string `json:"type"` } // BuildStatus Build/validation lifecycle status. type BuildStatus string +// CatalogueEntry defines model for CatalogueEntry. +type CatalogueEntry struct { + // Aggregation How each bucket was reduced, e.g. `avg` or `p50`. Carried so a tooltip can say what a point means rather than presenting a bucket reduction as an instant reading. + Aggregation string `json:"aggregation"` + + // Id The value to pass as `queryId`. + Id string `json:"id"` + + // Selectors The narrowings this query accepts. Anything else is rejected. + Selectors []string `json:"selectors"` + + // Series The stable series ids this query returns. Empty when those ids are not known until the request (`apps_request_volume` keys each line on an app id). + Series []string `json:"series"` + + // Unit The unit of every value in this query's series, e.g. `req/min`. + Unit string `json:"unit"` + + // Windows The windows this query can answer. A window absent here has no stored series behind it, so a client should not offer it. + Windows []string `json:"windows"` +} + // CodeSourceUpsert defines model for CodeSourceUpsert. type CodeSourceUpsert struct { // BaseImage Base image for the builder, e.g. `python:3.11-slim`. @@ -469,11 +867,8 @@ type CodeSourceUpsert struct { // CodebaseSource defines model for CodebaseSource. type CodebaseSource struct { - // ModelFile Path within the zip to the MLflow model entry point (e.g. `model.py`). - ModelFile string `json:"modelFile"` - - // ZipBase64 Base64-encoded zip archive of the customer's code. Note: move to presigned URL upload for production — base64 bloats the request body for large codebases. - ZipBase64 string `json:"zipBase64"` + // UploadId Id of a ready, unexpired source upload created for this app via `POST /v1/apps/{appId}/source-uploads` and completed. The archive it names is the zip of the customer's code, and the upload's own declaration carries the model entry point (`modelFile`), verified against the archive at completion — it is not repeated here. The operation consumes the upload atomically with the version it creates (version 1 on create, the next version on a source update); a consumed upload cannot back a second app or version. + UploadId SourceUploadId `json:"uploadId"` } // ComputeType Worker compute class. GPU is the only supported value. CPU workloads are not supported. @@ -481,12 +876,8 @@ type ComputeType string // ContainerSource defines model for ContainerSource. type ContainerSource struct { - // ImageRef Registry URI of a pre-built image, e.g. `ghcr.io/acme/model:v2`. - ImageRef string `json:"imageRef"` - - // RegistrySecretName Pull-credential name for a private image registry. Omit for a public registry. Parked on the version until image-pull custody has its own ADR — it is not a `secrets` row (ADR-019 covers only env-var secrets unsealed in-pod; the kubelet needs the credential before any container starts). - // When wired, the name becomes a Kubernetes Secret name, so it must be a DNS-1123 subdomain: lower-case alphanumerics, `-` and `.`, starting and ending alphanumeric, at most 253 characters. That is a hard requirement of what the name is used for, not a Runware naming policy. - RegistrySecretName *string `json:"registrySecretName,omitempty"` + // UploadId Id of a ready, unexpired source upload created for this app via `POST /v1/apps/{appId}/source-uploads` and completed. The archive it names carries a wrapper `Dockerfile` and a `container.yaml` config document at its root, plus any build-context files the Dockerfile copies in. Runware builds the image from it — resolving the Dockerfile's public base images to immutable digests — and hosts the result, so no image reference or pull credential is supplied: a private base image is not supported until a build-time credential mechanism exists. An invalid `container.yaml` rejects the create — `400` where the document could not be parsed, `422` where it parsed and broke a rule — with `errors[]` entries carrying `configPointer` into the document; the endpoint set it declares becomes visible once the first build is ready and deployed. The operation consumes the upload atomically with the version it creates (version 1 on create, the next version on a source update); a consumed upload cannot back a second app or version. + UploadId SourceUploadId `json:"uploadId"` } // Currency ISO 4217 alphabetic code. The platform bills in USD only. @@ -500,7 +891,7 @@ type DeployRequest struct { // Endpoint defines model for Endpoint. type Endpoint struct { - // AppId Immutable app identifier, unique within the authenticated organisation. + // AppId Immutable app identifier. Unique among the authenticated organisation's live apps: it cannot be changed after creation, and it becomes available again once the app it named reaches `deleted`. AppId AppId `json:"appId"` CreatedAt *time.Time `json:"createdAt,omitempty"` Id openapi_types.UUID `json:"id"` @@ -510,15 +901,12 @@ type Endpoint struct { UpdatedAt *time.Time `json:"updatedAt,omitempty"` } -// EndpointCreate defines model for EndpointCreate. -type EndpointCreate struct { - // Path The endpoint's identity within the app: a bare lowercase URL segment, e.g. `generate` — a letter first, then letters, digits and hyphens, ending with a letter or digit, max 64 characters. No leading slash: documentation may display `/generate`, but the stored and addressed form is `generate`, so it drops into the invocation URL with no encoding. Unique within the app. All invocations are POST; the HTTP method is not part of endpoint identity. - Path string `json:"path"` -} +// EndpointPath Path of the endpoint to route the task to: a bare lowercase segment such as `generate`, with no leading slash. +type EndpointPath = string // EnvironmentVariable defines model for EnvironmentVariable. type EnvironmentVariable struct { - // AppId Immutable app identifier, unique within the authenticated organisation. + // AppId Immutable app identifier. Unique among the authenticated organisation's live apps: it cannot be changed after creation, and it becomes available again once the app it named reaches `deleted`. AppId *AppId `json:"appId,omitempty"` CreatedAt *time.Time `json:"createdAt,omitempty"` Id *openapi_types.UUID `json:"id,omitempty"` @@ -641,6 +1029,9 @@ type GpuTypeCreatePricing struct { // GpuTypeId Public catalogue code for a supported GPU type (e.g. `h100`, `rtx-pro-6000`). Must match an `id` returned by `GET /v1/gpu-types` (validated at request time against the catalogue). This is not the internal database row UUID. type GpuTypeId = string +// GpuTypeIdOrEmpty A `GpuTypeId`, or the empty string. Optional fallback GPU fields accept `""` because forms bind an unselected dropdown as empty rather than omitting the key. A non-empty value has the same shape as `GpuTypeId` — keep this pattern aligned when the catalogue-code format changes. +type GpuTypeIdOrEmpty = string + // GpuTypeList defines model for GpuTypeList. type GpuTypeList struct { Data []GpuType `json:"data"` @@ -655,6 +1046,66 @@ type GpuTypeUpdate struct { SortOrder *int32 `json:"sortOrder,omitempty"` } +// ListSummary Collection totals for a paged list. Independent of the page: `total` is the COUNT of items in the collection and is the same value on every page, including a cursor that seeks past the last row. +type ListSummary struct { + // Total Number of items in the collection this page was drawn from. + Total int64 `json:"total"` +} + +// LogEntry defines model for LogEntry. +type LogEntry struct { + Body string `json:"body"` + Fields *map[string]string `json:"fields,omitempty"` + Level *string `json:"level,omitempty"` + Time int64 `json:"time"` +} + +// LogEntryPage defines model for LogEntryPage. +type LogEntryPage struct { + Entries []LogEntry `json:"entries"` + + // NextCursor Opaque; absent on the last page. + NextCursor *string `json:"nextCursor,omitempty"` +} + +// MetricSeries defines model for MetricSeries. +type MetricSeries struct { + Aggregation string `json:"aggregation"` + Query string `json:"query"` + Series []MetricSeriesEntry `json:"series"` + + // StepS Seconds between adjacent timestamps in `t`. + StepS int64 `json:"step_s"` + + // T The timestamp axis, shared by every series. Each value is the END of its bucket, in unix seconds: a point at `t[i]` is the aggregate over `(t[i] - step_s, t[i]]`, which is what the underlying range functions compute. + T []int64 `json:"t"` + Unit string `json:"unit"` + + // Window The range covered, as `(from, to]`. + Window MetricWindowRange `json:"window"` +} + +// MetricSeriesEntry defines model for MetricSeriesEntry. +type MetricSeriesEntry struct { + // Id Stable identifier for this line. For chart queries it does not change, so a client can map it to a colour or legend position. For `apps_request_volume` it is the app id of that line. + Id string `json:"id"` + + // Label Display text. May change without notice; do not switch on it. + Label string `json:"label"` + + // V Values, positionally aligned to `t` and always the same length. `null` is a genuine absence of data, never a zero, and is sent explicitly rather than omitted so a gap draws as a gap instead of a line across an outage. + V []*float64 `json:"v"` +} + +// MetricWindowRange The range covered, as `(from, to]`. +type MetricWindowRange struct { + // From EXCLUSIVE: one `step_s` before the first timestamp in `t`. Nothing is sampled at `from` itself. + From int64 `json:"from"` + + // To INCLUSIVE, and equal to the last timestamp in `t`. + To int64 `json:"to"` +} + // MoneyAmount A monetary amount as an exact decimal string in the currency's major unit. Money is never represented as a float (see `GpuPricing.perSecond`). type MoneyAmount struct { // Amount Amount in major units as an exact decimal string. @@ -666,6 +1117,30 @@ type MoneyAmount struct { Currency Currency `json:"currency"` } +// OrgTenancy Receipt that an organisation has been provisioned for serverless (ADR-019). Names are derived from the organisation UUID; this object is the state machine, not a directory. +type OrgTenancy struct { + // KsaName Kubernetes service account in the shared app namespace (`org-`). + KsaName string `json:"ksaName"` + OrganizationUuid openapi_types.UUID `json:"organizationUuid"` + + // State `pending` while Ensure is in flight, `active` when key, KSA and bindings have converged, `disabled` after teardown. Rows are tombstones — disable does not delete. + State OrgTenancyState `json:"state"` +} + +// OrgTenancyState `pending` while Ensure is in flight, `active` when key, KSA and bindings have converged, `disabled` after teardown. Rows are tombstones — disable does not delete. +type OrgTenancyState string + +// OrgTenancyDesiredState Client-writable tenancy state. `active` runs Ensure; `disabled` runs teardown. `pending` is server-only on the receipt and is rejected. +type OrgTenancyDesiredState string + +// OrgTenancyUpsert Desired serverless tenancy for a customer organisation. The UUID is the organisation being provisioned, not the authenticated caller. +type OrgTenancyUpsert struct { + OrganizationUuid openapi_types.UUID `json:"organizationUuid"` + + // State Client-writable tenancy state. `active` runs Ensure; `disabled` runs teardown. `pending` is server-only on the receipt and is rejected. + State OrgTenancyDesiredState `json:"state"` +} + // Page defines model for Page. type Page struct { // NextCursor Cursor for the next page; null when there are no more items. @@ -701,9 +1176,6 @@ type ProblemDetails struct { // Example: 404 Status int32 `json:"status"` - // TaskId Extension member. Present on synchronous inference timeouts when the accepted task can be polled for its eventual result. - TaskId *string `json:"taskId,omitempty"` - // Title Short, human-readable summary of the problem type (the standard HTTP status text). Stable for a given `type`; does not change from occurrence to occurrence. // // @@ -719,6 +1191,12 @@ type ProblemDetails struct { // ProblemError A single field-level validation error within a ProblemDetails. type ProblemError struct { + // ConfigPointer JSON Pointer (RFC 6901) to the offending field inside a document the request carried, rather than in the request body itself: a container source's `container.yaml`. On such a rejection `pointer` names where the archive sat in the request body and this member names the field inside the document. A rejection about the archive rather than the document carries no `configPointer`, because nothing was parsed. + // + // + // Example: /endpoints/0/path + ConfigPointer *string `json:"configPointer,omitempty"` + // Detail Human-readable reason this field was rejected. // // Example: is required @@ -731,6 +1209,12 @@ type ProblemError struct { Pointer *string `json:"pointer,omitempty"` } +// QueryCatalogue defines model for QueryCatalogue. +type QueryCatalogue struct { + Logs []CatalogueEntry `json:"logs"` + Metrics []CatalogueEntry `json:"metrics"` +} + // Secret Secret metadata. The encrypted value is never returned. type Secret struct { CreatedAt *time.Time `json:"createdAt,omitempty"` @@ -748,9 +1232,9 @@ type Secret struct { UpdatedAt *time.Time `json:"updatedAt,omitempty"` } -// SecretAttach Attach an organisation secret to an app (control-plane record only in this release). The resolved name (`envVarName`, or `secretName` when omitted) is stored as one NOT NULL column. It must be unique among this app's secret attaches and must not collide with a plain environment variable key on the same app — both names are reserved for the same future pod env namespace. Reserved platform names are rejected as on `SecretName`. +// SecretAttach Attach an organisation secret to an app. The resolved name (`envVarName`, or `secretName` when omitted) is the environment variable the secret is injected as, and the next rollout carries the value into the worker. It must be unique among this app's secret attaches and must not collide with a plain environment variable key on the same app — both names land in the same pod env namespace. Reserved platform names are rejected as on `SecretName`. type SecretAttach struct { - // EnvVarName Environment variable name to use when the secret is eventually injected. Omit or null to use `secretName`; the server resolves and stores the final name. Same reserved-name rules as `SecretName` (`422` if reserved). The resolved name must also not collide with `deployment_configs.key` on this app (`422`). + // EnvVarName Environment variable name the secret is injected as. Omit or null to use `secretName`; the server resolves and stores the final name. Same reserved-name rules as `SecretName` (`422` if reserved). The resolved name must also not collide with a plain environment variable key on this app (`422`). EnvVarName *EnvironmentVariableName `json:"envVarName,omitempty"` // SecretName Organisation-scoped secret name. The shape matches `EnvironmentVariableName` and the `secrets.name` / `deployment_secrets.env_var_name` column CHECKs — one rule for the contract and the schema — because attached secrets are intended to be injected as environment variables once ADR-019 in-pod unseal lands. @@ -810,17 +1294,92 @@ type SecretUpdate struct { Value string `json:"value"` } -// Task defines model for Task. -type Task struct { - // AppId Immutable app identifier, unique within the authenticated organisation. - AppId AppId `json:"appId"` - CompletedAt *time.Time `json:"completedAt,omitempty"` +// SourceUpload defines model for SourceUpload. +type SourceUpload struct { + // AppId Immutable app identifier. Unique among the authenticated organisation's live apps: it cannot be changed after creation, and it becomes available again once the app it named reaches `deleted`. + AppId AppId `json:"appId"` + CreatedAt time.Time `json:"createdAt"` + DeclaredByteLength int64 `json:"declaredByteLength"` + ExpiresAt time.Time `json:"expiresAt"` + Id SourceUploadId `json:"id"` + + // RejectionReason Reason completion rejected the archive, when state is `rejected`. + RejectionReason *string `json:"rejectionReason,omitempty"` + Sha256 string `json:"sha256"` + SourceType AppSourceType `json:"sourceType"` + State SourceUploadState `json:"state"` + UpdatedAt time.Time `json:"updatedAt"` +} + +// SourceUploadCreate defines model for SourceUploadCreate. +type SourceUploadCreate struct { + // DeclaredByteLength Exact archive size in bytes with a 10 MiB MVP limit. + DeclaredByteLength int64 `json:"declaredByteLength"` + + // IdempotencyKey Client-generated key used to make session creation safe to retry. + IdempotencyKey string `json:"idempotencyKey"` + + // ModelFile Path of the MLflow model entry point inside the archive, relative to its root (e.g. `model.py`). Required for a `code` upload and refused for a `container` one, whose required files the contract names rather than the client. + // + // It is declared here rather than at app creation because upload completion is the last thing that opens the archive: `POST /v1/apps` consumes a ready upload and never reads the object, so an entry point named there could only be proved against the archive by reading it a second time. The pattern refuses a leading separator; a path that escapes the archive root is refused by completion. + ModelFile *string `json:"modelFile,omitempty"` + + // Sha256 Lowercase SHA-256 digest of the complete archive. + Sha256 string `json:"sha256"` + SourceType AppSourceType `json:"sourceType"` +} + +// SourceUploadCreation defines model for SourceUploadCreation. +type SourceUploadCreation struct { + Transfer SourceUploadTransfer `json:"transfer"` + Upload SourceUpload `json:"upload"` +} + +// SourceUploadId defines model for SourceUploadId. +type SourceUploadId = openapi_types.UUID + +// SourceUploadSinglePutTransfer defines model for SourceUploadSinglePutTransfer. +type SourceUploadSinglePutTransfer struct { + // ExpiresAt Time after which the transfer instruction is no longer valid. + ExpiresAt time.Time `json:"expiresAt"` + + // Headers Headers the client must include in the upload request. + Headers map[string]string `json:"headers"` + Method SourceUploadSinglePutTransferMethod `json:"method"` + Mode SourceUploadSinglePutTransferMode `json:"mode"` + + // Url Short-lived URL for this upload's exact staging object. + Url string `json:"url"` +} + +// SourceUploadSinglePutTransferMethod defines model for SourceUploadSinglePutTransfer.Method. +type SourceUploadSinglePutTransferMethod string + +// SourceUploadSinglePutTransferMode defines model for SourceUploadSinglePutTransfer.Mode. +type SourceUploadSinglePutTransferMode string + +// SourceUploadState defines model for SourceUploadState. +type SourceUploadState string + +// SourceUploadTransfer defines model for SourceUploadTransfer. +type SourceUploadTransfer struct { + union json.RawMessage +} + +// Task defines model for Task. +type Task struct { + // AppId Immutable app identifier. Unique among the authenticated organisation's live apps: it cannot be changed after creation, and it becomes available again once the app it named reaches `deleted`. + AppId AppId `json:"appId"` + CompletedAt *time.Time `json:"completedAt,omitempty"` CreatedAt time.Time `json:"createdAt"` + // EndpointPath Path of the endpoint to route the task to: a bare lowercase segment such as `generate`, with no leading slash. + EndpointPath EndpointPath `json:"endpointPath"` + // Error Failure detail when status is `failed`; null otherwise. Error *string `json:"error,omitempty"` - // Id Opaque task identifier returned by the execution backend. + // Id Task identifier, supplied by the caller when the task was submitted. Id string `json:"id"` // Output Inference result payload on success; null otherwise. @@ -828,12 +1387,36 @@ type Task struct { Status TaskStatus `json:"status"` } +// TaskId Client-generated task identifier, canonical lowercase UUID. One id is one task: resubmitting it is answered with the task it already names rather than starting a second, so a request whose response was lost can be sent again without paying for the work twice. Reusing an id for a different request returns the first task, so the id is the caller's to keep unique. +type TaskId = openapi_types.UUID + +// TaskInvocation The request body for both invoke routes. The endpoint's own input schema describes `payload`, never the whole body, so no platform field can collide with one of the app's own. Unknown top-level members are rejected rather than ignored: the envelope is the platform's to extend, and silently accepting a stray member would make a later addition breaking. +type TaskInvocation struct { + // Payload The body the endpoint's handler receives, validated against the endpoint's declared input schema. An endpoint that declares none takes it unvalidated. + Payload map[string]interface{} `json:"payload"` + + // TaskId Client-generated task identifier, canonical lowercase UUID. One id is one task: resubmitting it is answered with the task it already names rather than starting a second, so a request whose response was lost can be sent again without paying for the work twice. Reusing an id for a different request returns the first task, so the id is the caller's to keep unique. + TaskId TaskId `json:"taskId"` +} + // TaskStatus defines model for TaskStatus. type TaskStatus string +// TriggeredBy Who performed an action — the authenticated user (JWT) or the API key. `kind` says which, so `id` (that actor's UUID) is resolvable to the right thing; `displayName` is its name captured at write time, so it renders as it was even if the user or key is later renamed. Used as `Build.triggeredBy` and `Version.author`. +type TriggeredBy struct { + DisplayName string `json:"displayName"` + Id openapi_types.UUID `json:"id"` + + // Kind Whether the actor is a user (JWT) or an API key. + Kind TriggeredByKind `json:"kind"` +} + +// TriggeredByKind Whether the actor is a user (JWT) or an API key. +type TriggeredByKind string + // UsageEvent defines model for UsageEvent. type UsageEvent struct { - // AppId Immutable app identifier, unique within the authenticated organisation. + // AppId Immutable app identifier. Unique among the authenticated organisation's live apps: it cannot be changed after creation, and it becomes available again once the app it named reaches `deleted`. AppId AppId `json:"appId"` // CreatedAt When the event was recorded. Audit only — may lag `occurredAt`. @@ -849,27 +1432,85 @@ type UsageEvent struct { WorkerId openapi_types.UUID `json:"workerId"` } -// Version An immutable record of what to deploy. One is created with the app and one on every update, so a rollout always names a version rather than reading configuration that may since have changed. +// Version An immutable record of what to deploy. One is created with the app and one on every update, so a rollout always names a version rather than reading configuration that may since have changed. `listVersions` and `getVersion` return this same shape. The version internally pins the exact image digest its build pushed, and everything the version references — the built image and the submitted source — is retained for the life of the version. +// Computed fields: +// +// - `buildDurationMs` is the wall-clock duration of the build this version names. +// Null while the build is running or when no completion time is available. A +// config-only update carries the image — and therefore this duration — forward. +// +// - `changes` is the structured diff against the previous version. Null on version 1 +// (no predecessor). A name-only update still inserts a version; `changes` is then +// present with `imageChanged` false and no field diffs. type Version struct { - // AppId Immutable app identifier, unique within the authenticated organisation. + // AppId Immutable app identifier. Unique among the authenticated organisation's live apps: it cannot be changed after creation, and it becomes available again once the app it named reaches `deleted`. AppId AppId `json:"appId"` - // BuildId The build that produced this version's image. Null for a `container` source, which names an image the customer already built and so has no build. A version created by an update carries the image, and therefore this build, forward. - BuildId *openapi_types.UUID `json:"buildId,omitempty"` - CreatedAt time.Time `json:"createdAt"` - Id openapi_types.UUID `json:"id"` + // Author Who created this version — the authenticated user (JWT) or the API key. `displayName` is the name captured at write time. + Author *TriggeredBy `json:"author,omitempty"` + + // BuildDurationMs Wall-clock milliseconds of the named build (`completedAt - createdAt` on that build). Null while the build is running or when no completion time is available. Bytes and units are not included; this is a raw millisecond count. + BuildDurationMs *int64 `json:"buildDurationMs,omitempty"` + + // BuildId The build that produced this version's image. Both source types build — a `code` source bakes an image around a submitted codebase, a `container` source builds the customer's own wrapper Dockerfile. A version created by an update carries the image, and therefore this build, forward. + BuildId *openapi_types.UUID `json:"buildId,omitempty"` + + // Changes Structured diff against the previous version. Null on version 1. + Changes *VersionChanges `json:"changes,omitempty"` + CreatedAt time.Time `json:"createdAt"` + + // GpuType Preferred GPU type of this version, taken from the config snapshot. + GpuType *GpuTypeId `json:"gpuType,omitempty"` + Id openapi_types.UUID `json:"id"` // VersionNumber Monotonically increasing per app. VersionNumber int32 `json:"versionNumber"` } +// VersionChanges How this version differs from the previous one. Environment-variable *values* never appear — only keys — so a secret-bearing env var cannot leak through the versions list. Numeric worker-config fields are rendered as decimal-free integer strings (the same spelling the event log uses). Empty collections are omitted: a name-only update is `{ "imageChanged": false }`. +type VersionChanges struct { + // Endpoints Keys added, removed, or changed between consecutive versions. For environment variables, `changed` is keys whose *value* changed (the value itself is never returned). For endpoints the key is the path; for volumes it is `mountPath`. `changed` is omitted on those two (a path either exists or does not). + Endpoints *VersionKeySetDiff `json:"endpoints,omitempty"` + + // EnvironmentVariables Keys added, removed, or changed between consecutive versions. For environment variables, `changed` is keys whose *value* changed (the value itself is never returned). For endpoints the key is the path; for volumes it is `mountPath`. `changed` is omitted on those two (a path either exists or does not). + EnvironmentVariables *VersionKeySetDiff `json:"environmentVariables,omitempty"` + + // ImageChanged True when this version names a different image than the previous one (`buildId` or `imageRef` changed). False for a config-only update, which carries the image forward. + ImageChanged bool `json:"imageChanged"` + + // Volumes Keys added, removed, or changed between consecutive versions. For environment variables, `changed` is keys whose *value* changed (the value itself is never returned). For endpoints the key is the path; for volumes it is `mountPath`. `changed` is omitted on those two (a path either exists or does not). + Volumes *VersionKeySetDiff `json:"volumes,omitempty"` + WorkerConfig *[]VersionConfigChange `json:"workerConfig,omitempty"` +} + +// VersionConfigChange One worker-config field that changed. `field` is the public JSON name (`gpuType`, `minWorkers`, `idleTtlSecs`, …). `from` / `to` are strings; null means the field was unset on that side. +type VersionConfigChange struct { + Field string `json:"field"` + From *string `json:"from"` + To *string `json:"to"` +} + +// VersionKeySetDiff Keys added, removed, or changed between consecutive versions. For environment variables, `changed` is keys whose *value* changed (the value itself is never returned). For endpoints the key is the path; for volumes it is `mountPath`. `changed` is omitted on those two (a path either exists or does not). +type VersionKeySetDiff struct { + Added *[]string `json:"added,omitempty"` + Changed *[]string `json:"changed,omitempty"` + Removed *[]string `json:"removed,omitempty"` +} + // Worker A worker instance observed from Kubernetes. Read-only runtime state written by the reconciler; `id` is the pod UID. +// +// Address a worker by `id`, which is stable for the life of the pod, and show `podName`, which is the name the same pod has in the cluster. There is no separate short identifier. +// +// Uptime is derived, not carried: a worker has been up from `createdAt` until `statusOccurredAt` once its `status` is `stopped`, and until now before that. type Worker struct { - // AppId Immutable app identifier, unique within the authenticated organisation. + // AppId Immutable app identifier. Unique among the authenticated organisation's live apps: it cannot be changed after creation, and it becomes available again once the app it named reaches `deleted`. AppId AppId `json:"appId"` - // CreatedAt Pod creation time (`metadata.creationTimestamp`), not insert time. - CreatedAt *time.Time `json:"createdAt,omitempty"` + // CreatedAt Pod creation time (`metadata.creationTimestamp`), not insert time. It is also the start of the worker's uptime. + CreatedAt time.Time `json:"createdAt"` + + // GpuAvailability How the catalogue currently provisions this worker's `gpuType`. Omitted for a CPU worker and for a code the catalogue no longer holds. Unlike `gpuType` this is read now rather than snapshotted, so it tells you how that GPU is supplied today, not how it was supplied when the worker started. + GpuAvailability *GpuAvailability `json:"gpuAvailability,omitempty"` // GpuCount GPUs attached to this worker at observation time. GpuCount int32 `json:"gpuCount"` @@ -888,7 +1529,7 @@ type Worker struct { // Status Worker lifecycle status. Also the type of `UsageEvent.eventType`, which records a ledger subset of these states (see that field — `busy` never appears there). `unhealthy` means the pod exists but failed to become or stay ready, not an intentional drain or stop. Status WorkerStatus `json:"status"` - // StatusOccurredAt When the worker entered its current status. + // StatusOccurredAt When the worker entered its current status. For a `stopped` worker this is when it stopped, so it is also the end of the worker's uptime. StatusOccurredAt time.Time `json:"statusOccurredAt"` // StatusReason Kubernetes-facing reason for the current status when unhealthy or otherwise notable (e.g. `ImagePullBackOff`, `CrashLoopBackOff`). @@ -899,10 +1540,10 @@ type Worker struct { // WorkerConfig defines model for WorkerConfig. type WorkerConfig struct { - // AppId Immutable app identifier, unique within the authenticated organisation. + // AppId Immutable app identifier. Unique among the authenticated organisation's live apps: it cannot be changed after creation, and it becomes available again once the app it named reaches `deleted`. AppId AppId `json:"appId"` - // AvailableWorkersPct Scaling buffer as a percentage of incoming task load. + // AvailableWorkersPct Reserved for future percentage-based buffer support. AvailableWorkersPct *int32 `json:"availableWorkersPct,omitempty"` // ComputeType Worker compute class. GPU is the only supported value. CPU workloads are not supported. @@ -916,7 +1557,9 @@ type WorkerConfig struct { FallbackGpuType *GpuTypeId `json:"fallbackGpuType,omitempty"` // GpuType Preferred GPU type. Absent (or null) only on historical apps created before a GPU type was required. - GpuType *GpuTypeId `json:"gpuType,omitempty"` + GpuType *GpuTypeId `json:"gpuType,omitempty"` + + // GpusPerWorker One GPU per worker is currently supported. Historical apps may contain another value. GpusPerWorker int32 `json:"gpusPerWorker"` Id openapi_types.UUID `json:"id"` @@ -924,7 +1567,7 @@ type WorkerConfig struct { IdleTtlSecs int32 `json:"idleTtlSecs"` MaxWorkers int32 `json:"maxWorkers"` - // MinAvailableWorkers Minimum number of available (idle) workers kept as a pre-emptive buffer. + // MinAvailableWorkers Reserved for future idle-worker buffer support. MinAvailableWorkers *int32 `json:"minAvailableWorkers,omitempty"` // MinWorkers Floor for scale-down; 0 = scale to zero. @@ -937,59 +1580,98 @@ type WorkerConfig struct { // WorkerConfigCreate defines model for WorkerConfigCreate. type WorkerConfigCreate struct { + // AvailableWorkersPct A non-null value returns 422 because this setting is not supported yet. AvailableWorkersPct *int32 `json:"availableWorkersPct,omitempty"` // ComputeType GPU is the only supported compute type. Omitting the field selects GPU. CPU workloads are not supported; a request that names `cpu` is rejected with 422 before a build or deploy starts. - ComputeType *ComputeType `json:"computeType,omitempty"` - Concurrency *int32 `json:"concurrency,omitempty"` - FallbackGpuType *GpuTypeId `json:"fallbackGpuType,omitempty"` + ComputeType *ComputeType `json:"computeType,omitempty"` + Concurrency *int32 `json:"concurrency,omitempty"` + + // FallbackGpuType Secondary GPU type used if the preferred type is unavailable. Omit, send JSON null, or send an empty string for no fallback — forms bind an unselected dropdown as `""`, which is not a `GpuTypeId`. A non-empty value must be an active catalogue code. Unlike `gpuType` this is an existence check only: it does not require admitted capacity, so the code may not appear in the customer `GET /v1/gpu-types` list. + FallbackGpuType *GpuTypeIdOrEmpty `json:"fallbackGpuType,omitempty"` // GpuType GPU type the workers run on. Required: omitting it (or sending null) is a 422 before a build or deploy starts, because a GPU app with no type is unpinned and the deployer would render NVIDIA defaults. Must match an `id` returned by `GET /v1/gpu-types` that currently has admitted capacity. - GpuType GpuTypeId `json:"gpuType"` - GpusPerWorker *int32 `json:"gpusPerWorker,omitempty"` - IdleTtlSecs int32 `json:"idleTtlSecs"` - MaxWorkers int32 `json:"maxWorkers"` - MinAvailableWorkers *int32 `json:"minAvailableWorkers,omitempty"` - MinWorkers *int32 `json:"minWorkers,omitempty"` - ScalingDelaySecs int32 `json:"scalingDelaySecs"` + GpuType GpuTypeId `json:"gpuType"` + + // GpusPerWorker Only 1 is currently supported. Any other value returns 422. + GpusPerWorker *int32 `json:"gpusPerWorker,omitempty"` + IdleTtlSecs int32 `json:"idleTtlSecs"` + MaxWorkers int32 `json:"maxWorkers"` + + // MinAvailableWorkers A non-null value returns 422 because this setting is not supported yet. + MinAvailableWorkers *int32 `json:"minAvailableWorkers,omitempty"` + MinWorkers *int32 `json:"minWorkers,omitempty"` + ScalingDelaySecs int32 `json:"scalingDelaySecs"` } -// WorkerConfigPatch Partial worker configuration. Any field present overwrites the live value; omitted fields are left unchanged. Clearing a nullable live field (setting it to null) is not supported — omit the field to leave it unchanged. `computeType` is create-time only and cannot be patched. Changing `gpuType` or `gpusPerWorker` affects only newly created workers. +// WorkerConfigPatch Partial worker configuration. Any field present overwrites the live value; omitted fields are left unchanged. Clearing a nullable live field (setting it to null) is not supported — omit the field to leave it unchanged. `fallbackGpuType` is the exception: send an empty string to clear it. `computeType` is create-time only and cannot be patched. Changing `gpuType` affects only newly created workers. type WorkerConfigPatch struct { - // AvailableWorkersPct Scaling buffer as a percentage of load. Omit to leave unchanged. + // AvailableWorkersPct Reserved for future use. Supplying it returns 422. AvailableWorkersPct *int32 `json:"availableWorkersPct,omitempty"` Concurrency *int32 `json:"concurrency,omitempty"` - // FallbackGpuType Secondary GPU type. Omit to leave unchanged. - FallbackGpuType *GpuTypeId `json:"fallbackGpuType,omitempty"` + // FallbackGpuType Secondary GPU type. Omit to leave unchanged. Send an empty string to clear — forms bind an unselected dropdown as `""`. JSON null is rejected: this field is not nullable, so a client that meant to clear must send `""` rather than null. A non-empty value must be an active catalogue code. Unlike `gpuType` this is an existence check only: it does not require admitted capacity, so the code may not appear in the customer `GET /v1/gpu-types` list. + FallbackGpuType *GpuTypeIdOrEmpty `json:"fallbackGpuType,omitempty"` // GpuType Preferred GPU type. Omit to leave unchanged. Rejected with a 422 when no capacity is currently offered for the type (it does not appear in `GET /v1/gpu-types`). - GpuType *GpuTypeId `json:"gpuType,omitempty"` - GpusPerWorker *int32 `json:"gpusPerWorker,omitempty"` - IdleTtlSecs *int32 `json:"idleTtlSecs,omitempty"` - MaxWorkers *int32 `json:"maxWorkers,omitempty"` + GpuType *GpuTypeId `json:"gpuType,omitempty"` + + // GpusPerWorker Only 1 is currently supported. Any other value returns 422. + GpusPerWorker *int32 `json:"gpusPerWorker,omitempty"` + IdleTtlSecs *int32 `json:"idleTtlSecs,omitempty"` + MaxWorkers *int32 `json:"maxWorkers,omitempty"` - // MinAvailableWorkers Pre-emptive idle-worker buffer. Omit to leave unchanged. + // MinAvailableWorkers Reserved for future use. Supplying it returns 422. MinAvailableWorkers *int32 `json:"minAvailableWorkers,omitempty"` MinWorkers *int32 `json:"minWorkers,omitempty"` ScalingDelaySecs *int32 `json:"scalingDelaySecs,omitempty"` } +// WorkerStateFilter Which worker states a page covers. `live` is every status other than `stopped`, so it is the page a dashboard wants and the one `status` alone can only ask for one value at a time. `all` includes the terminal rows that are kept as history. +type WorkerStateFilter string + // WorkerStatus Worker lifecycle status. Also the type of `UsageEvent.eventType`, which records a ledger subset of these states (see that field — `busy` never appears there). `unhealthy` means the pod exists but failed to become or stay ready, not an intentional drain or stop. type WorkerStatus string // Cursor defines model for Cursor. type Cursor = string -// EndpointPath defines model for EndpointPath. -type EndpointPath = string - // Limit defines model for Limit. type Limit = int32 +// MetricWindow defines model for MetricWindow. +type MetricWindow string + +// PinnedTo defines model for PinnedTo. +type PinnedTo = int64 + +// QueryId defines model for QueryId. +type QueryId = string + +// SelectorDeployment Immutable app identifier. Unique among the authenticated organisation's live apps: it cannot be changed after creation, and it becomes available again once the app it named reaches `deleted`. +type SelectorDeployment = AppId + +// SelectorEndpoint defines model for SelectorEndpoint. +type SelectorEndpoint = openapi_types.UUID + +// SelectorRegion defines model for SelectorRegion. +type SelectorRegion = string + +// SelectorStatusClass defines model for SelectorStatusClass. +type SelectorStatusClass string + +// SeriesAppId defines model for SeriesAppId. +type SeriesAppId = []AppId + +// SeriesEndpointId defines model for SeriesEndpointId. +type SeriesEndpointId = []openapi_types.UUID + // WorkerId defines model for WorkerId. type WorkerId = openapi_types.UUID +// BadGateway RFC 9457 problem details. Every error response from this API uses this schema with media type `application/problem+json`. `type` is a URI that identifies the problem class and dereferences to its documentation; clients should switch on `type` (not `status` or `detail`, which are not stable identifiers). Additional members beyond those below may appear. +type BadGateway = ProblemDetails + // BadRequest RFC 9457 problem details. Every error response from this API uses this schema with media type `application/problem+json`. `type` is a URI that identifies the problem class and dereferences to its documentation; clients should switch on `type` (not `status` or `detail`, which are not stable identifiers). Additional members beyond those below may appear. type BadRequest = ProblemDetails @@ -999,6 +1681,9 @@ type Conflict = ProblemDetails // Forbidden RFC 9457 problem details. Every error response from this API uses this schema with media type `application/problem+json`. `type` is a URI that identifies the problem class and dereferences to its documentation; clients should switch on `type` (not `status` or `detail`, which are not stable identifiers). Additional members beyond those below may appear. type Forbidden = ProblemDetails +// GatewayTimeout RFC 9457 problem details. Every error response from this API uses this schema with media type `application/problem+json`. `type` is a URI that identifies the problem class and dereferences to its documentation; clients should switch on `type` (not `status` or `detail`, which are not stable identifiers). Additional members beyond those below may appear. +type GatewayTimeout = ProblemDetails + // NotFound RFC 9457 problem details. Every error response from this API uses this schema with media type `application/problem+json`. `type` is a URI that identifies the problem class and dereferences to its documentation; clients should switch on `type` (not `status` or `detail`, which are not stable identifiers). Additional members beyond those below may appear. type NotFound = ProblemDetails @@ -1008,8 +1693,8 @@ type ServiceUnavailable = ProblemDetails // TaskAccepted defines model for TaskAccepted. type TaskAccepted = Task -// Timeout RFC 9457 problem details. Every error response from this API uses this schema with media type `application/problem+json`. `type` is a URI that identifies the problem class and dereferences to its documentation; clients should switch on `type` (not `status` or `detail`, which are not stable identifiers). Additional members beyond those below may appear. -type Timeout = ProblemDetails +// TooManyRequests RFC 9457 problem details. Every error response from this API uses this schema with media type `application/problem+json`. `type` is a URI that identifies the problem class and dereferences to its documentation; clients should switch on `type` (not `status` or `detail`, which are not stable identifiers). Additional members beyond those below may appear. +type TooManyRequests = ProblemDetails // Unauthorized RFC 9457 problem details. Every error response from this API uses this schema with media type `application/problem+json`. `type` is a URI that identifies the problem class and dereferences to its documentation; clients should switch on `type` (not `status` or `detail`, which are not stable identifiers). Additional members beyond those below may appear. type Unauthorized = ProblemDetails @@ -1017,9 +1702,6 @@ type Unauthorized = ProblemDetails // ValidationError RFC 9457 problem details. Every error response from this API uses this schema with media type `application/problem+json`. `type` is a URI that identifies the problem class and dereferences to its documentation; clients should switch on `type` (not `status` or `detail`, which are not stable identifiers). Additional members beyond those below may appear. type ValidationError = ProblemDetails -// TaskPayload defines model for TaskPayload. -type TaskPayload map[string]interface{} - // ListAppsParams defines parameters for ListApps. type ListAppsParams struct { // Limit Maximum number of items to return. @@ -1076,12 +1758,6 @@ type ListAppEventsParams struct { Type *AppEventType `form:"type,omitempty" json:"type,omitempty"` } -// StartAsyncTaskJSONBody defines parameters for StartAsyncTask. -type StartAsyncTaskJSONBody map[string]interface{} - -// StartSyncTaskJSONBody defines parameters for StartSyncTask. -type StartSyncTaskJSONBody map[string]interface{} - // ListAppSecretsParams defines parameters for ListAppSecrets. type ListAppSecretsParams struct { // Limit Maximum number of items to return. @@ -1116,8 +1792,13 @@ type ListWorkersParams struct { Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"` // Cursor Opaque pagination cursor returned as `nextCursor` by a previous call. - Cursor *Cursor `form:"cursor,omitempty" json:"cursor,omitempty"` - Status *WorkerStatus `form:"status,omitempty" json:"status,omitempty"` + Cursor *Cursor `form:"cursor,omitempty" json:"cursor,omitempty"` + + // State Narrow the page by worker state. The default, `all`, keeps the terminal `stopped` rows in the page; `live` drops them. + // + // A `state` of `live` with a `status` of `stopped` is a contradiction and is refused, because an empty page would read as "this app has never run". + State *WorkerStateFilter `form:"state,omitempty" json:"state,omitempty"` + Status *WorkerStatus `form:"status,omitempty" json:"status,omitempty"` } // ListGpuTypePricesParams defines parameters for ListGpuTypePrices. @@ -1129,6 +1810,60 @@ type ListGpuTypePricesParams struct { Cursor *Cursor `form:"cursor,omitempty" json:"cursor,omitempty"` } +// GetLogEntriesParams defines parameters for GetLogEntries. +type GetLogEntriesParams struct { + // Window The time window. A closed set rather than a free-form range, because every distinct range defeats the server-side cache alignment that makes a sliding window cheap. Only the windows a query lists in the catalogue can be asked of it. + Window GetLogEntriesParamsWindow `form:"window" json:"window"` + + // Limit Maximum number of items to return. + Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"` + + // Cursor Opaque pagination cursor returned as `nextCursor` by a previous call. + Cursor *Cursor `form:"cursor,omitempty" json:"cursor,omitempty"` + + // Deployment Narrow to one app. + Deployment *SelectorDeployment `form:"deployment,omitempty" json:"deployment,omitempty"` + + // Endpoint Narrow to one endpoint within a deployment. The value is the allocated `endpoints.id` (UUID), never the customer-authored path. A query that does not declare this selector rejects it rather than ignoring it. + Endpoint *SelectorEndpoint `form:"endpoint,omitempty" json:"endpoint,omitempty"` +} + +// GetLogEntriesParamsWindow defines parameters for GetLogEntries. +type GetLogEntriesParamsWindow string + +// GetMetricSeriesParams defines parameters for GetMetricSeries. +type GetMetricSeriesParams struct { + // Window The time window. A closed set rather than a free-form range, because every distinct range defeats the server-side cache alignment that makes a sliding window cheap. Only the windows a query lists in the catalogue can be asked of it. + Window GetMetricSeriesParamsWindow `form:"window" json:"window"` + + // PinnedTo Fixes the window's inclusive end, the last timestamp in `t`, so that several calls making up one visual share an axis instead of racing the clock between them. Must be aligned to the window's step, no newer than the newest readable edge, and inside retention. + PinnedTo *PinnedTo `form:"pinnedTo,omitempty" json:"pinnedTo,omitempty"` + + // Deployment Narrow to one app. + Deployment *SelectorDeployment `form:"deployment,omitempty" json:"deployment,omitempty"` + + // Endpoint Narrow to one endpoint within a deployment. The value is the allocated `endpoints.id` (UUID), never the customer-authored path. A query that does not declare this selector rejects it rather than ignoring it. + Endpoint *SelectorEndpoint `form:"endpoint,omitempty" json:"endpoint,omitempty"` + + // StatusClass Narrow to one response class. + StatusClass *GetMetricSeriesParamsStatusClass `form:"statusClass,omitempty" json:"statusClass,omitempty"` + + // Region Narrow to one region. No series carries a region label yet, so no query currently accepts this and supplying it is rejected rather than ignored. + Region *SelectorRegion `form:"region,omitempty" json:"region,omitempty"` + + // AppId Restrict expand-by-`app_id` queries (`apps_request_volume`, `apps_error_volume`, `apps_request_duration`) to these app ids: one series per id, in request order, with all-null series for apps that had no samples. Values are hourly over `window=24h`. Hours that started before that live app's `createdAt` are null. Repeat the parameter once per id on the current list page (at most 100, matching `listApps`). Omit it to receive every app in the organisation that had data, unless that set is larger than this query will expand: then the call is a `422` on `appId` and the list page should name the apps it is showing. Other queries reject this parameter. + AppId *SeriesAppId `form:"appId,omitempty" json:"appId,omitempty"` + + // EndpointId Restrict `endpoints_request_volume` to these endpoint ids: one series per id, in request order, with all-null series for endpoints that had no traffic. Values are hourly request counts over `window=24h`. Hours that started before that endpoint row's `createdAt` are null. Repeat the parameter once per id on the current list page (at most 100, matching `listEndpoints`). Omit it to receive every endpoint on the selected app that had data, unless that set is larger than this query will expand: then the call is a `422` on `endpointId` and the list page should name the endpoints it is showing. Other queries reject this parameter. Requires `deployment`. + EndpointId *SeriesEndpointId `form:"endpointId,omitempty" json:"endpointId,omitempty"` +} + +// GetMetricSeriesParamsWindow defines parameters for GetMetricSeries. +type GetMetricSeriesParamsWindow string + +// GetMetricSeriesParamsStatusClass defines parameters for GetMetricSeries. +type GetMetricSeriesParamsStatusClass string + // ListSecretsParams defines parameters for ListSecrets. type ListSecretsParams struct { // Limit Maximum number of items to return. @@ -1167,14 +1902,17 @@ type DeployVersionJSONRequestBody = DeployRequest type UpdateAppEnvironmentVariableJSONRequestBody = EnvironmentVariableUpdate // StartAsyncTaskJSONRequestBody defines body for StartAsyncTask for application/json ContentType. -type StartAsyncTaskJSONRequestBody StartAsyncTaskJSONBody +type StartAsyncTaskJSONRequestBody = TaskInvocation // StartSyncTaskJSONRequestBody defines body for StartSyncTask for application/json ContentType. -type StartSyncTaskJSONRequestBody StartSyncTaskJSONBody +type StartSyncTaskJSONRequestBody = TaskInvocation // AttachAppSecretJSONRequestBody defines body for AttachAppSecret for application/json ContentType. type AttachAppSecretJSONRequestBody = SecretAttach +// CreateSourceUploadJSONRequestBody defines body for CreateSourceUpload for application/json ContentType. +type CreateSourceUploadJSONRequestBody = SourceUploadCreate + // CreateGpuTypeJSONRequestBody defines body for CreateGpuType for application/json ContentType. type CreateGpuTypeJSONRequestBody = GpuTypeCreate @@ -1187,6 +1925,9 @@ type CreateGpuTypePriceJSONRequestBody = GpuPricingCreate // UpdateGpuTypePriceJSONRequestBody defines body for UpdateGpuTypePrice for application/json ContentType. type UpdateGpuTypePriceJSONRequestBody = GpuPricingUpdate +// UpsertOrgTenancyJSONRequestBody defines body for UpsertOrgTenancy for application/json ContentType. +type UpsertOrgTenancyJSONRequestBody = OrgTenancyUpsert + // CreateSecretJSONRequestBody defines body for CreateSecret for application/json ContentType. type CreateSecretJSONRequestBody = SecretCreate @@ -1255,6 +1996,71 @@ func (t *AppSourceUpsert_Source) UnmarshalJSON(b []byte) error { return err } +// AsSourceUploadSinglePutTransfer returns the union data inside the SourceUploadTransfer as a SourceUploadSinglePutTransfer +func (t SourceUploadTransfer) AsSourceUploadSinglePutTransfer() (SourceUploadSinglePutTransfer, error) { + var body SourceUploadSinglePutTransfer + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromSourceUploadSinglePutTransfer overwrites any union data inside the SourceUploadTransfer as the provided SourceUploadSinglePutTransfer +func (t *SourceUploadTransfer) FromSourceUploadSinglePutTransfer(v SourceUploadSinglePutTransfer) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + b, err = runtime.JSONMerge(b, []byte(`{"mode":"singlePut"}`)) + t.union = b + return err +} + +// MergeSourceUploadSinglePutTransfer performs a merge with any union data inside the SourceUploadTransfer, using the provided SourceUploadSinglePutTransfer +func (t *SourceUploadTransfer) MergeSourceUploadSinglePutTransfer(v SourceUploadSinglePutTransfer) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + b, err = runtime.JSONMerge(b, []byte(`{"mode":"singlePut"}`)) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t SourceUploadTransfer) Discriminator() (string, error) { + var discriminator struct { + Discriminator string `json:"mode"` + } + err := json.Unmarshal(t.union, &discriminator) + return discriminator.Discriminator, err +} + +func (t SourceUploadTransfer) ValueByDiscriminator() (interface{}, error) { + discriminator, err := t.Discriminator() + if err != nil { + return nil, err + } + switch discriminator { + case "singlePut": + return t.AsSourceUploadSinglePutTransfer() + default: + return nil, errors.New("unknown discriminator value: " + discriminator) + } +} + +func (t SourceUploadTransfer) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *SourceUploadTransfer) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + // RequestEditorFn is the function signature for the RequestEditor callback function type RequestEditorFn func(ctx context.Context, req *http.Request) error @@ -1331,14 +2137,14 @@ type ClientInterface interface { // GetAppSummary App summary metrics for the authenticated organisation // - // Aggregate dashboard metrics across all apps owned by the authenticated organisation. Metrics whose backing system is not yet available are omitted from the response rather than reported as zero. + // Aggregate dashboard metrics across all apps owned by the authenticated organisation. App and worker tallies are always present. Request and error-rate totals come from the metrics store and are omitted when that hop cannot answer rather than reported as zero. Spend is omitted until billing rollups exist. // // Corresponds with GET /v1/app-summary (the `GetAppSummary` operationId). GetAppSummary(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) // ListApps List apps // - // Returns a page of the organisation's apps. Filters combine with AND; soft-deleted apps are excluded unless `status=deleted` is requested explicitly. + // Returns a page of the organisation's apps. Filters combine with AND; soft-deleted apps are excluded unless `status=deleted` is requested explicitly. Favourited apps appear before non-favourited apps, with the selected ordering applied within each group. // // A `cursor` is only valid for the `sort` and filters it was issued under — reusing one across a different ordering or filter set returns `400`. // @@ -1354,14 +2160,17 @@ type ClientInterface interface { // points at that version. If the build, validation, or rollout fails the app is // marked `failed`. // - // - `container` source: no build step, so the version carries no `buildId`. No worker runs - // from a container source yet, so the app stays `initializing` and does not serve - // inference — poll `active` only for a `code` source. + // - `container` source: the submitted zip (wrapper `Dockerfile` + `container.yaml`) + // goes through the same build pipeline — the wrapper image is built, published and + // deployed, so the version carries a `buildId` and the app follows the same + // lifecycle as a code source. An invalid `container.yaml` rejects the create + // before any build capacity is spent — `400` where the document could not be + // parsed at all, `422` where it parsed and broke a rule. // // // `activeVersionId` is null until a rollout completes: a version records what should run, and only a finished deploy says what does. // - // `secrets` is accepted by the schema but not yet applied, so supplying it returns `422` rather than silently dropping it. + // `secrets` attaches organisation secrets that already exist. It is the app's initial attachment set, so the first rollout carries their values into the worker. This route does not create a secret — use `POST /v1/secrets` first. A name that is unknown to the organisation, or that is not `active`, returns `404`. A name that collides with a key in `environmentVariables`, a repeated name and a set that goes past the binding limit each return `422`. The whole set is checked before any build capacity is spent. // // Takes any type of body and a specified content type. // @@ -1377,14 +2186,17 @@ type ClientInterface interface { // points at that version. If the build, validation, or rollout fails the app is // marked `failed`. // - // - `container` source: no build step, so the version carries no `buildId`. No worker runs - // from a container source yet, so the app stays `initializing` and does not serve - // inference — poll `active` only for a `code` source. + // - `container` source: the submitted zip (wrapper `Dockerfile` + `container.yaml`) + // goes through the same build pipeline — the wrapper image is built, published and + // deployed, so the version carries a `buildId` and the app follows the same + // lifecycle as a code source. An invalid `container.yaml` rejects the create + // before any build capacity is spent — `400` where the document could not be + // parsed at all, `422` where it parsed and broke a rule. // // // `activeVersionId` is null until a rollout completes: a version records what should run, and only a finished deploy says what does. // - // `secrets` is accepted by the schema but not yet applied, so supplying it returns `422` rather than silently dropping it. + // `secrets` attaches organisation secrets that already exist. It is the app's initial attachment set, so the first rollout carries their values into the worker. This route does not create a secret — use `POST /v1/secrets` first. A name that is unknown to the organisation, or that is not `active`, returns `404`. A name that collides with a key in `environmentVariables`, a repeated name and a set that goes past the binding limit each return `422`. The whole set is checked before any build capacity is spent. // // Takes a body of the `application/json` content type. // @@ -1395,33 +2207,26 @@ type ClientInterface interface { // // Soft delete. Sets `status = deleting` and returns `202` once that intent is persisted. Router removal, cancelling in-progress builds, and worker drain (`draining → stopping → stopped`) are performed asynchronously by the deployer/Scaler; `status` becomes `deleted` once all workers stop. All rows are retained for billing finalisation, audit, and usage history. Idempotent if the app is already `deleting`. // + // The `appId` is released once `status` reaches `deleted`, and not before: while the app is `deleting` its workload is still being torn down and the name stays taken. A new app created under a released name is a new app and inherits nothing — no version, no build, no event history, and no workers. + // // Corresponds with DELETE /v1/apps/{appId} (the `DeleteApp` operationId). DeleteApp(ctx context.Context, appId AppId, reqEditors ...RequestEditorFn) (*http.Response, error) // GetApp Get an app // + // Returns the app the authenticated organisation owns under this `appId`. An unknown app and a soft-deleted one both return `404 Not Found`: a deleted app is gone to its owner, and its rows are retained only for billing and audit. To read deleted apps, list them with `status=deleted`. + // // Corresponds with GET /v1/apps/{appId} (the `GetApp` operationId). GetApp(ctx context.Context, appId AppId, reqEditors ...RequestEditorFn) (*http.Response, error) // UpdateAppWithBody Update an app // // Patches one or more aspects of an app in place. All fields are optional; omitted fields are left unchanged. Valid in any non-`deleted` status, including `stopped` (changes apply on `resume`). Lifecycle transitions use the dedicated `deploy`, `stop`, `resume`, and `delete` operations. - // - // **Currently persisted:** `appName` and `configuration` only. Supplying `appSource`, `secrets`, `environmentVariables`, or `endpoints` returns `422` (bulk env-var replace is not wired — use the dedicated `/environment-variables` endpoints for individual keys). - // - // Target behaviour (once fully wired): - // - `configuration`: applied on the next Scaler cycle; triggers a rollout so workers - // restart with the new configuration. If the rollout fails, the app remains on - // the previous configuration. - // - // - `appSource`: triggers a build (for `code` sources) or image validation (for `container` - // sources); on success the new version is deployed automatically. If the build or - // validation fails, the app remains on the previous version. - // - // - `secrets` / `environmentVariables` / `endpoints`: the supplied array **replaces** the - // current set — any item absent from the request is deleted. Endpoints take effect - // immediately. Changes to secrets or environment variables trigger a rollout so workers - // restart and pick up the new values. + // A configuration or `environmentVariables` change records a new version with the same image. If that image is deployable, the update pins it as `activeVersionId` and rolls the workload when the app is `active` or `initializing`. A `failed` app is moved to `initializing` and rolled, the same as `POST /deploy`. If the image is not deployable, the version is recorded and `activeVersionId` is left unchanged. If the roll fails, `activeVersionId` is restored and the previous configuration keeps serving. A name-only change records a version and does not pin. A `stopped` or `stopping` app pins the version and rolls it on `resume`. A configuration, `environmentVariables`, or `appSource` change while a create or resume rollout is already in progress returns `409 Conflict`. A name-only or `secrets`-only change does not. + // `appSource` starts a build and records version N+1 with a new image tag. The deploy queue carries the build-then-deploy tail; `activeVersionId` moves only when that rollout completes. A builder rejection (400 where a container document's parser refused it, 422 where it parsed and broke a rule) leaves the app on its current version and writes no version row and no build row. After the builder accepts, version N+1 is recorded even if a concurrent secret deactivation or env/secret collision prevents this request's env/secrets overlay; in that case the previous environmentVariables and attachment set stay in place and are what the new version snapshots. + // `environmentVariables` replaces the whole set: a key absent from the map is deleted, and a null value omits that key from the new set. The resolved map is snapshotted onto the new version. + // `secrets` replaces the whole attachment set. An attachment absent from the array is detached. Injected names must not collide with a plain environment variable on the app; the combined set of plain variables and attachments is capped at 100. This is a control-plane record only — secret values do not reach a pod, and the version snapshot carries no secrets — so a secrets-only change does not roll the workload. + // Endpoints are not a field of this contract: the set belongs to the app source, so it changes only when a new version with a new source builds and deploys. // // Takes any type of body and a specified content type. // @@ -1431,22 +2236,11 @@ type ClientInterface interface { // UpdateApp Update an app // // Patches one or more aspects of an app in place. All fields are optional; omitted fields are left unchanged. Valid in any non-`deleted` status, including `stopped` (changes apply on `resume`). Lifecycle transitions use the dedicated `deploy`, `stop`, `resume`, and `delete` operations. - // - // **Currently persisted:** `appName` and `configuration` only. Supplying `appSource`, `secrets`, `environmentVariables`, or `endpoints` returns `422` (bulk env-var replace is not wired — use the dedicated `/environment-variables` endpoints for individual keys). - // - // Target behaviour (once fully wired): - // - `configuration`: applied on the next Scaler cycle; triggers a rollout so workers - // restart with the new configuration. If the rollout fails, the app remains on - // the previous configuration. - // - // - `appSource`: triggers a build (for `code` sources) or image validation (for `container` - // sources); on success the new version is deployed automatically. If the build or - // validation fails, the app remains on the previous version. - // - // - `secrets` / `environmentVariables` / `endpoints`: the supplied array **replaces** the - // current set — any item absent from the request is deleted. Endpoints take effect - // immediately. Changes to secrets or environment variables trigger a rollout so workers - // restart and pick up the new values. + // A configuration or `environmentVariables` change records a new version with the same image. If that image is deployable, the update pins it as `activeVersionId` and rolls the workload when the app is `active` or `initializing`. A `failed` app is moved to `initializing` and rolled, the same as `POST /deploy`. If the image is not deployable, the version is recorded and `activeVersionId` is left unchanged. If the roll fails, `activeVersionId` is restored and the previous configuration keeps serving. A name-only change records a version and does not pin. A `stopped` or `stopping` app pins the version and rolls it on `resume`. A configuration, `environmentVariables`, or `appSource` change while a create or resume rollout is already in progress returns `409 Conflict`. A name-only or `secrets`-only change does not. + // `appSource` starts a build and records version N+1 with a new image tag. The deploy queue carries the build-then-deploy tail; `activeVersionId` moves only when that rollout completes. A builder rejection (400 where a container document's parser refused it, 422 where it parsed and broke a rule) leaves the app on its current version and writes no version row and no build row. After the builder accepts, version N+1 is recorded even if a concurrent secret deactivation or env/secret collision prevents this request's env/secrets overlay; in that case the previous environmentVariables and attachment set stay in place and are what the new version snapshots. + // `environmentVariables` replaces the whole set: a key absent from the map is deleted, and a null value omits that key from the new set. The resolved map is snapshotted onto the new version. + // `secrets` replaces the whole attachment set. An attachment absent from the array is detached. Injected names must not collide with a plain environment variable on the app; the combined set of plain variables and attachments is capped at 100. This is a control-plane record only — secret values do not reach a pod, and the version snapshot carries no secrets — so a secrets-only change does not roll the workload. + // Endpoints are not a field of this contract: the set belongs to the app source, so it changes only when a new version with a new source builds and deploys. // // Takes a body of the `application/json` content type. // @@ -1458,6 +2252,13 @@ type ClientInterface interface { // Corresponds with GET /v1/apps/{appId}/builds (the `ListBuilds` operationId). ListBuilds(ctx context.Context, appId AppId, params *ListBuildsParams, reqEditors ...RequestEditorFn) (*http.Response, error) + // DeleteBuild Delete or cancel a build + // + // Cancels a queued or running build and records it as `superseded`. Deleting a queued or running build ends its current rollout without activating the cancelled build, so any previous version keeps serving. A terminal build can be deleted once no live rollout still needs it. Ready builds remain while a version references them. + // + // Corresponds with DELETE /v1/apps/{appId}/builds/{buildId} (the `DeleteBuild` operationId). + DeleteBuild(ctx context.Context, appId AppId, buildId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) + // GetBuild Get a build // // Corresponds with GET /v1/apps/{appId}/builds/{buildId} (the `GetBuild` operationId). @@ -1465,12 +2266,12 @@ type ClientInterface interface { // DeployVersionWithBody Deploy a version // - // Activates a `ready` version by number, setting `activeVersionId` and returning `202` once that intent is persisted. Worker rollout, routing switch, and cancelling in-progress builds (`failed` with `error: "superseded"`) are performed asynchronously by the deployer/Scaler. Permitted in any addressable status, including `initializing` and `failed`. + // Activates a `ready` version by number, setting `activeVersionId` and returning `202` once that intent is persisted. Worker rollout, routing switch, and cancelling in-progress builds (`superseded`) are performed asynchronously by the deployer/Scaler. Permitted in any addressable status, including `initializing` and `failed`. // To roll back, supply an older `versionNumber` — the operation is identical to a forward deploy. No new version is created and no rebuild happens: the version's existing image is re-applied. Re-deploying the currently active version is permitted and re-applies it. // A deploy to a `stopped` or `stopping` app records the version and rolls no workload, because no workers are running: the `202` does not imply a rollout there. The recorded version is the one applied when the app resumes. // If the roll of a live app fails, `activeVersionId` is restored to the version that kept serving, so the field keeps naming the running image. // **Rollout** (deployer/Scaler): the platform starts workers on the target version, waits for at least one to become healthy, switches task routing to the new version, then drains old-version workers gracefully. Old workers are given a fixed, platform-managed grace period to finish in-flight tasks before being force-terminated. If new workers fail to become healthy, old workers are not drained and the app continues on the previous version. - // Errors: - Deploy to a `deleting` app returns `409 Conflict` - `versionNumber` not found or not `ready` returns `409 Conflict` - A `container`-source version returns `409 Conflict` until container apps are supported - Deploy to a non-existent or `deleted` app returns `404 Not Found` + // Errors: - Deploy to a `deleting` app returns `409 Conflict` - `versionNumber` not found or not `ready` returns `409 Conflict` - Deploy to a non-existent or `deleted` app returns `404 Not Found` // // Takes any type of body and a specified content type. // @@ -1479,12 +2280,12 @@ type ClientInterface interface { // DeployVersion Deploy a version // - // Activates a `ready` version by number, setting `activeVersionId` and returning `202` once that intent is persisted. Worker rollout, routing switch, and cancelling in-progress builds (`failed` with `error: "superseded"`) are performed asynchronously by the deployer/Scaler. Permitted in any addressable status, including `initializing` and `failed`. + // Activates a `ready` version by number, setting `activeVersionId` and returning `202` once that intent is persisted. Worker rollout, routing switch, and cancelling in-progress builds (`superseded`) are performed asynchronously by the deployer/Scaler. Permitted in any addressable status, including `initializing` and `failed`. // To roll back, supply an older `versionNumber` — the operation is identical to a forward deploy. No new version is created and no rebuild happens: the version's existing image is re-applied. Re-deploying the currently active version is permitted and re-applies it. // A deploy to a `stopped` or `stopping` app records the version and rolls no workload, because no workers are running: the `202` does not imply a rollout there. The recorded version is the one applied when the app resumes. // If the roll of a live app fails, `activeVersionId` is restored to the version that kept serving, so the field keeps naming the running image. // **Rollout** (deployer/Scaler): the platform starts workers on the target version, waits for at least one to become healthy, switches task routing to the new version, then drains old-version workers gracefully. Old workers are given a fixed, platform-managed grace period to finish in-flight tasks before being force-terminated. If new workers fail to become healthy, old workers are not drained and the app continues on the previous version. - // Errors: - Deploy to a `deleting` app returns `409 Conflict` - `versionNumber` not found or not `ready` returns `409 Conflict` - A `container`-source version returns `409 Conflict` until container apps are supported - Deploy to a non-existent or `deleted` app returns `404 Not Found` + // Errors: - Deploy to a `deleting` app returns `409 Conflict` - `versionNumber` not found or not `ready` returns `409 Conflict` - Deploy to a non-existent or `deleted` app returns `404 Not Found` // // Takes a body of the `application/json` content type. // @@ -1493,6 +2294,8 @@ type ClientInterface interface { // ListEndpoints List endpoints // + // Lists the endpoints of the app's active version. The set is written by the source itself — a code build's introspection, or a container's config document — and is replaced atomically whenever a version activates, so a deploy of a newer version or a rollback to an older one is immediately reflected here. Empty while the app is `initializing`: nothing is routable until its first build is ready and deployed. + // // Corresponds with GET /v1/apps/{appId}/endpoints (the `ListEndpoints` operationId). ListEndpoints(ctx context.Context, appId AppId, params *ListEndpointsParams, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -1558,7 +2361,7 @@ type ClientInterface interface { // StartAsyncTaskWithBody Start a new async task // - // Starts a new async task on `appId`, routing the request body payload to an available worker. The task runs asynchronously and the response is `202`; poll `GET /v1/apps/{appId}/tasks/{taskId}` for completion. Apps in `initializing`, `active`, or `stopping` accept invocation. `stopped`, `deleting`, and `failed` return `409 Conflict`; unknown or deleted apps return `404 Not Found`. + // Starts a new async task on `appId`, routing the request body payload to an available worker. The task runs asynchronously and the response is `202`; poll `GET /v1/apps/{appId}/tasks/{taskId}` for completion. Resubmitting a task id is answered with the task it already names rather than starting a second one, so the `202` can carry a task that has already finished: read its `status` instead of assuming `pending`, and note it may name a different `appId`. Apps in `initializing`, `active`, or `stopping` accept invocation. `stopped`, `deleting`, and `failed` return `409 Conflict`; unknown or deleted apps return `404 Not Found`. Endpoint membership is checked against the active version's endpoint set before the task is accepted: an endpoint the app does not declare returns `404` whose `endpointPath` extension member carries the rejected path, distinguishing it from an unknown app, and the task never enters the queue. // // Takes any type of body and a specified content type. // @@ -1567,7 +2370,7 @@ type ClientInterface interface { // StartAsyncTask Start a new async task // - // Starts a new async task on `appId`, routing the request body payload to an available worker. The task runs asynchronously and the response is `202`; poll `GET /v1/apps/{appId}/tasks/{taskId}` for completion. Apps in `initializing`, `active`, or `stopping` accept invocation. `stopped`, `deleting`, and `failed` return `409 Conflict`; unknown or deleted apps return `404 Not Found`. + // Starts a new async task on `appId`, routing the request body payload to an available worker. The task runs asynchronously and the response is `202`; poll `GET /v1/apps/{appId}/tasks/{taskId}` for completion. Resubmitting a task id is answered with the task it already names rather than starting a second one, so the `202` can carry a task that has already finished: read its `status` instead of assuming `pending`, and note it may name a different `appId`. Apps in `initializing`, `active`, or `stopping` accept invocation. `stopped`, `deleting`, and `failed` return `409 Conflict`; unknown or deleted apps return `404 Not Found`. Endpoint membership is checked against the active version's endpoint set before the task is accepted: an endpoint the app does not declare returns `404` whose `endpointPath` extension member carries the rejected path, distinguishing it from an unknown app, and the task never enters the queue. // // Takes a body of the `application/json` content type. // @@ -1576,7 +2379,7 @@ type ClientInterface interface { // StartSyncTaskWithBody Start a new sync task // - // Starts a new sync task on `appId`, routing the request body payload to an available worker. The request blocks until the task is terminal and returns the result inline (`200`), or `504` if it does not complete within the wait window. When the accepted task ID is available, the response includes `taskId` for polling. Apps in `initializing`, `active`, or `stopping` accept invocation. `stopped`, `deleting`, and `failed` return `409 Conflict`; unknown or deleted apps return `404 Not Found`. + // Starts a new sync task on `appId`, routing the request body payload to an available worker. The request blocks until the task is terminal and returns the result inline (`200`). Resubmitting a task id waits on the task it already names rather than starting a second one, so the `200` carries that task's result and may name a different `appId` — poll it under the one returned. A task that outlives the wait window is **not** a failure: the task is still queued or running, and the response is `202` carrying that task with `status: pending` — the same shape `invoke-async` returns, and it names the owning `appId` on a resubmission just as the `200` does. Poll `GET /v1/apps/{appId}/tasks/{taskId}` for its result. A request the platform cannot attribute to an accepted task fails instead, with no task to poll. Apps in `initializing`, `active`, or `stopping` accept invocation. `stopped`, `deleting`, and `failed` return `409 Conflict`; unknown or deleted apps return `404 Not Found`. Endpoint membership is checked against the active version's endpoint set before the task is accepted: an endpoint the app does not declare returns `404` whose `endpointPath` extension member carries the rejected path, distinguishing it from an unknown app, and the task never enters the queue. // // Takes any type of body and a specified content type. // @@ -1585,7 +2388,7 @@ type ClientInterface interface { // StartSyncTask Start a new sync task // - // Starts a new sync task on `appId`, routing the request body payload to an available worker. The request blocks until the task is terminal and returns the result inline (`200`), or `504` if it does not complete within the wait window. When the accepted task ID is available, the response includes `taskId` for polling. Apps in `initializing`, `active`, or `stopping` accept invocation. `stopped`, `deleting`, and `failed` return `409 Conflict`; unknown or deleted apps return `404 Not Found`. + // Starts a new sync task on `appId`, routing the request body payload to an available worker. The request blocks until the task is terminal and returns the result inline (`200`). Resubmitting a task id waits on the task it already names rather than starting a second one, so the `200` carries that task's result and may name a different `appId` — poll it under the one returned. A task that outlives the wait window is **not** a failure: the task is still queued or running, and the response is `202` carrying that task with `status: pending` — the same shape `invoke-async` returns, and it names the owning `appId` on a resubmission just as the `200` does. Poll `GET /v1/apps/{appId}/tasks/{taskId}` for its result. A request the platform cannot attribute to an accepted task fails instead, with no task to poll. Apps in `initializing`, `active`, or `stopping` accept invocation. `stopped`, `deleting`, and `failed` return `409 Conflict`; unknown or deleted apps return `404 Not Found`. Endpoint membership is checked against the active version's endpoint set before the task is accepted: an endpoint the app does not declare returns `404` whose `endpointPath` extension member carries the rejected path, distinguishing it from an unknown app, and the task never enters the queue. // // Takes a body of the `application/json` content type. // @@ -1606,8 +2409,8 @@ type ClientInterface interface { // AttachAppSecretWithBody Attach a secret to an app // - // Records that an organisation secret is attached to an app under a resolved env-var name. This is a control-plane association only in this release — it does not roll workers or inject values into pods yet (ADR-019 in-pod unseal is separate). Returns `409` if the secret is already attached, or if another attach would use the same env-var name. - // The resolved name (`envVarName`, or `secretName` when omitted) must not already exist as a plain environment variable on this app (`deployment_configs.key`). Both sources are reserved for the same future pod env namespace, so the server rejects the collision with `422` instead of allowing a last-wins override later. The reverse check applies when setting a plain environment variable. + // Records that an organisation secret is attached to an app under a resolved env-var name. The next rollout injects the value into the worker. This operation does not roll workers. Returns `409` if the secret is already attached, or if another attach would use the same env-var name. + // The resolved name (`envVarName`, or `secretName` when omitted) must not already exist as a plain environment variable on this app (`deployment_configs.key`). Both sources use the same pod env namespace, so the server rejects the collision with `422` instead of allowing a last-wins override later. The reverse check applies when setting a plain environment variable. // An app holds at most 100 environment bindings in total — plain environment variables plus attached secrets — the same combined ceiling as create and the single-key env-var route. Attaching when the app is already at that limit returns `422`. // // Takes any type of body and a specified content type. @@ -1617,8 +2420,8 @@ type ClientInterface interface { // AttachAppSecret Attach a secret to an app // - // Records that an organisation secret is attached to an app under a resolved env-var name. This is a control-plane association only in this release — it does not roll workers or inject values into pods yet (ADR-019 in-pod unseal is separate). Returns `409` if the secret is already attached, or if another attach would use the same env-var name. - // The resolved name (`envVarName`, or `secretName` when omitted) must not already exist as a plain environment variable on this app (`deployment_configs.key`). Both sources are reserved for the same future pod env namespace, so the server rejects the collision with `422` instead of allowing a last-wins override later. The reverse check applies when setting a plain environment variable. + // Records that an organisation secret is attached to an app under a resolved env-var name. The next rollout injects the value into the worker. This operation does not roll workers. Returns `409` if the secret is already attached, or if another attach would use the same env-var name. + // The resolved name (`envVarName`, or `secretName` when omitted) must not already exist as a plain environment variable on this app (`deployment_configs.key`). Both sources use the same pod env namespace, so the server rejects the collision with `422` instead of allowing a last-wins override later. The reverse check applies when setting a plain environment variable. // An app holds at most 100 environment bindings in total — plain environment variables plus attached secrets — the same combined ceiling as create and the single-key env-var route. Attaching when the app is already at that limit returns `422`. // // Takes a body of the `application/json` content type. @@ -1628,11 +2431,50 @@ type ClientInterface interface { // DetachAppSecret Detach a secret from an app // - // Removes the control-plane attachment. Does not roll workers in this release. + // Removes the attachment from the next rollout. This operation does not roll workers. Existing workers keep the value until they stop. // // Corresponds with DELETE /v1/apps/{appId}/secrets/{secretName} (the `DetachAppSecret` operationId). DetachAppSecret(ctx context.Context, appId AppId, secretName SecretName, reqEditors ...RequestEditorFn) (*http.Response, error) + // CreateSourceUploadWithBody Create a source upload + // + // Creates an upload session for source intended for `appId`. The app does not need to exist yet. The response contains a short-lived transfer instruction for one exact staging object. Repeating the request with the same idempotency key and declaration while the session is pending and unexpired returns the same upload resource with a refreshed transfer instruction. Replays with a different declaration or after the session becomes ready, rejected, consumed, expired, or deleted return `409`. + // + // Takes any type of body and a specified content type. + // + // Corresponds with POST /v1/apps/{appId}/source-uploads (the `CreateSourceUpload` operationId). + CreateSourceUploadWithBody(ctx context.Context, appId AppId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + // CreateSourceUpload Create a source upload + // + // Creates an upload session for source intended for `appId`. The app does not need to exist yet. The response contains a short-lived transfer instruction for one exact staging object. Repeating the request with the same idempotency key and declaration while the session is pending and unexpired returns the same upload resource with a refreshed transfer instruction. Replays with a different declaration or after the session becomes ready, rejected, consumed, expired, or deleted return `409`. + // + // Takes a body of the `application/json` content type. + // + // Corresponds with POST /v1/apps/{appId}/source-uploads (the `CreateSourceUpload` operationId). + CreateSourceUpload(ctx context.Context, appId AppId, body CreateSourceUploadJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeleteSourceUpload Abort a source upload + // + // Aborts an unconsumed upload and removes its staging object. The session remains as a deleted tombstone so its object key cannot be reused. Repeating a successful abort is idempotent. + // + // Corresponds with DELETE /v1/apps/{appId}/source-uploads/{uploadId} (the `DeleteSourceUpload` operationId). + DeleteSourceUpload(ctx context.Context, appId AppId, uploadId SourceUploadId, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetSourceUpload Get a source upload + // + // Returns the upload session belonging to the authenticated organization and `appId`. An upload belonging to another organization or app returns `404`. + // + // Corresponds with GET /v1/apps/{appId}/source-uploads/{uploadId} (the `GetSourceUpload` operationId). + GetSourceUpload(ctx context.Context, appId AppId, uploadId SourceUploadId, reqEditors ...RequestEditorFn) (*http.Response, error) + + // CompleteSourceUpload Complete a source upload + // + // Verifies the staging object's length, content type, and SHA-256 digest against the session declaration. A successful retry returns the existing ready resource. A rejected upload keeps its rejection so later retries return the same result. + // + // Corresponds with POST /v1/apps/{appId}/source-uploads/{uploadId}/complete (the `CompleteSourceUpload` operationId). + CompleteSourceUpload(ctx context.Context, appId AppId, uploadId SourceUploadId, reqEditors ...RequestEditorFn) (*http.Response, error) + // StopApp Stop an app // // Moves the app to `stopping` and returns `202` once that intent is persisted. Scale-to-zero and worker drain are performed asynchronously by the Scaler; `status` becomes `stopped` once all workers drain. In-flight tasks have a fixed, platform-managed grace period to complete; workers that exceed it are force-terminated and their tasks return to the queue per delivery guarantees. New task submissions remain accepted while `stopping`; after the app reaches `stopped`, submissions return `409 Conflict`. Precondition: `status = active`. @@ -1642,7 +2484,7 @@ type ClientInterface interface { // ListTasks List tasks for an app // - // Lists TTL-bounded asynchronous task metadata for this app so a client can recover task ids after an interrupted long-poll or CLI session. Pending includes queued, running and retrying work. Tasks appear only within the configured recovery window. A page can be empty and still have `nextCursor`; continue until it is null. Pending entries are best effort and may disappear if the recovery store restarts; tracked tasks reappear on completion. This is not persisted task history. Each submission has a new task id, so client retries can appear as separate tasks. If the app is `stopped`, `deleting`, or `failed`, recovery stays available. Unknown or deleted apps return `404 Not Found`. + // Lists TTL-bounded asynchronous task metadata for this app so a client can recover task ids after an interrupted long-poll or CLI session. Pending includes queued, running and retrying work. Tasks appear only within the configured recovery window. A page can be empty and still have `nextCursor`; continue until it is null. Pending entries are best effort and may disappear if the recovery store restarts; tracked tasks reappear on completion. This is not persisted task history. A task id names one task, so resubmitting one does not add a second entry here. If the app is `stopped`, `deleting`, or `failed`, recovery stays available. Unknown or deleted apps return `404 Not Found`. // // Corresponds with GET /v1/apps/{appId}/tasks (the `ListTasks` operationId). ListTasks(ctx context.Context, appId AppId, params *ListTasksParams, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -1652,13 +2494,20 @@ type ClientInterface interface { // Returns the task's current status, read through the inference transport layer from the shared result store. When `completed`, includes the result `output` and `completedAt`; when `failed`, includes `error`; when `pending`, neither is set. If the app is `stopped`, `deleting`, or `failed`, accepted task results stay readable. A `404 Not Found` means the task cannot currently be verified for this app. Because enqueue-time ownership tracking is best effort, a recently returned task ID can temporarily return `404`; retry it within the normal polling window. Unknown or deleted apps also return `404 Not Found`. // // Corresponds with GET /v1/apps/{appId}/tasks/{taskId} (the `GetTask` operationId). - GetTask(ctx context.Context, appId AppId, taskId string, reqEditors ...RequestEditorFn) (*http.Response, error) + GetTask(ctx context.Context, appId AppId, taskId TaskId, reqEditors ...RequestEditorFn) (*http.Response, error) // ListVersions List versions // // Corresponds with GET /v1/apps/{appId}/versions (the `ListVersions` operationId). ListVersions(ctx context.Context, appId AppId, params *ListVersionsParams, reqEditors ...RequestEditorFn) (*http.Response, error) + // DeleteVersion Delete a version + // + // Deletes an unused version while retaining its immutable history. Deleted versions are omitted from version lists, return `404` from version reads, and cannot be deployed. Returns `409` while the app is deleting, or when the version is active, is the app's only remaining version, has a non-stopped worker, or is targeted by a live rollout. Deleting an already deleted version returns `404`. This operation does not remove the version's OCI image. + // + // Corresponds with DELETE /v1/apps/{appId}/versions/{versionNumber} (the `DeleteVersion` operationId). + DeleteVersion(ctx context.Context, appId AppId, versionNumber int32, reqEditors ...RequestEditorFn) (*http.Response, error) + // GetVersion Get a version // // Corresponds with GET /v1/apps/{appId}/versions/{versionNumber} (the `GetVersion` operationId). @@ -1666,7 +2515,7 @@ type ClientInterface interface { // ListWorkers List workers // - // Returns a newest-first page of workers observed for the app (including terminal `stopped` rows until purged). Optional `status` narrows the page; a cursor must be replayed under the same status filter it was issued with. + // Returns a newest-first page of workers observed for the app (including terminal `stopped` rows until purged). Optional `state` and `status` narrow the page; a cursor must be replayed under the same filters it was issued with. // // Corresponds with GET /v1/apps/{appId}/workers (the `ListWorkers` operationId). ListWorkers(ctx context.Context, appId AppId, params *ListWorkersParams, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -1785,6 +2634,65 @@ type ClientInterface interface { // Corresponds with PATCH /v1/gpu-types/{gpuTypeId}/prices/{priceId} (the `UpdateGpuTypePrice` operationId). UpdateGpuTypePrice(ctx context.Context, gpuTypeId GpuTypeId, priceId openapi_types.UUID, body UpdateGpuTypePriceJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // GetLogEntries Read one page of a named log query + // + // Returns one page of log entries, newest first, with an opaque cursor for the next page when one exists. + // + // No query is registered yet: live tail, retention tiers and log quotas are decided in a follow-up ADR, so every request currently answers `404`. The route exists so the contract is fixed before the templates land. + // + // Corresponds with GET /v1/logs/queries/{queryId}/entries (the `GetLogEntries` operationId). + GetLogEntries(ctx context.Context, queryId QueryId, params *GetLogEntriesParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ListInsightsQueries List the metric and log queries this build can answer + // + // The catalogue: every named query, its unit and aggregation, the selectors it accepts, the series it returns, and the windows actually backed by stored series. + // + // This is the source of query ids. Clients discover ids here rather than carrying a list of their own, and render window tabs from `windows` rather than from the full ladder, so a window whose storage tier has no backing series stays invisible instead of rendering a tab with nothing behind it. + // + // Corresponds with GET /v1/metrics/queries (the `ListInsightsQueries` operationId). + ListInsightsQueries(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetMetricSeries Read one named metric query + // + // Returns one chart's data: a single timestamp axis shared by every series, and one dense value array per series aligned to it. + // + // Values are dense and positionally aligned to `t`, with an explicit `null` wherever there was no sample. Each timestamp is the END of its bucket, so `window.to` is inclusive and equals the last timestamp in `t`, while `window.from` is exclusive and is one `step_s` before the first. + // + // An organization with no metrics yet is answered with the full axis and all-null series rather than an error. + // + // `apps_request_volume` returns one series per app: 24 hourly request counts over `window=24h` (`step_s` 3600, unit `requests`). Repeat `appId` once per id on the current list page to pad idle apps with all-null series, in request order. Hours that started before that live app's `createdAt` are null, so a reused app id does not inherit the previous generation's traffic still in the 24h store. The same `appId` pad applies to the list-scoped `apps_error_volume` and `apps_request_duration` queries. Other queries reject `appId`. Other windows are not available for these queries. + // + // `endpoints_request_volume` is the endpoints-list counterpart: 24 hourly request counts per endpoint over `window=24h` (`step_s` 3600, unit `requests`). It requires `deployment` (the public app id, rewritten to the live deployment UUID). Repeat `endpointId` once per id on the current `listEndpoints` page to pad idle endpoints with all-null series, in request order. Hours that started before that endpoint row's `createdAt` are null, so a removed-then-readded path does not inherit the previous row's traffic. Other queries reject `endpointId`. Other windows are not available for this query. + // + // Corresponds with GET /v1/metrics/queries/{queryId}/series (the `GetMetricSeries` operationId). + GetMetricSeries(ctx context.Context, queryId QueryId, params *GetMetricSeriesParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // UpsertOrgTenancyWithBody Set an organisation's serverless tenancy state + // + // Idempotent upsert for one customer organisation. The customer UUID is in the body — public paths never carry an organisation identifier (the authenticated API key names the *caller*, which for this route must be the Runware platform organisation). + // + // `state: active` runs Ensure: a Cloud KMS CryptoKey named after the organisation UUID, a Kubernetes service account `org-` in the shared app namespace, and a decrypt IAM binding on that key for the KSA principal. `state: disabled` runs teardown: disable the key's primary version, drop the decrypt binding, delete the KSA. The key itself is not destroyed — a destroyed key makes every ciphertext under it permanently unreadable. The local row stays as a tombstone so a later Ensure converges on the same names. + // + // A retry after a partial failure converges rather than duplicating objects. `200` returns the resulting receipt. `503` when Cloud KMS key-admin is rate-limited (60 writes/min) or otherwise unavailable; the caller (admin-api Messenger) retries the same PUT. + // + // Takes any type of body and a specified content type. + // + // Corresponds with PUT /v1/org-tenancies (the `UpsertOrgTenancy` operationId). + UpsertOrgTenancyWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + // UpsertOrgTenancy Set an organisation's serverless tenancy state + // + // Idempotent upsert for one customer organisation. The customer UUID is in the body — public paths never carry an organisation identifier (the authenticated API key names the *caller*, which for this route must be the Runware platform organisation). + // + // `state: active` runs Ensure: a Cloud KMS CryptoKey named after the organisation UUID, a Kubernetes service account `org-` in the shared app namespace, and a decrypt IAM binding on that key for the KSA principal. `state: disabled` runs teardown: disable the key's primary version, drop the decrypt binding, delete the KSA. The key itself is not destroyed — a destroyed key makes every ciphertext under it permanently unreadable. The local row stays as a tombstone so a later Ensure converges on the same names. + // + // A retry after a partial failure converges rather than duplicating objects. `200` returns the resulting receipt. `503` when Cloud KMS key-admin is rate-limited (60 writes/min) or otherwise unavailable; the caller (admin-api Messenger) retries the same PUT. + // + // Takes a body of the `application/json` content type. + // + // Corresponds with PUT /v1/org-tenancies (the `UpsertOrgTenancy` operationId). + UpsertOrgTenancy(ctx context.Context, body UpsertOrgTenancyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // ListSecrets List secrets // // Returns secret metadata only; encrypted values are never returned. @@ -1794,7 +2702,7 @@ type ClientInterface interface { // CreateSecretWithBody Create a secret // - // Creates an organisation-scoped secret. Returns `409` if the name is already in use — including when a secret of that name is `pending_destroy`. List only shows active secrets, so a name can appear free while create still conflicts for as long as that row remains. Hard deletion of `pending_destroy` rows (which would release the name) is not performed by this API yet. Recreate-while-deleting may later reuse the pending row with the new value (same name, new ciphertext). + // Creates an organisation-scoped secret. Returns `409` if the name is already in use — including when a secret of that name is `pending_destroy`. List only shows active secrets, so a name can appear free while create still conflicts for as long as that row remains. A `pending_destroy` row is removed, and its name released, by a background sweep once no running worker can still hold the value — there is no deadline on that wait, so a continuously busy app can hold a name for as long as it runs. Recreate-while-deleting may later reuse the pending row with the new value (same name, new ciphertext). // // Takes any type of body and a specified content type. // @@ -1803,7 +2711,7 @@ type ClientInterface interface { // CreateSecret Create a secret // - // Creates an organisation-scoped secret. Returns `409` if the name is already in use — including when a secret of that name is `pending_destroy`. List only shows active secrets, so a name can appear free while create still conflicts for as long as that row remains. Hard deletion of `pending_destroy` rows (which would release the name) is not performed by this API yet. Recreate-while-deleting may later reuse the pending row with the new value (same name, new ciphertext). + // Creates an organisation-scoped secret. Returns `409` if the name is already in use — including when a secret of that name is `pending_destroy`. List only shows active secrets, so a name can appear free while create still conflicts for as long as that row remains. A `pending_destroy` row is removed, and its name released, by a background sweep once no running worker can still hold the value — there is no deadline on that wait, so a continuously busy app can hold a name for as long as it runs. Recreate-while-deleting may later reuse the pending row with the new value (same name, new ciphertext). // // Takes a body of the `application/json` content type. // @@ -1812,7 +2720,7 @@ type ClientInterface interface { // DeleteSecret Delete a secret // - // Soft-deletes a secret: marks the row `pending_destroy` and bumps revision. This API does not hard-delete the row; a future GC path is expected to remove unattached `pending_destroy` secrets and release the name, but that sweep is not implemented yet. Returns `409` while any app still attaches it — cascade-detach is not performed here; detach each holder with `DELETE .../apps/{id}/secrets/{name}` first. Attach/detach are control-plane records only in this release (they do not roll workers). While the row remains `pending_destroy` the name stays reserved, so create may return `409` even though list no longer shows the secret. Retries on an already-pending name are safe when no attachments remain (`204`); they still return `409` while attached. + // Soft-deletes a secret: marks the row `pending_destroy` and bumps revision. This API does not hard-delete the row. A background sweep removes the row and releases the name once no running worker can still hold the value — the value travels inside the worker's own environment, which is fixed when the container starts, so a worker keeps it until it stops. There is no deadline on that wait. Returns `409` while any app still attaches it — cascade-detach is not performed here; detach each holder with `DELETE .../apps/{id}/secrets/{name}` first. Attach and detach change the secret set for the next rollout. Neither operation rolls workers. While the row remains `pending_destroy` the name stays reserved, so create may return `409` even though list no longer shows the secret. Retries on an already-pending name are safe when no attachments remain (`204`); they still return `409` while attached. // // Corresponds with DELETE /v1/secrets/{secretName} (the `DeleteSecret` operationId). DeleteSecret(ctx context.Context, secretName SecretName, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -1841,7 +2749,7 @@ type ClientInterface interface { // GetAppSummary App summary metrics for the authenticated organisation // -// Aggregate dashboard metrics across all apps owned by the authenticated organisation. Metrics whose backing system is not yet available are omitted from the response rather than reported as zero. +// Aggregate dashboard metrics across all apps owned by the authenticated organisation. App and worker tallies are always present. Request and error-rate totals come from the metrics store and are omitted when that hop cannot answer rather than reported as zero. Spend is omitted until billing rollups exist. // // Corresponds with GET /v1/app-summary (the `GetAppSummary` operationId). func (c *Client) GetAppSummary(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { @@ -1858,7 +2766,7 @@ func (c *Client) GetAppSummary(ctx context.Context, reqEditors ...RequestEditorF // ListApps List apps // -// Returns a page of the organisation's apps. Filters combine with AND; soft-deleted apps are excluded unless `status=deleted` is requested explicitly. +// Returns a page of the organisation's apps. Filters combine with AND; soft-deleted apps are excluded unless `status=deleted` is requested explicitly. Favourited apps appear before non-favourited apps, with the selected ordering applied within each group. // // A `cursor` is only valid for the `sort` and filters it was issued under — reusing one across a different ordering or filter set returns `400`. // @@ -1884,13 +2792,16 @@ func (c *Client) ListApps(ctx context.Context, params *ListAppsParams, reqEditor // points at that version. If the build, validation, or rollout fails the app is // marked `failed`. // -// - `container` source: no build step, so the version carries no `buildId`. No worker runs -// from a container source yet, so the app stays `initializing` and does not serve -// inference — poll `active` only for a `code` source. +// - `container` source: the submitted zip (wrapper `Dockerfile` + `container.yaml`) +// goes through the same build pipeline — the wrapper image is built, published and +// deployed, so the version carries a `buildId` and the app follows the same +// lifecycle as a code source. An invalid `container.yaml` rejects the create +// before any build capacity is spent — `400` where the document could not be +// parsed at all, `422` where it parsed and broke a rule. // // `activeVersionId` is null until a rollout completes: a version records what should run, and only a finished deploy says what does. // -// `secrets` is accepted by the schema but not yet applied, so supplying it returns `422` rather than silently dropping it. +// `secrets` attaches organisation secrets that already exist. It is the app's initial attachment set, so the first rollout carries their values into the worker. This route does not create a secret — use `POST /v1/secrets` first. A name that is unknown to the organisation, or that is not `active`, returns `404`. A name that collides with a key in `environmentVariables`, a repeated name and a set that goes past the binding limit each return `422`. The whole set is checked before any build capacity is spent. // // Takes any type of body and a specified content type. // @@ -1916,13 +2827,16 @@ func (c *Client) CreateAppWithBody(ctx context.Context, contentType string, body // points at that version. If the build, validation, or rollout fails the app is // marked `failed`. // -// - `container` source: no build step, so the version carries no `buildId`. No worker runs -// from a container source yet, so the app stays `initializing` and does not serve -// inference — poll `active` only for a `code` source. +// - `container` source: the submitted zip (wrapper `Dockerfile` + `container.yaml`) +// goes through the same build pipeline — the wrapper image is built, published and +// deployed, so the version carries a `buildId` and the app follows the same +// lifecycle as a code source. An invalid `container.yaml` rejects the create +// before any build capacity is spent — `400` where the document could not be +// parsed at all, `422` where it parsed and broke a rule. // // `activeVersionId` is null until a rollout completes: a version records what should run, and only a finished deploy says what does. // -// `secrets` is accepted by the schema but not yet applied, so supplying it returns `422` rather than silently dropping it. +// `secrets` attaches organisation secrets that already exist. It is the app's initial attachment set, so the first rollout carries their values into the worker. This route does not create a secret — use `POST /v1/secrets` first. A name that is unknown to the organisation, or that is not `active`, returns `404`. A name that collides with a key in `environmentVariables`, a repeated name and a set that goes past the binding limit each return `422`. The whole set is checked before any build capacity is spent. // // Takes a body of the `application/json` content type. // @@ -1943,6 +2857,8 @@ func (c *Client) CreateApp(ctx context.Context, body CreateAppJSONRequestBody, r // // Soft delete. Sets `status = deleting` and returns `202` once that intent is persisted. Router removal, cancelling in-progress builds, and worker drain (`draining → stopping → stopped`) are performed asynchronously by the deployer/Scaler; `status` becomes `deleted` once all workers stop. All rows are retained for billing finalisation, audit, and usage history. Idempotent if the app is already `deleting`. // +// The `appId` is released once `status` reaches `deleted`, and not before: while the app is `deleting` its workload is still being torn down and the name stays taken. A new app created under a released name is a new app and inherits nothing — no version, no build, no event history, and no workers. +// // Corresponds with DELETE /v1/apps/{appId} (the `DeleteApp` operationId). func (c *Client) DeleteApp(ctx context.Context, appId AppId, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewDeleteAppRequest(c.Server, appId) @@ -1958,6 +2874,8 @@ func (c *Client) DeleteApp(ctx context.Context, appId AppId, reqEditors ...Reque // GetApp Get an app // +// Returns the app the authenticated organisation owns under this `appId`. An unknown app and a soft-deleted one both return `404 Not Found`: a deleted app is gone to its owner, and its rows are retained only for billing and audit. To read deleted apps, list them with `status=deleted`. +// // Corresponds with GET /v1/apps/{appId} (the `GetApp` operationId). func (c *Client) GetApp(ctx context.Context, appId AppId, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetAppRequest(c.Server, appId) @@ -1974,22 +2892,11 @@ func (c *Client) GetApp(ctx context.Context, appId AppId, reqEditors ...RequestE // UpdateAppWithBody Update an app // // Patches one or more aspects of an app in place. All fields are optional; omitted fields are left unchanged. Valid in any non-`deleted` status, including `stopped` (changes apply on `resume`). Lifecycle transitions use the dedicated `deploy`, `stop`, `resume`, and `delete` operations. -// -// **Currently persisted:** `appName` and `configuration` only. Supplying `appSource`, `secrets`, `environmentVariables`, or `endpoints` returns `422` (bulk env-var replace is not wired — use the dedicated `/environment-variables` endpoints for individual keys). -// -// Target behaviour (once fully wired): -// - `configuration`: applied on the next Scaler cycle; triggers a rollout so workers -// restart with the new configuration. If the rollout fails, the app remains on -// the previous configuration. -// -// - `appSource`: triggers a build (for `code` sources) or image validation (for `container` -// sources); on success the new version is deployed automatically. If the build or -// validation fails, the app remains on the previous version. -// -// - `secrets` / `environmentVariables` / `endpoints`: the supplied array **replaces** the -// current set — any item absent from the request is deleted. Endpoints take effect -// immediately. Changes to secrets or environment variables trigger a rollout so workers -// restart and pick up the new values. +// A configuration or `environmentVariables` change records a new version with the same image. If that image is deployable, the update pins it as `activeVersionId` and rolls the workload when the app is `active` or `initializing`. A `failed` app is moved to `initializing` and rolled, the same as `POST /deploy`. If the image is not deployable, the version is recorded and `activeVersionId` is left unchanged. If the roll fails, `activeVersionId` is restored and the previous configuration keeps serving. A name-only change records a version and does not pin. A `stopped` or `stopping` app pins the version and rolls it on `resume`. A configuration, `environmentVariables`, or `appSource` change while a create or resume rollout is already in progress returns `409 Conflict`. A name-only or `secrets`-only change does not. +// `appSource` starts a build and records version N+1 with a new image tag. The deploy queue carries the build-then-deploy tail; `activeVersionId` moves only when that rollout completes. A builder rejection (400 where a container document's parser refused it, 422 where it parsed and broke a rule) leaves the app on its current version and writes no version row and no build row. After the builder accepts, version N+1 is recorded even if a concurrent secret deactivation or env/secret collision prevents this request's env/secrets overlay; in that case the previous environmentVariables and attachment set stay in place and are what the new version snapshots. +// `environmentVariables` replaces the whole set: a key absent from the map is deleted, and a null value omits that key from the new set. The resolved map is snapshotted onto the new version. +// `secrets` replaces the whole attachment set. An attachment absent from the array is detached. Injected names must not collide with a plain environment variable on the app; the combined set of plain variables and attachments is capped at 100. This is a control-plane record only — secret values do not reach a pod, and the version snapshot carries no secrets — so a secrets-only change does not roll the workload. +// Endpoints are not a field of this contract: the set belongs to the app source, so it changes only when a new version with a new source builds and deploys. // // Takes any type of body and a specified content type. // @@ -2009,23 +2916,11 @@ func (c *Client) UpdateAppWithBody(ctx context.Context, appId AppId, contentType // UpdateApp Update an app // // Patches one or more aspects of an app in place. All fields are optional; omitted fields are left unchanged. Valid in any non-`deleted` status, including `stopped` (changes apply on `resume`). Lifecycle transitions use the dedicated `deploy`, `stop`, `resume`, and `delete` operations. -// -// **Currently persisted:** `appName` and `configuration` only. Supplying `appSource`, `secrets`, `environmentVariables`, or `endpoints` returns `422` (bulk env-var replace is not wired — use the dedicated `/environment-variables` endpoints for individual keys). -// -// Target behaviour (once fully wired): -// -// - `configuration`: applied on the next Scaler cycle; triggers a rollout so workers -// restart with the new configuration. If the rollout fails, the app remains on -// the previous configuration. -// -// - `appSource`: triggers a build (for `code` sources) or image validation (for `container` -// sources); on success the new version is deployed automatically. If the build or -// validation fails, the app remains on the previous version. -// -// - `secrets` / `environmentVariables` / `endpoints`: the supplied array **replaces** the -// current set — any item absent from the request is deleted. Endpoints take effect -// immediately. Changes to secrets or environment variables trigger a rollout so workers -// restart and pick up the new values. +// A configuration or `environmentVariables` change records a new version with the same image. If that image is deployable, the update pins it as `activeVersionId` and rolls the workload when the app is `active` or `initializing`. A `failed` app is moved to `initializing` and rolled, the same as `POST /deploy`. If the image is not deployable, the version is recorded and `activeVersionId` is left unchanged. If the roll fails, `activeVersionId` is restored and the previous configuration keeps serving. A name-only change records a version and does not pin. A `stopped` or `stopping` app pins the version and rolls it on `resume`. A configuration, `environmentVariables`, or `appSource` change while a create or resume rollout is already in progress returns `409 Conflict`. A name-only or `secrets`-only change does not. +// `appSource` starts a build and records version N+1 with a new image tag. The deploy queue carries the build-then-deploy tail; `activeVersionId` moves only when that rollout completes. A builder rejection (400 where a container document's parser refused it, 422 where it parsed and broke a rule) leaves the app on its current version and writes no version row and no build row. After the builder accepts, version N+1 is recorded even if a concurrent secret deactivation or env/secret collision prevents this request's env/secrets overlay; in that case the previous environmentVariables and attachment set stay in place and are what the new version snapshots. +// `environmentVariables` replaces the whole set: a key absent from the map is deleted, and a null value omits that key from the new set. The resolved map is snapshotted onto the new version. +// `secrets` replaces the whole attachment set. An attachment absent from the array is detached. Injected names must not collide with a plain environment variable on the app; the combined set of plain variables and attachments is capped at 100. This is a control-plane record only — secret values do not reach a pod, and the version snapshot carries no secrets — so a secrets-only change does not roll the workload. +// Endpoints are not a field of this contract: the set belongs to the app source, so it changes only when a new version with a new source builds and deploys. // // Takes a body of the `application/json` content type. // @@ -2057,6 +2952,23 @@ func (c *Client) ListBuilds(ctx context.Context, appId AppId, params *ListBuilds return c.Client.Do(req) } +// DeleteBuild Delete or cancel a build +// +// Cancels a queued or running build and records it as `superseded`. Deleting a queued or running build ends its current rollout without activating the cancelled build, so any previous version keeps serving. A terminal build can be deleted once no live rollout still needs it. Ready builds remain while a version references them. +// +// Corresponds with DELETE /v1/apps/{appId}/builds/{buildId} (the `DeleteBuild` operationId). +func (c *Client) DeleteBuild(ctx context.Context, appId AppId, buildId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteBuildRequest(c.Server, appId, buildId) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + // GetBuild Get a build // // Corresponds with GET /v1/apps/{appId}/builds/{buildId} (the `GetBuild` operationId). @@ -2074,12 +2986,12 @@ func (c *Client) GetBuild(ctx context.Context, appId AppId, buildId openapi_type // DeployVersionWithBody Deploy a version // -// Activates a `ready` version by number, setting `activeVersionId` and returning `202` once that intent is persisted. Worker rollout, routing switch, and cancelling in-progress builds (`failed` with `error: "superseded"`) are performed asynchronously by the deployer/Scaler. Permitted in any addressable status, including `initializing` and `failed`. +// Activates a `ready` version by number, setting `activeVersionId` and returning `202` once that intent is persisted. Worker rollout, routing switch, and cancelling in-progress builds (`superseded`) are performed asynchronously by the deployer/Scaler. Permitted in any addressable status, including `initializing` and `failed`. // To roll back, supply an older `versionNumber` — the operation is identical to a forward deploy. No new version is created and no rebuild happens: the version's existing image is re-applied. Re-deploying the currently active version is permitted and re-applies it. // A deploy to a `stopped` or `stopping` app records the version and rolls no workload, because no workers are running: the `202` does not imply a rollout there. The recorded version is the one applied when the app resumes. // If the roll of a live app fails, `activeVersionId` is restored to the version that kept serving, so the field keeps naming the running image. // **Rollout** (deployer/Scaler): the platform starts workers on the target version, waits for at least one to become healthy, switches task routing to the new version, then drains old-version workers gracefully. Old workers are given a fixed, platform-managed grace period to finish in-flight tasks before being force-terminated. If new workers fail to become healthy, old workers are not drained and the app continues on the previous version. -// Errors: - Deploy to a `deleting` app returns `409 Conflict` - `versionNumber` not found or not `ready` returns `409 Conflict` - A `container`-source version returns `409 Conflict` until container apps are supported - Deploy to a non-existent or `deleted` app returns `404 Not Found` +// Errors: - Deploy to a `deleting` app returns `409 Conflict` - `versionNumber` not found or not `ready` returns `409 Conflict` - Deploy to a non-existent or `deleted` app returns `404 Not Found` // // Takes any type of body and a specified content type. // @@ -2098,12 +3010,12 @@ func (c *Client) DeployVersionWithBody(ctx context.Context, appId AppId, content // DeployVersion Deploy a version // -// Activates a `ready` version by number, setting `activeVersionId` and returning `202` once that intent is persisted. Worker rollout, routing switch, and cancelling in-progress builds (`failed` with `error: "superseded"`) are performed asynchronously by the deployer/Scaler. Permitted in any addressable status, including `initializing` and `failed`. +// Activates a `ready` version by number, setting `activeVersionId` and returning `202` once that intent is persisted. Worker rollout, routing switch, and cancelling in-progress builds (`superseded`) are performed asynchronously by the deployer/Scaler. Permitted in any addressable status, including `initializing` and `failed`. // To roll back, supply an older `versionNumber` — the operation is identical to a forward deploy. No new version is created and no rebuild happens: the version's existing image is re-applied. Re-deploying the currently active version is permitted and re-applies it. // A deploy to a `stopped` or `stopping` app records the version and rolls no workload, because no workers are running: the `202` does not imply a rollout there. The recorded version is the one applied when the app resumes. // If the roll of a live app fails, `activeVersionId` is restored to the version that kept serving, so the field keeps naming the running image. // **Rollout** (deployer/Scaler): the platform starts workers on the target version, waits for at least one to become healthy, switches task routing to the new version, then drains old-version workers gracefully. Old workers are given a fixed, platform-managed grace period to finish in-flight tasks before being force-terminated. If new workers fail to become healthy, old workers are not drained and the app continues on the previous version. -// Errors: - Deploy to a `deleting` app returns `409 Conflict` - `versionNumber` not found or not `ready` returns `409 Conflict` - A `container`-source version returns `409 Conflict` until container apps are supported - Deploy to a non-existent or `deleted` app returns `404 Not Found` +// Errors: - Deploy to a `deleting` app returns `409 Conflict` - `versionNumber` not found or not `ready` returns `409 Conflict` - Deploy to a non-existent or `deleted` app returns `404 Not Found` // // Takes a body of the `application/json` content type. // @@ -2122,6 +3034,8 @@ func (c *Client) DeployVersion(ctx context.Context, appId AppId, body DeployVers // ListEndpoints List endpoints // +// Lists the endpoints of the app's active version. The set is written by the source itself — a code build's introspection, or a container's config document — and is replaced atomically whenever a version activates, so a deploy of a newer version or a rollback to an older one is immediately reflected here. Empty while the app is `initializing`: nothing is routable until its first build is ready and deployed. +// // Corresponds with GET /v1/apps/{appId}/endpoints (the `ListEndpoints` operationId). func (c *Client) ListEndpoints(ctx context.Context, appId AppId, params *ListEndpointsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewListEndpointsRequest(c.Server, appId, params) @@ -2277,7 +3191,7 @@ func (c *Client) FavouriteApp(ctx context.Context, appId AppId, reqEditors ...Re // StartAsyncTaskWithBody Start a new async task // -// Starts a new async task on `appId`, routing the request body payload to an available worker. The task runs asynchronously and the response is `202`; poll `GET /v1/apps/{appId}/tasks/{taskId}` for completion. Apps in `initializing`, `active`, or `stopping` accept invocation. `stopped`, `deleting`, and `failed` return `409 Conflict`; unknown or deleted apps return `404 Not Found`. +// Starts a new async task on `appId`, routing the request body payload to an available worker. The task runs asynchronously and the response is `202`; poll `GET /v1/apps/{appId}/tasks/{taskId}` for completion. Resubmitting a task id is answered with the task it already names rather than starting a second one, so the `202` can carry a task that has already finished: read its `status` instead of assuming `pending`, and note it may name a different `appId`. Apps in `initializing`, `active`, or `stopping` accept invocation. `stopped`, `deleting`, and `failed` return `409 Conflict`; unknown or deleted apps return `404 Not Found`. Endpoint membership is checked against the active version's endpoint set before the task is accepted: an endpoint the app does not declare returns `404` whose `endpointPath` extension member carries the rejected path, distinguishing it from an unknown app, and the task never enters the queue. // // Takes any type of body and a specified content type. // @@ -2296,7 +3210,7 @@ func (c *Client) StartAsyncTaskWithBody(ctx context.Context, appId AppId, endpoi // StartAsyncTask Start a new async task // -// Starts a new async task on `appId`, routing the request body payload to an available worker. The task runs asynchronously and the response is `202`; poll `GET /v1/apps/{appId}/tasks/{taskId}` for completion. Apps in `initializing`, `active`, or `stopping` accept invocation. `stopped`, `deleting`, and `failed` return `409 Conflict`; unknown or deleted apps return `404 Not Found`. +// Starts a new async task on `appId`, routing the request body payload to an available worker. The task runs asynchronously and the response is `202`; poll `GET /v1/apps/{appId}/tasks/{taskId}` for completion. Resubmitting a task id is answered with the task it already names rather than starting a second one, so the `202` can carry a task that has already finished: read its `status` instead of assuming `pending`, and note it may name a different `appId`. Apps in `initializing`, `active`, or `stopping` accept invocation. `stopped`, `deleting`, and `failed` return `409 Conflict`; unknown or deleted apps return `404 Not Found`. Endpoint membership is checked against the active version's endpoint set before the task is accepted: an endpoint the app does not declare returns `404` whose `endpointPath` extension member carries the rejected path, distinguishing it from an unknown app, and the task never enters the queue. // // Takes a body of the `application/json` content type. // @@ -2315,7 +3229,7 @@ func (c *Client) StartAsyncTask(ctx context.Context, appId AppId, endpointPath E // StartSyncTaskWithBody Start a new sync task // -// Starts a new sync task on `appId`, routing the request body payload to an available worker. The request blocks until the task is terminal and returns the result inline (`200`), or `504` if it does not complete within the wait window. When the accepted task ID is available, the response includes `taskId` for polling. Apps in `initializing`, `active`, or `stopping` accept invocation. `stopped`, `deleting`, and `failed` return `409 Conflict`; unknown or deleted apps return `404 Not Found`. +// Starts a new sync task on `appId`, routing the request body payload to an available worker. The request blocks until the task is terminal and returns the result inline (`200`). Resubmitting a task id waits on the task it already names rather than starting a second one, so the `200` carries that task's result and may name a different `appId` — poll it under the one returned. A task that outlives the wait window is **not** a failure: the task is still queued or running, and the response is `202` carrying that task with `status: pending` — the same shape `invoke-async` returns, and it names the owning `appId` on a resubmission just as the `200` does. Poll `GET /v1/apps/{appId}/tasks/{taskId}` for its result. A request the platform cannot attribute to an accepted task fails instead, with no task to poll. Apps in `initializing`, `active`, or `stopping` accept invocation. `stopped`, `deleting`, and `failed` return `409 Conflict`; unknown or deleted apps return `404 Not Found`. Endpoint membership is checked against the active version's endpoint set before the task is accepted: an endpoint the app does not declare returns `404` whose `endpointPath` extension member carries the rejected path, distinguishing it from an unknown app, and the task never enters the queue. // // Takes any type of body and a specified content type. // @@ -2334,7 +3248,7 @@ func (c *Client) StartSyncTaskWithBody(ctx context.Context, appId AppId, endpoin // StartSyncTask Start a new sync task // -// Starts a new sync task on `appId`, routing the request body payload to an available worker. The request blocks until the task is terminal and returns the result inline (`200`), or `504` if it does not complete within the wait window. When the accepted task ID is available, the response includes `taskId` for polling. Apps in `initializing`, `active`, or `stopping` accept invocation. `stopped`, `deleting`, and `failed` return `409 Conflict`; unknown or deleted apps return `404 Not Found`. +// Starts a new sync task on `appId`, routing the request body payload to an available worker. The request blocks until the task is terminal and returns the result inline (`200`). Resubmitting a task id waits on the task it already names rather than starting a second one, so the `200` carries that task's result and may name a different `appId` — poll it under the one returned. A task that outlives the wait window is **not** a failure: the task is still queued or running, and the response is `202` carrying that task with `status: pending` — the same shape `invoke-async` returns, and it names the owning `appId` on a resubmission just as the `200` does. Poll `GET /v1/apps/{appId}/tasks/{taskId}` for its result. A request the platform cannot attribute to an accepted task fails instead, with no task to poll. Apps in `initializing`, `active`, or `stopping` accept invocation. `stopped`, `deleting`, and `failed` return `409 Conflict`; unknown or deleted apps return `404 Not Found`. Endpoint membership is checked against the active version's endpoint set before the task is accepted: an endpoint the app does not declare returns `404` whose `endpointPath` extension member carries the rejected path, distinguishing it from an unknown app, and the task never enters the queue. // // Takes a body of the `application/json` content type. // @@ -2385,8 +3299,8 @@ func (c *Client) ListAppSecrets(ctx context.Context, appId AppId, params *ListAp // AttachAppSecretWithBody Attach a secret to an app // -// Records that an organisation secret is attached to an app under a resolved env-var name. This is a control-plane association only in this release — it does not roll workers or inject values into pods yet (ADR-019 in-pod unseal is separate). Returns `409` if the secret is already attached, or if another attach would use the same env-var name. -// The resolved name (`envVarName`, or `secretName` when omitted) must not already exist as a plain environment variable on this app (`deployment_configs.key`). Both sources are reserved for the same future pod env namespace, so the server rejects the collision with `422` instead of allowing a last-wins override later. The reverse check applies when setting a plain environment variable. +// Records that an organisation secret is attached to an app under a resolved env-var name. The next rollout injects the value into the worker. This operation does not roll workers. Returns `409` if the secret is already attached, or if another attach would use the same env-var name. +// The resolved name (`envVarName`, or `secretName` when omitted) must not already exist as a plain environment variable on this app (`deployment_configs.key`). Both sources use the same pod env namespace, so the server rejects the collision with `422` instead of allowing a last-wins override later. The reverse check applies when setting a plain environment variable. // An app holds at most 100 environment bindings in total — plain environment variables plus attached secrets — the same combined ceiling as create and the single-key env-var route. Attaching when the app is already at that limit returns `422`. // // Takes any type of body and a specified content type. @@ -2406,8 +3320,8 @@ func (c *Client) AttachAppSecretWithBody(ctx context.Context, appId AppId, conte // AttachAppSecret Attach a secret to an app // -// Records that an organisation secret is attached to an app under a resolved env-var name. This is a control-plane association only in this release — it does not roll workers or inject values into pods yet (ADR-019 in-pod unseal is separate). Returns `409` if the secret is already attached, or if another attach would use the same env-var name. -// The resolved name (`envVarName`, or `secretName` when omitted) must not already exist as a plain environment variable on this app (`deployment_configs.key`). Both sources are reserved for the same future pod env namespace, so the server rejects the collision with `422` instead of allowing a last-wins override later. The reverse check applies when setting a plain environment variable. +// Records that an organisation secret is attached to an app under a resolved env-var name. The next rollout injects the value into the worker. This operation does not roll workers. Returns `409` if the secret is already attached, or if another attach would use the same env-var name. +// The resolved name (`envVarName`, or `secretName` when omitted) must not already exist as a plain environment variable on this app (`deployment_configs.key`). Both sources use the same pod env namespace, so the server rejects the collision with `422` instead of allowing a last-wins override later. The reverse check applies when setting a plain environment variable. // An app holds at most 100 environment bindings in total — plain environment variables plus attached secrets — the same combined ceiling as create and the single-key env-var route. Attaching when the app is already at that limit returns `422`. // // Takes a body of the `application/json` content type. @@ -2427,7 +3341,7 @@ func (c *Client) AttachAppSecret(ctx context.Context, appId AppId, body AttachAp // DetachAppSecret Detach a secret from an app // -// Removes the control-plane attachment. Does not roll workers in this release. +// Removes the attachment from the next rollout. This operation does not roll workers. Existing workers keep the value until they stop. // // Corresponds with DELETE /v1/apps/{appId}/secrets/{secretName} (the `DetachAppSecret` operationId). func (c *Client) DetachAppSecret(ctx context.Context, appId AppId, secretName SecretName, reqEditors ...RequestEditorFn) (*http.Response, error) { @@ -2442,13 +3356,15 @@ func (c *Client) DetachAppSecret(ctx context.Context, appId AppId, secretName Se return c.Client.Do(req) } -// StopApp Stop an app +// CreateSourceUploadWithBody Create a source upload // -// Moves the app to `stopping` and returns `202` once that intent is persisted. Scale-to-zero and worker drain are performed asynchronously by the Scaler; `status` becomes `stopped` once all workers drain. In-flight tasks have a fixed, platform-managed grace period to complete; workers that exceed it are force-terminated and their tasks return to the queue per delivery guarantees. New task submissions remain accepted while `stopping`; after the app reaches `stopped`, submissions return `409 Conflict`. Precondition: `status = active`. +// Creates an upload session for source intended for `appId`. The app does not need to exist yet. The response contains a short-lived transfer instruction for one exact staging object. Repeating the request with the same idempotency key and declaration while the session is pending and unexpired returns the same upload resource with a refreshed transfer instruction. Replays with a different declaration or after the session becomes ready, rejected, consumed, expired, or deleted return `409`. // -// Corresponds with POST /v1/apps/{appId}/stop (the `StopApp` operationId). -func (c *Client) StopApp(ctx context.Context, appId AppId, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewStopAppRequest(c.Server, appId) +// Takes any type of body and a specified content type. +// +// Corresponds with POST /v1/apps/{appId}/source-uploads (the `CreateSourceUpload` operationId). +func (c *Client) CreateSourceUploadWithBody(ctx context.Context, appId AppId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateSourceUploadRequestWithBody(c.Server, appId, contentType, body) if err != nil { return nil, err } @@ -2459,13 +3375,15 @@ func (c *Client) StopApp(ctx context.Context, appId AppId, reqEditors ...Request return c.Client.Do(req) } -// ListTasks List tasks for an app +// CreateSourceUpload Create a source upload // -// Lists TTL-bounded asynchronous task metadata for this app so a client can recover task ids after an interrupted long-poll or CLI session. Pending includes queued, running and retrying work. Tasks appear only within the configured recovery window. A page can be empty and still have `nextCursor`; continue until it is null. Pending entries are best effort and may disappear if the recovery store restarts; tracked tasks reappear on completion. This is not persisted task history. Each submission has a new task id, so client retries can appear as separate tasks. If the app is `stopped`, `deleting`, or `failed`, recovery stays available. Unknown or deleted apps return `404 Not Found`. +// Creates an upload session for source intended for `appId`. The app does not need to exist yet. The response contains a short-lived transfer instruction for one exact staging object. Repeating the request with the same idempotency key and declaration while the session is pending and unexpired returns the same upload resource with a refreshed transfer instruction. Replays with a different declaration or after the session becomes ready, rejected, consumed, expired, or deleted return `409`. // -// Corresponds with GET /v1/apps/{appId}/tasks (the `ListTasks` operationId). -func (c *Client) ListTasks(ctx context.Context, appId AppId, params *ListTasksParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewListTasksRequest(c.Server, appId, params) +// Takes a body of the `application/json` content type. +// +// Corresponds with POST /v1/apps/{appId}/source-uploads (the `CreateSourceUpload` operationId). +func (c *Client) CreateSourceUpload(ctx context.Context, appId AppId, body CreateSourceUploadJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateSourceUploadRequest(c.Server, appId, body) if err != nil { return nil, err } @@ -2476,12 +3394,97 @@ func (c *Client) ListTasks(ctx context.Context, appId AppId, params *ListTasksPa return c.Client.Do(req) } -// GetTask Get a task +// DeleteSourceUpload Abort a source upload // -// Returns the task's current status, read through the inference transport layer from the shared result store. When `completed`, includes the result `output` and `completedAt`; when `failed`, includes `error`; when `pending`, neither is set. If the app is `stopped`, `deleting`, or `failed`, accepted task results stay readable. A `404 Not Found` means the task cannot currently be verified for this app. Because enqueue-time ownership tracking is best effort, a recently returned task ID can temporarily return `404`; retry it within the normal polling window. Unknown or deleted apps also return `404 Not Found`. +// Aborts an unconsumed upload and removes its staging object. The session remains as a deleted tombstone so its object key cannot be reused. Repeating a successful abort is idempotent. +// +// Corresponds with DELETE /v1/apps/{appId}/source-uploads/{uploadId} (the `DeleteSourceUpload` operationId). +func (c *Client) DeleteSourceUpload(ctx context.Context, appId AppId, uploadId SourceUploadId, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteSourceUploadRequest(c.Server, appId, uploadId) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// GetSourceUpload Get a source upload +// +// Returns the upload session belonging to the authenticated organization and `appId`. An upload belonging to another organization or app returns `404`. +// +// Corresponds with GET /v1/apps/{appId}/source-uploads/{uploadId} (the `GetSourceUpload` operationId). +func (c *Client) GetSourceUpload(ctx context.Context, appId AppId, uploadId SourceUploadId, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetSourceUploadRequest(c.Server, appId, uploadId) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// CompleteSourceUpload Complete a source upload +// +// Verifies the staging object's length, content type, and SHA-256 digest against the session declaration. A successful retry returns the existing ready resource. A rejected upload keeps its rejection so later retries return the same result. +// +// Corresponds with POST /v1/apps/{appId}/source-uploads/{uploadId}/complete (the `CompleteSourceUpload` operationId). +func (c *Client) CompleteSourceUpload(ctx context.Context, appId AppId, uploadId SourceUploadId, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCompleteSourceUploadRequest(c.Server, appId, uploadId) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// StopApp Stop an app +// +// Moves the app to `stopping` and returns `202` once that intent is persisted. Scale-to-zero and worker drain are performed asynchronously by the Scaler; `status` becomes `stopped` once all workers drain. In-flight tasks have a fixed, platform-managed grace period to complete; workers that exceed it are force-terminated and their tasks return to the queue per delivery guarantees. New task submissions remain accepted while `stopping`; after the app reaches `stopped`, submissions return `409 Conflict`. Precondition: `status = active`. +// +// Corresponds with POST /v1/apps/{appId}/stop (the `StopApp` operationId). +func (c *Client) StopApp(ctx context.Context, appId AppId, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewStopAppRequest(c.Server, appId) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// ListTasks List tasks for an app +// +// Lists TTL-bounded asynchronous task metadata for this app so a client can recover task ids after an interrupted long-poll or CLI session. Pending includes queued, running and retrying work. Tasks appear only within the configured recovery window. A page can be empty and still have `nextCursor`; continue until it is null. Pending entries are best effort and may disappear if the recovery store restarts; tracked tasks reappear on completion. This is not persisted task history. A task id names one task, so resubmitting one does not add a second entry here. If the app is `stopped`, `deleting`, or `failed`, recovery stays available. Unknown or deleted apps return `404 Not Found`. +// +// Corresponds with GET /v1/apps/{appId}/tasks (the `ListTasks` operationId). +func (c *Client) ListTasks(ctx context.Context, appId AppId, params *ListTasksParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewListTasksRequest(c.Server, appId, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// GetTask Get a task +// +// Returns the task's current status, read through the inference transport layer from the shared result store. When `completed`, includes the result `output` and `completedAt`; when `failed`, includes `error`; when `pending`, neither is set. If the app is `stopped`, `deleting`, or `failed`, accepted task results stay readable. A `404 Not Found` means the task cannot currently be verified for this app. Because enqueue-time ownership tracking is best effort, a recently returned task ID can temporarily return `404`; retry it within the normal polling window. Unknown or deleted apps also return `404 Not Found`. // // Corresponds with GET /v1/apps/{appId}/tasks/{taskId} (the `GetTask` operationId). -func (c *Client) GetTask(ctx context.Context, appId AppId, taskId string, reqEditors ...RequestEditorFn) (*http.Response, error) { +func (c *Client) GetTask(ctx context.Context, appId AppId, taskId TaskId, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetTaskRequest(c.Server, appId, taskId) if err != nil { return nil, err @@ -2508,6 +3511,23 @@ func (c *Client) ListVersions(ctx context.Context, appId AppId, params *ListVers return c.Client.Do(req) } +// DeleteVersion Delete a version +// +// Deletes an unused version while retaining its immutable history. Deleted versions are omitted from version lists, return `404` from version reads, and cannot be deployed. Returns `409` while the app is deleting, or when the version is active, is the app's only remaining version, has a non-stopped worker, or is targeted by a live rollout. Deleting an already deleted version returns `404`. This operation does not remove the version's OCI image. +// +// Corresponds with DELETE /v1/apps/{appId}/versions/{versionNumber} (the `DeleteVersion` operationId). +func (c *Client) DeleteVersion(ctx context.Context, appId AppId, versionNumber int32, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteVersionRequest(c.Server, appId, versionNumber) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + // GetVersion Get a version // // Corresponds with GET /v1/apps/{appId}/versions/{versionNumber} (the `GetVersion` operationId). @@ -2525,7 +3545,7 @@ func (c *Client) GetVersion(ctx context.Context, appId AppId, versionNumber int3 // ListWorkers List workers // -// Returns a newest-first page of workers observed for the app (including terminal `stopped` rows until purged). Optional `status` narrows the page; a cursor must be replayed under the same status filter it was issued with. +// Returns a newest-first page of workers observed for the app (including terminal `stopped` rows until purged). Optional `state` and `status` narrow the page; a cursor must be replayed under the same filters it was issued with. // // Corresponds with GET /v1/apps/{appId}/workers (the `ListWorkers` operationId). func (c *Client) ListWorkers(ctx context.Context, appId AppId, params *ListWorkersParams, reqEditors ...RequestEditorFn) (*http.Response, error) { @@ -2794,6 +3814,115 @@ func (c *Client) UpdateGpuTypePrice(ctx context.Context, gpuTypeId GpuTypeId, pr return c.Client.Do(req) } +// GetLogEntries Read one page of a named log query +// +// Returns one page of log entries, newest first, with an opaque cursor for the next page when one exists. +// +// No query is registered yet: live tail, retention tiers and log quotas are decided in a follow-up ADR, so every request currently answers `404`. The route exists so the contract is fixed before the templates land. +// +// Corresponds with GET /v1/logs/queries/{queryId}/entries (the `GetLogEntries` operationId). +func (c *Client) GetLogEntries(ctx context.Context, queryId QueryId, params *GetLogEntriesParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetLogEntriesRequest(c.Server, queryId, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// ListInsightsQueries List the metric and log queries this build can answer +// +// The catalogue: every named query, its unit and aggregation, the selectors it accepts, the series it returns, and the windows actually backed by stored series. +// +// This is the source of query ids. Clients discover ids here rather than carrying a list of their own, and render window tabs from `windows` rather than from the full ladder, so a window whose storage tier has no backing series stays invisible instead of rendering a tab with nothing behind it. +// +// Corresponds with GET /v1/metrics/queries (the `ListInsightsQueries` operationId). +func (c *Client) ListInsightsQueries(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewListInsightsQueriesRequest(c.Server) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// GetMetricSeries Read one named metric query +// +// Returns one chart's data: a single timestamp axis shared by every series, and one dense value array per series aligned to it. +// +// Values are dense and positionally aligned to `t`, with an explicit `null` wherever there was no sample. Each timestamp is the END of its bucket, so `window.to` is inclusive and equals the last timestamp in `t`, while `window.from` is exclusive and is one `step_s` before the first. +// +// An organization with no metrics yet is answered with the full axis and all-null series rather than an error. +// +// `apps_request_volume` returns one series per app: 24 hourly request counts over `window=24h` (`step_s` 3600, unit `requests`). Repeat `appId` once per id on the current list page to pad idle apps with all-null series, in request order. Hours that started before that live app's `createdAt` are null, so a reused app id does not inherit the previous generation's traffic still in the 24h store. The same `appId` pad applies to the list-scoped `apps_error_volume` and `apps_request_duration` queries. Other queries reject `appId`. Other windows are not available for these queries. +// +// `endpoints_request_volume` is the endpoints-list counterpart: 24 hourly request counts per endpoint over `window=24h` (`step_s` 3600, unit `requests`). It requires `deployment` (the public app id, rewritten to the live deployment UUID). Repeat `endpointId` once per id on the current `listEndpoints` page to pad idle endpoints with all-null series, in request order. Hours that started before that endpoint row's `createdAt` are null, so a removed-then-readded path does not inherit the previous row's traffic. Other queries reject `endpointId`. Other windows are not available for this query. +// +// Corresponds with GET /v1/metrics/queries/{queryId}/series (the `GetMetricSeries` operationId). +func (c *Client) GetMetricSeries(ctx context.Context, queryId QueryId, params *GetMetricSeriesParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetMetricSeriesRequest(c.Server, queryId, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// UpsertOrgTenancyWithBody Set an organisation's serverless tenancy state +// +// Idempotent upsert for one customer organisation. The customer UUID is in the body — public paths never carry an organisation identifier (the authenticated API key names the *caller*, which for this route must be the Runware platform organisation). +// +// `state: active` runs Ensure: a Cloud KMS CryptoKey named after the organisation UUID, a Kubernetes service account `org-` in the shared app namespace, and a decrypt IAM binding on that key for the KSA principal. `state: disabled` runs teardown: disable the key's primary version, drop the decrypt binding, delete the KSA. The key itself is not destroyed — a destroyed key makes every ciphertext under it permanently unreadable. The local row stays as a tombstone so a later Ensure converges on the same names. +// +// A retry after a partial failure converges rather than duplicating objects. `200` returns the resulting receipt. `503` when Cloud KMS key-admin is rate-limited (60 writes/min) or otherwise unavailable; the caller (admin-api Messenger) retries the same PUT. +// +// Takes any type of body and a specified content type. +// +// Corresponds with PUT /v1/org-tenancies (the `UpsertOrgTenancy` operationId). +func (c *Client) UpsertOrgTenancyWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpsertOrgTenancyRequestWithBody(c.Server, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// UpsertOrgTenancy Set an organisation's serverless tenancy state +// +// Idempotent upsert for one customer organisation. The customer UUID is in the body — public paths never carry an organisation identifier (the authenticated API key names the *caller*, which for this route must be the Runware platform organisation). +// +// `state: active` runs Ensure: a Cloud KMS CryptoKey named after the organisation UUID, a Kubernetes service account `org-` in the shared app namespace, and a decrypt IAM binding on that key for the KSA principal. `state: disabled` runs teardown: disable the key's primary version, drop the decrypt binding, delete the KSA. The key itself is not destroyed — a destroyed key makes every ciphertext under it permanently unreadable. The local row stays as a tombstone so a later Ensure converges on the same names. +// +// A retry after a partial failure converges rather than duplicating objects. `200` returns the resulting receipt. `503` when Cloud KMS key-admin is rate-limited (60 writes/min) or otherwise unavailable; the caller (admin-api Messenger) retries the same PUT. +// +// Takes a body of the `application/json` content type. +// +// Corresponds with PUT /v1/org-tenancies (the `UpsertOrgTenancy` operationId). +func (c *Client) UpsertOrgTenancy(ctx context.Context, body UpsertOrgTenancyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpsertOrgTenancyRequest(c.Server, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + // ListSecrets List secrets // // Returns secret metadata only; encrypted values are never returned. @@ -2813,7 +3942,7 @@ func (c *Client) ListSecrets(ctx context.Context, params *ListSecretsParams, req // CreateSecretWithBody Create a secret // -// Creates an organisation-scoped secret. Returns `409` if the name is already in use — including when a secret of that name is `pending_destroy`. List only shows active secrets, so a name can appear free while create still conflicts for as long as that row remains. Hard deletion of `pending_destroy` rows (which would release the name) is not performed by this API yet. Recreate-while-deleting may later reuse the pending row with the new value (same name, new ciphertext). +// Creates an organisation-scoped secret. Returns `409` if the name is already in use — including when a secret of that name is `pending_destroy`. List only shows active secrets, so a name can appear free while create still conflicts for as long as that row remains. A `pending_destroy` row is removed, and its name released, by a background sweep once no running worker can still hold the value — there is no deadline on that wait, so a continuously busy app can hold a name for as long as it runs. Recreate-while-deleting may later reuse the pending row with the new value (same name, new ciphertext). // // Takes any type of body and a specified content type. // @@ -2832,7 +3961,7 @@ func (c *Client) CreateSecretWithBody(ctx context.Context, contentType string, b // CreateSecret Create a secret // -// Creates an organisation-scoped secret. Returns `409` if the name is already in use — including when a secret of that name is `pending_destroy`. List only shows active secrets, so a name can appear free while create still conflicts for as long as that row remains. Hard deletion of `pending_destroy` rows (which would release the name) is not performed by this API yet. Recreate-while-deleting may later reuse the pending row with the new value (same name, new ciphertext). +// Creates an organisation-scoped secret. Returns `409` if the name is already in use — including when a secret of that name is `pending_destroy`. List only shows active secrets, so a name can appear free while create still conflicts for as long as that row remains. A `pending_destroy` row is removed, and its name released, by a background sweep once no running worker can still hold the value — there is no deadline on that wait, so a continuously busy app can hold a name for as long as it runs. Recreate-while-deleting may later reuse the pending row with the new value (same name, new ciphertext). // // Takes a body of the `application/json` content type. // @@ -2851,7 +3980,7 @@ func (c *Client) CreateSecret(ctx context.Context, body CreateSecretJSONRequestB // DeleteSecret Delete a secret // -// Soft-deletes a secret: marks the row `pending_destroy` and bumps revision. This API does not hard-delete the row; a future GC path is expected to remove unattached `pending_destroy` secrets and release the name, but that sweep is not implemented yet. Returns `409` while any app still attaches it — cascade-detach is not performed here; detach each holder with `DELETE .../apps/{id}/secrets/{name}` first. Attach/detach are control-plane records only in this release (they do not roll workers). While the row remains `pending_destroy` the name stays reserved, so create may return `409` even though list no longer shows the secret. Retries on an already-pending name are safe when no attachments remain (`204`); they still return `409` while attached. +// Soft-deletes a secret: marks the row `pending_destroy` and bumps revision. This API does not hard-delete the row. A background sweep removes the row and releases the name once no running worker can still hold the value — the value travels inside the worker's own environment, which is fixed when the container starts, so a worker keeps it until it stops. There is no deadline on that wait. Returns `409` while any app still attaches it — cascade-detach is not performed here; detach each holder with `DELETE .../apps/{id}/secrets/{name}` first. Attach and detach change the secret set for the next rollout. Neither operation rolls workers. While the row remains `pending_destroy` the name stays reserved, so create may return `409` even though list no longer shows the secret. Retries on an already-pending name are safe when no attachments remain (`204`); they still return `409` while attached. // // Corresponds with DELETE /v1/secrets/{secretName} (the `DeleteSecret` operationId). func (c *Client) DeleteSecret(ctx context.Context, secretName SecretName, reqEditors ...RequestEditorFn) (*http.Response, error) { @@ -3286,6 +4415,47 @@ func NewListBuildsRequest(server string, appId AppId, params *ListBuildsParams) return req, nil } +// NewDeleteBuildRequest constructs an http.Request for the DeleteBuild method +func NewDeleteBuildRequest(server string, appId AppId, buildId openapi_types.UUID) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "appId", appId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithOptions("simple", false, "buildId", buildId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: "uuid"}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/apps/%s/builds/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + // NewGetBuildRequest constructs an http.Request for the GetBuild method func NewGetBuildRequest(server string, appId AppId, buildId openapi_types.UUID) (*http.Request, error) { var err error @@ -4112,8 +5282,19 @@ func NewDetachAppSecretRequest(server string, appId AppId, secretName SecretName return req, nil } -// NewStopAppRequest constructs an http.Request for the StopApp method -func NewStopAppRequest(server string, appId AppId) (*http.Request, error) { +// NewCreateSourceUploadRequest calls the generic CreateSourceUpload builder with application/json body +func NewCreateSourceUploadRequest(server string, appId AppId, body CreateSourceUploadJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewCreateSourceUploadRequestWithBody(server, appId, "application/json", bodyReader) +} + +// NewCreateSourceUploadRequestWithBody constructs an http.Request for the CreateSourceUpload method, with any body, and a specified content type +func NewCreateSourceUploadRequestWithBody(server string, appId AppId, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -4128,7 +5309,7 @@ func NewStopAppRequest(server string, appId AppId) (*http.Request, error) { return nil, err } - operationPath := fmt.Sprintf("/v1/apps/%s/stop", pathParam0) + operationPath := fmt.Sprintf("/v1/apps/%s/source-uploads", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -4138,16 +5319,18 @@ func NewStopAppRequest(server string, appId AppId) (*http.Request, error) { return nil, err } - req, err := http.NewRequest(http.MethodPost, queryURL.String(), nil) + req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } + req.Header.Add("Content-Type", contentType) + return req, nil } -// NewListTasksRequest constructs an http.Request for the ListTasks method -func NewListTasksRequest(server string, appId AppId, params *ListTasksParams) (*http.Request, error) { +// NewDeleteSourceUploadRequest constructs an http.Request for the DeleteSourceUpload method +func NewDeleteSourceUploadRequest(server string, appId AppId, uploadId SourceUploadId) (*http.Request, error) { var err error var pathParam0 string @@ -4157,12 +5340,19 @@ func NewListTasksRequest(server string, appId AppId, params *ListTasksParams) (* return nil, err } + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithOptions("simple", false, "uploadId", uploadId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: "uuid"}) + if err != nil { + return nil, err + } + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/v1/apps/%s/tasks", pathParam0) + operationPath := fmt.Sprintf("/v1/apps/%s/source-uploads/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -4172,35 +5362,185 @@ func NewListTasksRequest(server string, appId AppId, params *ListTasksParams) (* return nil, err } - if params != nil { - // queryValues collects non-styled parameters (passthrough, JSON) - // that are safe to round-trip through url.Values.Encode(). - queryValues := queryURL.Query() - // rawQueryFragments collects pre-encoded query fragments from - // styled parameters, preserving literal commas as delimiters - // per the OpenAPI spec (e.g. "color=blue,black,brown"). - var rawQueryFragments []string + req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) + if err != nil { + return nil, err + } - if params.Limit != nil { + return req, nil +} - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: "int32"}); err != nil { - return nil, err - } else { - for _, qp := range strings.Split(queryFrag, "&") { - rawQueryFragments = append(rawQueryFragments, qp) - } - } +// NewGetSourceUploadRequest constructs an http.Request for the GetSourceUpload method +func NewGetSourceUploadRequest(server string, appId AppId, uploadId SourceUploadId) (*http.Request, error) { + var err error - } + var pathParam0 string - if params.Cursor != nil { + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "appId", appId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "cursor", *params.Cursor, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { - return nil, err - } else { - for _, qp := range strings.Split(queryFrag, "&") { - rawQueryFragments = append(rawQueryFragments, qp) - } + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithOptions("simple", false, "uploadId", uploadId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: "uuid"}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/apps/%s/source-uploads/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewCompleteSourceUploadRequest constructs an http.Request for the CompleteSourceUpload method +func NewCompleteSourceUploadRequest(server string, appId AppId, uploadId SourceUploadId) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "appId", appId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithOptions("simple", false, "uploadId", uploadId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: "uuid"}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/apps/%s/source-uploads/%s/complete", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodPost, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewStopAppRequest constructs an http.Request for the StopApp method +func NewStopAppRequest(server string, appId AppId) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "appId", appId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/apps/%s/stop", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodPost, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewListTasksRequest constructs an http.Request for the ListTasks method +func NewListTasksRequest(server string, appId AppId, params *ListTasksParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "appId", appId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/apps/%s/tasks", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + // queryValues collects non-styled parameters (passthrough, JSON) + // that are safe to round-trip through url.Values.Encode(). + queryValues := queryURL.Query() + // rawQueryFragments collects pre-encoded query fragments from + // styled parameters, preserving literal commas as delimiters + // per the OpenAPI spec (e.g. "color=blue,black,brown"). + var rawQueryFragments []string + + if params.Limit != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: "int32"}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.Cursor != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "cursor", *params.Cursor, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } } } @@ -4232,7 +5572,7 @@ func NewListTasksRequest(server string, appId AppId, params *ListTasksParams) (* } // NewGetTaskRequest constructs an http.Request for the GetTask method -func NewGetTaskRequest(server string, appId AppId, taskId string) (*http.Request, error) { +func NewGetTaskRequest(server string, appId AppId, taskId TaskId) (*http.Request, error) { var err error var pathParam0 string @@ -4244,7 +5584,7 @@ func NewGetTaskRequest(server string, appId AppId, taskId string) (*http.Request var pathParam1 string - pathParam1, err = runtime.StyleParamWithOptions("simple", false, "taskId", taskId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + pathParam1, err = runtime.StyleParamWithOptions("simple", false, "taskId", taskId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: "uuid"}) if err != nil { return nil, err } @@ -4345,6 +5685,47 @@ func NewListVersionsRequest(server string, appId AppId, params *ListVersionsPara return req, nil } +// NewDeleteVersionRequest constructs an http.Request for the DeleteVersion method +func NewDeleteVersionRequest(server string, appId AppId, versionNumber int32) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "appId", appId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithOptions("simple", false, "versionNumber", versionNumber, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "integer", Format: "int32"}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/apps/%s/versions/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + // NewGetVersionRequest constructs an http.Request for the GetVersion method func NewGetVersionRequest(server string, appId AppId, versionNumber int32) (*http.Request, error) { var err error @@ -4445,6 +5826,18 @@ func NewListWorkersRequest(server string, appId AppId, params *ListWorkersParams } + if params.State != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "state", *params.State, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + if params.Status != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "status", *params.Status, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { @@ -4909,16 +6302,23 @@ func NewUpdateGpuTypePriceRequestWithBody(server string, gpuTypeId GpuTypeId, pr return req, nil } -// NewListSecretsRequest constructs an http.Request for the ListSecrets method -func NewListSecretsRequest(server string, params *ListSecretsParams) (*http.Request, error) { +// NewGetLogEntriesRequest constructs an http.Request for the GetLogEntries method +func NewGetLogEntriesRequest(server string, queryId QueryId, params *GetLogEntriesParams) (*http.Request, error) { var err error + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "queryId", queryId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/v1/secrets") + operationPath := fmt.Sprintf("/v1/logs/queries/%s/entries", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -4937,6 +6337,14 @@ func NewListSecretsRequest(server string, params *ListSecretsParams) (*http.Requ // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "window", params.Window, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + if params.Limit != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: "int32"}); err != nil { @@ -4961,6 +6369,30 @@ func NewListSecretsRequest(server string, params *ListSecretsParams) (*http.Requ } + if params.Deployment != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "deployment", *params.Deployment, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.Endpoint != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "endpoint", *params.Endpoint, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "uuid"}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } @@ -4975,19 +6407,8 @@ func NewListSecretsRequest(server string, params *ListSecretsParams) (*http.Requ return req, nil } -// NewCreateSecretRequest calls the generic CreateSecret builder with application/json body -func NewCreateSecretRequest(server string, body CreateSecretJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewCreateSecretRequestWithBody(server, "application/json", bodyReader) -} - -// NewCreateSecretRequestWithBody constructs an http.Request for the CreateSecret method, with any body, and a specified content type -func NewCreateSecretRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { +// NewListInsightsQueriesRequest constructs an http.Request for the ListInsightsQueries method +func NewListInsightsQueriesRequest(server string) (*http.Request, error) { var err error serverURL, err := url.Parse(server) @@ -4995,7 +6416,7 @@ func NewCreateSecretRequestWithBody(server string, contentType string, body io.R return nil, err } - operationPath := fmt.Sprintf("/v1/secrets") + operationPath := fmt.Sprintf("/v1/metrics/queries") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5005,23 +6426,21 @@ func NewCreateSecretRequestWithBody(server string, contentType string, body io.R return nil, err } - req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } - req.Header.Add("Content-Type", contentType) - return req, nil } -// NewDeleteSecretRequest constructs an http.Request for the DeleteSecret method -func NewDeleteSecretRequest(server string, secretName SecretName) (*http.Request, error) { +// NewGetMetricSeriesRequest constructs an http.Request for the GetMetricSeries method +func NewGetMetricSeriesRequest(server string, queryId QueryId, params *GetMetricSeriesParams) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithOptions("simple", false, "secretName", secretName, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "queryId", queryId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } @@ -5031,7 +6450,7 @@ func NewDeleteSecretRequest(server string, secretName SecretName) (*http.Request return nil, err } - operationPath := fmt.Sprintf("/v1/secrets/%s", pathParam0) + operationPath := fmt.Sprintf("/v1/metrics/queries/%s/series", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5041,7 +6460,114 @@ func NewDeleteSecretRequest(server string, secretName SecretName) (*http.Request return nil, err } - req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) + if params != nil { + // queryValues collects non-styled parameters (passthrough, JSON) + // that are safe to round-trip through url.Values.Encode(). + queryValues := queryURL.Query() + // rawQueryFragments collects pre-encoded query fragments from + // styled parameters, preserving literal commas as delimiters + // per the OpenAPI spec (e.g. "color=blue,black,brown"). + var rawQueryFragments []string + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "window", params.Window, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + if params.PinnedTo != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "pinnedTo", *params.PinnedTo, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: "int64"}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.Deployment != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "deployment", *params.Deployment, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.Endpoint != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "endpoint", *params.Endpoint, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "uuid"}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.StatusClass != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "statusClass", *params.StatusClass, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.Region != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "region", *params.Region, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.AppId != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "appId", *params.AppId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "array", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.EndpointId != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "endpointId", *params.EndpointId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "array", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if encoded := queryValues.Encode(); encoded != "" { + rawQueryFragments = append(rawQueryFragments, encoded) + } + queryURL.RawQuery = strings.Join(rawQueryFragments, "&") + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } @@ -5049,34 +6575,27 @@ func NewDeleteSecretRequest(server string, secretName SecretName) (*http.Request return req, nil } -// NewUpdateSecretRequest calls the generic UpdateSecret builder with application/json body -func NewUpdateSecretRequest(server string, secretName SecretName, body UpdateSecretJSONRequestBody) (*http.Request, error) { +// NewUpsertOrgTenancyRequest calls the generic UpsertOrgTenancy builder with application/json body +func NewUpsertOrgTenancyRequest(server string, body UpsertOrgTenancyJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewUpdateSecretRequestWithBody(server, secretName, "application/json", bodyReader) + return NewUpsertOrgTenancyRequestWithBody(server, "application/json", bodyReader) } -// NewUpdateSecretRequestWithBody constructs an http.Request for the UpdateSecret method, with any body, and a specified content type -func NewUpdateSecretRequestWithBody(server string, secretName SecretName, contentType string, body io.Reader) (*http.Request, error) { +// NewUpsertOrgTenancyRequestWithBody constructs an http.Request for the UpsertOrgTenancy method, with any body, and a specified content type +func NewUpsertOrgTenancyRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithOptions("simple", false, "secretName", secretName, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) - if err != nil { - return nil, err - } - serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/v1/secrets/%s", pathParam0) + operationPath := fmt.Sprintf("/v1/org-tenancies") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5096,8 +6615,8 @@ func NewUpdateSecretRequestWithBody(server string, secretName SecretName, conten return req, nil } -// NewListUsageEventsRequest constructs an http.Request for the ListUsageEvents method -func NewListUsageEventsRequest(server string, params *ListUsageEventsParams) (*http.Request, error) { +// NewListSecretsRequest constructs an http.Request for the ListSecrets method +func NewListSecretsRequest(server string, params *ListSecretsParams) (*http.Request, error) { var err error serverURL, err := url.Parse(server) @@ -5105,7 +6624,7 @@ func NewListUsageEventsRequest(server string, params *ListUsageEventsParams) (*h return nil, err } - operationPath := fmt.Sprintf("/v1/usage") + operationPath := fmt.Sprintf("/v1/secrets") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5148,112 +6667,299 @@ func NewListUsageEventsRequest(server string, params *ListUsageEventsParams) (*h } - if params.AppId != nil { - - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "appId", *params.AppId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { - return nil, err - } else { - for _, qp := range strings.Split(queryFrag, "&") { - rawQueryFragments = append(rawQueryFragments, qp) - } - } - + if encoded := queryValues.Encode(); encoded != "" { + rawQueryFragments = append(rawQueryFragments, encoded) } + queryURL.RawQuery = strings.Join(rawQueryFragments, "&") + } - if params.From != nil { + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "from", *params.From, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "date-time"}); err != nil { - return nil, err - } else { - for _, qp := range strings.Split(queryFrag, "&") { - rawQueryFragments = append(rawQueryFragments, qp) - } - } + return req, nil +} - } +// NewCreateSecretRequest calls the generic CreateSecret builder with application/json body +func NewCreateSecretRequest(server string, body CreateSecretJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewCreateSecretRequestWithBody(server, "application/json", bodyReader) +} - if params.To != nil { +// NewCreateSecretRequestWithBody constructs an http.Request for the CreateSecret method, with any body, and a specified content type +func NewCreateSecretRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "to", *params.To, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "date-time"}); err != nil { - return nil, err - } else { - for _, qp := range strings.Split(queryFrag, "&") { - rawQueryFragments = append(rawQueryFragments, qp) - } - } + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } - } + operationPath := fmt.Sprintf("/v1/secrets") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } - if encoded := queryValues.Encode(); encoded != "" { - rawQueryFragments = append(rawQueryFragments, encoded) - } - queryURL.RawQuery = strings.Join(rawQueryFragments, "&") + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err } - req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } + req.Header.Add("Content-Type", contentType) + return req, nil } -func (c *Client) applyEditors(ctx context.Context, req *http.Request, additionalEditors []RequestEditorFn) error { - for _, r := range c.RequestEditors { - if err := r(ctx, req); err != nil { - return err - } +// NewDeleteSecretRequest constructs an http.Request for the DeleteSecret method +func NewDeleteSecretRequest(server string, secretName SecretName) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "secretName", secretName, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err } - for _, r := range additionalEditors { - if err := r(ctx, req); err != nil { - return err - } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err } - return nil -} -// ClientWithResponses builds on ClientInterface to offer response payloads -type ClientWithResponses struct { - ClientInterface -} + operationPath := fmt.Sprintf("/v1/secrets/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } -// NewClientWithResponses creates a new ClientWithResponses, which wraps -// Client with return type handling -func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error) { - client, err := NewClient(server, opts...) + queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } - return &ClientWithResponses{client}, nil + + req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil } -// WithBaseURL overrides the baseURL. -func WithBaseURL(baseURL string) ClientOption { - return func(c *Client) error { - newBaseURL, err := url.Parse(baseURL) - if err != nil { - return err - } - c.Server = newBaseURL.String() - return nil +// NewUpdateSecretRequest calls the generic UpdateSecret builder with application/json body +func NewUpdateSecretRequest(server string, secretName SecretName, body UpdateSecretJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err } + bodyReader = bytes.NewReader(buf) + return NewUpdateSecretRequestWithBody(server, secretName, "application/json", bodyReader) } -// ClientWithResponsesInterface is the interface specification for the client with responses above. -type ClientWithResponsesInterface interface { +// NewUpdateSecretRequestWithBody constructs an http.Request for the UpdateSecret method, with any body, and a specified content type +func NewUpdateSecretRequestWithBody(server string, secretName SecretName, contentType string, body io.Reader) (*http.Request, error) { + var err error - // GetAppSummaryWithResponse App summary metrics for the authenticated organisation - // - // Aggregate dashboard metrics across all apps owned by the authenticated organisation. Metrics whose backing system is not yet available are omitted from the response rather than reported as zero. - // - // Returns a wrapper object for the known response body format(s). - // - // Corresponds with GET /v1/app-summary (the `GetAppSummary` operationId). + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "secretName", secretName, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/secrets/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodPut, queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewListUsageEventsRequest constructs an http.Request for the ListUsageEvents method +func NewListUsageEventsRequest(server string, params *ListUsageEventsParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/usage") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + // queryValues collects non-styled parameters (passthrough, JSON) + // that are safe to round-trip through url.Values.Encode(). + queryValues := queryURL.Query() + // rawQueryFragments collects pre-encoded query fragments from + // styled parameters, preserving literal commas as delimiters + // per the OpenAPI spec (e.g. "color=blue,black,brown"). + var rawQueryFragments []string + + if params.Limit != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: "int32"}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.Cursor != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "cursor", *params.Cursor, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.AppId != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "appId", *params.AppId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.From != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "from", *params.From, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "date-time"}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.To != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "to", *params.To, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "date-time"}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if encoded := queryValues.Encode(); encoded != "" { + rawQueryFragments = append(rawQueryFragments, encoded) + } + queryURL.RawQuery = strings.Join(rawQueryFragments, "&") + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +func (c *Client) applyEditors(ctx context.Context, req *http.Request, additionalEditors []RequestEditorFn) error { + for _, r := range c.RequestEditors { + if err := r(ctx, req); err != nil { + return err + } + } + for _, r := range additionalEditors { + if err := r(ctx, req); err != nil { + return err + } + } + return nil +} + +// ClientWithResponses builds on ClientInterface to offer response payloads +type ClientWithResponses struct { + ClientInterface +} + +// NewClientWithResponses creates a new ClientWithResponses, which wraps +// Client with return type handling +func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error) { + client, err := NewClient(server, opts...) + if err != nil { + return nil, err + } + return &ClientWithResponses{client}, nil +} + +// WithBaseURL overrides the baseURL. +func WithBaseURL(baseURL string) ClientOption { + return func(c *Client) error { + newBaseURL, err := url.Parse(baseURL) + if err != nil { + return err + } + c.Server = newBaseURL.String() + return nil + } +} + +// ClientWithResponsesInterface is the interface specification for the client with responses above. +type ClientWithResponsesInterface interface { + + // GetAppSummaryWithResponse App summary metrics for the authenticated organisation + // + // Aggregate dashboard metrics across all apps owned by the authenticated organisation. App and worker tallies are always present. Request and error-rate totals come from the metrics store and are omitted when that hop cannot answer rather than reported as zero. Spend is omitted until billing rollups exist. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /v1/app-summary (the `GetAppSummary` operationId). GetAppSummaryWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetAppSummaryResponse, error) // ListAppsWithResponse List apps // - // Returns a page of the organisation's apps. Filters combine with AND; soft-deleted apps are excluded unless `status=deleted` is requested explicitly. + // Returns a page of the organisation's apps. Filters combine with AND; soft-deleted apps are excluded unless `status=deleted` is requested explicitly. Favourited apps appear before non-favourited apps, with the selected ordering applied within each group. // // A `cursor` is only valid for the `sort` and filters it was issued under — reusing one across a different ordering or filter set returns `400`. // @@ -5271,14 +6977,17 @@ type ClientWithResponsesInterface interface { // points at that version. If the build, validation, or rollout fails the app is // marked `failed`. // - // - `container` source: no build step, so the version carries no `buildId`. No worker runs - // from a container source yet, so the app stays `initializing` and does not serve - // inference — poll `active` only for a `code` source. + // - `container` source: the submitted zip (wrapper `Dockerfile` + `container.yaml`) + // goes through the same build pipeline — the wrapper image is built, published and + // deployed, so the version carries a `buildId` and the app follows the same + // lifecycle as a code source. An invalid `container.yaml` rejects the create + // before any build capacity is spent — `400` where the document could not be + // parsed at all, `422` where it parsed and broke a rule. // // // `activeVersionId` is null until a rollout completes: a version records what should run, and only a finished deploy says what does. // - // `secrets` is accepted by the schema but not yet applied, so supplying it returns `422` rather than silently dropping it. + // `secrets` attaches organisation secrets that already exist. It is the app's initial attachment set, so the first rollout carries their values into the worker. This route does not create a secret — use `POST /v1/secrets` first. A name that is unknown to the organisation, or that is not `active`, returns `404`. A name that collides with a key in `environmentVariables`, a repeated name and a set that goes past the binding limit each return `422`. The whole set is checked before any build capacity is spent. // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // @@ -5294,14 +7003,17 @@ type ClientWithResponsesInterface interface { // points at that version. If the build, validation, or rollout fails the app is // marked `failed`. // - // - `container` source: no build step, so the version carries no `buildId`. No worker runs - // from a container source yet, so the app stays `initializing` and does not serve - // inference — poll `active` only for a `code` source. + // - `container` source: the submitted zip (wrapper `Dockerfile` + `container.yaml`) + // goes through the same build pipeline — the wrapper image is built, published and + // deployed, so the version carries a `buildId` and the app follows the same + // lifecycle as a code source. An invalid `container.yaml` rejects the create + // before any build capacity is spent — `400` where the document could not be + // parsed at all, `422` where it parsed and broke a rule. // // // `activeVersionId` is null until a rollout completes: a version records what should run, and only a finished deploy says what does. // - // `secrets` is accepted by the schema but not yet applied, so supplying it returns `422` rather than silently dropping it. + // `secrets` attaches organisation secrets that already exist. It is the app's initial attachment set, so the first rollout carries their values into the worker. This route does not create a secret — use `POST /v1/secrets` first. A name that is unknown to the organisation, or that is not `active`, returns `404`. A name that collides with a key in `environmentVariables`, a repeated name and a set that goes past the binding limit each return `422`. The whole set is checked before any build capacity is spent. // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // @@ -5312,6 +7024,8 @@ type ClientWithResponsesInterface interface { // // Soft delete. Sets `status = deleting` and returns `202` once that intent is persisted. Router removal, cancelling in-progress builds, and worker drain (`draining → stopping → stopped`) are performed asynchronously by the deployer/Scaler; `status` becomes `deleted` once all workers stop. All rows are retained for billing finalisation, audit, and usage history. Idempotent if the app is already `deleting`. // + // The `appId` is released once `status` reaches `deleted`, and not before: while the app is `deleting` its workload is still being torn down and the name stays taken. A new app created under a released name is a new app and inherits nothing — no version, no build, no event history, and no workers. + // // Returns a wrapper object for the known response body format(s). // // Corresponds with DELETE /v1/apps/{appId} (the `DeleteApp` operationId). @@ -5319,6 +7033,8 @@ type ClientWithResponsesInterface interface { // GetAppWithResponse Get an app // + // Returns the app the authenticated organisation owns under this `appId`. An unknown app and a soft-deleted one both return `404 Not Found`: a deleted app is gone to its owner, and its rows are retained only for billing and audit. To read deleted apps, list them with `status=deleted`. + // // Returns a wrapper object for the known response body format(s). // // Corresponds with GET /v1/apps/{appId} (the `GetApp` operationId). @@ -5327,22 +7043,11 @@ type ClientWithResponsesInterface interface { // UpdateAppWithBodyWithResponse Update an app // // Patches one or more aspects of an app in place. All fields are optional; omitted fields are left unchanged. Valid in any non-`deleted` status, including `stopped` (changes apply on `resume`). Lifecycle transitions use the dedicated `deploy`, `stop`, `resume`, and `delete` operations. - // - // **Currently persisted:** `appName` and `configuration` only. Supplying `appSource`, `secrets`, `environmentVariables`, or `endpoints` returns `422` (bulk env-var replace is not wired — use the dedicated `/environment-variables` endpoints for individual keys). - // - // Target behaviour (once fully wired): - // - `configuration`: applied on the next Scaler cycle; triggers a rollout so workers - // restart with the new configuration. If the rollout fails, the app remains on - // the previous configuration. - // - // - `appSource`: triggers a build (for `code` sources) or image validation (for `container` - // sources); on success the new version is deployed automatically. If the build or - // validation fails, the app remains on the previous version. - // - // - `secrets` / `environmentVariables` / `endpoints`: the supplied array **replaces** the - // current set — any item absent from the request is deleted. Endpoints take effect - // immediately. Changes to secrets or environment variables trigger a rollout so workers - // restart and pick up the new values. + // A configuration or `environmentVariables` change records a new version with the same image. If that image is deployable, the update pins it as `activeVersionId` and rolls the workload when the app is `active` or `initializing`. A `failed` app is moved to `initializing` and rolled, the same as `POST /deploy`. If the image is not deployable, the version is recorded and `activeVersionId` is left unchanged. If the roll fails, `activeVersionId` is restored and the previous configuration keeps serving. A name-only change records a version and does not pin. A `stopped` or `stopping` app pins the version and rolls it on `resume`. A configuration, `environmentVariables`, or `appSource` change while a create or resume rollout is already in progress returns `409 Conflict`. A name-only or `secrets`-only change does not. + // `appSource` starts a build and records version N+1 with a new image tag. The deploy queue carries the build-then-deploy tail; `activeVersionId` moves only when that rollout completes. A builder rejection (400 where a container document's parser refused it, 422 where it parsed and broke a rule) leaves the app on its current version and writes no version row and no build row. After the builder accepts, version N+1 is recorded even if a concurrent secret deactivation or env/secret collision prevents this request's env/secrets overlay; in that case the previous environmentVariables and attachment set stay in place and are what the new version snapshots. + // `environmentVariables` replaces the whole set: a key absent from the map is deleted, and a null value omits that key from the new set. The resolved map is snapshotted onto the new version. + // `secrets` replaces the whole attachment set. An attachment absent from the array is detached. Injected names must not collide with a plain environment variable on the app; the combined set of plain variables and attachments is capped at 100. This is a control-plane record only — secret values do not reach a pod, and the version snapshot carries no secrets — so a secrets-only change does not roll the workload. + // Endpoints are not a field of this contract: the set belongs to the app source, so it changes only when a new version with a new source builds and deploys. // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // @@ -5352,22 +7057,11 @@ type ClientWithResponsesInterface interface { // UpdateAppWithResponse Update an app // // Patches one or more aspects of an app in place. All fields are optional; omitted fields are left unchanged. Valid in any non-`deleted` status, including `stopped` (changes apply on `resume`). Lifecycle transitions use the dedicated `deploy`, `stop`, `resume`, and `delete` operations. - // - // **Currently persisted:** `appName` and `configuration` only. Supplying `appSource`, `secrets`, `environmentVariables`, or `endpoints` returns `422` (bulk env-var replace is not wired — use the dedicated `/environment-variables` endpoints for individual keys). - // - // Target behaviour (once fully wired): - // - `configuration`: applied on the next Scaler cycle; triggers a rollout so workers - // restart with the new configuration. If the rollout fails, the app remains on - // the previous configuration. - // - // - `appSource`: triggers a build (for `code` sources) or image validation (for `container` - // sources); on success the new version is deployed automatically. If the build or - // validation fails, the app remains on the previous version. - // - // - `secrets` / `environmentVariables` / `endpoints`: the supplied array **replaces** the - // current set — any item absent from the request is deleted. Endpoints take effect - // immediately. Changes to secrets or environment variables trigger a rollout so workers - // restart and pick up the new values. + // A configuration or `environmentVariables` change records a new version with the same image. If that image is deployable, the update pins it as `activeVersionId` and rolls the workload when the app is `active` or `initializing`. A `failed` app is moved to `initializing` and rolled, the same as `POST /deploy`. If the image is not deployable, the version is recorded and `activeVersionId` is left unchanged. If the roll fails, `activeVersionId` is restored and the previous configuration keeps serving. A name-only change records a version and does not pin. A `stopped` or `stopping` app pins the version and rolls it on `resume`. A configuration, `environmentVariables`, or `appSource` change while a create or resume rollout is already in progress returns `409 Conflict`. A name-only or `secrets`-only change does not. + // `appSource` starts a build and records version N+1 with a new image tag. The deploy queue carries the build-then-deploy tail; `activeVersionId` moves only when that rollout completes. A builder rejection (400 where a container document's parser refused it, 422 where it parsed and broke a rule) leaves the app on its current version and writes no version row and no build row. After the builder accepts, version N+1 is recorded even if a concurrent secret deactivation or env/secret collision prevents this request's env/secrets overlay; in that case the previous environmentVariables and attachment set stay in place and are what the new version snapshots. + // `environmentVariables` replaces the whole set: a key absent from the map is deleted, and a null value omits that key from the new set. The resolved map is snapshotted onto the new version. + // `secrets` replaces the whole attachment set. An attachment absent from the array is detached. Injected names must not collide with a plain environment variable on the app; the combined set of plain variables and attachments is capped at 100. This is a control-plane record only — secret values do not reach a pod, and the version snapshot carries no secrets — so a secrets-only change does not roll the workload. + // Endpoints are not a field of this contract: the set belongs to the app source, so it changes only when a new version with a new source builds and deploys. // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // @@ -5381,6 +7075,15 @@ type ClientWithResponsesInterface interface { // Corresponds with GET /v1/apps/{appId}/builds (the `ListBuilds` operationId). ListBuildsWithResponse(ctx context.Context, appId AppId, params *ListBuildsParams, reqEditors ...RequestEditorFn) (*ListBuildsResponse, error) + // DeleteBuildWithResponse Delete or cancel a build + // + // Cancels a queued or running build and records it as `superseded`. Deleting a queued or running build ends its current rollout without activating the cancelled build, so any previous version keeps serving. A terminal build can be deleted once no live rollout still needs it. Ready builds remain while a version references them. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with DELETE /v1/apps/{appId}/builds/{buildId} (the `DeleteBuild` operationId). + DeleteBuildWithResponse(ctx context.Context, appId AppId, buildId openapi_types.UUID, reqEditors ...RequestEditorFn) (*DeleteBuildResponse, error) + // GetBuildWithResponse Get a build // // Returns a wrapper object for the known response body format(s). @@ -5390,12 +7093,12 @@ type ClientWithResponsesInterface interface { // DeployVersionWithBodyWithResponse Deploy a version // - // Activates a `ready` version by number, setting `activeVersionId` and returning `202` once that intent is persisted. Worker rollout, routing switch, and cancelling in-progress builds (`failed` with `error: "superseded"`) are performed asynchronously by the deployer/Scaler. Permitted in any addressable status, including `initializing` and `failed`. + // Activates a `ready` version by number, setting `activeVersionId` and returning `202` once that intent is persisted. Worker rollout, routing switch, and cancelling in-progress builds (`superseded`) are performed asynchronously by the deployer/Scaler. Permitted in any addressable status, including `initializing` and `failed`. // To roll back, supply an older `versionNumber` — the operation is identical to a forward deploy. No new version is created and no rebuild happens: the version's existing image is re-applied. Re-deploying the currently active version is permitted and re-applies it. // A deploy to a `stopped` or `stopping` app records the version and rolls no workload, because no workers are running: the `202` does not imply a rollout there. The recorded version is the one applied when the app resumes. // If the roll of a live app fails, `activeVersionId` is restored to the version that kept serving, so the field keeps naming the running image. // **Rollout** (deployer/Scaler): the platform starts workers on the target version, waits for at least one to become healthy, switches task routing to the new version, then drains old-version workers gracefully. Old workers are given a fixed, platform-managed grace period to finish in-flight tasks before being force-terminated. If new workers fail to become healthy, old workers are not drained and the app continues on the previous version. - // Errors: - Deploy to a `deleting` app returns `409 Conflict` - `versionNumber` not found or not `ready` returns `409 Conflict` - A `container`-source version returns `409 Conflict` until container apps are supported - Deploy to a non-existent or `deleted` app returns `404 Not Found` + // Errors: - Deploy to a `deleting` app returns `409 Conflict` - `versionNumber` not found or not `ready` returns `409 Conflict` - Deploy to a non-existent or `deleted` app returns `404 Not Found` // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // @@ -5404,12 +7107,12 @@ type ClientWithResponsesInterface interface { // DeployVersionWithResponse Deploy a version // - // Activates a `ready` version by number, setting `activeVersionId` and returning `202` once that intent is persisted. Worker rollout, routing switch, and cancelling in-progress builds (`failed` with `error: "superseded"`) are performed asynchronously by the deployer/Scaler. Permitted in any addressable status, including `initializing` and `failed`. + // Activates a `ready` version by number, setting `activeVersionId` and returning `202` once that intent is persisted. Worker rollout, routing switch, and cancelling in-progress builds (`superseded`) are performed asynchronously by the deployer/Scaler. Permitted in any addressable status, including `initializing` and `failed`. // To roll back, supply an older `versionNumber` — the operation is identical to a forward deploy. No new version is created and no rebuild happens: the version's existing image is re-applied. Re-deploying the currently active version is permitted and re-applies it. // A deploy to a `stopped` or `stopping` app records the version and rolls no workload, because no workers are running: the `202` does not imply a rollout there. The recorded version is the one applied when the app resumes. // If the roll of a live app fails, `activeVersionId` is restored to the version that kept serving, so the field keeps naming the running image. // **Rollout** (deployer/Scaler): the platform starts workers on the target version, waits for at least one to become healthy, switches task routing to the new version, then drains old-version workers gracefully. Old workers are given a fixed, platform-managed grace period to finish in-flight tasks before being force-terminated. If new workers fail to become healthy, old workers are not drained and the app continues on the previous version. - // Errors: - Deploy to a `deleting` app returns `409 Conflict` - `versionNumber` not found or not `ready` returns `409 Conflict` - A `container`-source version returns `409 Conflict` until container apps are supported - Deploy to a non-existent or `deleted` app returns `404 Not Found` + // Errors: - Deploy to a `deleting` app returns `409 Conflict` - `versionNumber` not found or not `ready` returns `409 Conflict` - Deploy to a non-existent or `deleted` app returns `404 Not Found` // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // @@ -5418,6 +7121,8 @@ type ClientWithResponsesInterface interface { // ListEndpointsWithResponse List endpoints // + // Lists the endpoints of the app's active version. The set is written by the source itself — a code build's introspection, or a container's config document — and is replaced atomically whenever a version activates, so a deploy of a newer version or a rollback to an older one is immediately reflected here. Empty while the app is `initializing`: nothing is routable until its first build is ready and deployed. + // // Returns a wrapper object for the known response body format(s). // // Corresponds with GET /v1/apps/{appId}/endpoints (the `ListEndpoints` operationId). @@ -5497,7 +7202,7 @@ type ClientWithResponsesInterface interface { // StartAsyncTaskWithBodyWithResponse Start a new async task // - // Starts a new async task on `appId`, routing the request body payload to an available worker. The task runs asynchronously and the response is `202`; poll `GET /v1/apps/{appId}/tasks/{taskId}` for completion. Apps in `initializing`, `active`, or `stopping` accept invocation. `stopped`, `deleting`, and `failed` return `409 Conflict`; unknown or deleted apps return `404 Not Found`. + // Starts a new async task on `appId`, routing the request body payload to an available worker. The task runs asynchronously and the response is `202`; poll `GET /v1/apps/{appId}/tasks/{taskId}` for completion. Resubmitting a task id is answered with the task it already names rather than starting a second one, so the `202` can carry a task that has already finished: read its `status` instead of assuming `pending`, and note it may name a different `appId`. Apps in `initializing`, `active`, or `stopping` accept invocation. `stopped`, `deleting`, and `failed` return `409 Conflict`; unknown or deleted apps return `404 Not Found`. Endpoint membership is checked against the active version's endpoint set before the task is accepted: an endpoint the app does not declare returns `404` whose `endpointPath` extension member carries the rejected path, distinguishing it from an unknown app, and the task never enters the queue. // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // @@ -5506,7 +7211,7 @@ type ClientWithResponsesInterface interface { // StartAsyncTaskWithResponse Start a new async task // - // Starts a new async task on `appId`, routing the request body payload to an available worker. The task runs asynchronously and the response is `202`; poll `GET /v1/apps/{appId}/tasks/{taskId}` for completion. Apps in `initializing`, `active`, or `stopping` accept invocation. `stopped`, `deleting`, and `failed` return `409 Conflict`; unknown or deleted apps return `404 Not Found`. + // Starts a new async task on `appId`, routing the request body payload to an available worker. The task runs asynchronously and the response is `202`; poll `GET /v1/apps/{appId}/tasks/{taskId}` for completion. Resubmitting a task id is answered with the task it already names rather than starting a second one, so the `202` can carry a task that has already finished: read its `status` instead of assuming `pending`, and note it may name a different `appId`. Apps in `initializing`, `active`, or `stopping` accept invocation. `stopped`, `deleting`, and `failed` return `409 Conflict`; unknown or deleted apps return `404 Not Found`. Endpoint membership is checked against the active version's endpoint set before the task is accepted: an endpoint the app does not declare returns `404` whose `endpointPath` extension member carries the rejected path, distinguishing it from an unknown app, and the task never enters the queue. // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // @@ -5515,7 +7220,7 @@ type ClientWithResponsesInterface interface { // StartSyncTaskWithBodyWithResponse Start a new sync task // - // Starts a new sync task on `appId`, routing the request body payload to an available worker. The request blocks until the task is terminal and returns the result inline (`200`), or `504` if it does not complete within the wait window. When the accepted task ID is available, the response includes `taskId` for polling. Apps in `initializing`, `active`, or `stopping` accept invocation. `stopped`, `deleting`, and `failed` return `409 Conflict`; unknown or deleted apps return `404 Not Found`. + // Starts a new sync task on `appId`, routing the request body payload to an available worker. The request blocks until the task is terminal and returns the result inline (`200`). Resubmitting a task id waits on the task it already names rather than starting a second one, so the `200` carries that task's result and may name a different `appId` — poll it under the one returned. A task that outlives the wait window is **not** a failure: the task is still queued or running, and the response is `202` carrying that task with `status: pending` — the same shape `invoke-async` returns, and it names the owning `appId` on a resubmission just as the `200` does. Poll `GET /v1/apps/{appId}/tasks/{taskId}` for its result. A request the platform cannot attribute to an accepted task fails instead, with no task to poll. Apps in `initializing`, `active`, or `stopping` accept invocation. `stopped`, `deleting`, and `failed` return `409 Conflict`; unknown or deleted apps return `404 Not Found`. Endpoint membership is checked against the active version's endpoint set before the task is accepted: an endpoint the app does not declare returns `404` whose `endpointPath` extension member carries the rejected path, distinguishing it from an unknown app, and the task never enters the queue. // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // @@ -5524,7 +7229,7 @@ type ClientWithResponsesInterface interface { // StartSyncTaskWithResponse Start a new sync task // - // Starts a new sync task on `appId`, routing the request body payload to an available worker. The request blocks until the task is terminal and returns the result inline (`200`), or `504` if it does not complete within the wait window. When the accepted task ID is available, the response includes `taskId` for polling. Apps in `initializing`, `active`, or `stopping` accept invocation. `stopped`, `deleting`, and `failed` return `409 Conflict`; unknown or deleted apps return `404 Not Found`. + // Starts a new sync task on `appId`, routing the request body payload to an available worker. The request blocks until the task is terminal and returns the result inline (`200`). Resubmitting a task id waits on the task it already names rather than starting a second one, so the `200` carries that task's result and may name a different `appId` — poll it under the one returned. A task that outlives the wait window is **not** a failure: the task is still queued or running, and the response is `202` carrying that task with `status: pending` — the same shape `invoke-async` returns, and it names the owning `appId` on a resubmission just as the `200` does. Poll `GET /v1/apps/{appId}/tasks/{taskId}` for its result. A request the platform cannot attribute to an accepted task fails instead, with no task to poll. Apps in `initializing`, `active`, or `stopping` accept invocation. `stopped`, `deleting`, and `failed` return `409 Conflict`; unknown or deleted apps return `404 Not Found`. Endpoint membership is checked against the active version's endpoint set before the task is accepted: an endpoint the app does not declare returns `404` whose `endpointPath` extension member carries the rejected path, distinguishing it from an unknown app, and the task never enters the queue. // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // @@ -5549,8 +7254,8 @@ type ClientWithResponsesInterface interface { // AttachAppSecretWithBodyWithResponse Attach a secret to an app // - // Records that an organisation secret is attached to an app under a resolved env-var name. This is a control-plane association only in this release — it does not roll workers or inject values into pods yet (ADR-019 in-pod unseal is separate). Returns `409` if the secret is already attached, or if another attach would use the same env-var name. - // The resolved name (`envVarName`, or `secretName` when omitted) must not already exist as a plain environment variable on this app (`deployment_configs.key`). Both sources are reserved for the same future pod env namespace, so the server rejects the collision with `422` instead of allowing a last-wins override later. The reverse check applies when setting a plain environment variable. + // Records that an organisation secret is attached to an app under a resolved env-var name. The next rollout injects the value into the worker. This operation does not roll workers. Returns `409` if the secret is already attached, or if another attach would use the same env-var name. + // The resolved name (`envVarName`, or `secretName` when omitted) must not already exist as a plain environment variable on this app (`deployment_configs.key`). Both sources use the same pod env namespace, so the server rejects the collision with `422` instead of allowing a last-wins override later. The reverse check applies when setting a plain environment variable. // An app holds at most 100 environment bindings in total — plain environment variables plus attached secrets — the same combined ceiling as create and the single-key env-var route. Attaching when the app is already at that limit returns `422`. // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). @@ -5560,8 +7265,8 @@ type ClientWithResponsesInterface interface { // AttachAppSecretWithResponse Attach a secret to an app // - // Records that an organisation secret is attached to an app under a resolved env-var name. This is a control-plane association only in this release — it does not roll workers or inject values into pods yet (ADR-019 in-pod unseal is separate). Returns `409` if the secret is already attached, or if another attach would use the same env-var name. - // The resolved name (`envVarName`, or `secretName` when omitted) must not already exist as a plain environment variable on this app (`deployment_configs.key`). Both sources are reserved for the same future pod env namespace, so the server rejects the collision with `422` instead of allowing a last-wins override later. The reverse check applies when setting a plain environment variable. + // Records that an organisation secret is attached to an app under a resolved env-var name. The next rollout injects the value into the worker. This operation does not roll workers. Returns `409` if the secret is already attached, or if another attach would use the same env-var name. + // The resolved name (`envVarName`, or `secretName` when omitted) must not already exist as a plain environment variable on this app (`deployment_configs.key`). Both sources use the same pod env namespace, so the server rejects the collision with `422` instead of allowing a last-wins override later. The reverse check applies when setting a plain environment variable. // An app holds at most 100 environment bindings in total — plain environment variables plus attached secrets — the same combined ceiling as create and the single-key env-var route. Attaching when the app is already at that limit returns `422`. // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). @@ -5571,13 +7276,58 @@ type ClientWithResponsesInterface interface { // DetachAppSecretWithResponse Detach a secret from an app // - // Removes the control-plane attachment. Does not roll workers in this release. + // Removes the attachment from the next rollout. This operation does not roll workers. Existing workers keep the value until they stop. // // Returns a wrapper object for the known response body format(s). // // Corresponds with DELETE /v1/apps/{appId}/secrets/{secretName} (the `DetachAppSecret` operationId). DetachAppSecretWithResponse(ctx context.Context, appId AppId, secretName SecretName, reqEditors ...RequestEditorFn) (*DetachAppSecretResponse, error) + // CreateSourceUploadWithBodyWithResponse Create a source upload + // + // Creates an upload session for source intended for `appId`. The app does not need to exist yet. The response contains a short-lived transfer instruction for one exact staging object. Repeating the request with the same idempotency key and declaration while the session is pending and unexpired returns the same upload resource with a refreshed transfer instruction. Replays with a different declaration or after the session becomes ready, rejected, consumed, expired, or deleted return `409`. + // + // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /v1/apps/{appId}/source-uploads (the `CreateSourceUpload` operationId). + CreateSourceUploadWithBodyWithResponse(ctx context.Context, appId AppId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateSourceUploadResponse, error) + + // CreateSourceUploadWithResponse Create a source upload + // + // Creates an upload session for source intended for `appId`. The app does not need to exist yet. The response contains a short-lived transfer instruction for one exact staging object. Repeating the request with the same idempotency key and declaration while the session is pending and unexpired returns the same upload resource with a refreshed transfer instruction. Replays with a different declaration or after the session becomes ready, rejected, consumed, expired, or deleted return `409`. + // + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /v1/apps/{appId}/source-uploads (the `CreateSourceUpload` operationId). + CreateSourceUploadWithResponse(ctx context.Context, appId AppId, body CreateSourceUploadJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateSourceUploadResponse, error) + + // DeleteSourceUploadWithResponse Abort a source upload + // + // Aborts an unconsumed upload and removes its staging object. The session remains as a deleted tombstone so its object key cannot be reused. Repeating a successful abort is idempotent. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with DELETE /v1/apps/{appId}/source-uploads/{uploadId} (the `DeleteSourceUpload` operationId). + DeleteSourceUploadWithResponse(ctx context.Context, appId AppId, uploadId SourceUploadId, reqEditors ...RequestEditorFn) (*DeleteSourceUploadResponse, error) + + // GetSourceUploadWithResponse Get a source upload + // + // Returns the upload session belonging to the authenticated organization and `appId`. An upload belonging to another organization or app returns `404`. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /v1/apps/{appId}/source-uploads/{uploadId} (the `GetSourceUpload` operationId). + GetSourceUploadWithResponse(ctx context.Context, appId AppId, uploadId SourceUploadId, reqEditors ...RequestEditorFn) (*GetSourceUploadResponse, error) + + // CompleteSourceUploadWithResponse Complete a source upload + // + // Verifies the staging object's length, content type, and SHA-256 digest against the session declaration. A successful retry returns the existing ready resource. A rejected upload keeps its rejection so later retries return the same result. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /v1/apps/{appId}/source-uploads/{uploadId}/complete (the `CompleteSourceUpload` operationId). + CompleteSourceUploadWithResponse(ctx context.Context, appId AppId, uploadId SourceUploadId, reqEditors ...RequestEditorFn) (*CompleteSourceUploadResponse, error) + // StopAppWithResponse Stop an app // // Moves the app to `stopping` and returns `202` once that intent is persisted. Scale-to-zero and worker drain are performed asynchronously by the Scaler; `status` becomes `stopped` once all workers drain. In-flight tasks have a fixed, platform-managed grace period to complete; workers that exceed it are force-terminated and their tasks return to the queue per delivery guarantees. New task submissions remain accepted while `stopping`; after the app reaches `stopped`, submissions return `409 Conflict`. Precondition: `status = active`. @@ -5589,7 +7339,7 @@ type ClientWithResponsesInterface interface { // ListTasksWithResponse List tasks for an app // - // Lists TTL-bounded asynchronous task metadata for this app so a client can recover task ids after an interrupted long-poll or CLI session. Pending includes queued, running and retrying work. Tasks appear only within the configured recovery window. A page can be empty and still have `nextCursor`; continue until it is null. Pending entries are best effort and may disappear if the recovery store restarts; tracked tasks reappear on completion. This is not persisted task history. Each submission has a new task id, so client retries can appear as separate tasks. If the app is `stopped`, `deleting`, or `failed`, recovery stays available. Unknown or deleted apps return `404 Not Found`. + // Lists TTL-bounded asynchronous task metadata for this app so a client can recover task ids after an interrupted long-poll or CLI session. Pending includes queued, running and retrying work. Tasks appear only within the configured recovery window. A page can be empty and still have `nextCursor`; continue until it is null. Pending entries are best effort and may disappear if the recovery store restarts; tracked tasks reappear on completion. This is not persisted task history. A task id names one task, so resubmitting one does not add a second entry here. If the app is `stopped`, `deleting`, or `failed`, recovery stays available. Unknown or deleted apps return `404 Not Found`. // // Returns a wrapper object for the known response body format(s). // @@ -5603,7 +7353,7 @@ type ClientWithResponsesInterface interface { // Returns a wrapper object for the known response body format(s). // // Corresponds with GET /v1/apps/{appId}/tasks/{taskId} (the `GetTask` operationId). - GetTaskWithResponse(ctx context.Context, appId AppId, taskId string, reqEditors ...RequestEditorFn) (*GetTaskResponse, error) + GetTaskWithResponse(ctx context.Context, appId AppId, taskId TaskId, reqEditors ...RequestEditorFn) (*GetTaskResponse, error) // ListVersionsWithResponse List versions // @@ -5612,6 +7362,15 @@ type ClientWithResponsesInterface interface { // Corresponds with GET /v1/apps/{appId}/versions (the `ListVersions` operationId). ListVersionsWithResponse(ctx context.Context, appId AppId, params *ListVersionsParams, reqEditors ...RequestEditorFn) (*ListVersionsResponse, error) + // DeleteVersionWithResponse Delete a version + // + // Deletes an unused version while retaining its immutable history. Deleted versions are omitted from version lists, return `404` from version reads, and cannot be deployed. Returns `409` while the app is deleting, or when the version is active, is the app's only remaining version, has a non-stopped worker, or is targeted by a live rollout. Deleting an already deleted version returns `404`. This operation does not remove the version's OCI image. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with DELETE /v1/apps/{appId}/versions/{versionNumber} (the `DeleteVersion` operationId). + DeleteVersionWithResponse(ctx context.Context, appId AppId, versionNumber int32, reqEditors ...RequestEditorFn) (*DeleteVersionResponse, error) + // GetVersionWithResponse Get a version // // Returns a wrapper object for the known response body format(s). @@ -5621,7 +7380,7 @@ type ClientWithResponsesInterface interface { // ListWorkersWithResponse List workers // - // Returns a newest-first page of workers observed for the app (including terminal `stopped` rows until purged). Optional `status` narrows the page; a cursor must be replayed under the same status filter it was issued with. + // Returns a newest-first page of workers observed for the app (including terminal `stopped` rows until purged). Optional `state` and `status` narrow the page; a cursor must be replayed under the same filters it was issued with. // // Returns a wrapper object for the known response body format(s). // @@ -5754,48 +7513,113 @@ type ClientWithResponsesInterface interface { // Corresponds with PATCH /v1/gpu-types/{gpuTypeId}/prices/{priceId} (the `UpdateGpuTypePrice` operationId). UpdateGpuTypePriceWithResponse(ctx context.Context, gpuTypeId GpuTypeId, priceId openapi_types.UUID, body UpdateGpuTypePriceJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateGpuTypePriceResponse, error) - // ListSecretsWithResponse List secrets + // GetLogEntriesWithResponse Read one page of a named log query // - // Returns secret metadata only; encrypted values are never returned. + // Returns one page of log entries, newest first, with an opaque cursor for the next page when one exists. + // + // No query is registered yet: live tail, retention tiers and log quotas are decided in a follow-up ADR, so every request currently answers `404`. The route exists so the contract is fixed before the templates land. // // Returns a wrapper object for the known response body format(s). // - // Corresponds with GET /v1/secrets (the `ListSecrets` operationId). - ListSecretsWithResponse(ctx context.Context, params *ListSecretsParams, reqEditors ...RequestEditorFn) (*ListSecretsResponse, error) + // Corresponds with GET /v1/logs/queries/{queryId}/entries (the `GetLogEntries` operationId). + GetLogEntriesWithResponse(ctx context.Context, queryId QueryId, params *GetLogEntriesParams, reqEditors ...RequestEditorFn) (*GetLogEntriesResponse, error) - // CreateSecretWithBodyWithResponse Create a secret + // ListInsightsQueriesWithResponse List the metric and log queries this build can answer // - // Creates an organisation-scoped secret. Returns `409` if the name is already in use — including when a secret of that name is `pending_destroy`. List only shows active secrets, so a name can appear free while create still conflicts for as long as that row remains. Hard deletion of `pending_destroy` rows (which would release the name) is not performed by this API yet. Recreate-while-deleting may later reuse the pending row with the new value (same name, new ciphertext). + // The catalogue: every named query, its unit and aggregation, the selectors it accepts, the series it returns, and the windows actually backed by stored series. // - // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). + // This is the source of query ids. Clients discover ids here rather than carrying a list of their own, and render window tabs from `windows` rather than from the full ladder, so a window whose storage tier has no backing series stays invisible instead of rendering a tab with nothing behind it. // - // Corresponds with POST /v1/secrets (the `CreateSecret` operationId). - CreateSecretWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateSecretResponse, error) + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /v1/metrics/queries (the `ListInsightsQueries` operationId). + ListInsightsQueriesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListInsightsQueriesResponse, error) - // CreateSecretWithResponse Create a secret + // GetMetricSeriesWithResponse Read one named metric query // - // Creates an organisation-scoped secret. Returns `409` if the name is already in use — including when a secret of that name is `pending_destroy`. List only shows active secrets, so a name can appear free while create still conflicts for as long as that row remains. Hard deletion of `pending_destroy` rows (which would release the name) is not performed by this API yet. Recreate-while-deleting may later reuse the pending row with the new value (same name, new ciphertext). + // Returns one chart's data: a single timestamp axis shared by every series, and one dense value array per series aligned to it. // - // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + // Values are dense and positionally aligned to `t`, with an explicit `null` wherever there was no sample. Each timestamp is the END of its bucket, so `window.to` is inclusive and equals the last timestamp in `t`, while `window.from` is exclusive and is one `step_s` before the first. // - // Corresponds with POST /v1/secrets (the `CreateSecret` operationId). - CreateSecretWithResponse(ctx context.Context, body CreateSecretJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateSecretResponse, error) - - // DeleteSecretWithResponse Delete a secret + // An organization with no metrics yet is answered with the full axis and all-null series rather than an error. + // + // `apps_request_volume` returns one series per app: 24 hourly request counts over `window=24h` (`step_s` 3600, unit `requests`). Repeat `appId` once per id on the current list page to pad idle apps with all-null series, in request order. Hours that started before that live app's `createdAt` are null, so a reused app id does not inherit the previous generation's traffic still in the 24h store. The same `appId` pad applies to the list-scoped `apps_error_volume` and `apps_request_duration` queries. Other queries reject `appId`. Other windows are not available for these queries. // - // Soft-deletes a secret: marks the row `pending_destroy` and bumps revision. This API does not hard-delete the row; a future GC path is expected to remove unattached `pending_destroy` secrets and release the name, but that sweep is not implemented yet. Returns `409` while any app still attaches it — cascade-detach is not performed here; detach each holder with `DELETE .../apps/{id}/secrets/{name}` first. Attach/detach are control-plane records only in this release (they do not roll workers). While the row remains `pending_destroy` the name stays reserved, so create may return `409` even though list no longer shows the secret. Retries on an already-pending name are safe when no attachments remain (`204`); they still return `409` while attached. + // `endpoints_request_volume` is the endpoints-list counterpart: 24 hourly request counts per endpoint over `window=24h` (`step_s` 3600, unit `requests`). It requires `deployment` (the public app id, rewritten to the live deployment UUID). Repeat `endpointId` once per id on the current `listEndpoints` page to pad idle endpoints with all-null series, in request order. Hours that started before that endpoint row's `createdAt` are null, so a removed-then-readded path does not inherit the previous row's traffic. Other queries reject `endpointId`. Other windows are not available for this query. // // Returns a wrapper object for the known response body format(s). // - // Corresponds with DELETE /v1/secrets/{secretName} (the `DeleteSecret` operationId). - DeleteSecretWithResponse(ctx context.Context, secretName SecretName, reqEditors ...RequestEditorFn) (*DeleteSecretResponse, error) + // Corresponds with GET /v1/metrics/queries/{queryId}/series (the `GetMetricSeries` operationId). + GetMetricSeriesWithResponse(ctx context.Context, queryId QueryId, params *GetMetricSeriesParams, reqEditors ...RequestEditorFn) (*GetMetricSeriesResponse, error) - // UpdateSecretWithBodyWithResponse Update a secret + // UpsertOrgTenancyWithBodyWithResponse Set an organisation's serverless tenancy state + // + // Idempotent upsert for one customer organisation. The customer UUID is in the body — public paths never carry an organisation identifier (the authenticated API key names the *caller*, which for this route must be the Runware platform organisation). + // + // `state: active` runs Ensure: a Cloud KMS CryptoKey named after the organisation UUID, a Kubernetes service account `org-` in the shared app namespace, and a decrypt IAM binding on that key for the KSA principal. `state: disabled` runs teardown: disable the key's primary version, drop the decrypt binding, delete the KSA. The key itself is not destroyed — a destroyed key makes every ciphertext under it permanently unreadable. The local row stays as a tombstone so a later Ensure converges on the same names. + // + // A retry after a partial failure converges rather than duplicating objects. `200` returns the resulting receipt. `503` when Cloud KMS key-admin is rate-limited (60 writes/min) or otherwise unavailable; the caller (admin-api Messenger) retries the same PUT. // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // - // Corresponds with PUT /v1/secrets/{secretName} (the `UpdateSecret` operationId). - UpdateSecretWithBodyWithResponse(ctx context.Context, secretName SecretName, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateSecretResponse, error) + // Corresponds with PUT /v1/org-tenancies (the `UpsertOrgTenancy` operationId). + UpsertOrgTenancyWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpsertOrgTenancyResponse, error) + + // UpsertOrgTenancyWithResponse Set an organisation's serverless tenancy state + // + // Idempotent upsert for one customer organisation. The customer UUID is in the body — public paths never carry an organisation identifier (the authenticated API key names the *caller*, which for this route must be the Runware platform organisation). + // + // `state: active` runs Ensure: a Cloud KMS CryptoKey named after the organisation UUID, a Kubernetes service account `org-` in the shared app namespace, and a decrypt IAM binding on that key for the KSA principal. `state: disabled` runs teardown: disable the key's primary version, drop the decrypt binding, delete the KSA. The key itself is not destroyed — a destroyed key makes every ciphertext under it permanently unreadable. The local row stays as a tombstone so a later Ensure converges on the same names. + // + // A retry after a partial failure converges rather than duplicating objects. `200` returns the resulting receipt. `503` when Cloud KMS key-admin is rate-limited (60 writes/min) or otherwise unavailable; the caller (admin-api Messenger) retries the same PUT. + // + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with PUT /v1/org-tenancies (the `UpsertOrgTenancy` operationId). + UpsertOrgTenancyWithResponse(ctx context.Context, body UpsertOrgTenancyJSONRequestBody, reqEditors ...RequestEditorFn) (*UpsertOrgTenancyResponse, error) + + // ListSecretsWithResponse List secrets + // + // Returns secret metadata only; encrypted values are never returned. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /v1/secrets (the `ListSecrets` operationId). + ListSecretsWithResponse(ctx context.Context, params *ListSecretsParams, reqEditors ...RequestEditorFn) (*ListSecretsResponse, error) + + // CreateSecretWithBodyWithResponse Create a secret + // + // Creates an organisation-scoped secret. Returns `409` if the name is already in use — including when a secret of that name is `pending_destroy`. List only shows active secrets, so a name can appear free while create still conflicts for as long as that row remains. A `pending_destroy` row is removed, and its name released, by a background sweep once no running worker can still hold the value — there is no deadline on that wait, so a continuously busy app can hold a name for as long as it runs. Recreate-while-deleting may later reuse the pending row with the new value (same name, new ciphertext). + // + // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /v1/secrets (the `CreateSecret` operationId). + CreateSecretWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateSecretResponse, error) + + // CreateSecretWithResponse Create a secret + // + // Creates an organisation-scoped secret. Returns `409` if the name is already in use — including when a secret of that name is `pending_destroy`. List only shows active secrets, so a name can appear free while create still conflicts for as long as that row remains. A `pending_destroy` row is removed, and its name released, by a background sweep once no running worker can still hold the value — there is no deadline on that wait, so a continuously busy app can hold a name for as long as it runs. Recreate-while-deleting may later reuse the pending row with the new value (same name, new ciphertext). + // + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /v1/secrets (the `CreateSecret` operationId). + CreateSecretWithResponse(ctx context.Context, body CreateSecretJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateSecretResponse, error) + + // DeleteSecretWithResponse Delete a secret + // + // Soft-deletes a secret: marks the row `pending_destroy` and bumps revision. This API does not hard-delete the row. A background sweep removes the row and releases the name once no running worker can still hold the value — the value travels inside the worker's own environment, which is fixed when the container starts, so a worker keeps it until it stops. There is no deadline on that wait. Returns `409` while any app still attaches it — cascade-detach is not performed here; detach each holder with `DELETE .../apps/{id}/secrets/{name}` first. Attach and detach change the secret set for the next rollout. Neither operation rolls workers. While the row remains `pending_destroy` the name stays reserved, so create may return `409` even though list no longer shows the secret. Retries on an already-pending name are safe when no attachments remain (`204`); they still return `409` while attached. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with DELETE /v1/secrets/{secretName} (the `DeleteSecret` operationId). + DeleteSecretWithResponse(ctx context.Context, secretName SecretName, reqEditors ...RequestEditorFn) (*DeleteSecretResponse, error) + + // UpdateSecretWithBodyWithResponse Update a secret + // + // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with PUT /v1/secrets/{secretName} (the `UpdateSecret` operationId). + UpdateSecretWithBodyWithResponse(ctx context.Context, secretName SecretName, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateSecretResponse, error) // UpdateSecretWithResponse Update a secret // @@ -5973,6 +7797,8 @@ type CreateAppResponse struct { ApplicationproblemJSON401 *Unauthorized // ApplicationproblemJSON403 the response for an HTTP 403 `application/problem+json` response ApplicationproblemJSON403 *Forbidden + // ApplicationproblemJSON404 the response for an HTTP 404 `application/problem+json` response + ApplicationproblemJSON404 *NotFound // ApplicationproblemJSON409 the response for an HTTP 409 `application/problem+json` response ApplicationproblemJSON409 *Conflict // ApplicationproblemJSON422 the response for an HTTP 422 `application/problem+json` response @@ -6001,6 +7827,11 @@ func (r CreateAppResponse) GetApplicationproblemJSON403() *Forbidden { return r.ApplicationproblemJSON403 } +// GetApplicationproblemJSON404 returns the response for an HTTP 404 `application/problem+json` response +func (r CreateAppResponse) GetApplicationproblemJSON404() *NotFound { + return r.ApplicationproblemJSON404 +} + // GetApplicationproblemJSON409 returns the response for an HTTP 409 `application/problem+json` response func (r CreateAppResponse) GetApplicationproblemJSON409() *Conflict { return r.ApplicationproblemJSON409 @@ -6278,10 +8109,13 @@ type ListBuildsResponse struct { HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response JSON200 *struct { - Data *[]Build `json:"data,omitempty"` + Data []Build `json:"data"` // NextCursor Cursor for the next page; null when there are no more items. NextCursor *string `json:"nextCursor,omitempty"` + + // Summary Collection totals for this app's builds list. Independent of the page: the same values on every cursor, including a seek past the last row. `total` counts builds. `versions` counts versions on the same app — the same predicate as `listVersions` `summary.total`, excluding soft-deleted versions. + Summary BuildListSummary `json:"summary"` } // ApplicationproblemJSON401 the response for an HTTP 401 `application/problem+json` response ApplicationproblemJSON401 *Unauthorized @@ -6295,10 +8129,13 @@ type ListBuildsResponse struct { // GetJSON200 returns the response for an HTTP 200 `application/json` response func (r ListBuildsResponse) GetJSON200() *struct { - Data *[]Build `json:"data,omitempty"` + Data []Build `json:"data"` // NextCursor Cursor for the next page; null when there are no more items. NextCursor *string `json:"nextCursor,omitempty"` + + // Summary Collection totals for this app's builds list. Independent of the page: the same values on every cursor, including a seek past the last row. `total` counts builds. `versions` counts versions on the same app — the same predicate as `listVersions` `summary.total`, excluding soft-deleted versions. + Summary BuildListSummary `json:"summary"` } { return r.JSON200 } @@ -6352,6 +8189,96 @@ func (r ListBuildsResponse) ContentType() string { return "" } +type DeleteBuildResponse struct { + Body []byte + HTTPResponse *http.Response + // ApplicationproblemJSON400 the response for an HTTP 400 `application/problem+json` response + ApplicationproblemJSON400 *BadRequest + // ApplicationproblemJSON401 the response for an HTTP 401 `application/problem+json` response + ApplicationproblemJSON401 *Unauthorized + // ApplicationproblemJSON403 the response for an HTTP 403 `application/problem+json` response + ApplicationproblemJSON403 *Forbidden + // ApplicationproblemJSON404 the response for an HTTP 404 `application/problem+json` response + ApplicationproblemJSON404 *NotFound + // ApplicationproblemJSON409 the response for an HTTP 409 `application/problem+json` response + ApplicationproblemJSON409 *Conflict + // ApplicationproblemJSON422 the response for an HTTP 422 `application/problem+json` response + ApplicationproblemJSON422 *ValidationError + // ApplicationproblemJSON502 the response for an HTTP 502 `application/problem+json` response + ApplicationproblemJSON502 *BadGateway + // ApplicationproblemJSON503 the response for an HTTP 503 `application/problem+json` response + ApplicationproblemJSON503 *ServiceUnavailable +} + +// GetApplicationproblemJSON400 returns the response for an HTTP 400 `application/problem+json` response +func (r DeleteBuildResponse) GetApplicationproblemJSON400() *BadRequest { + return r.ApplicationproblemJSON400 +} + +// GetApplicationproblemJSON401 returns the response for an HTTP 401 `application/problem+json` response +func (r DeleteBuildResponse) GetApplicationproblemJSON401() *Unauthorized { + return r.ApplicationproblemJSON401 +} + +// GetApplicationproblemJSON403 returns the response for an HTTP 403 `application/problem+json` response +func (r DeleteBuildResponse) GetApplicationproblemJSON403() *Forbidden { + return r.ApplicationproblemJSON403 +} + +// GetApplicationproblemJSON404 returns the response for an HTTP 404 `application/problem+json` response +func (r DeleteBuildResponse) GetApplicationproblemJSON404() *NotFound { + return r.ApplicationproblemJSON404 +} + +// GetApplicationproblemJSON409 returns the response for an HTTP 409 `application/problem+json` response +func (r DeleteBuildResponse) GetApplicationproblemJSON409() *Conflict { + return r.ApplicationproblemJSON409 +} + +// GetApplicationproblemJSON422 returns the response for an HTTP 422 `application/problem+json` response +func (r DeleteBuildResponse) GetApplicationproblemJSON422() *ValidationError { + return r.ApplicationproblemJSON422 +} + +// GetApplicationproblemJSON502 returns the response for an HTTP 502 `application/problem+json` response +func (r DeleteBuildResponse) GetApplicationproblemJSON502() *BadGateway { + return r.ApplicationproblemJSON502 +} + +// GetApplicationproblemJSON503 returns the response for an HTTP 503 `application/problem+json` response +func (r DeleteBuildResponse) GetApplicationproblemJSON503() *ServiceUnavailable { + return r.ApplicationproblemJSON503 +} + +// GetBody returns the raw response body bytes +func (r DeleteBuildResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r DeleteBuildResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteBuildResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r DeleteBuildResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + type GetBuildResponse struct { Body []byte HTTPResponse *http.Response @@ -7223,6 +9150,8 @@ type StartSyncTaskResponse struct { HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response JSON200 *Task + // JSON202 the response for an HTTP 202 `application/json` response + JSON202 *TaskAccepted // ApplicationproblemJSON400 the response for an HTTP 400 `application/problem+json` response ApplicationproblemJSON400 *BadRequest // ApplicationproblemJSON401 the response for an HTTP 401 `application/problem+json` response @@ -7237,8 +9166,6 @@ type StartSyncTaskResponse struct { ApplicationproblemJSON422 *ValidationError // ApplicationproblemJSON503 the response for an HTTP 503 `application/problem+json` response ApplicationproblemJSON503 *ServiceUnavailable - // ApplicationproblemJSON504 the response for an HTTP 504 `application/problem+json` response - ApplicationproblemJSON504 *Timeout } // GetJSON200 returns the response for an HTTP 200 `application/json` response @@ -7246,6 +9173,11 @@ func (r StartSyncTaskResponse) GetJSON200() *Task { return r.JSON200 } +// GetJSON202 returns the response for an HTTP 202 `application/json` response +func (r StartSyncTaskResponse) GetJSON202() *TaskAccepted { + return r.JSON202 +} + // GetApplicationproblemJSON400 returns the response for an HTTP 400 `application/problem+json` response func (r StartSyncTaskResponse) GetApplicationproblemJSON400() *BadRequest { return r.ApplicationproblemJSON400 @@ -7281,11 +9213,6 @@ func (r StartSyncTaskResponse) GetApplicationproblemJSON503() *ServiceUnavailabl return r.ApplicationproblemJSON503 } -// GetApplicationproblemJSON504 returns the response for an HTTP 504 `application/problem+json` response -func (r StartSyncTaskResponse) GetApplicationproblemJSON504() *Timeout { - return r.ApplicationproblemJSON504 -} - // GetBody returns the raw response body bytes func (r StartSyncTaskResponse) GetBody() []byte { return r.Body @@ -7636,60 +9563,74 @@ func (r DetachAppSecretResponse) ContentType() string { return "" } -type StopAppResponse struct { +type CreateSourceUploadResponse struct { Body []byte HTTPResponse *http.Response - // JSON202 the response for an HTTP 202 `application/json` response - JSON202 *App + // JSON201 the response for an HTTP 201 `application/json` response + JSON201 *SourceUploadCreation + // ApplicationproblemJSON400 the response for an HTTP 400 `application/problem+json` response + ApplicationproblemJSON400 *BadRequest // ApplicationproblemJSON401 the response for an HTTP 401 `application/problem+json` response ApplicationproblemJSON401 *Unauthorized // ApplicationproblemJSON403 the response for an HTTP 403 `application/problem+json` response ApplicationproblemJSON403 *Forbidden - // ApplicationproblemJSON404 the response for an HTTP 404 `application/problem+json` response - ApplicationproblemJSON404 *NotFound // ApplicationproblemJSON409 the response for an HTTP 409 `application/problem+json` response ApplicationproblemJSON409 *Conflict + // ApplicationproblemJSON422 the response for an HTTP 422 `application/problem+json` response + ApplicationproblemJSON422 *ValidationError + // ApplicationproblemJSON502 the response for an HTTP 502 `application/problem+json` response + ApplicationproblemJSON502 *BadGateway // ApplicationproblemJSON503 the response for an HTTP 503 `application/problem+json` response ApplicationproblemJSON503 *ServiceUnavailable } -// GetJSON202 returns the response for an HTTP 202 `application/json` response -func (r StopAppResponse) GetJSON202() *App { - return r.JSON202 +// GetJSON201 returns the response for an HTTP 201 `application/json` response +func (r CreateSourceUploadResponse) GetJSON201() *SourceUploadCreation { + return r.JSON201 +} + +// GetApplicationproblemJSON400 returns the response for an HTTP 400 `application/problem+json` response +func (r CreateSourceUploadResponse) GetApplicationproblemJSON400() *BadRequest { + return r.ApplicationproblemJSON400 } // GetApplicationproblemJSON401 returns the response for an HTTP 401 `application/problem+json` response -func (r StopAppResponse) GetApplicationproblemJSON401() *Unauthorized { +func (r CreateSourceUploadResponse) GetApplicationproblemJSON401() *Unauthorized { return r.ApplicationproblemJSON401 } // GetApplicationproblemJSON403 returns the response for an HTTP 403 `application/problem+json` response -func (r StopAppResponse) GetApplicationproblemJSON403() *Forbidden { +func (r CreateSourceUploadResponse) GetApplicationproblemJSON403() *Forbidden { return r.ApplicationproblemJSON403 } -// GetApplicationproblemJSON404 returns the response for an HTTP 404 `application/problem+json` response -func (r StopAppResponse) GetApplicationproblemJSON404() *NotFound { - return r.ApplicationproblemJSON404 -} - // GetApplicationproblemJSON409 returns the response for an HTTP 409 `application/problem+json` response -func (r StopAppResponse) GetApplicationproblemJSON409() *Conflict { +func (r CreateSourceUploadResponse) GetApplicationproblemJSON409() *Conflict { return r.ApplicationproblemJSON409 } +// GetApplicationproblemJSON422 returns the response for an HTTP 422 `application/problem+json` response +func (r CreateSourceUploadResponse) GetApplicationproblemJSON422() *ValidationError { + return r.ApplicationproblemJSON422 +} + +// GetApplicationproblemJSON502 returns the response for an HTTP 502 `application/problem+json` response +func (r CreateSourceUploadResponse) GetApplicationproblemJSON502() *BadGateway { + return r.ApplicationproblemJSON502 +} + // GetApplicationproblemJSON503 returns the response for an HTTP 503 `application/problem+json` response -func (r StopAppResponse) GetApplicationproblemJSON503() *ServiceUnavailable { +func (r CreateSourceUploadResponse) GetApplicationproblemJSON503() *ServiceUnavailable { return r.ApplicationproblemJSON503 } // GetBody returns the raw response body bytes -func (r StopAppResponse) GetBody() []byte { +func (r CreateSourceUploadResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r StopAppResponse) Status() string { +func (r CreateSourceUploadResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -7697,7 +9638,7 @@ func (r StopAppResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r StopAppResponse) StatusCode() int { +func (r CreateSourceUploadResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -7705,23 +9646,16 @@ func (r StopAppResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r StopAppResponse) ContentType() string { +func (r CreateSourceUploadResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type ListTasksResponse struct { +type DeleteSourceUploadResponse struct { Body []byte HTTPResponse *http.Response - // JSON200 the response for an HTTP 200 `application/json` response - JSON200 *struct { - Data *[]Task `json:"data,omitempty"` - - // NextCursor Cursor for the next page; null when there are no more items. - NextCursor *string `json:"nextCursor,omitempty"` - } // ApplicationproblemJSON400 the response for an HTTP 400 `application/problem+json` response ApplicationproblemJSON400 *BadRequest // ApplicationproblemJSON401 the response for an HTTP 401 `application/problem+json` response @@ -7730,59 +9664,63 @@ type ListTasksResponse struct { ApplicationproblemJSON403 *Forbidden // ApplicationproblemJSON404 the response for an HTTP 404 `application/problem+json` response ApplicationproblemJSON404 *NotFound + // ApplicationproblemJSON409 the response for an HTTP 409 `application/problem+json` response + ApplicationproblemJSON409 *Conflict // ApplicationproblemJSON422 the response for an HTTP 422 `application/problem+json` response ApplicationproblemJSON422 *ValidationError + // ApplicationproblemJSON502 the response for an HTTP 502 `application/problem+json` response + ApplicationproblemJSON502 *BadGateway // ApplicationproblemJSON503 the response for an HTTP 503 `application/problem+json` response ApplicationproblemJSON503 *ServiceUnavailable } -// GetJSON200 returns the response for an HTTP 200 `application/json` response -func (r ListTasksResponse) GetJSON200() *struct { - Data *[]Task `json:"data,omitempty"` - - // NextCursor Cursor for the next page; null when there are no more items. - NextCursor *string `json:"nextCursor,omitempty"` -} { - return r.JSON200 -} - // GetApplicationproblemJSON400 returns the response for an HTTP 400 `application/problem+json` response -func (r ListTasksResponse) GetApplicationproblemJSON400() *BadRequest { +func (r DeleteSourceUploadResponse) GetApplicationproblemJSON400() *BadRequest { return r.ApplicationproblemJSON400 } // GetApplicationproblemJSON401 returns the response for an HTTP 401 `application/problem+json` response -func (r ListTasksResponse) GetApplicationproblemJSON401() *Unauthorized { +func (r DeleteSourceUploadResponse) GetApplicationproblemJSON401() *Unauthorized { return r.ApplicationproblemJSON401 } // GetApplicationproblemJSON403 returns the response for an HTTP 403 `application/problem+json` response -func (r ListTasksResponse) GetApplicationproblemJSON403() *Forbidden { +func (r DeleteSourceUploadResponse) GetApplicationproblemJSON403() *Forbidden { return r.ApplicationproblemJSON403 } // GetApplicationproblemJSON404 returns the response for an HTTP 404 `application/problem+json` response -func (r ListTasksResponse) GetApplicationproblemJSON404() *NotFound { +func (r DeleteSourceUploadResponse) GetApplicationproblemJSON404() *NotFound { return r.ApplicationproblemJSON404 } +// GetApplicationproblemJSON409 returns the response for an HTTP 409 `application/problem+json` response +func (r DeleteSourceUploadResponse) GetApplicationproblemJSON409() *Conflict { + return r.ApplicationproblemJSON409 +} + // GetApplicationproblemJSON422 returns the response for an HTTP 422 `application/problem+json` response -func (r ListTasksResponse) GetApplicationproblemJSON422() *ValidationError { +func (r DeleteSourceUploadResponse) GetApplicationproblemJSON422() *ValidationError { return r.ApplicationproblemJSON422 } +// GetApplicationproblemJSON502 returns the response for an HTTP 502 `application/problem+json` response +func (r DeleteSourceUploadResponse) GetApplicationproblemJSON502() *BadGateway { + return r.ApplicationproblemJSON502 +} + // GetApplicationproblemJSON503 returns the response for an HTTP 503 `application/problem+json` response -func (r ListTasksResponse) GetApplicationproblemJSON503() *ServiceUnavailable { +func (r DeleteSourceUploadResponse) GetApplicationproblemJSON503() *ServiceUnavailable { return r.ApplicationproblemJSON503 } // GetBody returns the raw response body bytes -func (r ListTasksResponse) GetBody() []byte { +func (r DeleteSourceUploadResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r ListTasksResponse) Status() string { +func (r DeleteSourceUploadResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -7790,7 +9728,7 @@ func (r ListTasksResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ListTasksResponse) StatusCode() int { +func (r DeleteSourceUploadResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -7798,60 +9736,74 @@ func (r ListTasksResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r ListTasksResponse) ContentType() string { +func (r DeleteSourceUploadResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type GetTaskResponse struct { +type GetSourceUploadResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response - JSON200 *Task + JSON200 *SourceUpload + // ApplicationproblemJSON400 the response for an HTTP 400 `application/problem+json` response + ApplicationproblemJSON400 *BadRequest // ApplicationproblemJSON401 the response for an HTTP 401 `application/problem+json` response ApplicationproblemJSON401 *Unauthorized // ApplicationproblemJSON403 the response for an HTTP 403 `application/problem+json` response ApplicationproblemJSON403 *Forbidden // ApplicationproblemJSON404 the response for an HTTP 404 `application/problem+json` response ApplicationproblemJSON404 *NotFound + // ApplicationproblemJSON422 the response for an HTTP 422 `application/problem+json` response + ApplicationproblemJSON422 *ValidationError // ApplicationproblemJSON503 the response for an HTTP 503 `application/problem+json` response ApplicationproblemJSON503 *ServiceUnavailable } // GetJSON200 returns the response for an HTTP 200 `application/json` response -func (r GetTaskResponse) GetJSON200() *Task { +func (r GetSourceUploadResponse) GetJSON200() *SourceUpload { return r.JSON200 } +// GetApplicationproblemJSON400 returns the response for an HTTP 400 `application/problem+json` response +func (r GetSourceUploadResponse) GetApplicationproblemJSON400() *BadRequest { + return r.ApplicationproblemJSON400 +} + // GetApplicationproblemJSON401 returns the response for an HTTP 401 `application/problem+json` response -func (r GetTaskResponse) GetApplicationproblemJSON401() *Unauthorized { +func (r GetSourceUploadResponse) GetApplicationproblemJSON401() *Unauthorized { return r.ApplicationproblemJSON401 } // GetApplicationproblemJSON403 returns the response for an HTTP 403 `application/problem+json` response -func (r GetTaskResponse) GetApplicationproblemJSON403() *Forbidden { +func (r GetSourceUploadResponse) GetApplicationproblemJSON403() *Forbidden { return r.ApplicationproblemJSON403 } // GetApplicationproblemJSON404 returns the response for an HTTP 404 `application/problem+json` response -func (r GetTaskResponse) GetApplicationproblemJSON404() *NotFound { +func (r GetSourceUploadResponse) GetApplicationproblemJSON404() *NotFound { return r.ApplicationproblemJSON404 } +// GetApplicationproblemJSON422 returns the response for an HTTP 422 `application/problem+json` response +func (r GetSourceUploadResponse) GetApplicationproblemJSON422() *ValidationError { + return r.ApplicationproblemJSON422 +} + // GetApplicationproblemJSON503 returns the response for an HTTP 503 `application/problem+json` response -func (r GetTaskResponse) GetApplicationproblemJSON503() *ServiceUnavailable { +func (r GetSourceUploadResponse) GetApplicationproblemJSON503() *ServiceUnavailable { return r.ApplicationproblemJSON503 } // GetBody returns the raw response body bytes -func (r GetTaskResponse) GetBody() []byte { +func (r GetSourceUploadResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r GetTaskResponse) Status() string { +func (r GetSourceUploadResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -7859,7 +9811,7 @@ func (r GetTaskResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetTaskResponse) StatusCode() int { +func (r GetSourceUploadResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -7867,70 +9819,88 @@ func (r GetTaskResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r GetTaskResponse) ContentType() string { +func (r GetSourceUploadResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type ListVersionsResponse struct { +type CompleteSourceUploadResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response - JSON200 *struct { - Data *[]Version `json:"data,omitempty"` - - // NextCursor Cursor for the next page; null when there are no more items. - NextCursor *string `json:"nextCursor,omitempty"` - } + JSON200 *SourceUpload + // ApplicationproblemJSON400 the response for an HTTP 400 `application/problem+json` response + ApplicationproblemJSON400 *BadRequest // ApplicationproblemJSON401 the response for an HTTP 401 `application/problem+json` response ApplicationproblemJSON401 *Unauthorized // ApplicationproblemJSON403 the response for an HTTP 403 `application/problem+json` response ApplicationproblemJSON403 *Forbidden // ApplicationproblemJSON404 the response for an HTTP 404 `application/problem+json` response ApplicationproblemJSON404 *NotFound + // ApplicationproblemJSON409 the response for an HTTP 409 `application/problem+json` response + ApplicationproblemJSON409 *Conflict + // ApplicationproblemJSON422 the response for an HTTP 422 `application/problem+json` response + ApplicationproblemJSON422 *ValidationError + // ApplicationproblemJSON502 the response for an HTTP 502 `application/problem+json` response + ApplicationproblemJSON502 *BadGateway // ApplicationproblemJSON503 the response for an HTTP 503 `application/problem+json` response ApplicationproblemJSON503 *ServiceUnavailable } // GetJSON200 returns the response for an HTTP 200 `application/json` response -func (r ListVersionsResponse) GetJSON200() *struct { - Data *[]Version `json:"data,omitempty"` - - // NextCursor Cursor for the next page; null when there are no more items. - NextCursor *string `json:"nextCursor,omitempty"` -} { +func (r CompleteSourceUploadResponse) GetJSON200() *SourceUpload { return r.JSON200 } -// GetApplicationproblemJSON401 returns the response for an HTTP 401 `application/problem+json` response -func (r ListVersionsResponse) GetApplicationproblemJSON401() *Unauthorized { - return r.ApplicationproblemJSON401 +// GetApplicationproblemJSON400 returns the response for an HTTP 400 `application/problem+json` response +func (r CompleteSourceUploadResponse) GetApplicationproblemJSON400() *BadRequest { + return r.ApplicationproblemJSON400 +} + +// GetApplicationproblemJSON401 returns the response for an HTTP 401 `application/problem+json` response +func (r CompleteSourceUploadResponse) GetApplicationproblemJSON401() *Unauthorized { + return r.ApplicationproblemJSON401 } // GetApplicationproblemJSON403 returns the response for an HTTP 403 `application/problem+json` response -func (r ListVersionsResponse) GetApplicationproblemJSON403() *Forbidden { +func (r CompleteSourceUploadResponse) GetApplicationproblemJSON403() *Forbidden { return r.ApplicationproblemJSON403 } // GetApplicationproblemJSON404 returns the response for an HTTP 404 `application/problem+json` response -func (r ListVersionsResponse) GetApplicationproblemJSON404() *NotFound { +func (r CompleteSourceUploadResponse) GetApplicationproblemJSON404() *NotFound { return r.ApplicationproblemJSON404 } +// GetApplicationproblemJSON409 returns the response for an HTTP 409 `application/problem+json` response +func (r CompleteSourceUploadResponse) GetApplicationproblemJSON409() *Conflict { + return r.ApplicationproblemJSON409 +} + +// GetApplicationproblemJSON422 returns the response for an HTTP 422 `application/problem+json` response +func (r CompleteSourceUploadResponse) GetApplicationproblemJSON422() *ValidationError { + return r.ApplicationproblemJSON422 +} + +// GetApplicationproblemJSON502 returns the response for an HTTP 502 `application/problem+json` response +func (r CompleteSourceUploadResponse) GetApplicationproblemJSON502() *BadGateway { + return r.ApplicationproblemJSON502 +} + // GetApplicationproblemJSON503 returns the response for an HTTP 503 `application/problem+json` response -func (r ListVersionsResponse) GetApplicationproblemJSON503() *ServiceUnavailable { +func (r CompleteSourceUploadResponse) GetApplicationproblemJSON503() *ServiceUnavailable { return r.ApplicationproblemJSON503 } // GetBody returns the raw response body bytes -func (r ListVersionsResponse) GetBody() []byte { +func (r CompleteSourceUploadResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r ListVersionsResponse) Status() string { +func (r CompleteSourceUploadResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -7938,7 +9908,7 @@ func (r ListVersionsResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ListVersionsResponse) StatusCode() int { +func (r CompleteSourceUploadResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -7946,60 +9916,67 @@ func (r ListVersionsResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r ListVersionsResponse) ContentType() string { +func (r CompleteSourceUploadResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type GetVersionResponse struct { +type StopAppResponse struct { Body []byte HTTPResponse *http.Response - // JSON200 the response for an HTTP 200 `application/json` response - JSON200 *Version + // JSON202 the response for an HTTP 202 `application/json` response + JSON202 *App // ApplicationproblemJSON401 the response for an HTTP 401 `application/problem+json` response ApplicationproblemJSON401 *Unauthorized // ApplicationproblemJSON403 the response for an HTTP 403 `application/problem+json` response ApplicationproblemJSON403 *Forbidden // ApplicationproblemJSON404 the response for an HTTP 404 `application/problem+json` response ApplicationproblemJSON404 *NotFound + // ApplicationproblemJSON409 the response for an HTTP 409 `application/problem+json` response + ApplicationproblemJSON409 *Conflict // ApplicationproblemJSON503 the response for an HTTP 503 `application/problem+json` response ApplicationproblemJSON503 *ServiceUnavailable } -// GetJSON200 returns the response for an HTTP 200 `application/json` response -func (r GetVersionResponse) GetJSON200() *Version { - return r.JSON200 +// GetJSON202 returns the response for an HTTP 202 `application/json` response +func (r StopAppResponse) GetJSON202() *App { + return r.JSON202 } // GetApplicationproblemJSON401 returns the response for an HTTP 401 `application/problem+json` response -func (r GetVersionResponse) GetApplicationproblemJSON401() *Unauthorized { +func (r StopAppResponse) GetApplicationproblemJSON401() *Unauthorized { return r.ApplicationproblemJSON401 } // GetApplicationproblemJSON403 returns the response for an HTTP 403 `application/problem+json` response -func (r GetVersionResponse) GetApplicationproblemJSON403() *Forbidden { +func (r StopAppResponse) GetApplicationproblemJSON403() *Forbidden { return r.ApplicationproblemJSON403 } // GetApplicationproblemJSON404 returns the response for an HTTP 404 `application/problem+json` response -func (r GetVersionResponse) GetApplicationproblemJSON404() *NotFound { +func (r StopAppResponse) GetApplicationproblemJSON404() *NotFound { return r.ApplicationproblemJSON404 } +// GetApplicationproblemJSON409 returns the response for an HTTP 409 `application/problem+json` response +func (r StopAppResponse) GetApplicationproblemJSON409() *Conflict { + return r.ApplicationproblemJSON409 +} + // GetApplicationproblemJSON503 returns the response for an HTTP 503 `application/problem+json` response -func (r GetVersionResponse) GetApplicationproblemJSON503() *ServiceUnavailable { +func (r StopAppResponse) GetApplicationproblemJSON503() *ServiceUnavailable { return r.ApplicationproblemJSON503 } // GetBody returns the raw response body bytes -func (r GetVersionResponse) GetBody() []byte { +func (r StopAppResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r GetVersionResponse) Status() string { +func (r StopAppResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8007,7 +9984,7 @@ func (r GetVersionResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetVersionResponse) StatusCode() int { +func (r StopAppResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -8015,19 +9992,19 @@ func (r GetVersionResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r GetVersionResponse) ContentType() string { +func (r StopAppResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type ListWorkersResponse struct { +type ListTasksResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response JSON200 *struct { - Data *[]Worker `json:"data,omitempty"` + Data *[]Task `json:"data,omitempty"` // NextCursor Cursor for the next page; null when there are no more items. NextCursor *string `json:"nextCursor,omitempty"` @@ -8047,8 +10024,8 @@ type ListWorkersResponse struct { } // GetJSON200 returns the response for an HTTP 200 `application/json` response -func (r ListWorkersResponse) GetJSON200() *struct { - Data *[]Worker `json:"data,omitempty"` +func (r ListTasksResponse) GetJSON200() *struct { + Data *[]Task `json:"data,omitempty"` // NextCursor Cursor for the next page; null when there are no more items. NextCursor *string `json:"nextCursor,omitempty"` @@ -8057,42 +10034,42 @@ func (r ListWorkersResponse) GetJSON200() *struct { } // GetApplicationproblemJSON400 returns the response for an HTTP 400 `application/problem+json` response -func (r ListWorkersResponse) GetApplicationproblemJSON400() *BadRequest { +func (r ListTasksResponse) GetApplicationproblemJSON400() *BadRequest { return r.ApplicationproblemJSON400 } // GetApplicationproblemJSON401 returns the response for an HTTP 401 `application/problem+json` response -func (r ListWorkersResponse) GetApplicationproblemJSON401() *Unauthorized { +func (r ListTasksResponse) GetApplicationproblemJSON401() *Unauthorized { return r.ApplicationproblemJSON401 } // GetApplicationproblemJSON403 returns the response for an HTTP 403 `application/problem+json` response -func (r ListWorkersResponse) GetApplicationproblemJSON403() *Forbidden { +func (r ListTasksResponse) GetApplicationproblemJSON403() *Forbidden { return r.ApplicationproblemJSON403 } // GetApplicationproblemJSON404 returns the response for an HTTP 404 `application/problem+json` response -func (r ListWorkersResponse) GetApplicationproblemJSON404() *NotFound { +func (r ListTasksResponse) GetApplicationproblemJSON404() *NotFound { return r.ApplicationproblemJSON404 } // GetApplicationproblemJSON422 returns the response for an HTTP 422 `application/problem+json` response -func (r ListWorkersResponse) GetApplicationproblemJSON422() *ValidationError { +func (r ListTasksResponse) GetApplicationproblemJSON422() *ValidationError { return r.ApplicationproblemJSON422 } // GetApplicationproblemJSON503 returns the response for an HTTP 503 `application/problem+json` response -func (r ListWorkersResponse) GetApplicationproblemJSON503() *ServiceUnavailable { +func (r ListTasksResponse) GetApplicationproblemJSON503() *ServiceUnavailable { return r.ApplicationproblemJSON503 } // GetBody returns the raw response body bytes -func (r ListWorkersResponse) GetBody() []byte { +func (r ListTasksResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r ListWorkersResponse) Status() string { +func (r ListTasksResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8100,7 +10077,7 @@ func (r ListWorkersResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ListWorkersResponse) StatusCode() int { +func (r ListTasksResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -8108,74 +10085,60 @@ func (r ListWorkersResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r ListWorkersResponse) ContentType() string { +func (r ListTasksResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type GetWorkerResponse struct { +type GetTaskResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response - JSON200 *Worker - // ApplicationproblemJSON400 the response for an HTTP 400 `application/problem+json` response - ApplicationproblemJSON400 *BadRequest + JSON200 *Task // ApplicationproblemJSON401 the response for an HTTP 401 `application/problem+json` response ApplicationproblemJSON401 *Unauthorized // ApplicationproblemJSON403 the response for an HTTP 403 `application/problem+json` response ApplicationproblemJSON403 *Forbidden // ApplicationproblemJSON404 the response for an HTTP 404 `application/problem+json` response ApplicationproblemJSON404 *NotFound - // ApplicationproblemJSON422 the response for an HTTP 422 `application/problem+json` response - ApplicationproblemJSON422 *ValidationError // ApplicationproblemJSON503 the response for an HTTP 503 `application/problem+json` response ApplicationproblemJSON503 *ServiceUnavailable } // GetJSON200 returns the response for an HTTP 200 `application/json` response -func (r GetWorkerResponse) GetJSON200() *Worker { +func (r GetTaskResponse) GetJSON200() *Task { return r.JSON200 } -// GetApplicationproblemJSON400 returns the response for an HTTP 400 `application/problem+json` response -func (r GetWorkerResponse) GetApplicationproblemJSON400() *BadRequest { - return r.ApplicationproblemJSON400 -} - // GetApplicationproblemJSON401 returns the response for an HTTP 401 `application/problem+json` response -func (r GetWorkerResponse) GetApplicationproblemJSON401() *Unauthorized { +func (r GetTaskResponse) GetApplicationproblemJSON401() *Unauthorized { return r.ApplicationproblemJSON401 } // GetApplicationproblemJSON403 returns the response for an HTTP 403 `application/problem+json` response -func (r GetWorkerResponse) GetApplicationproblemJSON403() *Forbidden { +func (r GetTaskResponse) GetApplicationproblemJSON403() *Forbidden { return r.ApplicationproblemJSON403 } // GetApplicationproblemJSON404 returns the response for an HTTP 404 `application/problem+json` response -func (r GetWorkerResponse) GetApplicationproblemJSON404() *NotFound { +func (r GetTaskResponse) GetApplicationproblemJSON404() *NotFound { return r.ApplicationproblemJSON404 } -// GetApplicationproblemJSON422 returns the response for an HTTP 422 `application/problem+json` response -func (r GetWorkerResponse) GetApplicationproblemJSON422() *ValidationError { - return r.ApplicationproblemJSON422 -} - // GetApplicationproblemJSON503 returns the response for an HTTP 503 `application/problem+json` response -func (r GetWorkerResponse) GetApplicationproblemJSON503() *ServiceUnavailable { +func (r GetTaskResponse) GetApplicationproblemJSON503() *ServiceUnavailable { return r.ApplicationproblemJSON503 } // GetBody returns the raw response body bytes -func (r GetWorkerResponse) GetBody() []byte { +func (r GetTaskResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r GetWorkerResponse) Status() string { +func (r GetTaskResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8183,7 +10146,7 @@ func (r GetWorkerResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetWorkerResponse) StatusCode() int { +func (r GetTaskResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -8191,53 +10154,76 @@ func (r GetWorkerResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r GetWorkerResponse) ContentType() string { +func (r GetTaskResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type ListGpuTypesResponse struct { +type ListVersionsResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response - JSON200 *GpuTypeList + JSON200 *struct { + Data []Version `json:"data"` + + // NextCursor Cursor for the next page; null when there are no more items. + NextCursor *string `json:"nextCursor,omitempty"` + + // Summary Collection totals for a paged list. Independent of the page: `total` is the COUNT of items in the collection and is the same value on every page, including a cursor that seeks past the last row. + Summary ListSummary `json:"summary"` + } // ApplicationproblemJSON401 the response for an HTTP 401 `application/problem+json` response ApplicationproblemJSON401 *Unauthorized // ApplicationproblemJSON403 the response for an HTTP 403 `application/problem+json` response ApplicationproblemJSON403 *Forbidden + // ApplicationproblemJSON404 the response for an HTTP 404 `application/problem+json` response + ApplicationproblemJSON404 *NotFound // ApplicationproblemJSON503 the response for an HTTP 503 `application/problem+json` response ApplicationproblemJSON503 *ServiceUnavailable } // GetJSON200 returns the response for an HTTP 200 `application/json` response -func (r ListGpuTypesResponse) GetJSON200() *GpuTypeList { +func (r ListVersionsResponse) GetJSON200() *struct { + Data []Version `json:"data"` + + // NextCursor Cursor for the next page; null when there are no more items. + NextCursor *string `json:"nextCursor,omitempty"` + + // Summary Collection totals for a paged list. Independent of the page: `total` is the COUNT of items in the collection and is the same value on every page, including a cursor that seeks past the last row. + Summary ListSummary `json:"summary"` +} { return r.JSON200 } // GetApplicationproblemJSON401 returns the response for an HTTP 401 `application/problem+json` response -func (r ListGpuTypesResponse) GetApplicationproblemJSON401() *Unauthorized { +func (r ListVersionsResponse) GetApplicationproblemJSON401() *Unauthorized { return r.ApplicationproblemJSON401 } // GetApplicationproblemJSON403 returns the response for an HTTP 403 `application/problem+json` response -func (r ListGpuTypesResponse) GetApplicationproblemJSON403() *Forbidden { +func (r ListVersionsResponse) GetApplicationproblemJSON403() *Forbidden { return r.ApplicationproblemJSON403 } +// GetApplicationproblemJSON404 returns the response for an HTTP 404 `application/problem+json` response +func (r ListVersionsResponse) GetApplicationproblemJSON404() *NotFound { + return r.ApplicationproblemJSON404 +} + // GetApplicationproblemJSON503 returns the response for an HTTP 503 `application/problem+json` response -func (r ListGpuTypesResponse) GetApplicationproblemJSON503() *ServiceUnavailable { +func (r ListVersionsResponse) GetApplicationproblemJSON503() *ServiceUnavailable { return r.ApplicationproblemJSON503 } // GetBody returns the raw response body bytes -func (r ListGpuTypesResponse) GetBody() []byte { +func (r ListVersionsResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r ListGpuTypesResponse) Status() string { +func (r ListVersionsResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8245,7 +10231,7 @@ func (r ListGpuTypesResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ListGpuTypesResponse) StatusCode() int { +func (r ListVersionsResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -8253,74 +10239,60 @@ func (r ListGpuTypesResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r ListGpuTypesResponse) ContentType() string { +func (r ListVersionsResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type CreateGpuTypeResponse struct { +type DeleteVersionResponse struct { Body []byte HTTPResponse *http.Response - // JSON201 the response for an HTTP 201 `application/json` response - JSON201 *GpuType - // ApplicationproblemJSON400 the response for an HTTP 400 `application/problem+json` response - ApplicationproblemJSON400 *BadRequest // ApplicationproblemJSON401 the response for an HTTP 401 `application/problem+json` response ApplicationproblemJSON401 *Unauthorized // ApplicationproblemJSON403 the response for an HTTP 403 `application/problem+json` response ApplicationproblemJSON403 *Forbidden + // ApplicationproblemJSON404 the response for an HTTP 404 `application/problem+json` response + ApplicationproblemJSON404 *NotFound // ApplicationproblemJSON409 the response for an HTTP 409 `application/problem+json` response ApplicationproblemJSON409 *Conflict - // ApplicationproblemJSON422 the response for an HTTP 422 `application/problem+json` response - ApplicationproblemJSON422 *ValidationError // ApplicationproblemJSON503 the response for an HTTP 503 `application/problem+json` response ApplicationproblemJSON503 *ServiceUnavailable } -// GetJSON201 returns the response for an HTTP 201 `application/json` response -func (r CreateGpuTypeResponse) GetJSON201() *GpuType { - return r.JSON201 -} - -// GetApplicationproblemJSON400 returns the response for an HTTP 400 `application/problem+json` response -func (r CreateGpuTypeResponse) GetApplicationproblemJSON400() *BadRequest { - return r.ApplicationproblemJSON400 -} - // GetApplicationproblemJSON401 returns the response for an HTTP 401 `application/problem+json` response -func (r CreateGpuTypeResponse) GetApplicationproblemJSON401() *Unauthorized { +func (r DeleteVersionResponse) GetApplicationproblemJSON401() *Unauthorized { return r.ApplicationproblemJSON401 } // GetApplicationproblemJSON403 returns the response for an HTTP 403 `application/problem+json` response -func (r CreateGpuTypeResponse) GetApplicationproblemJSON403() *Forbidden { +func (r DeleteVersionResponse) GetApplicationproblemJSON403() *Forbidden { return r.ApplicationproblemJSON403 } -// GetApplicationproblemJSON409 returns the response for an HTTP 409 `application/problem+json` response -func (r CreateGpuTypeResponse) GetApplicationproblemJSON409() *Conflict { - return r.ApplicationproblemJSON409 +// GetApplicationproblemJSON404 returns the response for an HTTP 404 `application/problem+json` response +func (r DeleteVersionResponse) GetApplicationproblemJSON404() *NotFound { + return r.ApplicationproblemJSON404 } -// GetApplicationproblemJSON422 returns the response for an HTTP 422 `application/problem+json` response -func (r CreateGpuTypeResponse) GetApplicationproblemJSON422() *ValidationError { - return r.ApplicationproblemJSON422 +// GetApplicationproblemJSON409 returns the response for an HTTP 409 `application/problem+json` response +func (r DeleteVersionResponse) GetApplicationproblemJSON409() *Conflict { + return r.ApplicationproblemJSON409 } // GetApplicationproblemJSON503 returns the response for an HTTP 503 `application/problem+json` response -func (r CreateGpuTypeResponse) GetApplicationproblemJSON503() *ServiceUnavailable { +func (r DeleteVersionResponse) GetApplicationproblemJSON503() *ServiceUnavailable { return r.ApplicationproblemJSON503 } // GetBody returns the raw response body bytes -func (r CreateGpuTypeResponse) GetBody() []byte { +func (r DeleteVersionResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r CreateGpuTypeResponse) Status() string { +func (r DeleteVersionResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8328,7 +10300,7 @@ func (r CreateGpuTypeResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r CreateGpuTypeResponse) StatusCode() int { +func (r DeleteVersionResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -8336,67 +10308,60 @@ func (r CreateGpuTypeResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r CreateGpuTypeResponse) ContentType() string { +func (r DeleteVersionResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type DeleteGpuTypeResponse struct { +type GetVersionResponse struct { Body []byte HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *Version // ApplicationproblemJSON401 the response for an HTTP 401 `application/problem+json` response ApplicationproblemJSON401 *Unauthorized // ApplicationproblemJSON403 the response for an HTTP 403 `application/problem+json` response ApplicationproblemJSON403 *Forbidden // ApplicationproblemJSON404 the response for an HTTP 404 `application/problem+json` response ApplicationproblemJSON404 *NotFound - // ApplicationproblemJSON409 the response for an HTTP 409 `application/problem+json` response - ApplicationproblemJSON409 *Conflict - // ApplicationproblemJSON422 the response for an HTTP 422 `application/problem+json` response - ApplicationproblemJSON422 *ValidationError // ApplicationproblemJSON503 the response for an HTTP 503 `application/problem+json` response ApplicationproblemJSON503 *ServiceUnavailable } +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r GetVersionResponse) GetJSON200() *Version { + return r.JSON200 +} + // GetApplicationproblemJSON401 returns the response for an HTTP 401 `application/problem+json` response -func (r DeleteGpuTypeResponse) GetApplicationproblemJSON401() *Unauthorized { +func (r GetVersionResponse) GetApplicationproblemJSON401() *Unauthorized { return r.ApplicationproblemJSON401 } // GetApplicationproblemJSON403 returns the response for an HTTP 403 `application/problem+json` response -func (r DeleteGpuTypeResponse) GetApplicationproblemJSON403() *Forbidden { +func (r GetVersionResponse) GetApplicationproblemJSON403() *Forbidden { return r.ApplicationproblemJSON403 } // GetApplicationproblemJSON404 returns the response for an HTTP 404 `application/problem+json` response -func (r DeleteGpuTypeResponse) GetApplicationproblemJSON404() *NotFound { +func (r GetVersionResponse) GetApplicationproblemJSON404() *NotFound { return r.ApplicationproblemJSON404 } -// GetApplicationproblemJSON409 returns the response for an HTTP 409 `application/problem+json` response -func (r DeleteGpuTypeResponse) GetApplicationproblemJSON409() *Conflict { - return r.ApplicationproblemJSON409 -} - -// GetApplicationproblemJSON422 returns the response for an HTTP 422 `application/problem+json` response -func (r DeleteGpuTypeResponse) GetApplicationproblemJSON422() *ValidationError { - return r.ApplicationproblemJSON422 -} - // GetApplicationproblemJSON503 returns the response for an HTTP 503 `application/problem+json` response -func (r DeleteGpuTypeResponse) GetApplicationproblemJSON503() *ServiceUnavailable { +func (r GetVersionResponse) GetApplicationproblemJSON503() *ServiceUnavailable { return r.ApplicationproblemJSON503 } // GetBody returns the raw response body bytes -func (r DeleteGpuTypeResponse) GetBody() []byte { +func (r GetVersionResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r DeleteGpuTypeResponse) Status() string { +func (r GetVersionResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8404,7 +10369,7 @@ func (r DeleteGpuTypeResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r DeleteGpuTypeResponse) StatusCode() int { +func (r GetVersionResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -8412,18 +10377,25 @@ func (r DeleteGpuTypeResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r DeleteGpuTypeResponse) ContentType() string { +func (r GetVersionResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type GetGpuTypeResponse struct { +type ListWorkersResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response - JSON200 *GpuType + JSON200 *struct { + Data *[]Worker `json:"data,omitempty"` + + // NextCursor Cursor for the next page; null when there are no more items. + NextCursor *string `json:"nextCursor,omitempty"` + } + // ApplicationproblemJSON400 the response for an HTTP 400 `application/problem+json` response + ApplicationproblemJSON400 *BadRequest // ApplicationproblemJSON401 the response for an HTTP 401 `application/problem+json` response ApplicationproblemJSON401 *Unauthorized // ApplicationproblemJSON403 the response for an HTTP 403 `application/problem+json` response @@ -8437,42 +10409,52 @@ type GetGpuTypeResponse struct { } // GetJSON200 returns the response for an HTTP 200 `application/json` response -func (r GetGpuTypeResponse) GetJSON200() *GpuType { +func (r ListWorkersResponse) GetJSON200() *struct { + Data *[]Worker `json:"data,omitempty"` + + // NextCursor Cursor for the next page; null when there are no more items. + NextCursor *string `json:"nextCursor,omitempty"` +} { return r.JSON200 } -// GetApplicationproblemJSON401 returns the response for an HTTP 401 `application/problem+json` response -func (r GetGpuTypeResponse) GetApplicationproblemJSON401() *Unauthorized { - return r.ApplicationproblemJSON401 -} +// GetApplicationproblemJSON400 returns the response for an HTTP 400 `application/problem+json` response +func (r ListWorkersResponse) GetApplicationproblemJSON400() *BadRequest { + return r.ApplicationproblemJSON400 +} + +// GetApplicationproblemJSON401 returns the response for an HTTP 401 `application/problem+json` response +func (r ListWorkersResponse) GetApplicationproblemJSON401() *Unauthorized { + return r.ApplicationproblemJSON401 +} // GetApplicationproblemJSON403 returns the response for an HTTP 403 `application/problem+json` response -func (r GetGpuTypeResponse) GetApplicationproblemJSON403() *Forbidden { +func (r ListWorkersResponse) GetApplicationproblemJSON403() *Forbidden { return r.ApplicationproblemJSON403 } // GetApplicationproblemJSON404 returns the response for an HTTP 404 `application/problem+json` response -func (r GetGpuTypeResponse) GetApplicationproblemJSON404() *NotFound { +func (r ListWorkersResponse) GetApplicationproblemJSON404() *NotFound { return r.ApplicationproblemJSON404 } // GetApplicationproblemJSON422 returns the response for an HTTP 422 `application/problem+json` response -func (r GetGpuTypeResponse) GetApplicationproblemJSON422() *ValidationError { +func (r ListWorkersResponse) GetApplicationproblemJSON422() *ValidationError { return r.ApplicationproblemJSON422 } // GetApplicationproblemJSON503 returns the response for an HTTP 503 `application/problem+json` response -func (r GetGpuTypeResponse) GetApplicationproblemJSON503() *ServiceUnavailable { +func (r ListWorkersResponse) GetApplicationproblemJSON503() *ServiceUnavailable { return r.ApplicationproblemJSON503 } // GetBody returns the raw response body bytes -func (r GetGpuTypeResponse) GetBody() []byte { +func (r ListWorkersResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r GetGpuTypeResponse) Status() string { +func (r ListWorkersResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8480,7 +10462,7 @@ func (r GetGpuTypeResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetGpuTypeResponse) StatusCode() int { +func (r ListWorkersResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -8488,18 +10470,18 @@ func (r GetGpuTypeResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r GetGpuTypeResponse) ContentType() string { +func (r ListWorkersResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type UpdateGpuTypeResponse struct { +type GetWorkerResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response - JSON200 *GpuType + JSON200 *Worker // ApplicationproblemJSON400 the response for an HTTP 400 `application/problem+json` response ApplicationproblemJSON400 *BadRequest // ApplicationproblemJSON401 the response for an HTTP 401 `application/problem+json` response @@ -8515,47 +10497,47 @@ type UpdateGpuTypeResponse struct { } // GetJSON200 returns the response for an HTTP 200 `application/json` response -func (r UpdateGpuTypeResponse) GetJSON200() *GpuType { +func (r GetWorkerResponse) GetJSON200() *Worker { return r.JSON200 } // GetApplicationproblemJSON400 returns the response for an HTTP 400 `application/problem+json` response -func (r UpdateGpuTypeResponse) GetApplicationproblemJSON400() *BadRequest { +func (r GetWorkerResponse) GetApplicationproblemJSON400() *BadRequest { return r.ApplicationproblemJSON400 } // GetApplicationproblemJSON401 returns the response for an HTTP 401 `application/problem+json` response -func (r UpdateGpuTypeResponse) GetApplicationproblemJSON401() *Unauthorized { +func (r GetWorkerResponse) GetApplicationproblemJSON401() *Unauthorized { return r.ApplicationproblemJSON401 } // GetApplicationproblemJSON403 returns the response for an HTTP 403 `application/problem+json` response -func (r UpdateGpuTypeResponse) GetApplicationproblemJSON403() *Forbidden { +func (r GetWorkerResponse) GetApplicationproblemJSON403() *Forbidden { return r.ApplicationproblemJSON403 } // GetApplicationproblemJSON404 returns the response for an HTTP 404 `application/problem+json` response -func (r UpdateGpuTypeResponse) GetApplicationproblemJSON404() *NotFound { +func (r GetWorkerResponse) GetApplicationproblemJSON404() *NotFound { return r.ApplicationproblemJSON404 } // GetApplicationproblemJSON422 returns the response for an HTTP 422 `application/problem+json` response -func (r UpdateGpuTypeResponse) GetApplicationproblemJSON422() *ValidationError { +func (r GetWorkerResponse) GetApplicationproblemJSON422() *ValidationError { return r.ApplicationproblemJSON422 } // GetApplicationproblemJSON503 returns the response for an HTTP 503 `application/problem+json` response -func (r UpdateGpuTypeResponse) GetApplicationproblemJSON503() *ServiceUnavailable { +func (r GetWorkerResponse) GetApplicationproblemJSON503() *ServiceUnavailable { return r.ApplicationproblemJSON503 } // GetBody returns the raw response body bytes -func (r UpdateGpuTypeResponse) GetBody() []byte { +func (r GetWorkerResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r UpdateGpuTypeResponse) Status() string { +func (r GetWorkerResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8563,7 +10545,7 @@ func (r UpdateGpuTypeResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r UpdateGpuTypeResponse) StatusCode() int { +func (r GetWorkerResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -8571,77 +10553,53 @@ func (r UpdateGpuTypeResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r UpdateGpuTypeResponse) ContentType() string { +func (r GetWorkerResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type ListGpuTypePricesResponse struct { +type ListGpuTypesResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response - JSON200 *struct { - Data *[]GpuPricingListItem `json:"data,omitempty"` - - // NextCursor Cursor for the next page; null when there are no more items. - NextCursor *string `json:"nextCursor,omitempty"` - } - // ApplicationproblemJSON400 the response for an HTTP 400 `application/problem+json` response - ApplicationproblemJSON400 *BadRequest + JSON200 *GpuTypeList // ApplicationproblemJSON401 the response for an HTTP 401 `application/problem+json` response ApplicationproblemJSON401 *Unauthorized // ApplicationproblemJSON403 the response for an HTTP 403 `application/problem+json` response ApplicationproblemJSON403 *Forbidden - // ApplicationproblemJSON404 the response for an HTTP 404 `application/problem+json` response - ApplicationproblemJSON404 *NotFound - // ApplicationproblemJSON422 the response for an HTTP 422 `application/problem+json` response - ApplicationproblemJSON422 *ValidationError + // ApplicationproblemJSON503 the response for an HTTP 503 `application/problem+json` response + ApplicationproblemJSON503 *ServiceUnavailable } // GetJSON200 returns the response for an HTTP 200 `application/json` response -func (r ListGpuTypePricesResponse) GetJSON200() *struct { - Data *[]GpuPricingListItem `json:"data,omitempty"` - - // NextCursor Cursor for the next page; null when there are no more items. - NextCursor *string `json:"nextCursor,omitempty"` -} { +func (r ListGpuTypesResponse) GetJSON200() *GpuTypeList { return r.JSON200 } -// GetApplicationproblemJSON400 returns the response for an HTTP 400 `application/problem+json` response -func (r ListGpuTypePricesResponse) GetApplicationproblemJSON400() *BadRequest { - return r.ApplicationproblemJSON400 -} - // GetApplicationproblemJSON401 returns the response for an HTTP 401 `application/problem+json` response -func (r ListGpuTypePricesResponse) GetApplicationproblemJSON401() *Unauthorized { +func (r ListGpuTypesResponse) GetApplicationproblemJSON401() *Unauthorized { return r.ApplicationproblemJSON401 } // GetApplicationproblemJSON403 returns the response for an HTTP 403 `application/problem+json` response -func (r ListGpuTypePricesResponse) GetApplicationproblemJSON403() *Forbidden { +func (r ListGpuTypesResponse) GetApplicationproblemJSON403() *Forbidden { return r.ApplicationproblemJSON403 } -// GetApplicationproblemJSON404 returns the response for an HTTP 404 `application/problem+json` response -func (r ListGpuTypePricesResponse) GetApplicationproblemJSON404() *NotFound { - return r.ApplicationproblemJSON404 -} - -// GetApplicationproblemJSON422 returns the response for an HTTP 422 `application/problem+json` response -func (r ListGpuTypePricesResponse) GetApplicationproblemJSON422() *ValidationError { - return r.ApplicationproblemJSON422 +// GetApplicationproblemJSON503 returns the response for an HTTP 503 `application/problem+json` response +func (r ListGpuTypesResponse) GetApplicationproblemJSON503() *ServiceUnavailable { + return r.ApplicationproblemJSON503 } // GetBody returns the raw response body bytes -func (r ListGpuTypePricesResponse) GetBody() []byte { +func (r ListGpuTypesResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r ListGpuTypePricesResponse) Status() string { +func (r ListGpuTypesResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8649,7 +10607,7 @@ func (r ListGpuTypePricesResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ListGpuTypePricesResponse) StatusCode() int { +func (r ListGpuTypesResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -8657,74 +10615,74 @@ func (r ListGpuTypePricesResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r ListGpuTypePricesResponse) ContentType() string { +func (r ListGpuTypesResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type CreateGpuTypePriceResponse struct { +type CreateGpuTypeResponse struct { Body []byte HTTPResponse *http.Response // JSON201 the response for an HTTP 201 `application/json` response - JSON201 *GpuPricing + JSON201 *GpuType // ApplicationproblemJSON400 the response for an HTTP 400 `application/problem+json` response ApplicationproblemJSON400 *BadRequest // ApplicationproblemJSON401 the response for an HTTP 401 `application/problem+json` response ApplicationproblemJSON401 *Unauthorized // ApplicationproblemJSON403 the response for an HTTP 403 `application/problem+json` response ApplicationproblemJSON403 *Forbidden - // ApplicationproblemJSON404 the response for an HTTP 404 `application/problem+json` response - ApplicationproblemJSON404 *NotFound // ApplicationproblemJSON409 the response for an HTTP 409 `application/problem+json` response ApplicationproblemJSON409 *Conflict // ApplicationproblemJSON422 the response for an HTTP 422 `application/problem+json` response ApplicationproblemJSON422 *ValidationError + // ApplicationproblemJSON503 the response for an HTTP 503 `application/problem+json` response + ApplicationproblemJSON503 *ServiceUnavailable } // GetJSON201 returns the response for an HTTP 201 `application/json` response -func (r CreateGpuTypePriceResponse) GetJSON201() *GpuPricing { +func (r CreateGpuTypeResponse) GetJSON201() *GpuType { return r.JSON201 } // GetApplicationproblemJSON400 returns the response for an HTTP 400 `application/problem+json` response -func (r CreateGpuTypePriceResponse) GetApplicationproblemJSON400() *BadRequest { +func (r CreateGpuTypeResponse) GetApplicationproblemJSON400() *BadRequest { return r.ApplicationproblemJSON400 } // GetApplicationproblemJSON401 returns the response for an HTTP 401 `application/problem+json` response -func (r CreateGpuTypePriceResponse) GetApplicationproblemJSON401() *Unauthorized { +func (r CreateGpuTypeResponse) GetApplicationproblemJSON401() *Unauthorized { return r.ApplicationproblemJSON401 } // GetApplicationproblemJSON403 returns the response for an HTTP 403 `application/problem+json` response -func (r CreateGpuTypePriceResponse) GetApplicationproblemJSON403() *Forbidden { +func (r CreateGpuTypeResponse) GetApplicationproblemJSON403() *Forbidden { return r.ApplicationproblemJSON403 } -// GetApplicationproblemJSON404 returns the response for an HTTP 404 `application/problem+json` response -func (r CreateGpuTypePriceResponse) GetApplicationproblemJSON404() *NotFound { - return r.ApplicationproblemJSON404 -} - // GetApplicationproblemJSON409 returns the response for an HTTP 409 `application/problem+json` response -func (r CreateGpuTypePriceResponse) GetApplicationproblemJSON409() *Conflict { +func (r CreateGpuTypeResponse) GetApplicationproblemJSON409() *Conflict { return r.ApplicationproblemJSON409 } // GetApplicationproblemJSON422 returns the response for an HTTP 422 `application/problem+json` response -func (r CreateGpuTypePriceResponse) GetApplicationproblemJSON422() *ValidationError { +func (r CreateGpuTypeResponse) GetApplicationproblemJSON422() *ValidationError { return r.ApplicationproblemJSON422 } +// GetApplicationproblemJSON503 returns the response for an HTTP 503 `application/problem+json` response +func (r CreateGpuTypeResponse) GetApplicationproblemJSON503() *ServiceUnavailable { + return r.ApplicationproblemJSON503 +} + // GetBody returns the raw response body bytes -func (r CreateGpuTypePriceResponse) GetBody() []byte { +func (r CreateGpuTypeResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r CreateGpuTypePriceResponse) Status() string { +func (r CreateGpuTypeResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8732,7 +10690,7 @@ func (r CreateGpuTypePriceResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r CreateGpuTypePriceResponse) StatusCode() int { +func (r CreateGpuTypeResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -8740,18 +10698,16 @@ func (r CreateGpuTypePriceResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r CreateGpuTypePriceResponse) ContentType() string { +func (r CreateGpuTypeResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type DeleteGpuTypePriceResponse struct { +type DeleteGpuTypeResponse struct { Body []byte HTTPResponse *http.Response - // ApplicationproblemJSON400 the response for an HTTP 400 `application/problem+json` response - ApplicationproblemJSON400 *BadRequest // ApplicationproblemJSON401 the response for an HTTP 401 `application/problem+json` response ApplicationproblemJSON401 *Unauthorized // ApplicationproblemJSON403 the response for an HTTP 403 `application/problem+json` response @@ -8762,45 +10718,47 @@ type DeleteGpuTypePriceResponse struct { ApplicationproblemJSON409 *Conflict // ApplicationproblemJSON422 the response for an HTTP 422 `application/problem+json` response ApplicationproblemJSON422 *ValidationError -} - -// GetApplicationproblemJSON400 returns the response for an HTTP 400 `application/problem+json` response -func (r DeleteGpuTypePriceResponse) GetApplicationproblemJSON400() *BadRequest { - return r.ApplicationproblemJSON400 + // ApplicationproblemJSON503 the response for an HTTP 503 `application/problem+json` response + ApplicationproblemJSON503 *ServiceUnavailable } // GetApplicationproblemJSON401 returns the response for an HTTP 401 `application/problem+json` response -func (r DeleteGpuTypePriceResponse) GetApplicationproblemJSON401() *Unauthorized { +func (r DeleteGpuTypeResponse) GetApplicationproblemJSON401() *Unauthorized { return r.ApplicationproblemJSON401 } // GetApplicationproblemJSON403 returns the response for an HTTP 403 `application/problem+json` response -func (r DeleteGpuTypePriceResponse) GetApplicationproblemJSON403() *Forbidden { +func (r DeleteGpuTypeResponse) GetApplicationproblemJSON403() *Forbidden { return r.ApplicationproblemJSON403 } // GetApplicationproblemJSON404 returns the response for an HTTP 404 `application/problem+json` response -func (r DeleteGpuTypePriceResponse) GetApplicationproblemJSON404() *NotFound { +func (r DeleteGpuTypeResponse) GetApplicationproblemJSON404() *NotFound { return r.ApplicationproblemJSON404 } // GetApplicationproblemJSON409 returns the response for an HTTP 409 `application/problem+json` response -func (r DeleteGpuTypePriceResponse) GetApplicationproblemJSON409() *Conflict { +func (r DeleteGpuTypeResponse) GetApplicationproblemJSON409() *Conflict { return r.ApplicationproblemJSON409 } // GetApplicationproblemJSON422 returns the response for an HTTP 422 `application/problem+json` response -func (r DeleteGpuTypePriceResponse) GetApplicationproblemJSON422() *ValidationError { +func (r DeleteGpuTypeResponse) GetApplicationproblemJSON422() *ValidationError { return r.ApplicationproblemJSON422 } +// GetApplicationproblemJSON503 returns the response for an HTTP 503 `application/problem+json` response +func (r DeleteGpuTypeResponse) GetApplicationproblemJSON503() *ServiceUnavailable { + return r.ApplicationproblemJSON503 +} + // GetBody returns the raw response body bytes -func (r DeleteGpuTypePriceResponse) GetBody() []byte { +func (r DeleteGpuTypeResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r DeleteGpuTypePriceResponse) Status() string { +func (r DeleteGpuTypeResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8808,7 +10766,7 @@ func (r DeleteGpuTypePriceResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r DeleteGpuTypePriceResponse) StatusCode() int { +func (r DeleteGpuTypeResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -8816,74 +10774,67 @@ func (r DeleteGpuTypePriceResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r DeleteGpuTypePriceResponse) ContentType() string { +func (r DeleteGpuTypeResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type UpdateGpuTypePriceResponse struct { +type GetGpuTypeResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response - JSON200 *GpuPricing - // ApplicationproblemJSON400 the response for an HTTP 400 `application/problem+json` response - ApplicationproblemJSON400 *BadRequest + JSON200 *GpuType // ApplicationproblemJSON401 the response for an HTTP 401 `application/problem+json` response ApplicationproblemJSON401 *Unauthorized // ApplicationproblemJSON403 the response for an HTTP 403 `application/problem+json` response ApplicationproblemJSON403 *Forbidden // ApplicationproblemJSON404 the response for an HTTP 404 `application/problem+json` response ApplicationproblemJSON404 *NotFound - // ApplicationproblemJSON409 the response for an HTTP 409 `application/problem+json` response - ApplicationproblemJSON409 *Conflict // ApplicationproblemJSON422 the response for an HTTP 422 `application/problem+json` response ApplicationproblemJSON422 *ValidationError + // ApplicationproblemJSON503 the response for an HTTP 503 `application/problem+json` response + ApplicationproblemJSON503 *ServiceUnavailable } // GetJSON200 returns the response for an HTTP 200 `application/json` response -func (r UpdateGpuTypePriceResponse) GetJSON200() *GpuPricing { +func (r GetGpuTypeResponse) GetJSON200() *GpuType { return r.JSON200 } -// GetApplicationproblemJSON400 returns the response for an HTTP 400 `application/problem+json` response -func (r UpdateGpuTypePriceResponse) GetApplicationproblemJSON400() *BadRequest { - return r.ApplicationproblemJSON400 -} - // GetApplicationproblemJSON401 returns the response for an HTTP 401 `application/problem+json` response -func (r UpdateGpuTypePriceResponse) GetApplicationproblemJSON401() *Unauthorized { +func (r GetGpuTypeResponse) GetApplicationproblemJSON401() *Unauthorized { return r.ApplicationproblemJSON401 } // GetApplicationproblemJSON403 returns the response for an HTTP 403 `application/problem+json` response -func (r UpdateGpuTypePriceResponse) GetApplicationproblemJSON403() *Forbidden { +func (r GetGpuTypeResponse) GetApplicationproblemJSON403() *Forbidden { return r.ApplicationproblemJSON403 } // GetApplicationproblemJSON404 returns the response for an HTTP 404 `application/problem+json` response -func (r UpdateGpuTypePriceResponse) GetApplicationproblemJSON404() *NotFound { +func (r GetGpuTypeResponse) GetApplicationproblemJSON404() *NotFound { return r.ApplicationproblemJSON404 } -// GetApplicationproblemJSON409 returns the response for an HTTP 409 `application/problem+json` response -func (r UpdateGpuTypePriceResponse) GetApplicationproblemJSON409() *Conflict { - return r.ApplicationproblemJSON409 -} - // GetApplicationproblemJSON422 returns the response for an HTTP 422 `application/problem+json` response -func (r UpdateGpuTypePriceResponse) GetApplicationproblemJSON422() *ValidationError { +func (r GetGpuTypeResponse) GetApplicationproblemJSON422() *ValidationError { return r.ApplicationproblemJSON422 } +// GetApplicationproblemJSON503 returns the response for an HTTP 503 `application/problem+json` response +func (r GetGpuTypeResponse) GetApplicationproblemJSON503() *ServiceUnavailable { + return r.ApplicationproblemJSON503 +} + // GetBody returns the raw response body bytes -func (r UpdateGpuTypePriceResponse) GetBody() []byte { +func (r GetGpuTypeResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r UpdateGpuTypePriceResponse) Status() string { +func (r GetGpuTypeResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8891,7 +10842,7 @@ func (r UpdateGpuTypePriceResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r UpdateGpuTypePriceResponse) StatusCode() int { +func (r GetGpuTypeResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -8899,29 +10850,26 @@ func (r UpdateGpuTypePriceResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r UpdateGpuTypePriceResponse) ContentType() string { +func (r GetGpuTypeResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type ListSecretsResponse struct { +type UpdateGpuTypeResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response - JSON200 *struct { - Data *[]Secret `json:"data,omitempty"` - - // NextCursor Cursor for the next page; null when there are no more items. - NextCursor *string `json:"nextCursor,omitempty"` - } + JSON200 *GpuType // ApplicationproblemJSON400 the response for an HTTP 400 `application/problem+json` response ApplicationproblemJSON400 *BadRequest // ApplicationproblemJSON401 the response for an HTTP 401 `application/problem+json` response ApplicationproblemJSON401 *Unauthorized // ApplicationproblemJSON403 the response for an HTTP 403 `application/problem+json` response ApplicationproblemJSON403 *Forbidden + // ApplicationproblemJSON404 the response for an HTTP 404 `application/problem+json` response + ApplicationproblemJSON404 *NotFound // ApplicationproblemJSON422 the response for an HTTP 422 `application/problem+json` response ApplicationproblemJSON422 *ValidationError // ApplicationproblemJSON503 the response for an HTTP 503 `application/problem+json` response @@ -8929,47 +10877,47 @@ type ListSecretsResponse struct { } // GetJSON200 returns the response for an HTTP 200 `application/json` response -func (r ListSecretsResponse) GetJSON200() *struct { - Data *[]Secret `json:"data,omitempty"` - - // NextCursor Cursor for the next page; null when there are no more items. - NextCursor *string `json:"nextCursor,omitempty"` -} { +func (r UpdateGpuTypeResponse) GetJSON200() *GpuType { return r.JSON200 } // GetApplicationproblemJSON400 returns the response for an HTTP 400 `application/problem+json` response -func (r ListSecretsResponse) GetApplicationproblemJSON400() *BadRequest { +func (r UpdateGpuTypeResponse) GetApplicationproblemJSON400() *BadRequest { return r.ApplicationproblemJSON400 } // GetApplicationproblemJSON401 returns the response for an HTTP 401 `application/problem+json` response -func (r ListSecretsResponse) GetApplicationproblemJSON401() *Unauthorized { +func (r UpdateGpuTypeResponse) GetApplicationproblemJSON401() *Unauthorized { return r.ApplicationproblemJSON401 } // GetApplicationproblemJSON403 returns the response for an HTTP 403 `application/problem+json` response -func (r ListSecretsResponse) GetApplicationproblemJSON403() *Forbidden { +func (r UpdateGpuTypeResponse) GetApplicationproblemJSON403() *Forbidden { return r.ApplicationproblemJSON403 } +// GetApplicationproblemJSON404 returns the response for an HTTP 404 `application/problem+json` response +func (r UpdateGpuTypeResponse) GetApplicationproblemJSON404() *NotFound { + return r.ApplicationproblemJSON404 +} + // GetApplicationproblemJSON422 returns the response for an HTTP 422 `application/problem+json` response -func (r ListSecretsResponse) GetApplicationproblemJSON422() *ValidationError { +func (r UpdateGpuTypeResponse) GetApplicationproblemJSON422() *ValidationError { return r.ApplicationproblemJSON422 } // GetApplicationproblemJSON503 returns the response for an HTTP 503 `application/problem+json` response -func (r ListSecretsResponse) GetApplicationproblemJSON503() *ServiceUnavailable { +func (r UpdateGpuTypeResponse) GetApplicationproblemJSON503() *ServiceUnavailable { return r.ApplicationproblemJSON503 } // GetBody returns the raw response body bytes -func (r ListSecretsResponse) GetBody() []byte { +func (r UpdateGpuTypeResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r ListSecretsResponse) Status() string { +func (r UpdateGpuTypeResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8977,7 +10925,7 @@ func (r ListSecretsResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ListSecretsResponse) StatusCode() int { +func (r UpdateGpuTypeResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -8985,74 +10933,160 @@ func (r ListSecretsResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r ListSecretsResponse) ContentType() string { +func (r UpdateGpuTypeResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type CreateSecretResponse struct { +type ListGpuTypePricesResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + Data *[]GpuPricingListItem `json:"data,omitempty"` + + // NextCursor Cursor for the next page; null when there are no more items. + NextCursor *string `json:"nextCursor,omitempty"` + } + // ApplicationproblemJSON400 the response for an HTTP 400 `application/problem+json` response + ApplicationproblemJSON400 *BadRequest + // ApplicationproblemJSON401 the response for an HTTP 401 `application/problem+json` response + ApplicationproblemJSON401 *Unauthorized + // ApplicationproblemJSON403 the response for an HTTP 403 `application/problem+json` response + ApplicationproblemJSON403 *Forbidden + // ApplicationproblemJSON404 the response for an HTTP 404 `application/problem+json` response + ApplicationproblemJSON404 *NotFound + // ApplicationproblemJSON422 the response for an HTTP 422 `application/problem+json` response + ApplicationproblemJSON422 *ValidationError +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r ListGpuTypePricesResponse) GetJSON200() *struct { + Data *[]GpuPricingListItem `json:"data,omitempty"` + + // NextCursor Cursor for the next page; null when there are no more items. + NextCursor *string `json:"nextCursor,omitempty"` +} { + return r.JSON200 +} + +// GetApplicationproblemJSON400 returns the response for an HTTP 400 `application/problem+json` response +func (r ListGpuTypePricesResponse) GetApplicationproblemJSON400() *BadRequest { + return r.ApplicationproblemJSON400 +} + +// GetApplicationproblemJSON401 returns the response for an HTTP 401 `application/problem+json` response +func (r ListGpuTypePricesResponse) GetApplicationproblemJSON401() *Unauthorized { + return r.ApplicationproblemJSON401 +} + +// GetApplicationproblemJSON403 returns the response for an HTTP 403 `application/problem+json` response +func (r ListGpuTypePricesResponse) GetApplicationproblemJSON403() *Forbidden { + return r.ApplicationproblemJSON403 +} + +// GetApplicationproblemJSON404 returns the response for an HTTP 404 `application/problem+json` response +func (r ListGpuTypePricesResponse) GetApplicationproblemJSON404() *NotFound { + return r.ApplicationproblemJSON404 +} + +// GetApplicationproblemJSON422 returns the response for an HTTP 422 `application/problem+json` response +func (r ListGpuTypePricesResponse) GetApplicationproblemJSON422() *ValidationError { + return r.ApplicationproblemJSON422 +} + +// GetBody returns the raw response body bytes +func (r ListGpuTypePricesResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r ListGpuTypePricesResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ListGpuTypePricesResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r ListGpuTypePricesResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type CreateGpuTypePriceResponse struct { Body []byte HTTPResponse *http.Response // JSON201 the response for an HTTP 201 `application/json` response - JSON201 *Secret + JSON201 *GpuPricing // ApplicationproblemJSON400 the response for an HTTP 400 `application/problem+json` response ApplicationproblemJSON400 *BadRequest // ApplicationproblemJSON401 the response for an HTTP 401 `application/problem+json` response ApplicationproblemJSON401 *Unauthorized // ApplicationproblemJSON403 the response for an HTTP 403 `application/problem+json` response ApplicationproblemJSON403 *Forbidden + // ApplicationproblemJSON404 the response for an HTTP 404 `application/problem+json` response + ApplicationproblemJSON404 *NotFound // ApplicationproblemJSON409 the response for an HTTP 409 `application/problem+json` response ApplicationproblemJSON409 *Conflict // ApplicationproblemJSON422 the response for an HTTP 422 `application/problem+json` response ApplicationproblemJSON422 *ValidationError - // ApplicationproblemJSON503 the response for an HTTP 503 `application/problem+json` response - ApplicationproblemJSON503 *ServiceUnavailable } // GetJSON201 returns the response for an HTTP 201 `application/json` response -func (r CreateSecretResponse) GetJSON201() *Secret { +func (r CreateGpuTypePriceResponse) GetJSON201() *GpuPricing { return r.JSON201 } // GetApplicationproblemJSON400 returns the response for an HTTP 400 `application/problem+json` response -func (r CreateSecretResponse) GetApplicationproblemJSON400() *BadRequest { +func (r CreateGpuTypePriceResponse) GetApplicationproblemJSON400() *BadRequest { return r.ApplicationproblemJSON400 } // GetApplicationproblemJSON401 returns the response for an HTTP 401 `application/problem+json` response -func (r CreateSecretResponse) GetApplicationproblemJSON401() *Unauthorized { +func (r CreateGpuTypePriceResponse) GetApplicationproblemJSON401() *Unauthorized { return r.ApplicationproblemJSON401 } // GetApplicationproblemJSON403 returns the response for an HTTP 403 `application/problem+json` response -func (r CreateSecretResponse) GetApplicationproblemJSON403() *Forbidden { +func (r CreateGpuTypePriceResponse) GetApplicationproblemJSON403() *Forbidden { return r.ApplicationproblemJSON403 } +// GetApplicationproblemJSON404 returns the response for an HTTP 404 `application/problem+json` response +func (r CreateGpuTypePriceResponse) GetApplicationproblemJSON404() *NotFound { + return r.ApplicationproblemJSON404 +} + // GetApplicationproblemJSON409 returns the response for an HTTP 409 `application/problem+json` response -func (r CreateSecretResponse) GetApplicationproblemJSON409() *Conflict { +func (r CreateGpuTypePriceResponse) GetApplicationproblemJSON409() *Conflict { return r.ApplicationproblemJSON409 } // GetApplicationproblemJSON422 returns the response for an HTTP 422 `application/problem+json` response -func (r CreateSecretResponse) GetApplicationproblemJSON422() *ValidationError { +func (r CreateGpuTypePriceResponse) GetApplicationproblemJSON422() *ValidationError { return r.ApplicationproblemJSON422 } -// GetApplicationproblemJSON503 returns the response for an HTTP 503 `application/problem+json` response -func (r CreateSecretResponse) GetApplicationproblemJSON503() *ServiceUnavailable { - return r.ApplicationproblemJSON503 -} - // GetBody returns the raw response body bytes -func (r CreateSecretResponse) GetBody() []byte { +func (r CreateGpuTypePriceResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r CreateSecretResponse) Status() string { +func (r CreateGpuTypePriceResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -9060,7 +11094,7 @@ func (r CreateSecretResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r CreateSecretResponse) StatusCode() int { +func (r CreateGpuTypePriceResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -9068,16 +11102,18 @@ func (r CreateSecretResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r CreateSecretResponse) ContentType() string { +func (r CreateGpuTypePriceResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type DeleteSecretResponse struct { +type DeleteGpuTypePriceResponse struct { Body []byte HTTPResponse *http.Response + // ApplicationproblemJSON400 the response for an HTTP 400 `application/problem+json` response + ApplicationproblemJSON400 *BadRequest // ApplicationproblemJSON401 the response for an HTTP 401 `application/problem+json` response ApplicationproblemJSON401 *Unauthorized // ApplicationproblemJSON403 the response for an HTTP 403 `application/problem+json` response @@ -9088,47 +11124,45 @@ type DeleteSecretResponse struct { ApplicationproblemJSON409 *Conflict // ApplicationproblemJSON422 the response for an HTTP 422 `application/problem+json` response ApplicationproblemJSON422 *ValidationError - // ApplicationproblemJSON503 the response for an HTTP 503 `application/problem+json` response - ApplicationproblemJSON503 *ServiceUnavailable +} + +// GetApplicationproblemJSON400 returns the response for an HTTP 400 `application/problem+json` response +func (r DeleteGpuTypePriceResponse) GetApplicationproblemJSON400() *BadRequest { + return r.ApplicationproblemJSON400 } // GetApplicationproblemJSON401 returns the response for an HTTP 401 `application/problem+json` response -func (r DeleteSecretResponse) GetApplicationproblemJSON401() *Unauthorized { +func (r DeleteGpuTypePriceResponse) GetApplicationproblemJSON401() *Unauthorized { return r.ApplicationproblemJSON401 } // GetApplicationproblemJSON403 returns the response for an HTTP 403 `application/problem+json` response -func (r DeleteSecretResponse) GetApplicationproblemJSON403() *Forbidden { +func (r DeleteGpuTypePriceResponse) GetApplicationproblemJSON403() *Forbidden { return r.ApplicationproblemJSON403 } // GetApplicationproblemJSON404 returns the response for an HTTP 404 `application/problem+json` response -func (r DeleteSecretResponse) GetApplicationproblemJSON404() *NotFound { +func (r DeleteGpuTypePriceResponse) GetApplicationproblemJSON404() *NotFound { return r.ApplicationproblemJSON404 } // GetApplicationproblemJSON409 returns the response for an HTTP 409 `application/problem+json` response -func (r DeleteSecretResponse) GetApplicationproblemJSON409() *Conflict { +func (r DeleteGpuTypePriceResponse) GetApplicationproblemJSON409() *Conflict { return r.ApplicationproblemJSON409 } // GetApplicationproblemJSON422 returns the response for an HTTP 422 `application/problem+json` response -func (r DeleteSecretResponse) GetApplicationproblemJSON422() *ValidationError { +func (r DeleteGpuTypePriceResponse) GetApplicationproblemJSON422() *ValidationError { return r.ApplicationproblemJSON422 } -// GetApplicationproblemJSON503 returns the response for an HTTP 503 `application/problem+json` response -func (r DeleteSecretResponse) GetApplicationproblemJSON503() *ServiceUnavailable { - return r.ApplicationproblemJSON503 -} - // GetBody returns the raw response body bytes -func (r DeleteSecretResponse) GetBody() []byte { +func (r DeleteGpuTypePriceResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r DeleteSecretResponse) Status() string { +func (r DeleteGpuTypePriceResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -9136,7 +11170,7 @@ func (r DeleteSecretResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r DeleteSecretResponse) StatusCode() int { +func (r DeleteGpuTypePriceResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -9144,18 +11178,18 @@ func (r DeleteSecretResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r DeleteSecretResponse) ContentType() string { +func (r DeleteGpuTypePriceResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type UpdateSecretResponse struct { +type UpdateGpuTypePriceResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response - JSON200 *Secret + JSON200 *GpuPricing // ApplicationproblemJSON400 the response for an HTTP 400 `application/problem+json` response ApplicationproblemJSON400 *BadRequest // ApplicationproblemJSON401 the response for an HTTP 401 `application/problem+json` response @@ -9164,54 +11198,54 @@ type UpdateSecretResponse struct { ApplicationproblemJSON403 *Forbidden // ApplicationproblemJSON404 the response for an HTTP 404 `application/problem+json` response ApplicationproblemJSON404 *NotFound + // ApplicationproblemJSON409 the response for an HTTP 409 `application/problem+json` response + ApplicationproblemJSON409 *Conflict // ApplicationproblemJSON422 the response for an HTTP 422 `application/problem+json` response ApplicationproblemJSON422 *ValidationError - // ApplicationproblemJSON503 the response for an HTTP 503 `application/problem+json` response - ApplicationproblemJSON503 *ServiceUnavailable } // GetJSON200 returns the response for an HTTP 200 `application/json` response -func (r UpdateSecretResponse) GetJSON200() *Secret { +func (r UpdateGpuTypePriceResponse) GetJSON200() *GpuPricing { return r.JSON200 } // GetApplicationproblemJSON400 returns the response for an HTTP 400 `application/problem+json` response -func (r UpdateSecretResponse) GetApplicationproblemJSON400() *BadRequest { +func (r UpdateGpuTypePriceResponse) GetApplicationproblemJSON400() *BadRequest { return r.ApplicationproblemJSON400 } // GetApplicationproblemJSON401 returns the response for an HTTP 401 `application/problem+json` response -func (r UpdateSecretResponse) GetApplicationproblemJSON401() *Unauthorized { +func (r UpdateGpuTypePriceResponse) GetApplicationproblemJSON401() *Unauthorized { return r.ApplicationproblemJSON401 } // GetApplicationproblemJSON403 returns the response for an HTTP 403 `application/problem+json` response -func (r UpdateSecretResponse) GetApplicationproblemJSON403() *Forbidden { +func (r UpdateGpuTypePriceResponse) GetApplicationproblemJSON403() *Forbidden { return r.ApplicationproblemJSON403 } // GetApplicationproblemJSON404 returns the response for an HTTP 404 `application/problem+json` response -func (r UpdateSecretResponse) GetApplicationproblemJSON404() *NotFound { +func (r UpdateGpuTypePriceResponse) GetApplicationproblemJSON404() *NotFound { return r.ApplicationproblemJSON404 } -// GetApplicationproblemJSON422 returns the response for an HTTP 422 `application/problem+json` response -func (r UpdateSecretResponse) GetApplicationproblemJSON422() *ValidationError { - return r.ApplicationproblemJSON422 +// GetApplicationproblemJSON409 returns the response for an HTTP 409 `application/problem+json` response +func (r UpdateGpuTypePriceResponse) GetApplicationproblemJSON409() *Conflict { + return r.ApplicationproblemJSON409 } -// GetApplicationproblemJSON503 returns the response for an HTTP 503 `application/problem+json` response -func (r UpdateSecretResponse) GetApplicationproblemJSON503() *ServiceUnavailable { - return r.ApplicationproblemJSON503 +// GetApplicationproblemJSON422 returns the response for an HTTP 422 `application/problem+json` response +func (r UpdateGpuTypePriceResponse) GetApplicationproblemJSON422() *ValidationError { + return r.ApplicationproblemJSON422 } // GetBody returns the raw response body bytes -func (r UpdateSecretResponse) GetBody() []byte { +func (r UpdateGpuTypePriceResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r UpdateSecretResponse) Status() string { +func (r UpdateGpuTypePriceResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -9219,7 +11253,7 @@ func (r UpdateSecretResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r UpdateSecretResponse) StatusCode() int { +func (r UpdateGpuTypePriceResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -9227,70 +11261,102 @@ func (r UpdateSecretResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r UpdateSecretResponse) ContentType() string { +func (r UpdateGpuTypePriceResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type ListUsageEventsResponse struct { +// GetLogEntriesResponse429Headers the declared response headers of an HTTP 429 response for GetLogEntries +type GetLogEntriesResponse429Headers struct { + RetryAfter int32 +} + +type GetLogEntriesResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response - JSON200 *struct { - Data *[]UsageEvent `json:"data,omitempty"` - - // NextCursor Cursor for the next page; null when there are no more items. - NextCursor *string `json:"nextCursor,omitempty"` - } + JSON200 *LogEntryPage // ApplicationproblemJSON400 the response for an HTTP 400 `application/problem+json` response ApplicationproblemJSON400 *BadRequest // ApplicationproblemJSON401 the response for an HTTP 401 `application/problem+json` response ApplicationproblemJSON401 *Unauthorized // ApplicationproblemJSON403 the response for an HTTP 403 `application/problem+json` response ApplicationproblemJSON403 *Forbidden + // ApplicationproblemJSON404 the response for an HTTP 404 `application/problem+json` response + ApplicationproblemJSON404 *NotFound + // ApplicationproblemJSON422 the response for an HTTP 422 `application/problem+json` response + ApplicationproblemJSON422 *ValidationError + // ApplicationproblemJSON429 the response for an HTTP 429 `application/problem+json` response + ApplicationproblemJSON429 *TooManyRequests + // ApplicationproblemJSON502 the response for an HTTP 502 `application/problem+json` response + ApplicationproblemJSON502 *BadGateway // ApplicationproblemJSON503 the response for an HTTP 503 `application/problem+json` response ApplicationproblemJSON503 *ServiceUnavailable + // ApplicationproblemJSON504 the response for an HTTP 504 `application/problem+json` response + ApplicationproblemJSON504 *GatewayTimeout + // Headers429 the parsed response headers for an HTTP 429 response + Headers429 *GetLogEntriesResponse429Headers } // GetJSON200 returns the response for an HTTP 200 `application/json` response -func (r ListUsageEventsResponse) GetJSON200() *struct { - Data *[]UsageEvent `json:"data,omitempty"` - - // NextCursor Cursor for the next page; null when there are no more items. - NextCursor *string `json:"nextCursor,omitempty"` -} { +func (r GetLogEntriesResponse) GetJSON200() *LogEntryPage { return r.JSON200 } // GetApplicationproblemJSON400 returns the response for an HTTP 400 `application/problem+json` response -func (r ListUsageEventsResponse) GetApplicationproblemJSON400() *BadRequest { +func (r GetLogEntriesResponse) GetApplicationproblemJSON400() *BadRequest { return r.ApplicationproblemJSON400 } // GetApplicationproblemJSON401 returns the response for an HTTP 401 `application/problem+json` response -func (r ListUsageEventsResponse) GetApplicationproblemJSON401() *Unauthorized { +func (r GetLogEntriesResponse) GetApplicationproblemJSON401() *Unauthorized { return r.ApplicationproblemJSON401 } // GetApplicationproblemJSON403 returns the response for an HTTP 403 `application/problem+json` response -func (r ListUsageEventsResponse) GetApplicationproblemJSON403() *Forbidden { +func (r GetLogEntriesResponse) GetApplicationproblemJSON403() *Forbidden { return r.ApplicationproblemJSON403 } +// GetApplicationproblemJSON404 returns the response for an HTTP 404 `application/problem+json` response +func (r GetLogEntriesResponse) GetApplicationproblemJSON404() *NotFound { + return r.ApplicationproblemJSON404 +} + +// GetApplicationproblemJSON422 returns the response for an HTTP 422 `application/problem+json` response +func (r GetLogEntriesResponse) GetApplicationproblemJSON422() *ValidationError { + return r.ApplicationproblemJSON422 +} + +// GetApplicationproblemJSON429 returns the response for an HTTP 429 `application/problem+json` response +func (r GetLogEntriesResponse) GetApplicationproblemJSON429() *TooManyRequests { + return r.ApplicationproblemJSON429 +} + +// GetApplicationproblemJSON502 returns the response for an HTTP 502 `application/problem+json` response +func (r GetLogEntriesResponse) GetApplicationproblemJSON502() *BadGateway { + return r.ApplicationproblemJSON502 +} + // GetApplicationproblemJSON503 returns the response for an HTTP 503 `application/problem+json` response -func (r ListUsageEventsResponse) GetApplicationproblemJSON503() *ServiceUnavailable { +func (r GetLogEntriesResponse) GetApplicationproblemJSON503() *ServiceUnavailable { return r.ApplicationproblemJSON503 } +// GetApplicationproblemJSON504 returns the response for an HTTP 504 `application/problem+json` response +func (r GetLogEntriesResponse) GetApplicationproblemJSON504() *GatewayTimeout { + return r.ApplicationproblemJSON504 +} + // GetBody returns the raw response body bytes -func (r ListUsageEventsResponse) GetBody() []byte { +func (r GetLogEntriesResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status -func (r ListUsageEventsResponse) Status() string { +func (r GetLogEntriesResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -9298,7 +11364,7 @@ func (r ListUsageEventsResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ListUsageEventsResponse) StatusCode() int { +func (r GetLogEntriesResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -9306,945 +11372,2376 @@ func (r ListUsageEventsResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r ListUsageEventsResponse) ContentType() string { +func (r GetLogEntriesResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -// GetAppSummaryWithResponse App summary metrics for the authenticated organisation -// -// Aggregate dashboard metrics across all apps owned by the authenticated organisation. Metrics whose backing system is not yet available are omitted from the response rather than reported as zero. -// -// Returns a wrapper object for the known response body format(s). -// -// Corresponds with GET /v1/app-summary (the `GetAppSummary` operationId). -func (c *ClientWithResponses) GetAppSummaryWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetAppSummaryResponse, error) { - rsp, err := c.GetAppSummary(ctx, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetAppSummaryResponse(rsp) -} +type ListInsightsQueriesResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *QueryCatalogue + // ApplicationproblemJSON401 the response for an HTTP 401 `application/problem+json` response + ApplicationproblemJSON401 *Unauthorized + // ApplicationproblemJSON403 the response for an HTTP 403 `application/problem+json` response + ApplicationproblemJSON403 *Forbidden + // ApplicationproblemJSON502 the response for an HTTP 502 `application/problem+json` response + ApplicationproblemJSON502 *BadGateway + // ApplicationproblemJSON503 the response for an HTTP 503 `application/problem+json` response + ApplicationproblemJSON503 *ServiceUnavailable + // ApplicationproblemJSON504 the response for an HTTP 504 `application/problem+json` response + ApplicationproblemJSON504 *GatewayTimeout +} -// ListAppsWithResponse List apps -// -// Returns a page of the organisation's apps. Filters combine with AND; soft-deleted apps are excluded unless `status=deleted` is requested explicitly. -// -// A `cursor` is only valid for the `sort` and filters it was issued under — reusing one across a different ordering or filter set returns `400`. -// -// Returns a wrapper object for the known response body format(s). -// -// Corresponds with GET /v1/apps (the `ListApps` operationId). -func (c *ClientWithResponses) ListAppsWithResponse(ctx context.Context, params *ListAppsParams, reqEditors ...RequestEditorFn) (*ListAppsResponse, error) { - rsp, err := c.ListApps(ctx, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseListAppsResponse(rsp) +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r ListInsightsQueriesResponse) GetJSON200() *QueryCatalogue { + return r.JSON200 } -// CreateAppWithBodyWithResponse Create an app -// -// Creates an app together with its worker configuration, environment variables and endpoints, and records version `1` — the immutable description of what to deploy. The app starts in `initializing`, and what happens next depends on the app source type: -// -// - `code` source: the codebase is submitted to the build pipeline; once the image is built -// and workers become healthy the app transitions to `active` and `activeVersionId` -// points at that version. If the build, validation, or rollout fails the app is -// marked `failed`. -// -// - `container` source: no build step, so the version carries no `buildId`. No worker runs -// from a container source yet, so the app stays `initializing` and does not serve -// inference — poll `active` only for a `code` source. -// -// `activeVersionId` is null until a rollout completes: a version records what should run, and only a finished deploy says what does. -// -// `secrets` is accepted by the schema but not yet applied, so supplying it returns `422` rather than silently dropping it. -// -// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). -// -// Corresponds with POST /v1/apps (the `CreateApp` operationId). -func (c *ClientWithResponses) CreateAppWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateAppResponse, error) { - rsp, err := c.CreateAppWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseCreateAppResponse(rsp) +// GetApplicationproblemJSON401 returns the response for an HTTP 401 `application/problem+json` response +func (r ListInsightsQueriesResponse) GetApplicationproblemJSON401() *Unauthorized { + return r.ApplicationproblemJSON401 } -// CreateAppWithResponse Create an app -// -// Creates an app together with its worker configuration, environment variables and endpoints, and records version `1` — the immutable description of what to deploy. The app starts in `initializing`, and what happens next depends on the app source type: -// -// - `code` source: the codebase is submitted to the build pipeline; once the image is built -// and workers become healthy the app transitions to `active` and `activeVersionId` -// points at that version. If the build, validation, or rollout fails the app is -// marked `failed`. -// -// - `container` source: no build step, so the version carries no `buildId`. No worker runs -// from a container source yet, so the app stays `initializing` and does not serve -// inference — poll `active` only for a `code` source. -// -// `activeVersionId` is null until a rollout completes: a version records what should run, and only a finished deploy says what does. -// -// `secrets` is accepted by the schema but not yet applied, so supplying it returns `422` rather than silently dropping it. -// -// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). -// -// Corresponds with POST /v1/apps (the `CreateApp` operationId). -func (c *ClientWithResponses) CreateAppWithResponse(ctx context.Context, body CreateAppJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateAppResponse, error) { - rsp, err := c.CreateApp(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseCreateAppResponse(rsp) +// GetApplicationproblemJSON403 returns the response for an HTTP 403 `application/problem+json` response +func (r ListInsightsQueriesResponse) GetApplicationproblemJSON403() *Forbidden { + return r.ApplicationproblemJSON403 } -// DeleteAppWithResponse Delete an app -// -// Soft delete. Sets `status = deleting` and returns `202` once that intent is persisted. Router removal, cancelling in-progress builds, and worker drain (`draining → stopping → stopped`) are performed asynchronously by the deployer/Scaler; `status` becomes `deleted` once all workers stop. All rows are retained for billing finalisation, audit, and usage history. Idempotent if the app is already `deleting`. -// -// Returns a wrapper object for the known response body format(s). -// -// Corresponds with DELETE /v1/apps/{appId} (the `DeleteApp` operationId). -func (c *ClientWithResponses) DeleteAppWithResponse(ctx context.Context, appId AppId, reqEditors ...RequestEditorFn) (*DeleteAppResponse, error) { - rsp, err := c.DeleteApp(ctx, appId, reqEditors...) - if err != nil { - return nil, err - } - return ParseDeleteAppResponse(rsp) +// GetApplicationproblemJSON502 returns the response for an HTTP 502 `application/problem+json` response +func (r ListInsightsQueriesResponse) GetApplicationproblemJSON502() *BadGateway { + return r.ApplicationproblemJSON502 } -// GetAppWithResponse Get an app -// -// Returns a wrapper object for the known response body format(s). -// -// Corresponds with GET /v1/apps/{appId} (the `GetApp` operationId). -func (c *ClientWithResponses) GetAppWithResponse(ctx context.Context, appId AppId, reqEditors ...RequestEditorFn) (*GetAppResponse, error) { - rsp, err := c.GetApp(ctx, appId, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetAppResponse(rsp) +// GetApplicationproblemJSON503 returns the response for an HTTP 503 `application/problem+json` response +func (r ListInsightsQueriesResponse) GetApplicationproblemJSON503() *ServiceUnavailable { + return r.ApplicationproblemJSON503 } -// UpdateAppWithBodyWithResponse Update an app -// -// Patches one or more aspects of an app in place. All fields are optional; omitted fields are left unchanged. Valid in any non-`deleted` status, including `stopped` (changes apply on `resume`). Lifecycle transitions use the dedicated `deploy`, `stop`, `resume`, and `delete` operations. -// -// **Currently persisted:** `appName` and `configuration` only. Supplying `appSource`, `secrets`, `environmentVariables`, or `endpoints` returns `422` (bulk env-var replace is not wired — use the dedicated `/environment-variables` endpoints for individual keys). -// -// Target behaviour (once fully wired): -// - `configuration`: applied on the next Scaler cycle; triggers a rollout so workers -// restart with the new configuration. If the rollout fails, the app remains on -// the previous configuration. -// -// - `appSource`: triggers a build (for `code` sources) or image validation (for `container` -// sources); on success the new version is deployed automatically. If the build or -// validation fails, the app remains on the previous version. -// -// - `secrets` / `environmentVariables` / `endpoints`: the supplied array **replaces** the -// current set — any item absent from the request is deleted. Endpoints take effect -// immediately. Changes to secrets or environment variables trigger a rollout so workers -// restart and pick up the new values. -// -// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). -// -// Corresponds with PATCH /v1/apps/{appId} (the `UpdateApp` operationId). -func (c *ClientWithResponses) UpdateAppWithBodyWithResponse(ctx context.Context, appId AppId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateAppResponse, error) { - rsp, err := c.UpdateAppWithBody(ctx, appId, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseUpdateAppResponse(rsp) +// GetApplicationproblemJSON504 returns the response for an HTTP 504 `application/problem+json` response +func (r ListInsightsQueriesResponse) GetApplicationproblemJSON504() *GatewayTimeout { + return r.ApplicationproblemJSON504 } -// UpdateAppWithResponse Update an app -// -// Patches one or more aspects of an app in place. All fields are optional; omitted fields are left unchanged. Valid in any non-`deleted` status, including `stopped` (changes apply on `resume`). Lifecycle transitions use the dedicated `deploy`, `stop`, `resume`, and `delete` operations. -// -// **Currently persisted:** `appName` and `configuration` only. Supplying `appSource`, `secrets`, `environmentVariables`, or `endpoints` returns `422` (bulk env-var replace is not wired — use the dedicated `/environment-variables` endpoints for individual keys). -// -// Target behaviour (once fully wired): -// -// - `configuration`: applied on the next Scaler cycle; triggers a rollout so workers -// restart with the new configuration. If the rollout fails, the app remains on -// the previous configuration. -// -// - `appSource`: triggers a build (for `code` sources) or image validation (for `container` -// sources); on success the new version is deployed automatically. If the build or -// validation fails, the app remains on the previous version. -// -// - `secrets` / `environmentVariables` / `endpoints`: the supplied array **replaces** the -// current set — any item absent from the request is deleted. Endpoints take effect -// immediately. Changes to secrets or environment variables trigger a rollout so workers -// restart and pick up the new values. -// -// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). -// -// Corresponds with PATCH /v1/apps/{appId} (the `UpdateApp` operationId). -func (c *ClientWithResponses) UpdateAppWithResponse(ctx context.Context, appId AppId, body UpdateAppJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateAppResponse, error) { - rsp, err := c.UpdateApp(ctx, appId, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseUpdateAppResponse(rsp) +// GetBody returns the raw response body bytes +func (r ListInsightsQueriesResponse) GetBody() []byte { + return r.Body } -// ListBuildsWithResponse List builds -// -// Returns a wrapper object for the known response body format(s). -// -// Corresponds with GET /v1/apps/{appId}/builds (the `ListBuilds` operationId). -func (c *ClientWithResponses) ListBuildsWithResponse(ctx context.Context, appId AppId, params *ListBuildsParams, reqEditors ...RequestEditorFn) (*ListBuildsResponse, error) { - rsp, err := c.ListBuilds(ctx, appId, params, reqEditors...) - if err != nil { - return nil, err +// Status returns HTTPResponse.Status +func (r ListInsightsQueriesResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status } - return ParseListBuildsResponse(rsp) + return http.StatusText(0) } -// GetBuildWithResponse Get a build -// -// Returns a wrapper object for the known response body format(s). -// -// Corresponds with GET /v1/apps/{appId}/builds/{buildId} (the `GetBuild` operationId). -func (c *ClientWithResponses) GetBuildWithResponse(ctx context.Context, appId AppId, buildId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetBuildResponse, error) { - rsp, err := c.GetBuild(ctx, appId, buildId, reqEditors...) - if err != nil { - return nil, err +// StatusCode returns HTTPResponse.StatusCode +func (r ListInsightsQueriesResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode } - return ParseGetBuildResponse(rsp) + return 0 } -// DeployVersionWithBodyWithResponse Deploy a version -// -// Activates a `ready` version by number, setting `activeVersionId` and returning `202` once that intent is persisted. Worker rollout, routing switch, and cancelling in-progress builds (`failed` with `error: "superseded"`) are performed asynchronously by the deployer/Scaler. Permitted in any addressable status, including `initializing` and `failed`. -// To roll back, supply an older `versionNumber` — the operation is identical to a forward deploy. No new version is created and no rebuild happens: the version's existing image is re-applied. Re-deploying the currently active version is permitted and re-applies it. -// A deploy to a `stopped` or `stopping` app records the version and rolls no workload, because no workers are running: the `202` does not imply a rollout there. The recorded version is the one applied when the app resumes. -// If the roll of a live app fails, `activeVersionId` is restored to the version that kept serving, so the field keeps naming the running image. -// **Rollout** (deployer/Scaler): the platform starts workers on the target version, waits for at least one to become healthy, switches task routing to the new version, then drains old-version workers gracefully. Old workers are given a fixed, platform-managed grace period to finish in-flight tasks before being force-terminated. If new workers fail to become healthy, old workers are not drained and the app continues on the previous version. -// Errors: - Deploy to a `deleting` app returns `409 Conflict` - `versionNumber` not found or not `ready` returns `409 Conflict` - A `container`-source version returns `409 Conflict` until container apps are supported - Deploy to a non-existent or `deleted` app returns `404 Not Found` -// -// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). -// -// Corresponds with POST /v1/apps/{appId}/deploy (the `DeployVersion` operationId). -func (c *ClientWithResponses) DeployVersionWithBodyWithResponse(ctx context.Context, appId AppId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DeployVersionResponse, error) { - rsp, err := c.DeployVersionWithBody(ctx, appId, contentType, body, reqEditors...) - if err != nil { - return nil, err +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r ListInsightsQueriesResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") } - return ParseDeployVersionResponse(rsp) + return "" } -// DeployVersionWithResponse Deploy a version -// -// Activates a `ready` version by number, setting `activeVersionId` and returning `202` once that intent is persisted. Worker rollout, routing switch, and cancelling in-progress builds (`failed` with `error: "superseded"`) are performed asynchronously by the deployer/Scaler. Permitted in any addressable status, including `initializing` and `failed`. -// To roll back, supply an older `versionNumber` — the operation is identical to a forward deploy. No new version is created and no rebuild happens: the version's existing image is re-applied. Re-deploying the currently active version is permitted and re-applies it. -// A deploy to a `stopped` or `stopping` app records the version and rolls no workload, because no workers are running: the `202` does not imply a rollout there. The recorded version is the one applied when the app resumes. -// If the roll of a live app fails, `activeVersionId` is restored to the version that kept serving, so the field keeps naming the running image. -// **Rollout** (deployer/Scaler): the platform starts workers on the target version, waits for at least one to become healthy, switches task routing to the new version, then drains old-version workers gracefully. Old workers are given a fixed, platform-managed grace period to finish in-flight tasks before being force-terminated. If new workers fail to become healthy, old workers are not drained and the app continues on the previous version. -// Errors: - Deploy to a `deleting` app returns `409 Conflict` - `versionNumber` not found or not `ready` returns `409 Conflict` - A `container`-source version returns `409 Conflict` until container apps are supported - Deploy to a non-existent or `deleted` app returns `404 Not Found` -// -// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). -// -// Corresponds with POST /v1/apps/{appId}/deploy (the `DeployVersion` operationId). -func (c *ClientWithResponses) DeployVersionWithResponse(ctx context.Context, appId AppId, body DeployVersionJSONRequestBody, reqEditors ...RequestEditorFn) (*DeployVersionResponse, error) { - rsp, err := c.DeployVersion(ctx, appId, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseDeployVersionResponse(rsp) +// GetMetricSeriesResponse429Headers the declared response headers of an HTTP 429 response for GetMetricSeries +type GetMetricSeriesResponse429Headers struct { + RetryAfter int32 } -// ListEndpointsWithResponse List endpoints -// -// Returns a wrapper object for the known response body format(s). -// -// Corresponds with GET /v1/apps/{appId}/endpoints (the `ListEndpoints` operationId). -func (c *ClientWithResponses) ListEndpointsWithResponse(ctx context.Context, appId AppId, params *ListEndpointsParams, reqEditors ...RequestEditorFn) (*ListEndpointsResponse, error) { - rsp, err := c.ListEndpoints(ctx, appId, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseListEndpointsResponse(rsp) +type GetMetricSeriesResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *MetricSeries + // ApplicationproblemJSON400 the response for an HTTP 400 `application/problem+json` response + ApplicationproblemJSON400 *BadRequest + // ApplicationproblemJSON401 the response for an HTTP 401 `application/problem+json` response + ApplicationproblemJSON401 *Unauthorized + // ApplicationproblemJSON403 the response for an HTTP 403 `application/problem+json` response + ApplicationproblemJSON403 *Forbidden + // ApplicationproblemJSON404 the response for an HTTP 404 `application/problem+json` response + ApplicationproblemJSON404 *NotFound + // ApplicationproblemJSON422 the response for an HTTP 422 `application/problem+json` response + ApplicationproblemJSON422 *ValidationError + // ApplicationproblemJSON429 the response for an HTTP 429 `application/problem+json` response + ApplicationproblemJSON429 *TooManyRequests + // ApplicationproblemJSON502 the response for an HTTP 502 `application/problem+json` response + ApplicationproblemJSON502 *BadGateway + // ApplicationproblemJSON503 the response for an HTTP 503 `application/problem+json` response + ApplicationproblemJSON503 *ServiceUnavailable + // ApplicationproblemJSON504 the response for an HTTP 504 `application/problem+json` response + ApplicationproblemJSON504 *GatewayTimeout + // Headers429 the parsed response headers for an HTTP 429 response + Headers429 *GetMetricSeriesResponse429Headers } -// GetEndpointWithResponse Get an endpoint -// -// Returns a wrapper object for the known response body format(s). -// -// Corresponds with GET /v1/apps/{appId}/endpoints/{endpointId} (the `GetEndpoint` operationId). -func (c *ClientWithResponses) GetEndpointWithResponse(ctx context.Context, appId AppId, endpointId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetEndpointResponse, error) { - rsp, err := c.GetEndpoint(ctx, appId, endpointId, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetEndpointResponse(rsp) +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r GetMetricSeriesResponse) GetJSON200() *MetricSeries { + return r.JSON200 } -// ListAppEnvironmentVariablesWithResponse List app environment variables -// -// Returns a wrapper object for the known response body format(s). -// -// Corresponds with GET /v1/apps/{appId}/environment-variables (the `ListAppEnvironmentVariables` operationId). -func (c *ClientWithResponses) ListAppEnvironmentVariablesWithResponse(ctx context.Context, appId AppId, params *ListAppEnvironmentVariablesParams, reqEditors ...RequestEditorFn) (*ListAppEnvironmentVariablesResponse, error) { - rsp, err := c.ListAppEnvironmentVariables(ctx, appId, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseListAppEnvironmentVariablesResponse(rsp) +// GetApplicationproblemJSON400 returns the response for an HTTP 400 `application/problem+json` response +func (r GetMetricSeriesResponse) GetApplicationproblemJSON400() *BadRequest { + return r.ApplicationproblemJSON400 } -// DeleteAppEnvironmentVariableWithResponse Delete an app environment variable -// -// Returns a wrapper object for the known response body format(s). -// -// Corresponds with DELETE /v1/apps/{appId}/environment-variables/{variableName} (the `DeleteAppEnvironmentVariable` operationId). -func (c *ClientWithResponses) DeleteAppEnvironmentVariableWithResponse(ctx context.Context, appId AppId, variableName EnvironmentVariableName, reqEditors ...RequestEditorFn) (*DeleteAppEnvironmentVariableResponse, error) { - rsp, err := c.DeleteAppEnvironmentVariable(ctx, appId, variableName, reqEditors...) - if err != nil { - return nil, err - } - return ParseDeleteAppEnvironmentVariableResponse(rsp) +// GetApplicationproblemJSON401 returns the response for an HTTP 401 `application/problem+json` response +func (r GetMetricSeriesResponse) GetApplicationproblemJSON401() *Unauthorized { + return r.ApplicationproblemJSON401 } -// UpdateAppEnvironmentVariableWithBodyWithResponse Update an app environment variable -// -// Sets one environment variable, creating it if absent. Names the platform sets on the serving container itself are rejected with `422`, as they are on create. -// -// An app holds at most 100 environment bindings in total — plain variables plus attached secrets — the same combined ceiling `AppCreate.environmentVariables` declares (create rejects secrets in-request; attach grows the set later). Overwriting an existing variable is always allowed; adding one past the ceiling returns `422`. -// -// The name must not collide with a secret already attached to this app (the secret's injected env var name). Secrets and plain env vars share the pod environment; a duplicate would be resolved last-wins by kubelet with no error, so the server rejects it with `422`. The reverse check applies on attach. -// -// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). -// -// Corresponds with PUT /v1/apps/{appId}/environment-variables/{variableName} (the `UpdateAppEnvironmentVariable` operationId). -func (c *ClientWithResponses) UpdateAppEnvironmentVariableWithBodyWithResponse(ctx context.Context, appId AppId, variableName EnvironmentVariableName, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateAppEnvironmentVariableResponse, error) { - rsp, err := c.UpdateAppEnvironmentVariableWithBody(ctx, appId, variableName, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseUpdateAppEnvironmentVariableResponse(rsp) +// GetApplicationproblemJSON403 returns the response for an HTTP 403 `application/problem+json` response +func (r GetMetricSeriesResponse) GetApplicationproblemJSON403() *Forbidden { + return r.ApplicationproblemJSON403 } -// UpdateAppEnvironmentVariableWithResponse Update an app environment variable -// -// Sets one environment variable, creating it if absent. Names the platform sets on the serving container itself are rejected with `422`, as they are on create. -// -// An app holds at most 100 environment bindings in total — plain variables plus attached secrets — the same combined ceiling `AppCreate.environmentVariables` declares (create rejects secrets in-request; attach grows the set later). Overwriting an existing variable is always allowed; adding one past the ceiling returns `422`. -// -// The name must not collide with a secret already attached to this app (the secret's injected env var name). Secrets and plain env vars share the pod environment; a duplicate would be resolved last-wins by kubelet with no error, so the server rejects it with `422`. The reverse check applies on attach. -// -// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). -// -// Corresponds with PUT /v1/apps/{appId}/environment-variables/{variableName} (the `UpdateAppEnvironmentVariable` operationId). -func (c *ClientWithResponses) UpdateAppEnvironmentVariableWithResponse(ctx context.Context, appId AppId, variableName EnvironmentVariableName, body UpdateAppEnvironmentVariableJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateAppEnvironmentVariableResponse, error) { - rsp, err := c.UpdateAppEnvironmentVariable(ctx, appId, variableName, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseUpdateAppEnvironmentVariableResponse(rsp) +// GetApplicationproblemJSON404 returns the response for an HTTP 404 `application/problem+json` response +func (r GetMetricSeriesResponse) GetApplicationproblemJSON404() *NotFound { + return r.ApplicationproblemJSON404 } -// ListAppEventsWithResponse List app events -// -// Returns a wrapper object for the known response body format(s). -// -// Corresponds with GET /v1/apps/{appId}/events (the `ListAppEvents` operationId). -func (c *ClientWithResponses) ListAppEventsWithResponse(ctx context.Context, appId AppId, params *ListAppEventsParams, reqEditors ...RequestEditorFn) (*ListAppEventsResponse, error) { - rsp, err := c.ListAppEvents(ctx, appId, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseListAppEventsResponse(rsp) +// GetApplicationproblemJSON422 returns the response for an HTTP 422 `application/problem+json` response +func (r GetMetricSeriesResponse) GetApplicationproblemJSON422() *ValidationError { + return r.ApplicationproblemJSON422 } -// UnfavouriteAppWithResponse Unfavourite an app -// -// Removes the organisation favourite pin from the app. Idempotent: unfavouriting an app that is not favourited succeeds and returns the app with `isFavourite: false`. Valid in any status including `deleting` and `deleted` — unpinning is not an app lifecycle mutation. Missing apps return `404`. -// -// Returns a wrapper object for the known response body format(s). -// -// Corresponds with DELETE /v1/apps/{appId}/favourite (the `UnfavouriteApp` operationId). -func (c *ClientWithResponses) UnfavouriteAppWithResponse(ctx context.Context, appId AppId, reqEditors ...RequestEditorFn) (*UnfavouriteAppResponse, error) { - rsp, err := c.UnfavouriteApp(ctx, appId, reqEditors...) - if err != nil { - return nil, err - } - return ParseUnfavouriteAppResponse(rsp) +// GetApplicationproblemJSON429 returns the response for an HTTP 429 `application/problem+json` response +func (r GetMetricSeriesResponse) GetApplicationproblemJSON429() *TooManyRequests { + return r.ApplicationproblemJSON429 } -// FavouriteAppWithResponse Favourite an app -// -// Pins the app as a favourite for the authenticated organisation so the console can surface it in a Favourites section. Idempotent: favouriting an already-favourited app succeeds and returns the app with `isFavourite: true`. Apps in `deleting` or `deleted` status cannot be favourited (`404`). Soft-delete clears any existing pin when status becomes `deleting`. -// -// Returns a wrapper object for the known response body format(s). -// -// Corresponds with PUT /v1/apps/{appId}/favourite (the `FavouriteApp` operationId). -func (c *ClientWithResponses) FavouriteAppWithResponse(ctx context.Context, appId AppId, reqEditors ...RequestEditorFn) (*FavouriteAppResponse, error) { - rsp, err := c.FavouriteApp(ctx, appId, reqEditors...) - if err != nil { - return nil, err - } - return ParseFavouriteAppResponse(rsp) +// GetApplicationproblemJSON502 returns the response for an HTTP 502 `application/problem+json` response +func (r GetMetricSeriesResponse) GetApplicationproblemJSON502() *BadGateway { + return r.ApplicationproblemJSON502 } -// StartAsyncTaskWithBodyWithResponse Start a new async task -// -// Starts a new async task on `appId`, routing the request body payload to an available worker. The task runs asynchronously and the response is `202`; poll `GET /v1/apps/{appId}/tasks/{taskId}` for completion. Apps in `initializing`, `active`, or `stopping` accept invocation. `stopped`, `deleting`, and `failed` return `409 Conflict`; unknown or deleted apps return `404 Not Found`. -// -// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). -// -// Corresponds with POST /v1/apps/{appId}/invoke-async/{endpointPath} (the `StartAsyncTask` operationId). -func (c *ClientWithResponses) StartAsyncTaskWithBodyWithResponse(ctx context.Context, appId AppId, endpointPath EndpointPath, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*StartAsyncTaskResponse, error) { - rsp, err := c.StartAsyncTaskWithBody(ctx, appId, endpointPath, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseStartAsyncTaskResponse(rsp) +// GetApplicationproblemJSON503 returns the response for an HTTP 503 `application/problem+json` response +func (r GetMetricSeriesResponse) GetApplicationproblemJSON503() *ServiceUnavailable { + return r.ApplicationproblemJSON503 } -// StartAsyncTaskWithResponse Start a new async task -// -// Starts a new async task on `appId`, routing the request body payload to an available worker. The task runs asynchronously and the response is `202`; poll `GET /v1/apps/{appId}/tasks/{taskId}` for completion. Apps in `initializing`, `active`, or `stopping` accept invocation. `stopped`, `deleting`, and `failed` return `409 Conflict`; unknown or deleted apps return `404 Not Found`. -// -// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). -// -// Corresponds with POST /v1/apps/{appId}/invoke-async/{endpointPath} (the `StartAsyncTask` operationId). -func (c *ClientWithResponses) StartAsyncTaskWithResponse(ctx context.Context, appId AppId, endpointPath EndpointPath, body StartAsyncTaskJSONRequestBody, reqEditors ...RequestEditorFn) (*StartAsyncTaskResponse, error) { - rsp, err := c.StartAsyncTask(ctx, appId, endpointPath, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseStartAsyncTaskResponse(rsp) +// GetApplicationproblemJSON504 returns the response for an HTTP 504 `application/problem+json` response +func (r GetMetricSeriesResponse) GetApplicationproblemJSON504() *GatewayTimeout { + return r.ApplicationproblemJSON504 } -// StartSyncTaskWithBodyWithResponse Start a new sync task -// -// Starts a new sync task on `appId`, routing the request body payload to an available worker. The request blocks until the task is terminal and returns the result inline (`200`), or `504` if it does not complete within the wait window. When the accepted task ID is available, the response includes `taskId` for polling. Apps in `initializing`, `active`, or `stopping` accept invocation. `stopped`, `deleting`, and `failed` return `409 Conflict`; unknown or deleted apps return `404 Not Found`. -// -// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). -// -// Corresponds with POST /v1/apps/{appId}/invoke-sync/{endpointPath} (the `StartSyncTask` operationId). -func (c *ClientWithResponses) StartSyncTaskWithBodyWithResponse(ctx context.Context, appId AppId, endpointPath EndpointPath, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*StartSyncTaskResponse, error) { - rsp, err := c.StartSyncTaskWithBody(ctx, appId, endpointPath, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseStartSyncTaskResponse(rsp) +// GetBody returns the raw response body bytes +func (r GetMetricSeriesResponse) GetBody() []byte { + return r.Body } -// StartSyncTaskWithResponse Start a new sync task -// -// Starts a new sync task on `appId`, routing the request body payload to an available worker. The request blocks until the task is terminal and returns the result inline (`200`), or `504` if it does not complete within the wait window. When the accepted task ID is available, the response includes `taskId` for polling. Apps in `initializing`, `active`, or `stopping` accept invocation. `stopped`, `deleting`, and `failed` return `409 Conflict`; unknown or deleted apps return `404 Not Found`. -// -// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). -// -// Corresponds with POST /v1/apps/{appId}/invoke-sync/{endpointPath} (the `StartSyncTask` operationId). -func (c *ClientWithResponses) StartSyncTaskWithResponse(ctx context.Context, appId AppId, endpointPath EndpointPath, body StartSyncTaskJSONRequestBody, reqEditors ...RequestEditorFn) (*StartSyncTaskResponse, error) { - rsp, err := c.StartSyncTask(ctx, appId, endpointPath, body, reqEditors...) - if err != nil { - return nil, err +// Status returns HTTPResponse.Status +func (r GetMetricSeriesResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status } - return ParseStartSyncTaskResponse(rsp) + return http.StatusText(0) } -// ResumeAppWithResponse Resume an app -// -// Moves the app to `initializing` and returns `202` once that intent is persisted. The Scaler then starts workers and sets the app to `active`; tasks that remained queued when the app stopped are consumed as workers come online. Precondition: `status = stopped`. -// -// Returns a wrapper object for the known response body format(s). -// -// Corresponds with POST /v1/apps/{appId}/resume (the `ResumeApp` operationId). -func (c *ClientWithResponses) ResumeAppWithResponse(ctx context.Context, appId AppId, reqEditors ...RequestEditorFn) (*ResumeAppResponse, error) { - rsp, err := c.ResumeApp(ctx, appId, reqEditors...) - if err != nil { - return nil, err +// StatusCode returns HTTPResponse.StatusCode +func (r GetMetricSeriesResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode } - return ParseResumeAppResponse(rsp) + return 0 } -// ListAppSecretsWithResponse List secrets attached to an app -// -// Returns a wrapper object for the known response body format(s). -// -// Corresponds with GET /v1/apps/{appId}/secrets (the `ListAppSecrets` operationId). -func (c *ClientWithResponses) ListAppSecretsWithResponse(ctx context.Context, appId AppId, params *ListAppSecretsParams, reqEditors ...RequestEditorFn) (*ListAppSecretsResponse, error) { - rsp, err := c.ListAppSecrets(ctx, appId, params, reqEditors...) - if err != nil { - return nil, err +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r GetMetricSeriesResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") } - return ParseListAppSecretsResponse(rsp) + return "" } -// AttachAppSecretWithBodyWithResponse Attach a secret to an app -// -// Records that an organisation secret is attached to an app under a resolved env-var name. This is a control-plane association only in this release — it does not roll workers or inject values into pods yet (ADR-019 in-pod unseal is separate). Returns `409` if the secret is already attached, or if another attach would use the same env-var name. -// The resolved name (`envVarName`, or `secretName` when omitted) must not already exist as a plain environment variable on this app (`deployment_configs.key`). Both sources are reserved for the same future pod env namespace, so the server rejects the collision with `422` instead of allowing a last-wins override later. The reverse check applies when setting a plain environment variable. -// An app holds at most 100 environment bindings in total — plain environment variables plus attached secrets — the same combined ceiling as create and the single-key env-var route. Attaching when the app is already at that limit returns `422`. -// -// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). -// -// Corresponds with POST /v1/apps/{appId}/secrets (the `AttachAppSecret` operationId). -func (c *ClientWithResponses) AttachAppSecretWithBodyWithResponse(ctx context.Context, appId AppId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AttachAppSecretResponse, error) { - rsp, err := c.AttachAppSecretWithBody(ctx, appId, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseAttachAppSecretResponse(rsp) +type UpsertOrgTenancyResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *OrgTenancy + // ApplicationproblemJSON400 the response for an HTTP 400 `application/problem+json` response + ApplicationproblemJSON400 *BadRequest + // ApplicationproblemJSON401 the response for an HTTP 401 `application/problem+json` response + ApplicationproblemJSON401 *Unauthorized + // ApplicationproblemJSON403 the response for an HTTP 403 `application/problem+json` response + ApplicationproblemJSON403 *Forbidden + // ApplicationproblemJSON422 the response for an HTTP 422 `application/problem+json` response + ApplicationproblemJSON422 *ValidationError + // ApplicationproblemJSON503 the response for an HTTP 503 `application/problem+json` response + ApplicationproblemJSON503 *ServiceUnavailable } -// AttachAppSecretWithResponse Attach a secret to an app -// -// Records that an organisation secret is attached to an app under a resolved env-var name. This is a control-plane association only in this release — it does not roll workers or inject values into pods yet (ADR-019 in-pod unseal is separate). Returns `409` if the secret is already attached, or if another attach would use the same env-var name. -// The resolved name (`envVarName`, or `secretName` when omitted) must not already exist as a plain environment variable on this app (`deployment_configs.key`). Both sources are reserved for the same future pod env namespace, so the server rejects the collision with `422` instead of allowing a last-wins override later. The reverse check applies when setting a plain environment variable. -// An app holds at most 100 environment bindings in total — plain environment variables plus attached secrets — the same combined ceiling as create and the single-key env-var route. Attaching when the app is already at that limit returns `422`. -// -// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). -// -// Corresponds with POST /v1/apps/{appId}/secrets (the `AttachAppSecret` operationId). -func (c *ClientWithResponses) AttachAppSecretWithResponse(ctx context.Context, appId AppId, body AttachAppSecretJSONRequestBody, reqEditors ...RequestEditorFn) (*AttachAppSecretResponse, error) { - rsp, err := c.AttachAppSecret(ctx, appId, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseAttachAppSecretResponse(rsp) +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r UpsertOrgTenancyResponse) GetJSON200() *OrgTenancy { + return r.JSON200 } -// DetachAppSecretWithResponse Detach a secret from an app -// -// Removes the control-plane attachment. Does not roll workers in this release. -// -// Returns a wrapper object for the known response body format(s). -// -// Corresponds with DELETE /v1/apps/{appId}/secrets/{secretName} (the `DetachAppSecret` operationId). -func (c *ClientWithResponses) DetachAppSecretWithResponse(ctx context.Context, appId AppId, secretName SecretName, reqEditors ...RequestEditorFn) (*DetachAppSecretResponse, error) { - rsp, err := c.DetachAppSecret(ctx, appId, secretName, reqEditors...) - if err != nil { - return nil, err - } - return ParseDetachAppSecretResponse(rsp) +// GetApplicationproblemJSON400 returns the response for an HTTP 400 `application/problem+json` response +func (r UpsertOrgTenancyResponse) GetApplicationproblemJSON400() *BadRequest { + return r.ApplicationproblemJSON400 } -// StopAppWithResponse Stop an app -// -// Moves the app to `stopping` and returns `202` once that intent is persisted. Scale-to-zero and worker drain are performed asynchronously by the Scaler; `status` becomes `stopped` once all workers drain. In-flight tasks have a fixed, platform-managed grace period to complete; workers that exceed it are force-terminated and their tasks return to the queue per delivery guarantees. New task submissions remain accepted while `stopping`; after the app reaches `stopped`, submissions return `409 Conflict`. Precondition: `status = active`. -// -// Returns a wrapper object for the known response body format(s). -// -// Corresponds with POST /v1/apps/{appId}/stop (the `StopApp` operationId). -func (c *ClientWithResponses) StopAppWithResponse(ctx context.Context, appId AppId, reqEditors ...RequestEditorFn) (*StopAppResponse, error) { - rsp, err := c.StopApp(ctx, appId, reqEditors...) - if err != nil { - return nil, err - } - return ParseStopAppResponse(rsp) +// GetApplicationproblemJSON401 returns the response for an HTTP 401 `application/problem+json` response +func (r UpsertOrgTenancyResponse) GetApplicationproblemJSON401() *Unauthorized { + return r.ApplicationproblemJSON401 } -// ListTasksWithResponse List tasks for an app -// -// Lists TTL-bounded asynchronous task metadata for this app so a client can recover task ids after an interrupted long-poll or CLI session. Pending includes queued, running and retrying work. Tasks appear only within the configured recovery window. A page can be empty and still have `nextCursor`; continue until it is null. Pending entries are best effort and may disappear if the recovery store restarts; tracked tasks reappear on completion. This is not persisted task history. Each submission has a new task id, so client retries can appear as separate tasks. If the app is `stopped`, `deleting`, or `failed`, recovery stays available. Unknown or deleted apps return `404 Not Found`. -// -// Returns a wrapper object for the known response body format(s). -// -// Corresponds with GET /v1/apps/{appId}/tasks (the `ListTasks` operationId). -func (c *ClientWithResponses) ListTasksWithResponse(ctx context.Context, appId AppId, params *ListTasksParams, reqEditors ...RequestEditorFn) (*ListTasksResponse, error) { - rsp, err := c.ListTasks(ctx, appId, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseListTasksResponse(rsp) +// GetApplicationproblemJSON403 returns the response for an HTTP 403 `application/problem+json` response +func (r UpsertOrgTenancyResponse) GetApplicationproblemJSON403() *Forbidden { + return r.ApplicationproblemJSON403 } -// GetTaskWithResponse Get a task -// -// Returns the task's current status, read through the inference transport layer from the shared result store. When `completed`, includes the result `output` and `completedAt`; when `failed`, includes `error`; when `pending`, neither is set. If the app is `stopped`, `deleting`, or `failed`, accepted task results stay readable. A `404 Not Found` means the task cannot currently be verified for this app. Because enqueue-time ownership tracking is best effort, a recently returned task ID can temporarily return `404`; retry it within the normal polling window. Unknown or deleted apps also return `404 Not Found`. -// -// Returns a wrapper object for the known response body format(s). -// -// Corresponds with GET /v1/apps/{appId}/tasks/{taskId} (the `GetTask` operationId). -func (c *ClientWithResponses) GetTaskWithResponse(ctx context.Context, appId AppId, taskId string, reqEditors ...RequestEditorFn) (*GetTaskResponse, error) { - rsp, err := c.GetTask(ctx, appId, taskId, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetTaskResponse(rsp) +// GetApplicationproblemJSON422 returns the response for an HTTP 422 `application/problem+json` response +func (r UpsertOrgTenancyResponse) GetApplicationproblemJSON422() *ValidationError { + return r.ApplicationproblemJSON422 } -// ListVersionsWithResponse List versions -// -// Returns a wrapper object for the known response body format(s). -// -// Corresponds with GET /v1/apps/{appId}/versions (the `ListVersions` operationId). -func (c *ClientWithResponses) ListVersionsWithResponse(ctx context.Context, appId AppId, params *ListVersionsParams, reqEditors ...RequestEditorFn) (*ListVersionsResponse, error) { - rsp, err := c.ListVersions(ctx, appId, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseListVersionsResponse(rsp) +// GetApplicationproblemJSON503 returns the response for an HTTP 503 `application/problem+json` response +func (r UpsertOrgTenancyResponse) GetApplicationproblemJSON503() *ServiceUnavailable { + return r.ApplicationproblemJSON503 } -// GetVersionWithResponse Get a version -// -// Returns a wrapper object for the known response body format(s). -// -// Corresponds with GET /v1/apps/{appId}/versions/{versionNumber} (the `GetVersion` operationId). -func (c *ClientWithResponses) GetVersionWithResponse(ctx context.Context, appId AppId, versionNumber int32, reqEditors ...RequestEditorFn) (*GetVersionResponse, error) { - rsp, err := c.GetVersion(ctx, appId, versionNumber, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetVersionResponse(rsp) +// GetBody returns the raw response body bytes +func (r UpsertOrgTenancyResponse) GetBody() []byte { + return r.Body } -// ListWorkersWithResponse List workers -// -// Returns a newest-first page of workers observed for the app (including terminal `stopped` rows until purged). Optional `status` narrows the page; a cursor must be replayed under the same status filter it was issued with. -// -// Returns a wrapper object for the known response body format(s). -// -// Corresponds with GET /v1/apps/{appId}/workers (the `ListWorkers` operationId). -func (c *ClientWithResponses) ListWorkersWithResponse(ctx context.Context, appId AppId, params *ListWorkersParams, reqEditors ...RequestEditorFn) (*ListWorkersResponse, error) { - rsp, err := c.ListWorkers(ctx, appId, params, reqEditors...) - if err != nil { - return nil, err +// Status returns HTTPResponse.Status +func (r UpsertOrgTenancyResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status } - return ParseListWorkersResponse(rsp) + return http.StatusText(0) } -// GetWorkerWithResponse Get a worker -// -// Returns one worker by id within the app. The id is the Kubernetes pod UID recorded by the reconciler. A worker that belongs to another app (or tenant) is not found. -// -// Returns a wrapper object for the known response body format(s). -// -// Corresponds with GET /v1/apps/{appId}/workers/{workerId} (the `GetWorker` operationId). -func (c *ClientWithResponses) GetWorkerWithResponse(ctx context.Context, appId AppId, workerId WorkerId, reqEditors ...RequestEditorFn) (*GetWorkerResponse, error) { - rsp, err := c.GetWorker(ctx, appId, workerId, reqEditors...) - if err != nil { - return nil, err +// StatusCode returns HTTPResponse.StatusCode +func (r UpsertOrgTenancyResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode } - return ParseGetWorkerResponse(rsp) + return 0 } -// ListGpuTypesWithResponse List supported GPU types and their pricing -// -// Returns the global GPU type catalogue and pricing. The request requires authentication. Customer principals receive only GPU types with capacity currently offered to customers; a type whose hardware is not yet cleared for customer workloads is omitted. The Runware principal receives the full catalogue, including retired types and types not yet offered. Retired entries carry `deletedAt`. Each entry's `pricing` is the price currently in effect; the Runware principal can read the full price history, including scheduled future changes, from `GET /v1/gpu-types/{gpuTypeId}/prices`. -// -// Returns a wrapper object for the known response body format(s). -// -// Corresponds with GET /v1/gpu-types (the `ListGpuTypes` operationId). -func (c *ClientWithResponses) ListGpuTypesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListGpuTypesResponse, error) { - rsp, err := c.ListGpuTypes(ctx, reqEditors...) - if err != nil { - return nil, err +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r UpsertOrgTenancyResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") } - return ParseListGpuTypesResponse(rsp) + return "" } -// CreateGpuTypeWithBodyWithResponse Add a GPU type to the catalogue -// -// Creates a new entry in the global GPU type catalogue. Restricted to the Runware platform organization. The `id` (catalogue code) is immutable and remains reserved after retirement. -// -// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). -// -// Corresponds with POST /v1/gpu-types (the `CreateGpuType` operationId). -func (c *ClientWithResponses) CreateGpuTypeWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateGpuTypeResponse, error) { - rsp, err := c.CreateGpuTypeWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err +type ListSecretsResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + Data *[]Secret `json:"data,omitempty"` + + // NextCursor Cursor for the next page; null when there are no more items. + NextCursor *string `json:"nextCursor,omitempty"` } - return ParseCreateGpuTypeResponse(rsp) + // ApplicationproblemJSON400 the response for an HTTP 400 `application/problem+json` response + ApplicationproblemJSON400 *BadRequest + // ApplicationproblemJSON401 the response for an HTTP 401 `application/problem+json` response + ApplicationproblemJSON401 *Unauthorized + // ApplicationproblemJSON403 the response for an HTTP 403 `application/problem+json` response + ApplicationproblemJSON403 *Forbidden + // ApplicationproblemJSON422 the response for an HTTP 422 `application/problem+json` response + ApplicationproblemJSON422 *ValidationError + // ApplicationproblemJSON503 the response for an HTTP 503 `application/problem+json` response + ApplicationproblemJSON503 *ServiceUnavailable } -// CreateGpuTypeWithResponse Add a GPU type to the catalogue -// -// Creates a new entry in the global GPU type catalogue. Restricted to the Runware platform organization. The `id` (catalogue code) is immutable and remains reserved after retirement. -// -// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). -// -// Corresponds with POST /v1/gpu-types (the `CreateGpuType` operationId). -func (c *ClientWithResponses) CreateGpuTypeWithResponse(ctx context.Context, body CreateGpuTypeJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateGpuTypeResponse, error) { - rsp, err := c.CreateGpuType(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseCreateGpuTypeResponse(rsp) +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r ListSecretsResponse) GetJSON200() *struct { + Data *[]Secret `json:"data,omitempty"` + + // NextCursor Cursor for the next page; null when there are no more items. + NextCursor *string `json:"nextCursor,omitempty"` +} { + return r.JSON200 } -// DeleteGpuTypeWithResponse Retire a GPU type from the catalogue -// -// Soft-deletes a GPU type while preserving its code and price history. Restricted to the Runware platform organization. Returns `409` if a worker configuration or GPU pool still references the code. Retiring an already retired code returns `404`. -// -// Returns a wrapper object for the known response body format(s). -// -// Corresponds with DELETE /v1/gpu-types/{gpuTypeId} (the `DeleteGpuType` operationId). -func (c *ClientWithResponses) DeleteGpuTypeWithResponse(ctx context.Context, gpuTypeId GpuTypeId, reqEditors ...RequestEditorFn) (*DeleteGpuTypeResponse, error) { - rsp, err := c.DeleteGpuType(ctx, gpuTypeId, reqEditors...) - if err != nil { - return nil, err - } - return ParseDeleteGpuTypeResponse(rsp) +// GetApplicationproblemJSON400 returns the response for an HTTP 400 `application/problem+json` response +func (r ListSecretsResponse) GetApplicationproblemJSON400() *BadRequest { + return r.ApplicationproblemJSON400 } -// GetGpuTypeWithResponse Get a GPU type from the catalogue -// -// Returns an active entry from the global GPU type catalogue. Retired entries return `404`. The result is not organisation-specific, but the request still requires authentication. -// -// Returns a wrapper object for the known response body format(s). -// -// Corresponds with GET /v1/gpu-types/{gpuTypeId} (the `GetGpuType` operationId). -func (c *ClientWithResponses) GetGpuTypeWithResponse(ctx context.Context, gpuTypeId GpuTypeId, reqEditors ...RequestEditorFn) (*GetGpuTypeResponse, error) { - rsp, err := c.GetGpuType(ctx, gpuTypeId, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetGpuTypeResponse(rsp) +// GetApplicationproblemJSON401 returns the response for an HTTP 401 `application/problem+json` response +func (r ListSecretsResponse) GetApplicationproblemJSON401() *Unauthorized { + return r.ApplicationproblemJSON401 } -// UpdateGpuTypeWithBodyWithResponse Update a GPU type in the catalogue -// -// Updates mutable fields of an active GPU type. Restricted to the Runware platform organization. The catalogue code (`gpuTypeId`) cannot be changed; retired entries return `404`. -// -// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). -// -// Corresponds with PATCH /v1/gpu-types/{gpuTypeId} (the `UpdateGpuType` operationId). -func (c *ClientWithResponses) UpdateGpuTypeWithBodyWithResponse(ctx context.Context, gpuTypeId GpuTypeId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateGpuTypeResponse, error) { - rsp, err := c.UpdateGpuTypeWithBody(ctx, gpuTypeId, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseUpdateGpuTypeResponse(rsp) +// GetApplicationproblemJSON403 returns the response for an HTTP 403 `application/problem+json` response +func (r ListSecretsResponse) GetApplicationproblemJSON403() *Forbidden { + return r.ApplicationproblemJSON403 } -// UpdateGpuTypeWithResponse Update a GPU type in the catalogue -// -// Updates mutable fields of an active GPU type. Restricted to the Runware platform organization. The catalogue code (`gpuTypeId`) cannot be changed; retired entries return `404`. -// -// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). -// -// Corresponds with PATCH /v1/gpu-types/{gpuTypeId} (the `UpdateGpuType` operationId). -func (c *ClientWithResponses) UpdateGpuTypeWithResponse(ctx context.Context, gpuTypeId GpuTypeId, body UpdateGpuTypeJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateGpuTypeResponse, error) { - rsp, err := c.UpdateGpuType(ctx, gpuTypeId, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseUpdateGpuTypeResponse(rsp) +// GetApplicationproblemJSON422 returns the response for an HTTP 422 `application/problem+json` response +func (r ListSecretsResponse) GetApplicationproblemJSON422() *ValidationError { + return r.ApplicationproblemJSON422 } -// ListGpuTypePricesWithResponse List historical and future prices of a GPU type -// -// Returns a page of a GPU type's prices, ordered by effectiveFrom. Restricted to the Runware platform organization: the page includes retired types and prices that are scheduled but not yet in effect. Customers read the price currently in effect from `GET /v1/gpu-types`. -// -// Returns a wrapper object for the known response body format(s). -// -// Corresponds with GET /v1/gpu-types/{gpuTypeId}/prices (the `ListGpuTypePrices` operationId). -func (c *ClientWithResponses) ListGpuTypePricesWithResponse(ctx context.Context, gpuTypeId GpuTypeId, params *ListGpuTypePricesParams, reqEditors ...RequestEditorFn) (*ListGpuTypePricesResponse, error) { - rsp, err := c.ListGpuTypePrices(ctx, gpuTypeId, params, reqEditors...) - if err != nil { - return nil, err +// GetApplicationproblemJSON503 returns the response for an HTTP 503 `application/problem+json` response +func (r ListSecretsResponse) GetApplicationproblemJSON503() *ServiceUnavailable { + return r.ApplicationproblemJSON503 +} + +// GetBody returns the raw response body bytes +func (r ListSecretsResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r ListSecretsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status } - return ParseListGpuTypePricesResponse(rsp) + return http.StatusText(0) } -// CreateGpuTypePriceWithBodyWithResponse Schedule a new price for a GPU type -// -// Schedules a new price to take effect at `effectiveFrom`. Restricted to the Runware platform organization. `effectiveFrom` must normally be more than 7 days in the future. Before a GPU type is admitted or used, a later price can be added inside that window to correct its initial price. This preserves the original row and records the correction as a superseding price. Retired types return `404`; other values inside the notice window return `422`. Returns `409` if the GPU type already has a price scheduled at that exact instant. -// -// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). -// -// Corresponds with POST /v1/gpu-types/{gpuTypeId}/prices (the `CreateGpuTypePrice` operationId). -func (c *ClientWithResponses) CreateGpuTypePriceWithBodyWithResponse(ctx context.Context, gpuTypeId GpuTypeId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateGpuTypePriceResponse, error) { - rsp, err := c.CreateGpuTypePriceWithBody(ctx, gpuTypeId, contentType, body, reqEditors...) - if err != nil { - return nil, err +// StatusCode returns HTTPResponse.StatusCode +func (r ListSecretsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode } - return ParseCreateGpuTypePriceResponse(rsp) + return 0 } -// CreateGpuTypePriceWithResponse Schedule a new price for a GPU type -// -// Schedules a new price to take effect at `effectiveFrom`. Restricted to the Runware platform organization. `effectiveFrom` must normally be more than 7 days in the future. Before a GPU type is admitted or used, a later price can be added inside that window to correct its initial price. This preserves the original row and records the correction as a superseding price. Retired types return `404`; other values inside the notice window return `422`. Returns `409` if the GPU type already has a price scheduled at that exact instant. -// +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r ListSecretsResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type CreateSecretResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON201 the response for an HTTP 201 `application/json` response + JSON201 *Secret + // ApplicationproblemJSON400 the response for an HTTP 400 `application/problem+json` response + ApplicationproblemJSON400 *BadRequest + // ApplicationproblemJSON401 the response for an HTTP 401 `application/problem+json` response + ApplicationproblemJSON401 *Unauthorized + // ApplicationproblemJSON403 the response for an HTTP 403 `application/problem+json` response + ApplicationproblemJSON403 *Forbidden + // ApplicationproblemJSON409 the response for an HTTP 409 `application/problem+json` response + ApplicationproblemJSON409 *Conflict + // ApplicationproblemJSON422 the response for an HTTP 422 `application/problem+json` response + ApplicationproblemJSON422 *ValidationError + // ApplicationproblemJSON503 the response for an HTTP 503 `application/problem+json` response + ApplicationproblemJSON503 *ServiceUnavailable +} + +// GetJSON201 returns the response for an HTTP 201 `application/json` response +func (r CreateSecretResponse) GetJSON201() *Secret { + return r.JSON201 +} + +// GetApplicationproblemJSON400 returns the response for an HTTP 400 `application/problem+json` response +func (r CreateSecretResponse) GetApplicationproblemJSON400() *BadRequest { + return r.ApplicationproblemJSON400 +} + +// GetApplicationproblemJSON401 returns the response for an HTTP 401 `application/problem+json` response +func (r CreateSecretResponse) GetApplicationproblemJSON401() *Unauthorized { + return r.ApplicationproblemJSON401 +} + +// GetApplicationproblemJSON403 returns the response for an HTTP 403 `application/problem+json` response +func (r CreateSecretResponse) GetApplicationproblemJSON403() *Forbidden { + return r.ApplicationproblemJSON403 +} + +// GetApplicationproblemJSON409 returns the response for an HTTP 409 `application/problem+json` response +func (r CreateSecretResponse) GetApplicationproblemJSON409() *Conflict { + return r.ApplicationproblemJSON409 +} + +// GetApplicationproblemJSON422 returns the response for an HTTP 422 `application/problem+json` response +func (r CreateSecretResponse) GetApplicationproblemJSON422() *ValidationError { + return r.ApplicationproblemJSON422 +} + +// GetApplicationproblemJSON503 returns the response for an HTTP 503 `application/problem+json` response +func (r CreateSecretResponse) GetApplicationproblemJSON503() *ServiceUnavailable { + return r.ApplicationproblemJSON503 +} + +// GetBody returns the raw response body bytes +func (r CreateSecretResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r CreateSecretResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r CreateSecretResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r CreateSecretResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type DeleteSecretResponse struct { + Body []byte + HTTPResponse *http.Response + // ApplicationproblemJSON401 the response for an HTTP 401 `application/problem+json` response + ApplicationproblemJSON401 *Unauthorized + // ApplicationproblemJSON403 the response for an HTTP 403 `application/problem+json` response + ApplicationproblemJSON403 *Forbidden + // ApplicationproblemJSON404 the response for an HTTP 404 `application/problem+json` response + ApplicationproblemJSON404 *NotFound + // ApplicationproblemJSON409 the response for an HTTP 409 `application/problem+json` response + ApplicationproblemJSON409 *Conflict + // ApplicationproblemJSON422 the response for an HTTP 422 `application/problem+json` response + ApplicationproblemJSON422 *ValidationError + // ApplicationproblemJSON503 the response for an HTTP 503 `application/problem+json` response + ApplicationproblemJSON503 *ServiceUnavailable +} + +// GetApplicationproblemJSON401 returns the response for an HTTP 401 `application/problem+json` response +func (r DeleteSecretResponse) GetApplicationproblemJSON401() *Unauthorized { + return r.ApplicationproblemJSON401 +} + +// GetApplicationproblemJSON403 returns the response for an HTTP 403 `application/problem+json` response +func (r DeleteSecretResponse) GetApplicationproblemJSON403() *Forbidden { + return r.ApplicationproblemJSON403 +} + +// GetApplicationproblemJSON404 returns the response for an HTTP 404 `application/problem+json` response +func (r DeleteSecretResponse) GetApplicationproblemJSON404() *NotFound { + return r.ApplicationproblemJSON404 +} + +// GetApplicationproblemJSON409 returns the response for an HTTP 409 `application/problem+json` response +func (r DeleteSecretResponse) GetApplicationproblemJSON409() *Conflict { + return r.ApplicationproblemJSON409 +} + +// GetApplicationproblemJSON422 returns the response for an HTTP 422 `application/problem+json` response +func (r DeleteSecretResponse) GetApplicationproblemJSON422() *ValidationError { + return r.ApplicationproblemJSON422 +} + +// GetApplicationproblemJSON503 returns the response for an HTTP 503 `application/problem+json` response +func (r DeleteSecretResponse) GetApplicationproblemJSON503() *ServiceUnavailable { + return r.ApplicationproblemJSON503 +} + +// GetBody returns the raw response body bytes +func (r DeleteSecretResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r DeleteSecretResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteSecretResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r DeleteSecretResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type UpdateSecretResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *Secret + // ApplicationproblemJSON400 the response for an HTTP 400 `application/problem+json` response + ApplicationproblemJSON400 *BadRequest + // ApplicationproblemJSON401 the response for an HTTP 401 `application/problem+json` response + ApplicationproblemJSON401 *Unauthorized + // ApplicationproblemJSON403 the response for an HTTP 403 `application/problem+json` response + ApplicationproblemJSON403 *Forbidden + // ApplicationproblemJSON404 the response for an HTTP 404 `application/problem+json` response + ApplicationproblemJSON404 *NotFound + // ApplicationproblemJSON422 the response for an HTTP 422 `application/problem+json` response + ApplicationproblemJSON422 *ValidationError + // ApplicationproblemJSON503 the response for an HTTP 503 `application/problem+json` response + ApplicationproblemJSON503 *ServiceUnavailable +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r UpdateSecretResponse) GetJSON200() *Secret { + return r.JSON200 +} + +// GetApplicationproblemJSON400 returns the response for an HTTP 400 `application/problem+json` response +func (r UpdateSecretResponse) GetApplicationproblemJSON400() *BadRequest { + return r.ApplicationproblemJSON400 +} + +// GetApplicationproblemJSON401 returns the response for an HTTP 401 `application/problem+json` response +func (r UpdateSecretResponse) GetApplicationproblemJSON401() *Unauthorized { + return r.ApplicationproblemJSON401 +} + +// GetApplicationproblemJSON403 returns the response for an HTTP 403 `application/problem+json` response +func (r UpdateSecretResponse) GetApplicationproblemJSON403() *Forbidden { + return r.ApplicationproblemJSON403 +} + +// GetApplicationproblemJSON404 returns the response for an HTTP 404 `application/problem+json` response +func (r UpdateSecretResponse) GetApplicationproblemJSON404() *NotFound { + return r.ApplicationproblemJSON404 +} + +// GetApplicationproblemJSON422 returns the response for an HTTP 422 `application/problem+json` response +func (r UpdateSecretResponse) GetApplicationproblemJSON422() *ValidationError { + return r.ApplicationproblemJSON422 +} + +// GetApplicationproblemJSON503 returns the response for an HTTP 503 `application/problem+json` response +func (r UpdateSecretResponse) GetApplicationproblemJSON503() *ServiceUnavailable { + return r.ApplicationproblemJSON503 +} + +// GetBody returns the raw response body bytes +func (r UpdateSecretResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r UpdateSecretResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r UpdateSecretResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r UpdateSecretResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type ListUsageEventsResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *struct { + Data *[]UsageEvent `json:"data,omitempty"` + + // NextCursor Cursor for the next page; null when there are no more items. + NextCursor *string `json:"nextCursor,omitempty"` + } + // ApplicationproblemJSON400 the response for an HTTP 400 `application/problem+json` response + ApplicationproblemJSON400 *BadRequest + // ApplicationproblemJSON401 the response for an HTTP 401 `application/problem+json` response + ApplicationproblemJSON401 *Unauthorized + // ApplicationproblemJSON403 the response for an HTTP 403 `application/problem+json` response + ApplicationproblemJSON403 *Forbidden + // ApplicationproblemJSON503 the response for an HTTP 503 `application/problem+json` response + ApplicationproblemJSON503 *ServiceUnavailable +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r ListUsageEventsResponse) GetJSON200() *struct { + Data *[]UsageEvent `json:"data,omitempty"` + + // NextCursor Cursor for the next page; null when there are no more items. + NextCursor *string `json:"nextCursor,omitempty"` +} { + return r.JSON200 +} + +// GetApplicationproblemJSON400 returns the response for an HTTP 400 `application/problem+json` response +func (r ListUsageEventsResponse) GetApplicationproblemJSON400() *BadRequest { + return r.ApplicationproblemJSON400 +} + +// GetApplicationproblemJSON401 returns the response for an HTTP 401 `application/problem+json` response +func (r ListUsageEventsResponse) GetApplicationproblemJSON401() *Unauthorized { + return r.ApplicationproblemJSON401 +} + +// GetApplicationproblemJSON403 returns the response for an HTTP 403 `application/problem+json` response +func (r ListUsageEventsResponse) GetApplicationproblemJSON403() *Forbidden { + return r.ApplicationproblemJSON403 +} + +// GetApplicationproblemJSON503 returns the response for an HTTP 503 `application/problem+json` response +func (r ListUsageEventsResponse) GetApplicationproblemJSON503() *ServiceUnavailable { + return r.ApplicationproblemJSON503 +} + +// GetBody returns the raw response body bytes +func (r ListUsageEventsResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r ListUsageEventsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ListUsageEventsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r ListUsageEventsResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +// GetAppSummaryWithResponse App summary metrics for the authenticated organisation +// +// Aggregate dashboard metrics across all apps owned by the authenticated organisation. App and worker tallies are always present. Request and error-rate totals come from the metrics store and are omitted when that hop cannot answer rather than reported as zero. Spend is omitted until billing rollups exist. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v1/app-summary (the `GetAppSummary` operationId). +func (c *ClientWithResponses) GetAppSummaryWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetAppSummaryResponse, error) { + rsp, err := c.GetAppSummary(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetAppSummaryResponse(rsp) +} + +// ListAppsWithResponse List apps +// +// Returns a page of the organisation's apps. Filters combine with AND; soft-deleted apps are excluded unless `status=deleted` is requested explicitly. Favourited apps appear before non-favourited apps, with the selected ordering applied within each group. +// +// A `cursor` is only valid for the `sort` and filters it was issued under — reusing one across a different ordering or filter set returns `400`. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v1/apps (the `ListApps` operationId). +func (c *ClientWithResponses) ListAppsWithResponse(ctx context.Context, params *ListAppsParams, reqEditors ...RequestEditorFn) (*ListAppsResponse, error) { + rsp, err := c.ListApps(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseListAppsResponse(rsp) +} + +// CreateAppWithBodyWithResponse Create an app +// +// Creates an app together with its worker configuration, environment variables and endpoints, and records version `1` — the immutable description of what to deploy. The app starts in `initializing`, and what happens next depends on the app source type: +// +// - `code` source: the codebase is submitted to the build pipeline; once the image is built +// and workers become healthy the app transitions to `active` and `activeVersionId` +// points at that version. If the build, validation, or rollout fails the app is +// marked `failed`. +// +// - `container` source: the submitted zip (wrapper `Dockerfile` + `container.yaml`) +// goes through the same build pipeline — the wrapper image is built, published and +// deployed, so the version carries a `buildId` and the app follows the same +// lifecycle as a code source. An invalid `container.yaml` rejects the create +// before any build capacity is spent — `400` where the document could not be +// parsed at all, `422` where it parsed and broke a rule. +// +// `activeVersionId` is null until a rollout completes: a version records what should run, and only a finished deploy says what does. +// +// `secrets` attaches organisation secrets that already exist. It is the app's initial attachment set, so the first rollout carries their values into the worker. This route does not create a secret — use `POST /v1/secrets` first. A name that is unknown to the organisation, or that is not `active`, returns `404`. A name that collides with a key in `environmentVariables`, a repeated name and a set that goes past the binding limit each return `422`. The whole set is checked before any build capacity is spent. +// +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /v1/apps (the `CreateApp` operationId). +func (c *ClientWithResponses) CreateAppWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateAppResponse, error) { + rsp, err := c.CreateAppWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateAppResponse(rsp) +} + +// CreateAppWithResponse Create an app +// +// Creates an app together with its worker configuration, environment variables and endpoints, and records version `1` — the immutable description of what to deploy. The app starts in `initializing`, and what happens next depends on the app source type: +// +// - `code` source: the codebase is submitted to the build pipeline; once the image is built +// and workers become healthy the app transitions to `active` and `activeVersionId` +// points at that version. If the build, validation, or rollout fails the app is +// marked `failed`. +// +// - `container` source: the submitted zip (wrapper `Dockerfile` + `container.yaml`) +// goes through the same build pipeline — the wrapper image is built, published and +// deployed, so the version carries a `buildId` and the app follows the same +// lifecycle as a code source. An invalid `container.yaml` rejects the create +// before any build capacity is spent — `400` where the document could not be +// parsed at all, `422` where it parsed and broke a rule. +// +// `activeVersionId` is null until a rollout completes: a version records what should run, and only a finished deploy says what does. +// +// `secrets` attaches organisation secrets that already exist. It is the app's initial attachment set, so the first rollout carries their values into the worker. This route does not create a secret — use `POST /v1/secrets` first. A name that is unknown to the organisation, or that is not `active`, returns `404`. A name that collides with a key in `environmentVariables`, a repeated name and a set that goes past the binding limit each return `422`. The whole set is checked before any build capacity is spent. +// +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /v1/apps (the `CreateApp` operationId). +func (c *ClientWithResponses) CreateAppWithResponse(ctx context.Context, body CreateAppJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateAppResponse, error) { + rsp, err := c.CreateApp(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateAppResponse(rsp) +} + +// DeleteAppWithResponse Delete an app +// +// Soft delete. Sets `status = deleting` and returns `202` once that intent is persisted. Router removal, cancelling in-progress builds, and worker drain (`draining → stopping → stopped`) are performed asynchronously by the deployer/Scaler; `status` becomes `deleted` once all workers stop. All rows are retained for billing finalisation, audit, and usage history. Idempotent if the app is already `deleting`. +// +// The `appId` is released once `status` reaches `deleted`, and not before: while the app is `deleting` its workload is still being torn down and the name stays taken. A new app created under a released name is a new app and inherits nothing — no version, no build, no event history, and no workers. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with DELETE /v1/apps/{appId} (the `DeleteApp` operationId). +func (c *ClientWithResponses) DeleteAppWithResponse(ctx context.Context, appId AppId, reqEditors ...RequestEditorFn) (*DeleteAppResponse, error) { + rsp, err := c.DeleteApp(ctx, appId, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteAppResponse(rsp) +} + +// GetAppWithResponse Get an app +// +// Returns the app the authenticated organisation owns under this `appId`. An unknown app and a soft-deleted one both return `404 Not Found`: a deleted app is gone to its owner, and its rows are retained only for billing and audit. To read deleted apps, list them with `status=deleted`. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v1/apps/{appId} (the `GetApp` operationId). +func (c *ClientWithResponses) GetAppWithResponse(ctx context.Context, appId AppId, reqEditors ...RequestEditorFn) (*GetAppResponse, error) { + rsp, err := c.GetApp(ctx, appId, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetAppResponse(rsp) +} + +// UpdateAppWithBodyWithResponse Update an app +// +// Patches one or more aspects of an app in place. All fields are optional; omitted fields are left unchanged. Valid in any non-`deleted` status, including `stopped` (changes apply on `resume`). Lifecycle transitions use the dedicated `deploy`, `stop`, `resume`, and `delete` operations. +// A configuration or `environmentVariables` change records a new version with the same image. If that image is deployable, the update pins it as `activeVersionId` and rolls the workload when the app is `active` or `initializing`. A `failed` app is moved to `initializing` and rolled, the same as `POST /deploy`. If the image is not deployable, the version is recorded and `activeVersionId` is left unchanged. If the roll fails, `activeVersionId` is restored and the previous configuration keeps serving. A name-only change records a version and does not pin. A `stopped` or `stopping` app pins the version and rolls it on `resume`. A configuration, `environmentVariables`, or `appSource` change while a create or resume rollout is already in progress returns `409 Conflict`. A name-only or `secrets`-only change does not. +// `appSource` starts a build and records version N+1 with a new image tag. The deploy queue carries the build-then-deploy tail; `activeVersionId` moves only when that rollout completes. A builder rejection (400 where a container document's parser refused it, 422 where it parsed and broke a rule) leaves the app on its current version and writes no version row and no build row. After the builder accepts, version N+1 is recorded even if a concurrent secret deactivation or env/secret collision prevents this request's env/secrets overlay; in that case the previous environmentVariables and attachment set stay in place and are what the new version snapshots. +// `environmentVariables` replaces the whole set: a key absent from the map is deleted, and a null value omits that key from the new set. The resolved map is snapshotted onto the new version. +// `secrets` replaces the whole attachment set. An attachment absent from the array is detached. Injected names must not collide with a plain environment variable on the app; the combined set of plain variables and attachments is capped at 100. This is a control-plane record only — secret values do not reach a pod, and the version snapshot carries no secrets — so a secrets-only change does not roll the workload. +// Endpoints are not a field of this contract: the set belongs to the app source, so it changes only when a new version with a new source builds and deploys. +// +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with PATCH /v1/apps/{appId} (the `UpdateApp` operationId). +func (c *ClientWithResponses) UpdateAppWithBodyWithResponse(ctx context.Context, appId AppId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateAppResponse, error) { + rsp, err := c.UpdateAppWithBody(ctx, appId, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateAppResponse(rsp) +} + +// UpdateAppWithResponse Update an app +// +// Patches one or more aspects of an app in place. All fields are optional; omitted fields are left unchanged. Valid in any non-`deleted` status, including `stopped` (changes apply on `resume`). Lifecycle transitions use the dedicated `deploy`, `stop`, `resume`, and `delete` operations. +// A configuration or `environmentVariables` change records a new version with the same image. If that image is deployable, the update pins it as `activeVersionId` and rolls the workload when the app is `active` or `initializing`. A `failed` app is moved to `initializing` and rolled, the same as `POST /deploy`. If the image is not deployable, the version is recorded and `activeVersionId` is left unchanged. If the roll fails, `activeVersionId` is restored and the previous configuration keeps serving. A name-only change records a version and does not pin. A `stopped` or `stopping` app pins the version and rolls it on `resume`. A configuration, `environmentVariables`, or `appSource` change while a create or resume rollout is already in progress returns `409 Conflict`. A name-only or `secrets`-only change does not. +// `appSource` starts a build and records version N+1 with a new image tag. The deploy queue carries the build-then-deploy tail; `activeVersionId` moves only when that rollout completes. A builder rejection (400 where a container document's parser refused it, 422 where it parsed and broke a rule) leaves the app on its current version and writes no version row and no build row. After the builder accepts, version N+1 is recorded even if a concurrent secret deactivation or env/secret collision prevents this request's env/secrets overlay; in that case the previous environmentVariables and attachment set stay in place and are what the new version snapshots. +// `environmentVariables` replaces the whole set: a key absent from the map is deleted, and a null value omits that key from the new set. The resolved map is snapshotted onto the new version. +// `secrets` replaces the whole attachment set. An attachment absent from the array is detached. Injected names must not collide with a plain environment variable on the app; the combined set of plain variables and attachments is capped at 100. This is a control-plane record only — secret values do not reach a pod, and the version snapshot carries no secrets — so a secrets-only change does not roll the workload. +// Endpoints are not a field of this contract: the set belongs to the app source, so it changes only when a new version with a new source builds and deploys. +// +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with PATCH /v1/apps/{appId} (the `UpdateApp` operationId). +func (c *ClientWithResponses) UpdateAppWithResponse(ctx context.Context, appId AppId, body UpdateAppJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateAppResponse, error) { + rsp, err := c.UpdateApp(ctx, appId, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateAppResponse(rsp) +} + +// ListBuildsWithResponse List builds +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v1/apps/{appId}/builds (the `ListBuilds` operationId). +func (c *ClientWithResponses) ListBuildsWithResponse(ctx context.Context, appId AppId, params *ListBuildsParams, reqEditors ...RequestEditorFn) (*ListBuildsResponse, error) { + rsp, err := c.ListBuilds(ctx, appId, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseListBuildsResponse(rsp) +} + +// DeleteBuildWithResponse Delete or cancel a build +// +// Cancels a queued or running build and records it as `superseded`. Deleting a queued or running build ends its current rollout without activating the cancelled build, so any previous version keeps serving. A terminal build can be deleted once no live rollout still needs it. Ready builds remain while a version references them. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with DELETE /v1/apps/{appId}/builds/{buildId} (the `DeleteBuild` operationId). +func (c *ClientWithResponses) DeleteBuildWithResponse(ctx context.Context, appId AppId, buildId openapi_types.UUID, reqEditors ...RequestEditorFn) (*DeleteBuildResponse, error) { + rsp, err := c.DeleteBuild(ctx, appId, buildId, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteBuildResponse(rsp) +} + +// GetBuildWithResponse Get a build +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v1/apps/{appId}/builds/{buildId} (the `GetBuild` operationId). +func (c *ClientWithResponses) GetBuildWithResponse(ctx context.Context, appId AppId, buildId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetBuildResponse, error) { + rsp, err := c.GetBuild(ctx, appId, buildId, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetBuildResponse(rsp) +} + +// DeployVersionWithBodyWithResponse Deploy a version +// +// Activates a `ready` version by number, setting `activeVersionId` and returning `202` once that intent is persisted. Worker rollout, routing switch, and cancelling in-progress builds (`superseded`) are performed asynchronously by the deployer/Scaler. Permitted in any addressable status, including `initializing` and `failed`. +// To roll back, supply an older `versionNumber` — the operation is identical to a forward deploy. No new version is created and no rebuild happens: the version's existing image is re-applied. Re-deploying the currently active version is permitted and re-applies it. +// A deploy to a `stopped` or `stopping` app records the version and rolls no workload, because no workers are running: the `202` does not imply a rollout there. The recorded version is the one applied when the app resumes. +// If the roll of a live app fails, `activeVersionId` is restored to the version that kept serving, so the field keeps naming the running image. +// **Rollout** (deployer/Scaler): the platform starts workers on the target version, waits for at least one to become healthy, switches task routing to the new version, then drains old-version workers gracefully. Old workers are given a fixed, platform-managed grace period to finish in-flight tasks before being force-terminated. If new workers fail to become healthy, old workers are not drained and the app continues on the previous version. +// Errors: - Deploy to a `deleting` app returns `409 Conflict` - `versionNumber` not found or not `ready` returns `409 Conflict` - Deploy to a non-existent or `deleted` app returns `404 Not Found` +// +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /v1/apps/{appId}/deploy (the `DeployVersion` operationId). +func (c *ClientWithResponses) DeployVersionWithBodyWithResponse(ctx context.Context, appId AppId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DeployVersionResponse, error) { + rsp, err := c.DeployVersionWithBody(ctx, appId, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeployVersionResponse(rsp) +} + +// DeployVersionWithResponse Deploy a version +// +// Activates a `ready` version by number, setting `activeVersionId` and returning `202` once that intent is persisted. Worker rollout, routing switch, and cancelling in-progress builds (`superseded`) are performed asynchronously by the deployer/Scaler. Permitted in any addressable status, including `initializing` and `failed`. +// To roll back, supply an older `versionNumber` — the operation is identical to a forward deploy. No new version is created and no rebuild happens: the version's existing image is re-applied. Re-deploying the currently active version is permitted and re-applies it. +// A deploy to a `stopped` or `stopping` app records the version and rolls no workload, because no workers are running: the `202` does not imply a rollout there. The recorded version is the one applied when the app resumes. +// If the roll of a live app fails, `activeVersionId` is restored to the version that kept serving, so the field keeps naming the running image. +// **Rollout** (deployer/Scaler): the platform starts workers on the target version, waits for at least one to become healthy, switches task routing to the new version, then drains old-version workers gracefully. Old workers are given a fixed, platform-managed grace period to finish in-flight tasks before being force-terminated. If new workers fail to become healthy, old workers are not drained and the app continues on the previous version. +// Errors: - Deploy to a `deleting` app returns `409 Conflict` - `versionNumber` not found or not `ready` returns `409 Conflict` - Deploy to a non-existent or `deleted` app returns `404 Not Found` +// +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /v1/apps/{appId}/deploy (the `DeployVersion` operationId). +func (c *ClientWithResponses) DeployVersionWithResponse(ctx context.Context, appId AppId, body DeployVersionJSONRequestBody, reqEditors ...RequestEditorFn) (*DeployVersionResponse, error) { + rsp, err := c.DeployVersion(ctx, appId, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeployVersionResponse(rsp) +} + +// ListEndpointsWithResponse List endpoints +// +// Lists the endpoints of the app's active version. The set is written by the source itself — a code build's introspection, or a container's config document — and is replaced atomically whenever a version activates, so a deploy of a newer version or a rollback to an older one is immediately reflected here. Empty while the app is `initializing`: nothing is routable until its first build is ready and deployed. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v1/apps/{appId}/endpoints (the `ListEndpoints` operationId). +func (c *ClientWithResponses) ListEndpointsWithResponse(ctx context.Context, appId AppId, params *ListEndpointsParams, reqEditors ...RequestEditorFn) (*ListEndpointsResponse, error) { + rsp, err := c.ListEndpoints(ctx, appId, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseListEndpointsResponse(rsp) +} + +// GetEndpointWithResponse Get an endpoint +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v1/apps/{appId}/endpoints/{endpointId} (the `GetEndpoint` operationId). +func (c *ClientWithResponses) GetEndpointWithResponse(ctx context.Context, appId AppId, endpointId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetEndpointResponse, error) { + rsp, err := c.GetEndpoint(ctx, appId, endpointId, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetEndpointResponse(rsp) +} + +// ListAppEnvironmentVariablesWithResponse List app environment variables +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v1/apps/{appId}/environment-variables (the `ListAppEnvironmentVariables` operationId). +func (c *ClientWithResponses) ListAppEnvironmentVariablesWithResponse(ctx context.Context, appId AppId, params *ListAppEnvironmentVariablesParams, reqEditors ...RequestEditorFn) (*ListAppEnvironmentVariablesResponse, error) { + rsp, err := c.ListAppEnvironmentVariables(ctx, appId, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseListAppEnvironmentVariablesResponse(rsp) +} + +// DeleteAppEnvironmentVariableWithResponse Delete an app environment variable +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with DELETE /v1/apps/{appId}/environment-variables/{variableName} (the `DeleteAppEnvironmentVariable` operationId). +func (c *ClientWithResponses) DeleteAppEnvironmentVariableWithResponse(ctx context.Context, appId AppId, variableName EnvironmentVariableName, reqEditors ...RequestEditorFn) (*DeleteAppEnvironmentVariableResponse, error) { + rsp, err := c.DeleteAppEnvironmentVariable(ctx, appId, variableName, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteAppEnvironmentVariableResponse(rsp) +} + +// UpdateAppEnvironmentVariableWithBodyWithResponse Update an app environment variable +// +// Sets one environment variable, creating it if absent. Names the platform sets on the serving container itself are rejected with `422`, as they are on create. +// +// An app holds at most 100 environment bindings in total — plain variables plus attached secrets — the same combined ceiling `AppCreate.environmentVariables` declares (create rejects secrets in-request; attach grows the set later). Overwriting an existing variable is always allowed; adding one past the ceiling returns `422`. +// +// The name must not collide with a secret already attached to this app (the secret's injected env var name). Secrets and plain env vars share the pod environment; a duplicate would be resolved last-wins by kubelet with no error, so the server rejects it with `422`. The reverse check applies on attach. +// +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with PUT /v1/apps/{appId}/environment-variables/{variableName} (the `UpdateAppEnvironmentVariable` operationId). +func (c *ClientWithResponses) UpdateAppEnvironmentVariableWithBodyWithResponse(ctx context.Context, appId AppId, variableName EnvironmentVariableName, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateAppEnvironmentVariableResponse, error) { + rsp, err := c.UpdateAppEnvironmentVariableWithBody(ctx, appId, variableName, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateAppEnvironmentVariableResponse(rsp) +} + +// UpdateAppEnvironmentVariableWithResponse Update an app environment variable +// +// Sets one environment variable, creating it if absent. Names the platform sets on the serving container itself are rejected with `422`, as they are on create. +// +// An app holds at most 100 environment bindings in total — plain variables plus attached secrets — the same combined ceiling `AppCreate.environmentVariables` declares (create rejects secrets in-request; attach grows the set later). Overwriting an existing variable is always allowed; adding one past the ceiling returns `422`. +// +// The name must not collide with a secret already attached to this app (the secret's injected env var name). Secrets and plain env vars share the pod environment; a duplicate would be resolved last-wins by kubelet with no error, so the server rejects it with `422`. The reverse check applies on attach. +// +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with PUT /v1/apps/{appId}/environment-variables/{variableName} (the `UpdateAppEnvironmentVariable` operationId). +func (c *ClientWithResponses) UpdateAppEnvironmentVariableWithResponse(ctx context.Context, appId AppId, variableName EnvironmentVariableName, body UpdateAppEnvironmentVariableJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateAppEnvironmentVariableResponse, error) { + rsp, err := c.UpdateAppEnvironmentVariable(ctx, appId, variableName, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateAppEnvironmentVariableResponse(rsp) +} + +// ListAppEventsWithResponse List app events +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v1/apps/{appId}/events (the `ListAppEvents` operationId). +func (c *ClientWithResponses) ListAppEventsWithResponse(ctx context.Context, appId AppId, params *ListAppEventsParams, reqEditors ...RequestEditorFn) (*ListAppEventsResponse, error) { + rsp, err := c.ListAppEvents(ctx, appId, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseListAppEventsResponse(rsp) +} + +// UnfavouriteAppWithResponse Unfavourite an app +// +// Removes the organisation favourite pin from the app. Idempotent: unfavouriting an app that is not favourited succeeds and returns the app with `isFavourite: false`. Valid in any status including `deleting` and `deleted` — unpinning is not an app lifecycle mutation. Missing apps return `404`. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with DELETE /v1/apps/{appId}/favourite (the `UnfavouriteApp` operationId). +func (c *ClientWithResponses) UnfavouriteAppWithResponse(ctx context.Context, appId AppId, reqEditors ...RequestEditorFn) (*UnfavouriteAppResponse, error) { + rsp, err := c.UnfavouriteApp(ctx, appId, reqEditors...) + if err != nil { + return nil, err + } + return ParseUnfavouriteAppResponse(rsp) +} + +// FavouriteAppWithResponse Favourite an app +// +// Pins the app as a favourite for the authenticated organisation so the console can surface it in a Favourites section. Idempotent: favouriting an already-favourited app succeeds and returns the app with `isFavourite: true`. Apps in `deleting` or `deleted` status cannot be favourited (`404`). Soft-delete clears any existing pin when status becomes `deleting`. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with PUT /v1/apps/{appId}/favourite (the `FavouriteApp` operationId). +func (c *ClientWithResponses) FavouriteAppWithResponse(ctx context.Context, appId AppId, reqEditors ...RequestEditorFn) (*FavouriteAppResponse, error) { + rsp, err := c.FavouriteApp(ctx, appId, reqEditors...) + if err != nil { + return nil, err + } + return ParseFavouriteAppResponse(rsp) +} + +// StartAsyncTaskWithBodyWithResponse Start a new async task +// +// Starts a new async task on `appId`, routing the request body payload to an available worker. The task runs asynchronously and the response is `202`; poll `GET /v1/apps/{appId}/tasks/{taskId}` for completion. Resubmitting a task id is answered with the task it already names rather than starting a second one, so the `202` can carry a task that has already finished: read its `status` instead of assuming `pending`, and note it may name a different `appId`. Apps in `initializing`, `active`, or `stopping` accept invocation. `stopped`, `deleting`, and `failed` return `409 Conflict`; unknown or deleted apps return `404 Not Found`. Endpoint membership is checked against the active version's endpoint set before the task is accepted: an endpoint the app does not declare returns `404` whose `endpointPath` extension member carries the rejected path, distinguishing it from an unknown app, and the task never enters the queue. +// +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /v1/apps/{appId}/invoke-async/{endpointPath} (the `StartAsyncTask` operationId). +func (c *ClientWithResponses) StartAsyncTaskWithBodyWithResponse(ctx context.Context, appId AppId, endpointPath EndpointPath, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*StartAsyncTaskResponse, error) { + rsp, err := c.StartAsyncTaskWithBody(ctx, appId, endpointPath, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseStartAsyncTaskResponse(rsp) +} + +// StartAsyncTaskWithResponse Start a new async task +// +// Starts a new async task on `appId`, routing the request body payload to an available worker. The task runs asynchronously and the response is `202`; poll `GET /v1/apps/{appId}/tasks/{taskId}` for completion. Resubmitting a task id is answered with the task it already names rather than starting a second one, so the `202` can carry a task that has already finished: read its `status` instead of assuming `pending`, and note it may name a different `appId`. Apps in `initializing`, `active`, or `stopping` accept invocation. `stopped`, `deleting`, and `failed` return `409 Conflict`; unknown or deleted apps return `404 Not Found`. Endpoint membership is checked against the active version's endpoint set before the task is accepted: an endpoint the app does not declare returns `404` whose `endpointPath` extension member carries the rejected path, distinguishing it from an unknown app, and the task never enters the queue. +// +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /v1/apps/{appId}/invoke-async/{endpointPath} (the `StartAsyncTask` operationId). +func (c *ClientWithResponses) StartAsyncTaskWithResponse(ctx context.Context, appId AppId, endpointPath EndpointPath, body StartAsyncTaskJSONRequestBody, reqEditors ...RequestEditorFn) (*StartAsyncTaskResponse, error) { + rsp, err := c.StartAsyncTask(ctx, appId, endpointPath, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseStartAsyncTaskResponse(rsp) +} + +// StartSyncTaskWithBodyWithResponse Start a new sync task +// +// Starts a new sync task on `appId`, routing the request body payload to an available worker. The request blocks until the task is terminal and returns the result inline (`200`). Resubmitting a task id waits on the task it already names rather than starting a second one, so the `200` carries that task's result and may name a different `appId` — poll it under the one returned. A task that outlives the wait window is **not** a failure: the task is still queued or running, and the response is `202` carrying that task with `status: pending` — the same shape `invoke-async` returns, and it names the owning `appId` on a resubmission just as the `200` does. Poll `GET /v1/apps/{appId}/tasks/{taskId}` for its result. A request the platform cannot attribute to an accepted task fails instead, with no task to poll. Apps in `initializing`, `active`, or `stopping` accept invocation. `stopped`, `deleting`, and `failed` return `409 Conflict`; unknown or deleted apps return `404 Not Found`. Endpoint membership is checked against the active version's endpoint set before the task is accepted: an endpoint the app does not declare returns `404` whose `endpointPath` extension member carries the rejected path, distinguishing it from an unknown app, and the task never enters the queue. +// +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /v1/apps/{appId}/invoke-sync/{endpointPath} (the `StartSyncTask` operationId). +func (c *ClientWithResponses) StartSyncTaskWithBodyWithResponse(ctx context.Context, appId AppId, endpointPath EndpointPath, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*StartSyncTaskResponse, error) { + rsp, err := c.StartSyncTaskWithBody(ctx, appId, endpointPath, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseStartSyncTaskResponse(rsp) +} + +// StartSyncTaskWithResponse Start a new sync task +// +// Starts a new sync task on `appId`, routing the request body payload to an available worker. The request blocks until the task is terminal and returns the result inline (`200`). Resubmitting a task id waits on the task it already names rather than starting a second one, so the `200` carries that task's result and may name a different `appId` — poll it under the one returned. A task that outlives the wait window is **not** a failure: the task is still queued or running, and the response is `202` carrying that task with `status: pending` — the same shape `invoke-async` returns, and it names the owning `appId` on a resubmission just as the `200` does. Poll `GET /v1/apps/{appId}/tasks/{taskId}` for its result. A request the platform cannot attribute to an accepted task fails instead, with no task to poll. Apps in `initializing`, `active`, or `stopping` accept invocation. `stopped`, `deleting`, and `failed` return `409 Conflict`; unknown or deleted apps return `404 Not Found`. Endpoint membership is checked against the active version's endpoint set before the task is accepted: an endpoint the app does not declare returns `404` whose `endpointPath` extension member carries the rejected path, distinguishing it from an unknown app, and the task never enters the queue. +// +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /v1/apps/{appId}/invoke-sync/{endpointPath} (the `StartSyncTask` operationId). +func (c *ClientWithResponses) StartSyncTaskWithResponse(ctx context.Context, appId AppId, endpointPath EndpointPath, body StartSyncTaskJSONRequestBody, reqEditors ...RequestEditorFn) (*StartSyncTaskResponse, error) { + rsp, err := c.StartSyncTask(ctx, appId, endpointPath, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseStartSyncTaskResponse(rsp) +} + +// ResumeAppWithResponse Resume an app +// +// Moves the app to `initializing` and returns `202` once that intent is persisted. The Scaler then starts workers and sets the app to `active`; tasks that remained queued when the app stopped are consumed as workers come online. Precondition: `status = stopped`. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /v1/apps/{appId}/resume (the `ResumeApp` operationId). +func (c *ClientWithResponses) ResumeAppWithResponse(ctx context.Context, appId AppId, reqEditors ...RequestEditorFn) (*ResumeAppResponse, error) { + rsp, err := c.ResumeApp(ctx, appId, reqEditors...) + if err != nil { + return nil, err + } + return ParseResumeAppResponse(rsp) +} + +// ListAppSecretsWithResponse List secrets attached to an app +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v1/apps/{appId}/secrets (the `ListAppSecrets` operationId). +func (c *ClientWithResponses) ListAppSecretsWithResponse(ctx context.Context, appId AppId, params *ListAppSecretsParams, reqEditors ...RequestEditorFn) (*ListAppSecretsResponse, error) { + rsp, err := c.ListAppSecrets(ctx, appId, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseListAppSecretsResponse(rsp) +} + +// AttachAppSecretWithBodyWithResponse Attach a secret to an app +// +// Records that an organisation secret is attached to an app under a resolved env-var name. The next rollout injects the value into the worker. This operation does not roll workers. Returns `409` if the secret is already attached, or if another attach would use the same env-var name. +// The resolved name (`envVarName`, or `secretName` when omitted) must not already exist as a plain environment variable on this app (`deployment_configs.key`). Both sources use the same pod env namespace, so the server rejects the collision with `422` instead of allowing a last-wins override later. The reverse check applies when setting a plain environment variable. +// An app holds at most 100 environment bindings in total — plain environment variables plus attached secrets — the same combined ceiling as create and the single-key env-var route. Attaching when the app is already at that limit returns `422`. +// +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /v1/apps/{appId}/secrets (the `AttachAppSecret` operationId). +func (c *ClientWithResponses) AttachAppSecretWithBodyWithResponse(ctx context.Context, appId AppId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AttachAppSecretResponse, error) { + rsp, err := c.AttachAppSecretWithBody(ctx, appId, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseAttachAppSecretResponse(rsp) +} + +// AttachAppSecretWithResponse Attach a secret to an app +// +// Records that an organisation secret is attached to an app under a resolved env-var name. The next rollout injects the value into the worker. This operation does not roll workers. Returns `409` if the secret is already attached, or if another attach would use the same env-var name. +// The resolved name (`envVarName`, or `secretName` when omitted) must not already exist as a plain environment variable on this app (`deployment_configs.key`). Both sources use the same pod env namespace, so the server rejects the collision with `422` instead of allowing a last-wins override later. The reverse check applies when setting a plain environment variable. +// An app holds at most 100 environment bindings in total — plain environment variables plus attached secrets — the same combined ceiling as create and the single-key env-var route. Attaching when the app is already at that limit returns `422`. +// +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /v1/apps/{appId}/secrets (the `AttachAppSecret` operationId). +func (c *ClientWithResponses) AttachAppSecretWithResponse(ctx context.Context, appId AppId, body AttachAppSecretJSONRequestBody, reqEditors ...RequestEditorFn) (*AttachAppSecretResponse, error) { + rsp, err := c.AttachAppSecret(ctx, appId, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseAttachAppSecretResponse(rsp) +} + +// DetachAppSecretWithResponse Detach a secret from an app +// +// Removes the attachment from the next rollout. This operation does not roll workers. Existing workers keep the value until they stop. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with DELETE /v1/apps/{appId}/secrets/{secretName} (the `DetachAppSecret` operationId). +func (c *ClientWithResponses) DetachAppSecretWithResponse(ctx context.Context, appId AppId, secretName SecretName, reqEditors ...RequestEditorFn) (*DetachAppSecretResponse, error) { + rsp, err := c.DetachAppSecret(ctx, appId, secretName, reqEditors...) + if err != nil { + return nil, err + } + return ParseDetachAppSecretResponse(rsp) +} + +// CreateSourceUploadWithBodyWithResponse Create a source upload +// +// Creates an upload session for source intended for `appId`. The app does not need to exist yet. The response contains a short-lived transfer instruction for one exact staging object. Repeating the request with the same idempotency key and declaration while the session is pending and unexpired returns the same upload resource with a refreshed transfer instruction. Replays with a different declaration or after the session becomes ready, rejected, consumed, expired, or deleted return `409`. +// +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /v1/apps/{appId}/source-uploads (the `CreateSourceUpload` operationId). +func (c *ClientWithResponses) CreateSourceUploadWithBodyWithResponse(ctx context.Context, appId AppId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateSourceUploadResponse, error) { + rsp, err := c.CreateSourceUploadWithBody(ctx, appId, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateSourceUploadResponse(rsp) +} + +// CreateSourceUploadWithResponse Create a source upload +// +// Creates an upload session for source intended for `appId`. The app does not need to exist yet. The response contains a short-lived transfer instruction for one exact staging object. Repeating the request with the same idempotency key and declaration while the session is pending and unexpired returns the same upload resource with a refreshed transfer instruction. Replays with a different declaration or after the session becomes ready, rejected, consumed, expired, or deleted return `409`. +// +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /v1/apps/{appId}/source-uploads (the `CreateSourceUpload` operationId). +func (c *ClientWithResponses) CreateSourceUploadWithResponse(ctx context.Context, appId AppId, body CreateSourceUploadJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateSourceUploadResponse, error) { + rsp, err := c.CreateSourceUpload(ctx, appId, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateSourceUploadResponse(rsp) +} + +// DeleteSourceUploadWithResponse Abort a source upload +// +// Aborts an unconsumed upload and removes its staging object. The session remains as a deleted tombstone so its object key cannot be reused. Repeating a successful abort is idempotent. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with DELETE /v1/apps/{appId}/source-uploads/{uploadId} (the `DeleteSourceUpload` operationId). +func (c *ClientWithResponses) DeleteSourceUploadWithResponse(ctx context.Context, appId AppId, uploadId SourceUploadId, reqEditors ...RequestEditorFn) (*DeleteSourceUploadResponse, error) { + rsp, err := c.DeleteSourceUpload(ctx, appId, uploadId, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteSourceUploadResponse(rsp) +} + +// GetSourceUploadWithResponse Get a source upload +// +// Returns the upload session belonging to the authenticated organization and `appId`. An upload belonging to another organization or app returns `404`. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v1/apps/{appId}/source-uploads/{uploadId} (the `GetSourceUpload` operationId). +func (c *ClientWithResponses) GetSourceUploadWithResponse(ctx context.Context, appId AppId, uploadId SourceUploadId, reqEditors ...RequestEditorFn) (*GetSourceUploadResponse, error) { + rsp, err := c.GetSourceUpload(ctx, appId, uploadId, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetSourceUploadResponse(rsp) +} + +// CompleteSourceUploadWithResponse Complete a source upload +// +// Verifies the staging object's length, content type, and SHA-256 digest against the session declaration. A successful retry returns the existing ready resource. A rejected upload keeps its rejection so later retries return the same result. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /v1/apps/{appId}/source-uploads/{uploadId}/complete (the `CompleteSourceUpload` operationId). +func (c *ClientWithResponses) CompleteSourceUploadWithResponse(ctx context.Context, appId AppId, uploadId SourceUploadId, reqEditors ...RequestEditorFn) (*CompleteSourceUploadResponse, error) { + rsp, err := c.CompleteSourceUpload(ctx, appId, uploadId, reqEditors...) + if err != nil { + return nil, err + } + return ParseCompleteSourceUploadResponse(rsp) +} + +// StopAppWithResponse Stop an app +// +// Moves the app to `stopping` and returns `202` once that intent is persisted. Scale-to-zero and worker drain are performed asynchronously by the Scaler; `status` becomes `stopped` once all workers drain. In-flight tasks have a fixed, platform-managed grace period to complete; workers that exceed it are force-terminated and their tasks return to the queue per delivery guarantees. New task submissions remain accepted while `stopping`; after the app reaches `stopped`, submissions return `409 Conflict`. Precondition: `status = active`. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /v1/apps/{appId}/stop (the `StopApp` operationId). +func (c *ClientWithResponses) StopAppWithResponse(ctx context.Context, appId AppId, reqEditors ...RequestEditorFn) (*StopAppResponse, error) { + rsp, err := c.StopApp(ctx, appId, reqEditors...) + if err != nil { + return nil, err + } + return ParseStopAppResponse(rsp) +} + +// ListTasksWithResponse List tasks for an app +// +// Lists TTL-bounded asynchronous task metadata for this app so a client can recover task ids after an interrupted long-poll or CLI session. Pending includes queued, running and retrying work. Tasks appear only within the configured recovery window. A page can be empty and still have `nextCursor`; continue until it is null. Pending entries are best effort and may disappear if the recovery store restarts; tracked tasks reappear on completion. This is not persisted task history. A task id names one task, so resubmitting one does not add a second entry here. If the app is `stopped`, `deleting`, or `failed`, recovery stays available. Unknown or deleted apps return `404 Not Found`. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v1/apps/{appId}/tasks (the `ListTasks` operationId). +func (c *ClientWithResponses) ListTasksWithResponse(ctx context.Context, appId AppId, params *ListTasksParams, reqEditors ...RequestEditorFn) (*ListTasksResponse, error) { + rsp, err := c.ListTasks(ctx, appId, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseListTasksResponse(rsp) +} + +// GetTaskWithResponse Get a task +// +// Returns the task's current status, read through the inference transport layer from the shared result store. When `completed`, includes the result `output` and `completedAt`; when `failed`, includes `error`; when `pending`, neither is set. If the app is `stopped`, `deleting`, or `failed`, accepted task results stay readable. A `404 Not Found` means the task cannot currently be verified for this app. Because enqueue-time ownership tracking is best effort, a recently returned task ID can temporarily return `404`; retry it within the normal polling window. Unknown or deleted apps also return `404 Not Found`. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v1/apps/{appId}/tasks/{taskId} (the `GetTask` operationId). +func (c *ClientWithResponses) GetTaskWithResponse(ctx context.Context, appId AppId, taskId TaskId, reqEditors ...RequestEditorFn) (*GetTaskResponse, error) { + rsp, err := c.GetTask(ctx, appId, taskId, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetTaskResponse(rsp) +} + +// ListVersionsWithResponse List versions +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v1/apps/{appId}/versions (the `ListVersions` operationId). +func (c *ClientWithResponses) ListVersionsWithResponse(ctx context.Context, appId AppId, params *ListVersionsParams, reqEditors ...RequestEditorFn) (*ListVersionsResponse, error) { + rsp, err := c.ListVersions(ctx, appId, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseListVersionsResponse(rsp) +} + +// DeleteVersionWithResponse Delete a version +// +// Deletes an unused version while retaining its immutable history. Deleted versions are omitted from version lists, return `404` from version reads, and cannot be deployed. Returns `409` while the app is deleting, or when the version is active, is the app's only remaining version, has a non-stopped worker, or is targeted by a live rollout. Deleting an already deleted version returns `404`. This operation does not remove the version's OCI image. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with DELETE /v1/apps/{appId}/versions/{versionNumber} (the `DeleteVersion` operationId). +func (c *ClientWithResponses) DeleteVersionWithResponse(ctx context.Context, appId AppId, versionNumber int32, reqEditors ...RequestEditorFn) (*DeleteVersionResponse, error) { + rsp, err := c.DeleteVersion(ctx, appId, versionNumber, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteVersionResponse(rsp) +} + +// GetVersionWithResponse Get a version +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v1/apps/{appId}/versions/{versionNumber} (the `GetVersion` operationId). +func (c *ClientWithResponses) GetVersionWithResponse(ctx context.Context, appId AppId, versionNumber int32, reqEditors ...RequestEditorFn) (*GetVersionResponse, error) { + rsp, err := c.GetVersion(ctx, appId, versionNumber, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetVersionResponse(rsp) +} + +// ListWorkersWithResponse List workers +// +// Returns a newest-first page of workers observed for the app (including terminal `stopped` rows until purged). Optional `state` and `status` narrow the page; a cursor must be replayed under the same filters it was issued with. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v1/apps/{appId}/workers (the `ListWorkers` operationId). +func (c *ClientWithResponses) ListWorkersWithResponse(ctx context.Context, appId AppId, params *ListWorkersParams, reqEditors ...RequestEditorFn) (*ListWorkersResponse, error) { + rsp, err := c.ListWorkers(ctx, appId, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseListWorkersResponse(rsp) +} + +// GetWorkerWithResponse Get a worker +// +// Returns one worker by id within the app. The id is the Kubernetes pod UID recorded by the reconciler. A worker that belongs to another app (or tenant) is not found. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v1/apps/{appId}/workers/{workerId} (the `GetWorker` operationId). +func (c *ClientWithResponses) GetWorkerWithResponse(ctx context.Context, appId AppId, workerId WorkerId, reqEditors ...RequestEditorFn) (*GetWorkerResponse, error) { + rsp, err := c.GetWorker(ctx, appId, workerId, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetWorkerResponse(rsp) +} + +// ListGpuTypesWithResponse List supported GPU types and their pricing +// +// Returns the global GPU type catalogue and pricing. The request requires authentication. Customer principals receive only GPU types with capacity currently offered to customers; a type whose hardware is not yet cleared for customer workloads is omitted. The Runware principal receives the full catalogue, including retired types and types not yet offered. Retired entries carry `deletedAt`. Each entry's `pricing` is the price currently in effect; the Runware principal can read the full price history, including scheduled future changes, from `GET /v1/gpu-types/{gpuTypeId}/prices`. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v1/gpu-types (the `ListGpuTypes` operationId). +func (c *ClientWithResponses) ListGpuTypesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListGpuTypesResponse, error) { + rsp, err := c.ListGpuTypes(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParseListGpuTypesResponse(rsp) +} + +// CreateGpuTypeWithBodyWithResponse Add a GPU type to the catalogue +// +// Creates a new entry in the global GPU type catalogue. Restricted to the Runware platform organization. The `id` (catalogue code) is immutable and remains reserved after retirement. +// +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /v1/gpu-types (the `CreateGpuType` operationId). +func (c *ClientWithResponses) CreateGpuTypeWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateGpuTypeResponse, error) { + rsp, err := c.CreateGpuTypeWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateGpuTypeResponse(rsp) +} + +// CreateGpuTypeWithResponse Add a GPU type to the catalogue +// +// Creates a new entry in the global GPU type catalogue. Restricted to the Runware platform organization. The `id` (catalogue code) is immutable and remains reserved after retirement. +// +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /v1/gpu-types (the `CreateGpuType` operationId). +func (c *ClientWithResponses) CreateGpuTypeWithResponse(ctx context.Context, body CreateGpuTypeJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateGpuTypeResponse, error) { + rsp, err := c.CreateGpuType(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateGpuTypeResponse(rsp) +} + +// DeleteGpuTypeWithResponse Retire a GPU type from the catalogue +// +// Soft-deletes a GPU type while preserving its code and price history. Restricted to the Runware platform organization. Returns `409` if a worker configuration or GPU pool still references the code. Retiring an already retired code returns `404`. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with DELETE /v1/gpu-types/{gpuTypeId} (the `DeleteGpuType` operationId). +func (c *ClientWithResponses) DeleteGpuTypeWithResponse(ctx context.Context, gpuTypeId GpuTypeId, reqEditors ...RequestEditorFn) (*DeleteGpuTypeResponse, error) { + rsp, err := c.DeleteGpuType(ctx, gpuTypeId, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteGpuTypeResponse(rsp) +} + +// GetGpuTypeWithResponse Get a GPU type from the catalogue +// +// Returns an active entry from the global GPU type catalogue. Retired entries return `404`. The result is not organisation-specific, but the request still requires authentication. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v1/gpu-types/{gpuTypeId} (the `GetGpuType` operationId). +func (c *ClientWithResponses) GetGpuTypeWithResponse(ctx context.Context, gpuTypeId GpuTypeId, reqEditors ...RequestEditorFn) (*GetGpuTypeResponse, error) { + rsp, err := c.GetGpuType(ctx, gpuTypeId, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetGpuTypeResponse(rsp) +} + +// UpdateGpuTypeWithBodyWithResponse Update a GPU type in the catalogue +// +// Updates mutable fields of an active GPU type. Restricted to the Runware platform organization. The catalogue code (`gpuTypeId`) cannot be changed; retired entries return `404`. +// +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with PATCH /v1/gpu-types/{gpuTypeId} (the `UpdateGpuType` operationId). +func (c *ClientWithResponses) UpdateGpuTypeWithBodyWithResponse(ctx context.Context, gpuTypeId GpuTypeId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateGpuTypeResponse, error) { + rsp, err := c.UpdateGpuTypeWithBody(ctx, gpuTypeId, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateGpuTypeResponse(rsp) +} + +// UpdateGpuTypeWithResponse Update a GPU type in the catalogue +// +// Updates mutable fields of an active GPU type. Restricted to the Runware platform organization. The catalogue code (`gpuTypeId`) cannot be changed; retired entries return `404`. +// +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with PATCH /v1/gpu-types/{gpuTypeId} (the `UpdateGpuType` operationId). +func (c *ClientWithResponses) UpdateGpuTypeWithResponse(ctx context.Context, gpuTypeId GpuTypeId, body UpdateGpuTypeJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateGpuTypeResponse, error) { + rsp, err := c.UpdateGpuType(ctx, gpuTypeId, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateGpuTypeResponse(rsp) +} + +// ListGpuTypePricesWithResponse List historical and future prices of a GPU type +// +// Returns a page of a GPU type's prices, ordered by effectiveFrom. Restricted to the Runware platform organization: the page includes retired types and prices that are scheduled but not yet in effect. Customers read the price currently in effect from `GET /v1/gpu-types`. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v1/gpu-types/{gpuTypeId}/prices (the `ListGpuTypePrices` operationId). +func (c *ClientWithResponses) ListGpuTypePricesWithResponse(ctx context.Context, gpuTypeId GpuTypeId, params *ListGpuTypePricesParams, reqEditors ...RequestEditorFn) (*ListGpuTypePricesResponse, error) { + rsp, err := c.ListGpuTypePrices(ctx, gpuTypeId, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseListGpuTypePricesResponse(rsp) +} + +// CreateGpuTypePriceWithBodyWithResponse Schedule a new price for a GPU type +// +// Schedules a new price to take effect at `effectiveFrom`. Restricted to the Runware platform organization. `effectiveFrom` must normally be more than 7 days in the future. Before a GPU type is admitted or used, a later price can be added inside that window to correct its initial price. This preserves the original row and records the correction as a superseding price. Retired types return `404`; other values inside the notice window return `422`. Returns `409` if the GPU type already has a price scheduled at that exact instant. +// +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /v1/gpu-types/{gpuTypeId}/prices (the `CreateGpuTypePrice` operationId). +func (c *ClientWithResponses) CreateGpuTypePriceWithBodyWithResponse(ctx context.Context, gpuTypeId GpuTypeId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateGpuTypePriceResponse, error) { + rsp, err := c.CreateGpuTypePriceWithBody(ctx, gpuTypeId, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateGpuTypePriceResponse(rsp) +} + +// CreateGpuTypePriceWithResponse Schedule a new price for a GPU type +// +// Schedules a new price to take effect at `effectiveFrom`. Restricted to the Runware platform organization. `effectiveFrom` must normally be more than 7 days in the future. Before a GPU type is admitted or used, a later price can be added inside that window to correct its initial price. This preserves the original row and records the correction as a superseding price. Retired types return `404`; other values inside the notice window return `422`. Returns `409` if the GPU type already has a price scheduled at that exact instant. +// +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /v1/gpu-types/{gpuTypeId}/prices (the `CreateGpuTypePrice` operationId). +func (c *ClientWithResponses) CreateGpuTypePriceWithResponse(ctx context.Context, gpuTypeId GpuTypeId, body CreateGpuTypePriceJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateGpuTypePriceResponse, error) { + rsp, err := c.CreateGpuTypePrice(ctx, gpuTypeId, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateGpuTypePriceResponse(rsp) +} + +// DeleteGpuTypePriceWithResponse Remove a scheduled price for a GPU type +// +// Deletes a scheduled price. Restricted to the Runware platform organization. Only a price whose effectiveFrom is still more than 7 days in the future can be deleted — once inside that window the price is locked in (about to take effect, or already has) and this returns `409`. Retired GPU types return `404`. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with DELETE /v1/gpu-types/{gpuTypeId}/prices/{priceId} (the `DeleteGpuTypePrice` operationId). +func (c *ClientWithResponses) DeleteGpuTypePriceWithResponse(ctx context.Context, gpuTypeId GpuTypeId, priceId openapi_types.UUID, reqEditors ...RequestEditorFn) (*DeleteGpuTypePriceResponse, error) { + rsp, err := c.DeleteGpuTypePrice(ctx, gpuTypeId, priceId, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteGpuTypePriceResponse(rsp) +} + +// UpdateGpuTypePriceWithBodyWithResponse Update a scheduled price for a GPU type +// +// Partially updates a scheduled price. Restricted to the Runware platform organization. Only a price whose current `effectiveFrom` is still more than 7 days in the future can be edited — once inside that window the price is locked in and this returns `409`. A supplied `effectiveFrom` must itself be more than 7 days in the future, returning `422` otherwise. Retired GPU types return `404`. Returns `409` if the update collides with another price already scheduled at that exact instant. +// +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with PATCH /v1/gpu-types/{gpuTypeId}/prices/{priceId} (the `UpdateGpuTypePrice` operationId). +func (c *ClientWithResponses) UpdateGpuTypePriceWithBodyWithResponse(ctx context.Context, gpuTypeId GpuTypeId, priceId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateGpuTypePriceResponse, error) { + rsp, err := c.UpdateGpuTypePriceWithBody(ctx, gpuTypeId, priceId, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateGpuTypePriceResponse(rsp) +} + +// UpdateGpuTypePriceWithResponse Update a scheduled price for a GPU type +// +// Partially updates a scheduled price. Restricted to the Runware platform organization. Only a price whose current `effectiveFrom` is still more than 7 days in the future can be edited — once inside that window the price is locked in and this returns `409`. A supplied `effectiveFrom` must itself be more than 7 days in the future, returning `422` otherwise. Retired GPU types return `404`. Returns `409` if the update collides with another price already scheduled at that exact instant. +// +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with PATCH /v1/gpu-types/{gpuTypeId}/prices/{priceId} (the `UpdateGpuTypePrice` operationId). +func (c *ClientWithResponses) UpdateGpuTypePriceWithResponse(ctx context.Context, gpuTypeId GpuTypeId, priceId openapi_types.UUID, body UpdateGpuTypePriceJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateGpuTypePriceResponse, error) { + rsp, err := c.UpdateGpuTypePrice(ctx, gpuTypeId, priceId, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateGpuTypePriceResponse(rsp) +} + +// GetLogEntriesWithResponse Read one page of a named log query +// +// Returns one page of log entries, newest first, with an opaque cursor for the next page when one exists. +// +// No query is registered yet: live tail, retention tiers and log quotas are decided in a follow-up ADR, so every request currently answers `404`. The route exists so the contract is fixed before the templates land. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v1/logs/queries/{queryId}/entries (the `GetLogEntries` operationId). +func (c *ClientWithResponses) GetLogEntriesWithResponse(ctx context.Context, queryId QueryId, params *GetLogEntriesParams, reqEditors ...RequestEditorFn) (*GetLogEntriesResponse, error) { + rsp, err := c.GetLogEntries(ctx, queryId, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetLogEntriesResponse(rsp) +} + +// ListInsightsQueriesWithResponse List the metric and log queries this build can answer +// +// The catalogue: every named query, its unit and aggregation, the selectors it accepts, the series it returns, and the windows actually backed by stored series. +// +// This is the source of query ids. Clients discover ids here rather than carrying a list of their own, and render window tabs from `windows` rather than from the full ladder, so a window whose storage tier has no backing series stays invisible instead of rendering a tab with nothing behind it. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v1/metrics/queries (the `ListInsightsQueries` operationId). +func (c *ClientWithResponses) ListInsightsQueriesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListInsightsQueriesResponse, error) { + rsp, err := c.ListInsightsQueries(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParseListInsightsQueriesResponse(rsp) +} + +// GetMetricSeriesWithResponse Read one named metric query +// +// Returns one chart's data: a single timestamp axis shared by every series, and one dense value array per series aligned to it. +// +// Values are dense and positionally aligned to `t`, with an explicit `null` wherever there was no sample. Each timestamp is the END of its bucket, so `window.to` is inclusive and equals the last timestamp in `t`, while `window.from` is exclusive and is one `step_s` before the first. +// +// An organization with no metrics yet is answered with the full axis and all-null series rather than an error. +// +// `apps_request_volume` returns one series per app: 24 hourly request counts over `window=24h` (`step_s` 3600, unit `requests`). Repeat `appId` once per id on the current list page to pad idle apps with all-null series, in request order. Hours that started before that live app's `createdAt` are null, so a reused app id does not inherit the previous generation's traffic still in the 24h store. The same `appId` pad applies to the list-scoped `apps_error_volume` and `apps_request_duration` queries. Other queries reject `appId`. Other windows are not available for these queries. +// +// `endpoints_request_volume` is the endpoints-list counterpart: 24 hourly request counts per endpoint over `window=24h` (`step_s` 3600, unit `requests`). It requires `deployment` (the public app id, rewritten to the live deployment UUID). Repeat `endpointId` once per id on the current `listEndpoints` page to pad idle endpoints with all-null series, in request order. Hours that started before that endpoint row's `createdAt` are null, so a removed-then-readded path does not inherit the previous row's traffic. Other queries reject `endpointId`. Other windows are not available for this query. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v1/metrics/queries/{queryId}/series (the `GetMetricSeries` operationId). +func (c *ClientWithResponses) GetMetricSeriesWithResponse(ctx context.Context, queryId QueryId, params *GetMetricSeriesParams, reqEditors ...RequestEditorFn) (*GetMetricSeriesResponse, error) { + rsp, err := c.GetMetricSeries(ctx, queryId, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetMetricSeriesResponse(rsp) +} + +// UpsertOrgTenancyWithBodyWithResponse Set an organisation's serverless tenancy state +// +// Idempotent upsert for one customer organisation. The customer UUID is in the body — public paths never carry an organisation identifier (the authenticated API key names the *caller*, which for this route must be the Runware platform organisation). +// +// `state: active` runs Ensure: a Cloud KMS CryptoKey named after the organisation UUID, a Kubernetes service account `org-` in the shared app namespace, and a decrypt IAM binding on that key for the KSA principal. `state: disabled` runs teardown: disable the key's primary version, drop the decrypt binding, delete the KSA. The key itself is not destroyed — a destroyed key makes every ciphertext under it permanently unreadable. The local row stays as a tombstone so a later Ensure converges on the same names. +// +// A retry after a partial failure converges rather than duplicating objects. `200` returns the resulting receipt. `503` when Cloud KMS key-admin is rate-limited (60 writes/min) or otherwise unavailable; the caller (admin-api Messenger) retries the same PUT. +// +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with PUT /v1/org-tenancies (the `UpsertOrgTenancy` operationId). +func (c *ClientWithResponses) UpsertOrgTenancyWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpsertOrgTenancyResponse, error) { + rsp, err := c.UpsertOrgTenancyWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpsertOrgTenancyResponse(rsp) +} + +// UpsertOrgTenancyWithResponse Set an organisation's serverless tenancy state +// +// Idempotent upsert for one customer organisation. The customer UUID is in the body — public paths never carry an organisation identifier (the authenticated API key names the *caller*, which for this route must be the Runware platform organisation). +// +// `state: active` runs Ensure: a Cloud KMS CryptoKey named after the organisation UUID, a Kubernetes service account `org-` in the shared app namespace, and a decrypt IAM binding on that key for the KSA principal. `state: disabled` runs teardown: disable the key's primary version, drop the decrypt binding, delete the KSA. The key itself is not destroyed — a destroyed key makes every ciphertext under it permanently unreadable. The local row stays as a tombstone so a later Ensure converges on the same names. +// +// A retry after a partial failure converges rather than duplicating objects. `200` returns the resulting receipt. `503` when Cloud KMS key-admin is rate-limited (60 writes/min) or otherwise unavailable; the caller (admin-api Messenger) retries the same PUT. +// // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // -// Corresponds with POST /v1/gpu-types/{gpuTypeId}/prices (the `CreateGpuTypePrice` operationId). -func (c *ClientWithResponses) CreateGpuTypePriceWithResponse(ctx context.Context, gpuTypeId GpuTypeId, body CreateGpuTypePriceJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateGpuTypePriceResponse, error) { - rsp, err := c.CreateGpuTypePrice(ctx, gpuTypeId, body, reqEditors...) +// Corresponds with PUT /v1/org-tenancies (the `UpsertOrgTenancy` operationId). +func (c *ClientWithResponses) UpsertOrgTenancyWithResponse(ctx context.Context, body UpsertOrgTenancyJSONRequestBody, reqEditors ...RequestEditorFn) (*UpsertOrgTenancyResponse, error) { + rsp, err := c.UpsertOrgTenancy(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpsertOrgTenancyResponse(rsp) +} + +// ListSecretsWithResponse List secrets +// +// Returns secret metadata only; encrypted values are never returned. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v1/secrets (the `ListSecrets` operationId). +func (c *ClientWithResponses) ListSecretsWithResponse(ctx context.Context, params *ListSecretsParams, reqEditors ...RequestEditorFn) (*ListSecretsResponse, error) { + rsp, err := c.ListSecrets(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseListSecretsResponse(rsp) +} + +// CreateSecretWithBodyWithResponse Create a secret +// +// Creates an organisation-scoped secret. Returns `409` if the name is already in use — including when a secret of that name is `pending_destroy`. List only shows active secrets, so a name can appear free while create still conflicts for as long as that row remains. A `pending_destroy` row is removed, and its name released, by a background sweep once no running worker can still hold the value — there is no deadline on that wait, so a continuously busy app can hold a name for as long as it runs. Recreate-while-deleting may later reuse the pending row with the new value (same name, new ciphertext). +// +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /v1/secrets (the `CreateSecret` operationId). +func (c *ClientWithResponses) CreateSecretWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateSecretResponse, error) { + rsp, err := c.CreateSecretWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateSecretResponse(rsp) +} + +// CreateSecretWithResponse Create a secret +// +// Creates an organisation-scoped secret. Returns `409` if the name is already in use — including when a secret of that name is `pending_destroy`. List only shows active secrets, so a name can appear free while create still conflicts for as long as that row remains. A `pending_destroy` row is removed, and its name released, by a background sweep once no running worker can still hold the value — there is no deadline on that wait, so a continuously busy app can hold a name for as long as it runs. Recreate-while-deleting may later reuse the pending row with the new value (same name, new ciphertext). +// +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /v1/secrets (the `CreateSecret` operationId). +func (c *ClientWithResponses) CreateSecretWithResponse(ctx context.Context, body CreateSecretJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateSecretResponse, error) { + rsp, err := c.CreateSecret(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateSecretResponse(rsp) +} + +// DeleteSecretWithResponse Delete a secret +// +// Soft-deletes a secret: marks the row `pending_destroy` and bumps revision. This API does not hard-delete the row. A background sweep removes the row and releases the name once no running worker can still hold the value — the value travels inside the worker's own environment, which is fixed when the container starts, so a worker keeps it until it stops. There is no deadline on that wait. Returns `409` while any app still attaches it — cascade-detach is not performed here; detach each holder with `DELETE .../apps/{id}/secrets/{name}` first. Attach and detach change the secret set for the next rollout. Neither operation rolls workers. While the row remains `pending_destroy` the name stays reserved, so create may return `409` even though list no longer shows the secret. Retries on an already-pending name are safe when no attachments remain (`204`); they still return `409` while attached. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with DELETE /v1/secrets/{secretName} (the `DeleteSecret` operationId). +func (c *ClientWithResponses) DeleteSecretWithResponse(ctx context.Context, secretName SecretName, reqEditors ...RequestEditorFn) (*DeleteSecretResponse, error) { + rsp, err := c.DeleteSecret(ctx, secretName, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteSecretResponse(rsp) +} + +// UpdateSecretWithBodyWithResponse Update a secret +// +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with PUT /v1/secrets/{secretName} (the `UpdateSecret` operationId). +func (c *ClientWithResponses) UpdateSecretWithBodyWithResponse(ctx context.Context, secretName SecretName, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateSecretResponse, error) { + rsp, err := c.UpdateSecretWithBody(ctx, secretName, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateSecretResponse(rsp) +} + +// UpdateSecretWithResponse Update a secret +// +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with PUT /v1/secrets/{secretName} (the `UpdateSecret` operationId). +func (c *ClientWithResponses) UpdateSecretWithResponse(ctx context.Context, secretName SecretName, body UpdateSecretJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateSecretResponse, error) { + rsp, err := c.UpdateSecret(ctx, secretName, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateSecretResponse(rsp) +} + +// ListUsageEventsWithResponse List usage events +// +// Append-only billing telemetry; one row per worker state transition. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v1/usage (the `ListUsageEvents` operationId). +func (c *ClientWithResponses) ListUsageEventsWithResponse(ctx context.Context, params *ListUsageEventsParams, reqEditors ...RequestEditorFn) (*ListUsageEventsResponse, error) { + rsp, err := c.ListUsageEvents(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseListUsageEventsResponse(rsp) +} + +// ParseGetAppSummaryResponse parses an HTTP response from a GetAppSummaryWithResponse call +func ParseGetAppSummaryResponse(rsp *http.Response) (*GetAppSummaryResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetAppSummaryResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest AppSummary + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Forbidden + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: + var dest ServiceUnavailable + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON503 = &dest + + } + + return response, nil +} + +// ParseListAppsResponse parses an HTTP response from a ListAppsWithResponse call +func ParseListAppsResponse(rsp *http.Response) (*ListAppsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &ListAppsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + Data *[]App `json:"data,omitempty"` + + // NextCursor Cursor for the next page; null when there are no more items. + NextCursor *string `json:"nextCursor,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest BadRequest + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Forbidden + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: + var dest ValidationError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON422 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: + var dest ServiceUnavailable + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON503 = &dest + + } + + return response, nil +} + +// ParseCreateAppResponse parses an HTTP response from a CreateAppWithResponse call +func ParseCreateAppResponse(rsp *http.Response) (*CreateAppResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseCreateGpuTypePriceResponse(rsp) + + response := &CreateAppResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest App + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest BadRequest + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Forbidden + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest NotFound + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: + var dest Conflict + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON409 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: + var dest ValidationError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON422 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: + var dest ServiceUnavailable + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON503 = &dest + + } + + return response, nil +} + +// ParseDeleteAppResponse parses an HTTP response from a DeleteAppWithResponse call +func ParseDeleteAppResponse(rsp *http.Response) (*DeleteAppResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &DeleteAppResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 202: + var dest App + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON202 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Forbidden + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest NotFound + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: + var dest ServiceUnavailable + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON503 = &dest + + } + + return response, nil +} + +// ParseGetAppResponse parses an HTTP response from a GetAppWithResponse call +func ParseGetAppResponse(rsp *http.Response) (*GetAppResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetAppResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest App + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Forbidden + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest NotFound + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: + var dest ServiceUnavailable + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON503 = &dest + + } + + return response, nil } -// DeleteGpuTypePriceWithResponse Remove a scheduled price for a GPU type -// -// Deletes a scheduled price. Restricted to the Runware platform organization. Only a price whose effectiveFrom is still more than 7 days in the future can be deleted — once inside that window the price is locked in (about to take effect, or already has) and this returns `409`. Retired GPU types return `404`. -// -// Returns a wrapper object for the known response body format(s). -// -// Corresponds with DELETE /v1/gpu-types/{gpuTypeId}/prices/{priceId} (the `DeleteGpuTypePrice` operationId). -func (c *ClientWithResponses) DeleteGpuTypePriceWithResponse(ctx context.Context, gpuTypeId GpuTypeId, priceId openapi_types.UUID, reqEditors ...RequestEditorFn) (*DeleteGpuTypePriceResponse, error) { - rsp, err := c.DeleteGpuTypePrice(ctx, gpuTypeId, priceId, reqEditors...) - if err != nil { - return nil, err +// ParseUpdateAppResponse parses an HTTP response from a UpdateAppWithResponse call +func ParseUpdateAppResponse(rsp *http.Response) (*UpdateAppResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &UpdateAppResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest App + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest BadRequest + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Forbidden + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest NotFound + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: + var dest Conflict + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON409 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: + var dest ValidationError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON422 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: + var dest ServiceUnavailable + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON503 = &dest + } - return ParseDeleteGpuTypePriceResponse(rsp) + + return response, nil } -// UpdateGpuTypePriceWithBodyWithResponse Update a scheduled price for a GPU type -// -// Partially updates a scheduled price. Restricted to the Runware platform organization. Only a price whose current `effectiveFrom` is still more than 7 days in the future can be edited — once inside that window the price is locked in and this returns `409`. A supplied `effectiveFrom` must itself be more than 7 days in the future, returning `422` otherwise. Retired GPU types return `404`. Returns `409` if the update collides with another price already scheduled at that exact instant. -// -// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). -// -// Corresponds with PATCH /v1/gpu-types/{gpuTypeId}/prices/{priceId} (the `UpdateGpuTypePrice` operationId). -func (c *ClientWithResponses) UpdateGpuTypePriceWithBodyWithResponse(ctx context.Context, gpuTypeId GpuTypeId, priceId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateGpuTypePriceResponse, error) { - rsp, err := c.UpdateGpuTypePriceWithBody(ctx, gpuTypeId, priceId, contentType, body, reqEditors...) +// ParseListBuildsResponse parses an HTTP response from a ListBuildsWithResponse call +func ParseListBuildsResponse(rsp *http.Response) (*ListBuildsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseUpdateGpuTypePriceResponse(rsp) -} -// UpdateGpuTypePriceWithResponse Update a scheduled price for a GPU type -// -// Partially updates a scheduled price. Restricted to the Runware platform organization. Only a price whose current `effectiveFrom` is still more than 7 days in the future can be edited — once inside that window the price is locked in and this returns `409`. A supplied `effectiveFrom` must itself be more than 7 days in the future, returning `422` otherwise. Retired GPU types return `404`. Returns `409` if the update collides with another price already scheduled at that exact instant. -// -// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). -// -// Corresponds with PATCH /v1/gpu-types/{gpuTypeId}/prices/{priceId} (the `UpdateGpuTypePrice` operationId). -func (c *ClientWithResponses) UpdateGpuTypePriceWithResponse(ctx context.Context, gpuTypeId GpuTypeId, priceId openapi_types.UUID, body UpdateGpuTypePriceJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateGpuTypePriceResponse, error) { - rsp, err := c.UpdateGpuTypePrice(ctx, gpuTypeId, priceId, body, reqEditors...) - if err != nil { - return nil, err + response := &ListBuildsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseUpdateGpuTypePriceResponse(rsp) -} -// ListSecretsWithResponse List secrets -// -// Returns secret metadata only; encrypted values are never returned. -// -// Returns a wrapper object for the known response body format(s). -// -// Corresponds with GET /v1/secrets (the `ListSecrets` operationId). -func (c *ClientWithResponses) ListSecretsWithResponse(ctx context.Context, params *ListSecretsParams, reqEditors ...RequestEditorFn) (*ListSecretsResponse, error) { - rsp, err := c.ListSecrets(ctx, params, reqEditors...) - if err != nil { - return nil, err + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + Data []Build `json:"data"` + + // NextCursor Cursor for the next page; null when there are no more items. + NextCursor *string `json:"nextCursor,omitempty"` + + // Summary Collection totals for this app's builds list. Independent of the page: the same values on every cursor, including a seek past the last row. `total` counts builds. `versions` counts versions on the same app — the same predicate as `listVersions` `summary.total`, excluding soft-deleted versions. + Summary BuildListSummary `json:"summary"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Forbidden + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest NotFound + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: + var dest ServiceUnavailable + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON503 = &dest + } - return ParseListSecretsResponse(rsp) + + return response, nil } -// CreateSecretWithBodyWithResponse Create a secret -// -// Creates an organisation-scoped secret. Returns `409` if the name is already in use — including when a secret of that name is `pending_destroy`. List only shows active secrets, so a name can appear free while create still conflicts for as long as that row remains. Hard deletion of `pending_destroy` rows (which would release the name) is not performed by this API yet. Recreate-while-deleting may later reuse the pending row with the new value (same name, new ciphertext). -// -// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). -// -// Corresponds with POST /v1/secrets (the `CreateSecret` operationId). -func (c *ClientWithResponses) CreateSecretWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateSecretResponse, error) { - rsp, err := c.CreateSecretWithBody(ctx, contentType, body, reqEditors...) +// ParseDeleteBuildResponse parses an HTTP response from a DeleteBuildWithResponse call +func ParseDeleteBuildResponse(rsp *http.Response) (*DeleteBuildResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseCreateSecretResponse(rsp) -} -// CreateSecretWithResponse Create a secret -// -// Creates an organisation-scoped secret. Returns `409` if the name is already in use — including when a secret of that name is `pending_destroy`. List only shows active secrets, so a name can appear free while create still conflicts for as long as that row remains. Hard deletion of `pending_destroy` rows (which would release the name) is not performed by this API yet. Recreate-while-deleting may later reuse the pending row with the new value (same name, new ciphertext). -// -// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). -// -// Corresponds with POST /v1/secrets (the `CreateSecret` operationId). -func (c *ClientWithResponses) CreateSecretWithResponse(ctx context.Context, body CreateSecretJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateSecretResponse, error) { - rsp, err := c.CreateSecret(ctx, body, reqEditors...) - if err != nil { - return nil, err + response := &DeleteBuildResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseCreateSecretResponse(rsp) -} -// DeleteSecretWithResponse Delete a secret -// -// Soft-deletes a secret: marks the row `pending_destroy` and bumps revision. This API does not hard-delete the row; a future GC path is expected to remove unattached `pending_destroy` secrets and release the name, but that sweep is not implemented yet. Returns `409` while any app still attaches it — cascade-detach is not performed here; detach each holder with `DELETE .../apps/{id}/secrets/{name}` first. Attach/detach are control-plane records only in this release (they do not roll workers). While the row remains `pending_destroy` the name stays reserved, so create may return `409` even though list no longer shows the secret. Retries on an already-pending name are safe when no attachments remain (`204`); they still return `409` while attached. -// -// Returns a wrapper object for the known response body format(s). -// -// Corresponds with DELETE /v1/secrets/{secretName} (the `DeleteSecret` operationId). -func (c *ClientWithResponses) DeleteSecretWithResponse(ctx context.Context, secretName SecretName, reqEditors ...RequestEditorFn) (*DeleteSecretResponse, error) { - rsp, err := c.DeleteSecret(ctx, secretName, reqEditors...) - if err != nil { - return nil, err + switch { + case rsp.StatusCode == 204: + break // No content-type + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest BadRequest + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Forbidden + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest NotFound + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: + var dest Conflict + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON409 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: + var dest ValidationError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON422 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 502: + var dest BadGateway + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON502 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: + var dest ServiceUnavailable + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON503 = &dest + } - return ParseDeleteSecretResponse(rsp) + + return response, nil } -// UpdateSecretWithBodyWithResponse Update a secret -// -// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). -// -// Corresponds with PUT /v1/secrets/{secretName} (the `UpdateSecret` operationId). -func (c *ClientWithResponses) UpdateSecretWithBodyWithResponse(ctx context.Context, secretName SecretName, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateSecretResponse, error) { - rsp, err := c.UpdateSecretWithBody(ctx, secretName, contentType, body, reqEditors...) +// ParseGetBuildResponse parses an HTTP response from a GetBuildWithResponse call +func ParseGetBuildResponse(rsp *http.Response) (*GetBuildResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseUpdateSecretResponse(rsp) -} -// UpdateSecretWithResponse Update a secret -// -// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). -// -// Corresponds with PUT /v1/secrets/{secretName} (the `UpdateSecret` operationId). -func (c *ClientWithResponses) UpdateSecretWithResponse(ctx context.Context, secretName SecretName, body UpdateSecretJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateSecretResponse, error) { - rsp, err := c.UpdateSecret(ctx, secretName, body, reqEditors...) - if err != nil { - return nil, err + response := &GetBuildResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseUpdateSecretResponse(rsp) -} -// ListUsageEventsWithResponse List usage events -// -// Append-only billing telemetry; one row per worker state transition. -// -// Returns a wrapper object for the known response body format(s). -// -// Corresponds with GET /v1/usage (the `ListUsageEvents` operationId). -func (c *ClientWithResponses) ListUsageEventsWithResponse(ctx context.Context, params *ListUsageEventsParams, reqEditors ...RequestEditorFn) (*ListUsageEventsResponse, error) { - rsp, err := c.ListUsageEvents(ctx, params, reqEditors...) - if err != nil { - return nil, err + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Build + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Forbidden + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest NotFound + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: + var dest ServiceUnavailable + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON503 = &dest + } - return ParseListUsageEventsResponse(rsp) + + return response, nil } -// ParseGetAppSummaryResponse parses an HTTP response from a GetAppSummaryWithResponse call -func ParseGetAppSummaryResponse(rsp *http.Response) (*GetAppSummaryResponse, error) { +// ParseDeployVersionResponse parses an HTTP response from a DeployVersionWithResponse call +func ParseDeployVersionResponse(rsp *http.Response) (*DeployVersionResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetAppSummaryResponse{ + response := &DeployVersionResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest AppSummary + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 202: + var dest App if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON200 = &dest + response.JSON202 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest BadRequest + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON400 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest Unauthorized @@ -10260,6 +13757,27 @@ func ParseGetAppSummaryResponse(rsp *http.Response) (*GetAppSummaryResponse, err } response.ApplicationproblemJSON403 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest NotFound + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: + var dest Conflict + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON409 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: + var dest ValidationError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON422 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: var dest ServiceUnavailable if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -10272,15 +13790,15 @@ func ParseGetAppSummaryResponse(rsp *http.Response) (*GetAppSummaryResponse, err return response, nil } -// ParseListAppsResponse parses an HTTP response from a ListAppsWithResponse call -func ParseListAppsResponse(rsp *http.Response) (*ListAppsResponse, error) { +// ParseListEndpointsResponse parses an HTTP response from a ListEndpointsWithResponse call +func ParseListEndpointsResponse(rsp *http.Response) (*ListEndpointsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ListAppsResponse{ + response := &ListEndpointsResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -10288,7 +13806,7 @@ func ParseListAppsResponse(rsp *http.Response) (*ListAppsResponse, error) { switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest struct { - Data *[]App `json:"data,omitempty"` + Data *[]Endpoint `json:"data,omitempty"` // NextCursor Cursor for the next page; null when there are no more items. NextCursor *string `json:"nextCursor,omitempty"` @@ -10319,6 +13837,13 @@ func ParseListAppsResponse(rsp *http.Response) (*ListAppsResponse, error) { } response.ApplicationproblemJSON403 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest NotFound + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON404 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: var dest ValidationError if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -10338,26 +13863,26 @@ func ParseListAppsResponse(rsp *http.Response) (*ListAppsResponse, error) { return response, nil } -// ParseCreateAppResponse parses an HTTP response from a CreateAppWithResponse call -func ParseCreateAppResponse(rsp *http.Response) (*CreateAppResponse, error) { +// ParseGetEndpointResponse parses an HTTP response from a GetEndpointWithResponse call +func ParseGetEndpointResponse(rsp *http.Response) (*GetEndpointResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &CreateAppResponse{ + response := &GetEndpointResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: - var dest App + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Endpoint if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON201 = &dest + response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest BadRequest @@ -10380,12 +13905,12 @@ func ParseCreateAppResponse(rsp *http.Response) (*CreateAppResponse, error) { } response.ApplicationproblemJSON403 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: - var dest Conflict + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest NotFound if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.ApplicationproblemJSON409 = &dest + response.ApplicationproblemJSON404 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: var dest ValidationError @@ -10406,26 +13931,31 @@ func ParseCreateAppResponse(rsp *http.Response) (*CreateAppResponse, error) { return response, nil } -// ParseDeleteAppResponse parses an HTTP response from a DeleteAppWithResponse call -func ParseDeleteAppResponse(rsp *http.Response) (*DeleteAppResponse, error) { +// ParseListAppEnvironmentVariablesResponse parses an HTTP response from a ListAppEnvironmentVariablesWithResponse call +func ParseListAppEnvironmentVariablesResponse(rsp *http.Response) (*ListAppEnvironmentVariablesResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &DeleteAppResponse{ + response := &ListAppEnvironmentVariablesResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 202: - var dest App + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + Data *[]EnvironmentVariable `json:"data,omitempty"` + + // NextCursor Cursor for the next page; null when there are no more items. + NextCursor *string `json:"nextCursor,omitempty"` + } if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON202 = &dest + response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest Unauthorized @@ -10460,26 +13990,22 @@ func ParseDeleteAppResponse(rsp *http.Response) (*DeleteAppResponse, error) { return response, nil } -// ParseGetAppResponse parses an HTTP response from a GetAppWithResponse call -func ParseGetAppResponse(rsp *http.Response) (*GetAppResponse, error) { +// ParseDeleteAppEnvironmentVariableResponse parses an HTTP response from a DeleteAppEnvironmentVariableWithResponse call +func ParseDeleteAppEnvironmentVariableResponse(rsp *http.Response) (*DeleteAppEnvironmentVariableResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetAppResponse{ + response := &DeleteAppEnvironmentVariableResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest App - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest + case rsp.StatusCode == 204: + break // No content-type case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest Unauthorized @@ -10514,22 +14040,22 @@ func ParseGetAppResponse(rsp *http.Response) (*GetAppResponse, error) { return response, nil } -// ParseUpdateAppResponse parses an HTTP response from a UpdateAppWithResponse call -func ParseUpdateAppResponse(rsp *http.Response) (*UpdateAppResponse, error) { +// ParseUpdateAppEnvironmentVariableResponse parses an HTTP response from a UpdateAppEnvironmentVariableWithResponse call +func ParseUpdateAppEnvironmentVariableResponse(rsp *http.Response) (*UpdateAppEnvironmentVariableResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &UpdateAppResponse{ + response := &UpdateAppEnvironmentVariableResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest App + var dest EnvironmentVariable if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -10563,19 +14089,71 @@ func ParseUpdateAppResponse(rsp *http.Response) (*UpdateAppResponse, error) { } response.ApplicationproblemJSON404 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: - var dest Conflict + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: + var dest ValidationError if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.ApplicationproblemJSON409 = &dest + response.ApplicationproblemJSON422 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest ValidationError + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: + var dest ServiceUnavailable if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.ApplicationproblemJSON422 = &dest + response.ApplicationproblemJSON503 = &dest + + } + + return response, nil +} + +// ParseListAppEventsResponse parses an HTTP response from a ListAppEventsWithResponse call +func ParseListAppEventsResponse(rsp *http.Response) (*ListAppEventsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &ListAppEventsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + Data *[]AppEvent `json:"data,omitempty"` + + // NextCursor Cursor for the next page; null when there are no more items. + NextCursor *string `json:"nextCursor,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Forbidden + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest NotFound + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON404 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: var dest ServiceUnavailable @@ -10589,27 +14167,76 @@ func ParseUpdateAppResponse(rsp *http.Response) (*UpdateAppResponse, error) { return response, nil } -// ParseListBuildsResponse parses an HTTP response from a ListBuildsWithResponse call -func ParseListBuildsResponse(rsp *http.Response) (*ListBuildsResponse, error) { +// ParseUnfavouriteAppResponse parses an HTTP response from a UnfavouriteAppWithResponse call +func ParseUnfavouriteAppResponse(rsp *http.Response) (*UnfavouriteAppResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ListBuildsResponse{ + response := &UnfavouriteAppResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest App + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Forbidden + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest NotFound + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: + var dest ServiceUnavailable + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON503 = &dest + + } + + return response, nil +} + +// ParseFavouriteAppResponse parses an HTTP response from a FavouriteAppWithResponse call +func ParseFavouriteAppResponse(rsp *http.Response) (*FavouriteAppResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &FavouriteAppResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest struct { - Data *[]Build `json:"data,omitempty"` - - // NextCursor Cursor for the next page; null when there are no more items. - NextCursor *string `json:"nextCursor,omitempty"` - } + var dest App if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -10648,26 +14275,33 @@ func ParseListBuildsResponse(rsp *http.Response) (*ListBuildsResponse, error) { return response, nil } -// ParseGetBuildResponse parses an HTTP response from a GetBuildWithResponse call -func ParseGetBuildResponse(rsp *http.Response) (*GetBuildResponse, error) { +// ParseStartAsyncTaskResponse parses an HTTP response from a StartAsyncTaskWithResponse call +func ParseStartAsyncTaskResponse(rsp *http.Response) (*StartAsyncTaskResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetBuildResponse{ + response := &StartAsyncTaskResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Build + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 202: + var dest TaskAccepted if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON200 = &dest + response.JSON202 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest BadRequest + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON400 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest Unauthorized @@ -10690,6 +14324,20 @@ func ParseGetBuildResponse(rsp *http.Response) (*GetBuildResponse, error) { } response.ApplicationproblemJSON404 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: + var dest Conflict + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON409 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: + var dest ValidationError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON422 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: var dest ServiceUnavailable if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -10702,22 +14350,29 @@ func ParseGetBuildResponse(rsp *http.Response) (*GetBuildResponse, error) { return response, nil } -// ParseDeployVersionResponse parses an HTTP response from a DeployVersionWithResponse call -func ParseDeployVersionResponse(rsp *http.Response) (*DeployVersionResponse, error) { +// ParseStartSyncTaskResponse parses an HTTP response from a StartSyncTaskWithResponse call +func ParseStartSyncTaskResponse(rsp *http.Response) (*StartSyncTaskResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &DeployVersionResponse{ + response := &StartSyncTaskResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Task + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 202: - var dest App + var dest TaskAccepted if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -10777,38 +14432,26 @@ func ParseDeployVersionResponse(rsp *http.Response) (*DeployVersionResponse, err return response, nil } -// ParseListEndpointsResponse parses an HTTP response from a ListEndpointsWithResponse call -func ParseListEndpointsResponse(rsp *http.Response) (*ListEndpointsResponse, error) { +// ParseResumeAppResponse parses an HTTP response from a ResumeAppWithResponse call +func ParseResumeAppResponse(rsp *http.Response) (*ResumeAppResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ListEndpointsResponse{ + response := &ResumeAppResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest struct { - Data *[]Endpoint `json:"data,omitempty"` - - // NextCursor Cursor for the next page; null when there are no more items. - NextCursor *string `json:"nextCursor,omitempty"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest BadRequest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 202: + var dest App if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.ApplicationproblemJSON400 = &dest + response.JSON202 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest Unauthorized @@ -10831,12 +14474,12 @@ func ParseListEndpointsResponse(rsp *http.Response) (*ListEndpointsResponse, err } response.ApplicationproblemJSON404 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest ValidationError + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: + var dest Conflict if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.ApplicationproblemJSON422 = &dest + response.ApplicationproblemJSON409 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: var dest ServiceUnavailable @@ -10850,22 +14493,27 @@ func ParseListEndpointsResponse(rsp *http.Response) (*ListEndpointsResponse, err return response, nil } -// ParseGetEndpointResponse parses an HTTP response from a GetEndpointWithResponse call -func ParseGetEndpointResponse(rsp *http.Response) (*GetEndpointResponse, error) { +// ParseListAppSecretsResponse parses an HTTP response from a ListAppSecretsWithResponse call +func ParseListAppSecretsResponse(rsp *http.Response) (*ListAppSecretsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetEndpointResponse{ + response := &ListAppSecretsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Endpoint + var dest struct { + Data *[]SecretAttachment `json:"data,omitempty"` + + // NextCursor Cursor for the next page; null when there are no more items. + NextCursor *string `json:"nextCursor,omitempty"` + } if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -10918,31 +14566,29 @@ func ParseGetEndpointResponse(rsp *http.Response) (*GetEndpointResponse, error) return response, nil } -// ParseListAppEnvironmentVariablesResponse parses an HTTP response from a ListAppEnvironmentVariablesWithResponse call -func ParseListAppEnvironmentVariablesResponse(rsp *http.Response) (*ListAppEnvironmentVariablesResponse, error) { +// ParseAttachAppSecretResponse parses an HTTP response from a AttachAppSecretWithResponse call +func ParseAttachAppSecretResponse(rsp *http.Response) (*AttachAppSecretResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ListAppEnvironmentVariablesResponse{ + response := &AttachAppSecretResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest struct { - Data *[]EnvironmentVariable `json:"data,omitempty"` + case rsp.StatusCode == 204: + break // No content-type - // NextCursor Cursor for the next page; null when there are no more items. - NextCursor *string `json:"nextCursor,omitempty"` - } + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest BadRequest if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON200 = &dest + response.ApplicationproblemJSON400 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest Unauthorized @@ -10965,6 +14611,20 @@ func ParseListAppEnvironmentVariablesResponse(rsp *http.Response) (*ListAppEnvir } response.ApplicationproblemJSON404 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: + var dest Conflict + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON409 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: + var dest ValidationError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON422 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: var dest ServiceUnavailable if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -10977,15 +14637,15 @@ func ParseListAppEnvironmentVariablesResponse(rsp *http.Response) (*ListAppEnvir return response, nil } -// ParseDeleteAppEnvironmentVariableResponse parses an HTTP response from a DeleteAppEnvironmentVariableWithResponse call -func ParseDeleteAppEnvironmentVariableResponse(rsp *http.Response) (*DeleteAppEnvironmentVariableResponse, error) { +// ParseDetachAppSecretResponse parses an HTTP response from a DetachAppSecretWithResponse call +func ParseDetachAppSecretResponse(rsp *http.Response) (*DetachAppSecretResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &DeleteAppEnvironmentVariableResponse{ + response := &DetachAppSecretResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -11015,6 +14675,13 @@ func ParseDeleteAppEnvironmentVariableResponse(rsp *http.Response) (*DeleteAppEn } response.ApplicationproblemJSON404 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: + var dest ValidationError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON422 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: var dest ServiceUnavailable if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -11027,26 +14694,26 @@ func ParseDeleteAppEnvironmentVariableResponse(rsp *http.Response) (*DeleteAppEn return response, nil } -// ParseUpdateAppEnvironmentVariableResponse parses an HTTP response from a UpdateAppEnvironmentVariableWithResponse call -func ParseUpdateAppEnvironmentVariableResponse(rsp *http.Response) (*UpdateAppEnvironmentVariableResponse, error) { +// ParseCreateSourceUploadResponse parses an HTTP response from a CreateSourceUploadWithResponse call +func ParseCreateSourceUploadResponse(rsp *http.Response) (*CreateSourceUploadResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &UpdateAppEnvironmentVariableResponse{ + response := &CreateSourceUploadResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest EnvironmentVariable + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest SourceUploadCreation if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON200 = &dest + response.JSON201 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest BadRequest @@ -11069,12 +14736,12 @@ func ParseUpdateAppEnvironmentVariableResponse(rsp *http.Response) (*UpdateAppEn } response.ApplicationproblemJSON403 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: - var dest NotFound + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: + var dest Conflict if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.ApplicationproblemJSON404 = &dest + response.ApplicationproblemJSON409 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: var dest ValidationError @@ -11083,6 +14750,13 @@ func ParseUpdateAppEnvironmentVariableResponse(rsp *http.Response) (*UpdateAppEn } response.ApplicationproblemJSON422 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 502: + var dest BadGateway + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON502 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: var dest ServiceUnavailable if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -11095,31 +14769,29 @@ func ParseUpdateAppEnvironmentVariableResponse(rsp *http.Response) (*UpdateAppEn return response, nil } -// ParseListAppEventsResponse parses an HTTP response from a ListAppEventsWithResponse call -func ParseListAppEventsResponse(rsp *http.Response) (*ListAppEventsResponse, error) { +// ParseDeleteSourceUploadResponse parses an HTTP response from a DeleteSourceUploadWithResponse call +func ParseDeleteSourceUploadResponse(rsp *http.Response) (*DeleteSourceUploadResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ListAppEventsResponse{ + response := &DeleteSourceUploadResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest struct { - Data *[]AppEvent `json:"data,omitempty"` + case rsp.StatusCode == 204: + break // No content-type - // NextCursor Cursor for the next page; null when there are no more items. - NextCursor *string `json:"nextCursor,omitempty"` - } + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest BadRequest if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON200 = &dest + response.ApplicationproblemJSON400 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest Unauthorized @@ -11142,6 +14814,27 @@ func ParseListAppEventsResponse(rsp *http.Response) (*ListAppEventsResponse, err } response.ApplicationproblemJSON404 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: + var dest Conflict + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON409 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: + var dest ValidationError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON422 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 502: + var dest BadGateway + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON502 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: var dest ServiceUnavailable if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -11154,27 +14847,34 @@ func ParseListAppEventsResponse(rsp *http.Response) (*ListAppEventsResponse, err return response, nil } -// ParseUnfavouriteAppResponse parses an HTTP response from a UnfavouriteAppWithResponse call -func ParseUnfavouriteAppResponse(rsp *http.Response) (*UnfavouriteAppResponse, error) { +// ParseGetSourceUploadResponse parses an HTTP response from a GetSourceUploadWithResponse call +func ParseGetSourceUploadResponse(rsp *http.Response) (*GetSourceUploadResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &UnfavouriteAppResponse{ + response := &GetSourceUploadResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest App + var dest SourceUpload if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest BadRequest + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON400 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest Unauthorized if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -11196,6 +14896,13 @@ func ParseUnfavouriteAppResponse(rsp *http.Response) (*UnfavouriteAppResponse, e } response.ApplicationproblemJSON404 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: + var dest ValidationError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON422 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: var dest ServiceUnavailable if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -11208,27 +14915,34 @@ func ParseUnfavouriteAppResponse(rsp *http.Response) (*UnfavouriteAppResponse, e return response, nil } -// ParseFavouriteAppResponse parses an HTTP response from a FavouriteAppWithResponse call -func ParseFavouriteAppResponse(rsp *http.Response) (*FavouriteAppResponse, error) { +// ParseCompleteSourceUploadResponse parses an HTTP response from a CompleteSourceUploadWithResponse call +func ParseCompleteSourceUploadResponse(rsp *http.Response) (*CompleteSourceUploadResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &FavouriteAppResponse{ + response := &CompleteSourceUploadResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest App + var dest SourceUpload if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest BadRequest + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON400 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest Unauthorized if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -11250,6 +14964,27 @@ func ParseFavouriteAppResponse(rsp *http.Response) (*FavouriteAppResponse, error } response.ApplicationproblemJSON404 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: + var dest Conflict + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON409 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: + var dest ValidationError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON422 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 502: + var dest BadGateway + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON502 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: var dest ServiceUnavailable if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -11262,33 +14997,26 @@ func ParseFavouriteAppResponse(rsp *http.Response) (*FavouriteAppResponse, error return response, nil } -// ParseStartAsyncTaskResponse parses an HTTP response from a StartAsyncTaskWithResponse call -func ParseStartAsyncTaskResponse(rsp *http.Response) (*StartAsyncTaskResponse, error) { +// ParseStopAppResponse parses an HTTP response from a StopAppWithResponse call +func ParseStopAppResponse(rsp *http.Response) (*StopAppResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &StartAsyncTaskResponse{ + response := &StopAppResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 202: - var dest TaskAccepted - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON202 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest BadRequest + var dest App if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.ApplicationproblemJSON400 = &dest + response.JSON202 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest Unauthorized @@ -11318,13 +15046,6 @@ func ParseStartAsyncTaskResponse(rsp *http.Response) (*StartAsyncTaskResponse, e } response.ApplicationproblemJSON409 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest ValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.ApplicationproblemJSON422 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: var dest ServiceUnavailable if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -11337,22 +15058,27 @@ func ParseStartAsyncTaskResponse(rsp *http.Response) (*StartAsyncTaskResponse, e return response, nil } -// ParseStartSyncTaskResponse parses an HTTP response from a StartSyncTaskWithResponse call -func ParseStartSyncTaskResponse(rsp *http.Response) (*StartSyncTaskResponse, error) { +// ParseListTasksResponse parses an HTTP response from a ListTasksWithResponse call +func ParseListTasksResponse(rsp *http.Response) (*ListTasksResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &StartSyncTaskResponse{ + response := &ListTasksResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Task + var dest struct { + Data *[]Task `json:"data,omitempty"` + + // NextCursor Cursor for the next page; null when there are no more items. + NextCursor *string `json:"nextCursor,omitempty"` + } if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -11386,13 +15112,6 @@ func ParseStartSyncTaskResponse(rsp *http.Response) (*StartSyncTaskResponse, err } response.ApplicationproblemJSON404 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: - var dest Conflict - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.ApplicationproblemJSON409 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: var dest ValidationError if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -11407,38 +15126,31 @@ func ParseStartSyncTaskResponse(rsp *http.Response) (*StartSyncTaskResponse, err } response.ApplicationproblemJSON503 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 504: - var dest Timeout - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.ApplicationproblemJSON504 = &dest - } return response, nil } -// ParseResumeAppResponse parses an HTTP response from a ResumeAppWithResponse call -func ParseResumeAppResponse(rsp *http.Response) (*ResumeAppResponse, error) { +// ParseGetTaskResponse parses an HTTP response from a GetTaskWithResponse call +func ParseGetTaskResponse(rsp *http.Response) (*GetTaskResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ResumeAppResponse{ + response := &GetTaskResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 202: - var dest App + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Task if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON202 = &dest + response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest Unauthorized @@ -11461,13 +15173,6 @@ func ParseResumeAppResponse(rsp *http.Response) (*ResumeAppResponse, error) { } response.ApplicationproblemJSON404 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: - var dest Conflict - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.ApplicationproblemJSON409 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: var dest ServiceUnavailable if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -11480,15 +15185,15 @@ func ParseResumeAppResponse(rsp *http.Response) (*ResumeAppResponse, error) { return response, nil } -// ParseListAppSecretsResponse parses an HTTP response from a ListAppSecretsWithResponse call -func ParseListAppSecretsResponse(rsp *http.Response) (*ListAppSecretsResponse, error) { +// ParseListVersionsResponse parses an HTTP response from a ListVersionsWithResponse call +func ParseListVersionsResponse(rsp *http.Response) (*ListVersionsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ListAppSecretsResponse{ + response := &ListVersionsResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -11496,23 +15201,19 @@ func ParseListAppSecretsResponse(rsp *http.Response) (*ListAppSecretsResponse, e switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest struct { - Data *[]SecretAttachment `json:"data,omitempty"` + Data []Version `json:"data"` // NextCursor Cursor for the next page; null when there are no more items. NextCursor *string `json:"nextCursor,omitempty"` + + // Summary Collection totals for a paged list. Independent of the page: `total` is the COUNT of items in the collection and is the same value on every page, including a cursor that seeks past the last row. + Summary ListSummary `json:"summary"` } if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest BadRequest - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.ApplicationproblemJSON400 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest Unauthorized if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -11534,13 +15235,6 @@ func ParseListAppSecretsResponse(rsp *http.Response) (*ListAppSecretsResponse, e } response.ApplicationproblemJSON404 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest ValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.ApplicationproblemJSON422 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: var dest ServiceUnavailable if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -11553,15 +15247,15 @@ func ParseListAppSecretsResponse(rsp *http.Response) (*ListAppSecretsResponse, e return response, nil } -// ParseAttachAppSecretResponse parses an HTTP response from a AttachAppSecretWithResponse call -func ParseAttachAppSecretResponse(rsp *http.Response) (*AttachAppSecretResponse, error) { +// ParseDeleteVersionResponse parses an HTTP response from a DeleteVersionWithResponse call +func ParseDeleteVersionResponse(rsp *http.Response) (*DeleteVersionResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &AttachAppSecretResponse{ + response := &DeleteVersionResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -11570,13 +15264,6 @@ func ParseAttachAppSecretResponse(rsp *http.Response) (*AttachAppSecretResponse, case rsp.StatusCode == 204: break // No content-type - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest BadRequest - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.ApplicationproblemJSON400 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest Unauthorized if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -11605,13 +15292,6 @@ func ParseAttachAppSecretResponse(rsp *http.Response) (*AttachAppSecretResponse, } response.ApplicationproblemJSON409 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest ValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.ApplicationproblemJSON422 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: var dest ServiceUnavailable if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -11624,22 +15304,26 @@ func ParseAttachAppSecretResponse(rsp *http.Response) (*AttachAppSecretResponse, return response, nil } -// ParseDetachAppSecretResponse parses an HTTP response from a DetachAppSecretWithResponse call -func ParseDetachAppSecretResponse(rsp *http.Response) (*DetachAppSecretResponse, error) { +// ParseGetVersionResponse parses an HTTP response from a GetVersionWithResponse call +func ParseGetVersionResponse(rsp *http.Response) (*GetVersionResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &DetachAppSecretResponse{ + response := &GetVersionResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case rsp.StatusCode == 204: - break // No content-type + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Version + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest Unauthorized @@ -11662,13 +15346,6 @@ func ParseDetachAppSecretResponse(rsp *http.Response) (*DetachAppSecretResponse, } response.ApplicationproblemJSON404 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest ValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.ApplicationproblemJSON422 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: var dest ServiceUnavailable if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -11681,26 +15358,38 @@ func ParseDetachAppSecretResponse(rsp *http.Response) (*DetachAppSecretResponse, return response, nil } -// ParseStopAppResponse parses an HTTP response from a StopAppWithResponse call -func ParseStopAppResponse(rsp *http.Response) (*StopAppResponse, error) { +// ParseListWorkersResponse parses an HTTP response from a ListWorkersWithResponse call +func ParseListWorkersResponse(rsp *http.Response) (*ListWorkersResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &StopAppResponse{ + response := &ListWorkersResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 202: - var dest App + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + Data *[]Worker `json:"data,omitempty"` + + // NextCursor Cursor for the next page; null when there are no more items. + NextCursor *string `json:"nextCursor,omitempty"` + } if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON202 = &dest + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest BadRequest + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON400 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest Unauthorized @@ -11723,12 +15412,12 @@ func ParseStopAppResponse(rsp *http.Response) (*StopAppResponse, error) { } response.ApplicationproblemJSON404 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: - var dest Conflict + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: + var dest ValidationError if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.ApplicationproblemJSON409 = &dest + response.ApplicationproblemJSON422 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: var dest ServiceUnavailable @@ -11742,27 +15431,22 @@ func ParseStopAppResponse(rsp *http.Response) (*StopAppResponse, error) { return response, nil } -// ParseListTasksResponse parses an HTTP response from a ListTasksWithResponse call -func ParseListTasksResponse(rsp *http.Response) (*ListTasksResponse, error) { +// ParseGetWorkerResponse parses an HTTP response from a GetWorkerWithResponse call +func ParseGetWorkerResponse(rsp *http.Response) (*GetWorkerResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ListTasksResponse{ + response := &GetWorkerResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest struct { - Data *[]Task `json:"data,omitempty"` - - // NextCursor Cursor for the next page; null when there are no more items. - NextCursor *string `json:"nextCursor,omitempty"` - } + var dest Worker if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -11815,22 +15499,22 @@ func ParseListTasksResponse(rsp *http.Response) (*ListTasksResponse, error) { return response, nil } -// ParseGetTaskResponse parses an HTTP response from a GetTaskWithResponse call -func ParseGetTaskResponse(rsp *http.Response) (*GetTaskResponse, error) { +// ParseListGpuTypesResponse parses an HTTP response from a ListGpuTypesWithResponse call +func ParseListGpuTypesResponse(rsp *http.Response) (*ListGpuTypesResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetTaskResponse{ + response := &ListGpuTypesResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Task + var dest GpuTypeList if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -11850,13 +15534,6 @@ func ParseGetTaskResponse(rsp *http.Response) (*GetTaskResponse, error) { } response.ApplicationproblemJSON403 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: - var dest NotFound - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.ApplicationproblemJSON404 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: var dest ServiceUnavailable if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -11869,31 +15546,33 @@ func ParseGetTaskResponse(rsp *http.Response) (*GetTaskResponse, error) { return response, nil } -// ParseListVersionsResponse parses an HTTP response from a ListVersionsWithResponse call -func ParseListVersionsResponse(rsp *http.Response) (*ListVersionsResponse, error) { +// ParseCreateGpuTypeResponse parses an HTTP response from a CreateGpuTypeWithResponse call +func ParseCreateGpuTypeResponse(rsp *http.Response) (*CreateGpuTypeResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ListVersionsResponse{ + response := &CreateGpuTypeResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest struct { - Data *[]Version `json:"data,omitempty"` - - // NextCursor Cursor for the next page; null when there are no more items. - NextCursor *string `json:"nextCursor,omitempty"` + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest GpuType + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest BadRequest if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON200 = &dest + response.ApplicationproblemJSON400 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest Unauthorized @@ -11909,12 +15588,19 @@ func ParseListVersionsResponse(rsp *http.Response) (*ListVersionsResponse, error } response.ApplicationproblemJSON403 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: - var dest NotFound + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: + var dest Conflict if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.ApplicationproblemJSON404 = &dest + response.ApplicationproblemJSON409 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: + var dest ValidationError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON422 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: var dest ServiceUnavailable @@ -11928,26 +15614,22 @@ func ParseListVersionsResponse(rsp *http.Response) (*ListVersionsResponse, error return response, nil } -// ParseGetVersionResponse parses an HTTP response from a GetVersionWithResponse call -func ParseGetVersionResponse(rsp *http.Response) (*GetVersionResponse, error) { +// ParseDeleteGpuTypeResponse parses an HTTP response from a DeleteGpuTypeWithResponse call +func ParseDeleteGpuTypeResponse(rsp *http.Response) (*DeleteGpuTypeResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetVersionResponse{ + response := &DeleteGpuTypeResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Version - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest + case rsp.StatusCode == 204: + break // No content-type case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest Unauthorized @@ -11970,6 +15652,20 @@ func ParseGetVersionResponse(rsp *http.Response) (*GetVersionResponse, error) { } response.ApplicationproblemJSON404 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: + var dest Conflict + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON409 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: + var dest ValidationError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON422 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: var dest ServiceUnavailable if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -11982,39 +15678,27 @@ func ParseGetVersionResponse(rsp *http.Response) (*GetVersionResponse, error) { return response, nil } -// ParseListWorkersResponse parses an HTTP response from a ListWorkersWithResponse call -func ParseListWorkersResponse(rsp *http.Response) (*ListWorkersResponse, error) { +// ParseGetGpuTypeResponse parses an HTTP response from a GetGpuTypeWithResponse call +func ParseGetGpuTypeResponse(rsp *http.Response) (*GetGpuTypeResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ListWorkersResponse{ + response := &GetGpuTypeResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest struct { - Data *[]Worker `json:"data,omitempty"` - - // NextCursor Cursor for the next page; null when there are no more items. - NextCursor *string `json:"nextCursor,omitempty"` - } + var dest GpuType if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest BadRequest - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.ApplicationproblemJSON400 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest Unauthorized if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -12055,22 +15739,22 @@ func ParseListWorkersResponse(rsp *http.Response) (*ListWorkersResponse, error) return response, nil } -// ParseGetWorkerResponse parses an HTTP response from a GetWorkerWithResponse call -func ParseGetWorkerResponse(rsp *http.Response) (*GetWorkerResponse, error) { +// ParseUpdateGpuTypeResponse parses an HTTP response from a UpdateGpuTypeWithResponse call +func ParseUpdateGpuTypeResponse(rsp *http.Response) (*UpdateGpuTypeResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetWorkerResponse{ + response := &UpdateGpuTypeResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Worker + var dest GpuType if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -12123,27 +15807,39 @@ func ParseGetWorkerResponse(rsp *http.Response) (*GetWorkerResponse, error) { return response, nil } -// ParseListGpuTypesResponse parses an HTTP response from a ListGpuTypesWithResponse call -func ParseListGpuTypesResponse(rsp *http.Response) (*ListGpuTypesResponse, error) { +// ParseListGpuTypePricesResponse parses an HTTP response from a ListGpuTypePricesWithResponse call +func ParseListGpuTypePricesResponse(rsp *http.Response) (*ListGpuTypePricesResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ListGpuTypesResponse{ + response := &ListGpuTypePricesResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest GpuTypeList + var dest struct { + Data *[]GpuPricingListItem `json:"data,omitempty"` + + // NextCursor Cursor for the next page; null when there are no more items. + NextCursor *string `json:"nextCursor,omitempty"` + } if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest BadRequest + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON400 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest Unauthorized if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -12158,34 +15854,41 @@ func ParseListGpuTypesResponse(rsp *http.Response) (*ListGpuTypesResponse, error } response.ApplicationproblemJSON403 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: - var dest ServiceUnavailable + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest NotFound if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.ApplicationproblemJSON503 = &dest + response.ApplicationproblemJSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: + var dest ValidationError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON422 = &dest } return response, nil } -// ParseCreateGpuTypeResponse parses an HTTP response from a CreateGpuTypeWithResponse call -func ParseCreateGpuTypeResponse(rsp *http.Response) (*CreateGpuTypeResponse, error) { +// ParseCreateGpuTypePriceResponse parses an HTTP response from a CreateGpuTypePriceWithResponse call +func ParseCreateGpuTypePriceResponse(rsp *http.Response) (*CreateGpuTypePriceResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &CreateGpuTypeResponse{ + response := &CreateGpuTypePriceResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: - var dest GpuType + var dest GpuPricing if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -12212,6 +15915,13 @@ func ParseCreateGpuTypeResponse(rsp *http.Response) (*CreateGpuTypeResponse, err } response.ApplicationproblemJSON403 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest NotFound + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON404 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: var dest Conflict if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -12226,27 +15936,20 @@ func ParseCreateGpuTypeResponse(rsp *http.Response) (*CreateGpuTypeResponse, err } response.ApplicationproblemJSON422 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: - var dest ServiceUnavailable - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.ApplicationproblemJSON503 = &dest - } return response, nil } -// ParseDeleteGpuTypeResponse parses an HTTP response from a DeleteGpuTypeWithResponse call -func ParseDeleteGpuTypeResponse(rsp *http.Response) (*DeleteGpuTypeResponse, error) { +// ParseDeleteGpuTypePriceResponse parses an HTTP response from a DeleteGpuTypePriceWithResponse call +func ParseDeleteGpuTypePriceResponse(rsp *http.Response) (*DeleteGpuTypePriceResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &DeleteGpuTypeResponse{ + response := &DeleteGpuTypePriceResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -12255,6 +15958,13 @@ func ParseDeleteGpuTypeResponse(rsp *http.Response) (*DeleteGpuTypeResponse, err case rsp.StatusCode == 204: break // No content-type + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest BadRequest + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON400 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest Unauthorized if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -12290,39 +16000,39 @@ func ParseDeleteGpuTypeResponse(rsp *http.Response) (*DeleteGpuTypeResponse, err } response.ApplicationproblemJSON422 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: - var dest ServiceUnavailable - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.ApplicationproblemJSON503 = &dest - } return response, nil } -// ParseGetGpuTypeResponse parses an HTTP response from a GetGpuTypeWithResponse call -func ParseGetGpuTypeResponse(rsp *http.Response) (*GetGpuTypeResponse, error) { +// ParseUpdateGpuTypePriceResponse parses an HTTP response from a UpdateGpuTypePriceWithResponse call +func ParseUpdateGpuTypePriceResponse(rsp *http.Response) (*UpdateGpuTypePriceResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetGpuTypeResponse{ + response := &UpdateGpuTypePriceResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest GpuType + var dest GpuPricing if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest BadRequest + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON400 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest Unauthorized if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -12344,41 +16054,41 @@ func ParseGetGpuTypeResponse(rsp *http.Response) (*GetGpuTypeResponse, error) { } response.ApplicationproblemJSON404 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest ValidationError + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: + var dest Conflict if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.ApplicationproblemJSON422 = &dest + response.ApplicationproblemJSON409 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: - var dest ServiceUnavailable + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: + var dest ValidationError if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.ApplicationproblemJSON503 = &dest + response.ApplicationproblemJSON422 = &dest } return response, nil } -// ParseUpdateGpuTypeResponse parses an HTTP response from a UpdateGpuTypeWithResponse call -func ParseUpdateGpuTypeResponse(rsp *http.Response) (*UpdateGpuTypeResponse, error) { +// ParseGetLogEntriesResponse parses an HTTP response from a GetLogEntriesWithResponse call +func ParseGetLogEntriesResponse(rsp *http.Response) (*GetLogEntriesResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &UpdateGpuTypeResponse{ + response := &GetLogEntriesResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest GpuType + var dest LogEntryPage if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -12419,6 +16129,20 @@ func ParseUpdateGpuTypeResponse(rsp *http.Response) (*UpdateGpuTypeResponse, err } response.ApplicationproblemJSON422 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: + var dest TooManyRequests + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON429 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 502: + var dest BadGateway + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON502 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: var dest ServiceUnavailable if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -12426,44 +16150,52 @@ func ParseUpdateGpuTypeResponse(rsp *http.Response) (*UpdateGpuTypeResponse, err } response.ApplicationproblemJSON503 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 504: + var dest GatewayTimeout + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON504 = &dest + + } + + switch { + case rsp.StatusCode == 429: + var headers GetLogEntriesResponse429Headers + if values := rsp.Header.Values("Retry-After"); len(values) > 0 { + var value int32 + if err := runtime.BindStyledParameterWithOptions("simple", "Retry-After", values[0], &value, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: true, Type: "integer", Format: "int32"}); err != nil { + return nil, err + } + headers.RetryAfter = value + } + response.Headers429 = &headers } return response, nil } -// ParseListGpuTypePricesResponse parses an HTTP response from a ListGpuTypePricesWithResponse call -func ParseListGpuTypePricesResponse(rsp *http.Response) (*ListGpuTypePricesResponse, error) { +// ParseListInsightsQueriesResponse parses an HTTP response from a ListInsightsQueriesWithResponse call +func ParseListInsightsQueriesResponse(rsp *http.Response) (*ListInsightsQueriesResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ListGpuTypePricesResponse{ + response := &ListInsightsQueriesResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest struct { - Data *[]GpuPricingListItem `json:"data,omitempty"` - - // NextCursor Cursor for the next page; null when there are no more items. - NextCursor *string `json:"nextCursor,omitempty"` - } + var dest QueryCatalogue if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest BadRequest - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.ApplicationproblemJSON400 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest Unauthorized if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -12478,45 +16210,52 @@ func ParseListGpuTypePricesResponse(rsp *http.Response) (*ListGpuTypePricesRespo } response.ApplicationproblemJSON403 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: - var dest NotFound + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 502: + var dest BadGateway if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.ApplicationproblemJSON404 = &dest + response.ApplicationproblemJSON502 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest ValidationError + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: + var dest ServiceUnavailable if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.ApplicationproblemJSON422 = &dest + response.ApplicationproblemJSON503 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 504: + var dest GatewayTimeout + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationproblemJSON504 = &dest } return response, nil } -// ParseCreateGpuTypePriceResponse parses an HTTP response from a CreateGpuTypePriceWithResponse call -func ParseCreateGpuTypePriceResponse(rsp *http.Response) (*CreateGpuTypePriceResponse, error) { +// ParseGetMetricSeriesResponse parses an HTTP response from a GetMetricSeriesWithResponse call +func ParseGetMetricSeriesResponse(rsp *http.Response) (*GetMetricSeriesResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &CreateGpuTypePriceResponse{ + response := &GetMetricSeriesResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: - var dest GpuPricing + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest MetricSeries if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON201 = &dest + response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest BadRequest @@ -12546,13 +16285,6 @@ func ParseCreateGpuTypePriceResponse(rsp *http.Response) (*CreateGpuTypePriceRes } response.ApplicationproblemJSON404 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: - var dest Conflict - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.ApplicationproblemJSON409 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: var dest ValidationError if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -12560,91 +16292,68 @@ func ParseCreateGpuTypePriceResponse(rsp *http.Response) (*CreateGpuTypePriceRes } response.ApplicationproblemJSON422 = &dest - } - - return response, nil -} - -// ParseDeleteGpuTypePriceResponse parses an HTTP response from a DeleteGpuTypePriceWithResponse call -func ParseDeleteGpuTypePriceResponse(rsp *http.Response) (*DeleteGpuTypePriceResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &DeleteGpuTypePriceResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case rsp.StatusCode == 204: - break // No content-type - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest BadRequest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: + var dest TooManyRequests if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.ApplicationproblemJSON400 = &dest + response.ApplicationproblemJSON429 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: - var dest Unauthorized + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 502: + var dest BadGateway if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.ApplicationproblemJSON401 = &dest + response.ApplicationproblemJSON502 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: - var dest Forbidden + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: + var dest ServiceUnavailable if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.ApplicationproblemJSON403 = &dest + response.ApplicationproblemJSON503 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: - var dest NotFound + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 504: + var dest GatewayTimeout if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.ApplicationproblemJSON404 = &dest + response.ApplicationproblemJSON504 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: - var dest Conflict - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.ApplicationproblemJSON409 = &dest + } - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest ValidationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err + switch { + case rsp.StatusCode == 429: + var headers GetMetricSeriesResponse429Headers + if values := rsp.Header.Values("Retry-After"); len(values) > 0 { + var value int32 + if err := runtime.BindStyledParameterWithOptions("simple", "Retry-After", values[0], &value, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: true, Type: "integer", Format: "int32"}); err != nil { + return nil, err + } + headers.RetryAfter = value } - response.ApplicationproblemJSON422 = &dest - + response.Headers429 = &headers } return response, nil } -// ParseUpdateGpuTypePriceResponse parses an HTTP response from a UpdateGpuTypePriceWithResponse call -func ParseUpdateGpuTypePriceResponse(rsp *http.Response) (*UpdateGpuTypePriceResponse, error) { +// ParseUpsertOrgTenancyResponse parses an HTTP response from a UpsertOrgTenancyWithResponse call +func ParseUpsertOrgTenancyResponse(rsp *http.Response) (*UpsertOrgTenancyResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &UpdateGpuTypePriceResponse{ + response := &UpsertOrgTenancyResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest GpuPricing + var dest OrgTenancy if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -12671,26 +16380,19 @@ func ParseUpdateGpuTypePriceResponse(rsp *http.Response) (*UpdateGpuTypePriceRes } response.ApplicationproblemJSON403 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: - var dest NotFound - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.ApplicationproblemJSON404 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: - var dest Conflict + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: + var dest ValidationError if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.ApplicationproblemJSON409 = &dest + response.ApplicationproblemJSON422 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest ValidationError + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: + var dest ServiceUnavailable if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.ApplicationproblemJSON422 = &dest + response.ApplicationproblemJSON503 = &dest } diff --git a/internal/api/serverless/sourceuploads.go b/internal/api/serverless/sourceuploads.go new file mode 100644 index 0000000..f85399e --- /dev/null +++ b/internal/api/serverless/sourceuploads.go @@ -0,0 +1,195 @@ +package serverless + +import ( + "bytes" + "context" + "fmt" + "net/http" + "time" + + "github.com/runware/runware-cli/internal/api/serverless/gen" + "github.com/runware/runware-cli/internal/api/transport" +) + +// SourceUpload is one upload session for an app's source archive. +type SourceUpload = gen.SourceUpload + +// SourceUploadCreate declares the archive a session is opened for. +type SourceUploadCreate = gen.SourceUploadCreate + +// SourceUploadCreation is a new session plus the transfer instruction for it. +type SourceUploadCreation = gen.SourceUploadCreation + +// SourceUploadID identifies an upload session. +type SourceUploadID = gen.SourceUploadId + +// SourceUploadState is the lifecycle state of an upload session. +type SourceUploadState = gen.SourceUploadState + +// SourceUploadTransfer is the instruction for staging one archive. +type SourceUploadTransfer = gen.SourceUploadTransfer + +// transferTimeout bounds the archive transfer, which is the one request in a +// deploy that carries the whole codebase. +const transferTimeout = 5 * time.Minute + +// SourceUploadStateReady is the state a session reaches once completion has +// verified the staged archive against the declaration. +const SourceUploadStateReady = gen.SourceUploadStateReady + +// CreateSourceUpload opens an upload session for appId, which need not exist +// yet, and returns it with a short-lived instruction for staging the archive. +func (c *Client) CreateSourceUpload(ctx context.Context, appID string, body SourceUploadCreate) (*SourceUploadCreation, error) { + if c.apiKey == "" { + return nil, transport.ErrNoAPIKey + } + + resp, err := c.inner.CreateSourceUploadWithResponse(ctx, appID, body) + if err != nil { + return nil, fmt.Errorf("create source upload: %w", err) + } + + c.logResponse(ctx, resp.HTTPResponse, resp.Body) + + switch resp.StatusCode() { + case http.StatusCreated: + if resp.JSON201 == nil { + return nil, fmt.Errorf("create source upload: empty 201 response") + } + return resp.JSON201, nil + case http.StatusBadRequest: + return nil, problemToError(resp.ApplicationproblemJSON400, http.StatusBadRequest) + case http.StatusUnauthorized: + return nil, problemToError(resp.ApplicationproblemJSON401, http.StatusUnauthorized) + case http.StatusForbidden: + return nil, problemToError(resp.ApplicationproblemJSON403, http.StatusForbidden) + case http.StatusConflict: + return nil, problemToError(resp.ApplicationproblemJSON409, http.StatusConflict) + case http.StatusUnprocessableEntity: + return nil, problemToError(resp.ApplicationproblemJSON422, http.StatusUnprocessableEntity) + default: + return nil, problemFromBody(resp.Body, resp.StatusCode()) + } +} + +// StageSourceArchive sends the archive to the staging object the transfer +// instruction names. +// +// The request is issued through the bare doer rather than the generated client: +// the URL carries its own signature, and the Authorization header the generated +// client attaches to every call would invalidate it. Only the headers the +// instruction lists are sent. +func (c *Client) StageSourceArchive(ctx context.Context, transfer SourceUploadTransfer, archive []byte) error { + put, err := transfer.AsSourceUploadSinglePutTransfer() + if err != nil { + return fmt.Errorf("stage source archive: %w", err) + } + + req, err := http.NewRequestWithContext(ctx, string(put.Method), put.Url, bytes.NewReader(archive)) + if err != nil { + return fmt.Errorf("stage source archive: %w", err) + } + for name, value := range put.Headers { + req.Header.Set(name, value) + } + // Set explicitly: a bytes.Reader body would otherwise be sent chunked, and + // completion verifies the staged object's exact length. + req.ContentLength = int64(len(archive)) + + resp, err := c.transferDoer().Do(req) + if err != nil { + return fmt.Errorf("stage source archive: %w", err) + } + defer func() { _ = resp.Body.Close() }() + + if resp.StatusCode < 200 || resp.StatusCode > 299 { + return fmt.Errorf("stage source archive: %s", resp.Status) + } + return nil +} + +// CompleteSourceUpload asks the API to verify the staged archive against the +// session declaration and returns the session in its settled state. +func (c *Client) CompleteSourceUpload(ctx context.Context, appID string, uploadID SourceUploadID) (*SourceUpload, error) { + if c.apiKey == "" { + return nil, transport.ErrNoAPIKey + } + + resp, err := c.inner.CompleteSourceUploadWithResponse(ctx, appID, uploadID) + if err != nil { + return nil, fmt.Errorf("complete source upload: %w", err) + } + + c.logResponse(ctx, resp.HTTPResponse, resp.Body) + + switch resp.StatusCode() { + case http.StatusOK: + if resp.JSON200 == nil { + return nil, fmt.Errorf("complete source upload: empty 200 response") + } + return resp.JSON200, nil + case http.StatusBadRequest: + return nil, problemToError(resp.ApplicationproblemJSON400, http.StatusBadRequest) + case http.StatusUnauthorized: + return nil, problemToError(resp.ApplicationproblemJSON401, http.StatusUnauthorized) + case http.StatusForbidden: + return nil, problemToError(resp.ApplicationproblemJSON403, http.StatusForbidden) + case http.StatusNotFound: + return nil, problemToError(resp.ApplicationproblemJSON404, http.StatusNotFound) + case http.StatusConflict: + return nil, problemToError(resp.ApplicationproblemJSON409, http.StatusConflict) + case http.StatusUnprocessableEntity: + return nil, problemToError(resp.ApplicationproblemJSON422, http.StatusUnprocessableEntity) + default: + return nil, problemFromBody(resp.Body, resp.StatusCode()) + } +} + +// DeleteSourceUpload aborts an unconsumed session and removes its staging +// object. Repeating a successful abort is idempotent. +func (c *Client) DeleteSourceUpload(ctx context.Context, appID string, uploadID SourceUploadID) error { + if c.apiKey == "" { + return transport.ErrNoAPIKey + } + + resp, err := c.inner.DeleteSourceUploadWithResponse(ctx, appID, uploadID) + if err != nil { + return fmt.Errorf("delete source upload: %w", err) + } + + c.logResponse(ctx, resp.HTTPResponse, resp.Body) + + switch resp.StatusCode() { + case http.StatusNoContent: + return nil + case http.StatusBadRequest: + return problemToError(resp.ApplicationproblemJSON400, http.StatusBadRequest) + case http.StatusUnauthorized: + return problemToError(resp.ApplicationproblemJSON401, http.StatusUnauthorized) + case http.StatusForbidden: + return problemToError(resp.ApplicationproblemJSON403, http.StatusForbidden) + case http.StatusNotFound: + return problemToError(resp.ApplicationproblemJSON404, http.StatusNotFound) + case http.StatusConflict: + return problemToError(resp.ApplicationproblemJSON409, http.StatusConflict) + case http.StatusUnprocessableEntity: + return problemToError(resp.ApplicationproblemJSON422, http.StatusUnprocessableEntity) + default: + return problemFromBody(resp.Body, resp.StatusCode()) + } +} + +// transferDoer returns a doer with the archive transfer's longer deadline. The +// same reasoning as createInner, for the request that now carries the bytes. +func (c *Client) transferDoer() gen.HttpRequestDoer { + hc, ok := c.doer.(*http.Client) + if !ok { + return c.doer + } + if hc.Timeout == 0 || hc.Timeout >= transferTimeout { + return hc + } + cloned := *hc + cloned.Timeout = transferTimeout + return &cloned +} diff --git a/internal/cmd/serverless/deploy.go b/internal/cmd/serverless/deploy.go index 69bf5c4..c9c1ba6 100644 --- a/internal/cmd/serverless/deploy.go +++ b/internal/cmd/serverless/deploy.go @@ -89,7 +89,7 @@ serverless init' is planned). Endpoints are derived server-side from the SDK.`, name = id } - zipBase64, modelFile, err := packDirectory(srcDir, entryFile) + archive, modelFile, err := packDirectory(srcDir, entryFile) if err != nil { return err } @@ -104,11 +104,20 @@ serverless init' is planned). Endpoints are derived server-side from the SDK.`, return err } + client := serverlessapi.NewClient(config.GetAPIKey(), config.GetServerlessBaseURL(), slog.New(logger)) + + spin := cmdutil.NewSpinner(fmt.Sprintf("Uploading source for %s...", id)) + spin.Start() + uploadID, err := uploadSource(cmd.Context(), client, id, archive, modelFile) + spin.Stop() + if err != nil { + return err + } + source, err := serverlessapi.NewCodeAppSource(serverlessapi.CodeSourceUpsert{ BaseImage: baseImage, Codebase: serverlessapi.CodebaseSource{ - ModelFile: modelFile, - ZipBase64: zipBase64, + UploadId: uploadID, }, Requirements: optionalStringSlice(requirements), }) @@ -132,10 +141,9 @@ serverless init' is planned). Endpoints are derived server-side from the SDK.`, }, } - spin := cmdutil.NewSpinner(fmt.Sprintf("Creating application %s...", id)) + spin = cmdutil.NewSpinner(fmt.Sprintf("Creating application %s...", id)) spin.Start() - client := serverlessapi.NewClient(config.GetAPIKey(), config.GetServerlessBaseURL(), slog.New(logger)) app, err := client.CreateApp(cmd.Context(), body) if err != nil { spin.Stop() diff --git a/internal/cmd/serverless/pack.go b/internal/cmd/serverless/pack.go index 78802d1..5e9c293 100644 --- a/internal/cmd/serverless/pack.go +++ b/internal/cmd/serverless/pack.go @@ -3,7 +3,6 @@ package serverless import ( "archive/zip" "bytes" - "encoding/base64" "fmt" "io" "io/fs" @@ -80,45 +79,45 @@ func alwaysExcluded(segments []string) bool { return false } -// packDirectory zips srcDir and returns the base64-encoded archive plus the path -// of modelFile inside it. +// packDirectory zips srcDir and returns the archive bytes plus the path of +// modelFile inside it. // // srcDir is the archive root: every path in the zip is relative to it, which is // what the builder puts on PYTHONPATH and hands to MLflow code_paths, so the // project's own imports resolve at build and serve time exactly as they do // locally. An empty srcDir means the working directory. -func packDirectory(srcDir, modelFile string) (zipBase64, modelFileRel string, err error) { +func packDirectory(srcDir, modelFile string) (archive []byte, modelFileRel string, err error) { root, err := resolveSrcDir(srcDir) if err != nil { - return "", "", err + return nil, "", err } modelFileRel, err = relativeModelFile(root, modelFile) if err != nil { - return "", "", err + return nil, "", err } matcher, err := loadIgnoreMatcher(root) if err != nil { - return "", "", err + return nil, "", err } files, err := collectFiles(root, modelFileRel, matcher) if err != nil { - return "", "", err + return nil, "", err } if len(files) == 0 { // Unreachable while the model file is forced in, but a packer that can // return an empty archive should say so rather than let the builder // answer with a 422 about a missing model file. - return "", "", fmt.Errorf("no files to pack under %q", root) + return nil, "", fmt.Errorf("no files to pack under %q", root) } raw, err := writeArchive(root, files) if err != nil { - return "", "", err + return nil, "", err } - return base64.StdEncoding.EncodeToString(raw), modelFileRel, nil + return raw, modelFileRel, nil } // resolveSrcDir defaults an empty srcDir to the working directory and checks it diff --git a/internal/cmd/serverless/pack_test.go b/internal/cmd/serverless/pack_test.go index b820718..44b108a 100644 --- a/internal/cmd/serverless/pack_test.go +++ b/internal/cmd/serverless/pack_test.go @@ -3,7 +3,6 @@ package serverless import ( "archive/zip" "bytes" - "encoding/base64" "io" "os" "path/filepath" @@ -28,13 +27,9 @@ func writeTree(t *testing.T, dir string, files map[string]string) { } } -// unpack decodes an archive into path -> contents. -func unpack(t *testing.T, encoded string) map[string]string { +// unpack reads an archive into path -> contents. +func unpack(t *testing.T, raw []byte) map[string]string { t.Helper() - raw, err := base64.StdEncoding.DecodeString(encoded) - if err != nil { - t.Fatalf("decode: %v", err) - } zr, err := zip.NewReader(bytes.NewReader(raw), int64(len(raw))) if err != nil { t.Fatalf("zip.NewReader: %v", err) @@ -399,7 +394,7 @@ func TestPackDirectory_Deterministic(t *testing.T) { if err != nil { t.Fatalf("packDirectory: %v", err) } - if first != second { + if !bytes.Equal(first, second) { t.Error("packing the same tree twice produced different archives") } } @@ -625,14 +620,10 @@ func TestPackDirectory_PreservesFileMode(t *testing.T) { t.Fatal(err) } - encoded, _, err := packDirectory(dir, testModelFile) + raw, _, err := packDirectory(dir, testModelFile) if err != nil { t.Fatalf("packDirectory: %v", err) } - raw, err := base64.StdEncoding.DecodeString(encoded) - if err != nil { - t.Fatal(err) - } zr, err := zip.NewReader(bytes.NewReader(raw), int64(len(raw))) if err != nil { t.Fatal(err) diff --git a/internal/cmd/serverless/upload.go b/internal/cmd/serverless/upload.go new file mode 100644 index 0000000..f2919d0 --- /dev/null +++ b/internal/cmd/serverless/upload.go @@ -0,0 +1,62 @@ +package serverless + +import ( + "context" + "crypto/sha256" + "encoding/hex" + "fmt" + + "github.com/google/uuid" + serverlessapi "github.com/runware/runware-cli/internal/api/serverless" +) + +// uploadSource stages an app's source archive and returns the id of the ready +// upload for the create request to consume. +// +// Three steps, because the archive never travels through the API itself: the +// session declares what is coming, the bytes go straight to the staging object +// the API names, and completion is what opens the archive and verifies it +// against the declaration. Only then does the upload id mean anything to a +// create. +func uploadSource(ctx context.Context, client *serverlessapi.Client, appID string, archive []byte, modelFile string) (uuid.UUID, error) { + digest := sha256.Sum256(archive) + + created, err := client.CreateSourceUpload(ctx, appID, serverlessapi.SourceUploadCreate{ + DeclaredByteLength: int64(len(archive)), + // The digest doubles as the idempotency key: retrying the same deploy + // declares the same archive, and anything else is a different upload. + IdempotencyKey: hex.EncodeToString(digest[:]), + Sha256: hex.EncodeToString(digest[:]), + SourceType: serverlessapi.AppSourceTypeCode, + ModelFile: &modelFile, + }) + if err != nil { + return uuid.Nil, err + } + + if err := client.StageSourceArchive(ctx, created.Transfer, archive); err != nil { + // The session holds a staging object that will now never be completed, + // so give it back rather than leaving it to expire. A failure here is + // not the one worth reporting. + _ = client.DeleteSourceUpload(ctx, appID, created.Upload.Id) + return uuid.Nil, err + } + + upload, err := client.CompleteSourceUpload(ctx, appID, created.Upload.Id) + if err != nil { + return uuid.Nil, err + } + if upload.State != serverlessapi.SourceUploadStateReady { + return uuid.Nil, fmt.Errorf("source upload %s: %s", upload.State, rejectionReason(upload)) + } + return upload.Id, nil +} + +// rejectionReason reports why completion refused an archive, for the states +// that carry one. +func rejectionReason(upload *serverlessapi.SourceUpload) string { + if upload.RejectionReason == nil || *upload.RejectionReason == "" { + return "no reason given" + } + return *upload.RejectionReason +} diff --git a/internal/cmd/serverless/upload_test.go b/internal/cmd/serverless/upload_test.go new file mode 100644 index 0000000..4073cbb --- /dev/null +++ b/internal/cmd/serverless/upload_test.go @@ -0,0 +1,244 @@ +package serverless + +import ( + "bytes" + "context" + "crypto/sha256" + "encoding/hex" + "encoding/json" + "io" + "log/slog" + "net/http" + "net/http/httptest" + "strings" + "testing" + + serverlessapi "github.com/runware/runware-cli/internal/api/serverless" +) + +const uploadTestAppID = "my-app" + +// TestUploadSource_StagesTheArchiveAndReturnsAReadyUpload walks the three steps +// a deploy now takes before it can create an app, and pins what each one sends: +// the declaration has to describe the archive the transfer then carries, or +// completion refuses it. +func TestUploadSource_StagesTheArchiveAndReturnsAReadyUpload(t *testing.T) { + archive := []byte("a zip, near enough") + digest := sha256.Sum256(archive) + wantSHA := hex.EncodeToString(digest[:]) + + var staged []byte + var declaration serverlessapi.SourceUploadCreate + var completed bool + + stage := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if r.Method != http.MethodPut { + t.Errorf("staging method = %s, want PUT", r.Method) + } + // The signed URL carries its own credential; an Authorization header + // would invalidate it. + if auth := r.Header.Get("Authorization"); auth != "" { + t.Errorf("staging request carried Authorization: %q", auth) + } + if got := r.Header.Get("Content-Type"); got != "application/zip" { + t.Errorf("Content-Type = %q, want the header the instruction named", got) + } + body, err := io.ReadAll(r.Body) + if err != nil { + t.Fatalf("read staged body: %v", err) + } + staged = body + w.WriteHeader(http.StatusOK) + })) + defer stage.Close() + + api := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + switch { + case r.Method == http.MethodPost && r.URL.Path == "/v1/apps/"+uploadTestAppID+"/source-uploads": + if err := json.NewDecoder(r.Body).Decode(&declaration); err != nil { + t.Fatalf("decode declaration: %v", err) + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusCreated) + _, _ = w.Write([]byte(`{ + "upload": { + "id": "019c7654-8b21-7abc-9123-abcdef123456", + "appId": "` + uploadTestAppID + `", + "declaredByteLength": 18, + "sha256": "` + wantSHA + `", + "sourceType": "code", + "state": "pending", + "expiresAt": "2026-09-02T12:00:00Z", + "createdAt": "2026-09-02T11:00:00Z", + "updatedAt": "2026-09-02T11:00:00Z" + }, + "transfer": { + "mode": "singlePut", + "method": "PUT", + "url": "` + stage.URL + `/staging-object", + "headers": {"Content-Type": "application/zip"}, + "expiresAt": "2026-09-02T12:00:00Z" + } + }`)) + case r.Method == http.MethodPost && strings.HasSuffix(r.URL.Path, "/complete"): + completed = true + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write([]byte(`{ + "id": "019c7654-8b21-7abc-9123-abcdef123456", + "appId": "` + uploadTestAppID + `", + "declaredByteLength": 18, + "sha256": "` + wantSHA + `", + "sourceType": "code", + "state": "ready", + "expiresAt": "2026-09-02T12:00:00Z", + "createdAt": "2026-09-02T11:00:00Z", + "updatedAt": "2026-09-02T11:00:00Z" + }`)) + default: + t.Errorf("unexpected request: %s %s", r.Method, r.URL.Path) + w.WriteHeader(http.StatusNotFound) + } + })) + defer api.Close() + + client := serverlessapi.NewClient("test-key", api.URL, slog.Default()) + id, err := uploadSource(context.Background(), client, uploadTestAppID, archive, "model.py") + if err != nil { + t.Fatalf("uploadSource: %v", err) + } + + if id.String() != "019c7654-8b21-7abc-9123-abcdef123456" { + t.Errorf("upload id = %s, want the id completion settled", id) + } + if !completed { + t.Error("the upload was never completed, so no create could consume it") + } + if !bytes.Equal(staged, archive) { + t.Errorf("staged %q, want the archive itself", staged) + } + if declaration.Sha256 != wantSHA { + t.Errorf("declared sha256 = %q, want %q", declaration.Sha256, wantSHA) + } + if declaration.DeclaredByteLength != int64(len(archive)) { + t.Errorf("declared length = %d, want %d", declaration.DeclaredByteLength, len(archive)) + } + if declaration.ModelFile == nil || *declaration.ModelFile != "model.py" { + t.Errorf("declared modelFile = %v, want model.py", declaration.ModelFile) + } + if declaration.SourceType != serverlessapi.AppSourceTypeCode { + t.Errorf("declared sourceType = %q, want code", declaration.SourceType) + } +} + +// TestUploadSource_AbortsTheSessionWhenStagingFails keeps a failed transfer +// from leaving a staging object behind to expire on its own. +func TestUploadSource_AbortsTheSessionWhenStagingFails(t *testing.T) { + stage := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { + w.WriteHeader(http.StatusForbidden) + })) + defer stage.Close() + + aborted := false + api := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + switch r.Method { + case http.MethodPost: + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusCreated) + _, _ = w.Write([]byte(`{ + "upload": { + "id": "019c7654-8b21-7abc-9123-abcdef123456", + "appId": "` + uploadTestAppID + `", + "declaredByteLength": 3, + "sha256": "` + strings.Repeat("a", 64) + `", + "sourceType": "code", + "state": "pending", + "expiresAt": "2026-09-02T12:00:00Z", + "createdAt": "2026-09-02T11:00:00Z", + "updatedAt": "2026-09-02T11:00:00Z" + }, + "transfer": { + "mode": "singlePut", + "method": "PUT", + "url": "` + stage.URL + `/staging-object", + "headers": {}, + "expiresAt": "2026-09-02T12:00:00Z" + } + }`)) + case http.MethodDelete: + aborted = true + w.WriteHeader(http.StatusNoContent) + default: + t.Errorf("unexpected request: %s %s", r.Method, r.URL.Path) + } + })) + defer api.Close() + + client := serverlessapi.NewClient("test-key", api.URL, slog.Default()) + if _, err := uploadSource(context.Background(), client, uploadTestAppID, []byte("zip"), "model.py"); err == nil { + t.Fatal("uploadSource succeeded despite a refused transfer") + } + if !aborted { + t.Error("the session was left open after the transfer failed") + } +} + +// TestUploadSource_ReportsARejectedArchive proves a rejection is an error with +// the reason attached, not an upload id a create would then fail on. +func TestUploadSource_ReportsARejectedArchive(t *testing.T) { + stage := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { + w.WriteHeader(http.StatusOK) + })) + defer stage.Close() + + api := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json") + if strings.HasSuffix(r.URL.Path, "/complete") { + w.WriteHeader(http.StatusOK) + _, _ = w.Write([]byte(`{ + "id": "019c7654-8b21-7abc-9123-abcdef123456", + "appId": "` + uploadTestAppID + `", + "declaredByteLength": 3, + "sha256": "` + strings.Repeat("a", 64) + `", + "sourceType": "code", + "state": "rejected", + "rejectionReason": "model file not found in archive", + "expiresAt": "2026-09-02T12:00:00Z", + "createdAt": "2026-09-02T11:00:00Z", + "updatedAt": "2026-09-02T11:00:00Z" + }`)) + return + } + w.WriteHeader(http.StatusCreated) + _, _ = w.Write([]byte(`{ + "upload": { + "id": "019c7654-8b21-7abc-9123-abcdef123456", + "appId": "` + uploadTestAppID + `", + "declaredByteLength": 3, + "sha256": "` + strings.Repeat("a", 64) + `", + "sourceType": "code", + "state": "pending", + "expiresAt": "2026-09-02T12:00:00Z", + "createdAt": "2026-09-02T11:00:00Z", + "updatedAt": "2026-09-02T11:00:00Z" + }, + "transfer": { + "mode": "singlePut", + "method": "PUT", + "url": "` + stage.URL + `/staging-object", + "headers": {}, + "expiresAt": "2026-09-02T12:00:00Z" + } + }`)) + })) + defer api.Close() + + client := serverlessapi.NewClient("test-key", api.URL, slog.Default()) + _, err := uploadSource(context.Background(), client, uploadTestAppID, []byte("zip"), "model.py") + if err == nil { + t.Fatal("uploadSource accepted a rejected archive") + } + if !strings.Contains(err.Error(), "model file not found in archive") { + t.Errorf("error = %v, want the rejection reason", err) + } +} From 9bcda75d511df710dfe4ea8acbabb5b15b5f46ab Mon Sep 17 00:00:00 2001 From: D1-3105 Date: Thu, 3 Sep 2026 01:16:37 +0000 Subject: [PATCH 2/2] fix: upload id issue --- internal/cmd/serverless/upload.go | 8 ++- internal/cmd/serverless/upload_test.go | 78 ++++++++++++++++++++++++++ 2 files changed, 83 insertions(+), 3 deletions(-) diff --git a/internal/cmd/serverless/upload.go b/internal/cmd/serverless/upload.go index f2919d0..1bce929 100644 --- a/internal/cmd/serverless/upload.go +++ b/internal/cmd/serverless/upload.go @@ -23,9 +23,11 @@ func uploadSource(ctx context.Context, client *serverlessapi.Client, appID strin created, err := client.CreateSourceUpload(ctx, appID, serverlessapi.SourceUploadCreate{ DeclaredByteLength: int64(len(archive)), - // The digest doubles as the idempotency key: retrying the same deploy - // declares the same archive, and anything else is a different upload. - IdempotencyKey: hex.EncodeToString(digest[:]), + // Fresh per invocation, and deliberately not the archive's digest: a + // session replays only while it is still pending, and answers 409 once + // it is ready or consumed. Keyed on content, a tree that deployed once + // could never be deployed again. + IdempotencyKey: uuid.NewString(), Sha256: hex.EncodeToString(digest[:]), SourceType: serverlessapi.AppSourceTypeCode, ModelFile: &modelFile, diff --git a/internal/cmd/serverless/upload_test.go b/internal/cmd/serverless/upload_test.go index 4073cbb..7f5a9cc 100644 --- a/internal/cmd/serverless/upload_test.go +++ b/internal/cmd/serverless/upload_test.go @@ -120,6 +120,11 @@ func TestUploadSource_StagesTheArchiveAndReturnsAReadyUpload(t *testing.T) { if declaration.Sha256 != wantSHA { t.Errorf("declared sha256 = %q, want %q", declaration.Sha256, wantSHA) } + // A session replays only while pending and answers 409 once it is ready or + // consumed, so keying on the archive would let a tree deploy exactly once. + if declaration.IdempotencyKey == wantSHA { + t.Error("idempotency key is the archive digest; re-deploying the same tree would 409") + } if declaration.DeclaredByteLength != int64(len(archive)) { t.Errorf("declared length = %d, want %d", declaration.DeclaredByteLength, len(archive)) } @@ -242,3 +247,76 @@ func TestUploadSource_ReportsARejectedArchive(t *testing.T) { t.Errorf("error = %v, want the rejection reason", err) } } + +// TestUploadSource_UsesAFreshKeyPerInvocation is the other half of the rule: +// two deploys of the identical tree must open two sessions, because the first +// one is consumed by the version it created and will never replay again. +func TestUploadSource_UsesAFreshKeyPerInvocation(t *testing.T) { + archive := []byte("a zip, near enough") + + stage := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { + w.WriteHeader(http.StatusOK) + })) + defer stage.Close() + + var keys []string + api := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json") + if strings.HasSuffix(r.URL.Path, "/complete") { + w.WriteHeader(http.StatusOK) + _, _ = w.Write([]byte(`{ + "id": "019c7654-8b21-7abc-9123-abcdef123456", + "appId": "` + uploadTestAppID + `", + "declaredByteLength": 18, + "sha256": "` + strings.Repeat("a", 64) + `", + "sourceType": "code", + "state": "ready", + "expiresAt": "2026-09-02T12:00:00Z", + "createdAt": "2026-09-02T11:00:00Z", + "updatedAt": "2026-09-02T11:00:00Z" + }`)) + return + } + var declaration serverlessapi.SourceUploadCreate + if err := json.NewDecoder(r.Body).Decode(&declaration); err != nil { + t.Fatalf("decode declaration: %v", err) + } + keys = append(keys, declaration.IdempotencyKey) + w.WriteHeader(http.StatusCreated) + _, _ = w.Write([]byte(`{ + "upload": { + "id": "019c7654-8b21-7abc-9123-abcdef123456", + "appId": "` + uploadTestAppID + `", + "declaredByteLength": 18, + "sha256": "` + strings.Repeat("a", 64) + `", + "sourceType": "code", + "state": "pending", + "expiresAt": "2026-09-02T12:00:00Z", + "createdAt": "2026-09-02T11:00:00Z", + "updatedAt": "2026-09-02T11:00:00Z" + }, + "transfer": { + "mode": "singlePut", + "method": "PUT", + "url": "` + stage.URL + `/staging-object", + "headers": {}, + "expiresAt": "2026-09-02T12:00:00Z" + } + }`)) + })) + defer api.Close() + + client := serverlessapi.NewClient("test-key", api.URL, slog.Default()) + for range 2 { + if _, err := uploadSource(context.Background(), client, uploadTestAppID, archive, "model.py"); err != nil { + t.Fatalf("uploadSource: %v", err) + } + } + + if len(keys) != 2 { + t.Fatalf("saw %d declarations, want 2", len(keys)) + } + if keys[0] == keys[1] { + t.Errorf("both deploys sent idempotency key %q; the second would 409 on a consumed session", keys[0]) + } +}