DocumentationAPI reference

Rust · 0.1.0

Attachment

File metadata; content is upload-only and normal reads return metadata.

Creation versus existing references

CreateAttachment accepts base64 content. Chunk upload keeps metadata in spec.attachment and sends bytes in data. When an existing attachment is listed in a memo's desired attachment set, name identifies it; filename/type requirements in this shared schema do not mean the bytes must be uploaded again. UpdateAttachment changes filename only, and mediaMetadata is immutable after creation.

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.

Referenced by these component schemas:

Shape and fields

object

FieldType / requirementDescription
namestringThe name of the attachment. Format: attachments/{attachment}
createTimestring (date-time)Output only. The creation timestamp.
filenamestring
Required
The filename of the attachment.
contentstring (bytes)Input only. The content of the attachment.
externalLinkstringOptional. The external link of the attachment.
typestring
Required
The MIME type of the attachment.
sizestringOutput only. The size of the attachment in bytes.
memostringOptional. The related memo. Refer to `Memo.name`. Format: memos/{memo}
motionMediaallOf
MotionMedia
Optional. Motion media metadata.
mediaMetadataallOf
MediaMetadata
Optional. Immutable normalized media metadata explicitly supplied by the client at creation time.

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": [
    "filename",
    "type"
  ],
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "The name of the attachment.\n Format: attachments/{attachment}"
    },
    "createTime": {
      "readOnly": true,
      "type": "string",
      "description": "Output only. The creation timestamp.",
      "format": "date-time"
    },
    "filename": {
      "type": "string",
      "description": "The filename of the attachment."
    },
    "content": {
      "writeOnly": true,
      "type": "string",
      "description": "Input only. The content of the attachment.",
      "format": "bytes"
    },
    "externalLink": {
      "type": "string",
      "description": "Optional. The external link of the attachment."
    },
    "type": {
      "type": "string",
      "description": "The MIME type of the attachment."
    },
    "size": {
      "readOnly": true,
      "type": "string",
      "description": "Output only. The size of the attachment in bytes."
    },
    "memo": {
      "type": "string",
      "description": "Optional. The related memo. Refer to `Memo.name`.\n Format: memos/{memo}"
    },
    "motionMedia": {
      "allOf": [
        {
          "$ref": "#/components/schemas/MotionMedia"
        }
      ],
      "description": "Optional. Motion media metadata."
    },
    "mediaMetadata": {
      "allOf": [
        {
          "$ref": "#/components/schemas/MediaMetadata"
        }
      ],
      "description": "Optional. Immutable normalized media metadata explicitly supplied by the client at creation time."
    }
  }
}