gitee.com/larksuite/oapi-sdk-go/v3@v3.0.3/service/drive/v1/event.go (about) 1 // Package drive 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 larkdrive 15 16 import ( 17 "context" 18 ) 19 20 // 消息处理器定义 21 type P2FileDeletedV1Handler struct { 22 handler func(context.Context, *P2FileDeletedV1) error 23 } 24 25 func NewP2FileDeletedV1Handler(handler func(context.Context, *P2FileDeletedV1) error) *P2FileDeletedV1Handler { 26 h := &P2FileDeletedV1Handler{handler: handler} 27 return h 28 } 29 30 // 返回事件的消息体的实例,用于反序列化用 31 func (h *P2FileDeletedV1Handler) Event() interface{} { 32 return &P2FileDeletedV1{} 33 } 34 35 // 回调开发者注册的handle 36 func (h *P2FileDeletedV1Handler) Handle(ctx context.Context, event interface{}) error { 37 return h.handler(ctx, event.(*P2FileDeletedV1)) 38 } 39 40 // 消息处理器定义 41 type P2FileEditV1Handler struct { 42 handler func(context.Context, *P2FileEditV1) error 43 } 44 45 func NewP2FileEditV1Handler(handler func(context.Context, *P2FileEditV1) error) *P2FileEditV1Handler { 46 h := &P2FileEditV1Handler{handler: handler} 47 return h 48 } 49 50 // 返回事件的消息体的实例,用于反序列化用 51 func (h *P2FileEditV1Handler) Event() interface{} { 52 return &P2FileEditV1{} 53 } 54 55 // 回调开发者注册的handle 56 func (h *P2FileEditV1Handler) Handle(ctx context.Context, event interface{}) error { 57 return h.handler(ctx, event.(*P2FileEditV1)) 58 } 59 60 // 消息处理器定义 61 type P2FilePermissionMemberAddedV1Handler struct { 62 handler func(context.Context, *P2FilePermissionMemberAddedV1) error 63 } 64 65 func NewP2FilePermissionMemberAddedV1Handler(handler func(context.Context, *P2FilePermissionMemberAddedV1) error) *P2FilePermissionMemberAddedV1Handler { 66 h := &P2FilePermissionMemberAddedV1Handler{handler: handler} 67 return h 68 } 69 70 // 返回事件的消息体的实例,用于反序列化用 71 func (h *P2FilePermissionMemberAddedV1Handler) Event() interface{} { 72 return &P2FilePermissionMemberAddedV1{} 73 } 74 75 // 回调开发者注册的handle 76 func (h *P2FilePermissionMemberAddedV1Handler) Handle(ctx context.Context, event interface{}) error { 77 return h.handler(ctx, event.(*P2FilePermissionMemberAddedV1)) 78 } 79 80 // 消息处理器定义 81 type P2FilePermissionMemberRemovedV1Handler struct { 82 handler func(context.Context, *P2FilePermissionMemberRemovedV1) error 83 } 84 85 func NewP2FilePermissionMemberRemovedV1Handler(handler func(context.Context, *P2FilePermissionMemberRemovedV1) error) *P2FilePermissionMemberRemovedV1Handler { 86 h := &P2FilePermissionMemberRemovedV1Handler{handler: handler} 87 return h 88 } 89 90 // 返回事件的消息体的实例,用于反序列化用 91 func (h *P2FilePermissionMemberRemovedV1Handler) Event() interface{} { 92 return &P2FilePermissionMemberRemovedV1{} 93 } 94 95 // 回调开发者注册的handle 96 func (h *P2FilePermissionMemberRemovedV1Handler) Handle(ctx context.Context, event interface{}) error { 97 return h.handler(ctx, event.(*P2FilePermissionMemberRemovedV1)) 98 } 99 100 // 消息处理器定义 101 type P2FileReadV1Handler struct { 102 handler func(context.Context, *P2FileReadV1) error 103 } 104 105 func NewP2FileReadV1Handler(handler func(context.Context, *P2FileReadV1) error) *P2FileReadV1Handler { 106 h := &P2FileReadV1Handler{handler: handler} 107 return h 108 } 109 110 // 返回事件的消息体的实例,用于反序列化用 111 func (h *P2FileReadV1Handler) Event() interface{} { 112 return &P2FileReadV1{} 113 } 114 115 // 回调开发者注册的handle 116 func (h *P2FileReadV1Handler) Handle(ctx context.Context, event interface{}) error { 117 return h.handler(ctx, event.(*P2FileReadV1)) 118 } 119 120 // 消息处理器定义 121 type P2FileTitleUpdatedV1Handler struct { 122 handler func(context.Context, *P2FileTitleUpdatedV1) error 123 } 124 125 func NewP2FileTitleUpdatedV1Handler(handler func(context.Context, *P2FileTitleUpdatedV1) error) *P2FileTitleUpdatedV1Handler { 126 h := &P2FileTitleUpdatedV1Handler{handler: handler} 127 return h 128 } 129 130 // 返回事件的消息体的实例,用于反序列化用 131 func (h *P2FileTitleUpdatedV1Handler) Event() interface{} { 132 return &P2FileTitleUpdatedV1{} 133 } 134 135 // 回调开发者注册的handle 136 func (h *P2FileTitleUpdatedV1Handler) Handle(ctx context.Context, event interface{}) error { 137 return h.handler(ctx, event.(*P2FileTitleUpdatedV1)) 138 } 139 140 // 消息处理器定义 141 type P2FileTrashedV1Handler struct { 142 handler func(context.Context, *P2FileTrashedV1) error 143 } 144 145 func NewP2FileTrashedV1Handler(handler func(context.Context, *P2FileTrashedV1) error) *P2FileTrashedV1Handler { 146 h := &P2FileTrashedV1Handler{handler: handler} 147 return h 148 } 149 150 // 返回事件的消息体的实例,用于反序列化用 151 func (h *P2FileTrashedV1Handler) Event() interface{} { 152 return &P2FileTrashedV1{} 153 } 154 155 // 回调开发者注册的handle 156 func (h *P2FileTrashedV1Handler) Handle(ctx context.Context, event interface{}) error { 157 return h.handler(ctx, event.(*P2FileTrashedV1)) 158 }