文档API 参考

Rust · 0.1.0

Set Memo Relations

PATCH /api/v1/memos/{memo}/relations

MemoService · MemoService_SetMemoRelations

基于协议生成的参考。授权与实例策略仍然生效。结构描述继承自 MIT 许可的应用接口定义;本站不会向真实服务执行示例。

访问权限

需要笔记作者或实例管理员。更新与分享管理还会检查适用的空间归属;空间成员资格本身不会赋予他人笔记的所有者权限。

替换向外引用

发送完整目标 REFERENCE 关系数组,每项通过 relatedMemo.name 标识一个可读目标。这里不能创建或修改 COMMENT;空数组清除引用但保留评论上下文。调用者必须能读取每个目标。自引用会被忽略,重复目标会合并。

成功响应

此操作没有资源对象需要返回。Rust REST 传输将 protobuf Empty 序列化为 HTTP 200 与 JSON {}。生成接口定义中的成功结构为空是有意行为,不表示遗漏了请求说明。

请求

SetMemoRelations replaces the full set of mutable REFERENCE relations on a memo. COMMENT relations are immutable creation context and are rejected by this RPC. An empty list clears references without changing COMMENT.

PATCH/api/v1/memos/{memo}/relations

参数

名称 / 位置类型 / 是否必需描述
memo
path
string
必需
The memo id.

请求体

必需

application/json · SetMemoRelationsRequest

响应

200 · OK

default · Default error response

application/json · Status

完整操作定义

下方保留全部已声明约束、媒体类型和响应细节。结构引用链接到完整定义。

展开 JSON 定义
{
  "tags": [
    "MemoService"
  ],
  "description": "SetMemoRelations replaces the full set of mutable REFERENCE relations on a\n memo. COMMENT relations are immutable creation context and are rejected by\n this RPC. An empty list clears references without changing COMMENT.",
  "operationId": "MemoService_SetMemoRelations",
  "parameters": [
    {
      "name": "memo",
      "in": "path",
      "description": "The memo id.",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/SetMemoRelationsRequest"
        }
      }
    },
    "required": true
  },
  "responses": {
    "200": {
      "description": "OK",
      "content": {}
    },
    "default": {
      "description": "Default error response",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Status"
          }
        }
      }
    }
  }
}