DocumentationAPI reference
Rust · 0.1.0
UploadAttachmentRequest
A stateful upload request: start with spec, then continue with uploadId.
One upload alternative per request
spec and uploadId are alternatives, not fields to send together. writeOffset and totalSize are decimal strings; data is base64 in REST JSON. Resume with the server's committedSize and finish only after all bytes arrive. Read the operation page for finalization, retry and validation behavior.
Where this schema is used
These links are derived from direct references in the protocol snapshot. Follow the calling operation for authentication, accepted fields and runtime behavior; a reusable resource schema is not by itself a complete write request.
Shape and fields
object
| Field | Type / requirement | Description |
|---|---|---|
spec | allOf UploadAttachmentSpec | Starts a new upload. The same call may also carry data and finish_write. |
uploadId | string | Continues the upload identified by a previous response. |
writeOffset | string Required | Required. Zero-based byte offset at which data is written. Must equal the committed size, except when retrying the most recently accepted chunk with identical bytes and offset, which is accepted without writing again. |
data | string (bytes) | Optional. File bytes, at most max_chunk_size long. With no data and finish_write false, the call reports progress without writing, and write_offset is ignored. |
finishWrite | boolean | Optional. Finalize the upload after writing data. The committed size must then equal total_size. Any later call for the same upload_id returns the created attachment. |
Complete schema
Use this complete JSON definition for constraints and nested structure. A field's presence here does not mean it is writable by every caller.
{
"required": [
"writeOffset"
],
"type": "object",
"properties": {
"spec": {
"allOf": [
{
"$ref": "#/components/schemas/UploadAttachmentSpec"
}
],
"description": "Starts a new upload. The same call may also carry data and finish_write."
},
"uploadId": {
"type": "string",
"description": "Continues the upload identified by a previous response."
},
"writeOffset": {
"type": "string",
"description": "Required. Zero-based byte offset at which data is written. Must equal the\n committed size, except when retrying the most recently accepted chunk\n with identical bytes and offset, which is accepted without writing again."
},
"data": {
"type": "string",
"description": "Optional. File bytes, at most max_chunk_size long. With no data and\n finish_write false, the call reports progress without writing, and\n write_offset is ignored.",
"format": "bytes"
},
"finishWrite": {
"type": "boolean",
"description": "Optional. Finalize the upload after writing data. The committed size must\n then equal total_size. Any later call for the same upload_id returns the\n created attachment."
}
}
}