UserService · UserService_UpdateUserNotification
基于协议生成的参考。授权与实例策略仍然生效。结构描述继承自 MIT 许可的应用接口定义;本站不会向真实服务执行示例。
访问权限
仅限所有者:路径中的用户必须是已认证调用者;实例管理员身份不允许在此代替其他账号操作。
只能修改 status
使用 updateMask=status,并将 status 设为 UNREAD 或 ARCHIVED。此操作不能修改其他字段。通知主题必须仍可读;删除自己拥有的过期条目时使用 DeleteUserNotification。
请求
UpdateUserNotification updates a notification.
PATCH
/api/v1/users/{user}/notifications/{notification}参数
| 名称 / 位置 | 类型 / 是否必需 | 描述 |
|---|---|---|
userpath | string 必需 | The user id. |
notificationpath | string 必需 | The notification id. |
updateMaskquery | string (field-mask) OpenAPI 未标记为必需 |
请求体
必需
application/json · UserNotification
响应
200 · OK
application/json · UserNotification
default · Default error response
application/json · Status
完整操作定义
下方保留全部已声明约束、媒体类型和响应细节。结构引用链接到完整定义。
展开 JSON 定义
{
"tags": [
"UserService"
],
"description": "UpdateUserNotification updates a notification.",
"operationId": "UserService_UpdateUserNotification",
"parameters": [
{
"name": "user",
"in": "path",
"description": "The user id.",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "notification",
"in": "path",
"description": "The notification id.",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "updateMask",
"in": "query",
"schema": {
"type": "string",
"format": "field-mask"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserNotification"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserNotification"
}
}
}
},
"default": {
"description": "Default error response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Status"
}
}
}
}
}
}