// Package drive 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 larkdrive

import (
	"context"
)

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

func NewP2FileBitableFieldChangedV1Handler(handler func(context.Context, *P2FileBitableFieldChangedV1) error) *P2FileBitableFieldChangedV1Handler {
	h := &P2FileBitableFieldChangedV1Handler{handler: handler}
	return h
}

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

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

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

func NewP2FileBitableRecordChangedV1Handler(handler func(context.Context, *P2FileBitableRecordChangedV1) error) *P2FileBitableRecordChangedV1Handler {
	h := &P2FileBitableRecordChangedV1Handler{handler: handler}
	return h
}

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

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

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

func NewP2FileCreatedInFolderV1Handler(handler func(context.Context, *P2FileCreatedInFolderV1) error) *P2FileCreatedInFolderV1Handler {
	h := &P2FileCreatedInFolderV1Handler{handler: handler}
	return h
}

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

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

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

func NewP2FileDeletedV1Handler(handler func(context.Context, *P2FileDeletedV1) error) *P2FileDeletedV1Handler {
	h := &P2FileDeletedV1Handler{handler: handler}
	return h
}

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

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

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

func NewP2FileEditV1Handler(handler func(context.Context, *P2FileEditV1) error) *P2FileEditV1Handler {
	h := &P2FileEditV1Handler{handler: handler}
	return h
}

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

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

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

func NewP2FilePermissionMemberAddedV1Handler(handler func(context.Context, *P2FilePermissionMemberAddedV1) error) *P2FilePermissionMemberAddedV1Handler {
	h := &P2FilePermissionMemberAddedV1Handler{handler: handler}
	return h
}

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

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

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

func NewP2FilePermissionMemberAppliedV1Handler(handler func(context.Context, *P2FilePermissionMemberAppliedV1) error) *P2FilePermissionMemberAppliedV1Handler {
	h := &P2FilePermissionMemberAppliedV1Handler{handler: handler}
	return h
}

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

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

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

func NewP2FilePermissionMemberRemovedV1Handler(handler func(context.Context, *P2FilePermissionMemberRemovedV1) error) *P2FilePermissionMemberRemovedV1Handler {
	h := &P2FilePermissionMemberRemovedV1Handler{handler: handler}
	return h
}

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

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

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

func NewP2FileReadV1Handler(handler func(context.Context, *P2FileReadV1) error) *P2FileReadV1Handler {
	h := &P2FileReadV1Handler{handler: handler}
	return h
}

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

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

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

func NewP2FileTitleUpdatedV1Handler(handler func(context.Context, *P2FileTitleUpdatedV1) error) *P2FileTitleUpdatedV1Handler {
	h := &P2FileTitleUpdatedV1Handler{handler: handler}
	return h
}

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

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

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

func NewP2FileTrashedV1Handler(handler func(context.Context, *P2FileTrashedV1) error) *P2FileTrashedV1Handler {
	h := &P2FileTrashedV1Handler{handler: handler}
	return h
}

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

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