From 89707efcf6cd8c857b04046634d1fe2cada6defa Mon Sep 17 00:00:00 2001 From: ysyneu Date: Tue, 2 Jun 2026 12:02:30 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20sync=20spec=20from=20docs=20=E2=80=94?= =?UTF-8?q?=20drop=20stale=20/channel/notify/rule/*=20(docs#68)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Re-vendored openapi/ from flashduty-docs main after #68 removed the 6 dead /channel/notify/rule/* endpoints (backend routes deleted 2023-08, absent from the pgy registry). Regenerated: operations 254→248, the 6 ChannelNotifyRule* SDK methods drop from channels.go. No model change (they referenced only shared schemas); the #6 omitempty split is intact. Untagged — no release. --- channels.go | 54 ------ openapi/openapi.en.json | 408 ---------------------------------------- openapi/openapi.zh.json | 408 ---------------------------------------- 3 files changed, 870 deletions(-) diff --git a/channels.go b/channels.go index c585e28..db00025 100644 --- a/channels.go +++ b/channels.go @@ -232,60 +232,6 @@ func (s *ChannelsService) ChannelList(ctx context.Context, req *ListChannelsRequ return out, resp, nil } -// Create channel notification rule. -// -// Create a notification rule for a channel. -// -// API: POST /channel/notify/rule/create (channelNotifyRuleCreate). -func (s *ChannelsService) ChannelNotifyRuleCreate(ctx context.Context) (*Response, error) { - return s.client.do(ctx, "/channel/notify/rule/create", nil, nil) -} - -// Delete channel notification rule. -// -// Delete a channel notification rule. -// -// API: POST /channel/notify/rule/delete (channelNotifyRuleDelete). -func (s *ChannelsService) ChannelNotifyRuleDelete(ctx context.Context) (*Response, error) { - return s.client.do(ctx, "/channel/notify/rule/delete", nil, nil) -} - -// Disable channel notification rule. -// -// Disable a channel notification rule without deleting it. -// -// API: POST /channel/notify/rule/disable (channelNotifyRuleDisable). -func (s *ChannelsService) ChannelNotifyRuleDisable(ctx context.Context) (*Response, error) { - return s.client.do(ctx, "/channel/notify/rule/disable", nil, nil) -} - -// Enable channel notification rule. -// -// Enable a disabled channel notification rule. -// -// API: POST /channel/notify/rule/enable (channelNotifyRuleEnable). -func (s *ChannelsService) ChannelNotifyRuleEnable(ctx context.Context) (*Response, error) { - return s.client.do(ctx, "/channel/notify/rule/enable", nil, nil) -} - -// List channel notification rules. -// -// List all notification rules configured for a channel. -// -// API: POST /channel/notify/rule/list (channelNotifyRuleList). -func (s *ChannelsService) ChannelNotifyRuleList(ctx context.Context) (*Response, error) { - return s.client.do(ctx, "/channel/notify/rule/list", nil, nil) -} - -// Update channel notification rule. -// -// Update an existing channel notification rule. -// -// API: POST /channel/notify/rule/update (channelNotifyRuleUpdate). -func (s *ChannelsService) ChannelNotifyRuleUpdate(ctx context.Context) (*Response, error) { - return s.client.do(ctx, "/channel/notify/rule/update", nil, nil) -} - // Create silence rule. // // Create a silence rule to suppress notifications matching specified conditions. diff --git a/openapi/openapi.en.json b/openapi/openapi.en.json index 791f983..cc20716 100644 --- a/openapi/openapi.en.json +++ b/openapi/openapi.en.json @@ -3223,414 +3223,6 @@ } } }, - "/channel/notify/rule/list": { - "post": { - "operationId": "channelNotifyRuleList", - "summary": "List channel notification rules", - "description": "List all notification rules configured for a channel.", - "tags": [ - "On-call/Channels" - ], - "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |", - "href": "/en/api-reference/on-call/channels/channel-notify-rule-list", - "metadata": { - "sidebarTitle": "List channel notification rules" - } - }, - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "allOf": [ - { - "$ref": "#/components/schemas/SuccessEnvelope" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/components/schemas/EmptyResponse" - } - } - } - ] - }, - "example": { - "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests" - }, - "500": { - "$ref": "#/components/responses/ServerError" - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EmptyRequest" - }, - "example": {} - } - } - } - } - }, - "/channel/notify/rule/create": { - "post": { - "operationId": "channelNotifyRuleCreate", - "summary": "Create channel notification rule", - "description": "Create a notification rule for a channel.", - "tags": [ - "On-call/Channels" - ], - "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/channels/channel-notify-rule-create", - "metadata": { - "sidebarTitle": "Create channel notification rule" - } - }, - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "allOf": [ - { - "$ref": "#/components/schemas/SuccessEnvelope" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/components/schemas/EmptyResponse" - } - } - } - ] - }, - "example": { - "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests" - }, - "500": { - "$ref": "#/components/responses/ServerError" - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EmptyRequest" - }, - "example": {} - } - } - } - } - }, - "/channel/notify/rule/update": { - "post": { - "operationId": "channelNotifyRuleUpdate", - "summary": "Update channel notification rule", - "description": "Update an existing channel notification rule.", - "tags": [ - "On-call/Channels" - ], - "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/channels/channel-notify-rule-update", - "metadata": { - "sidebarTitle": "Update channel notification rule" - } - }, - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "allOf": [ - { - "$ref": "#/components/schemas/SuccessEnvelope" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/components/schemas/EmptyResponse" - } - } - } - ] - }, - "example": { - "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests" - }, - "500": { - "$ref": "#/components/responses/ServerError" - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EmptyRequest" - }, - "example": {} - } - } - } - } - }, - "/channel/notify/rule/delete": { - "post": { - "operationId": "channelNotifyRuleDelete", - "summary": "Delete channel notification rule", - "description": "Delete a channel notification rule.", - "tags": [ - "On-call/Channels" - ], - "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/channels/channel-notify-rule-delete", - "metadata": { - "sidebarTitle": "Delete channel notification rule" - } - }, - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "allOf": [ - { - "$ref": "#/components/schemas/SuccessEnvelope" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/components/schemas/EmptyResponse" - } - } - } - ] - }, - "example": { - "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests" - }, - "500": { - "$ref": "#/components/responses/ServerError" - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EmptyRequest" - }, - "example": {} - } - } - } - } - }, - "/channel/notify/rule/enable": { - "post": { - "operationId": "channelNotifyRuleEnable", - "summary": "Enable channel notification rule", - "description": "Enable a disabled channel notification rule.", - "tags": [ - "On-call/Channels" - ], - "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/channels/channel-notify-rule-enable", - "metadata": { - "sidebarTitle": "Enable channel notification rule" - } - }, - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "allOf": [ - { - "$ref": "#/components/schemas/SuccessEnvelope" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/components/schemas/EmptyResponse" - } - } - } - ] - }, - "example": { - "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests" - }, - "500": { - "$ref": "#/components/responses/ServerError" - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EmptyRequest" - }, - "example": {} - } - } - } - } - }, - "/channel/notify/rule/disable": { - "post": { - "operationId": "channelNotifyRuleDisable", - "summary": "Disable channel notification rule", - "description": "Disable a channel notification rule without deleting it.", - "tags": [ - "On-call/Channels" - ], - "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/channels/channel-notify-rule-disable", - "metadata": { - "sidebarTitle": "Disable channel notification rule" - } - }, - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "allOf": [ - { - "$ref": "#/components/schemas/SuccessEnvelope" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/components/schemas/EmptyResponse" - } - } - } - ] - }, - "example": { - "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests" - }, - "500": { - "$ref": "#/components/responses/ServerError" - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EmptyRequest" - }, - "example": {} - } - } - } - } - }, "/channel/silence/rule/list": { "post": { "operationId": "channelSilenceRuleList", diff --git a/openapi/openapi.zh.json b/openapi/openapi.zh.json index 98c8b32..1ce7910 100644 --- a/openapi/openapi.zh.json +++ b/openapi/openapi.zh.json @@ -3223,414 +3223,6 @@ } } }, - "/channel/notify/rule/list": { - "post": { - "operationId": "channelNotifyRuleList", - "summary": "查询协作空间通知规则", - "description": "查询为指定协作空间配置的所有通知规则。", - "tags": [ - "On-call/协作空间" - ], - "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |", - "href": "/zh/api-reference/on-call/channels/channel-notify-rule-list", - "metadata": { - "sidebarTitle": "查询协作空间通知规则" - } - }, - "responses": { - "200": { - "description": "成功", - "content": { - "application/json": { - "schema": { - "allOf": [ - { - "$ref": "#/components/schemas/SuccessEnvelope" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/components/schemas/EmptyResponse" - } - } - } - ] - }, - "example": { - "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests" - }, - "500": { - "$ref": "#/components/responses/ServerError" - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EmptyRequest" - }, - "example": {} - } - } - } - } - }, - "/channel/notify/rule/create": { - "post": { - "operationId": "channelNotifyRuleCreate", - "summary": "创建协作空间通知规则", - "description": "为协作空间创建通知规则。", - "tags": [ - "On-call/协作空间" - ], - "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/channels/channel-notify-rule-create", - "metadata": { - "sidebarTitle": "创建协作空间通知规则" - } - }, - "responses": { - "200": { - "description": "成功", - "content": { - "application/json": { - "schema": { - "allOf": [ - { - "$ref": "#/components/schemas/SuccessEnvelope" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/components/schemas/EmptyResponse" - } - } - } - ] - }, - "example": { - "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests" - }, - "500": { - "$ref": "#/components/responses/ServerError" - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EmptyRequest" - }, - "example": {} - } - } - } - } - }, - "/channel/notify/rule/update": { - "post": { - "operationId": "channelNotifyRuleUpdate", - "summary": "更新协作空间通知规则", - "description": "更新已有协作空间通知规则的配置。", - "tags": [ - "On-call/协作空间" - ], - "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/channels/channel-notify-rule-update", - "metadata": { - "sidebarTitle": "更新协作空间通知规则" - } - }, - "responses": { - "200": { - "description": "成功", - "content": { - "application/json": { - "schema": { - "allOf": [ - { - "$ref": "#/components/schemas/SuccessEnvelope" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/components/schemas/EmptyResponse" - } - } - } - ] - }, - "example": { - "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests" - }, - "500": { - "$ref": "#/components/responses/ServerError" - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EmptyRequest" - }, - "example": {} - } - } - } - } - }, - "/channel/notify/rule/delete": { - "post": { - "operationId": "channelNotifyRuleDelete", - "summary": "删除协作空间通知规则", - "description": "删除指定的协作空间通知规则。", - "tags": [ - "On-call/协作空间" - ], - "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/channels/channel-notify-rule-delete", - "metadata": { - "sidebarTitle": "删除协作空间通知规则" - } - }, - "responses": { - "200": { - "description": "成功", - "content": { - "application/json": { - "schema": { - "allOf": [ - { - "$ref": "#/components/schemas/SuccessEnvelope" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/components/schemas/EmptyResponse" - } - } - } - ] - }, - "example": { - "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests" - }, - "500": { - "$ref": "#/components/responses/ServerError" - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EmptyRequest" - }, - "example": {} - } - } - } - } - }, - "/channel/notify/rule/enable": { - "post": { - "operationId": "channelNotifyRuleEnable", - "summary": "启用协作空间通知规则", - "description": "启用已禁用的协作空间通知规则。", - "tags": [ - "On-call/协作空间" - ], - "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/channels/channel-notify-rule-enable", - "metadata": { - "sidebarTitle": "启用协作空间通知规则" - } - }, - "responses": { - "200": { - "description": "成功", - "content": { - "application/json": { - "schema": { - "allOf": [ - { - "$ref": "#/components/schemas/SuccessEnvelope" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/components/schemas/EmptyResponse" - } - } - } - ] - }, - "example": { - "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests" - }, - "500": { - "$ref": "#/components/responses/ServerError" - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EmptyRequest" - }, - "example": {} - } - } - } - } - }, - "/channel/notify/rule/disable": { - "post": { - "operationId": "channelNotifyRuleDisable", - "summary": "禁用协作空间通知规则", - "description": "禁用协作空间通知规则而不删除。", - "tags": [ - "On-call/协作空间" - ], - "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/channels/channel-notify-rule-disable", - "metadata": { - "sidebarTitle": "禁用协作空间通知规则" - } - }, - "responses": { - "200": { - "description": "成功", - "content": { - "application/json": { - "schema": { - "allOf": [ - { - "$ref": "#/components/schemas/SuccessEnvelope" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/components/schemas/EmptyResponse" - } - } - } - ] - }, - "example": { - "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests" - }, - "500": { - "$ref": "#/components/responses/ServerError" - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EmptyRequest" - }, - "example": {} - } - } - } - } - }, "/channel/silence/rule/list": { "post": { "operationId": "channelSilenceRuleList",