gitee.com/larksuite/oapi-sdk-go/v3@v3.0.3/event/dispatcher/application_event_dispatch.go (about)

     1  // Package dispatcher code generated by oapi sdk gen
     2  /*
     3   * MIT License
     4   *
     5   * Copyright (c) 2022 Lark Technologies Pte. Ltd.
     6   *
     7   * 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:
     8   *
     9   * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software.
    10   *
    11   * 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.
    12   */
    13  
    14  package dispatcher
    15  
    16  import (
    17  	"context"
    18  	"gitee.com/larksuite/oapi-sdk-go/v3/service/application/v6"
    19  )
    20  
    21  // 应用创建
    22  //
    23  // - 当企业内有新的应用被创建时推送此事件
    24  //
    25  // - 事件描述文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application/events/created
    26  func (dispatcher *EventDispatcher) OnP2ApplicationCreatedV6(handler func(ctx context.Context, event *larkapplication.P2ApplicationCreatedV6) error) *EventDispatcher {
    27  	_, existed := dispatcher.eventType2EventHandler["application.application.created_v6"]
    28  	if existed {
    29  		panic("event: multiple handler registrations for " + "application.application.created_v6")
    30  	}
    31  	dispatcher.eventType2EventHandler["application.application.created_v6"] = larkapplication.NewP2ApplicationCreatedV6Handler(handler)
    32  	return dispatcher
    33  }
    34  
    35  // 应用审核
    36  //
    37  // - 通过订阅该事件,可接收应用审核(通过 / 拒绝)事件
    38  //
    39  // - 事件描述文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application-app_version/events/audit
    40  func (dispatcher *EventDispatcher) OnP2ApplicationAppVersionAuditV6(handler func(ctx context.Context, event *larkapplication.P2ApplicationAppVersionAuditV6) error) *EventDispatcher {
    41  	_, existed := dispatcher.eventType2EventHandler["application.application.app_version.audit_v6"]
    42  	if existed {
    43  		panic("event: multiple handler registrations for " + "application.application.app_version.audit_v6")
    44  	}
    45  	dispatcher.eventType2EventHandler["application.application.app_version.audit_v6"] = larkapplication.NewP2ApplicationAppVersionAuditV6Handler(handler)
    46  	return dispatcher
    47  }
    48  
    49  // 申请发布应用
    50  //
    51  // - 通过订阅该事件,可接收应用提交发布申请事件
    52  //
    53  // - 事件描述文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application-app_version/events/publish_apply
    54  func (dispatcher *EventDispatcher) OnP2ApplicationAppVersionPublishApplyV6(handler func(ctx context.Context, event *larkapplication.P2ApplicationAppVersionPublishApplyV6) error) *EventDispatcher {
    55  	_, existed := dispatcher.eventType2EventHandler["application.application.app_version.publish_apply_v6"]
    56  	if existed {
    57  		panic("event: multiple handler registrations for " + "application.application.app_version.publish_apply_v6")
    58  	}
    59  	dispatcher.eventType2EventHandler["application.application.app_version.publish_apply_v6"] = larkapplication.NewP2ApplicationAppVersionPublishApplyV6Handler(handler)
    60  	return dispatcher
    61  }
    62  
    63  // 撤回应用发布申请
    64  //
    65  // - 通过订阅该事件,可接收应用撤回发布申请事件
    66  //
    67  // - 事件描述文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application-app_version/events/publish_revoke
    68  func (dispatcher *EventDispatcher) OnP2ApplicationAppVersionPublishRevokeV6(handler func(ctx context.Context, event *larkapplication.P2ApplicationAppVersionPublishRevokeV6) error) *EventDispatcher {
    69  	_, existed := dispatcher.eventType2EventHandler["application.application.app_version.publish_revoke_v6"]
    70  	if existed {
    71  		panic("event: multiple handler registrations for " + "application.application.app_version.publish_revoke_v6")
    72  	}
    73  	dispatcher.eventType2EventHandler["application.application.app_version.publish_revoke_v6"] = larkapplication.NewP2ApplicationAppVersionPublishRevokeV6Handler(handler)
    74  	return dispatcher
    75  }
    76  
    77  // 新增应用反馈
    78  //
    79  // - 当应用收到新反馈时,触发该事件
    80  //
    81  // - 事件描述文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application-feedback/events/created
    82  func (dispatcher *EventDispatcher) OnP2ApplicationFeedbackCreatedV6(handler func(ctx context.Context, event *larkapplication.P2ApplicationFeedbackCreatedV6) error) *EventDispatcher {
    83  	_, existed := dispatcher.eventType2EventHandler["application.application.feedback.created_v6"]
    84  	if existed {
    85  		panic("event: multiple handler registrations for " + "application.application.feedback.created_v6")
    86  	}
    87  	dispatcher.eventType2EventHandler["application.application.feedback.created_v6"] = larkapplication.NewP2ApplicationFeedbackCreatedV6Handler(handler)
    88  	return dispatcher
    89  }
    90  
    91  // 反馈更新
    92  //
    93  // - 当反馈的处理状态被更新时,触发该事件
    94  //
    95  // - 事件描述文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application-feedback/events/updated
    96  func (dispatcher *EventDispatcher) OnP2ApplicationFeedbackUpdatedV6(handler func(ctx context.Context, event *larkapplication.P2ApplicationFeedbackUpdatedV6) error) *EventDispatcher {
    97  	_, existed := dispatcher.eventType2EventHandler["application.application.feedback.updated_v6"]
    98  	if existed {
    99  		panic("event: multiple handler registrations for " + "application.application.feedback.updated_v6")
   100  	}
   101  	dispatcher.eventType2EventHandler["application.application.feedback.updated_v6"] = larkapplication.NewP2ApplicationFeedbackUpdatedV6Handler(handler)
   102  	return dispatcher
   103  }
   104  
   105  //
   106  //
   107  // -
   108  //
   109  // - 事件描述文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/event/app-availability-scope-extended
   110  func (dispatcher *EventDispatcher) OnP2ApplicationVisibilityAddedV6(handler func(ctx context.Context, event *larkapplication.P2ApplicationVisibilityAddedV6) error) *EventDispatcher {
   111  	_, existed := dispatcher.eventType2EventHandler["application.application.visibility.added_v6"]
   112  	if existed {
   113  		panic("event: multiple handler registrations for " + "application.application.visibility.added_v6")
   114  	}
   115  	dispatcher.eventType2EventHandler["application.application.visibility.added_v6"] = larkapplication.NewP2ApplicationVisibilityAddedV6Handler(handler)
   116  	return dispatcher
   117  }