不要回传整个响应
CreateMemo 与 UpdateMemo 直接接收此对象。creator、tags、reactions、property、parent 与 snippet 由服务端生成。虽然共用结构把 state 与 visibility 列为必需,updateMask=content 的 PATCH 只需提供 content。更新选中 attachments 或 relations 时采用集合替换语义。把响应复制成请求前先阅读操作运行时说明。
创建并非写入完整资源
CreateMemo 与 CreateMemoComment 忽略 state 和 pinned,创建的是 NORMAL 且未置顶的记录。需要时应随后通过 UpdateMemo 修改。这份共享必需字段及属性列表描述协议资源,实际采用哪些输入由调用操作决定。
此结构在哪里使用
以下链接根据协议快照中的直接引用生成。认证、可写字段和运行行为应以调用操作为准;可复用资源结构本身并不是完整的写入请求。
- POSTCreate Memo
/api/v1/memos - GETGet Memo
/api/v1/memos/{memo} - PATCHUpdate Memo
/api/v1/memos/{memo} - POSTCreate Memo Comment
/api/v1/memos/{memo}/comments - GETGet Shared Memo
/api/v1/shares/{shareToken}/memo
被以下组件结构引用:
结构与字段
object
| 字段 | 类型 / 是否必需 | 描述 |
|---|---|---|
name | string | The resource name of the memo. Format: memos/{memo}, where memo is the user-defined UID. |
state | string (enum)STATE_UNSPECIFIED · NORMAL · ARCHIVED必需 | The state of the memo. |
creator | string | The name of the creator. Format: users/{user} |
createTime | string (date-time) | The creation timestamp. If not set on creation, the server will set it to the current time. |
updateTime | string (date-time) | The last update timestamp. If not set on creation, the server will set it to the current time. |
content | string 必需 | Required. The content of the memo in Markdown format. |
visibility | string (enum)VISIBILITY_UNSPECIFIED · PRIVATE · PROTECTED · PUBLIC · SPACE必需 | The visibility of the memo. One of PRIVATE (creator only), PROTECTED (signed-in users), PUBLIC (anonymous-eligible), or SPACE (active space members). Defaults to PRIVATE on creation when unspecified. |
tags | array<string> | Output only. The tags extracted from the content. |
pinned | boolean | Whether the memo is pinned. |
attachments | array<Attachment> | Optional. The attachments of the memo. |
relations | array<MemoRelation> | Optional. The relations of the memo. |
reactions | array<Reaction> | Output only. The reactions to the memo. |
property | allOf Memo_Property | Output only. The computed properties of the memo. |
parent | string | Output only. The context memo of this COMMENT relation, if any. Its identity is returned even when the caller cannot read the parent. Fetch the parent independently; this field does not grant read access. Format: memos/{memo} |
snippet | string | Output only. The snippet of the memo content. Plain text only. |
location | allOf Location | Optional. The location of the memo. |
space | string | Optional. The space in which this memo is placed. Format: spaces/{space}. Every memo, including a comment, owns its placement independently. |
完整结构
约束与嵌套结构请以这份完整 JSON 定义为准。字段出现在这里,并不意味着每位调用者都能修改它。
{
"required": [
"state",
"content",
"visibility"
],
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "The resource name of the memo.\n Format: memos/{memo}, where memo is the user-defined UID."
},
"state": {
"enum": [
"STATE_UNSPECIFIED",
"NORMAL",
"ARCHIVED"
],
"type": "string",
"description": "The state of the memo.",
"format": "enum"
},
"creator": {
"readOnly": true,
"type": "string",
"description": "The name of the creator.\n Format: users/{user}"
},
"createTime": {
"type": "string",
"description": "The creation timestamp.\n If not set on creation, the server will set it to the current time.",
"format": "date-time"
},
"updateTime": {
"type": "string",
"description": "The last update timestamp.\n If not set on creation, the server will set it to the current time.",
"format": "date-time"
},
"content": {
"type": "string",
"description": "Required. The content of the memo in Markdown format."
},
"visibility": {
"enum": [
"VISIBILITY_UNSPECIFIED",
"PRIVATE",
"PROTECTED",
"PUBLIC",
"SPACE"
],
"type": "string",
"description": "The visibility of the memo.\n One of PRIVATE (creator only), PROTECTED (signed-in users), PUBLIC\n (anonymous-eligible), or SPACE (active space members). Defaults to\n PRIVATE on creation when unspecified.",
"format": "enum"
},
"tags": {
"readOnly": true,
"type": "array",
"items": {
"type": "string"
},
"description": "Output only. The tags extracted from the content."
},
"pinned": {
"type": "boolean",
"description": "Whether the memo is pinned."
},
"attachments": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Attachment"
},
"description": "Optional. The attachments of the memo."
},
"relations": {
"type": "array",
"items": {
"$ref": "#/components/schemas/MemoRelation"
},
"description": "Optional. The relations of the memo."
},
"reactions": {
"readOnly": true,
"type": "array",
"items": {
"$ref": "#/components/schemas/Reaction"
},
"description": "Output only. The reactions to the memo."
},
"property": {
"readOnly": true,
"allOf": [
{
"$ref": "#/components/schemas/Memo_Property"
}
],
"description": "Output only. The computed properties of the memo."
},
"parent": {
"readOnly": true,
"type": "string",
"description": "Output only. The context memo of this COMMENT relation, if any.\n Its identity is returned even when the caller cannot read the parent.\n Fetch the parent independently; this field does not grant read access.\n Format: memos/{memo}"
},
"snippet": {
"readOnly": true,
"type": "string",
"description": "Output only. The snippet of the memo content. Plain text only."
},
"location": {
"allOf": [
{
"$ref": "#/components/schemas/Location"
}
],
"description": "Optional. The location of the memo."
},
"space": {
"type": "string",
"description": "Optional. The space in which this memo is placed. Format: spaces/{space}.\n Every memo, including a comment, owns its placement independently."
}
}
}