UserService · UserService_UpdateUserSetting
基于协议生成的参考。授权与实例策略仍然生效。结构描述继承自 MIT 许可的应用接口定义;本站不会向真实服务执行示例。
访问权限
仅限所有者:路径中的用户必须是已认证调用者;实例管理员身份不允许在此代替其他账号操作。
可用设置键有限
暴露的设置键为 GENERAL、TAGS 与 WEBHOOKS。账号令牌与会话存储不作为设置暴露。WEBHOOKS 在此只读,应通过独立的 Webhook 操作管理。缺失 GENERAL 设置时返回默认投影。
掩码路径相对于所选设置
GENERAL 使用 memo_visibility、theme、locale 或 save_media_metadata,JSON 请求体则包含 generalSetting。memoVisibility 可为 PRIVATE、PROTECTED 或 PUBLIC,SPACE 不是全局默认值。TAGS 使用 updateMask=tags,并以 tagsSetting.tags 提交完整新映射;空映射清除标签元数据。不要把 generalSetting.locale 用作此接口的掩码路径。
请求
UpdateUserSetting updates the user setting.
PATCH
/api/v1/users/{user}/settings/{setting}参数
| 名称 / 位置 | 类型 / 是否必需 | 描述 |
|---|---|---|
userpath | string 必需 | The user id. |
settingpath | string 必需 | The setting id. |
updateMaskquery | string (field-mask) 必需(接口描述) | Required. The list of fields to update. |
请求体
必需
application/json · UserSetting
响应
200 · OK
application/json · UserSetting
default · Default error response
application/json · Status
完整操作定义
下方保留全部已声明约束、媒体类型和响应细节。结构引用链接到完整定义。
展开 JSON 定义
{
"tags": [
"UserService"
],
"description": "UpdateUserSetting updates the user setting.",
"operationId": "UserService_UpdateUserSetting",
"parameters": [
{
"name": "user",
"in": "path",
"description": "The user id.",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "setting",
"in": "path",
"description": "The setting id.",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "updateMask",
"in": "query",
"description": "Required. The list of fields to update.",
"schema": {
"type": "string",
"format": "field-mask"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserSetting"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserSetting"
}
}
}
},
"default": {
"description": "Default error response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Status"
}
}
}
}
}
}