// Package im 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 larkim

import (
	"context"
)

// 消息处理器定义
type P2ChatDisbandedV1Handler struct {
	handler func(context.Context, *P2ChatDisbandedV1) error
}

func NewP2ChatDisbandedV1Handler(handler func(context.Context, *P2ChatDisbandedV1) error) *P2ChatDisbandedV1Handler {
	h := &P2ChatDisbandedV1Handler{handler: handler}
	return h
}

// 返回事件的消息体的实例，用于反序列化用
func (h *P2ChatDisbandedV1Handler) Event() interface{} {
	return &P2ChatDisbandedV1{}
}

// 回调开发者注册的handle
func (h *P2ChatDisbandedV1Handler) Handle(ctx context.Context, event interface{}) error {
	return h.handler(ctx, event.(*P2ChatDisbandedV1))
}

// 消息处理器定义
type P2ChatUpdatedV1Handler struct {
	handler func(context.Context, *P2ChatUpdatedV1) error
}

func NewP2ChatUpdatedV1Handler(handler func(context.Context, *P2ChatUpdatedV1) error) *P2ChatUpdatedV1Handler {
	h := &P2ChatUpdatedV1Handler{handler: handler}
	return h
}

// 返回事件的消息体的实例，用于反序列化用
func (h *P2ChatUpdatedV1Handler) Event() interface{} {
	return &P2ChatUpdatedV1{}
}

// 回调开发者注册的handle
func (h *P2ChatUpdatedV1Handler) Handle(ctx context.Context, event interface{}) error {
	return h.handler(ctx, event.(*P2ChatUpdatedV1))
}

// 消息处理器定义
type P2ChatAccessEventBotP2pChatEnteredV1Handler struct {
	handler func(context.Context, *P2ChatAccessEventBotP2pChatEnteredV1) error
}

func NewP2ChatAccessEventBotP2pChatEnteredV1Handler(handler func(context.Context, *P2ChatAccessEventBotP2pChatEnteredV1) error) *P2ChatAccessEventBotP2pChatEnteredV1Handler {
	h := &P2ChatAccessEventBotP2pChatEnteredV1Handler{handler: handler}
	return h
}

// 返回事件的消息体的实例，用于反序列化用
func (h *P2ChatAccessEventBotP2pChatEnteredV1Handler) Event() interface{} {
	return &P2ChatAccessEventBotP2pChatEnteredV1{}
}

// 回调开发者注册的handle
func (h *P2ChatAccessEventBotP2pChatEnteredV1Handler) Handle(ctx context.Context, event interface{}) error {
	return h.handler(ctx, event.(*P2ChatAccessEventBotP2pChatEnteredV1))
}

// 消息处理器定义
type P2ChatMemberBotAddedV1Handler struct {
	handler func(context.Context, *P2ChatMemberBotAddedV1) error
}

func NewP2ChatMemberBotAddedV1Handler(handler func(context.Context, *P2ChatMemberBotAddedV1) error) *P2ChatMemberBotAddedV1Handler {
	h := &P2ChatMemberBotAddedV1Handler{handler: handler}
	return h
}

// 返回事件的消息体的实例，用于反序列化用
func (h *P2ChatMemberBotAddedV1Handler) Event() interface{} {
	return &P2ChatMemberBotAddedV1{}
}

// 回调开发者注册的handle
func (h *P2ChatMemberBotAddedV1Handler) Handle(ctx context.Context, event interface{}) error {
	return h.handler(ctx, event.(*P2ChatMemberBotAddedV1))
}

// 消息处理器定义
type P2ChatMemberBotDeletedV1Handler struct {
	handler func(context.Context, *P2ChatMemberBotDeletedV1) error
}

func NewP2ChatMemberBotDeletedV1Handler(handler func(context.Context, *P2ChatMemberBotDeletedV1) error) *P2ChatMemberBotDeletedV1Handler {
	h := &P2ChatMemberBotDeletedV1Handler{handler: handler}
	return h
}

// 返回事件的消息体的实例，用于反序列化用
func (h *P2ChatMemberBotDeletedV1Handler) Event() interface{} {
	return &P2ChatMemberBotDeletedV1{}
}

// 回调开发者注册的handle
func (h *P2ChatMemberBotDeletedV1Handler) Handle(ctx context.Context, event interface{}) error {
	return h.handler(ctx, event.(*P2ChatMemberBotDeletedV1))
}

// 消息处理器定义
type P2ChatMemberUserAddedV1Handler struct {
	handler func(context.Context, *P2ChatMemberUserAddedV1) error
}

func NewP2ChatMemberUserAddedV1Handler(handler func(context.Context, *P2ChatMemberUserAddedV1) error) *P2ChatMemberUserAddedV1Handler {
	h := &P2ChatMemberUserAddedV1Handler{handler: handler}
	return h
}

// 返回事件的消息体的实例，用于反序列化用
func (h *P2ChatMemberUserAddedV1Handler) Event() interface{} {
	return &P2ChatMemberUserAddedV1{}
}

// 回调开发者注册的handle
func (h *P2ChatMemberUserAddedV1Handler) Handle(ctx context.Context, event interface{}) error {
	return h.handler(ctx, event.(*P2ChatMemberUserAddedV1))
}

// 消息处理器定义
type P2ChatMemberUserDeletedV1Handler struct {
	handler func(context.Context, *P2ChatMemberUserDeletedV1) error
}

func NewP2ChatMemberUserDeletedV1Handler(handler func(context.Context, *P2ChatMemberUserDeletedV1) error) *P2ChatMemberUserDeletedV1Handler {
	h := &P2ChatMemberUserDeletedV1Handler{handler: handler}
	return h
}

// 返回事件的消息体的实例，用于反序列化用
func (h *P2ChatMemberUserDeletedV1Handler) Event() interface{} {
	return &P2ChatMemberUserDeletedV1{}
}

// 回调开发者注册的handle
func (h *P2ChatMemberUserDeletedV1Handler) Handle(ctx context.Context, event interface{}) error {
	return h.handler(ctx, event.(*P2ChatMemberUserDeletedV1))
}

// 消息处理器定义
type P2ChatMemberUserWithdrawnV1Handler struct {
	handler func(context.Context, *P2ChatMemberUserWithdrawnV1) error
}

func NewP2ChatMemberUserWithdrawnV1Handler(handler func(context.Context, *P2ChatMemberUserWithdrawnV1) error) *P2ChatMemberUserWithdrawnV1Handler {
	h := &P2ChatMemberUserWithdrawnV1Handler{handler: handler}
	return h
}

// 返回事件的消息体的实例，用于反序列化用
func (h *P2ChatMemberUserWithdrawnV1Handler) Event() interface{} {
	return &P2ChatMemberUserWithdrawnV1{}
}

// 回调开发者注册的handle
func (h *P2ChatMemberUserWithdrawnV1Handler) Handle(ctx context.Context, event interface{}) error {
	return h.handler(ctx, event.(*P2ChatMemberUserWithdrawnV1))
}

// 消息处理器定义
type P2MessageReadV1Handler struct {
	handler func(context.Context, *P2MessageReadV1) error
}

func NewP2MessageReadV1Handler(handler func(context.Context, *P2MessageReadV1) error) *P2MessageReadV1Handler {
	h := &P2MessageReadV1Handler{handler: handler}
	return h
}

// 返回事件的消息体的实例，用于反序列化用
func (h *P2MessageReadV1Handler) Event() interface{} {
	return &P2MessageReadV1{}
}

// 回调开发者注册的handle
func (h *P2MessageReadV1Handler) Handle(ctx context.Context, event interface{}) error {
	return h.handler(ctx, event.(*P2MessageReadV1))
}

// 消息处理器定义
type P2MessageRecalledV1Handler struct {
	handler func(context.Context, *P2MessageRecalledV1) error
}

func NewP2MessageRecalledV1Handler(handler func(context.Context, *P2MessageRecalledV1) error) *P2MessageRecalledV1Handler {
	h := &P2MessageRecalledV1Handler{handler: handler}
	return h
}

// 返回事件的消息体的实例，用于反序列化用
func (h *P2MessageRecalledV1Handler) Event() interface{} {
	return &P2MessageRecalledV1{}
}

// 回调开发者注册的handle
func (h *P2MessageRecalledV1Handler) Handle(ctx context.Context, event interface{}) error {
	return h.handler(ctx, event.(*P2MessageRecalledV1))
}

// 消息处理器定义
type P2MessageReceiveV1Handler struct {
	handler func(context.Context, *P2MessageReceiveV1) error
}

func NewP2MessageReceiveV1Handler(handler func(context.Context, *P2MessageReceiveV1) error) *P2MessageReceiveV1Handler {
	h := &P2MessageReceiveV1Handler{handler: handler}
	return h
}

// 返回事件的消息体的实例，用于反序列化用
func (h *P2MessageReceiveV1Handler) Event() interface{} {
	return &P2MessageReceiveV1{}
}

// 回调开发者注册的handle
func (h *P2MessageReceiveV1Handler) Handle(ctx context.Context, event interface{}) error {
	return h.handler(ctx, event.(*P2MessageReceiveV1))
}

// 消息处理器定义
type P2MessageReactionCreatedV1Handler struct {
	handler func(context.Context, *P2MessageReactionCreatedV1) error
}

func NewP2MessageReactionCreatedV1Handler(handler func(context.Context, *P2MessageReactionCreatedV1) error) *P2MessageReactionCreatedV1Handler {
	h := &P2MessageReactionCreatedV1Handler{handler: handler}
	return h
}

// 返回事件的消息体的实例，用于反序列化用
func (h *P2MessageReactionCreatedV1Handler) Event() interface{} {
	return &P2MessageReactionCreatedV1{}
}

// 回调开发者注册的handle
func (h *P2MessageReactionCreatedV1Handler) Handle(ctx context.Context, event interface{}) error {
	return h.handler(ctx, event.(*P2MessageReactionCreatedV1))
}

// 消息处理器定义
type P2MessageReactionDeletedV1Handler struct {
	handler func(context.Context, *P2MessageReactionDeletedV1) error
}

func NewP2MessageReactionDeletedV1Handler(handler func(context.Context, *P2MessageReactionDeletedV1) error) *P2MessageReactionDeletedV1Handler {
	h := &P2MessageReactionDeletedV1Handler{handler: handler}
	return h
}

// 返回事件的消息体的实例，用于反序列化用
func (h *P2MessageReactionDeletedV1Handler) Event() interface{} {
	return &P2MessageReactionDeletedV1{}
}

// 回调开发者注册的handle
func (h *P2MessageReactionDeletedV1Handler) Handle(ctx context.Context, event interface{}) error {
	return h.handler(ctx, event.(*P2MessageReactionDeletedV1))
}
