gitee.com/larksuite/oapi-sdk-go/v3@v3.0.3/service/helpdesk/v1/event.go (about)

     1  // Package helpdesk 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 larkhelpdesk
    15  
    16  import (
    17  	"context"
    18  )
    19  
    20  // 消息处理器定义
    21  type P2NotificationApproveV1Handler struct {
    22  	handler func(context.Context, *P2NotificationApproveV1) error
    23  }
    24  
    25  func NewP2NotificationApproveV1Handler(handler func(context.Context, *P2NotificationApproveV1) error) *P2NotificationApproveV1Handler {
    26  	h := &P2NotificationApproveV1Handler{handler: handler}
    27  	return h
    28  }
    29  
    30  // 返回事件的消息体的实例,用于反序列化用
    31  func (h *P2NotificationApproveV1Handler) Event() interface{} {
    32  	return &P2NotificationApproveV1{}
    33  }
    34  
    35  // 回调开发者注册的handle
    36  func (h *P2NotificationApproveV1Handler) Handle(ctx context.Context, event interface{}) error {
    37  	return h.handler(ctx, event.(*P2NotificationApproveV1))
    38  }
    39  
    40  // 消息处理器定义
    41  type P2TicketCreatedV1Handler struct {
    42  	handler func(context.Context, *P2TicketCreatedV1) error
    43  }
    44  
    45  func NewP2TicketCreatedV1Handler(handler func(context.Context, *P2TicketCreatedV1) error) *P2TicketCreatedV1Handler {
    46  	h := &P2TicketCreatedV1Handler{handler: handler}
    47  	return h
    48  }
    49  
    50  // 返回事件的消息体的实例,用于反序列化用
    51  func (h *P2TicketCreatedV1Handler) Event() interface{} {
    52  	return &P2TicketCreatedV1{}
    53  }
    54  
    55  // 回调开发者注册的handle
    56  func (h *P2TicketCreatedV1Handler) Handle(ctx context.Context, event interface{}) error {
    57  	return h.handler(ctx, event.(*P2TicketCreatedV1))
    58  }
    59  
    60  // 消息处理器定义
    61  type P2TicketUpdatedV1Handler struct {
    62  	handler func(context.Context, *P2TicketUpdatedV1) error
    63  }
    64  
    65  func NewP2TicketUpdatedV1Handler(handler func(context.Context, *P2TicketUpdatedV1) error) *P2TicketUpdatedV1Handler {
    66  	h := &P2TicketUpdatedV1Handler{handler: handler}
    67  	return h
    68  }
    69  
    70  // 返回事件的消息体的实例,用于反序列化用
    71  func (h *P2TicketUpdatedV1Handler) Event() interface{} {
    72  	return &P2TicketUpdatedV1{}
    73  }
    74  
    75  // 回调开发者注册的handle
    76  func (h *P2TicketUpdatedV1Handler) Handle(ctx context.Context, event interface{}) error {
    77  	return h.handler(ctx, event.(*P2TicketUpdatedV1))
    78  }
    79  
    80  // 消息处理器定义
    81  type P2TicketMessageCreatedV1Handler struct {
    82  	handler func(context.Context, *P2TicketMessageCreatedV1) error
    83  }
    84  
    85  func NewP2TicketMessageCreatedV1Handler(handler func(context.Context, *P2TicketMessageCreatedV1) error) *P2TicketMessageCreatedV1Handler {
    86  	h := &P2TicketMessageCreatedV1Handler{handler: handler}
    87  	return h
    88  }
    89  
    90  // 返回事件的消息体的实例,用于反序列化用
    91  func (h *P2TicketMessageCreatedV1Handler) Event() interface{} {
    92  	return &P2TicketMessageCreatedV1{}
    93  }
    94  
    95  // 回调开发者注册的handle
    96  func (h *P2TicketMessageCreatedV1Handler) Handle(ctx context.Context, event interface{}) error {
    97  	return h.handler(ctx, event.(*P2TicketMessageCreatedV1))
    98  }