1 Star 0 Fork 0

Larksuite/oapi-sdk-go

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
application_event_dispatch.go 6.67 KB
一键复制 编辑 原始数据 按行查看 历史
zhailuxu 提交于 2022-09-07 13:50 +08:00 . add sdk
// Package dispatcher code generated by oapi sdk gen
/*
* MIT License
*
* Copyright (c) 2022 Lark Technologies Pte. Ltd.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package dispatcher
import (
"context"
"gitee.com/larksuite/oapi-sdk-go/v3/service/application/v6"
)
// 应用创建
//
// - 当企业内有新的应用被创建时推送此事件
//
// - 事件描述文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application/events/created
func (dispatcher *EventDispatcher) OnP2ApplicationCreatedV6(handler func(ctx context.Context, event *larkapplication.P2ApplicationCreatedV6) error) *EventDispatcher {
_, existed := dispatcher.eventType2EventHandler["application.application.created_v6"]
if existed {
panic("event: multiple handler registrations for " + "application.application.created_v6")
}
dispatcher.eventType2EventHandler["application.application.created_v6"] = larkapplication.NewP2ApplicationCreatedV6Handler(handler)
return dispatcher
}
// 应用审核
//
// - 通过订阅该事件,可接收应用审核(通过 / 拒绝)事件
//
// - 事件描述文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application-app_version/events/audit
func (dispatcher *EventDispatcher) OnP2ApplicationAppVersionAuditV6(handler func(ctx context.Context, event *larkapplication.P2ApplicationAppVersionAuditV6) error) *EventDispatcher {
_, existed := dispatcher.eventType2EventHandler["application.application.app_version.audit_v6"]
if existed {
panic("event: multiple handler registrations for " + "application.application.app_version.audit_v6")
}
dispatcher.eventType2EventHandler["application.application.app_version.audit_v6"] = larkapplication.NewP2ApplicationAppVersionAuditV6Handler(handler)
return dispatcher
}
// 申请发布应用
//
// - 通过订阅该事件,可接收应用提交发布申请事件
//
// - 事件描述文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application-app_version/events/publish_apply
func (dispatcher *EventDispatcher) OnP2ApplicationAppVersionPublishApplyV6(handler func(ctx context.Context, event *larkapplication.P2ApplicationAppVersionPublishApplyV6) error) *EventDispatcher {
_, existed := dispatcher.eventType2EventHandler["application.application.app_version.publish_apply_v6"]
if existed {
panic("event: multiple handler registrations for " + "application.application.app_version.publish_apply_v6")
}
dispatcher.eventType2EventHandler["application.application.app_version.publish_apply_v6"] = larkapplication.NewP2ApplicationAppVersionPublishApplyV6Handler(handler)
return dispatcher
}
// 撤回应用发布申请
//
// - 通过订阅该事件,可接收应用撤回发布申请事件
//
// - 事件描述文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application-app_version/events/publish_revoke
func (dispatcher *EventDispatcher) OnP2ApplicationAppVersionPublishRevokeV6(handler func(ctx context.Context, event *larkapplication.P2ApplicationAppVersionPublishRevokeV6) error) *EventDispatcher {
_, existed := dispatcher.eventType2EventHandler["application.application.app_version.publish_revoke_v6"]
if existed {
panic("event: multiple handler registrations for " + "application.application.app_version.publish_revoke_v6")
}
dispatcher.eventType2EventHandler["application.application.app_version.publish_revoke_v6"] = larkapplication.NewP2ApplicationAppVersionPublishRevokeV6Handler(handler)
return dispatcher
}
// 新增应用反馈
//
// - 当应用收到新反馈时,触发该事件
//
// - 事件描述文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application-feedback/events/created
func (dispatcher *EventDispatcher) OnP2ApplicationFeedbackCreatedV6(handler func(ctx context.Context, event *larkapplication.P2ApplicationFeedbackCreatedV6) error) *EventDispatcher {
_, existed := dispatcher.eventType2EventHandler["application.application.feedback.created_v6"]
if existed {
panic("event: multiple handler registrations for " + "application.application.feedback.created_v6")
}
dispatcher.eventType2EventHandler["application.application.feedback.created_v6"] = larkapplication.NewP2ApplicationFeedbackCreatedV6Handler(handler)
return dispatcher
}
// 反馈更新
//
// - 当反馈的处理状态被更新时,触发该事件
//
// - 事件描述文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application-feedback/events/updated
func (dispatcher *EventDispatcher) OnP2ApplicationFeedbackUpdatedV6(handler func(ctx context.Context, event *larkapplication.P2ApplicationFeedbackUpdatedV6) error) *EventDispatcher {
_, existed := dispatcher.eventType2EventHandler["application.application.feedback.updated_v6"]
if existed {
panic("event: multiple handler registrations for " + "application.application.feedback.updated_v6")
}
dispatcher.eventType2EventHandler["application.application.feedback.updated_v6"] = larkapplication.NewP2ApplicationFeedbackUpdatedV6Handler(handler)
return dispatcher
}
//
//
// -
//
// - 事件描述文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/event/app-availability-scope-extended
func (dispatcher *EventDispatcher) OnP2ApplicationVisibilityAddedV6(handler func(ctx context.Context, event *larkapplication.P2ApplicationVisibilityAddedV6) error) *EventDispatcher {
_, existed := dispatcher.eventType2EventHandler["application.application.visibility.added_v6"]
if existed {
panic("event: multiple handler registrations for " + "application.application.visibility.added_v6")
}
dispatcher.eventType2EventHandler["application.application.visibility.added_v6"] = larkapplication.NewP2ApplicationVisibilityAddedV6Handler(handler)
return dispatcher
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/larksuite/oapi-sdk-go.git
git@gitee.com:larksuite/oapi-sdk-go.git
larksuite
oapi-sdk-go
oapi-sdk-go
v3.0.3

搜索帮助