diff --git a/README.md b/README.md
index 3a87ef39..c34f24c9 100644
--- a/README.md
+++ b/README.md
@@ -34,13 +34,7 @@ If you encounter any problems during usage, please let us know by submitting [G
- The latest release candidate provides more [open services API](/service) and bug repair.
```shell
-go get github.com/larksuite/oapi-sdk-go@v1.1.39-rc3
-```
-
-- Stable version
-
-```shell
-go get github.com/larksuite/oapi-sdk-go@v1.1.28
+go get github.com/larksuite/oapi-sdk-go@v1.1.40-rc1
```
## Explanation of terms
@@ -87,11 +81,14 @@ import (
func main() {
// Configuration of "Custom App", parameter description:
// AppID、AppSecret: "Developer Console" -> "Credentials"(App ID、App Secret)
- // VerificationToken、EncryptKey:"Developer Console" -> "Event Subscriptions"(Verification Token、Encrypt Key)
- appSetting := config.NewInternalAppSettings("AppID", "AppSecret", "VerificationToken", "EncryptKey")
+ // EncryptKey、VerificationToken:"Developer Console" -> "Event Subscriptions"(Encrypt Key、Verification Token)
+ appSettings := core.NewInternalAppSettings(
+ core.SetAppCredentials("AppID", "AppSecret"), // Required
+ core.SetAppEventKey("VerificationToken", "EncryptKey"), // Not required. Required for event、card subscription
+ )
- // Currently, you are visiting larksuite, which uses default storage and default log (debug level). More optional configurations are as follows: config.NewConfig()
- conf := config.NewConfigWithDefaultStore(constants.DomainLarkSuite, appSetting, log.NewDefaultLogger(), log.LevelInfo)
+ // Currently, you are visiting larksuite, which uses default storage and default log (error level). More optional configurations are as follows: core.NewConfig()
+ conf := core.NewConfig(core.DomainLarkSuite, appSettings, core.SetLoggerLevel(core.LoggerLevelError))
// The content of the sent message
body := map[string]interface{}{
@@ -155,11 +152,14 @@ func main() {
// Configuration of "Custom App", parameter description:
// AppID、AppSecret: "Developer Console" -> "Credentials"(App ID、App Secret)
- // VerificationToken、EncryptKey:"Developer Console" -> "Event Subscriptions"(Verification Token、Encrypt Key)
- appSetting := config.NewInternalAppSettings("AppID", "AppSecret", "VerificationToken", "EncryptKey")
+ // EncryptKey、VerificationToken:"Developer Console" -> "Event Subscriptions"(Encrypt Key、Verification Token)
+ appSettings := core.NewInternalAppSettings(
+ core.SetAppCredentials("AppID", "AppSecret"), // Required
+ core.SetAppEventKey("VerificationToken", "EncryptKey"), // Not required. Required for event、card subscription
+ )
- // Currently, you are visiting larksuite, which uses default storage and default log (debug level). More optional configurations are as follows: config.NewConfig ()
- conf := config.NewConfigWithDefaultStore(constants.DomainLarkSuite, appSetting, log.NewDefaultLogger(), log.LevelInfo)
+ // Currently, you are visiting larksuite, which uses default storage and default log (error level). More optional configurations are as follows: core.NewConfig()
+ conf := core.NewConfig(core.DomainLarkSuite, appSettings, core.SetLoggerLevel(core.LoggerLevelError))
// Set the application event callback to be enabled for the first time
event.SetTypeCallback(conf, "app_open", func(ctx *core.Context, e map[string]interface{}) error {
@@ -207,11 +207,14 @@ func main() {
// Configuration of "Custom App", parameter description:
// AppID、AppSecret: "Developer Console" -> "Credentials"(App ID、App Secret)
- // VerificationToken、EncryptKey:"Developer Console" -> "Event Subscriptions"(Verification Token、Encrypt Key)
- appSetting := config.NewInternalAppSettings("AppID", "AppSecret", "VerificationToken", "EncryptKey")
+ // EncryptKey、VerificationToken:"Developer Console" -> "Event Subscriptions"(Encrypt Key、Verification Token)
+ appSettings := core.NewInternalAppSettings(
+ core.SetAppCredentials("AppID", "AppSecret"), // Required
+ core.SetAppEventKey("VerificationToken", "EncryptKey"), // Not required. Required for event、card subscription
+ )
- // Currently, you are visiting larksuite, which uses default storage and default log (debug level). More optional configurations are as follows: config.NewConfig ()
- conf := config.NewConfigWithDefaultStore(constants.DomainLarkSuite, appSetting, log.NewDefaultLogger(), log.LevelInfo)
+ // Currently, you are visiting larksuite, which uses default storage and default log (error level). More optional configurations are as follows: core.NewConfig()
+ conf := core.NewConfig(core.DomainLarkSuite, appSettings, core.SetLoggerLevel(core.LoggerLevelError))
// Set the handler of the message card
// Return value: can be nil, JSON string of new message card
@@ -239,7 +242,7 @@ func main() {
```go
import (
- "github.com/larksuite/oapi-sdk-go/core/config"
+ "github.com/larksuite/oapi-sdk-go/core"
)
// To prevent application information leakage, in the configuration environment variables, the variables (4) are described as follows:
@@ -247,19 +250,29 @@ import (
// APP_Secret: "Developer Console" -> "Credentials"(App Secret)
// VERIFICATION_Token: VerificationToken、EncryptKey:"Developer Console" -> "Event Subscriptions"(Verification Token)
// ENCRYPT_Key: VerificationToken、EncryptKey:"Developer Console" -> "Event Subscriptions"(Encrypt Key)
+// HELP_DESK_ID: Help desk setting -> ID
+// HELP_DESK_TOKEN: Help desk setting -> Token
// The configuration of "Custom App" is obtained through environment variables
-appSettings := config.GetInternalAppSettingsByEnv()
+appSettings := core.GetInternalAppSettingsByEnv()
// The configuration of "Marketplace App" is obtained through environment variables
-appSettings := config.GetISVAppSettingsByEnv()
+appSettings := core.GetISVAppSettingsByEnv()
// Parameter Description:
// AppID、AppSecret: "Developer Console" -> "Credentials"(App ID、App Secret)
// VerificationToken、EncryptKey:"Developer Console" -> "Event Subscriptions"(Verification Token、Encrypt Key)
+// HelpDeskID、HelpDeskToken:Help desk setting -> ID、Token
// The configuration of "Custom App"
-appSettings := config.NewInternalAppSettings(appID, appSecret, verificationToken, encryptKey string)
+appSettings := core.NewInternalAppSettings(
+core.SetAppCredentials("AppID", "AppSecret"), // Required
+core.SetAppEventKey("VerificationToken", "EncryptKey"), // Not required. Required for event、card subscription
+core.SetHelpDeskCredentials("HelpDeskID", "HelpDeskToken"), // Not required. Required to access the service desk API
+)
// The configuration of "Marketplace App"
-appSettings := config.NewISVAppSettings(appID, appSecret, verificationToken, encryptKey string)
-
+appSettings := core.NewISVAppSettings(
+core.SetAppCredentials("AppID", "AppSecret"), // Required
+core.SetAppEventKey("VerificationToken", "EncryptKey"), // Not required. Required for event、card subscription
+core.SetHelpDeskCredentials("HelpDeskID", "HelpDeskToken"), // Not required. Required to access the service desk API
+)
```
### How to build overall configuration(Config)
@@ -279,31 +292,21 @@ appSettings := config.NewISVAppSettings(appID, appSecret, verificationToken, enc
implementation of the storage interface (store) needs to support distributed storage.
```go
-
import (
- "github.com/larksuite/oapi-sdk-go/core/config"
- "github.com/larksuite/oapi-sdk-go/core/constants"
+ "github.com/larksuite/oapi-sdk-go/core"
+ "github.com/larksuite/oapi-sdk-go/core/config"
"github.com/larksuite/oapi-sdk-go/core/log"
"github.com/larksuite/oapi-sdk-go/core/store"
)
-// Method 1: it is recommended to use redis to implement the store interface, so as to reduce the times of accessing the accesstoken interface
-// Parameter Description:
-// domain:URL domain address, value range: constants.DomainLarkSuite / constants.FeiShu / Other domain addresses
-// appSettings:App setting
-// logger:[Log interface](core/log/log.go)
-// loggerLevel: log.LevelInfo/LevelInfo/LevelWarn/LevelError
-// store: [Store interface](core/store/store.go), used to store app_ticket/access_token
-conf := config.NewConfig(domain constants.Domain, appSettings *AppSettings, logger log.Logger, logLevel log.Level, store store.Store)
-
-// Method 2: use the implementation of the default storage interface (store), which is suitable for light-weight use (not suitable: "Marketplace App" applies or calls the server API frequently)
// Parameter Description:
-// domain:constants.DomainLarkSuite / constants.FeiShu / Other domain addresses
-// appSettings:App setting
-// logger:[Log interface](core/log/log.go)
-// loggerLevel:log level: log.LevelInfo/LevelInfo/LevelWarn/LevelError
-conf := config.NewConfigWithDefaultStore(domain constants.Domain, appSettings *AppSettings, logger log.Logger, logLevel log.Level)
-
+// domain:URL domain address, value range: core.DomainFeiShu / core.DomainLarkSuite / 其他URL域名地址
+// appSettings:App settings
+// opts:Option parameters
+ // core.SetLogger(logger log.Logger), Set logger. The default is console output
+ // core.SetLoggerLevel(core.LoggerLevelDebug), Set the logger log level, and the default is: core.LoggerLevelError
+ // core.SetStore(store store.Store), Set Store([Store interface](core/store/store.go), used to store app_ticket/access_token),it is recommended to use redis to implement the store interface, so as to reduce the times of accessing the accesstoken interface. The default is: memory (sync.Map) storage
+conf = core.NewConfig(domain Domain, appSettings *config.AppSettings, opts ...ConfigOpt)
```
### How to build a request(Request)
@@ -330,6 +333,7 @@ import (
// request.SetNotDataField(), set whether the response does not have a `data` field, business interfaces all have `data `Field, so you don’t need to set
// request.SetTenantKey("TenantKey"), as an `app store application`, it means using `tenant_access_token` to access the API, you need to set
// request.SetUserAccessToken("UserAccessToken"), which means using` user_access_token` To access the API, you need to set
+ // request.NeedHelpDeskAuth(), Indicates that the help desk API needs to set help desk information of config.appsettings
req := request.NewRequestWithNative(httpPath, httpMethod string, accessTokenType AccessTokenType,
input interface{}, output interface{}, optFns ...OptFn)
```
diff --git a/README.zh.md b/README.zh.md
index 48643a64..d7186f01 100644
--- a/README.zh.md
+++ b/README.zh.md
@@ -11,7 +11,7 @@
- 飞书开发接口SDK,便捷调用服务端API与订阅服务端事件,例如:消息&群组、通讯录、日历、视频会议、云文档、 OKR等具体可以访问 [飞书开放平台文档](https://open.feishu.cn/document/) 看看【服务端
API】。
-## Problem feedback
+## 问题反馈
---
@@ -27,16 +27,8 @@
---
-- 最新的发布候选版本,提供更多[开放服务 API](/service) 以及 Bug 修复
-
```shell
-go get github.com/larksuite/oapi-sdk-go@v1.1.39-rc3
-```
-
-- 稳定版本
-
-```shell
-go get github.com/larksuite/oapi-sdk-go@v1.1.28
+go get github.com/larksuite/oapi-sdk-go@v1.1.40-rc1
```
## 术语解释
@@ -57,12 +49,14 @@ go get github.com/larksuite/oapi-sdk-go@v1.1.28
- **必看** [如何调用服务端API](https://open.feishu.cn/document/ukTMukTMukTM/uYTM5UjL2ETO14iNxkTN/guide-to-use-server-api)
,了解调用服务端API的过程及注意事项。
- - 由于SDK已经封装了app_access_token、tenant_access_token的获取,所以在调业务API的时候,不需要去获取app_access_token、tenant_access_token。如果业务接口需要使用user_access_token,需要进行设置(request.SetUserAccessToken("UserAccessToken")),具体请看 README.zh.md -> 如何构建请求(Request)
+ - 由于SDK已经封装了 app_access_token、tenant_access_token 的获取,所以在调业务API的时候,不需要去获取 app_access_token、tenant_access_token。如果业务接口需要使用 user_access_token,需要进行设置(request.SetUserAccessToken("UserAccessToken")),具体请看 README.zh.md -> 如何构建请求(Request)
- 更多示例,请看:[sample/api/api.go](sample/api/api.go)(含:文件的上传与下载)
-#### 使用`企业自建应用`访问 发送文本消息API 示例
+#### [使用`应用商店应用`调用 服务端API 示例](doc/ISV.APP.README.zh.md)
-- 有些老版接口,没有直接可以使用的SDK,可以使用`原生`模式。
+#### 使用`企业自建应用`访问 [发送消息API](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/create) 示例
+
+- 在 [service](./service) 下的业务 API,都是可以直接使用SDK。
```go
package main
@@ -70,14 +64,11 @@ package main
import (
"context"
"fmt"
- "github.com/larksuite/oapi-sdk-go/api"
- "github.com/larksuite/oapi-sdk-go/api/core/request"
"github.com/larksuite/oapi-sdk-go/api/core/response"
"github.com/larksuite/oapi-sdk-go/core"
"github.com/larksuite/oapi-sdk-go/core/config"
- "github.com/larksuite/oapi-sdk-go/core/constants"
- "github.com/larksuite/oapi-sdk-go/core/log"
"github.com/larksuite/oapi-sdk-go/core/tools"
+ im "github.com/larksuite/oapi-sdk-go/service/im/v1"
)
var conf *config.Config
@@ -85,50 +76,43 @@ var conf *config.Config
func init() {
// 企业自建应用的配置
// AppID、AppSecret: "开发者后台" -> "凭证与基础信息" -> 应用凭证(App ID、App Secret)
- // VerificationToken、EncryptKey:"开发者后台" -> "事件订阅" -> 事件订阅(Verification Token、Encrypt Key)。
- appSetting := config.NewInternalAppSettings("AppID", "AppSecret", "VerificationToken", "EncryptKey")
-
- // 当前访问的是飞书,使用默认存储、默认日志(Debug级别),更多可选配置,请看:README.zh.md->高级使用->如何构建整体配置(Config)。
- conf = config.NewConfigWithDefaultStore(constants.DomainFeiShu, appSetting, log.NewDefaultLogger(), log.LevelInfo)
+ // EncryptKey、VerificationToken:"开发者后台" -> "事件订阅" -> 事件订阅(Encrypt Key、Verification Token)
+ // HelpDeskID、HelpDeskToken:https://open.feishu.cn/document/ukTMukTMukTM/ugDOyYjL4gjM24CO4IjN
+ // 更多介绍请看:Github->README.zh.md->如何构建应用配置(AppSettings)
+ appSettings := core.GetInternalAppSettingsByEnv()
+
+ // 当前访问的是飞书,使用默认的内存存储(app/tenant access token)、默认日志(Error级别)
+ // 更多介绍请看:Github->README.zh.md->如何构建整体配置(Config)
+ conf = core.NewConfig(core.DomainFeiShu, appSettings, core.SetLoggerLevel(core.LoggerLevelError))
}
func main() {
- // 发送消息的内容
- body := map[string]interface{}{
- "open_id": "user open id",
- "msg_type": "text",
- "content": map[string]interface{}{
- "text": "test send message",
- },
- }
- // 请求发送消息的结果
- ret := make(map[string]interface{})
- // 构建请求
- req := request.NewRequestWithNative("message/v4/send", "POST", request.AccessTokenTypeTenant, body, &ret)
- // 请求的上下文
+ imService := im.NewService(conf)
coreCtx := core.WrapContext(context.Background())
- // 发送请求
- err := api.Send(coreCtx, conf, req)
- // 打印请求的RequestID
+ reqCall := imService.Messages.Create(coreCtx, &im.MessageCreateReqBody{
+ ReceiveId: "ou_a11d2bcc7d852afbcaf37e5b3ad01f7e",
+ Content: "{\"text\":\"Tom test content\"}",
+ MsgType: "text",
+ })
+ reqCall.SetReceiveIdType("open_id")
+ message, err := reqCall.Do()
+ // 打印 request_id 方便 oncall 时排查问题
fmt.Println(coreCtx.GetRequestID())
- // 打印请求的响应状态吗
fmt.Println(coreCtx.GetHTTPStatusCode())
- // 请求的error处理
if err != nil {
+ fmt.Println(tools.Prettify(err))
e := err.(*response.Error)
fmt.Println(e.Code)
fmt.Println(e.Msg)
- fmt.Println(tools.Prettify(err))
return
}
- // 打印请求的结果
- fmt.Println(tools.Prettify(ret))
+ fmt.Println(tools.Prettify(message))
}
```
-#### 使用`企业自建应用`访问 修改用户部分信息API 示例
+#### 使用`企业自建应用`访问 [发送文本消息API](https://open.feishu.cn/document/ukTMukTMukTM/uUjNz4SN2MjL1YzM) 示例
-- 该接口是新的接口(请看"README.zh.md -> 已生成SDK的业务服务"),可以直接使用SDK。
+- 有些老版接口,没有直接可以使用的SDK,可以使用`原生`模式。
```go
package main
@@ -136,39 +120,46 @@ package main
import (
"context"
"fmt"
+ "github.com/larksuite/oapi-sdk-go/api"
+ "github.com/larksuite/oapi-sdk-go/api/core/request"
"github.com/larksuite/oapi-sdk-go/api/core/response"
"github.com/larksuite/oapi-sdk-go/core"
"github.com/larksuite/oapi-sdk-go/core/config"
"github.com/larksuite/oapi-sdk-go/core/constants"
"github.com/larksuite/oapi-sdk-go/core/log"
"github.com/larksuite/oapi-sdk-go/core/tools"
- contact "github.com/larksuite/oapi-sdk-go/service/contact/v3"
)
var conf *config.Config
func init() {
- // 企业自建应用的配置
- // AppID、AppSecret: "开发者后台" -> "凭证与基础信息" -> 应用凭证(App ID、App Secret)
- // VerificationToken、EncryptKey:"开发者后台" -> "事件订阅" -> 事件订阅(Verification Token、Encrypt Key)。
- appSetting := config.NewInternalAppSettings("AppID", "AppSecret", "VerificationToken", "EncryptKey")
-
- // 当前访问的是飞书,使用默认存储、默认日志(Debug级别),更多可选配置,请看:README.zh.md->高级使用->如何构建整体配置(Config)。
- conf = config.NewConfigWithDefaultStore(constants.DomainFeiShu, appSetting, log.NewDefaultLogger(), log.LevelInfo)
+ appSettings := core.NewInternalAppSettings(
+ core.SetAppCredentials("AppID", "AppSecret"), // 必需
+ core.SetAppEventKey("VerificationToken", "EncryptKey"), // 非必需,订阅事件、消息卡片时必需
+ core.SetHelpDeskCredentials("HelpDeskID", "HelpDeskToken")) // 非必需,使用服务台API时必需
+
+ // 当前访问的是飞书,使用默认的内存存储(app/tenant access token)、默认日志(Error级别)
+ // 更多介绍请看:Github->README.zh.md->如何构建整体配置(Config)
+ conf = core.NewConfig(core.DomainFeiShu, appSettings, core.SetLoggerLevel(core.LoggerLevelError))
}
func main() {
- service := contact.NewService(conf)
+ // 发送消息的内容
+ body := map[string]interface{}{
+ "open_id": "user open id",
+ "msg_type": "text",
+ "content": map[string]interface{}{
+ "text": "test send message",
+ },
+ }
+ // 请求发送消息的结果
+ ret := make(map[string]interface{})
+ // 构建请求
+ req := request.NewRequestWithNative("/open-apis/message/v4/send", "POST", request.AccessTokenTypeTenant, body, &ret)
+ // 请求的上下文
coreCtx := core.WrapContext(context.Background())
- body := &contact.User{}
- body.Name = "rename"
- // 由于这是一个PATCH请求,需要明确更新哪些字段
- body.ForceSendFields = append(body.ForceSendFields, "Name")
- reqCall := service.Users.Patch(coreCtx, body)
- reqCall.SetUserId("user id")
- reqCall.SetUserIdType("user_id")
// 发送请求
- result, err := reqCall.Do()
+ err := api.Send(coreCtx, conf, req)
// 打印请求的RequestID
fmt.Println(coreCtx.GetRequestID())
// 打印请求的响应状态吗
@@ -182,20 +173,18 @@ func main() {
return
}
// 打印请求的结果
- fmt.Println(tools.Prettify(result))
+ fmt.Println(tools.Prettify(ret))
}
```
-#### [使用`应用商店应用`调用 服务端API 示例](doc/ISV.APP.README.zh.md)
-
### 订阅服务端事件
- **必看** [订阅事件概述](https://open.feishu.cn/document/ukTMukTMukTM/uUTNz4SN1MjL1UzM) ,了解订阅事件的过程及注意事项。
- 更多使用示例,请看[sample/event](sample/event)(含:结合gin的使用)
-#### 使用`企业自建应用` 订阅 [首次启用应用事件](https://open.feishu.cn/document/ukTMukTMukTM/uQTNxYjL0UTM24CN1EjN) 示例
+#### 使用`企业自建应用`订阅 [员工变更事件](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/user/events/updated) 示例
-- 有些老的事件,没有直接可以使用的SDK,可以使用`原生`模式
+- 在 [service](./service) 下的业务 Event,都是可以直接使用SDK。
```go
package main
@@ -204,11 +193,9 @@ import (
"fmt"
"github.com/larksuite/oapi-sdk-go/core"
"github.com/larksuite/oapi-sdk-go/core/config"
- "github.com/larksuite/oapi-sdk-go/core/constants"
- "github.com/larksuite/oapi-sdk-go/core/log"
"github.com/larksuite/oapi-sdk-go/core/tools"
- "github.com/larksuite/oapi-sdk-go/event"
eventhttpserver "github.com/larksuite/oapi-sdk-go/event/http/native"
+ contact "github.com/larksuite/oapi-sdk-go/service/contact/v3"
"net/http"
)
@@ -217,20 +204,26 @@ var conf *config.Config
func init() {
// 企业自建应用的配置
// AppID、AppSecret: "开发者后台" -> "凭证与基础信息" -> 应用凭证(App ID、App Secret)
- // VerificationToken、EncryptKey:"开发者后台" -> "事件订阅" -> 事件订阅(Verification Token、Encrypt Key)。
- appSetting := config.NewInternalAppSettings("AppID", "AppSecret", "VerificationToken", "EncryptKey")
-
- // 当前访问的是飞书,使用默认存储、默认日志(Debug级别),更多可选配置,请看:README.zh.md->高级使用->如何构建整体配置(Config)。
- conf = config.NewConfigWithDefaultStore(constants.DomainFeiShu, appSetting, log.NewDefaultLogger(), log.LevelInfo)
+ // EncryptKey、VerificationToken:"开发者后台" -> "事件订阅" -> 事件订阅(Encrypt Key、Verification Token)
+ // HelpDeskID、HelpDeskToken:https://open.feishu.cn/document/ukTMukTMukTM/ugDOyYjL4gjM24CO4IjN
+ // 更多介绍请看:Github->README.zh.md->如何构建应用配置(AppSettings)
+ appSettings := core.NewInternalAppSettings(
+ core.SetAppCredentials("AppID", "AppSecret"), // 必需
+ core.SetAppEventKey("VerificationToken", "EncryptKey"), // 非必需,订阅事件、消息卡片时必需
+ core.SetHelpDeskCredentials("HelpDeskID", "HelpDeskToken")) // 非必需,使用服务台API时必需
+
+ // 当前访问的是飞书,使用默认的内存存储(app/tenant access token)、默认日志(Error级别)
+ // 更多介绍请看:Github->README.zh.md->如何构建整体配置(Config)
+ conf = core.NewConfig(core.DomainFeiShu, appSettings, core.SetLoggerLevel(core.LoggerLevelError))
}
func main() {
- // 设置首次启用应用事件callback
- event.SetTypeCallback(conf, "app_open", func(ctx *core.Context, e map[string]interface{}) error {
- // 打印请求的Request ID
+ // 设置用户数据变更事件处理者
+ contact.SetUserUpdatedEventHandler(conf, func(ctx *core.Context, event *contact.UserUpdatedEvent) error {
+ // 打印请求的Request ID,方便 oncall 排查问题
fmt.Println(ctx.GetRequestID())
// 打印事件
- fmt.Println(tools.Prettify(e))
+ fmt.Println(tools.Prettify(event))
return nil
})
@@ -244,9 +237,9 @@ func main() {
}
```
-#### 使用`企业自建应用`订阅 [用户数据变更事件](https://open.feishu.cn/document/ukTMukTMukTM/uITNxYjLyUTM24iM1EjN#70402aa) 示例
+#### 使用`企业自建应用` 订阅 [首次启用应用事件](https://open.feishu.cn/document/ukTMukTMukTM/uQTNxYjL0UTM24CN1EjN) 示例
-- 该接口是新的事件,可以直接使用SDK
+- 有些老的事件,没有直接可以使用的SDK,可以使用`原生`模式
```go
package main
@@ -255,11 +248,9 @@ import (
"fmt"
"github.com/larksuite/oapi-sdk-go/core"
"github.com/larksuite/oapi-sdk-go/core/config"
- "github.com/larksuite/oapi-sdk-go/core/constants"
- "github.com/larksuite/oapi-sdk-go/core/log"
"github.com/larksuite/oapi-sdk-go/core/tools"
+ "github.com/larksuite/oapi-sdk-go/event"
eventhttpserver "github.com/larksuite/oapi-sdk-go/event/http/native"
- contact "github.com/larksuite/oapi-sdk-go/service/contact/v3"
"net/http"
)
@@ -268,20 +259,26 @@ var conf *config.Config
func init() {
// 企业自建应用的配置
// AppID、AppSecret: "开发者后台" -> "凭证与基础信息" -> 应用凭证(App ID、App Secret)
- // VerificationToken、EncryptKey:"开发者后台" -> "事件订阅" -> 事件订阅(Verification Token、Encrypt Key)。
- appSetting := config.NewInternalAppSettings("AppID", "AppSecret", "VerificationToken", "EncryptKey")
-
- // 当前访问的是飞书,使用默认存储、默认日志(Debug级别),更多可选配置,请看:README.zh.md->高级使用->如何构建整体配置(Config)。
- conf = config.NewConfigWithDefaultStore(constants.DomainFeiShu, appSetting, log.NewDefaultLogger(), log.LevelInfo)
+ // EncryptKey、VerificationToken:"开发者后台" -> "事件订阅" -> 事件订阅(Encrypt Key、Verification Token)
+ // HelpDeskID、HelpDeskToken:https://open.feishu.cn/document/ukTMukTMukTM/ugDOyYjL4gjM24CO4IjN
+ // 更多介绍请看:Github->README.zh.md->如何构建应用配置(AppSettings)
+ appSettings := core.NewInternalAppSettings(
+ core.SetAppCredentials("AppID", "AppSecret"), // 必需
+ core.SetAppEventKey("VerificationToken", "EncryptKey"), // 非必需,订阅事件、消息卡片时必需
+ core.SetHelpDeskCredentials("HelpDeskID", "HelpDeskToken")) // 非必需,使用服务台API时必需
+
+ // 当前访问的是飞书,使用默认的内存存储(app/tenant access token)、默认日志(Error级别)
+ // 更多介绍请看:Github->README.zh.md->如何构建整体配置(Config)
+ conf = core.NewConfig(core.DomainFeiShu, appSettings, core.SetLoggerLevel(core.LoggerLevelError))
}
func main() {
- // 设置用户数据变更事件处理者
- contact.SetUserUpdatedEventHandler(conf, func(ctx *core.Context, event *contact.UserUpdatedEvent) error {
+ // 设置首次启用应用事件callback
+ event.SetTypeCallback(conf, "app_open", func(ctx *core.Context, e map[string]interface{}) error {
// 打印请求的Request ID
fmt.Println(ctx.GetRequestID())
// 打印事件
- fmt.Println(tools.Prettify(event))
+ fmt.Println(tools.Prettify(e))
return nil
})
@@ -312,8 +309,6 @@ import (
"github.com/larksuite/oapi-sdk-go/card/model"
"github.com/larksuite/oapi-sdk-go/core"
"github.com/larksuite/oapi-sdk-go/core/config"
- "github.com/larksuite/oapi-sdk-go/core/constants"
- "github.com/larksuite/oapi-sdk-go/core/log"
"github.com/larksuite/oapi-sdk-go/core/tools"
"net/http"
)
@@ -323,11 +318,17 @@ var conf *config.Config
func init() {
// 企业自建应用的配置
// AppID、AppSecret: "开发者后台" -> "凭证与基础信息" -> 应用凭证(App ID、App Secret)
- // VerificationToken、EncryptKey:"开发者后台" -> "事件订阅" -> 事件订阅(Verification Token、Encrypt Key)。
- appSetting := config.NewInternalAppSettings("AppID", "AppSecret", "VerificationToken", "EncryptKey")
-
- // 当前访问的是飞书,使用默认存储、默认日志(Debug级别),更多可选配置,请看:README.zh.md->高级使用->如何构建整体配置(Config)。
- conf = config.NewConfigWithDefaultStore(constants.DomainFeiShu, appSetting, log.NewDefaultLogger(), log.LevelInfo)
+ // EncryptKey、VerificationToken:"开发者后台" -> "事件订阅" -> 事件订阅(Encrypt Key、Verification Token)
+ // HelpDeskID、HelpDeskToken:https://open.feishu.cn/document/ukTMukTMukTM/ugDOyYjL4gjM24CO4IjN
+ // 更多介绍请看:Github->README.zh.md->如何构建应用配置(AppSettings)
+ appSettings := core.NewInternalAppSettings(
+ core.SetAppCredentials("AppID", "AppSecret"), // 必需
+ core.SetAppEventKey("VerificationToken", "EncryptKey"), // 非必需,订阅事件、消息卡片时必需
+ core.SetHelpDeskCredentials("HelpDeskID", "HelpDeskToken")) // 非必需,使用服务台API时必需
+
+ // 当前访问的是飞书,使用默认的内存存储(app/tenant access token)、默认日志(Error级别)
+ // 更多介绍请看:Github->README.zh.md->如何构建整体配置(Config)
+ conf = core.NewConfig(core.DomainFeiShu, appSettings, core.SetLoggerLevel(core.LoggerLevelError))
}
func main() {
@@ -346,17 +347,13 @@ func main() {
panic(err)
}
}
-```
-
-## 高级使用
-
----
+```
-### 如何构建应用配置(AppSettings)
+## 如何构建应用配置(AppSettings)
```go
import (
- "github.com/larksuite/oapi-sdk-go/core/config"
+ "github.com/larksuite/oapi-sdk-go/core"
)
// 防止应用信息泄漏,配置环境变量中,变量(4个)说明:
@@ -364,23 +361,34 @@ import (
// APP_SECRET:"开发者后台" -> "凭证与基础信息" -> 应用凭证 App Secret
// VERIFICATION_TOKEN:"开发者后台" -> "事件订阅" -> 事件订阅 Verification Token
// ENCRYPT_KEY:"开发者后台" -> "事件订阅" -> 事件订阅 Encrypt Key
+// HELP_DESK_ID: 服务台设置中心 -> ID
+// HELP_DESK_TOKEN: 服务台设置中心 -> 令牌
// 企业自建应用的配置,通过环境变量获取应用配置
-appSettings := config.GetInternalAppSettingsByEnv()
+appSettings := core.GetInternalAppSettingsByEnv()
// 应用商店应用的配置,通过环境变量获取应用配置
-appSettings := config.GetISVAppSettingsByEnv()
+appSettings := core.GetISVAppSettingsByEnv()
// 参数说明:
// AppID、AppSecret: "开发者后台" -> "凭证与基础信息" -> 应用凭证(App ID、App Secret)
// VerificationToken、EncryptKey:"开发者后台" -> "事件订阅" -> 事件订阅(Verification Token、Encrypt Key)
+// HelpDeskID、HelpDeskToken:服务台设置中心 -> ID、令牌
// 企业自建应用的配置
-appSettings := config.NewInternalAppSettings(appID, appSecret, verificationToken, encryptKey string)
+appSettings := core.NewInternalAppSettings(
+core.SetAppCredentials("AppID", "AppSecret"), // 必需
+core.SetAppEventKey("VerificationToken", "EncryptKey"), // 非必需,事件订阅时必需
+core.SetHelpDeskCredentials("HelpDeskID", "HelpDeskToken"), // 非必需,访问服务台 API 时必需
+)
// 应用商店应用的配置
-appSettings := config.NewISVAppSettings(appID, appSecret, verificationToken, encryptKey string)
+appSettings := core.NewISVAppSettings(
+core.SetAppCredentials("AppID", "AppSecret"), // 必需
+core.SetAppEventKey("VerificationToken", "EncryptKey"), // 非必需,事件订阅时必需
+core.SetHelpDeskCredentials("HelpDeskID", "HelpDeskToken"), // 非必需,访问服务台 API 时必需
+)
```
-### 如何构建整体配置(Config)
+## 如何构建整体配置(Config)
- 访问 飞书、LarkSuite或者其他
- 应用的配置
@@ -393,32 +401,23 @@ appSettings := config.NewISVAppSettings(appID, appSecret, verificationToken, enc
```go
import (
- "github.com/larksuite/oapi-sdk-go/core/config"
- "github.com/larksuite/oapi-sdk-go/core/constants"
+ "github.com/larksuite/oapi-sdk-go/core"
+ "github.com/larksuite/oapi-sdk-go/core/config"
"github.com/larksuite/oapi-sdk-go/core/log"
"github.com/larksuite/oapi-sdk-go/core/store"
)
-// 方法一,推荐使用Redis实现存储接口(Store),减少访问获取AccessToken接口的次数
// 参数说明:
-// domain:URL域名地址,值范围:constants.DomainFeiShu / constants.DomainLarkSuite / 其他URL域名地址
+// domain:URL域名地址,值范围:core.DomainFeiShu / core.DomainLarkSuite / 其他URL域名地址
// appSettings:应用配置
-// logger:[日志接口](core/log/log.go)
-// loggerLevel:输出的日志级别 log.LevelInfo/LevelInfo/LevelWarn/LevelError
-// store: [存储接口](core/store/store.go),用来存储 app_ticket/access_token
-conf := config.NewConfig(domain constants.Domain, appSettings *AppSettings, logger log.Logger, logLevel log.Level, store store.Store)
-
-// 方法二,使用默认的存储接口(Store)的实现,适合轻量的使用(不合适:应用商店应用或调用服务端API次数频繁)
-// 参数说明:
-// domain:constants.DomainFeiShu / constants.DomainLarkSuite / 其他域名地址
-// appSettings:应用配置
-// logger:[日志接口](core/log/log.go)
-// loggerLevel:输出的日志级别 log.LevelInfo/LevelInfo/LevelWarn/LevelError
-conf := config.NewConfigWithDefaultStore(domain constants.Domain, appSettings *AppSettings, logger log.Logger, logLevel log.Level)
-
+// opts:选项参数
+ // core.SetLogger(logger log.Logger) ,设置 Logger, 默认是:控制台输出
+ // core.SetLoggerLevel(core.LoggerLevelDebug),设置 Logger日志级别, 默认是:core.LoggerLevelError
+ // core.SetStore(store store.Store),设置 Store([存储接口](core/store/store.go),用来存储 app_ticket/access_token),推荐使用Redis实现存储接口(Store),减少访问获取AccessToken接口的次数。默认是:内存(sync.Map)存储
+conf = core.NewConfig(domain Domain, appSettings *config.AppSettings, opts ...ConfigOpt)
```
-### 如何构建请求(Request)
+## 如何构建请求(Request)
- 有些老版接口,没有直接可以使用的SDK,可以使用原生模式,这时需要构建请求。
- 更多示例,请看:[sample/api/api.go](sample/api/api.go)(含:文件的上传与下载)
@@ -429,7 +428,11 @@ import (
)
// 参数说明:
-// httpPath:API路径(`open-apis/`之后的路径),例如:https://domain/open-apis/contact/v3/users/:user_id,则 httpPath:"contact/v3/users/:user_id"
+// httpPath:API路径
+ // 例如:https://domain/open-apis/contact/v3/users/:user_id,
+ // 支持域名之后的路径,则 httpPath:"/open-apis/contact/v3/users/:user_id"(推荐)
+ // 也支持全路径,则 httpPath:"/open-apis/contact/v3/users/:user_id"
+ // 也支持 /open-apis/ 之后的路径,则 httpPath:"contact/v3/users/:user_id"
// httpMethod: GET/POST/PUT/BATCH/DELETE
// accessTokenType:API使用哪种访问凭证,取值范围:request.AccessTokenTypeApp/request.AccessTokenTypeTenant/request.AccessTokenTypeUser,例如:request.AccessTokenTypeTenant
// input:请求体(可能是request.NewFormData()(例如:文件上传)),如果不需要请求体(例如一些GET请求),则传:nil
@@ -441,11 +444,12 @@ import (
// request.SetNotDataField(),设置响应的是否 没有`data`字段,业务接口都是有`data`字段,所以不需要设置
// request.SetTenantKey("TenantKey"),以`应用商店应用`身份,表示使用`tenant_access_token`访问API,需要设置
// request.SetUserAccessToken("UserAccessToken"),表示使用`user_access_token`访问API,需要设置
+ // request.NeedHelpDeskAuth(),表示是服务台API,需要设置 config.AppSettings 的 help desk 信息
req := request.NewRequestWithNative(httpPath, httpMethod string, accessTokenType AccessTokenType, input interface{}, output interface{}, optFns ...OptFn)
```
-### 如何构建请求上下文(core.Context)及常用方法
+## 如何构建请求上下文(core.Context)及常用方法
```go
import(
@@ -470,7 +474,7 @@ conf := config.ByCtx(ctx *core.Context)
```
-### 如何发送请求
+## 如何发送请求
- 由于SDK已经封装了app_access_token、tenant_access_token的获取,所以在调业务API的时候,不需要去获取app_access_token、tenant_access_token。如果业务接口需要使用user_access_token,需要进行设置(request.SetUserAccessToken("UserAccessToken")),具体请看 README.zh.md -> 如何构建请求(Request)
- 更多使用示例,请看:[sample/api/api.go](sample/api/api.go)
@@ -497,7 +501,7 @@ err := api.Send(ctx *core.Context, conf *config.Config, req *request.Request)
```
-### 下载文件工具
+## 下载文件工具
- 通过网络请求下载文件
- 更多使用示例,请看:[sample/tools/file_download.go](sample/tools/file_download.go)
@@ -528,32 +532,11 @@ readCloser, err := tools.DownloadFileToStream(ctx context.Context, url string)
```
-## 已生成SDK的业务服务
-
----
-
-|业务域|版本|路径|API示例|Event示例|
-|---|---|---|----|---|
-|[用户身份验证](https://open.feishu.cn/document/ukTMukTMukTM/uETOwYjLxkDM24SM5AjN)|v1|[service/authen](service/authen)|[sample/api/authen.go](sample/api/authen.go)||
-|[通讯录](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/introduction)|v3|[service/contact](service/contact)|[sample/api/contact.go](sample/api/contact.go)|[sample/event/contact.go](sample/event/contact.go)|
-|[日历](https://open.feishu.cn/document/ukTMukTMukTM/uETM3YjLxEzN24SMxcjN)|v4|[service/calendar](service/calendar)|[sample/api/calendar.go](sample/api/calendar.go)||
-|[视频会议](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/videoconference/guide)|v1|[service/vc](service/vc)|[sample/api/vc.go](sample/api/vc.go)||
-|[云空间文件](https://open.feishu.cn/document/ukTMukTMukTM/uUjM5YjL1ITO24SNykjN)|v1|[service/drive](service/drive)|[sample/api/drive.go](sample/api/drive.go)||
-|[消息&群组](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/create)|v1|[service/im](service/im)|[sample/api/im.go](sample/api/im.go)|[sample/event/im.go](sample/event/im.go)|
-|[AI能力-光学字符识别(OCR)](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/ai/optical_char_recognition-v1/image/basic_recognize)|v1|[service/optical_char_recognition](service/optical_char_recognition)|[sample/api/optical_char_recognition.go](sample/api/optical_char_recognition.go)||
-|[AI能力-语音识别(ASR)](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/ai/speech_to_text-v1/speech/stream_recognize)|v1|[service/speech_to_text](service/speech_to_text)|[sample/api/speech_to_text.go](sample/api/speech_to_text.go)||
-|[AI能力-机器翻译(MT)](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/ai/translation-v1/text/translate)|v1|[service/translation](service/translation)|[sample/api/translation.go](sample/api/translation.go)||
-
## License
---
- MIT
-## 联系我们
-
----
-
-- 飞书:[服务端SDK](https://open.feishu.cn/document/ukTMukTMukTM/uETO1YjLxkTN24SM5UjN) 页面右上角【这篇文档是否对你有帮助?】提交反馈
diff --git a/api/api.go b/api/api.go
index f38ec449..01ee17b2 100644
--- a/api/api.go
+++ b/api/api.go
@@ -6,11 +6,10 @@ import (
"github.com/larksuite/oapi-sdk-go/api/core/response"
"github.com/larksuite/oapi-sdk-go/core"
"github.com/larksuite/oapi-sdk-go/core/config"
- "sync"
)
func Send(ctx *core.Context, conf *config.Config, req *request.Request) error {
- conf.WithContext(ctx)
+ ctx.Set(config.CtxKeyConfig, conf)
req.WithContext(ctx)
handlers.Handle(ctx, req)
if req.Err == nil {
@@ -18,54 +17,3 @@ func Send(ctx *core.Context, conf *config.Config, req *request.Request) error {
}
return response.ToError(req.Err)
}
-
-type ErrorCallback = func(reqCall ReqCaller, err error)
-
-type ReqCallDone struct {
- ctx *core.Context
- Result interface{}
- Err interface{}
-}
-
-type ReqCaller interface {
- Ctx() *core.Context
- Do() (interface{}, error)
-}
-
-type BatchReqCall struct {
- wg sync.WaitGroup
- reqCalls []ReqCaller
- ReqCallDos []*ReqCallDone
- errorCallback ErrorCallback
-}
-
-func NewBatchReqCall(errorCallback ErrorCallback, reqCalls ...ReqCaller) *BatchReqCall {
- reqCallDos := make([]*ReqCallDone, 0, len(reqCalls))
- for _, reqCall := range reqCalls {
- reqCallDos = append(reqCallDos, &ReqCallDone{
- ctx: reqCall.Ctx(),
- })
- }
- return &BatchReqCall{
- reqCalls: reqCalls,
- ReqCallDos: reqCallDos,
- errorCallback: errorCallback,
- }
-}
-
-func (c *BatchReqCall) Do() *BatchReqCall {
- c.wg.Add(len(c.reqCalls))
- for i, reqCaller := range c.reqCalls {
- go func(i int, rc ReqCaller) {
- defer c.wg.Done()
- result, err := rc.Do()
- c.ReqCallDos[i].Result = result
- c.ReqCallDos[i].Err = err
- if err != nil {
- c.errorCallback(rc, err)
- }
- }(i, reqCaller)
- }
- c.wg.Wait()
- return c
-}
diff --git a/api/core/handlers/handlers.go b/api/core/handlers/handlers.go
index bae77eae..897bb66e 100644
--- a/api/core/handlers/handlers.go
+++ b/api/core/handlers/handlers.go
@@ -3,9 +3,10 @@ package handlers
import (
"bytes"
"encoding/json"
+ "errors"
"fmt"
"github.com/larksuite/oapi-sdk-go/api/core/constants"
- "github.com/larksuite/oapi-sdk-go/api/core/errors"
+ coreerrors "github.com/larksuite/oapi-sdk-go/api/core/errors"
"github.com/larksuite/oapi-sdk-go/api/core/request"
"github.com/larksuite/oapi-sdk-go/api/core/response"
"github.com/larksuite/oapi-sdk-go/api/core/token"
@@ -111,16 +112,16 @@ func validateFunc(ctx *core.Context, req *request.Request) {
return
}
if _, ok := req.AccessibleTokenTypeSet[req.AccessTokenType]; !ok {
- req.Err = errors.ErrAccessTokenTypeInvalid
+ req.Err = coreerrors.ErrAccessTokenTypeInvalid
}
if config.ByCtx(ctx).GetAppSettings().AppType == coreconst.AppTypeISV {
if req.AccessTokenType == request.AccessTokenTypeTenant && req.TenantKey == "" {
- req.Err = errors.ErrTenantKeyIsEmpty
+ req.Err = coreerrors.ErrTenantKeyIsEmpty
return
}
}
if req.AccessTokenType == request.AccessTokenTypeUser && req.UserAccessToken == "" {
- req.Err = errors.ErrUserAccessTokenKeyIsEmpty
+ req.Err = coreerrors.ErrUserAccessTokenKeyIsEmpty
return
}
}
@@ -184,6 +185,14 @@ func signFunc(ctx *core.Context, req *request.Request) {
default:
httpRequest, err = req.HTTPRequest, req.Err
}
+ if req.NeedHelpDeskAuth {
+ conf := config.ByCtx(ctx)
+ if conf.GetHelpDeskAuthorization() == "" {
+ err = errors.New("help desk API, please set the helpdesk information of config.AppSettings")
+ } else if httpRequest != nil {
+ httpRequest.Header.Set("X-Lark-Helpdesk-Authorization", conf.GetHelpDeskAuthorization())
+ }
+ }
req.HTTPRequest = httpRequest
req.Err = err
}
@@ -282,7 +291,7 @@ func complementFunc(ctx *core.Context, req *request.Request) {
applyAppTicket(ctx)
}
default:
- if req.Err == errors.ErrAppTicketIsEmpty {
+ if req.Err == coreerrors.ErrAppTicketIsEmpty {
applyAppTicket(ctx)
}
}
diff --git a/api/core/request/request.go b/api/core/request/request.go
index 90a01fc7..2d29c969 100644
--- a/api/core/request/request.go
+++ b/api/core/request/request.go
@@ -30,6 +30,7 @@ type Opt struct {
userAccessToken string
tenantKey string
isResponseStream bool
+ needHelpDeskAuth bool
}
type Info struct {
@@ -48,6 +49,7 @@ type Info struct {
optFns []OptFn
IsResponseStream bool
IsResponseStreamReal bool
+ NeedHelpDeskAuth bool
}
func (i *Info) WithContext(ctx *core.Context) {
@@ -92,6 +94,12 @@ func SetResponseStream() OptFn {
}
}
+func NeedHelpDeskAuth() OptFn {
+ return func(opt *Opt) {
+ opt.needHelpDeskAuth = true
+ }
+}
+
type Request struct {
*Info
HTTPRequest *http.Request
@@ -163,6 +171,7 @@ func (r *Request) Init(domain string) error {
}
r.IsNotDataField = opt.isNotDataField
r.IsResponseStream = opt.isResponseStream
+ r.NeedHelpDeskAuth = opt.needHelpDeskAuth
if opt.tenantKey != "" {
if _, ok := r.AccessibleTokenTypeSet[AccessTokenTypeTenant]; ok {
r.AccessTokenType = AccessTokenTypeTenant
@@ -235,8 +244,13 @@ func resolvePath(path string, pathVar map[string]interface{}) (string, error) {
func (r *Request) Url() string {
path := r.HttpPath
if strings.Index(r.HttpPath, "http") != 0 {
- path = fmt.Sprintf("%s/%s/%s", r.Domain, constants.OAPIRootPath, r.HttpPath)
+ if strings.Index(r.HttpPath, "/open-apis") == 0 {
+ path = fmt.Sprintf("%s%s", r.Domain, r.HttpPath)
+ } else {
+ path = fmt.Sprintf("%s/%s/%s", r.Domain, constants.OAPIRootPath, r.HttpPath)
+ }
}
+
if r.QueryParams != "" {
path = fmt.Sprintf("%s?%s", path, r.QueryParams)
}
diff --git a/card/card.go b/card/card.go
index 17286894..c46fdc50 100644
--- a/card/card.go
+++ b/card/card.go
@@ -14,7 +14,7 @@ func SetHandler(conf *config.Config, handler handlers.Handler) {
func Handle(conf *config.Config, request *coremodel.OapiRequest) *coremodel.OapiResponse {
coreCtx := core.WrapContext(request.Ctx)
- conf.WithContext(coreCtx)
+ coreCtx.Set(config.CtxKeyConfig, conf)
httpCard := &model.HTTPCard{
Request: request,
Response: &coremodel.OapiResponse{},
diff --git a/core/config/app_settings.go b/core/config/app_settings.go
index f547e1b1..f0867eac 100644
--- a/core/config/app_settings.go
+++ b/core/config/app_settings.go
@@ -1,58 +1,97 @@
package config
import (
+ "encoding/base64"
+ "fmt"
"github.com/larksuite/oapi-sdk-go/core/constants"
"os"
)
+type AppSettingsOpt func(*AppSettings)
+
type AppSettings struct {
- AppType constants.AppType
+ AppType constants.AppType
+
AppID string
AppSecret string
VerificationToken string
EncryptKey string
+
+ HelpDeskID string
+ HelpDeskToken string
+}
+
+func (s *AppSettings) helpDeskAuthorization() string {
+ if s.HelpDeskID != "" && s.HelpDeskToken != "" {
+ helpdeskAuthToken := base64.StdEncoding.EncodeToString([]byte(fmt.Sprintf("%s:%s", s.HelpDeskID, s.HelpDeskToken)))
+ return helpdeskAuthToken
+ }
+ return ""
}
func GetISVAppSettingsByEnv() *AppSettings {
- appID, appSecret, verificationToken, encryptKey := getAppSettingsByEnv()
- return NewISVAppSettings(appID, appSecret, verificationToken, encryptKey)
+ return NewISVAppSettingsByOpts(getAppSettingsOptsByEnv()...)
}
func GetInternalAppSettingsByEnv() *AppSettings {
- appID, appSecret, verificationToken, encryptKey := getAppSettingsByEnv()
- return NewInternalAppSettings(appID, appSecret, verificationToken, encryptKey)
+ return NewInternalAppSettingsByOpts(getAppSettingsOptsByEnv()...)
}
func NewISVAppSettings(appID, appSecret, verificationToken, encryptKey string) *AppSettings {
- return newAppSettings(constants.AppTypeISV, appID, appSecret, verificationToken, encryptKey)
+ return NewISVAppSettingsByOpts(SetAppCredentials(appID, appSecret), SetAppEventKey(verificationToken, encryptKey))
}
func NewInternalAppSettings(appID, appSecret, verificationToken, encryptKey string) *AppSettings {
- return newAppSettings(constants.AppTypeInternal, appID, appSecret, verificationToken, encryptKey)
+ return NewInternalAppSettingsByOpts(SetAppCredentials(appID, appSecret), SetAppEventKey(verificationToken, encryptKey))
+}
+
+func NewISVAppSettingsByOpts(opts ...AppSettingsOpt) *AppSettings {
+ return newAppSettingsByOpts(constants.AppTypeISV, opts...)
}
-func newAppSettings(appType constants.AppType, appID, appSecret, verificationToken, encryptKey string) *AppSettings {
- if appID == "" || appSecret == "" {
+func NewInternalAppSettingsByOpts(opts ...AppSettingsOpt) *AppSettings {
+ return newAppSettingsByOpts(constants.AppTypeInternal, opts...)
+}
+
+func newAppSettingsByOpts(appType constants.AppType, optFns ...AppSettingsOpt) *AppSettings {
+ settings := &AppSettings{AppType: appType}
+ for _, opt := range optFns {
+ opt(settings)
+ }
+ if settings.AppID == "" || settings.AppSecret == "" {
panic("appID or appSecret is empty")
}
- return &AppSettings{
- AppType: appType,
- AppID: appID,
- AppSecret: appSecret,
- VerificationToken: verificationToken,
- EncryptKey: encryptKey,
+ return settings
+}
+
+func getAppSettingsOptsByEnv() []AppSettingsOpt {
+ var opts []AppSettingsOpt
+ appID, appSecret, verificationToken, encryptKey, helpDeskID, helpDeskToken := os.Getenv("APP_ID"), os.Getenv("APP_SECRET"),
+ os.Getenv("VERIFICATION_TOKEN"), os.Getenv("ENCRYPT_KEY"), os.Getenv("HELP_DESK_ID"), os.Getenv("HELP_DESK_TOKEN")
+ opts = append(opts, SetAppCredentials(appID, appSecret))
+ opts = append(opts, SetAppEventKey(verificationToken, encryptKey))
+ opts = append(opts, SetHelpDeskCredentials(helpDeskID, helpDeskToken))
+ return opts
+}
+
+func SetAppCredentials(appID, appSecret string) AppSettingsOpt {
+ return func(settings *AppSettings) {
+ settings.AppID = appID
+ settings.AppSecret = appSecret
}
}
-func getAppSettingsByEnv() (string, string, string, string) {
- appID, appSecret, verificationToken, encryptKey := os.Getenv("APP_ID"), os.Getenv("APP_SECRET"),
- os.Getenv("VERIFICATION_TOKEN"), os.Getenv("ENCRYPT_KEY")
- if appID == "" {
- panic("environment variables not exist `APP_ID`")
+func SetAppEventKey(verificationToken, encryptKey string) AppSettingsOpt {
+ return func(settings *AppSettings) {
+ settings.VerificationToken = verificationToken
+ settings.EncryptKey = encryptKey
}
- if appSecret == "" {
- panic("environment variables not exist `APP_SECRET`")
+}
+
+func SetHelpDeskCredentials(helpDeskID, helpDeskToken string) AppSettingsOpt {
+ return func(settings *AppSettings) {
+ settings.HelpDeskID = helpDeskID
+ settings.HelpDeskToken = helpDeskToken
}
- return appID, appSecret, verificationToken, encryptKey
}
diff --git a/core/config/config.go b/core/config/config.go
index a9f49b42..549f2791 100644
--- a/core/config/config.go
+++ b/core/config/config.go
@@ -2,19 +2,19 @@ package config
import (
"context"
- "github.com/larksuite/oapi-sdk-go/core"
"github.com/larksuite/oapi-sdk-go/core/constants"
"github.com/larksuite/oapi-sdk-go/core/log"
"github.com/larksuite/oapi-sdk-go/core/store"
)
-var ctxKeyConfig = "-----ctxKeyConfig"
+var CtxKeyConfig = "-----CtxKeyConfig"
type Config struct {
- domain constants.Domain
- appSettings *AppSettings
- store store.Store // store
- logger log.Logger // logger
+ domain constants.Domain
+ appSettings *AppSettings
+ store store.Store // store
+ logger log.Logger // logger
+ helpDeskAuthorization string
}
func NewTestConfig(domain constants.Domain, appSettings *AppSettings) *Config {
@@ -24,10 +24,11 @@ func NewTestConfig(domain constants.Domain, appSettings *AppSettings) *Config {
func NewConfigWithDefaultStore(domain constants.Domain, appSettings *AppSettings, logger log.Logger, logLevel log.Level) *Config {
loggerProxy := log.NewLoggerProxy(logLevel, logger)
conf := &Config{
- domain: domain,
- appSettings: appSettings,
- store: store.NewDefaultStoreWithLog(loggerProxy),
- logger: loggerProxy,
+ domain: domain,
+ appSettings: appSettings,
+ store: store.NewDefaultStoreWithLog(loggerProxy),
+ logger: loggerProxy,
+ helpDeskAuthorization: appSettings.helpDeskAuthorization(),
}
return conf
}
@@ -35,10 +36,11 @@ func NewConfigWithDefaultStore(domain constants.Domain, appSettings *AppSettings
func NewConfig(domain constants.Domain, appSettings *AppSettings, logger log.Logger, logLevel log.Level, store store.Store) *Config {
loggerProxy := log.NewLoggerProxy(logLevel, logger)
conf := &Config{
- domain: domain,
- appSettings: appSettings,
- store: store,
- logger: loggerProxy,
+ domain: domain,
+ appSettings: appSettings,
+ store: store,
+ logger: loggerProxy,
+ helpDeskAuthorization: appSettings.helpDeskAuthorization(),
}
return conf
}
@@ -59,11 +61,11 @@ func (c *Config) GetStore() store.Store {
return c.store
}
-func (c *Config) WithContext(ctx *core.Context) {
- ctx.Set(ctxKeyConfig, c)
+func (c *Config) GetHelpDeskAuthorization() string {
+ return c.helpDeskAuthorization
}
func ByCtx(ctx context.Context) *Config {
- c := ctx.Value(ctxKeyConfig)
+ c := ctx.Value(CtxKeyConfig)
return c.(*Config)
}
diff --git a/core/core.go b/core/core.go
new file mode 100644
index 00000000..887e6fc6
--- /dev/null
+++ b/core/core.go
@@ -0,0 +1,74 @@
+package core
+
+import (
+ "github.com/larksuite/oapi-sdk-go/core/config"
+ "github.com/larksuite/oapi-sdk-go/core/constants"
+ "github.com/larksuite/oapi-sdk-go/core/log"
+ "github.com/larksuite/oapi-sdk-go/core/store"
+)
+
+var (
+ GetISVAppSettingsByEnv = config.GetISVAppSettingsByEnv
+ GetInternalAppSettingsByEnv = config.GetInternalAppSettingsByEnv
+ NewISVAppSettings = config.NewISVAppSettingsByOpts
+ NewInternalAppSettings = config.NewInternalAppSettingsByOpts
+ SetAppCredentials = config.SetAppCredentials
+ SetAppEventKey = config.SetAppEventKey
+ SetHelpDeskCredentials = config.SetHelpDeskCredentials
+)
+
+type LoggerLevel int
+
+const (
+ LoggerLevelDebug LoggerLevel = LoggerLevel(log.LevelDebug)
+ LoggerLevelInfo LoggerLevel = LoggerLevel(log.LevelInfo)
+ LoggerLevelWarn LoggerLevel = LoggerLevel(log.LevelWarn)
+ LoggerLevelError LoggerLevel = LoggerLevel(log.LevelError)
+)
+
+type configOpt struct {
+ logger log.Logger
+ logLevel log.Level
+ store store.Store
+}
+
+type Domain string
+
+const (
+ DomainFeiShu Domain = Domain(constants.DomainFeiShu)
+ DomainLarkSuite Domain = Domain(constants.DomainLarkSuite)
+)
+
+func NewConfig(domain Domain, appSettings *config.AppSettings, opts ...ConfigOpt) *config.Config {
+ configOpt := &configOpt{
+ logLevel: log.LevelError,
+ logger: log.NewDefaultLogger(),
+ }
+ for _, opt := range opts {
+ opt(configOpt)
+ }
+ if configOpt.store == nil {
+ return config.NewConfigWithDefaultStore(constants.Domain(domain), appSettings, configOpt.logger, configOpt.logLevel)
+ }
+ return config.NewConfig(constants.Domain(domain), appSettings, configOpt.logger, configOpt.logLevel, configOpt.store)
+}
+
+type ConfigOpt func(o *configOpt)
+
+func SetLogger(logger log.Logger) func(o *configOpt) {
+ return func(o *configOpt) {
+ o.logger = logger
+ }
+}
+
+func SetLoggerLevel(logLevel LoggerLevel) func(o *configOpt) {
+ return func(o *configOpt) {
+ o.logLevel = log.Level(logLevel)
+ }
+}
+
+func SetStore(store store.Store) func(o *configOpt) {
+ return func(o *configOpt) {
+ o.store = store
+ }
+}
diff --git a/core/version.go b/core/version.go
index eda40ab3..89ca57ef 100644
--- a/core/version.go
+++ b/core/version.go
@@ -1,3 +1,3 @@
package core
-const SdkVersion = "v1.1.39-rc3"
+const SdkVersion = "v1.1.40-rc1"
diff --git a/doc/ISV.APP.README.zh.md b/doc/ISV.APP.README.zh.md
index 176c57d5..a759c515 100644
--- a/doc/ISV.APP.README.zh.md
+++ b/doc/ISV.APP.README.zh.md
@@ -2,14 +2,14 @@
---
-- 如何获取app_access_token,请看:[获取app_access_token](https://open.feishu.cn/document/ukTMukTMukTM/uEjNz4SM2MjLxYzM) (应用商店应用)
- - 与企业自建应用相比,应用商店应用的获取app_access_token的流程复杂一些。
- - 需要开放平台下发的app_ticket,通过订阅事件接收。SDK已经封装了app_ticket事件的处理,只需要启动事件订阅服务。
- - 使用SDK调用服务端API时,如果当前还没有收到开发平台下发的app_ticket,会报错且向开放平台申请下发app_ticket,可以尽快的收到开发平台下发的app_ticket,保证再次调用服务端API的正常。
- - 使用SDK调用服务端API时,需要使用tenant_access_token访问凭证时,需要 tenant_key ,来表示当前是哪个租户使用这个应用调用服务端API。
- - tenant_key,租户安装启用了这个应用,开放平台发送的服务端事件,事件内容中都含有tenant_key。
+- [如何获取 app_access_token](https://open.feishu.cn/document/ukTMukTMukTM/uEjNz4SM2MjLxYzM) (应用商店应用)
+ - 与企业自建应用相比,应用商店应用的获取 app_access_token 的流程复杂一些。
+ - 需要开放平台下发的app_ticket,通过订阅事件接收。SDK已经封装了 app_ticket 事件的处理,只需要启动事件订阅服务。
+ - 使用SDK调用服务端API时,如果当前还没有收到开发平台下发的 app_ticket ,会报错且向开放平台申请下发 app_ticket ,可以尽快的收到开发平台下发的 app_ticket,保证再次调用服务端API的正常。
+ - 使用SDK调用服务端API时,需要使用 tenant_access_token 访问凭证时,需要 tenant_key ,来表示当前是哪个租户使用这个应用调用服务端API。
+ - tenant_key,租户安装启用了这个应用,开放平台发送的服务端事件,事件内容中都含有 tenant_key。
-### 使用`应用商店应用`访问 [发送文本消息API](https://open.feishu.cn/document/ukTMukTMukTM/uUjNz4SN2MjL1YzM) 示例
+## 使用`应用商店应用`访问 [修改用户部分信息API](https://open.feishu.cn/document/contact/v3/user/patch) 示例
- 第一步:启动启动事件订阅服务,用于接收`app_ticket`。
@@ -17,11 +17,10 @@
package main
import (
- "github.com/larksuite/oapi-sdk-go/core/config"
- "github.com/larksuite/oapi-sdk-go/core/constants"
- "github.com/larksuite/oapi-sdk-go/core/log"
- eventhttpserver "github.com/larksuite/oapi-sdk-go/event/http/native"
- "net/http"
+ "github.com/larksuite/oapi-sdk-go/core"
+ "github.com/larksuite/oapi-sdk-go/core/config"
+ eventhttpserver "github.com/larksuite/oapi-sdk-go/event/http/native"
+ "net/http"
)
var conf *config.Config
@@ -29,14 +28,20 @@ var conf *config.Config
func init() {
// 应用商店应用的配置
// AppID、AppSecret: "开发者后台" -> "凭证与基础信息" -> 应用凭证(App ID、App Secret)
- // VerificationToken、EncryptKey:"开发者后台" -> "事件订阅" -> 事件订阅(Verification Token、Encrypt Key)。
- appSetting := config.NewISVAppSettings("AppID", "AppSecret", "VerificationToken", "EncryptKey")
-
- // config.NewConfig()的使用,请看:README.zh.md->高级使用->如何构建整体配置(Config)
- conf := config.NewConfig(domain constants.Domain, appSettings *AppSettings, logger log.Logger, logLevel log.Level, store store.Store)
+ // EncryptKey、VerificationToken:"开发者后台" -> "事件订阅" -> 事件订阅(Encrypt Key、Verification Token)
+ // HelpDeskID、HelpDeskToken:https://open.feishu.cn/document/ukTMukTMukTM/ugDOyYjL4gjM24CO4IjN
+ // 更多介绍请看:Github->README.zh.md->如何构建应用配置(AppSettings)
+ appSettings := core.NewISVAppSettings(
+ core.SetAppCredentials("AppID", "AppSecret"), // 必需
+ core.SetAppEventKey("VerificationToken", "EncryptKey"), // 非必需,订阅事件、消息卡片时必需
+ core.SetHelpDeskCredentials("HelpDeskID", "HelpDeskToken")) // 非必需,使用服务台API时必需
+
+ // 当前访问的是飞书,使用默认的内存存储(app/tenant access token)、默认日志(Error级别)
+ // 更多介绍请看:Github->README.zh.md->如何构建整体配置(Config)
+ conf = core.NewConfig(core.DomainFeiShu, appSettings, core.SetLoggerLevel(core.LoggerLevelError))
}
-func main() {
+func main() {
// 启动httpServer,"开发者后台" -> "事件订阅" 请求网址 URL:https://domain/webhook/event
eventhttpserver.Register("/webhook/event", conf)
err := http.ListenAndServe(":8089", nil)
@@ -46,22 +51,20 @@ func main() {
}
```
-- 第二步:调用服务端接口,有些老版接口,没有直接可以使用的SDK,可以使用`原生`模式。
+- 第二步:在 [service](./service) 下的业务 Event,都是可以直接使用SDK。
```go
package main
import (
- "context"
- "fmt"
- "github.com/larksuite/oapi-sdk-go/api"
- "github.com/larksuite/oapi-sdk-go/api/core/request"
- "github.com/larksuite/oapi-sdk-go/api/core/response"
- "github.com/larksuite/oapi-sdk-go/core"
- "github.com/larksuite/oapi-sdk-go/core/config"
- "github.com/larksuite/oapi-sdk-go/core/constants"
- "github.com/larksuite/oapi-sdk-go/core/log"
- "github.com/larksuite/oapi-sdk-go/core/tools"
+ "context"
+ "fmt"
+ "github.com/larksuite/oapi-sdk-go/api/core/request"
+ "github.com/larksuite/oapi-sdk-go/api/core/response"
+ "github.com/larksuite/oapi-sdk-go/core"
+ "github.com/larksuite/oapi-sdk-go/core/config"
+ "github.com/larksuite/oapi-sdk-go/core/tools"
+ contact "github.com/larksuite/oapi-sdk-go/service/contact/v3"
)
var conf *config.Config
@@ -69,68 +72,68 @@ var conf *config.Config
func init() {
// 应用商店应用的配置
// AppID、AppSecret: "开发者后台" -> "凭证与基础信息" -> 应用凭证(App ID、App Secret)
- // VerificationToken、EncryptKey:"开发者后台" -> "事件订阅" -> 事件订阅(Verification Token、Encrypt Key)。
- appSetting := config.NewISVAppSettings("AppID", "AppSecret", "VerificationToken", "EncryptKey")
-
- // config.NewConfig()的使用,请看:README.zh.md->高级使用->如何构建整体配置(Config)
- conf := config.NewConfig(domain constants.Domain, appSettings *AppSettings, logger log.Logger, logLevel log.Level, store store.Store)
+ // EncryptKey、VerificationToken:"开发者后台" -> "事件订阅" -> 事件订阅(Encrypt Key、Verification Token)
+ // HelpDeskID、HelpDeskToken:https://open.feishu.cn/document/ukTMukTMukTM/ugDOyYjL4gjM24CO4IjN
+ // 更多介绍请看:Github->README.zh.md->如何构建应用配置(AppSettings)
+ appSettings := core.NewISVAppSettings(
+ core.SetAppCredentials("AppID", "AppSecret"), // 必需
+ core.SetAppEventKey("VerificationToken", "EncryptKey"), // 非必需,订阅事件、消息卡片时必需
+ core.SetHelpDeskCredentials("HelpDeskID", "HelpDeskToken")) // 非必需,使用服务台API时必需
+
+ // 当前访问的是飞书,使用默认的内存存储(app/tenant access token)、默认日志(Error级别)
+ // 更多介绍请看:Github->README.zh.md->如何构建整体配置(Config)
+ conf = core.NewConfig(core.DomainFeiShu, appSettings, core.SetLoggerLevel(core.LoggerLevelError))
}
func main() {
- // 发送消息的内容
- body := map[string]interface{}{
- "open_id": "user open id",
- "msg_type": "text",
- "content": map[string]interface{}{
- "text": "test send message",
- },
- }
- // 请求发送消息的结果
- ret := make(map[string]interface{})
- // 构建请求&&设置企业标识(tenant_key)
- req := request.NewRequestWithNative("message/v4/send", "POST", request.AccessTokenTypeTenant,
- body, &ret, request.SetTenantKey("Tenant key"))
- // 请求的上下文
- coreCtx := core.WrapContext(context.Background())
- // 发送请求
- err := api.Send(coreCtx, conf, req)
- // 打印请求的RequestID
- fmt.Println(coreCtx.GetRequestID())
- // 打印请求的响应状态吗
- fmt.Println(coreCtx.GetHTTPStatusCode())
- // 请求的error处理
- if err != nil {
- e := err.(*response.Error)
- fmt.Println(e.Code)
- fmt.Println(e.Msg)
- fmt.Println(tools.Prettify(err))
- return
- }
- // 打印请求的结果
- fmt.Println(tools.Prettify(ret))
+ service := contact.NewService(conf)
+ coreCtx := core.WrapContext(context.Background())
+ body := &contact.User{}
+ body.Name = "rename"
+ // 由于这是一个PATCH请求,需要告之更新哪些字段
+ body.ForceSendFields = append(body.ForceSendFields, "Name")
+ // 构建请求 && 设置租户标识(tenant_key)
+ reqCall := service.Users.Patch(coreCtx, body, request.SetTenantKey("tenant_key"))
+ reqCall.SetUserId("user id")
+ reqCall.SetUserIdType("user_id")
+ // 发送请求
+ result, err := reqCall.Do()
+ // 打印请求的RequestID
+ fmt.Println(coreCtx.GetRequestID())
+ // 打印请求的响应状态吗
+ fmt.Println(coreCtx.GetHTTPStatusCode())
+ // 请求的error处理
+ if err != nil {
+ e := err.(*response.Error)
+ fmt.Println(e.Code)
+ fmt.Println(e.Msg)
+ fmt.Println(tools.Prettify(err))
+ return
+ }
+ // 打印请求的结果
+ fmt.Println(tools.Prettify(result))
}
-```
-
-## 使用`应用商店应用`访问 [修改用户部分信息API](https://open.feishu.cn/document/contact/v3/user/patch) 示例
-- 第一步:略,同上
-
-- 第二步:调用服务端接口,该接口是新的接口(请看"README.zh.md -> 已生成SDK的业务服务"),可以直接使用SDK。
+```
+## 使用`应用商店应用`访问 [发送文本消息API](https://open.feishu.cn/document/ukTMukTMukTM/uUjNz4SN2MjL1YzM) 示例
+
+- 第一步:启动启动事件订阅服务,用于接收`app_ticket`。
+ - 同上
+
+- 第二步:调用服务端接口,有些老版接口,没有直接可以使用的SDK,可以使用`原生`模式。
```go
package main
import (
- "context"
- "fmt"
- "github.com/larksuite/oapi-sdk-go/api/core/request"
- "github.com/larksuite/oapi-sdk-go/api/core/response"
- "github.com/larksuite/oapi-sdk-go/core"
- "github.com/larksuite/oapi-sdk-go/core/config"
- "github.com/larksuite/oapi-sdk-go/core/constants"
- "github.com/larksuite/oapi-sdk-go/core/log"
- "github.com/larksuite/oapi-sdk-go/core/tools"
- contact "github.com/larksuite/oapi-sdk-go/service/contact/v3"
+ "context"
+ "fmt"
+ "github.com/larksuite/oapi-sdk-go/api"
+ "github.com/larksuite/oapi-sdk-go/api/core/request"
+ "github.com/larksuite/oapi-sdk-go/api/core/response"
+ "github.com/larksuite/oapi-sdk-go/core"
+ "github.com/larksuite/oapi-sdk-go/core/config"
+ "github.com/larksuite/oapi-sdk-go/core/tools"
)
var conf *config.Config
@@ -138,39 +141,52 @@ var conf *config.Config
func init() {
// 应用商店应用的配置
// AppID、AppSecret: "开发者后台" -> "凭证与基础信息" -> 应用凭证(App ID、App Secret)
- // VerificationToken、EncryptKey:"开发者后台" -> "事件订阅" -> 事件订阅(Verification Token、Encrypt Key)。
- appSetting := config.NewISVAppSettings("AppID", "AppSecret", "VerificationToken", "EncryptKey")
-
- // config.NewConfig()的使用,请看:README.zh.md->高级使用->如何构建整体配置(Config)
- conf := config.NewConfig(domain constants.Domain, appSettings *AppSettings, logger log.Logger, logLevel log.Level, store store.Store)
+ // EncryptKey、VerificationToken:"开发者后台" -> "事件订阅" -> 事件订阅(Encrypt Key、Verification Token)
+ // HelpDeskID、HelpDeskToken:https://open.feishu.cn/document/ukTMukTMukTM/ugDOyYjL4gjM24CO4IjN
+ // 更多介绍请看:Github->README.zh.md->如何构建应用配置(AppSettings)
+ appSettings := core.NewISVAppSettings(
+ core.SetAppCredentials("AppID", "AppSecret"), // 必需
+ core.SetAppEventKey("VerificationToken", "EncryptKey"), // 非必需,订阅事件、消息卡片时必需
+ core.SetHelpDeskCredentials("HelpDeskID", "HelpDeskToken")) // 非必需,使用服务台API时必需
+
+ // 当前访问的是飞书,使用默认的内存存储(app/tenant access token)、默认日志(Error级别)
+ // 更多介绍请看:Github->README.zh.md->如何构建整体配置(Config)
+ conf = core.NewConfig(core.DomainFeiShu, appSettings, core.SetLoggerLevel(core.LoggerLevelError))
}
func main() {
- service := contact.NewService(conf)
- coreCtx := core.WrapContext(context.Background())
- body := &contact.User{}
- body.Name = "rename"
- // 由于这是一个PATCH请求,需要告之更新哪些字段
- body.ForceSendFields = append(body.ForceSendFields, "Name")
- // 构建请求&&设置租户标识(tenant_key)
- reqCall := service.Users.Patch(coreCtx, body, request.SetTenantKey("tenant_key"))
- reqCall.SetUserId("user id")
- reqCall.SetUserIdType("user_id")
- // 发送请求
- result, err := reqCall.Do()
- // 打印请求的RequestID
- fmt.Println(coreCtx.GetRequestID())
- // 打印请求的响应状态吗
- fmt.Println(coreCtx.GetHTTPStatusCode())
- // 请求的error处理
- if err != nil {
- e := err.(*response.Error)
- fmt.Println(e.Code)
- fmt.Println(e.Msg)
- fmt.Println(tools.Prettify(err))
- return
- }
- // 打印请求的结果
- fmt.Println(tools.Prettify(result))
+ // 发送消息的内容
+ body := map[string]interface{}{
+ "open_id": "user open id",
+ "msg_type": "text",
+ "content": map[string]interface{}{
+ "text": "test send message",
+ },
+ }
+ // 请求发送消息的结果
+ ret := make(map[string]interface{})
+ // 构建请求&&设置企业标识(tenant_key)
+ req := request.NewRequestWithNative("/open-apis/message/v4/send", "POST", request.AccessTokenTypeTenant,
+ body, &ret, request.SetTenantKey("Tenant key"))
+ // 请求的上下文
+ coreCtx := core.WrapContext(context.Background())
+ // 发送请求
+ err := api.Send(coreCtx, conf, req)
+ // 打印请求的RequestID
+ fmt.Println(coreCtx.GetRequestID())
+ // 打印请求的响应状态吗
+ fmt.Println(coreCtx.GetHTTPStatusCode())
+ // 请求的error处理
+ if err != nil {
+ e := err.(*response.Error)
+ fmt.Println(e.Code)
+ fmt.Println(e.Msg)
+ fmt.Println(tools.Prettify(err))
+ return
+ }
+ // 打印请求的结果
+ fmt.Println(tools.Prettify(ret))
}
```
+
+
diff --git a/doc/README.old.md b/doc/README.old.md
deleted file mode 100644
index 9f24b7c5..00000000
--- a/doc/README.old.md
+++ /dev/null
@@ -1,204 +0,0 @@
-# larksuit open api sdk
-[中文](README.zh.md)
-
-| Module | description |
-|--------------|--------------|
-| core | Application information configuration and some general methods |
-| api | Request the interface of larksuite/feishu |
-| event | Monitor the business data of larksuite/feishu changes and events generated |
-| card | Monitor the actions of message card interaction |
-| service | Generated business SDK(api&event) |
-| sample | Example |
-
-### Module core
-```shell script
-$ go get -u github.com/larksuite/oapi-sdk-go
-```
-
-### Instructions for use
-- Instructions for use
- - Get application configuration
- - Provide [code sample GetConfig()](sample/config/config.go)
- - Use redis achieve [Store Interface](core/store/store.go), for maintenance `app_ticket`、`app_access_token`、`tenant_access_token` life cycle
- - Use logrus to implement [Logger Interface](core/log/log.go)
- - Instructions for the method are as follows:
- ```go
- // Create application configuration to prevent leakage. It is recommended to put application information in environment variables.
- // Environment variable or parameter name:
- // APP_ID: App ID in the application certificate
- // APP_SECRET: App Secret in the application certificate
- // VERIFICATION_TOKEN: Verification Token in the event subscription
- // ENCRYPT_KEY: Encrypt Key in the event subscription, yes Empty, indicating that the event content is not encrypted
- // The configuration of the enterprise self-built application
- appSettings := config.NewInternalAppSettings("[APP_ID]", "[APP_SECRET]", "[VERIFICATION_TOKEN]", "[ENCRYPT_KEY]")
- // Enterprise The configuration of self-built applications, the application configuration is obtained through environment variables
- appSettings := config.GetInternalAppSettingsByEnv()
- // App Store application configuration
- appSettings := config.NewISVAppSettings("[APP_ID]", "[APP_SECRET]", "[VERIFICATION_TOKEN]", "[ENCRYPT_KEY]")
- // App store application configuration, obtain application configuration through environment variables
- appSettings := config.GetISVAppSettingsByEnv()
-
-
- // Create Config
- // domain: domain name http address: constants.DomainFeiShu/constants.DomainLarkSuite
- // appSettings: application configuration
- // logger: [log interface](core/log/log.go)
- // loggerLevel: output log level log.LevelDebug/LevelInfo/LevelWarn/LevelError
- // store: [Storage interface](core/store/store.go), used to store app_ticket/app_access_token/tenant_access_token
- // used in online config
- conf := config.NewConfig(domain, appSettings, logger, loggerLevel, store)
-
- // Config for development and testing
- // logger: use the default implementation(core/log/log.go defaultLogger)
- // loggerLevel: Debug level
- // store: use the default implementation(core/store/store.go DefaultStore)
- conf := config.NewTestConfig(domain, appSettings)
-
- // Create CoreContext(*core.Context) for API requests, Event callbacks, Card callbacks, etc., as function parameters
- // core.Context implements the context.Context interface
- coreCtx := core.WrapContext(context.Background())
- // Get the RequestID(string) of API requests, Event callbacks, and Card callbacks, used for problem feedback, open platform query related logs, you can quickly locate the problem
- requestID := coreCtx.GetRequestID()
- // Get response to API request Status code(int)
- statusCode := coreCtx.GetHTTPStatusCode()
-
- ```
-
-### Module api
-- Processing flow
- - The acquisition and life cycle maintenance of app_access_token and tenant_access_token life cycle, **developers can directly access the business interface**
- ![processing flow](api_process_en.jpg)
-- Business API SDK that has been generated
-
- | Business service | version | path | sample |
- |--------------|--------------|------|------|
- | Authentication | v1 | [service/authen](service/authen) | [sample/api/authen.go](sample/api/authen.go)|
- | Image | v4 | [service/image](service/image)|[sample/api/image.go](sample/api/image.go)|
- | Contact | v3 | [service/contact](service/contact) | [sample/api/contact.go](sample/api/contact.go) |
- | Calendar | v4 | [service/calendar](service/calendar)|[sample/api/calendar.go](sample/api/calendar.go)|
- | Drive | v1 | [service/drive](service/drive)|[sample/api/drive.go](sample/api/drive.go)|
-
-
-- Instructions for use(For`No business API SDK is generated`the processing method)
- - For`App Store application`, when acquiring`app_access_token`, you need `app_ticket` to start the event subscription service(`Module event`)
- - [Usage example](sample/api/api.go)
- - The package request is as follows:
- ```go
- import(
- "github.com/larksuite/oapi-sdk-go/core/config"
- "github.com/larksuite/oapi-sdk-go/core/constants"
- "github.com/larksuite/oapi-sdk-go/core/log"
- "github.com/larksuite/oapi-sdk-go/api/core/request"
- "github.com/larksuite/oapi-sdk-go/api/core/response"
- )
- // Create request
- // httpPath:(path after `open-apis/`) API path, for example: https://{domain}/open-apis/authen/v1/user_info, the httpPath: "authen/v1/user_info"
- // httpMethod: GET/POST/PUT/BATCH/DELETE
- // accessTokenType: which token access is used by the API, value range: request.AccessTokenTypeApp/request.AccessTokenTypeTenant/request.AccessTokenTypeUser, for example: request.AccessTokenTypeTenant
- // input : Request body(may be request.NewFormData()(for example: file upload)), if the request body is not needed(for example, some GET requests), then pass: nil
- // output: response body(output := response["data" ])
- // optFns: extended function, some uncommon parameter packages, as follows:
- // request.SetPathParams(map[string]interface{}{"user_id": 4}): set the URL Path parameter(with: prefix) value, When httpPath="users/:user_id", the requested URL="https://{domain}/open-apis/users/4"
- // request.SetQueryParams(map[string]interface{}{"age":4,"types":[1,2]}): Set the URL qeury, will append to the url?age=4&types=1&types=2
- // request.setResponseStream(), set whether the response is a stream, such as downloading a file, at this time: output value is Buffer type
- // request.SetNotDataField(), set whether the response does not have a `data` field, business interfaces all have `data `Field, so you don’t need to set
- // request.SetTenantKey("TenantKey"), as an `app store application`, it means using `tenant_access_token` to access the API, you need to set
- // request.SetUserAccessToken("UserAccessToken"), which means using` user_access_token` To access the API, you need to set
- // req := request.NewRequestWithNative(httpPath:string, httpMethod:string, accessTokenType:AccessTokenType, input:interface, output:interface, ... optFns:OptFn [)))
- // Example:
- body := map[string]interface{}{
- "open_id": "[open_id]",
- "msg_type": "text",
- "content": map[string]interface{}{
- "text": "test",
- },
- }
- ret := make(map[string]interface{})
- req := request.NewRequestWithNative("message/v4/send", "POST", request.AccessTokenTypeTenant, body, &ret)
- coreCtx := core.WarpContext(context.Background())
- err := api.Send(coreCtx, conf, req)
- fmt.Println(coreCtx.GetRequestID())
- fmt.Println(coreCtx.GetHTTPStatusCode())
- if err != nil {
- fmt.Println(tools.Prettify(err))
- e := err.(*response.Error)
- fmt.Println(e.Code)
- fmt.Println(e.Msg)
- return
- }
- fmt.Println(tools.Prettify(ret))
-
- ```
- - Tool
-
- | Tool | path | description |
- |--------------|--------------|------|
- | file download | [api/core/tools/file.go](api/core/tools/file.go) | For example, you can download pictures for picture upload |
-
-### Module event
-- Processing flow
- - Encapsulated
- - `App Store application` The `app_ticket` event (you need to set the event handler again), store it in the Store for `Module api` use
- - Decryption of event data and verification of source reliability
- - Business Event SDK that has been generated
-
- | Business service | version | path | sample |
- |--------------|--------------|------|------|
- | application | v1 | [service/application](service/application) | [sample/event/application.go](sample/event/application.go) |
- | contact | v3 | [service/contact](service/contact) | [sample/event/contact.go](sample/event/contact.go) |
-
- - Instructions for use
- - Event monitoring service started
- - webhook address:http://ip:8089/[APP_ID]/webhook/event
- - [Start with native http server](sample/event/http_server.go)
- - [Start with Gin](sample/event/gin.go)
- - [Other](sample/event/go.go)
- - For `No business Event SDK is generated` the treatment
- - Set the event handler, for example:
- ```go
- import "github.com/larksuite/oapi-sdk-go/event"
-
- // conf: config.Config
- // app_status_change: event type
- // func
- // coreCtx: *core.Context
- // event: map[string]interface{}
- // return:
- // error: not nil, response status code 500
- event.SetTypeCallback(conf, "app_status_change", func(coreCtx *core.Context, event map[string]interface{}) error {
- fmt.Println(coreCtx.GetRequestID())
- fmt.Println(tools.Prettify(event))
- data := event["event"].(map[string]interface{})
- fmt.Println(tools.Prettify(data))
- return nil
- })
-
- ```
-
-## Module card
- - Encapsulated
- - Verification of the validity and source reliability of card data
- - Instructions for use
- - Message card callback service started
- - webhook address:http://ip:8089/[APP_ID]/webhook/card
- - [Start with native http server](sample/card/http_server.go)
- - [Start with Gin](sample/card/gin.go)
- - [Other](sample/card/go.go)
- - Set the message card handler, the code is as follows:
- ```go
- import "github.com/larksuite/oapi-sdk-go/card"
-
- // conf: config.Config
- // func
- // coreCtx: *core.Context
- // card: *model.Card
- // return:
- // interface{}: can be string(json string of message card) or map(The map package of the message card)
- // error: not nil, response status code 500
- card.SetHandler(conf, func(coreCtx *core.Context, card *model.Card)(interface{}, error) {
- fmt.Println(coreCtx.GetRequestID())
- fmt.Println(tools.Prettify(card.Action))
- return nil, nil
- })
-
- ```
\ No newline at end of file
diff --git a/doc/README.zh.old.md b/doc/README.zh.old.md
deleted file mode 100644
index d8f095bd..00000000
--- a/doc/README.zh.old.md
+++ /dev/null
@@ -1,214 +0,0 @@
-# larksuit open api sdk
-[English](README.md)
-
-| 模块 | 描述 |
-|--------------|--------------|
-| core | 应用信息配置及一些通用的方法 |
-| api | 请求larksuite/feishu的接口 |
-| event | 监听larksuite/feishu的业务数据发生变化,产生的事件 |
-| card | 监听消息卡片交互时的动作 |
-| service | 生成的业务SDK(api&event) |
-| sample | 示例 |
-
-### 包引入
-```shell script
-$ go get -u github.com/larksuite/oapi-sdk-go
-```
-
-### 模块core
-- 使用说明
- - 获取应用配置
- - 方便开发提供了[代码样例 GetConfig方法](sample/config/config.go)
- - 使用 redis 实现 [Store接口](core/store/store.go),用于维护 `app_ticket`、`app_access_token`、`tenant_access_token` 的生命周期
- - 使用 logrus 实现 [Logger接口](core/log/log.go)
- - 方法使用说明,如下:
- ```go
- import (
- "github.com/larksuite/oapi-sdk-go/core/config"
- "github.com/larksuite/oapi-sdk-go/core/constants"
- "github.com/larksuite/oapi-sdk-go/core/log"
- )
-
- // 创建应用配置,防止泄漏,建议将应用信息放在环境变量中。
- // 环境变量或参数名:
- // APP_ID:应用凭证中的App ID
- // APP_SECRET:应用凭证中的App Secret
- // VERIFICATION_TOKEN:事件订阅中的Verification Token
- // ENCRYPT_KEY:事件订阅中的Encrypt Key,可以为空,表示事件内容不加密
- // 企业自建应用的配置
- appSettings := config.NewInternalAppSettings("[APP_ID]", "[APP_SECRET]", "[VERIFICATION_TOKEN]", "[ENCRYPT_KEY]")
- // 企业自建应用的配置,通过环境变量获取应用配置
- appSettings := config.GetInternalAppSettingsByEnv()
- // 应用商店应用的配置
- appSettings := config.NewISVAppSettings("[APP_ID]", "[APP_SECRET]", "[VERIFICATION_TOKEN]", "[ENCRYPT_KEY]")
- // 应用商店应用的配置,通过环境变量获取应用配置
- appSettings := config.GetISVAppSettingsByEnv()
-
-
- // 创建Config
- // domain:域名http地址:constants.DomainFeiShu / constants.DomainLarkSuite
- // appSettings:应用配置
- // logger:[日志接口](core/log/log.go)
- // loggerLevel:输出的日志级别 log.LevelDebug/LevelInfo/LevelWarn/LevelError
- // store: [存储接口](core/store/store.go),用来存储 app_ticket/app_access_token/tenant_access_token
- // 用于线上的config
- conf := config.NewConfig(domain, appSettings, logger, loggerLevel, store)
-
- // 用于开发测试的Config
- // logger:使用默认实现(core/log/log.go defaultLogger)
- // loggerLevel:Debug级别
- // store:使用默认实现(core/store/store.go DefaultStore)
- conf := config.NewTestConfig(domain, appSettings)
-
- // 创建CoreContext(*core.Context),用于API请求、Event回调、Card回调等,作为函数的参数
- // core.Context实现了context.Context接口
- coreCtx := core.WrapContext(context.Background())
- // 获取 API请求、Event回调、Card回调的RequestID(string),用于问题反馈时,开放平台查询相关日志,可以快速的定位问题
- requestID := coreCtx.GetRequestID()
- // 获取 API请求的响应状态码(int)
- statusCode := coreCtx.GetHTTPStatusCode()
-
- ```
-
-### 模块api
-- 处理流程
- - 对app_access_token、tenant_access_token的获取及生命周期的维护做了封装,**开发者可直接访问业务接口**
- ![处理流程图](api_process.jpg)
-- 已经生成的业务API SDK
-
- | 业务服务 | 版本 | 路径 | 示例 |
- |--------------|--------------|------|------|
- | 身份验证 | v1 | [service/authen](service/authen) | [sample/api/authen.go](sample/api/authen.go)|
- | 图片 | v4 | [service/image](service/image)|[sample/api/image.go](sample/api/image.go)|
- | 通讯录 | v3 | [service/contact](service/contact)|[sample/api/contact.go](sample/api/contact.go)|
- | 日历 | v4 | [service/calendar](service/calendar)|[sample/api/calendar.go](sample/api/calendar.go)|
- | 云空间文件 | v1 | [service/drive](service/drive)|[sample/api/drive.go](sample/api/drive.go)|
-
-
-- 使用说明(对于`没有生成业务API SDK`的处理方式)
- - 对于`应用商店应用`,在获取`app_access_token`时,需要 `app_ticket`,需要启动事件订阅服务(`模块event`)
- - [使用示例](sample/api/api.go)
- - 封装请求,如下:
- ```go
- import (
- "github.com/larksuite/oapi-sdk-go/core/config"
- "github.com/larksuite/oapi-sdk-go/core/constants"
- "github.com/larksuite/oapi-sdk-go/core/log"
- "github.com/larksuite/oapi-sdk-go/api/core/request"
- )
- // 创建请求
- // httpPath:API路径(`open-apis/`之后的路径),例如:https://{domain}/open-apis/authen/v1/user_info,则 httpPath:"authen/v1/user_info"
- // httpMethod: GET/POST/PUT/BATCH/DELETE
- // accessTokenType:API使用哪种token访问,取值范围:request.AccessTokenTypeApp/request.AccessTokenTypeTenant/request.AccessTokenTypeUser,例如:request.AccessTokenTypeTenant
- // input:请求体(可能是request.NewFormData()(例如:文件上传)),如果不需要请求体(例如一些GET请求),则传:nil
- // output:响应体(output := response["data"])
- // optFns:扩展函数,一些不常用的参数封装,如下:
- // request.SetPathParams(map[string]interface{}{"user_id": 4}):设置URL Path参数(有:前缀)值,当httpPath="users/:user_id"时,请求的URL="https://{domain}/open-apis/users/4"
- // request.SetQueryParams(map[string]interface{}{"age":4,"types":[1,2]}):设置 URL qeury,会在url追加?age=4&types=1&types=2
- // request.setResponseStream(),设置响应的是否是流,例如下载文件,这时:output值是Buffer类型
- // request.SetNotDataField(),设置响应的是否 没有`data`字段,业务接口都是有`data`字段,所以不需要设置
- // request.SetTenantKey("TenantKey"),以`应用商店应用`身份,表示使用`tenant_access_token`访问API,需要设置
- // request.SetUserAccessToken("UserAccessToken"),表示使用`user_access_token`访问API,需要设置
- // req := request.NewRequestWithNative(httpPath:string, httpMethod:string, accessTokenType:AccessTokenType, input:interface, output:interface, ... optFns:OptFn [)))
- // Example:
- body := map[string]interface{}{
- "open_id": "[open_id]",
- "msg_type": "text",
- "content": map[string]interface{}{
- "text": "test",
- },
- }
- ret := make(map[string]interface{})
- req := request.NewRequestWithNative("message/v4/send", "POST", request.AccessTokenTypeTenant, body, &ret)coreCtx := core.WarpContext(context.Background())
- err := api.Send(coreCtx, conf, req)
- fmt.Println(coreCtx.GetRequestID())
- fmt.Println(coreCtx.GetHTTPStatusCode())
- if err != nil {
- fmt.Println(tools.Prettify(err))
- e := err.(*response.Error)
- fmt.Println(e.Code)
- fmt.Println(e.Msg)
- return
- }
- fmt.Println(tools.Prettify(ret))
-
- ```
- - 工具
-
- | 工具 | 路径 | 描述 |
- |--------------|--------------|------|
- | 文件下载 | [api/core/tools/file.go](api/core/tools/file.go) | 例如,可以下载图片,用于图片上传 |
-
-### 模块event
-- 处理流程
- - 封装了
- - `应用商店应用`的`app_ticket`事件(需要再次设置该事件的处理者),将其存入Store,供 `模块api` 使用
- - 已封装challenge验证
- - 事件数据的解密与来源可靠性的验证
- - 已经生成的业务Event SDK
-
- | 业务服务 | 版本 | 路径 | 示例 |
- |--------------|--------------|------|------|
- | 应用 | v1 | [service/application](service/application) | [sample/event/application.go](sample/event/application.go) |
- | 通讯录 | v3 | [service/contact](service/contact) | [sample/event/contact.go](sample/event/contact.go) |
-
- - 使用说明
- - 事件监听服务启动
- - webhook地址:http://ip:8089/[APP_ID]/webhook/event
- - [使用原生的http server启动](sample/event/http_server.go)
- - [使用Gin启动](sample/event/gin.go)
- - [其他情况使用](sample/event/go.go)
- - 对于`没有生成业务Event SDK`的处理方式
- - 设置事件的处理者,样例如下:
- ```go
- import "github.com/larksuite/oapi-sdk-go/event"
-
- // conf: config.Config
- // app_status_change: 事件类型
- // func
- // coreCtx: *core.Context
- // event: 事件数据
- // return:
- // error: 不为nil,响应状态码 500
- event.SetTypeCallback(conf, "app_status_change", func(coreCtx *core.Context, event map[string]interface{}) error {
- fmt.Println(coreCtx.GetRequestID())
- fmt.Println(tools.Prettify(event))
- data := event["event"].(map[string]interface{})
- fmt.Println(tools.Prettify(data))
- return nil
- })
-
- ```
-
-## 模块card
- - 封装了
- - 已封装challenge验证
- - 卡片数据的有效性、来源可靠性的验证
- - 使用说明
- - 消息卡片回调服务启动
- - webhook地址:http://ip:8089/[APP_ID]/webhook/card
- - [使用原生的http server启动](sample/card/http_server.go)
- - [使用Gin启动](sample/card/gin.go)
- - [其他情况使用](sample/card/go.go)
- - 设置卡片的处理者,代码如下:
- ```go
- import "github.com/larksuite/oapi-sdk-go/card"
-
- // conf: config.Config
- // func
- // coreCtx: *core.Context
- // card: 卡片
- // return:
- // interface{}: 可以是string(消息卡片 的json字符串),也可以是map(消息卡片 的map封装)
- // error: 不为nil,响应状态码 500
- card.SetHandler(conf, func(coreCtx *core.Context, card *model.Card) (interface{}, error) {
- fmt.Println(coreCtx.GetRequestID())
- fmt.Println(tools.Prettify(card.Action))
- return nil, nil
- })
-
- ```
-
-
-
-
diff --git a/event/event.go b/event/event.go
index 0e2366fe..724c771a 100644
--- a/event/event.go
+++ b/event/event.go
@@ -44,7 +44,7 @@ func Handle(conf *config.Config, request *coremodel.OapiRequest) *coremodel.Oapi
app.SetAppTicketEventHandler(conf)
})
coreCtx := core.WrapContext(request.Ctx)
- conf.WithContext(coreCtx)
+ coreCtx.Set(config.CtxKeyConfig, conf)
httpEvent := &model.HTTPEvent{
Request: request,
Response: &coremodel.OapiResponse{},
diff --git a/sample/api/api.go b/sample/api/api.go
index 7a4e0568..ac2fd39d 100644
--- a/sample/api/api.go
+++ b/sample/api/api.go
@@ -9,7 +9,6 @@ import (
"github.com/larksuite/oapi-sdk-go/api/core/request"
"github.com/larksuite/oapi-sdk-go/api/core/response"
"github.com/larksuite/oapi-sdk-go/core"
- "github.com/larksuite/oapi-sdk-go/core/constants"
"github.com/larksuite/oapi-sdk-go/core/tools"
"github.com/larksuite/oapi-sdk-go/sample/configs"
"io/ioutil"
@@ -17,15 +16,16 @@ import (
)
// for redis store and logrus
-// var conf = configs.TestConfigWithLogrusAndRedisStore(constants.DomainFeiShu)
+var conf = configs.TestConfigWithLogrusAndRedisStore(core.DomainFeiShu)
+
// var conf = configs.TestConfig("https://open.feishu.cn")
-var conf = configs.TestConfig(constants.DomainFeiShu)
+// var conf = configs.TestConfig(core.DomainFeiShu)
func main() {
- //testSendMessage()
- testSendCardMessage()
+ testSendMessage()
+ //testSendCardMessage()
//testUploadFile()
- //testDownloadFile()
+ testDownloadFile()
}
// send card message
@@ -43,7 +43,7 @@ func testSendCardMessage() {
"card": card,
}
ret := make(map[string]interface{})
- req := request.NewRequestWithNative("message/v4/send", "POST",
+ req := request.NewRequestWithNative("/open-apis/message/v4/send", "POST",
request.AccessTokenTypeTenant, body, &ret,
//应用市场应用 request.SetTenantKey("TenantKey"),
)
@@ -71,7 +71,7 @@ func testSendMessage() {
},
}
ret := make(map[string]interface{})
- req := request.NewRequestWithNative("message/v4/send", "POST",
+ req := request.NewRequestWithNative("/open-apis/message/v4/send", "POST",
request.AccessTokenTypeTenant, body, &ret,
//应用市场应用 request.SetTenantKey("TenantKey"),
)
@@ -114,7 +114,7 @@ func testUploadFile() {
formData.AddFile("image", request.NewFile().SetContentStream(file))
*/
ret := &UploadImage{}
- err = api.Send(coreCtx, conf, request.NewRequestWithNative("image/v4/put", "POST",
+ err = api.Send(coreCtx, conf, request.NewRequestWithNative("/open-apis/image/v4/put", "POST",
request.AccessTokenTypeTenant, formData, ret))
fmt.Println(coreCtx.GetRequestID())
fmt.Println(coreCtx.GetHTTPStatusCode())
@@ -140,7 +140,7 @@ func testDownloadFile() {
return
}
*/
- req := request.NewRequestWithNative("image/v4/get", "GET",
+ req := request.NewRequestWithNative("/open-apis/image/v4/get", "GET",
request.AccessTokenTypeTenant, nil, ret,
request.SetQueryParams(map[string]interface{}{"image_key": "[image key]"}), request.SetResponseStream())
err := api.Send(coreCtx, conf, req)
diff --git a/sample/api/authen.go b/sample/api/authen.go
index 2b2b7212..ae008ff3 100644
--- a/sample/api/authen.go
+++ b/sample/api/authen.go
@@ -6,16 +6,15 @@ import (
"github.com/larksuite/oapi-sdk-go/api/core/request"
"github.com/larksuite/oapi-sdk-go/api/core/response"
"github.com/larksuite/oapi-sdk-go/core"
- "github.com/larksuite/oapi-sdk-go/core/constants"
"github.com/larksuite/oapi-sdk-go/core/tools"
"github.com/larksuite/oapi-sdk-go/sample/configs"
authen "github.com/larksuite/oapi-sdk-go/service/authen/v1"
)
// for redis store and logrus
-// configs.TestConfigWithLogrusAndRedisStore(constants.DomainFeiShu)
+// configs.TestConfigWithLogrusAndRedisStore(core.DomainFeiShu)
// configs.TestConfig("https://open.feishu.cn")
-var authenService = authen.NewService(configs.TestConfig(constants.DomainFeiShu))
+var authenService = authen.NewService(configs.TestConfig(core.DomainFeiShu))
func main() {
testAccessToken()
diff --git a/sample/api/bot.go b/sample/api/bot.go
index b5d2480c..78ba59e9 100644
--- a/sample/api/bot.go
+++ b/sample/api/bot.go
@@ -5,16 +5,15 @@ import (
"fmt"
"github.com/larksuite/oapi-sdk-go/api/core/response"
"github.com/larksuite/oapi-sdk-go/core"
- "github.com/larksuite/oapi-sdk-go/core/constants"
"github.com/larksuite/oapi-sdk-go/core/tools"
"github.com/larksuite/oapi-sdk-go/sample/configs"
bot "github.com/larksuite/oapi-sdk-go/service/bot/v3"
)
// for redis store and logrus
-// configs.TestConfigWithLogrusAndRedisStore(constants.DomainFeiShu)
+// configs.TestConfigWithLogrusAndRedisStore(core.DomainFeiShu)
// configs.TestConfig("https://open.feishu.cn")
-var botService = bot.NewService(configs.TestConfig(constants.DomainFeiShu))
+var botService = bot.NewService(configs.TestConfig(core.DomainFeiShu))
func main() {
testBotGet()
diff --git a/sample/api/calendar.go b/sample/api/calendar.go
index 2be7c3cf..cd0e416d 100644
--- a/sample/api/calendar.go
+++ b/sample/api/calendar.go
@@ -6,16 +6,15 @@ import (
"github.com/larksuite/oapi-sdk-go/api/core/request"
"github.com/larksuite/oapi-sdk-go/api/core/response"
"github.com/larksuite/oapi-sdk-go/core"
- "github.com/larksuite/oapi-sdk-go/core/constants"
"github.com/larksuite/oapi-sdk-go/core/tools"
"github.com/larksuite/oapi-sdk-go/sample/configs"
calendar "github.com/larksuite/oapi-sdk-go/service/calendar/v4"
)
// for redis store and logrus
-// configs.TestConfigWithLogrusAndRedisStore(constants.DomainFeiShu)
+// configs.TestConfigWithLogrusAndRedisStore(core.DomainFeiShu)
// configs.TestConfig("https://open.feishu.cn")
-var calendarService = calendar.NewService(configs.TestConfig(constants.DomainFeiShu))
+var calendarService = calendar.NewService(configs.TestConfig(core.DomainFeiShu))
func main() {
testCalendarList()
diff --git a/sample/api/contact.go b/sample/api/contact.go
index 72e764d1..f48c0868 100644
--- a/sample/api/contact.go
+++ b/sample/api/contact.go
@@ -5,16 +5,15 @@ import (
"fmt"
"github.com/larksuite/oapi-sdk-go/api/core/response"
"github.com/larksuite/oapi-sdk-go/core"
- "github.com/larksuite/oapi-sdk-go/core/constants"
"github.com/larksuite/oapi-sdk-go/core/tools"
"github.com/larksuite/oapi-sdk-go/sample/configs"
contact "github.com/larksuite/oapi-sdk-go/service/contact/v3"
)
// for redis store and logrus
-// configs.TestConfigWithLogrusAndRedisStore(constants.DomainFeiShu)
+// configs.TestConfigWithLogrusAndRedisStore(core.DomainFeiShu)
// configs.TestConfig("https://open.feishu.cn")
-var contactService = contact.NewService(configs.TestConfig(constants.DomainFeiShu))
+var contactService = contact.NewService(configs.TestConfig(core.DomainFeiShu))
func main() {
testUserServiceList()
diff --git a/sample/api/drive.go b/sample/api/drive.go
index f8268591..9e40a455 100644
--- a/sample/api/drive.go
+++ b/sample/api/drive.go
@@ -8,7 +8,6 @@ import (
"github.com/larksuite/oapi-sdk-go/api/core/request"
"github.com/larksuite/oapi-sdk-go/api/core/response"
"github.com/larksuite/oapi-sdk-go/core"
- "github.com/larksuite/oapi-sdk-go/core/constants"
"github.com/larksuite/oapi-sdk-go/core/tools"
"github.com/larksuite/oapi-sdk-go/sample/configs"
drivev1 "github.com/larksuite/oapi-sdk-go/service/drive/v1"
@@ -17,13 +16,12 @@ import (
)
// for redis store and logrus
-// configs.TestConfigWithLogrusAndRedisStore(constants.DomainFeiShu)
+// configs.TestConfigWithLogrusAndRedisStore(core.DomainFeiShu)
// configs.TestConfig("https://open.feishu.cn")
-var driveService = drivev1.NewService(configs.TestConfig(constants.DomainFeiShu))
+var driveService = drivev1.NewService(configs.TestConfig(core.DomainFeiShu))
func main() {
testFileUploadAll()
- testFileUploadPart()
testMediaBatchGetTmpDownloadURLs()
testFileDownload()
}
@@ -65,84 +63,6 @@ func testFileUploadAll() {
}
-func testFileUploadPart() {
- coreCtx := core.WrapContext(context.Background())
- userAccessTokenOptFn := request.SetUserAccessToken("[user_access_token]")
- fileSize := 1024
-
- // upload prepare
- uploadPrepareReqCall := driveService.Files.UploadPrepare(coreCtx, &drivev1.UploadInfo{
- FileName: fmt.Sprintf("[file_name]"),
- ParentType: "explorer",
- ParentNode: "[folder_token]",
- Size: fileSize,
- }, userAccessTokenOptFn)
-
- uploadPrepareResult, err := uploadPrepareReqCall.Do()
- fmt.Printf("[upload prepare] request_id:%s", coreCtx.GetRequestID())
- fmt.Printf("[upload prepare] http status code:%d", coreCtx.GetHTTPStatusCode())
- if err != nil {
- e := err.(*response.Error)
- fmt.Println(tools.Prettify(e))
- return
- }
-
- fmt.Printf("[upload prepare] reault:%s", tools.Prettify(uploadPrepareResult))
-
- // upload part
- uploadedBlockNum := 0
- for i := 0; i < uploadPrepareResult.BlockNum; i++ {
- uploadPartReqCall := driveService.Files.UploadPart(coreCtx, userAccessTokenOptFn)
- uploadPartReqCall.SetUploadId(uploadPrepareResult.UploadId)
- uploadPartReqCall.SetSeq(i)
- //uploadPartReqCall.Set
- // 最后一块
- blockSize := uploadPrepareResult.BlockSize
- if i == (uploadPrepareResult.BlockNum - 1) {
- blockSize = fileSize - (i * uploadPrepareResult.BlockNum)
- }
- uploadPartReqCall.SetSize(blockSize)
- fileContent := createRandomFileData(int64(blockSize))
- file := request.NewFile().SetContent(fileContent)
-
- uploadPartReqCall.SetFile(file)
- uploadPartReqCall.SetChecksum(fmt.Sprintf("%d", adler32.Checksum(fileContent)))
-
- result, err := uploadPartReqCall.Do()
- fmt.Printf("[upload part[%d]] request_id:%s", i, coreCtx.GetRequestID())
- fmt.Printf("[upload part[%d]] http status code:%d", i, coreCtx.GetHTTPStatusCode())
- if err != nil {
- e := err.(*response.Error)
- fmt.Println(tools.Prettify(e))
- return
- }
- uploadedBlockNum++
- fmt.Printf("[upload part[%d]] reault:%s", i, tools.Prettify(result))
- }
-
- // upload finish
- uploadFinishReqCall := driveService.Files.UploadFinish(coreCtx, &drivev1.FileUploadFinishReqBody{
- UploadId: uploadPrepareResult.UploadId,
- BlockNum: uploadedBlockNum,
- }, userAccessTokenOptFn)
-
- uploadFinishResult, err := uploadFinishReqCall.Do()
- fmt.Printf("[upload finish] request_id:%s", coreCtx.GetRequestID())
- fmt.Printf("[upload finish] http status code:%d", coreCtx.GetHTTPStatusCode())
- if err != nil {
- e := err.(*response.Error)
- fmt.Println(tools.Prettify(e))
- return
- }
-
- fmt.Printf("[upload finish] reault:%s", tools.Prettify(uploadFinishResult))
-
- if len(uploadFinishResult.FileToken) == 0 {
- fmt.Printf("file token is empty")
- return
- }
-}
-
func testMediaBatchGetTmpDownloadURLs() {
coreCtx := core.WrapContext(context.Background())
diff --git a/sample/api/helpdesk.go b/sample/api/helpdesk.go
new file mode 100644
index 00000000..096ad755
--- /dev/null
+++ b/sample/api/helpdesk.go
@@ -0,0 +1,52 @@
+package main
+
+import (
+ "context"
+ "fmt"
+ "github.com/larksuite/oapi-sdk-go/api"
+ "github.com/larksuite/oapi-sdk-go/api/core/request"
+ "github.com/larksuite/oapi-sdk-go/api/core/response"
+ "github.com/larksuite/oapi-sdk-go/core"
+ "github.com/larksuite/oapi-sdk-go/core/tools"
+)
+
+func main() {
+ // 应用商店应用的配置
+ // AppID、AppSecret: "开发者后台" -> "凭证与基础信息" -> 应用凭证(App ID、App Secret)
+ // EncryptKey、VerificationToken:"开发者后台" -> "事件订阅" -> 事件订阅(Encrypt Key、Verification Token)
+ // HelpDeskID、HelpDeskToken:https://open.feishu.cn/document/ukTMukTMukTM/ugDOyYjL4gjM24CO4IjN
+ // 更多介绍请看:Github->README.zh.md->如何构建应用配置(AppSettings)
+ appSettings := core.NewISVAppSettings(
+ core.SetAppCredentials("AppID", "AppSecret"), // 必需
+ core.SetAppEventKey("VerificationToken", "EncryptKey"), // 非必需,订阅事件、消息卡片时必需
+ core.SetHelpDeskCredentials("HelpDeskID", "HelpDeskToken")) // 非必需,使用服务台API时必需
+
+ // 当前访问的是飞书,使用默认的内存存储(app/tenant access token)、默认日志(Error级别)
+ // 更多介绍请看:Github->README.zh.md->如何构建整体配置(Config)
+ conf := core.NewConfig(core.DomainFeiShu, appSettings, core.SetLoggerLevel(core.LoggerLevelError))
+ // 请求发送消息的结果
+ ret := make(map[string]interface{})
+ // 构建请求
+ req := request.NewRequestWithNative("/open-apis/helpdesk/v1/tickets/6971250929135779860", "GET",
+ request.AccessTokenTypeTenant, nil, &ret,
+ request.NeedHelpDeskAuth(), // 服务台 API,需要 HelpDeskAuth
+ )
+ // 请求的上下文
+ coreCtx := core.WrapContext(context.Background())
+ // 发送请求
+ err := api.Send(coreCtx, conf, req)
+ // 打印请求的RequestID
+ fmt.Println(coreCtx.GetRequestID())
+ // 打印请求的响应状态吗
+ fmt.Println(coreCtx.GetHTTPStatusCode())
+ // 请求的error处理
+ if err != nil {
+ e := err.(*response.Error)
+ fmt.Println(e.Code)
+ fmt.Println(e.Msg)
+ fmt.Println(tools.Prettify(err))
+ return
+ }
+ // 打印请求的结果
+ fmt.Println(tools.Prettify(ret))
+}
diff --git a/sample/api/im.go b/sample/api/im.go
index 44fb561b..b0a79b9e 100644
--- a/sample/api/im.go
+++ b/sample/api/im.go
@@ -7,7 +7,6 @@ import (
"github.com/larksuite/oapi-sdk-go/api/core/request"
"github.com/larksuite/oapi-sdk-go/api/core/response"
"github.com/larksuite/oapi-sdk-go/core"
- "github.com/larksuite/oapi-sdk-go/core/constants"
"github.com/larksuite/oapi-sdk-go/core/tools"
"github.com/larksuite/oapi-sdk-go/sample/configs"
im "github.com/larksuite/oapi-sdk-go/service/im/v1"
@@ -16,12 +15,12 @@ import (
)
// for redis store and logrus
-// configs.TestConfigWithLogrusAndRedisStore(constants.DomainFeiShu)
+// configs.TestConfigWithLogrusAndRedisStore(core.DomainFeiShu)
// configs.TestConfig("https://open.feishu.cn")
-var imService = im.NewService(configs.TestConfig(constants.DomainFeiShu))
+var imService = im.NewService(configs.TestConfig(core.DomainFeiShu))
func main() {
- //testMessageCreate()
+ testMessageCreate()
//testFileCreate()
testFileRead()
}
@@ -29,6 +28,7 @@ func main() {
func testMessageCreate() {
coreCtx := core.WrapContext(context.Background())
reqCall := imService.Messages.Create(coreCtx, &im.MessageCreateReqBody{
+ // ReceiveId: "b1g6b445",
ReceiveId: "ou_a11d2bcc7d852afbcaf37e5b3ad01f7e",
Content: "{\"text\":\"Tom test content\"}",
MsgType: "text",
diff --git a/sample/api/image.go b/sample/api/image.go
index 1894c66f..7ed9607f 100644
--- a/sample/api/image.go
+++ b/sample/api/image.go
@@ -6,7 +6,6 @@ import (
"github.com/larksuite/oapi-sdk-go/api/core/request"
"github.com/larksuite/oapi-sdk-go/api/core/response"
"github.com/larksuite/oapi-sdk-go/core"
- "github.com/larksuite/oapi-sdk-go/core/constants"
"github.com/larksuite/oapi-sdk-go/core/tools"
"github.com/larksuite/oapi-sdk-go/sample/configs"
image "github.com/larksuite/oapi-sdk-go/service/image/v4"
@@ -14,9 +13,9 @@ import (
)
// for redis store and logrus
-// configs.TestConfigWithLogrusAndRedisStore(constants.DomainFeiShu)
+// configs.TestConfigWithLogrusAndRedisStore(core.DomainFeiShu)
// configs.TestConfig("https://open.feishu.cn")
-var imageService = image.NewService(configs.TestConfig(constants.DomainFeiShu))
+var imageService = image.NewService(configs.TestConfig(core.DomainFeiShu))
func main() {
testUpload()
diff --git a/sample/api/optical_char_recognition.go b/sample/api/optical_char_recognition.go
index bbf0114c..f1899dae 100644
--- a/sample/api/optical_char_recognition.go
+++ b/sample/api/optical_char_recognition.go
@@ -5,16 +5,15 @@ import (
"fmt"
"github.com/larksuite/oapi-sdk-go/api/core/response"
"github.com/larksuite/oapi-sdk-go/core"
- "github.com/larksuite/oapi-sdk-go/core/constants"
"github.com/larksuite/oapi-sdk-go/core/tools"
"github.com/larksuite/oapi-sdk-go/sample/configs"
optical_char_recognition "github.com/larksuite/oapi-sdk-go/service/optical_char_recognition/v1"
)
// for redis store and logrus
-// configs.TestConfigWithLogrusAndRedisStore(constants.DomainFeiShu)
+// configs.TestConfigWithLogrusAndRedisStore(core.DomainFeiShu)
// configs.TestConfig("https://open.feishu.cn")
-var opticalCharRecognitionService = optical_char_recognition.NewService(configs.TestConfig(constants.DomainFeiShu))
+var opticalCharRecognitionService = optical_char_recognition.NewService(configs.TestConfig(core.DomainFeiShu))
func main() {
testImageBasicRecognize()
diff --git a/sample/api/speech_to_text.go b/sample/api/speech_to_text.go
index fac189b5..7a6ad0ad 100644
--- a/sample/api/speech_to_text.go
+++ b/sample/api/speech_to_text.go
@@ -5,16 +5,15 @@ import (
"fmt"
"github.com/larksuite/oapi-sdk-go/api/core/response"
"github.com/larksuite/oapi-sdk-go/core"
- "github.com/larksuite/oapi-sdk-go/core/constants"
"github.com/larksuite/oapi-sdk-go/core/tools"
"github.com/larksuite/oapi-sdk-go/sample/configs"
speech_to_text "github.com/larksuite/oapi-sdk-go/service/speech_to_text/v1"
)
// for redis store and logrus
-// configs.TestConfigWithLogrusAndRedisStore(constants.DomainFeiShu)
+// configs.TestConfigWithLogrusAndRedisStore(core.DomainFeiShu)
// configs.TestConfig("https://open.feishu.cn")
-var speechToTextService = speech_to_text.NewService(configs.TestConfig(constants.DomainFeiShu))
+var speechToTextService = speech_to_text.NewService(configs.TestConfig(core.DomainFeiShu))
func main() {
testSpeechFileRecognize()
diff --git a/sample/api/translation.go b/sample/api/translation.go
index 47f88875..eb637bb5 100644
--- a/sample/api/translation.go
+++ b/sample/api/translation.go
@@ -5,16 +5,15 @@ import (
"fmt"
"github.com/larksuite/oapi-sdk-go/api/core/response"
"github.com/larksuite/oapi-sdk-go/core"
- "github.com/larksuite/oapi-sdk-go/core/constants"
"github.com/larksuite/oapi-sdk-go/core/tools"
"github.com/larksuite/oapi-sdk-go/sample/configs"
translation "github.com/larksuite/oapi-sdk-go/service/translation/v1"
)
// for redis store and logrus
-// configs.TestConfigWithLogrusAndRedisStore(constants.DomainFeiShu)
+// configs.TestConfigWithLogrusAndRedisStore(core.DomainFeiShu)
// configs.TestConfig("https://open.feishu.cn")
-var translationService = translation.NewService(configs.TestConfig(constants.DomainFeiShu))
+var translationService = translation.NewService(configs.TestConfig(core.DomainFeiShu))
func main() {
testTextDetect()
diff --git a/sample/api/vc.go b/sample/api/vc.go
index 9c24882c..e0bcbac9 100644
--- a/sample/api/vc.go
+++ b/sample/api/vc.go
@@ -6,16 +6,15 @@ import (
"github.com/larksuite/oapi-sdk-go/api/core/request"
"github.com/larksuite/oapi-sdk-go/api/core/response"
"github.com/larksuite/oapi-sdk-go/core"
- "github.com/larksuite/oapi-sdk-go/core/constants"
"github.com/larksuite/oapi-sdk-go/core/tools"
"github.com/larksuite/oapi-sdk-go/sample/configs"
vc "github.com/larksuite/oapi-sdk-go/service/vc/v1"
)
// for redis store and logrus
-// configs.TestConfigWithLogrusAndRedisStore(constants.DomainFeiShu)
+// configs.TestConfigWithLogrusAndRedisStore(core.DomainFeiShu)
// configs.TestConfig("https://open.feishu.cn")
-var VCService = vc.NewService(configs.TestConfig(constants.DomainFeiShu))
+var VCService = vc.NewService(configs.TestConfig(core.DomainFeiShu))
func main() {
testReserveApply()
diff --git a/sample/card/gin.go b/sample/card/gin.go
index 6860abec..f3ff7a40 100644
--- a/sample/card/gin.go
+++ b/sample/card/gin.go
@@ -4,10 +4,9 @@ import (
"fmt"
"github.com/gin-gonic/gin"
"github.com/larksuite/oapi-sdk-go/card"
- cardtttp "github.com/larksuite/oapi-sdk-go/card/http"
+ cardhttp "github.com/larksuite/oapi-sdk-go/card/http"
"github.com/larksuite/oapi-sdk-go/card/model"
"github.com/larksuite/oapi-sdk-go/core"
- "github.com/larksuite/oapi-sdk-go/core/constants"
"github.com/larksuite/oapi-sdk-go/core/tools"
"github.com/larksuite/oapi-sdk-go/sample/configs"
)
@@ -15,9 +14,9 @@ import (
func main() {
// for redis store and logrus
- // var conf = configs.TestConfigWithLogrusAndRedisStore(constants.DomainFeiShu)
+ // var conf = configs.TestConfigWithLogrusAndRedisStore(core.DomainFeiShu)
// var conf = configs.TestConfig("https://open.feishu.cn")
- var conf = configs.TestConfig(constants.DomainFeiShu)
+ var conf = configs.TestConfig(core.DomainFeiShu)
card.SetHandler(conf, func(coreCtx *core.Context, card *model.Card) (interface{}, error) {
fmt.Println(coreCtx.GetRequestID())
@@ -27,7 +26,7 @@ func main() {
g := gin.Default()
g.POST("/webhook/card", func(context *gin.Context) {
- cardtttp.Handle(conf, context.Request, context.Writer)
+ cardhttp.Handle(conf, context.Request, context.Writer)
})
err := g.Run(":8089")
if err != nil {
diff --git a/sample/card/go.go b/sample/card/go.go
index 852ab593..00c32506 100644
--- a/sample/card/go.go
+++ b/sample/card/go.go
@@ -6,7 +6,6 @@ import (
"github.com/larksuite/oapi-sdk-go/card"
"github.com/larksuite/oapi-sdk-go/card/model"
"github.com/larksuite/oapi-sdk-go/core"
- "github.com/larksuite/oapi-sdk-go/core/constants"
coremodel "github.com/larksuite/oapi-sdk-go/core/model"
"github.com/larksuite/oapi-sdk-go/core/tools"
"github.com/larksuite/oapi-sdk-go/sample/configs"
@@ -14,9 +13,9 @@ import (
func main() {
// for redis store and logrus
- // var conf = configs.TestConfigWithLogrusAndRedisStore(constants.DomainFeiShu)
+ // var conf = configs.TestConfigWithLogrusAndRedisStore(core.DomainFeiShu)
// var conf = configs.TestConfig("https://open.feishu.cn")
- var conf = configs.TestConfig(constants.DomainFeiShu)
+ var conf = configs.TestConfig(core.DomainFeiShu)
card.SetHandler(conf, func(coreCtx *core.Context, card *model.Card) (interface{}, error) {
fmt.Println(coreCtx.GetRequestID())
diff --git a/sample/card/http_server.go b/sample/card/http_server.go
index 8e02473b..cb8e080f 100644
--- a/sample/card/http_server.go
+++ b/sample/card/http_server.go
@@ -6,7 +6,6 @@ import (
cardhttpserver "github.com/larksuite/oapi-sdk-go/card/http/native"
"github.com/larksuite/oapi-sdk-go/card/model"
"github.com/larksuite/oapi-sdk-go/core"
- "github.com/larksuite/oapi-sdk-go/core/constants"
"github.com/larksuite/oapi-sdk-go/core/tools"
"github.com/larksuite/oapi-sdk-go/sample/configs"
"net/http"
@@ -15,9 +14,9 @@ import (
func main() {
// for redis store and logrus
- // var conf = configs.TestConfigWithLogrusAndRedisStore(constants.DomainFeiShu)
+ // var conf = configs.TestConfigWithLogrusAndRedisStore(core.DomainFeiShu)
// var conf = configs.TestConfig("https://open.feishu.cn")
- var conf = configs.TestConfig(constants.DomainFeiShu)
+ var conf = configs.TestConfig(core.DomainFeiShu)
card.SetHandler(conf, func(ctx *core.Context, card *model.Card) (interface{}, error) {
fmt.Println(ctx.GetRequestID())
diff --git a/sample/configs/config.go b/sample/configs/config.go
index 59bc722c..ddcdb5c3 100644
--- a/sample/configs/config.go
+++ b/sample/configs/config.go
@@ -1,20 +1,19 @@
package configs
import (
+ "github.com/larksuite/oapi-sdk-go/core"
"github.com/larksuite/oapi-sdk-go/core/config"
- "github.com/larksuite/oapi-sdk-go/core/constants"
- "github.com/larksuite/oapi-sdk-go/core/log"
)
// for Cutome APP(企业自建应用)
-var appSettings = config.GetInternalAppSettingsByEnv()
+var appSettings = core.GetInternalAppSettingsByEnv()
-func TestConfigWithLogrusAndRedisStore(domain constants.Domain) *config.Config {
+func TestConfigWithLogrusAndRedisStore(domain core.Domain) *config.Config {
logger := Logrus{}
store := NewRedisStore()
- return config.NewConfig(domain, appSettings, logger, log.LevelDebug, store)
+ return core.NewConfig(domain, appSettings, core.SetLogger(logger), core.SetLoggerLevel(core.LoggerLevelDebug), core.SetStore(store))
}
-func TestConfig(domain constants.Domain) *config.Config {
- return config.NewConfigWithDefaultStore(domain, appSettings, log.NewDefaultLogger(), log.LevelDebug)
+func TestConfig(domain core.Domain) *config.Config {
+ return core.NewConfig(domain, appSettings, core.SetLoggerLevel(core.LoggerLevelDebug))
}
diff --git a/sample/configs/logrus.go b/sample/configs/logrus.go
index a8761da6..cedfa1d4 100644
--- a/sample/configs/logrus.go
+++ b/sample/configs/logrus.go
@@ -3,17 +3,27 @@ package configs
import (
"context"
"github.com/sirupsen/logrus"
+ "os"
)
// use logrus implement log.Logger
type Logrus struct {
}
+func init() {
+ logrus.SetFormatter(&logrus.TextFormatter{
+ DisableColors: true,
+ FullTimestamp: true,
+ })
+ logrus.SetOutput(os.Stdout)
+ logrus.SetLevel(logrus.DebugLevel)
+}
+
func (Logrus) Debug(ctx context.Context, args ...interface{}) {
logrus.Debug(args...)
}
func (Logrus) Info(ctx context.Context, args ...interface{}) {
- logrus.Debug(args...)
+ logrus.Info(args...)
}
func (Logrus) Warn(ctx context.Context, args ...interface{}) {
logrus.Debug(args...)
diff --git a/sample/event/application.go b/sample/event/application.go
index 99bac199..68147b47 100644
--- a/sample/event/application.go
+++ b/sample/event/application.go
@@ -3,7 +3,6 @@ package main
import (
"fmt"
"github.com/larksuite/oapi-sdk-go/core"
- "github.com/larksuite/oapi-sdk-go/core/constants"
"github.com/larksuite/oapi-sdk-go/core/tools"
eventhttpserver "github.com/larksuite/oapi-sdk-go/event/http/native"
"github.com/larksuite/oapi-sdk-go/sample/configs"
@@ -14,9 +13,9 @@ import (
func main() {
// for redis store and logrus
- // var conf = configs.TestConfigWithLogrusAndRedisStore(constants.DomainFeiShu)
+ // var conf = configs.TestConfigWithLogrusAndRedisStore(core.DomainFeiShu)
// var conf = configs.TestConfig("https://open.feishu.cn")
- var conf = configs.TestConfig(constants.DomainFeiShu)
+ var conf = configs.TestConfig(core.DomainFeiShu)
application.SetAppOpenEventHandler(conf, func(coreCtx *core.Context, appOpenEvent *application.AppOpenEvent) error {
fmt.Println(coreCtx.GetRequestID())
diff --git a/sample/event/contact.go b/sample/event/contact.go
index 496e7ec2..80652f3d 100644
--- a/sample/event/contact.go
+++ b/sample/event/contact.go
@@ -4,7 +4,6 @@ import (
"fmt"
"github.com/gin-gonic/gin"
"github.com/larksuite/oapi-sdk-go/core"
- "github.com/larksuite/oapi-sdk-go/core/constants"
"github.com/larksuite/oapi-sdk-go/core/tools"
eventhttp "github.com/larksuite/oapi-sdk-go/event/http"
"github.com/larksuite/oapi-sdk-go/sample/configs"
@@ -14,9 +13,9 @@ import (
func main() {
// for redis store and logrus
- // var conf = configs.TestConfigWithLogrusAndRedisStore(constants.DomainFeiShu)
+ // var conf = configs.TestConfigWithLogrusAndRedisStore(core.DomainFeiShu)
// var conf = configs.TestConfig("https://open.feishu.cn")
- var conf = configs.TestConfig(constants.DomainFeiShu)
+ var conf = configs.TestConfig(core.DomainFeiShu)
contact.SetDepartmentCreatedEventHandler(conf, func(ctx *core.Context, event *contact.DepartmentCreatedEvent) error {
fmt.Println(ctx.GetRequestID())
diff --git a/sample/event/gin.go b/sample/event/gin.go
index 517ff3ba..8caad683 100644
--- a/sample/event/gin.go
+++ b/sample/event/gin.go
@@ -4,7 +4,6 @@ import (
"fmt"
"github.com/gin-gonic/gin"
"github.com/larksuite/oapi-sdk-go/core"
- "github.com/larksuite/oapi-sdk-go/core/constants"
"github.com/larksuite/oapi-sdk-go/core/tools"
"github.com/larksuite/oapi-sdk-go/event"
eventhttp "github.com/larksuite/oapi-sdk-go/event/http"
@@ -13,9 +12,9 @@ import (
)
// for redis store and logrus
-// var conf = configs.TestConfigWithLogrusAndRedisStore(constants.DomainFeiShu)
+// var conf = configs.TestConfigWithLogrusAndRedisStore(core.DomainFeiShu)
// var conf = configs.TestConfig("https://open.feishu.cn")
-var conf = configs.TestConfig(constants.DomainFeiShu)
+var conf = configs.TestConfig(core.DomainFeiShu)
func main() {
diff --git a/sample/event/go.go b/sample/event/go.go
index 37a5b777..f3966bb8 100644
--- a/sample/event/go.go
+++ b/sample/event/go.go
@@ -4,7 +4,6 @@ import (
"context"
"fmt"
"github.com/larksuite/oapi-sdk-go/core"
- "github.com/larksuite/oapi-sdk-go/core/constants"
coremodel "github.com/larksuite/oapi-sdk-go/core/model"
"github.com/larksuite/oapi-sdk-go/core/tools"
"github.com/larksuite/oapi-sdk-go/event"
@@ -14,9 +13,9 @@ import (
func main() {
// for redis store and logrus
- // var conf = configs.TestConfigWithLogrusAndRedisStore(constants.DomainFeiShu)
+ // var conf = configs.TestConfigWithLogrusAndRedisStore(core.DomainFeiShu)
// var conf = configs.TestConfig("https://open.feishu.cn")
- var conf = configs.TestConfig(constants.DomainFeiShu)
+ var conf = configs.TestConfig(core.DomainFeiShu)
application.SetAppOpenEventHandler(conf, func(coreCtx *core.Context, appOpenEvent *application.AppOpenEvent) error {
fmt.Println(coreCtx.GetRequestID())
diff --git a/sample/event/http_server.go b/sample/event/http_server.go
index d236e866..e9c28ba9 100644
--- a/sample/event/http_server.go
+++ b/sample/event/http_server.go
@@ -3,7 +3,6 @@ package main
import (
"fmt"
"github.com/larksuite/oapi-sdk-go/core"
- "github.com/larksuite/oapi-sdk-go/core/constants"
"github.com/larksuite/oapi-sdk-go/core/tools"
"github.com/larksuite/oapi-sdk-go/event"
eventhttpserver "github.com/larksuite/oapi-sdk-go/event/http/native"
@@ -15,9 +14,9 @@ import (
func main() {
// for redis store and logrus
- // var conf = configs.TestConfigWithLogrusAndRedisStore(constants.DomainFeiShu)
+ // var conf = configs.TestConfigWithLogrusAndRedisStore(core.DomainFeiShu)
// var conf = configs.TestConfig("https://open.feishu.cn")
- var conf = configs.TestConfig(constants.DomainFeiShu)
+ var conf = configs.TestConfig(core.DomainFeiShu)
application.SetAppOpenEventHandler(conf, func(coreCtx *core.Context, appOpenEvent *application.AppOpenEvent) error {
fmt.Println(coreCtx.GetRequestID())
diff --git a/sample/event/im.go b/sample/event/im.go
index e5df3261..f9dcdc25 100644
--- a/sample/event/im.go
+++ b/sample/event/im.go
@@ -4,7 +4,6 @@ import (
"fmt"
"github.com/gin-gonic/gin"
"github.com/larksuite/oapi-sdk-go/core"
- "github.com/larksuite/oapi-sdk-go/core/constants"
"github.com/larksuite/oapi-sdk-go/core/tools"
eventhttp "github.com/larksuite/oapi-sdk-go/event/http"
"github.com/larksuite/oapi-sdk-go/sample/configs"
@@ -14,9 +13,9 @@ import (
func main() {
// for redis store and logrus
- // var conf = configs.TestConfigWithLogrusAndRedisStore(constants.DomainFeiShu)
+ // var conf = configs.TestConfigWithLogrusAndRedisStore(core.DomainFeiShu)
// var conf = configs.TestConfig("https://open.feishu.cn")
- var conf = configs.TestConfig(constants.DomainFeiShu)
+ var conf = configs.TestConfig(core.DomainFeiShu)
im.SetMessageReceiveEventHandler(conf, func(ctx *core.Context, event *im.MessageReceiveEvent) error {
fmt.Println(ctx.GetRequestID())
diff --git a/service/admin/v1/api.go b/service/admin/v1/api.go
index 938d00bb..74ba6a3f 100644
--- a/service/admin/v1/api.go
+++ b/service/admin/v1/api.go
@@ -75,7 +75,7 @@ func (rc *AdminDeptStatListReqCall) SetPageToken(pageToken string) {
func (rc *AdminDeptStatListReqCall) Do() (*AdminDeptStatListResult, error) {
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &AdminDeptStatListResult{}
- req := request.NewRequest("admin/v1/admin_dept_stats", "GET",
+ req := request.NewRequest("/open-apis/admin/v1/admin_dept_stats", "GET",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.adminDeptStats.service.conf, req)
return result, err
@@ -125,7 +125,7 @@ func (rc *AdminUserStatListReqCall) SetPageToken(pageToken string) {
func (rc *AdminUserStatListReqCall) Do() (*AdminUserStatListResult, error) {
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &AdminUserStatListResult{}
- req := request.NewRequest("admin/v1/admin_user_stats", "GET",
+ req := request.NewRequest("/open-apis/admin/v1/admin_user_stats", "GET",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.adminUserStats.service.conf, req)
return result, err
diff --git a/service/authen/v1/api.go b/service/authen/v1/api.go
index e4766f27..b3711ff9 100644
--- a/service/authen/v1/api.go
+++ b/service/authen/v1/api.go
@@ -40,7 +40,7 @@ type AuthenAccessTokenReqCall struct {
func (rc *AuthenAccessTokenReqCall) Do() (*UserAccessTokenInfo, error) {
var result = &UserAccessTokenInfo{}
- req := request.NewRequest("authen/v1/access_token", "POST",
+ req := request.NewRequest("/open-apis/authen/v1/access_token", "POST",
[]request.AccessTokenType{request.AccessTokenTypeApp}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.authens.service.conf, req)
return result, err
@@ -64,7 +64,7 @@ type AuthenRefreshAccessTokenReqCall struct {
func (rc *AuthenRefreshAccessTokenReqCall) Do() (*UserAccessTokenInfo, error) {
var result = &UserAccessTokenInfo{}
- req := request.NewRequest("authen/v1/refresh_access_token", "POST",
+ req := request.NewRequest("/open-apis/authen/v1/refresh_access_token", "POST",
[]request.AccessTokenType{request.AccessTokenTypeApp}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.authens.service.conf, req)
return result, err
@@ -87,7 +87,7 @@ type AuthenUserInfoReqCall struct {
func (rc *AuthenUserInfoReqCall) Do() (*UserInfo, error) {
var result = &UserInfo{}
- req := request.NewRequest("authen/v1/user_info", "GET",
+ req := request.NewRequest("/open-apis/authen/v1/user_info", "GET",
[]request.AccessTokenType{request.AccessTokenTypeUser}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.authens.service.conf, req)
return result, err
diff --git a/service/bitable/v1/api.go b/service/bitable/v1/api.go
index eaa6c729..7251f66b 100644
--- a/service/bitable/v1/api.go
+++ b/service/bitable/v1/api.go
@@ -4,6 +4,7 @@ package v1
import (
"github.com/larksuite/oapi-sdk-go/api"
"github.com/larksuite/oapi-sdk-go/api/core/request"
+ "github.com/larksuite/oapi-sdk-go/api/core/response"
"github.com/larksuite/oapi-sdk-go/core"
"github.com/larksuite/oapi-sdk-go/core/config"
)
@@ -14,6 +15,7 @@ type Service struct {
AppTables *AppTableService
AppTableFields *AppTableFieldService
AppTableRecords *AppTableRecordService
+ AppTableViews *AppTableViewService
}
func NewService(conf *config.Config) *Service {
@@ -24,6 +26,7 @@ func NewService(conf *config.Config) *Service {
s.AppTables = newAppTableService(s)
s.AppTableFields = newAppTableFieldService(s)
s.AppTableRecords = newAppTableRecordService(s)
+ s.AppTableViews = newAppTableViewService(s)
return s
}
@@ -67,6 +70,16 @@ func newAppTableRecordService(service *Service) *AppTableRecordService {
}
}
+type AppTableViewService struct {
+ service *Service
+}
+
+func newAppTableViewService(service *Service) *AppTableViewService {
+ return &AppTableViewService{
+ service: service,
+ }
+}
+
type AppTableRecordBatchDeleteReqCall struct {
ctx *core.Context
appTableRecords *AppTableRecordService
@@ -85,8 +98,8 @@ func (rc *AppTableRecordBatchDeleteReqCall) SetTableId(tableId string) {
func (rc *AppTableRecordBatchDeleteReqCall) Do() (*AppTableRecordBatchDeleteResult, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &AppTableRecordBatchDeleteResult{}
- req := request.NewRequest("bitable/v1/apps/:app_token/tables/:table_id/records/batch_delete", "POST",
- []request.AccessTokenType{request.AccessTokenTypeUser}, rc.body, result, rc.optFns...)
+ req := request.NewRequest("/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_delete", "POST",
+ []request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.appTableRecords.service.conf, req)
return result, err
}
@@ -124,8 +137,8 @@ func (rc *AppTableRecordBatchCreateReqCall) Do() (*AppTableRecordBatchCreateResu
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &AppTableRecordBatchCreateResult{}
- req := request.NewRequest("bitable/v1/apps/:app_token/tables/:table_id/records/batch_create", "POST",
- []request.AccessTokenType{request.AccessTokenTypeUser}, rc.body, result, rc.optFns...)
+ req := request.NewRequest("/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_create", "POST",
+ []request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.appTableRecords.service.conf, req)
return result, err
}
@@ -145,6 +158,7 @@ type AppTableRecordGetReqCall struct {
ctx *core.Context
appTableRecords *AppTableRecordService
pathParams map[string]interface{}
+ queryParams map[string]interface{}
optFns []request.OptFn
}
@@ -157,12 +171,16 @@ func (rc *AppTableRecordGetReqCall) SetTableId(tableId string) {
func (rc *AppTableRecordGetReqCall) SetRecordId(recordId string) {
rc.pathParams["record_id"] = recordId
}
+func (rc *AppTableRecordGetReqCall) SetUserIdType(userIdType string) {
+ rc.queryParams["user_id_type"] = userIdType
+}
func (rc *AppTableRecordGetReqCall) Do() (*AppTableRecordGetResult, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
+ rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &AppTableRecordGetResult{}
- req := request.NewRequest("bitable/v1/apps/:app_token/tables/:table_id/records/:record_id", "GET",
- []request.AccessTokenType{request.AccessTokenTypeUser}, nil, result, rc.optFns...)
+ req := request.NewRequest("/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id", "GET",
+ []request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.appTableRecords.service.conf, req)
return result, err
}
@@ -172,6 +190,7 @@ func (appTableRecords *AppTableRecordService) Get(ctx *core.Context, optFns ...r
ctx: ctx,
appTableRecords: appTableRecords,
pathParams: map[string]interface{}{},
+ queryParams: map[string]interface{}{},
optFns: optFns,
}
}
@@ -202,8 +221,8 @@ func (rc *AppTableRecordUpdateReqCall) Do() (*AppTableRecordUpdateResult, error)
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &AppTableRecordUpdateResult{}
- req := request.NewRequest("bitable/v1/apps/:app_token/tables/:table_id/records/:record_id", "PUT",
- []request.AccessTokenType{request.AccessTokenTypeUser}, rc.body, result, rc.optFns...)
+ req := request.NewRequest("/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id", "PUT",
+ []request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.appTableRecords.service.conf, req)
return result, err
}
@@ -239,8 +258,8 @@ func (rc *AppTableRecordDeleteReqCall) SetRecordId(recordId string) {
func (rc *AppTableRecordDeleteReqCall) Do() (*DeleteRecord, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &DeleteRecord{}
- req := request.NewRequest("bitable/v1/apps/:app_token/tables/:table_id/records/:record_id", "DELETE",
- []request.AccessTokenType{request.AccessTokenTypeUser}, nil, result, rc.optFns...)
+ req := request.NewRequest("/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id", "DELETE",
+ []request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.appTableRecords.service.conf, req)
return result, err
}
@@ -271,19 +290,31 @@ func (rc *AppTableRecordListReqCall) SetTableId(tableId string) {
func (rc *AppTableRecordListReqCall) SetViewId(viewId string) {
rc.queryParams["view_id"] = viewId
}
+func (rc *AppTableRecordListReqCall) SetFilter(filter string) {
+ rc.queryParams["filter"] = filter
+}
+func (rc *AppTableRecordListReqCall) SetSort(sort string) {
+ rc.queryParams["sort"] = sort
+}
+func (rc *AppTableRecordListReqCall) SetFieldNames(fieldNames string) {
+ rc.queryParams["field_names"] = fieldNames
+}
func (rc *AppTableRecordListReqCall) SetPageToken(pageToken string) {
rc.queryParams["page_token"] = pageToken
}
func (rc *AppTableRecordListReqCall) SetPageSize(pageSize int) {
rc.queryParams["page_size"] = pageSize
}
+func (rc *AppTableRecordListReqCall) SetUserIdType(userIdType string) {
+ rc.queryParams["user_id_type"] = userIdType
+}
func (rc *AppTableRecordListReqCall) Do() (*AppTableRecordListResult, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &AppTableRecordListResult{}
- req := request.NewRequest("bitable/v1/apps/:app_token/tables/:table_id/records", "GET",
- []request.AccessTokenType{request.AccessTokenTypeUser}, nil, result, rc.optFns...)
+ req := request.NewRequest("/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records", "GET",
+ []request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.appTableRecords.service.conf, req)
return result, err
}
@@ -321,8 +352,8 @@ func (rc *AppTableRecordBatchUpdateReqCall) Do() (*AppTableRecordBatchUpdateResu
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &AppTableRecordBatchUpdateResult{}
- req := request.NewRequest("bitable/v1/apps/:app_token/tables/:table_id/records/batch_update", "POST",
- []request.AccessTokenType{request.AccessTokenTypeUser}, rc.body, result, rc.optFns...)
+ req := request.NewRequest("/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_update", "POST",
+ []request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.appTableRecords.service.conf, req)
return result, err
}
@@ -361,8 +392,8 @@ func (rc *AppTableRecordCreateReqCall) Do() (*AppTableRecordCreateResult, error)
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &AppTableRecordCreateResult{}
- req := request.NewRequest("bitable/v1/apps/:app_token/tables/:table_id/records", "POST",
- []request.AccessTokenType{request.AccessTokenTypeUser}, rc.body, result, rc.optFns...)
+ req := request.NewRequest("/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records", "POST",
+ []request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.appTableRecords.service.conf, req)
return result, err
}
@@ -392,8 +423,8 @@ func (rc *AppGetReqCall) SetAppToken(appToken string) {
func (rc *AppGetReqCall) Do() (*AppGetResult, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &AppGetResult{}
- req := request.NewRequest("bitable/v1/apps/:app_token", "GET",
- []request.AccessTokenType{request.AccessTokenTypeUser}, nil, result, rc.optFns...)
+ req := request.NewRequest("/open-apis/bitable/v1/apps/:app_token", "GET",
+ []request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.apps.service.conf, req)
return result, err
}
@@ -429,8 +460,8 @@ func (rc *AppTableListReqCall) Do() (*AppTableListResult, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &AppTableListResult{}
- req := request.NewRequest("bitable/v1/apps/:app_token/tables", "GET",
- []request.AccessTokenType{request.AccessTokenTypeUser}, nil, result, rc.optFns...)
+ req := request.NewRequest("/open-apis/bitable/v1/apps/:app_token/tables", "GET",
+ []request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.appTables.service.conf, req)
return result, err
}
@@ -473,8 +504,8 @@ func (rc *AppTableFieldListReqCall) Do() (*AppTableFieldListResult, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &AppTableFieldListResult{}
- req := request.NewRequest("bitable/v1/apps/:app_token/tables/:table_id/fields", "GET",
- []request.AccessTokenType{request.AccessTokenTypeUser}, nil, result, rc.optFns...)
+ req := request.NewRequest("/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields", "GET",
+ []request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.appTableFields.service.conf, req)
return result, err
}
@@ -488,3 +519,362 @@ func (appTableFields *AppTableFieldService) List(ctx *core.Context, optFns ...re
optFns: optFns,
}
}
+
+type AppTableFieldCreateReqCall struct {
+ ctx *core.Context
+ appTableFields *AppTableFieldService
+ body *AppTableField
+ pathParams map[string]interface{}
+ queryParams map[string]interface{}
+ optFns []request.OptFn
+}
+
+func (rc *AppTableFieldCreateReqCall) SetAppToken(appToken string) {
+ rc.pathParams["app_token"] = appToken
+}
+func (rc *AppTableFieldCreateReqCall) SetTableId(tableId string) {
+ rc.pathParams["table_id"] = tableId
+}
+func (rc *AppTableFieldCreateReqCall) SetUserIdType(userIdType string) {
+ rc.queryParams["user_id_type"] = userIdType
+}
+
+func (rc *AppTableFieldCreateReqCall) Do() (*AppTableFieldCreateResult, error) {
+ rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
+ rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
+ var result = &AppTableFieldCreateResult{}
+ req := request.NewRequest("/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields", "POST",
+ []request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
+ err := api.Send(rc.ctx, rc.appTableFields.service.conf, req)
+ return result, err
+}
+
+func (appTableFields *AppTableFieldService) Create(ctx *core.Context, body *AppTableField, optFns ...request.OptFn) *AppTableFieldCreateReqCall {
+ return &AppTableFieldCreateReqCall{
+ ctx: ctx,
+ appTableFields: appTableFields,
+ body: body,
+ pathParams: map[string]interface{}{},
+ queryParams: map[string]interface{}{},
+ optFns: optFns,
+ }
+}
+
+type AppTableBatchCreateReqCall struct {
+ ctx *core.Context
+ appTables *AppTableService
+ body *AppTableBatchCreateReqBody
+ pathParams map[string]interface{}
+ queryParams map[string]interface{}
+ optFns []request.OptFn
+}
+
+func (rc *AppTableBatchCreateReqCall) SetAppToken(appToken string) {
+ rc.pathParams["app_token"] = appToken
+}
+func (rc *AppTableBatchCreateReqCall) SetUserIdType(userIdType string) {
+ rc.queryParams["user_id_type"] = userIdType
+}
+
+func (rc *AppTableBatchCreateReqCall) Do() (*AppTableBatchCreateResult, error) {
+ rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
+ rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
+ var result = &AppTableBatchCreateResult{}
+ req := request.NewRequest("/open-apis/bitable/v1/apps/:app_token/tables/batch_create", "POST",
+ []request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
+ err := api.Send(rc.ctx, rc.appTables.service.conf, req)
+ return result, err
+}
+
+func (appTables *AppTableService) BatchCreate(ctx *core.Context, body *AppTableBatchCreateReqBody, optFns ...request.OptFn) *AppTableBatchCreateReqCall {
+ return &AppTableBatchCreateReqCall{
+ ctx: ctx,
+ appTables: appTables,
+ body: body,
+ pathParams: map[string]interface{}{},
+ queryParams: map[string]interface{}{},
+ optFns: optFns,
+ }
+}
+
+type AppTableCreateReqCall struct {
+ ctx *core.Context
+ appTables *AppTableService
+ body *AppTableCreateReqBody
+ pathParams map[string]interface{}
+ queryParams map[string]interface{}
+ optFns []request.OptFn
+}
+
+func (rc *AppTableCreateReqCall) SetAppToken(appToken string) {
+ rc.pathParams["app_token"] = appToken
+}
+func (rc *AppTableCreateReqCall) SetUserIdType(userIdType string) {
+ rc.queryParams["user_id_type"] = userIdType
+}
+
+func (rc *AppTableCreateReqCall) Do() (*AppTableCreateResult, error) {
+ rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
+ rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
+ var result = &AppTableCreateResult{}
+ req := request.NewRequest("/open-apis/bitable/v1/apps/:app_token/tables", "POST",
+ []request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
+ err := api.Send(rc.ctx, rc.appTables.service.conf, req)
+ return result, err
+}
+
+func (appTables *AppTableService) Create(ctx *core.Context, body *AppTableCreateReqBody, optFns ...request.OptFn) *AppTableCreateReqCall {
+ return &AppTableCreateReqCall{
+ ctx: ctx,
+ appTables: appTables,
+ body: body,
+ pathParams: map[string]interface{}{},
+ queryParams: map[string]interface{}{},
+ optFns: optFns,
+ }
+}
+
+type AppTableDeleteReqCall struct {
+ ctx *core.Context
+ appTables *AppTableService
+ pathParams map[string]interface{}
+ optFns []request.OptFn
+}
+
+func (rc *AppTableDeleteReqCall) SetAppToken(appToken string) {
+ rc.pathParams["app_token"] = appToken
+}
+func (rc *AppTableDeleteReqCall) SetTableId(tableId string) {
+ rc.pathParams["table_id"] = tableId
+}
+
+func (rc *AppTableDeleteReqCall) Do() (*response.NoData, error) {
+ rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
+ var result = &response.NoData{}
+ req := request.NewRequest("/open-apis/bitable/v1/apps/:app_token/tables/:table_id", "DELETE",
+ []request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
+ err := api.Send(rc.ctx, rc.appTables.service.conf, req)
+ return result, err
+}
+
+func (appTables *AppTableService) Delete(ctx *core.Context, optFns ...request.OptFn) *AppTableDeleteReqCall {
+ return &AppTableDeleteReqCall{
+ ctx: ctx,
+ appTables: appTables,
+ pathParams: map[string]interface{}{},
+ optFns: optFns,
+ }
+}
+
+type AppTableFieldDeleteReqCall struct {
+ ctx *core.Context
+ appTableFields *AppTableFieldService
+ pathParams map[string]interface{}
+ optFns []request.OptFn
+}
+
+func (rc *AppTableFieldDeleteReqCall) SetAppToken(appToken string) {
+ rc.pathParams["app_token"] = appToken
+}
+func (rc *AppTableFieldDeleteReqCall) SetTableId(tableId string) {
+ rc.pathParams["table_id"] = tableId
+}
+func (rc *AppTableFieldDeleteReqCall) SetFieldId(fieldId string) {
+ rc.pathParams["field_id"] = fieldId
+}
+
+func (rc *AppTableFieldDeleteReqCall) Do() (*AppTableFieldDeleteResult, error) {
+ rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
+ var result = &AppTableFieldDeleteResult{}
+ req := request.NewRequest("/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields/:field_id", "DELETE",
+ []request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
+ err := api.Send(rc.ctx, rc.appTableFields.service.conf, req)
+ return result, err
+}
+
+func (appTableFields *AppTableFieldService) Delete(ctx *core.Context, optFns ...request.OptFn) *AppTableFieldDeleteReqCall {
+ return &AppTableFieldDeleteReqCall{
+ ctx: ctx,
+ appTableFields: appTableFields,
+ pathParams: map[string]interface{}{},
+ optFns: optFns,
+ }
+}
+
+type AppTableFieldUpdateReqCall struct {
+ ctx *core.Context
+ appTableFields *AppTableFieldService
+ body *AppTableField
+ pathParams map[string]interface{}
+ optFns []request.OptFn
+}
+
+func (rc *AppTableFieldUpdateReqCall) SetAppToken(appToken string) {
+ rc.pathParams["app_token"] = appToken
+}
+func (rc *AppTableFieldUpdateReqCall) SetTableId(tableId string) {
+ rc.pathParams["table_id"] = tableId
+}
+func (rc *AppTableFieldUpdateReqCall) SetFieldId(fieldId string) {
+ rc.pathParams["field_id"] = fieldId
+}
+
+func (rc *AppTableFieldUpdateReqCall) Do() (*AppTableFieldUpdateResult, error) {
+ rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
+ var result = &AppTableFieldUpdateResult{}
+ req := request.NewRequest("/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields/:field_id", "PUT",
+ []request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
+ err := api.Send(rc.ctx, rc.appTableFields.service.conf, req)
+ return result, err
+}
+
+func (appTableFields *AppTableFieldService) Update(ctx *core.Context, body *AppTableField, optFns ...request.OptFn) *AppTableFieldUpdateReqCall {
+ return &AppTableFieldUpdateReqCall{
+ ctx: ctx,
+ appTableFields: appTableFields,
+ body: body,
+ pathParams: map[string]interface{}{},
+ optFns: optFns,
+ }
+}
+
+type AppTableBatchDeleteReqCall struct {
+ ctx *core.Context
+ appTables *AppTableService
+ body *AppTableBatchDeleteReqBody
+ pathParams map[string]interface{}
+ optFns []request.OptFn
+}
+
+func (rc *AppTableBatchDeleteReqCall) SetAppToken(appToken string) {
+ rc.pathParams["app_token"] = appToken
+}
+
+func (rc *AppTableBatchDeleteReqCall) Do() (*response.NoData, error) {
+ rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
+ var result = &response.NoData{}
+ req := request.NewRequest("/open-apis/bitable/v1/apps/:app_token/tables/batch_delete", "POST",
+ []request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
+ err := api.Send(rc.ctx, rc.appTables.service.conf, req)
+ return result, err
+}
+
+func (appTables *AppTableService) BatchDelete(ctx *core.Context, body *AppTableBatchDeleteReqBody, optFns ...request.OptFn) *AppTableBatchDeleteReqCall {
+ return &AppTableBatchDeleteReqCall{
+ ctx: ctx,
+ appTables: appTables,
+ body: body,
+ pathParams: map[string]interface{}{},
+ optFns: optFns,
+ }
+}
+
+type AppTableViewCreateReqCall struct {
+ ctx *core.Context
+ appTableViews *AppTableViewService
+ body *AppTableView
+ pathParams map[string]interface{}
+ optFns []request.OptFn
+}
+
+func (rc *AppTableViewCreateReqCall) SetAppToken(appToken string) {
+ rc.pathParams["app_token"] = appToken
+}
+func (rc *AppTableViewCreateReqCall) SetTableId(tableId string) {
+ rc.pathParams["table_id"] = tableId
+}
+
+func (rc *AppTableViewCreateReqCall) Do() (*AppTableViewCreateResult, error) {
+ rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
+ var result = &AppTableViewCreateResult{}
+ req := request.NewRequest("/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views", "POST",
+ []request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
+ err := api.Send(rc.ctx, rc.appTableViews.service.conf, req)
+ return result, err
+}
+
+func (appTableViews *AppTableViewService) Create(ctx *core.Context, body *AppTableView, optFns ...request.OptFn) *AppTableViewCreateReqCall {
+ return &AppTableViewCreateReqCall{
+ ctx: ctx,
+ appTableViews: appTableViews,
+ body: body,
+ pathParams: map[string]interface{}{},
+ optFns: optFns,
+ }
+}
+
+type AppTableViewDeleteReqCall struct {
+ ctx *core.Context
+ appTableViews *AppTableViewService
+ pathParams map[string]interface{}
+ optFns []request.OptFn
+}
+
+func (rc *AppTableViewDeleteReqCall) SetAppToken(appToken string) {
+ rc.pathParams["app_token"] = appToken
+}
+func (rc *AppTableViewDeleteReqCall) SetTableId(tableId string) {
+ rc.pathParams["table_id"] = tableId
+}
+func (rc *AppTableViewDeleteReqCall) SetViewId(viewId string) {
+ rc.pathParams["view_id"] = viewId
+}
+
+func (rc *AppTableViewDeleteReqCall) Do() (*response.NoData, error) {
+ rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
+ var result = &response.NoData{}
+ req := request.NewRequest("/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views/:view_id", "DELETE",
+ []request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
+ err := api.Send(rc.ctx, rc.appTableViews.service.conf, req)
+ return result, err
+}
+
+func (appTableViews *AppTableViewService) Delete(ctx *core.Context, optFns ...request.OptFn) *AppTableViewDeleteReqCall {
+ return &AppTableViewDeleteReqCall{
+ ctx: ctx,
+ appTableViews: appTableViews,
+ pathParams: map[string]interface{}{},
+ optFns: optFns,
+ }
+}
+
+type AppTableViewListReqCall struct {
+ ctx *core.Context
+ appTableViews *AppTableViewService
+ pathParams map[string]interface{}
+ queryParams map[string]interface{}
+ optFns []request.OptFn
+}
+
+func (rc *AppTableViewListReqCall) SetAppToken(appToken string) {
+ rc.pathParams["app_token"] = appToken
+}
+func (rc *AppTableViewListReqCall) SetTableId(tableId string) {
+ rc.pathParams["table_id"] = tableId
+}
+func (rc *AppTableViewListReqCall) SetPageSize(pageSize int) {
+ rc.queryParams["page_size"] = pageSize
+}
+func (rc *AppTableViewListReqCall) SetPageToken(pageToken string) {
+ rc.queryParams["page_token"] = pageToken
+}
+
+func (rc *AppTableViewListReqCall) Do() (*AppTableViewListResult, error) {
+ rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
+ rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
+ var result = &AppTableViewListResult{}
+ req := request.NewRequest("/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views", "GET",
+ []request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
+ err := api.Send(rc.ctx, rc.appTableViews.service.conf, req)
+ return result, err
+}
+
+func (appTableViews *AppTableViewService) List(ctx *core.Context, optFns ...request.OptFn) *AppTableViewListReqCall {
+ return &AppTableViewListReqCall{
+ ctx: ctx,
+ appTableViews: appTableViews,
+ pathParams: map[string]interface{}{},
+ queryParams: map[string]interface{}{},
+ optFns: optFns,
+ }
+}
diff --git a/service/bitable/v1/model.go b/service/bitable/v1/model.go
index af17d2ef..87d81014 100644
--- a/service/bitable/v1/model.go
+++ b/service/bitable/v1/model.go
@@ -5,32 +5,6 @@ import (
"github.com/larksuite/oapi-sdk-go/api/core/tools"
)
-type DeleteRecord struct {
- Deleted bool `json:"deleted,omitempty"`
- RecordId string `json:"record_id,omitempty"`
- ForceSendFields []string `json:"-"`
-}
-
-func (s *DeleteRecord) MarshalJSON() ([]byte, error) {
- type cp DeleteRecord
- raw := cp(*s)
- return tools.MarshalJSON(raw, s.ForceSendFields)
-}
-
-type Person struct {
- Id string `json:"id,omitempty"`
- Name string `json:"name,omitempty"`
- EnName string `json:"en_name,omitempty"`
- Email string `json:"email,omitempty"`
- ForceSendFields []string `json:"-"`
-}
-
-func (s *Person) MarshalJSON() ([]byte, error) {
- type cp Person
- raw := cp(*s)
- return tools.MarshalJSON(raw, s.ForceSendFields)
-}
-
type App struct {
AppToken string `json:"app_token,omitempty"`
Revision int `json:"revision,omitempty"`
@@ -46,6 +20,7 @@ func (s *App) MarshalJSON() ([]byte, error) {
type AppTable struct {
TableId string `json:"table_id,omitempty"`
Revision int `json:"revision,omitempty"`
+ Name string `json:"name,omitempty"`
ForceSendFields []string `json:"-"`
}
@@ -56,11 +31,11 @@ func (s *AppTable) MarshalJSON() ([]byte, error) {
}
type AppTableField struct {
- FieldId string `json:"field_id,omitempty"`
- FieldName string `json:"field_name,omitempty"`
- Type int `json:"type,omitempty"`
- Property interface{} `json:"property,omitempty"`
- ForceSendFields []string `json:"-"`
+ FieldId string `json:"field_id,omitempty"`
+ FieldName string `json:"field_name,omitempty"`
+ Type int `json:"type,omitempty"`
+ Property *AppTableFieldProperty `json:"property,omitempty"`
+ ForceSendFields []string `json:"-"`
}
func (s *AppTableField) MarshalJSON() ([]byte, error) {
@@ -69,6 +44,37 @@ func (s *AppTableField) MarshalJSON() ([]byte, error) {
return tools.MarshalJSON(raw, s.ForceSendFields)
}
+type AppTableFieldProperty struct {
+ Options []*AppTableFieldPropertyOption `json:"options,omitempty"`
+ Formatter string `json:"formatter,omitempty"`
+ DateFormat string `json:"date_format,omitempty"`
+ TimeFormat string `json:"time_format,omitempty"`
+ AutoFill bool `json:"auto_fill,omitempty"`
+ Multiple bool `json:"multiple,omitempty"`
+ TableId string `json:"table_id,omitempty"`
+ ViewId string `json:"view_id,omitempty"`
+ Fields []string `json:"fields,omitempty"`
+ ForceSendFields []string `json:"-"`
+}
+
+func (s *AppTableFieldProperty) MarshalJSON() ([]byte, error) {
+ type cp AppTableFieldProperty
+ raw := cp(*s)
+ return tools.MarshalJSON(raw, s.ForceSendFields)
+}
+
+type AppTableFieldPropertyOption struct {
+ Name string `json:"name,omitempty"`
+ Id string `json:"id,omitempty"`
+ ForceSendFields []string `json:"-"`
+}
+
+func (s *AppTableFieldPropertyOption) MarshalJSON() ([]byte, error) {
+ type cp AppTableFieldPropertyOption
+ raw := cp(*s)
+ return tools.MarshalJSON(raw, s.ForceSendFields)
+}
+
type AppTableRecord struct {
RecordId string `json:"record_id,omitempty"`
Fields map[string]interface{} `json:"fields,omitempty"`
@@ -81,13 +87,52 @@ func (s *AppTableRecord) MarshalJSON() ([]byte, error) {
return tools.MarshalJSON(raw, s.ForceSendFields)
}
-type Option struct {
+type AppTableView struct {
+ ViewId string `json:"view_id,omitempty"`
+ ViewName string `json:"view_name,omitempty"`
+ ViewType string `json:"view_type,omitempty"`
+ ForceSendFields []string `json:"-"`
+}
+
+func (s *AppTableView) MarshalJSON() ([]byte, error) {
+ type cp AppTableView
+ raw := cp(*s)
+ return tools.MarshalJSON(raw, s.ForceSendFields)
+}
+
+type DeleteRecord struct {
+ Deleted bool `json:"deleted,omitempty"`
+ RecordId string `json:"record_id,omitempty"`
+ ForceSendFields []string `json:"-"`
+}
+
+func (s *DeleteRecord) MarshalJSON() ([]byte, error) {
+ type cp DeleteRecord
+ raw := cp(*s)
+ return tools.MarshalJSON(raw, s.ForceSendFields)
+}
+
+type Person struct {
+ Id string `json:"id,omitempty"`
+ Name string `json:"name,omitempty"`
+ EnName string `json:"en_name,omitempty"`
+ Email string `json:"email,omitempty"`
+ ForceSendFields []string `json:"-"`
+}
+
+func (s *Person) MarshalJSON() ([]byte, error) {
+ type cp Person
+ raw := cp(*s)
+ return tools.MarshalJSON(raw, s.ForceSendFields)
+}
+
+type ReqTable struct {
Name string `json:"name,omitempty"`
ForceSendFields []string `json:"-"`
}
-func (s *Option) MarshalJSON() ([]byte, error) {
- type cp Option
+func (s *ReqTable) MarshalJSON() ([]byte, error) {
+ type cp ReqTable
raw := cp(*s)
return tools.MarshalJSON(raw, s.ForceSendFields)
}
@@ -170,3 +215,67 @@ type AppTableFieldListResult struct {
PageToken string `json:"page_token,omitempty"`
Items []*AppTableField `json:"items,omitempty"`
}
+
+type AppTableFieldCreateResult struct {
+ Field *AppTableField `json:"field,omitempty"`
+}
+
+type AppTableBatchCreateReqBody struct {
+ Tables []*ReqTable `json:"tables,omitempty"`
+ ForceSendFields []string `json:"-"`
+}
+
+func (s *AppTableBatchCreateReqBody) MarshalJSON() ([]byte, error) {
+ type cp AppTableBatchCreateReqBody
+ raw := cp(*s)
+ return tools.MarshalJSON(raw, s.ForceSendFields)
+}
+
+type AppTableBatchCreateResult struct {
+ TableIds []string `json:"table_ids,omitempty"`
+}
+
+type AppTableCreateReqBody struct {
+ Table *ReqTable `json:"table,omitempty"`
+ ForceSendFields []string `json:"-"`
+}
+
+func (s *AppTableCreateReqBody) MarshalJSON() ([]byte, error) {
+ type cp AppTableCreateReqBody
+ raw := cp(*s)
+ return tools.MarshalJSON(raw, s.ForceSendFields)
+}
+
+type AppTableCreateResult struct {
+ TableId string `json:"table_id,omitempty"`
+}
+
+type AppTableFieldDeleteResult struct {
+ FieldId string `json:"field_id,omitempty"`
+ Deleted bool `json:"deleted,omitempty"`
+}
+
+type AppTableFieldUpdateResult struct {
+ Field *AppTableField `json:"field,omitempty"`
+}
+
+type AppTableBatchDeleteReqBody struct {
+ TableIds []string `json:"table_ids,omitempty"`
+ ForceSendFields []string `json:"-"`
+}
+
+func (s *AppTableBatchDeleteReqBody) MarshalJSON() ([]byte, error) {
+ type cp AppTableBatchDeleteReqBody
+ raw := cp(*s)
+ return tools.MarshalJSON(raw, s.ForceSendFields)
+}
+
+type AppTableViewCreateResult struct {
+ AppTableView *AppTableView `json:"app.table.view,omitempty"`
+}
+
+type AppTableViewListResult struct {
+ Items []*AppTableView `json:"items,omitempty"`
+ PageToken string `json:"page_token,omitempty"`
+ HasMore bool `json:"has_more,omitempty"`
+}
diff --git a/service/calendar/v4/api.go b/service/calendar/v4/api.go
index c438bdb5..a89603ad 100644
--- a/service/calendar/v4/api.go
+++ b/service/calendar/v4/api.go
@@ -16,7 +16,6 @@ type Service struct {
CalendarEvents *CalendarEventService
CalendarEventAttendees *CalendarEventAttendeeService
CalendarEventAttendeeChatMembers *CalendarEventAttendeeChatMemberService
- ExchangeBindings *ExchangeBindingService
Freebusys *FreebusyService
Settings *SettingService
TimeoffEvents *TimeoffEventService
@@ -31,7 +30,6 @@ func NewService(conf *config.Config) *Service {
s.CalendarEvents = newCalendarEventService(s)
s.CalendarEventAttendees = newCalendarEventAttendeeService(s)
s.CalendarEventAttendeeChatMembers = newCalendarEventAttendeeChatMemberService(s)
- s.ExchangeBindings = newExchangeBindingService(s)
s.Freebusys = newFreebusyService(s)
s.Settings = newSettingService(s)
s.TimeoffEvents = newTimeoffEventService(s)
@@ -88,16 +86,6 @@ func newCalendarEventAttendeeChatMemberService(service *Service) *CalendarEventA
}
}
-type ExchangeBindingService struct {
- service *Service
-}
-
-func newExchangeBindingService(service *Service) *ExchangeBindingService {
- return &ExchangeBindingService{
- service: service,
- }
-}
-
type FreebusyService struct {
service *Service
}
@@ -137,7 +125,7 @@ type CalendarCreateReqCall struct {
func (rc *CalendarCreateReqCall) Do() (*CalendarCreateResult, error) {
var result = &CalendarCreateResult{}
- req := request.NewRequest("calendar/v4/calendars", "POST",
+ req := request.NewRequest("/open-apis/calendar/v4/calendars", "POST",
[]request.AccessTokenType{request.AccessTokenTypeTenant, request.AccessTokenTypeUser}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.calendars.service.conf, req)
return result, err
@@ -174,7 +162,7 @@ func (rc *CalendarEventDeleteReqCall) Do() (*response.NoData, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &response.NoData{}
- req := request.NewRequest("calendar/v4/calendars/:calendar_id/events/:event_id", "DELETE",
+ req := request.NewRequest("/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id", "DELETE",
[]request.AccessTokenType{request.AccessTokenTypeTenant, request.AccessTokenTypeUser}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.calendarEvents.service.conf, req)
return result, err
@@ -207,7 +195,7 @@ func (rc *CalendarEventGetReqCall) SetEventId(eventId string) {
func (rc *CalendarEventGetReqCall) Do() (*CalendarEventGetResult, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &CalendarEventGetResult{}
- req := request.NewRequest("calendar/v4/calendars/:calendar_id/events/:event_id", "GET",
+ req := request.NewRequest("/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id", "GET",
[]request.AccessTokenType{request.AccessTokenTypeTenant, request.AccessTokenTypeUser}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.calendarEvents.service.conf, req)
return result, err
@@ -237,7 +225,7 @@ func (rc *CalendarPatchReqCall) SetCalendarId(calendarId string) {
func (rc *CalendarPatchReqCall) Do() (*CalendarPatchResult, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &CalendarPatchResult{}
- req := request.NewRequest("calendar/v4/calendars/:calendar_id", "PATCH",
+ req := request.NewRequest("/open-apis/calendar/v4/calendars/:calendar_id", "PATCH",
[]request.AccessTokenType{request.AccessTokenTypeTenant, request.AccessTokenTypeUser}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.calendars.service.conf, req)
return result, err
@@ -267,7 +255,7 @@ func (rc *CalendarDeleteReqCall) SetCalendarId(calendarId string) {
func (rc *CalendarDeleteReqCall) Do() (*response.NoData, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &response.NoData{}
- req := request.NewRequest("calendar/v4/calendars/:calendar_id", "DELETE",
+ req := request.NewRequest("/open-apis/calendar/v4/calendars/:calendar_id", "DELETE",
[]request.AccessTokenType{request.AccessTokenTypeTenant, request.AccessTokenTypeUser}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.calendars.service.conf, req)
return result, err
@@ -307,7 +295,7 @@ func (rc *CalendarAclListReqCall) Do() (*CalendarAclListResult, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &CalendarAclListResult{}
- req := request.NewRequest("calendar/v4/calendars/:calendar_id/acls", "GET",
+ req := request.NewRequest("/open-apis/calendar/v4/calendars/:calendar_id/acls", "GET",
[]request.AccessTokenType{request.AccessTokenTypeTenant, request.AccessTokenTypeUser}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.calendarAcls.service.conf, req)
return result, err
@@ -340,7 +328,7 @@ func (rc *CalendarAclDeleteReqCall) SetAclId(aclId string) {
func (rc *CalendarAclDeleteReqCall) Do() (*response.NoData, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &response.NoData{}
- req := request.NewRequest("calendar/v4/calendars/:calendar_id/acls/:acl_id", "DELETE",
+ req := request.NewRequest("/open-apis/calendar/v4/calendars/:calendar_id/acls/:acl_id", "DELETE",
[]request.AccessTokenType{request.AccessTokenTypeTenant, request.AccessTokenTypeUser}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.calendarAcls.service.conf, req)
return result, err
@@ -355,37 +343,6 @@ func (calendarAcls *CalendarAclService) Delete(ctx *core.Context, optFns ...requ
}
}
-type CalendarEventCreateReqCall struct {
- ctx *core.Context
- calendarEvents *CalendarEventService
- body *CalendarEvent
- pathParams map[string]interface{}
- optFns []request.OptFn
-}
-
-func (rc *CalendarEventCreateReqCall) SetCalendarId(calendarId string) {
- rc.pathParams["calendar_id"] = calendarId
-}
-
-func (rc *CalendarEventCreateReqCall) Do() (*CalendarEventCreateResult, error) {
- rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
- var result = &CalendarEventCreateResult{}
- req := request.NewRequest("calendar/v4/calendars/:calendar_id/events", "POST",
- []request.AccessTokenType{request.AccessTokenTypeTenant, request.AccessTokenTypeUser}, rc.body, result, rc.optFns...)
- err := api.Send(rc.ctx, rc.calendarEvents.service.conf, req)
- return result, err
-}
-
-func (calendarEvents *CalendarEventService) Create(ctx *core.Context, body *CalendarEvent, optFns ...request.OptFn) *CalendarEventCreateReqCall {
- return &CalendarEventCreateReqCall{
- ctx: ctx,
- calendarEvents: calendarEvents,
- body: body,
- pathParams: map[string]interface{}{},
- optFns: optFns,
- }
-}
-
type CalendarAclCreateReqCall struct {
ctx *core.Context
calendarAcls *CalendarAclService
@@ -406,7 +363,7 @@ func (rc *CalendarAclCreateReqCall) Do() (*CalendarAcl, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &CalendarAcl{}
- req := request.NewRequest("calendar/v4/calendars/:calendar_id/acls", "POST",
+ req := request.NewRequest("/open-apis/calendar/v4/calendars/:calendar_id/acls", "POST",
[]request.AccessTokenType{request.AccessTokenTypeTenant, request.AccessTokenTypeUser}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.calendarAcls.service.conf, req)
return result, err
@@ -443,7 +400,7 @@ func (rc *CalendarListReqCall) SetSyncToken(syncToken string) {
func (rc *CalendarListReqCall) Do() (*CalendarListResult, error) {
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &CalendarListResult{}
- req := request.NewRequest("calendar/v4/calendars", "GET",
+ req := request.NewRequest("/open-apis/calendar/v4/calendars", "GET",
[]request.AccessTokenType{request.AccessTokenTypeTenant, request.AccessTokenTypeUser}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.calendars.service.conf, req)
return result, err
@@ -486,7 +443,7 @@ func (rc *CalendarEventAttendeeListReqCall) Do() (*CalendarEventAttendeeListResu
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &CalendarEventAttendeeListResult{}
- req := request.NewRequest("calendar/v4/calendars/:calendar_id/events/:event_id/attendees", "GET",
+ req := request.NewRequest("/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees", "GET",
[]request.AccessTokenType{request.AccessTokenTypeTenant, request.AccessTokenTypeUser}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.calendarEventAttendees.service.conf, req)
return result, err
@@ -520,7 +477,7 @@ func (rc *CalendarEventAttendeeBatchDeleteReqCall) SetEventId(eventId string) {
func (rc *CalendarEventAttendeeBatchDeleteReqCall) Do() (*response.NoData, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &response.NoData{}
- req := request.NewRequest("calendar/v4/calendars/:calendar_id/events/:event_id/attendees/batch_delete", "POST",
+ req := request.NewRequest("/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees/batch_delete", "POST",
[]request.AccessTokenType{request.AccessTokenTypeTenant, request.AccessTokenTypeUser}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.calendarEventAttendees.service.conf, req)
return result, err
@@ -559,7 +516,7 @@ func (rc *CalendarEventAttendeeCreateReqCall) Do() (*CalendarEventAttendeeCreate
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &CalendarEventAttendeeCreateResult{}
- req := request.NewRequest("calendar/v4/calendars/:calendar_id/events/:event_id/attendees", "POST",
+ req := request.NewRequest("/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees", "POST",
[]request.AccessTokenType{request.AccessTokenTypeTenant, request.AccessTokenTypeUser}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.calendarEventAttendees.service.conf, req)
return result, err
@@ -590,7 +547,7 @@ func (rc *CalendarGetReqCall) SetCalendarId(calendarId string) {
func (rc *CalendarGetReqCall) Do() (*Calendar, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &Calendar{}
- req := request.NewRequest("calendar/v4/calendars/:calendar_id", "GET",
+ req := request.NewRequest("/open-apis/calendar/v4/calendars/:calendar_id", "GET",
[]request.AccessTokenType{request.AccessTokenTypeTenant, request.AccessTokenTypeUser}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.calendars.service.conf, req)
return result, err
@@ -633,7 +590,7 @@ func (rc *CalendarEventListReqCall) Do() (*CalendarEventListResult, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &CalendarEventListResult{}
- req := request.NewRequest("calendar/v4/calendars/:calendar_id/events", "GET",
+ req := request.NewRequest("/open-apis/calendar/v4/calendars/:calendar_id/events", "GET",
[]request.AccessTokenType{request.AccessTokenTypeTenant, request.AccessTokenTypeUser}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.calendarEvents.service.conf, req)
return result, err
@@ -667,7 +624,7 @@ func (rc *CalendarSearchReqCall) SetPageSize(pageSize int) {
func (rc *CalendarSearchReqCall) Do() (*CalendarSearchResult, error) {
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &CalendarSearchResult{}
- req := request.NewRequest("calendar/v4/calendars/search", "POST",
+ req := request.NewRequest("/open-apis/calendar/v4/calendars/search", "POST",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.calendars.service.conf, req)
return result, err
@@ -698,7 +655,7 @@ func (rc *FreebusyListReqCall) SetUserIdType(userIdType string) {
func (rc *FreebusyListReqCall) Do() (*FreebusyListResult, error) {
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &FreebusyListResult{}
- req := request.NewRequest("calendar/v4/freebusy/list", "POST",
+ req := request.NewRequest("/open-apis/calendar/v4/freebusy/list", "POST",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.freebusys.service.conf, req)
return result, err
@@ -732,7 +689,7 @@ func (rc *CalendarEventPatchReqCall) SetEventId(eventId string) {
func (rc *CalendarEventPatchReqCall) Do() (*CalendarEventPatchResult, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &CalendarEventPatchResult{}
- req := request.NewRequest("calendar/v4/calendars/:calendar_id/events/:event_id", "PATCH",
+ req := request.NewRequest("/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id", "PATCH",
[]request.AccessTokenType{request.AccessTokenTypeTenant, request.AccessTokenTypeUser}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.calendarEvents.service.conf, req)
return result, err
@@ -762,7 +719,7 @@ func (rc *TimeoffEventDeleteReqCall) SetTimeoffEventId(timeoffEventId string) {
func (rc *TimeoffEventDeleteReqCall) Do() (*response.NoData, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &response.NoData{}
- req := request.NewRequest("calendar/v4/timeoff_events/:timeoff_event_id", "DELETE",
+ req := request.NewRequest("/open-apis/calendar/v4/timeoff_events/:timeoff_event_id", "DELETE",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.timeoffEvents.service.conf, req)
return result, err
@@ -792,7 +749,7 @@ func (rc *TimeoffEventCreateReqCall) SetUserIdType(userIdType string) {
func (rc *TimeoffEventCreateReqCall) Do() (*TimeoffEvent, error) {
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &TimeoffEvent{}
- req := request.NewRequest("calendar/v4/timeoff_events", "POST",
+ req := request.NewRequest("/open-apis/calendar/v4/timeoff_events", "POST",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.timeoffEvents.service.conf, req)
return result, err
@@ -822,7 +779,7 @@ func (rc *CalendarUnsubscribeReqCall) SetCalendarId(calendarId string) {
func (rc *CalendarUnsubscribeReqCall) Do() (*response.NoData, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &response.NoData{}
- req := request.NewRequest("calendar/v4/calendars/:calendar_id/unsubscribe", "POST",
+ req := request.NewRequest("/open-apis/calendar/v4/calendars/:calendar_id/unsubscribe", "POST",
[]request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.calendars.service.conf, req)
return result, err
@@ -863,7 +820,7 @@ func (rc *CalendarEventSearchReqCall) Do() (*CalendarEventSearchResult, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &CalendarEventSearchResult{}
- req := request.NewRequest("calendar/v4/calendars/:calendar_id/events/search", "POST",
+ req := request.NewRequest("/open-apis/calendar/v4/calendars/:calendar_id/events/search", "POST",
[]request.AccessTokenType{request.AccessTokenTypeUser}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.calendarEvents.service.conf, req)
return result, err
@@ -894,7 +851,7 @@ func (rc *CalendarSubscribeReqCall) SetCalendarId(calendarId string) {
func (rc *CalendarSubscribeReqCall) Do() (*CalendarSubscribeResult, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &CalendarSubscribeResult{}
- req := request.NewRequest("calendar/v4/calendars/:calendar_id/subscribe", "POST",
+ req := request.NewRequest("/open-apis/calendar/v4/calendars/:calendar_id/subscribe", "POST",
[]request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.calendars.service.conf, req)
return result, err
@@ -918,7 +875,7 @@ type SettingGenerateCaldavConfReqCall struct {
func (rc *SettingGenerateCaldavConfReqCall) Do() (*SettingGenerateCaldavConfResult, error) {
var result = &SettingGenerateCaldavConfResult{}
- req := request.NewRequest("calendar/v4/settings/generate_caldav_conf", "POST",
+ req := request.NewRequest("/open-apis/calendar/v4/settings/generate_caldav_conf", "POST",
[]request.AccessTokenType{request.AccessTokenTypeUser}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.settings.service.conf, req)
return result, err
@@ -947,7 +904,7 @@ func (rc *CalendarEventSubscriptionReqCall) SetCalendarId(calendarId string) {
func (rc *CalendarEventSubscriptionReqCall) Do() (*response.NoData, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &response.NoData{}
- req := request.NewRequest("calendar/v4/calendars/:calendar_id/events/subscription", "POST",
+ req := request.NewRequest("/open-apis/calendar/v4/calendars/:calendar_id/events/subscription", "POST",
[]request.AccessTokenType{request.AccessTokenTypeUser}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.calendarEvents.service.conf, req)
return result, err
@@ -970,7 +927,7 @@ type CalendarSubscriptionReqCall struct {
func (rc *CalendarSubscriptionReqCall) Do() (*response.NoData, error) {
var result = &response.NoData{}
- req := request.NewRequest("calendar/v4/calendars/subscription", "POST",
+ req := request.NewRequest("/open-apis/calendar/v4/calendars/subscription", "POST",
[]request.AccessTokenType{request.AccessTokenTypeUser}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.calendars.service.conf, req)
return result, err
@@ -998,7 +955,7 @@ func (rc *CalendarAclSubscriptionReqCall) SetCalendarId(calendarId string) {
func (rc *CalendarAclSubscriptionReqCall) Do() (*response.NoData, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &response.NoData{}
- req := request.NewRequest("calendar/v4/calendars/:calendar_id/acls/subscription", "POST",
+ req := request.NewRequest("/open-apis/calendar/v4/calendars/:calendar_id/acls/subscription", "POST",
[]request.AccessTokenType{request.AccessTokenTypeUser}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.calendarAcls.service.conf, req)
return result, err
@@ -1041,7 +998,7 @@ func (rc *CalendarEventAttendeeChatMemberListReqCall) Do() (*CalendarEventAttend
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &CalendarEventAttendeeChatMemberListResult{}
- req := request.NewRequest("calendar/v4/calendars/:calendar_id/events/:event_id/attendees/:attendee_id/chat_members", "GET",
+ req := request.NewRequest("/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees/:attendee_id/chat_members", "GET",
[]request.AccessTokenType{request.AccessTokenTypeTenant, request.AccessTokenTypeUser}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.calendarEventAttendeeChatMembers.service.conf, req)
return result, err
@@ -1056,98 +1013,3 @@ func (calendarEventAttendeeChatMembers *CalendarEventAttendeeChatMemberService)
optFns: optFns,
}
}
-
-type ExchangeBindingCreateReqCall struct {
- ctx *core.Context
- exchangeBindings *ExchangeBindingService
- body *ExchangeBinding
- queryParams map[string]interface{}
- optFns []request.OptFn
-}
-
-func (rc *ExchangeBindingCreateReqCall) SetUserIdType(userIdType string) {
- rc.queryParams["user_id_type"] = userIdType
-}
-
-func (rc *ExchangeBindingCreateReqCall) Do() (*ExchangeBinding, error) {
- rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
- var result = &ExchangeBinding{}
- req := request.NewRequest("calendar/v4/exchange_bindings", "POST",
- []request.AccessTokenType{request.AccessTokenTypeUser}, rc.body, result, rc.optFns...)
- err := api.Send(rc.ctx, rc.exchangeBindings.service.conf, req)
- return result, err
-}
-
-func (exchangeBindings *ExchangeBindingService) Create(ctx *core.Context, body *ExchangeBinding, optFns ...request.OptFn) *ExchangeBindingCreateReqCall {
- return &ExchangeBindingCreateReqCall{
- ctx: ctx,
- exchangeBindings: exchangeBindings,
- body: body,
- queryParams: map[string]interface{}{},
- optFns: optFns,
- }
-}
-
-type ExchangeBindingDeleteReqCall struct {
- ctx *core.Context
- exchangeBindings *ExchangeBindingService
- pathParams map[string]interface{}
- optFns []request.OptFn
-}
-
-func (rc *ExchangeBindingDeleteReqCall) SetExchangeBindingId(exchangeBindingId string) {
- rc.pathParams["exchange_binding_id"] = exchangeBindingId
-}
-
-func (rc *ExchangeBindingDeleteReqCall) Do() (*response.NoData, error) {
- rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
- var result = &response.NoData{}
- req := request.NewRequest("calendar/v4/exchange_bindings/:exchange_binding_id", "DELETE",
- []request.AccessTokenType{request.AccessTokenTypeUser}, nil, result, rc.optFns...)
- err := api.Send(rc.ctx, rc.exchangeBindings.service.conf, req)
- return result, err
-}
-
-func (exchangeBindings *ExchangeBindingService) Delete(ctx *core.Context, optFns ...request.OptFn) *ExchangeBindingDeleteReqCall {
- return &ExchangeBindingDeleteReqCall{
- ctx: ctx,
- exchangeBindings: exchangeBindings,
- pathParams: map[string]interface{}{},
- optFns: optFns,
- }
-}
-
-type ExchangeBindingGetReqCall struct {
- ctx *core.Context
- exchangeBindings *ExchangeBindingService
- pathParams map[string]interface{}
- queryParams map[string]interface{}
- optFns []request.OptFn
-}
-
-func (rc *ExchangeBindingGetReqCall) SetExchangeBindingId(exchangeBindingId string) {
- rc.pathParams["exchange_binding_id"] = exchangeBindingId
-}
-func (rc *ExchangeBindingGetReqCall) SetUserIdType(userIdType string) {
- rc.queryParams["user_id_type"] = userIdType
-}
-
-func (rc *ExchangeBindingGetReqCall) Do() (*ExchangeBinding, error) {
- rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
- rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
- var result = &ExchangeBinding{}
- req := request.NewRequest("calendar/v4/exchange_bindings/:exchange_binding_id", "GET",
- []request.AccessTokenType{request.AccessTokenTypeUser}, nil, result, rc.optFns...)
- err := api.Send(rc.ctx, rc.exchangeBindings.service.conf, req)
- return result, err
-}
-
-func (exchangeBindings *ExchangeBindingService) Get(ctx *core.Context, optFns ...request.OptFn) *ExchangeBindingGetReqCall {
- return &ExchangeBindingGetReqCall{
- ctx: ctx,
- exchangeBindings: exchangeBindings,
- pathParams: map[string]interface{}{},
- queryParams: map[string]interface{}{},
- optFns: optFns,
- }
-}
diff --git a/service/calendar/v4/model.go b/service/calendar/v4/model.go
index f9c8283a..93becd99 100644
--- a/service/calendar/v4/model.go
+++ b/service/calendar/v4/model.go
@@ -213,25 +213,27 @@ func (s *TimeoffEvent) MarshalJSON() ([]byte, error) {
return tools.MarshalJSON(raw, s.ForceSendFields)
}
-type Vchat struct {
- MeetingUrl string `json:"meeting_url,omitempty"`
+type AclScopeEvent struct {
+ Type string `json:"type,omitempty"`
+ UserId *UserId `json:"user_id,omitempty"`
ForceSendFields []string `json:"-"`
}
-func (s *Vchat) MarshalJSON() ([]byte, error) {
- type cp Vchat
+func (s *AclScopeEvent) MarshalJSON() ([]byte, error) {
+ type cp AclScopeEvent
raw := cp(*s)
return tools.MarshalJSON(raw, s.ForceSendFields)
}
-type AclScopeEvent struct {
- Type string `json:"type,omitempty"`
- UserId *UserId `json:"user_id,omitempty"`
- ForceSendFields []string `json:"-"`
+type CalendarAclEvent struct {
+ AclId string `json:"acl_id,omitempty"`
+ Role string `json:"role,omitempty"`
+ Scope *AclScopeEvent `json:"scope,omitempty"`
+ ForceSendFields []string `json:"-"`
}
-func (s *AclScopeEvent) MarshalJSON() ([]byte, error) {
- type cp AclScopeEvent
+func (s *CalendarAclEvent) MarshalJSON() ([]byte, error) {
+ type cp CalendarAclEvent
raw := cp(*s)
return tools.MarshalJSON(raw, s.ForceSendFields)
}
@@ -279,6 +281,20 @@ func (s *ExchangeBinding) MarshalJSON() ([]byte, error) {
return tools.MarshalJSON(raw, s.ForceSendFields)
}
+type Vchat struct {
+ VcType string `json:"vc_type,omitempty"`
+ IconType string `json:"icon_type,omitempty"`
+ Description string `json:"description,omitempty"`
+ MeetingUrl string `json:"meeting_url,omitempty"`
+ ForceSendFields []string `json:"-"`
+}
+
+func (s *Vchat) MarshalJSON() ([]byte, error) {
+ type cp Vchat
+ raw := cp(*s)
+ return tools.MarshalJSON(raw, s.ForceSendFields)
+}
+
type CalendarCreateResult struct {
Calendar *Calendar `json:"calendar,omitempty"`
}
@@ -297,10 +313,6 @@ type CalendarAclListResult struct {
PageToken string `json:"page_token,omitempty"`
}
-type CalendarEventCreateResult struct {
- Event *CalendarEvent `json:"event,omitempty"`
-}
-
type CalendarListResult struct {
HasMore bool `json:"has_more,omitempty"`
PageToken string `json:"page_token,omitempty"`
diff --git a/service/doc/v2/api.go b/service/doc/v2/api.go
index 78c7ff70..46ce1904 100644
--- a/service/doc/v2/api.go
+++ b/service/doc/v2/api.go
@@ -47,7 +47,7 @@ func (rc *DocBatchUpdateReqCall) SetDocToken(docToken string) {
func (rc *DocBatchUpdateReqCall) Do() (*response.NoData, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &response.NoData{}
- req := request.NewRequest("doc/v2/:docToken/batch_update", "POST",
+ req := request.NewRequest("/open-apis/doc/v2/:docToken/batch_update", "POST",
[]request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.docs.service.conf, req)
return result, err
@@ -77,7 +77,7 @@ func (rc *DocContentReqCall) SetDocToken(docToken string) {
func (rc *DocContentReqCall) Do() (*DocContentResult, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &DocContentResult{}
- req := request.NewRequest("doc/v2/:docToken/content", "GET",
+ req := request.NewRequest("/open-apis/doc/v2/:docToken/content", "GET",
[]request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.docs.service.conf, req)
return result, err
@@ -101,7 +101,7 @@ type DocCreateReqCall struct {
func (rc *DocCreateReqCall) Do() (*DocCreateResult, error) {
var result = &DocCreateResult{}
- req := request.NewRequest("doc/v2/create", "POST",
+ req := request.NewRequest("/open-apis/doc/v2/create", "POST",
[]request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.docs.service.conf, req)
return result, err
@@ -130,7 +130,7 @@ func (rc *DocMetaReqCall) SetDocToken(docToken string) {
func (rc *DocMetaReqCall) Do() (*DocMetaResult, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &DocMetaResult{}
- req := request.NewRequest("doc/v2/meta/:docToken", "GET",
+ req := request.NewRequest("/open-apis/doc/v2/meta/:docToken", "GET",
[]request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.docs.service.conf, req)
return result, err
@@ -159,7 +159,7 @@ func (rc *DocRawContentReqCall) SetDocToken(docToken string) {
func (rc *DocRawContentReqCall) Do() (*DocRawContentResult, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &DocRawContentResult{}
- req := request.NewRequest("doc/v2/:docToken/raw_content", "GET",
+ req := request.NewRequest("/open-apis/doc/v2/:docToken/raw_content", "GET",
[]request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.docs.service.conf, req)
return result, err
diff --git a/service/drive/v1/api.go b/service/drive/v1/api.go
index 1c51d2ec..595c00f9 100644
--- a/service/drive/v1/api.go
+++ b/service/drive/v1/api.go
@@ -94,7 +94,7 @@ func (rc *MediaUploadPartReqCall) SetFile(file *request.File) {
func (rc *MediaUploadPartReqCall) Do() (*response.NoData, error) {
var result = &response.NoData{}
- req := request.NewRequest("drive/v1/medias/upload_part", "POST",
+ req := request.NewRequest("/open-apis/drive/v1/medias/upload_part", "POST",
[]request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.medias.service.conf, req)
return result, err
@@ -118,7 +118,7 @@ type FileUploadFinishReqCall struct {
func (rc *FileUploadFinishReqCall) Do() (*FileUploadFinishResult, error) {
var result = &FileUploadFinishResult{}
- req := request.NewRequest("drive/v1/files/upload_finish", "POST",
+ req := request.NewRequest("/open-apis/drive/v1/files/upload_finish", "POST",
[]request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.files.service.conf, req)
return result, err
@@ -136,19 +136,19 @@ func (files *FileService) UploadFinish(ctx *core.Context, body *FileUploadFinish
type FileUploadPrepareReqCall struct {
ctx *core.Context
files *FileService
- body *UploadInfo
+ body *FileUploadInfo
optFns []request.OptFn
}
func (rc *FileUploadPrepareReqCall) Do() (*FileUploadPrepareResult, error) {
var result = &FileUploadPrepareResult{}
- req := request.NewRequest("drive/v1/files/upload_prepare", "POST",
+ req := request.NewRequest("/open-apis/drive/v1/files/upload_prepare", "POST",
[]request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.files.service.conf, req)
return result, err
}
-func (files *FileService) UploadPrepare(ctx *core.Context, body *UploadInfo, optFns ...request.OptFn) *FileUploadPrepareReqCall {
+func (files *FileService) UploadPrepare(ctx *core.Context, body *FileUploadInfo, optFns ...request.OptFn) *FileUploadPrepareReqCall {
return &FileUploadPrepareReqCall{
ctx: ctx,
files: files,
@@ -179,13 +179,16 @@ func (rc *MediaUploadAllReqCall) SetSize(size int) {
func (rc *MediaUploadAllReqCall) SetChecksum(checksum string) {
rc.body.AddParam("checksum", checksum)
}
+func (rc *MediaUploadAllReqCall) SetExtra(extra string) {
+ rc.body.AddParam("extra", extra)
+}
func (rc *MediaUploadAllReqCall) SetFile(file *request.File) {
rc.body.AddFile("file", file)
}
func (rc *MediaUploadAllReqCall) Do() (*MediaUploadAllResult, error) {
var result = &MediaUploadAllResult{}
- req := request.NewRequest("drive/v1/medias/upload_all", "POST",
+ req := request.NewRequest("/open-apis/drive/v1/medias/upload_all", "POST",
[]request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.medias.service.conf, req)
return result, err
@@ -209,7 +212,7 @@ type MediaUploadFinishReqCall struct {
func (rc *MediaUploadFinishReqCall) Do() (*MediaUploadFinishResult, error) {
var result = &MediaUploadFinishResult{}
- req := request.NewRequest("drive/v1/medias/upload_finish", "POST",
+ req := request.NewRequest("/open-apis/drive/v1/medias/upload_finish", "POST",
[]request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.medias.service.conf, req)
return result, err
@@ -252,7 +255,7 @@ func (rc *FileUploadAllReqCall) SetFile(file *request.File) {
func (rc *FileUploadAllReqCall) Do() (*FileUploadAllResult, error) {
var result = &FileUploadAllResult{}
- req := request.NewRequest("drive/v1/files/upload_all", "POST",
+ req := request.NewRequest("/open-apis/drive/v1/files/upload_all", "POST",
[]request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.files.service.conf, req)
return result, err
@@ -270,19 +273,19 @@ func (files *FileService) UploadAll(ctx *core.Context, optFns ...request.OptFn)
type MediaUploadPrepareReqCall struct {
ctx *core.Context
medias *MediaService
- body *UploadInfo
+ body *MediaUploadInfo
optFns []request.OptFn
}
func (rc *MediaUploadPrepareReqCall) Do() (*MediaUploadPrepareResult, error) {
var result = &MediaUploadPrepareResult{}
- req := request.NewRequest("drive/v1/medias/upload_prepare", "POST",
+ req := request.NewRequest("/open-apis/drive/v1/medias/upload_prepare", "POST",
[]request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.medias.service.conf, req)
return result, err
}
-func (medias *MediaService) UploadPrepare(ctx *core.Context, body *UploadInfo, optFns ...request.OptFn) *MediaUploadPrepareReqCall {
+func (medias *MediaService) UploadPrepare(ctx *core.Context, body *MediaUploadInfo, optFns ...request.OptFn) *MediaUploadPrepareReqCall {
return &MediaUploadPrepareReqCall{
ctx: ctx,
medias: medias,
@@ -316,7 +319,7 @@ func (rc *FileUploadPartReqCall) SetFile(file *request.File) {
func (rc *FileUploadPartReqCall) Do() (*response.NoData, error) {
var result = &response.NoData{}
- req := request.NewRequest("drive/v1/files/upload_part", "POST",
+ req := request.NewRequest("/open-apis/drive/v1/files/upload_part", "POST",
[]request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.files.service.conf, req)
return result, err
@@ -341,11 +344,14 @@ type MediaBatchGetTmpDownloadUrlReqCall struct {
func (rc *MediaBatchGetTmpDownloadUrlReqCall) SetFileTokens(fileTokens ...string) {
rc.queryParams["file_tokens"] = fileTokens
}
+func (rc *MediaBatchGetTmpDownloadUrlReqCall) SetExtra(extra string) {
+ rc.queryParams["extra"] = extra
+}
func (rc *MediaBatchGetTmpDownloadUrlReqCall) Do() (*MediaBatchGetTmpDownloadUrlResult, error) {
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &MediaBatchGetTmpDownloadUrlResult{}
- req := request.NewRequest("drive/v1/medias/batch_get_tmp_download_url", "GET",
+ req := request.NewRequest("/open-apis/drive/v1/medias/batch_get_tmp_download_url", "GET",
[]request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.medias.service.conf, req)
return result, err
@@ -378,7 +384,7 @@ func (rc *FileDownloadReqCall) SetResponseStream(result io.Writer) {
func (rc *FileDownloadReqCall) Do() (io.Writer, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
rc.optFns = append(rc.optFns, request.SetResponseStream())
- req := request.NewRequest("drive/v1/files/:file_token/download", "GET",
+ req := request.NewRequest("/open-apis/drive/v1/files/:file_token/download", "GET",
[]request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, nil, rc.result, rc.optFns...)
err := api.Send(rc.ctx, rc.files.service.conf, req)
return rc.result, err
@@ -394,24 +400,29 @@ func (files *FileService) Download(ctx *core.Context, optFns ...request.OptFn) *
}
type MediaDownloadReqCall struct {
- ctx *core.Context
- medias *MediaService
- pathParams map[string]interface{}
- optFns []request.OptFn
- result io.Writer
+ ctx *core.Context
+ medias *MediaService
+ pathParams map[string]interface{}
+ queryParams map[string]interface{}
+ optFns []request.OptFn
+ result io.Writer
}
func (rc *MediaDownloadReqCall) SetFileToken(fileToken string) {
rc.pathParams["file_token"] = fileToken
}
+func (rc *MediaDownloadReqCall) SetExtra(extra string) {
+ rc.queryParams["extra"] = extra
+}
func (rc *MediaDownloadReqCall) SetResponseStream(result io.Writer) {
rc.result = result
}
func (rc *MediaDownloadReqCall) Do() (io.Writer, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
+ rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
rc.optFns = append(rc.optFns, request.SetResponseStream())
- req := request.NewRequest("drive/v1/medias/:file_token/download", "GET",
+ req := request.NewRequest("/open-apis/drive/v1/medias/:file_token/download", "GET",
[]request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, nil, rc.result, rc.optFns...)
err := api.Send(rc.ctx, rc.medias.service.conf, req)
return rc.result, err
@@ -419,42 +430,8 @@ func (rc *MediaDownloadReqCall) Do() (io.Writer, error) {
func (medias *MediaService) Download(ctx *core.Context, optFns ...request.OptFn) *MediaDownloadReqCall {
return &MediaDownloadReqCall{
- ctx: ctx,
- medias: medias,
- pathParams: map[string]interface{}{},
- optFns: optFns,
- }
-}
-
-type FileSubscribeReqCall struct {
- ctx *core.Context
- files *FileService
- pathParams map[string]interface{}
- queryParams map[string]interface{}
- optFns []request.OptFn
-}
-
-func (rc *FileSubscribeReqCall) SetFileToken(fileToken string) {
- rc.pathParams["file_token"] = fileToken
-}
-func (rc *FileSubscribeReqCall) SetFileType(fileType string) {
- rc.queryParams["file_type"] = fileType
-}
-
-func (rc *FileSubscribeReqCall) Do() (*response.NoData, error) {
- rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
- rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
- var result = &response.NoData{}
- req := request.NewRequest("drive/v1/files/:file_token/subscribe", "POST",
- []request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
- err := api.Send(rc.ctx, rc.files.service.conf, req)
- return result, err
-}
-
-func (files *FileService) Subscribe(ctx *core.Context, optFns ...request.OptFn) *FileSubscribeReqCall {
- return &FileSubscribeReqCall{
ctx: ctx,
- files: files,
+ medias: medias,
pathParams: map[string]interface{}{},
queryParams: map[string]interface{}{},
optFns: optFns,
@@ -484,7 +461,7 @@ func (rc *FileCommentCreateReqCall) Do() (*FileComment, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &FileComment{}
- req := request.NewRequest("drive/v1/files/:file_token/comments", "POST",
+ req := request.NewRequest("/open-apis/drive/v1/files/:file_token/comments", "POST",
[]request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.fileComments.service.conf, req)
return result, err
@@ -526,7 +503,7 @@ func (rc *FileCommentGetReqCall) Do() (*FileComment, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &FileComment{}
- req := request.NewRequest("drive/v1/files/:file_token/comments/:comment_id", "GET",
+ req := request.NewRequest("/open-apis/drive/v1/files/:file_token/comments/:comment_id", "GET",
[]request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.fileComments.service.conf, req)
return result, err
@@ -571,7 +548,7 @@ func (rc *FileCommentReplyUpdateReqCall) Do() (*response.NoData, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &response.NoData{}
- req := request.NewRequest("drive/v1/files/:file_token/comments/:comment_id/replies/:reply_id", "PUT",
+ req := request.NewRequest("/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies/:reply_id", "PUT",
[]request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.fileCommentReplys.service.conf, req)
return result, err
@@ -619,7 +596,7 @@ func (rc *FileCommentListReqCall) Do() (*FileCommentListResult, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &FileCommentListResult{}
- req := request.NewRequest("drive/v1/files/:file_token/comments", "GET",
+ req := request.NewRequest("/open-apis/drive/v1/files/:file_token/comments", "GET",
[]request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.fileComments.service.conf, req)
return result, err
@@ -658,7 +635,7 @@ func (rc *FileCommentPatchReqCall) Do() (*response.NoData, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &response.NoData{}
- req := request.NewRequest("drive/v1/files/:file_token/comments/:comment_id", "PATCH",
+ req := request.NewRequest("/open-apis/drive/v1/files/:file_token/comments/:comment_id", "PATCH",
[]request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.fileComments.service.conf, req)
return result, err
@@ -700,7 +677,7 @@ func (rc *FileCommentReplyDeleteReqCall) Do() (*response.NoData, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &response.NoData{}
- req := request.NewRequest("drive/v1/files/:file_token/comments/:comment_id/replies/:reply_id", "DELETE",
+ req := request.NewRequest("/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies/:reply_id", "DELETE",
[]request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.fileCommentReplys.service.conf, req)
return result, err
@@ -715,46 +692,3 @@ func (fileCommentReplys *FileCommentReplyService) Delete(ctx *core.Context, optF
optFns: optFns,
}
}
-
-type FileCommentReplyCreateReqCall struct {
- ctx *core.Context
- fileCommentReplys *FileCommentReplyService
- body *FileCommentReplyCreateReqBody
- pathParams map[string]interface{}
- queryParams map[string]interface{}
- optFns []request.OptFn
-}
-
-func (rc *FileCommentReplyCreateReqCall) SetFileToken(fileToken string) {
- rc.pathParams["file_token"] = fileToken
-}
-func (rc *FileCommentReplyCreateReqCall) SetCommentId(commentId int64) {
- rc.pathParams["comment_id"] = commentId
-}
-func (rc *FileCommentReplyCreateReqCall) SetFileType(fileType string) {
- rc.queryParams["file_type"] = fileType
-}
-func (rc *FileCommentReplyCreateReqCall) SetUserIdType(userIdType string) {
- rc.queryParams["user_id_type"] = userIdType
-}
-
-func (rc *FileCommentReplyCreateReqCall) Do() (*FileCommentReplyCreateResult, error) {
- rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
- rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
- var result = &FileCommentReplyCreateResult{}
- req := request.NewRequest("drive/v1/files/:file_token/comments/:comment_id/replies", "POST",
- []request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
- err := api.Send(rc.ctx, rc.fileCommentReplys.service.conf, req)
- return result, err
-}
-
-func (fileCommentReplys *FileCommentReplyService) Create(ctx *core.Context, body *FileCommentReplyCreateReqBody, optFns ...request.OptFn) *FileCommentReplyCreateReqCall {
- return &FileCommentReplyCreateReqCall{
- ctx: ctx,
- fileCommentReplys: fileCommentReplys,
- body: body,
- pathParams: map[string]interface{}{},
- queryParams: map[string]interface{}{},
- optFns: optFns,
- }
-}
diff --git a/service/drive/v1/event.go b/service/drive/v1/event.go
index b4cee3f6..28e2d6f1 100644
--- a/service/drive/v1/event.go
+++ b/service/drive/v1/event.go
@@ -6,99 +6,3 @@ import (
"github.com/larksuite/oapi-sdk-go/core/config"
"github.com/larksuite/oapi-sdk-go/event"
)
-
-type FileDeletedEventHandler struct {
- Fn func(*core.Context, *FileDeletedEvent) error
-}
-
-func (h *FileDeletedEventHandler) GetEvent() interface{} {
- return &FileDeletedEvent{}
-}
-
-func (h *FileDeletedEventHandler) Handle(ctx *core.Context, event interface{}) error {
- return h.Fn(ctx, event.(*FileDeletedEvent))
-}
-
-func SetFileDeletedEventHandler(conf *config.Config, fn func(ctx *core.Context, event *FileDeletedEvent) error) {
- event.SetTypeHandler(conf, "drive.file.deleted_v1", &FileDeletedEventHandler{Fn: fn})
-}
-
-type FilePermissionMemberAddedEventHandler struct {
- Fn func(*core.Context, *FilePermissionMemberAddedEvent) error
-}
-
-func (h *FilePermissionMemberAddedEventHandler) GetEvent() interface{} {
- return &FilePermissionMemberAddedEvent{}
-}
-
-func (h *FilePermissionMemberAddedEventHandler) Handle(ctx *core.Context, event interface{}) error {
- return h.Fn(ctx, event.(*FilePermissionMemberAddedEvent))
-}
-
-func SetFilePermissionMemberAddedEventHandler(conf *config.Config, fn func(ctx *core.Context, event *FilePermissionMemberAddedEvent) error) {
- event.SetTypeHandler(conf, "drive.file.permission_member_added_v1", &FilePermissionMemberAddedEventHandler{Fn: fn})
-}
-
-type FilePermissionMemberRemovedEventHandler struct {
- Fn func(*core.Context, *FilePermissionMemberRemovedEvent) error
-}
-
-func (h *FilePermissionMemberRemovedEventHandler) GetEvent() interface{} {
- return &FilePermissionMemberRemovedEvent{}
-}
-
-func (h *FilePermissionMemberRemovedEventHandler) Handle(ctx *core.Context, event interface{}) error {
- return h.Fn(ctx, event.(*FilePermissionMemberRemovedEvent))
-}
-
-func SetFilePermissionMemberRemovedEventHandler(conf *config.Config, fn func(ctx *core.Context, event *FilePermissionMemberRemovedEvent) error) {
- event.SetTypeHandler(conf, "drive.file.permission_member_removed_v1", &FilePermissionMemberRemovedEventHandler{Fn: fn})
-}
-
-type FileReadEventHandler struct {
- Fn func(*core.Context, *FileReadEvent) error
-}
-
-func (h *FileReadEventHandler) GetEvent() interface{} {
- return &FileReadEvent{}
-}
-
-func (h *FileReadEventHandler) Handle(ctx *core.Context, event interface{}) error {
- return h.Fn(ctx, event.(*FileReadEvent))
-}
-
-func SetFileReadEventHandler(conf *config.Config, fn func(ctx *core.Context, event *FileReadEvent) error) {
- event.SetTypeHandler(conf, "drive.file.read_v1", &FileReadEventHandler{Fn: fn})
-}
-
-type FileTitleUpdatedEventHandler struct {
- Fn func(*core.Context, *FileTitleUpdatedEvent) error
-}
-
-func (h *FileTitleUpdatedEventHandler) GetEvent() interface{} {
- return &FileTitleUpdatedEvent{}
-}
-
-func (h *FileTitleUpdatedEventHandler) Handle(ctx *core.Context, event interface{}) error {
- return h.Fn(ctx, event.(*FileTitleUpdatedEvent))
-}
-
-func SetFileTitleUpdatedEventHandler(conf *config.Config, fn func(ctx *core.Context, event *FileTitleUpdatedEvent) error) {
- event.SetTypeHandler(conf, "drive.file.title_updated_v1", &FileTitleUpdatedEventHandler{Fn: fn})
-}
-
-type FileTrashedEventHandler struct {
- Fn func(*core.Context, *FileTrashedEvent) error
-}
-
-func (h *FileTrashedEventHandler) GetEvent() interface{} {
- return &FileTrashedEvent{}
-}
-
-func (h *FileTrashedEventHandler) Handle(ctx *core.Context, event interface{}) error {
- return h.Fn(ctx, event.(*FileTrashedEvent))
-}
-
-func SetFileTrashedEventHandler(conf *config.Config, fn func(ctx *core.Context, event *FileTrashedEvent) error) {
- event.SetTypeHandler(conf, "drive.file.trashed_v1", &FileTrashedEventHandler{Fn: fn})
-}
diff --git a/service/drive/v1/model.go b/service/drive/v1/model.go
index 8336db7b..2802d28a 100644
--- a/service/drive/v1/model.go
+++ b/service/drive/v1/model.go
@@ -3,22 +3,8 @@ package v1
import (
"github.com/larksuite/oapi-sdk-go/api/core/tools"
- "github.com/larksuite/oapi-sdk-go/event/core/model"
)
-type UserId struct {
- UserId string `json:"user_id,omitempty"`
- OpenId string `json:"open_id,omitempty"`
- UnionId string `json:"union_id,omitempty"`
- ForceSendFields []string `json:"-"`
-}
-
-func (s *UserId) MarshalJSON() ([]byte, error) {
- type cp UserId
- raw := cp(*s)
- return tools.MarshalJSON(raw, s.ForceSendFields)
-}
-
type Collaborator struct {
MemberType string `json:"member_type,omitempty"`
MemberOpenId string `json:"member_open_id,omitempty"`
@@ -212,6 +198,109 @@ func (s *TokenType) MarshalJSON() ([]byte, error) {
return tools.MarshalJSON(raw, s.ForceSendFields)
}
+type CreateMember struct {
+ Type string `json:"type,omitempty"`
+ Member *Member `json:"member,omitempty"`
+ NeedNotification bool `json:"need_notification,omitempty"`
+ ForceSendFields []string `json:"-"`
+}
+
+func (s *CreateMember) MarshalJSON() ([]byte, error) {
+ type cp CreateMember
+ raw := cp(*s)
+ return tools.MarshalJSON(raw, s.ForceSendFields)
+}
+
+type FileStatistics struct {
+ Uv int `json:"uv,omitempty"`
+ Pv int `json:"pv,omitempty"`
+ LikeCount int `json:"like_count,omitempty"`
+ ForceSendFields []string `json:"-"`
+}
+
+func (s *FileStatistics) MarshalJSON() ([]byte, error) {
+ type cp FileStatistics
+ raw := cp(*s)
+ return tools.MarshalJSON(raw, s.ForceSendFields)
+}
+
+type FileUploadInfo struct {
+ FileName string `json:"file_name,omitempty"`
+ ParentType string `json:"parent_type,omitempty"`
+ ParentNode string `json:"parent_node,omitempty"`
+ Size int `json:"size,omitempty"`
+ ForceSendFields []string `json:"-"`
+}
+
+func (s *FileUploadInfo) MarshalJSON() ([]byte, error) {
+ type cp FileUploadInfo
+ raw := cp(*s)
+ return tools.MarshalJSON(raw, s.ForceSendFields)
+}
+
+type ImportTask struct {
+ Ticket string `json:"ticket,omitempty"`
+ FileExtension string `json:"file_extension,omitempty"`
+ FileToken string `json:"file_token,omitempty"`
+ Type string `json:"type,omitempty"`
+ FileName string `json:"file_name,omitempty"`
+ Point *ImportTaskMountPoint `json:"point,omitempty"`
+ JobStatus int `json:"job_status,omitempty"`
+ JobErrorMsg string `json:"job_error_msg,omitempty"`
+ Token string `json:"token,omitempty"`
+ Url string `json:"url,omitempty"`
+ ForceSendFields []string `json:"-"`
+}
+
+func (s *ImportTask) MarshalJSON() ([]byte, error) {
+ type cp ImportTask
+ raw := cp(*s)
+ return tools.MarshalJSON(raw, s.ForceSendFields)
+}
+
+type ImportTaskMountPoint struct {
+ MountType int `json:"mount_type,omitempty"`
+ MountKey string `json:"mount_key,omitempty"`
+ ForceSendFields []string `json:"-"`
+}
+
+func (s *ImportTaskMountPoint) MarshalJSON() ([]byte, error) {
+ type cp ImportTaskMountPoint
+ raw := cp(*s)
+ return tools.MarshalJSON(raw, s.ForceSendFields)
+}
+
+type MediaUploadInfo struct {
+ FileName string `json:"file_name,omitempty"`
+ ParentType string `json:"parent_type,omitempty"`
+ ParentNode string `json:"parent_node,omitempty"`
+ Size int `json:"size,omitempty"`
+ Extra string `json:"extra,omitempty"`
+ ForceSendFields []string `json:"-"`
+}
+
+func (s *MediaUploadInfo) MarshalJSON() ([]byte, error) {
+ type cp MediaUploadInfo
+ raw := cp(*s)
+ return tools.MarshalJSON(raw, s.ForceSendFields)
+}
+
+type PermissionPublic struct {
+ ExternalAccess bool `json:"external_access,omitempty"`
+ SecurityEntity string `json:"security_entity,omitempty"`
+ CommentEntity string `json:"comment_entity,omitempty"`
+ ShareEntity string `json:"share_entity,omitempty"`
+ LinkShareEntity string `json:"link_share_entity,omitempty"`
+ InviteExternal bool `json:"invite_external,omitempty"`
+ ForceSendFields []string `json:"-"`
+}
+
+func (s *PermissionPublic) MarshalJSON() ([]byte, error) {
+ type cp PermissionPublic
+ raw := cp(*s)
+ return tools.MarshalJSON(raw, s.ForceSendFields)
+}
+
type UploadInfo struct {
FileName string `json:"file_name,omitempty"`
ParentType string `json:"parent_type,omitempty"`
@@ -309,88 +398,3 @@ func (s *FileCommentPatchReqBody) MarshalJSON() ([]byte, error) {
raw := cp(*s)
return tools.MarshalJSON(raw, s.ForceSendFields)
}
-
-type FileCommentReplyCreateReqBody struct {
- Content *ReplyContent `json:"content,omitempty"`
- ForceSendFields []string `json:"-"`
-}
-
-func (s *FileCommentReplyCreateReqBody) MarshalJSON() ([]byte, error) {
- type cp FileCommentReplyCreateReqBody
- raw := cp(*s)
- return tools.MarshalJSON(raw, s.ForceSendFields)
-}
-
-type FileCommentReplyCreateResult struct {
- FileCommentReply *FileCommentReply `json:"file.comment.reply,omitempty"`
-}
-
-type FileDeletedEventData struct {
- FileType string `json:"file_type,omitempty"`
- FileToken string `json:"file_token,omitempty"`
- OperatorId *UserId `json:"operator_id,omitempty"`
-}
-
-type FileDeletedEvent struct {
- *model.BaseEventV2
- Event *FileDeletedEventData `json:"event"`
-}
-
-type FilePermissionMemberAddedEventData struct {
- FileType string `json:"file_type,omitempty"`
- FileToken string `json:"file_token,omitempty"`
- OperatorId *UserId `json:"operator_id,omitempty"`
- UserList []*UserId `json:"user_list,omitempty"`
- ChatList []string `json:"chat_list,omitempty"`
-}
-
-type FilePermissionMemberAddedEvent struct {
- *model.BaseEventV2
- Event *FilePermissionMemberAddedEventData `json:"event"`
-}
-
-type FilePermissionMemberRemovedEventData struct {
- FileType string `json:"file_type,omitempty"`
- FileToken string `json:"file_token,omitempty"`
- OperatorId *UserId `json:"operator_id,omitempty"`
- UserList []*UserId `json:"user_list,omitempty"`
- ChatList []string `json:"chat_list,omitempty"`
-}
-
-type FilePermissionMemberRemovedEvent struct {
- *model.BaseEventV2
- Event *FilePermissionMemberRemovedEventData `json:"event"`
-}
-
-type FileReadEventData struct {
- FileType string `json:"file_type,omitempty"`
- FileToken string `json:"file_token,omitempty"`
- OperatorIdList []*UserId `json:"operator_id_list,omitempty"`
-}
-
-type FileReadEvent struct {
- *model.BaseEventV2
- Event *FileReadEventData `json:"event"`
-}
-
-type FileTitleUpdatedEventData struct {
- FileType string `json:"file_type,omitempty"`
- FileToken string `json:"file_token,omitempty"`
- OperatorId *UserId `json:"operator_id,omitempty"`
-}
-
-type FileTitleUpdatedEvent struct {
- *model.BaseEventV2
- Event *FileTitleUpdatedEventData `json:"event"`
-}
-
-type FileTrashedEventData struct {
- FileType string `json:"file_type,omitempty"`
- FileToken string `json:"file_token,omitempty"`
- OperatorId *UserId `json:"operator_id,omitempty"`
-}
-
-type FileTrashedEvent struct {
- *model.BaseEventV2
- Event *FileTrashedEventData `json:"event"`
-}
diff --git a/service/drive_explorer/v2/api.go b/service/drive_explorer/v2/api.go
index c18acdf3..938172c4 100644
--- a/service/drive_explorer/v2/api.go
+++ b/service/drive_explorer/v2/api.go
@@ -62,7 +62,7 @@ func (rc *FolderChildrenReqCall) Do() (*FolderChildrenResult, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &FolderChildrenResult{}
- req := request.NewRequest("drive/explorer/v2/folder/:folderToken/children", "GET",
+ req := request.NewRequest("/open-apis/drive/explorer/v2/folder/:folderToken/children", "GET",
[]request.AccessTokenType{request.AccessTokenTypeUser}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.folders.service.conf, req)
return result, err
@@ -93,7 +93,7 @@ func (rc *FileCopyReqCall) SetFileToken(fileToken string) {
func (rc *FileCopyReqCall) Do() (*FileCopyResult, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &FileCopyResult{}
- req := request.NewRequest("drive/explorer/v2/file/copy/files/:fileToken", "POST",
+ req := request.NewRequest("/open-apis/drive/explorer/v2/file/copy/files/:fileToken", "POST",
[]request.AccessTokenType{request.AccessTokenTypeUser}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.files.service.conf, req)
return result, err
@@ -109,62 +109,62 @@ func (files *FileService) Copy(ctx *core.Context, body *FileCopyReqBody, optFns
}
}
-type FolderCreateReqCall struct {
+type FileCreateReqCall struct {
ctx *core.Context
- folders *FolderService
- body *FolderCreateReqBody
+ files *FileService
+ body *FileCreateReqBody
pathParams map[string]interface{}
optFns []request.OptFn
}
-func (rc *FolderCreateReqCall) SetFolderToken(folderToken string) {
+func (rc *FileCreateReqCall) SetFolderToken(folderToken string) {
rc.pathParams["folderToken"] = folderToken
}
-func (rc *FolderCreateReqCall) Do() (*FolderCreateResult, error) {
+func (rc *FileCreateReqCall) Do() (*FileCreateResult, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
- var result = &FolderCreateResult{}
- req := request.NewRequest("drive/explorer/v2/folder/:folderToken", "POST",
+ var result = &FileCreateResult{}
+ req := request.NewRequest("/open-apis/drive/explorer/v2/file/:folderToken", "POST",
[]request.AccessTokenType{request.AccessTokenTypeUser}, rc.body, result, rc.optFns...)
- err := api.Send(rc.ctx, rc.folders.service.conf, req)
+ err := api.Send(rc.ctx, rc.files.service.conf, req)
return result, err
}
-func (folders *FolderService) Create(ctx *core.Context, body *FolderCreateReqBody, optFns ...request.OptFn) *FolderCreateReqCall {
- return &FolderCreateReqCall{
+func (files *FileService) Create(ctx *core.Context, body *FileCreateReqBody, optFns ...request.OptFn) *FileCreateReqCall {
+ return &FileCreateReqCall{
ctx: ctx,
- folders: folders,
+ files: files,
body: body,
pathParams: map[string]interface{}{},
optFns: optFns,
}
}
-type FileCreateReqCall struct {
+type FolderCreateReqCall struct {
ctx *core.Context
- files *FileService
- body *FileCreateReqBody
+ folders *FolderService
+ body *FolderCreateReqBody
pathParams map[string]interface{}
optFns []request.OptFn
}
-func (rc *FileCreateReqCall) SetFolderToken(folderToken string) {
+func (rc *FolderCreateReqCall) SetFolderToken(folderToken string) {
rc.pathParams["folderToken"] = folderToken
}
-func (rc *FileCreateReqCall) Do() (*FileCreateResult, error) {
+func (rc *FolderCreateReqCall) Do() (*FolderCreateResult, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
- var result = &FileCreateResult{}
- req := request.NewRequest("drive/explorer/v2/file/:folderToken", "POST",
+ var result = &FolderCreateResult{}
+ req := request.NewRequest("/open-apis/drive/explorer/v2/folder/:folderToken", "POST",
[]request.AccessTokenType{request.AccessTokenTypeUser}, rc.body, result, rc.optFns...)
- err := api.Send(rc.ctx, rc.files.service.conf, req)
+ err := api.Send(rc.ctx, rc.folders.service.conf, req)
return result, err
}
-func (files *FileService) Create(ctx *core.Context, body *FileCreateReqBody, optFns ...request.OptFn) *FileCreateReqCall {
- return &FileCreateReqCall{
+func (folders *FolderService) Create(ctx *core.Context, body *FolderCreateReqBody, optFns ...request.OptFn) *FolderCreateReqCall {
+ return &FolderCreateReqCall{
ctx: ctx,
- files: files,
+ folders: folders,
body: body,
pathParams: map[string]interface{}{},
optFns: optFns,
@@ -185,7 +185,7 @@ func (rc *FileDocsDeleteReqCall) SetDocToken(docToken string) {
func (rc *FileDocsDeleteReqCall) Do() (*FileDocsDeleteResult, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &FileDocsDeleteResult{}
- req := request.NewRequest("drive/explorer/v2/file/docs/:docToken", "DELETE",
+ req := request.NewRequest("/open-apis/drive/explorer/v2/file/docs/:docToken", "DELETE",
[]request.AccessTokenType{request.AccessTokenTypeUser}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.files.service.conf, req)
return result, err
@@ -214,7 +214,7 @@ func (rc *FolderMetaReqCall) SetFolderToken(folderToken string) {
func (rc *FolderMetaReqCall) Do() (*FolderMetaResult, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &FolderMetaResult{}
- req := request.NewRequest("drive/explorer/v2/folder/:folderToken/meta", "GET",
+ req := request.NewRequest("/open-apis/drive/explorer/v2/folder/:folderToken/meta", "GET",
[]request.AccessTokenType{request.AccessTokenTypeUser}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.folders.service.conf, req)
return result, err
@@ -237,7 +237,7 @@ type FolderRootMetaReqCall struct {
func (rc *FolderRootMetaReqCall) Do() (*FolderRootMetaResult, error) {
var result = &FolderRootMetaResult{}
- req := request.NewRequest("drive/explorer/v2/root_folder/meta", "GET",
+ req := request.NewRequest("/open-apis/drive/explorer/v2/root_folder/meta", "GET",
[]request.AccessTokenType{request.AccessTokenTypeUser}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.folders.service.conf, req)
return result, err
@@ -265,7 +265,7 @@ func (rc *FileSpreadsheetsDeleteReqCall) SetSpreadsheetToken(spreadsheetToken st
func (rc *FileSpreadsheetsDeleteReqCall) Do() (*FileSpreadsheetsDeleteResult, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &FileSpreadsheetsDeleteResult{}
- req := request.NewRequest("drive/explorer/v2/file/spreadsheets/:spreadsheetToken", "DELETE",
+ req := request.NewRequest("/open-apis/drive/explorer/v2/file/spreadsheets/:spreadsheetToken", "DELETE",
[]request.AccessTokenType{request.AccessTokenTypeUser}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.files.service.conf, req)
return result, err
diff --git a/service/drive_explorer/v2/model.go b/service/drive_explorer/v2/model.go
index 7f8a9e5b..cc3ed6b7 100644
--- a/service/drive_explorer/v2/model.go
+++ b/service/drive_explorer/v2/model.go
@@ -64,36 +64,36 @@ type FileCopyResult struct {
Url string `json:"url,omitempty"`
}
-type FolderCreateReqBody struct {
+type FileCreateReqBody struct {
Title string `json:"title,omitempty"`
+ Type string `json:"type,omitempty"`
ForceSendFields []string `json:"-"`
}
-func (s *FolderCreateReqBody) MarshalJSON() ([]byte, error) {
- type cp FolderCreateReqBody
+func (s *FileCreateReqBody) MarshalJSON() ([]byte, error) {
+ type cp FileCreateReqBody
raw := cp(*s)
return tools.MarshalJSON(raw, s.ForceSendFields)
}
-type FolderCreateResult struct {
+type FileCreateResult struct {
Url string `json:"url,omitempty"`
Revision int `json:"revision,omitempty"`
Token string `json:"token,omitempty"`
}
-type FileCreateReqBody struct {
+type FolderCreateReqBody struct {
Title string `json:"title,omitempty"`
- Type string `json:"type,omitempty"`
ForceSendFields []string `json:"-"`
}
-func (s *FileCreateReqBody) MarshalJSON() ([]byte, error) {
- type cp FileCreateReqBody
+func (s *FolderCreateReqBody) MarshalJSON() ([]byte, error) {
+ type cp FolderCreateReqBody
raw := cp(*s)
return tools.MarshalJSON(raw, s.ForceSendFields)
}
-type FileCreateResult struct {
+type FolderCreateResult struct {
Url string `json:"url,omitempty"`
Revision int `json:"revision,omitempty"`
Token string `json:"token,omitempty"`
diff --git a/service/drive_permission/v1/api.go b/service/drive_permission/v1/api.go
index 6c02b481..7844799c 100644
--- a/service/drive_permission/v1/api.go
+++ b/service/drive_permission/v1/api.go
@@ -52,7 +52,7 @@ type MemberCreateReqCall struct {
func (rc *MemberCreateReqCall) Do() (*MemberCreateResult, error) {
var result = &MemberCreateResult{}
- req := request.NewRequest("drive/permission/member/create", "POST",
+ req := request.NewRequest("/open-apis/drive/permission/member/create", "POST",
[]request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.members.service.conf, req)
return result, err
@@ -76,7 +76,7 @@ type MemberDeleteReqCall struct {
func (rc *MemberDeleteReqCall) Do() (*MemberDeleteResult, error) {
var result = &MemberDeleteResult{}
- req := request.NewRequest("drive/permission/member/delete", "POST",
+ req := request.NewRequest("/open-apis/drive/permission/member/delete", "POST",
[]request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.members.service.conf, req)
return result, err
@@ -100,7 +100,7 @@ type MemberListReqCall struct {
func (rc *MemberListReqCall) Do() (*MemberListResult, error) {
var result = &MemberListResult{}
- req := request.NewRequest("drive/permission/member/list", "POST",
+ req := request.NewRequest("/open-apis/drive/permission/member/list", "POST",
[]request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.members.service.conf, req)
return result, err
@@ -124,7 +124,7 @@ type MemberPermittedReqCall struct {
func (rc *MemberPermittedReqCall) Do() (*MemberPermittedResult, error) {
var result = &MemberPermittedResult{}
- req := request.NewRequest("drive/permission/member/permitted", "POST",
+ req := request.NewRequest("/open-apis/drive/permission/member/permitted", "POST",
[]request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.members.service.conf, req)
return result, err
@@ -148,7 +148,7 @@ type MemberTransferReqCall struct {
func (rc *MemberTransferReqCall) Do() (*MemberTransferResult, error) {
var result = &MemberTransferResult{}
- req := request.NewRequest("drive/permission/member/transfer", "POST",
+ req := request.NewRequest("/open-apis/drive/permission/member/transfer", "POST",
[]request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.members.service.conf, req)
return result, err
@@ -163,49 +163,49 @@ func (members *MemberService) Transfer(ctx *core.Context, body *MemberTransferRe
}
}
-type PublicUpdateReqCall struct {
+type MemberUpdateReqCall struct {
ctx *core.Context
- publics *PublicService
- body *PublicUpdateReqBody
+ members *MemberService
+ body *MemberUpdateReqBody
optFns []request.OptFn
}
-func (rc *PublicUpdateReqCall) Do() (*PublicUpdateResult, error) {
- var result = &PublicUpdateResult{}
- req := request.NewRequest("drive/permission/public/update", "POST",
+func (rc *MemberUpdateReqCall) Do() (*MemberUpdateResult, error) {
+ var result = &MemberUpdateResult{}
+ req := request.NewRequest("/open-apis/drive/permission/member/update", "POST",
[]request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
- err := api.Send(rc.ctx, rc.publics.service.conf, req)
+ err := api.Send(rc.ctx, rc.members.service.conf, req)
return result, err
}
-func (publics *PublicService) Update(ctx *core.Context, body *PublicUpdateReqBody, optFns ...request.OptFn) *PublicUpdateReqCall {
- return &PublicUpdateReqCall{
+func (members *MemberService) Update(ctx *core.Context, body *MemberUpdateReqBody, optFns ...request.OptFn) *MemberUpdateReqCall {
+ return &MemberUpdateReqCall{
ctx: ctx,
- publics: publics,
+ members: members,
body: body,
optFns: optFns,
}
}
-type MemberUpdateReqCall struct {
+type PublicUpdateReqCall struct {
ctx *core.Context
- members *MemberService
- body *MemberUpdateReqBody
+ publics *PublicService
+ body *PublicUpdateReqBody
optFns []request.OptFn
}
-func (rc *MemberUpdateReqCall) Do() (*MemberUpdateResult, error) {
- var result = &MemberUpdateResult{}
- req := request.NewRequest("drive/permission/member/update", "POST",
+func (rc *PublicUpdateReqCall) Do() (*PublicUpdateResult, error) {
+ var result = &PublicUpdateResult{}
+ req := request.NewRequest("/open-apis/drive/permission/public/update", "POST",
[]request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
- err := api.Send(rc.ctx, rc.members.service.conf, req)
+ err := api.Send(rc.ctx, rc.publics.service.conf, req)
return result, err
}
-func (members *MemberService) Update(ctx *core.Context, body *MemberUpdateReqBody, optFns ...request.OptFn) *MemberUpdateReqCall {
- return &MemberUpdateReqCall{
+func (publics *PublicService) Update(ctx *core.Context, body *PublicUpdateReqBody, optFns ...request.OptFn) *PublicUpdateReqCall {
+ return &PublicUpdateReqCall{
ctx: ctx,
- members: members,
+ publics: publics,
body: body,
optFns: optFns,
}
diff --git a/service/drive_permission/v1/model.go b/service/drive_permission/v1/model.go
index a26c3ebd..59d14f23 100644
--- a/service/drive_permission/v1/model.go
+++ b/service/drive_permission/v1/model.go
@@ -139,6 +139,26 @@ type MemberTransferResult struct {
Owner *Owner `json:"owner,omitempty"`
}
+type MemberUpdateReqBody struct {
+ Token string `json:"token,omitempty"`
+ Type string `json:"type,omitempty"`
+ MemberType string `json:"member_type,omitempty"`
+ MemberId string `json:"member_id,omitempty"`
+ Perm string `json:"perm,omitempty"`
+ NotifyLark bool `json:"notify_lark,omitempty"`
+ ForceSendFields []string `json:"-"`
+}
+
+func (s *MemberUpdateReqBody) MarshalJSON() ([]byte, error) {
+ type cp MemberUpdateReqBody
+ raw := cp(*s)
+ return tools.MarshalJSON(raw, s.ForceSendFields)
+}
+
+type MemberUpdateResult struct {
+ IsSuccess bool `json:"is_success,omitempty"`
+}
+
type PublicUpdateReqBody struct {
Token string `json:"token,omitempty"`
Type string `json:"type,omitempty"`
@@ -160,23 +180,3 @@ func (s *PublicUpdateReqBody) MarshalJSON() ([]byte, error) {
type PublicUpdateResult struct {
IsSuccess bool `json:"is_success,omitempty"`
}
-
-type MemberUpdateReqBody struct {
- Token string `json:"token,omitempty"`
- Type string `json:"type,omitempty"`
- MemberType string `json:"member_type,omitempty"`
- MemberId string `json:"member_id,omitempty"`
- Perm string `json:"perm,omitempty"`
- NotifyLark bool `json:"notify_lark,omitempty"`
- ForceSendFields []string `json:"-"`
-}
-
-func (s *MemberUpdateReqBody) MarshalJSON() ([]byte, error) {
- type cp MemberUpdateReqBody
- raw := cp(*s)
- return tools.MarshalJSON(raw, s.ForceSendFields)
-}
-
-type MemberUpdateResult struct {
- IsSuccess bool `json:"is_success,omitempty"`
-}
diff --git a/service/drive_permission/v2/api.go b/service/drive_permission/v2/api.go
index 94808dbf..e04e93b4 100644
--- a/service/drive_permission/v2/api.go
+++ b/service/drive_permission/v2/api.go
@@ -41,7 +41,7 @@ type PublicGetReqCall struct {
func (rc *PublicGetReqCall) Do() (*PublicGetResult, error) {
var result = &PublicGetResult{}
- req := request.NewRequest("drive/permission/v2/public", "POST",
+ req := request.NewRequest("/open-apis/drive/permission/v2/public", "POST",
[]request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.publics.service.conf, req)
return result, err
@@ -65,7 +65,7 @@ type PublicUpdateReqCall struct {
func (rc *PublicUpdateReqCall) Do() (*response.NoData, error) {
var result = &response.NoData{}
- req := request.NewRequest("drive/permission/v2/public/update", "POST",
+ req := request.NewRequest("/open-apis/drive/permission/v2/public/update", "POST",
[]request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.publics.service.conf, req)
return result, err
diff --git a/service/ehr/v1/api.go b/service/ehr/v1/api.go
index 1d6d78bf..e78bda2e 100644
--- a/service/ehr/v1/api.go
+++ b/service/ehr/v1/api.go
@@ -62,7 +62,7 @@ func (rc *AttachmentGetReqCall) SetResponseStream(result io.Writer) {
func (rc *AttachmentGetReqCall) Do() (io.Writer, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
rc.optFns = append(rc.optFns, request.SetResponseStream())
- req := request.NewRequest("ehr/v1/attachments/:token", "GET",
+ req := request.NewRequest("/open-apis/ehr/v1/attachments/:token", "GET",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, nil, rc.result, rc.optFns...)
err := api.Send(rc.ctx, rc.attachments.service.conf, req)
return rc.result, err
@@ -115,7 +115,7 @@ func (rc *EmployeeListReqCall) SetPageSize(pageSize int) {
func (rc *EmployeeListReqCall) Do() (*EmployeeListResult, error) {
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &EmployeeListResult{}
- req := request.NewRequest("ehr/v1/employees", "GET",
+ req := request.NewRequest("/open-apis/ehr/v1/employees", "GET",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.employees.service.conf, req)
return result, err
diff --git a/service/face_verify/v1/api.go b/service/face_verify/v1/api.go
index 145b16cc..7e716da3 100644
--- a/service/face_verify/v1/api.go
+++ b/service/face_verify/v1/api.go
@@ -9,124 +9,12 @@ import (
)
type Service struct {
- conf *config.Config
- FaceVerifys *FaceVerifyService
+ conf *config.Config
}
func NewService(conf *config.Config) *Service {
s := &Service{
conf: conf,
}
- s.FaceVerifys = newFaceVerifyService(s)
return s
}
-
-type FaceVerifyService struct {
- service *Service
-}
-
-func newFaceVerifyService(service *Service) *FaceVerifyService {
- return &FaceVerifyService{
- service: service,
- }
-}
-
-type FaceVerifyCropFaceImageReqCall struct {
- ctx *core.Context
- faceVerifys *FaceVerifyService
- body *request.FormData
- optFns []request.OptFn
-}
-
-func (rc *FaceVerifyCropFaceImageReqCall) SetRawImage(rawImage *request.File) {
- rc.body.AddFile("raw_image", rawImage)
-}
-
-func (rc *FaceVerifyCropFaceImageReqCall) Do() (*FaceVerifyCropFaceImageResult, error) {
- var result = &FaceVerifyCropFaceImageResult{}
- req := request.NewRequest("face_verify/v1/crop_face_image", "POST",
- []request.AccessTokenType{request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
- err := api.Send(rc.ctx, rc.faceVerifys.service.conf, req)
- return result, err
-}
-
-func (faceVerifys *FaceVerifyService) CropFaceImage(ctx *core.Context, optFns ...request.OptFn) *FaceVerifyCropFaceImageReqCall {
- return &FaceVerifyCropFaceImageReqCall{
- ctx: ctx,
- faceVerifys: faceVerifys,
- body: request.NewFormData(),
- optFns: optFns,
- }
-}
-
-type FaceVerifyQueryAuthResultReqCall struct {
- ctx *core.Context
- faceVerifys *FaceVerifyService
- queryParams map[string]interface{}
- optFns []request.OptFn
-}
-
-func (rc *FaceVerifyQueryAuthResultReqCall) SetReqOrderNo(reqOrderNo string) {
- rc.queryParams["req_order_no"] = reqOrderNo
-}
-func (rc *FaceVerifyQueryAuthResultReqCall) SetOpenId(openId string) {
- rc.queryParams["open_id"] = openId
-}
-func (rc *FaceVerifyQueryAuthResultReqCall) SetEmployeeId(employeeId string) {
- rc.queryParams["employee_id"] = employeeId
-}
-
-func (rc *FaceVerifyQueryAuthResultReqCall) Do() (*FaceVerifyQueryAuthResultResult, error) {
- rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
- var result = &FaceVerifyQueryAuthResultResult{}
- req := request.NewRequest("face_verify/v1/query_auth_result", "GET",
- []request.AccessTokenType{request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
- err := api.Send(rc.ctx, rc.faceVerifys.service.conf, req)
- return result, err
-}
-
-func (faceVerifys *FaceVerifyService) QueryAuthResult(ctx *core.Context, optFns ...request.OptFn) *FaceVerifyQueryAuthResultReqCall {
- return &FaceVerifyQueryAuthResultReqCall{
- ctx: ctx,
- faceVerifys: faceVerifys,
- queryParams: map[string]interface{}{},
- optFns: optFns,
- }
-}
-
-type FaceVerifyUploadFaceImageReqCall struct {
- ctx *core.Context
- faceVerifys *FaceVerifyService
- body *request.FormData
- queryParams map[string]interface{}
- optFns []request.OptFn
-}
-
-func (rc *FaceVerifyUploadFaceImageReqCall) SetImage(image *request.File) {
- rc.body.AddFile("image", image)
-}
-func (rc *FaceVerifyUploadFaceImageReqCall) SetOpenId(openId string) {
- rc.queryParams["open_id"] = openId
-}
-func (rc *FaceVerifyUploadFaceImageReqCall) SetEmployeeId(employeeId string) {
- rc.queryParams["employee_id"] = employeeId
-}
-
-func (rc *FaceVerifyUploadFaceImageReqCall) Do() (*FaceVerifyUploadFaceImageResult, error) {
- rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
- var result = &FaceVerifyUploadFaceImageResult{}
- req := request.NewRequest("face_verify/v1/upload_face_image", "POST",
- []request.AccessTokenType{request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
- err := api.Send(rc.ctx, rc.faceVerifys.service.conf, req)
- return result, err
-}
-
-func (faceVerifys *FaceVerifyService) UploadFaceImage(ctx *core.Context, optFns ...request.OptFn) *FaceVerifyUploadFaceImageReqCall {
- return &FaceVerifyUploadFaceImageReqCall{
- ctx: ctx,
- faceVerifys: faceVerifys,
- body: request.NewFormData(),
- queryParams: map[string]interface{}{},
- optFns: optFns,
- }
-}
diff --git a/service/face_verify/v1/model.go b/service/face_verify/v1/model.go
index d2bd91e1..81de7b08 100644
--- a/service/face_verify/v1/model.go
+++ b/service/face_verify/v1/model.go
@@ -1,18 +1,2 @@
// Code generated by lark suite oapi sdk gen
package v1
-
-type FaceVerify struct {
-}
-
-type FaceVerifyCropFaceImageResult struct {
- FaceImage string `json:"face_image,omitempty"`
-}
-
-type FaceVerifyQueryAuthResultResult struct {
- AuthState int `json:"auth_state,omitempty"`
- AuthTimpstamp int `json:"auth_timpstamp,omitempty"`
-}
-
-type FaceVerifyUploadFaceImageResult struct {
- FaceUid string `json:"face_uid,omitempty"`
-}
diff --git a/service/human_authentication/v1/api.go b/service/human_authentication/v1/api.go
index 74543163..a4bfcab4 100644
--- a/service/human_authentication/v1/api.go
+++ b/service/human_authentication/v1/api.go
@@ -49,7 +49,7 @@ func (rc *IdentityCreateReqCall) SetUserIdType(userIdType string) {
func (rc *IdentityCreateReqCall) Do() (*IdentityCreateResult, error) {
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &IdentityCreateResult{}
- req := request.NewRequest("human_authentication/v1/identities", "POST",
+ req := request.NewRequest("/open-apis/human_authentication/v1/identities", "POST",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.identitys.service.conf, req)
return result, err
diff --git a/service/im/v1/api.go b/service/im/v1/api.go
index 4508adb3..1c330826 100644
--- a/service/im/v1/api.go
+++ b/service/im/v1/api.go
@@ -16,13 +16,11 @@ type Service struct {
Chats *ChatService
ChatMemberUsers *ChatMemberUserService
ChatMemberBots *ChatMemberBotService
- MessageReactions *MessageReactionService
ChatAnnouncements *ChatAnnouncementService
ChatMemberss *ChatMembersService
Files *FileService
Images *ImageService
MessageResources *MessageResourceService
- ChatCustomBots *ChatCustomBotService
}
func NewService(conf *config.Config) *Service {
@@ -33,13 +31,11 @@ func NewService(conf *config.Config) *Service {
s.Chats = newChatService(s)
s.ChatMemberUsers = newChatMemberUserService(s)
s.ChatMemberBots = newChatMemberBotService(s)
- s.MessageReactions = newMessageReactionService(s)
s.ChatAnnouncements = newChatAnnouncementService(s)
s.ChatMemberss = newChatMembersService(s)
s.Files = newFileService(s)
s.Images = newImageService(s)
s.MessageResources = newMessageResourceService(s)
- s.ChatCustomBots = newChatCustomBotService(s)
return s
}
@@ -83,16 +79,6 @@ func newChatMemberBotService(service *Service) *ChatMemberBotService {
}
}
-type MessageReactionService struct {
- service *Service
-}
-
-func newMessageReactionService(service *Service) *MessageReactionService {
- return &MessageReactionService{
- service: service,
- }
-}
-
type ChatAnnouncementService struct {
service *Service
}
@@ -143,16 +129,6 @@ func newMessageResourceService(service *Service) *MessageResourceService {
}
}
-type ChatCustomBotService struct {
- service *Service
-}
-
-func newChatCustomBotService(service *Service) *ChatCustomBotService {
- return &ChatCustomBotService{
- service: service,
- }
-}
-
type MessageListReqCall struct {
ctx *core.Context
messages *MessageService
@@ -182,7 +158,7 @@ func (rc *MessageListReqCall) SetPageSize(pageSize int) {
func (rc *MessageListReqCall) Do() (*MessageListResult, error) {
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &MessageListResult{}
- req := request.NewRequest("im/v1/messages", "GET",
+ req := request.NewRequest("/open-apis/im/v1/messages", "GET",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.messages.service.conf, req)
return result, err
@@ -212,7 +188,7 @@ func (rc *MessagePatchReqCall) SetMessageId(messageId string) {
func (rc *MessagePatchReqCall) Do() (*response.NoData, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &response.NoData{}
- req := request.NewRequest("im/v1/messages/:message_id", "PATCH",
+ req := request.NewRequest("/open-apis/im/v1/messages/:message_id", "PATCH",
[]request.AccessTokenType{request.AccessTokenTypeTenant, request.AccessTokenTypeUser}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.messages.service.conf, req)
return result, err
@@ -243,7 +219,7 @@ func (rc *MessageReplyReqCall) SetMessageId(messageId string) {
func (rc *MessageReplyReqCall) Do() (*Message, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &Message{}
- req := request.NewRequest("im/v1/messages/:message_id/reply", "POST",
+ req := request.NewRequest("/open-apis/im/v1/messages/:message_id/reply", "POST",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.messages.service.conf, req)
return result, err
@@ -274,7 +250,7 @@ func (rc *MessageCreateReqCall) SetReceiveIdType(receiveIdType string) {
func (rc *MessageCreateReqCall) Do() (*Message, error) {
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &Message{}
- req := request.NewRequest("im/v1/messages", "POST",
+ req := request.NewRequest("/open-apis/im/v1/messages", "POST",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.messages.service.conf, req)
return result, err
@@ -304,7 +280,7 @@ func (rc *MessageDeleteReqCall) SetMessageId(messageId string) {
func (rc *MessageDeleteReqCall) Do() (*response.NoData, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &response.NoData{}
- req := request.NewRequest("im/v1/messages/:message_id", "DELETE",
+ req := request.NewRequest("/open-apis/im/v1/messages/:message_id", "DELETE",
[]request.AccessTokenType{request.AccessTokenTypeTenant, request.AccessTokenTypeUser}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.messages.service.conf, req)
return result, err
@@ -344,7 +320,7 @@ func (rc *MessageReadUsersReqCall) Do() (*MessageReadUsersResult, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &MessageReadUsersResult{}
- req := request.NewRequest("im/v1/messages/:message_id/read_users", "GET",
+ req := request.NewRequest("/open-apis/im/v1/messages/:message_id/read_users", "GET",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.messages.service.conf, req)
return result, err
@@ -380,7 +356,7 @@ func (rc *ChatUpdateReqCall) Do() (*response.NoData, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &response.NoData{}
- req := request.NewRequest("im/v1/chats/:chat_id", "PUT",
+ req := request.NewRequest("/open-apis/im/v1/chats/:chat_id", "PUT",
[]request.AccessTokenType{request.AccessTokenTypeTenant, request.AccessTokenTypeUser}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.chats.service.conf, req)
return result, err
@@ -419,7 +395,7 @@ func (rc *FileCreateReqCall) SetFile(file *request.File) {
func (rc *FileCreateReqCall) Do() (*FileCreateResult, error) {
var result = &FileCreateResult{}
- req := request.NewRequest("im/v1/files", "POST",
+ req := request.NewRequest("/open-apis/im/v1/files", "POST",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.files.service.conf, req)
return result, err
@@ -452,7 +428,7 @@ func (rc *FileGetReqCall) SetResponseStream(result io.Writer) {
func (rc *FileGetReqCall) Do() (io.Writer, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
rc.optFns = append(rc.optFns, request.SetResponseStream())
- req := request.NewRequest("im/v1/files/:file_key", "GET",
+ req := request.NewRequest("/open-apis/im/v1/files/:file_key", "GET",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, nil, rc.result, rc.optFns...)
err := api.Send(rc.ctx, rc.files.service.conf, req)
return rc.result, err
@@ -487,7 +463,7 @@ func (rc *ChatListReqCall) SetPageSize(pageSize int) {
func (rc *ChatListReqCall) Do() (*ChatListResult, error) {
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &ChatListResult{}
- req := request.NewRequest("im/v1/chats", "GET",
+ req := request.NewRequest("/open-apis/im/v1/chats", "GET",
[]request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.chats.service.conf, req)
return result, err
@@ -518,7 +494,7 @@ func (rc *ImageCreateReqCall) SetImage(image *request.File) {
func (rc *ImageCreateReqCall) Do() (*ImageCreateResult, error) {
var result = &ImageCreateResult{}
- req := request.NewRequest("im/v1/images", "POST",
+ req := request.NewRequest("/open-apis/im/v1/images", "POST",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.images.service.conf, req)
return result, err
@@ -547,7 +523,7 @@ func (rc *ChatDeleteReqCall) SetChatId(chatId string) {
func (rc *ChatDeleteReqCall) Do() (*response.NoData, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &response.NoData{}
- req := request.NewRequest("im/v1/chats/:chat_id", "DELETE",
+ req := request.NewRequest("/open-apis/im/v1/chats/:chat_id", "DELETE",
[]request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.chats.service.conf, req)
return result, err
@@ -580,7 +556,7 @@ func (rc *ImageGetReqCall) SetResponseStream(result io.Writer) {
func (rc *ImageGetReqCall) Do() (io.Writer, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
rc.optFns = append(rc.optFns, request.SetResponseStream())
- req := request.NewRequest("im/v1/images/:image_key", "GET",
+ req := request.NewRequest("/open-apis/im/v1/images/:image_key", "GET",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, nil, rc.result, rc.optFns...)
err := api.Send(rc.ctx, rc.images.service.conf, req)
return rc.result, err
@@ -614,7 +590,7 @@ func (rc *ChatGetReqCall) Do() (*ChatGetResult, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &ChatGetResult{}
- req := request.NewRequest("im/v1/chats/:chat_id", "GET",
+ req := request.NewRequest("/open-apis/im/v1/chats/:chat_id", "GET",
[]request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.chats.service.conf, req)
return result, err
@@ -645,7 +621,7 @@ func (rc *ChatCreateReqCall) SetUserIdType(userIdType string) {
func (rc *ChatCreateReqCall) Do() (*ChatCreateResult, error) {
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &ChatCreateResult{}
- req := request.NewRequest("im/v1/chats", "POST",
+ req := request.NewRequest("/open-apis/im/v1/chats", "POST",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.chats.service.conf, req)
return result, err
@@ -684,7 +660,7 @@ func (rc *ChatSearchReqCall) SetPageSize(pageSize int) {
func (rc *ChatSearchReqCall) Do() (*ChatSearchResult, error) {
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &ChatSearchResult{}
- req := request.NewRequest("im/v1/chats/search", "GET",
+ req := request.NewRequest("/open-apis/im/v1/chats/search", "GET",
[]request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.chats.service.conf, req)
return result, err
@@ -713,7 +689,7 @@ func (rc *MessageGetReqCall) SetMessageId(messageId string) {
func (rc *MessageGetReqCall) Do() (*MessageGetResult, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &MessageGetResult{}
- req := request.NewRequest("im/v1/messages/:message_id", "GET",
+ req := request.NewRequest("/open-apis/im/v1/messages/:message_id", "GET",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.messages.service.conf, req)
return result, err
@@ -748,7 +724,7 @@ func (rc *ChatMembersCreateReqCall) Do() (*ChatMembersCreateResult, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &ChatMembersCreateResult{}
- req := request.NewRequest("im/v1/chats/:chat_id/members", "POST",
+ req := request.NewRequest("/open-apis/im/v1/chats/:chat_id/members", "POST",
[]request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.chatMemberss.service.conf, req)
return result, err
@@ -785,7 +761,7 @@ func (rc *ChatMembersDeleteReqCall) Do() (*ChatMembersDeleteResult, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &ChatMembersDeleteResult{}
- req := request.NewRequest("im/v1/chats/:chat_id/members", "DELETE",
+ req := request.NewRequest("/open-apis/im/v1/chats/:chat_id/members", "DELETE",
[]request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.chatMemberss.service.conf, req)
return result, err
@@ -802,41 +778,6 @@ func (chatMemberss *ChatMembersService) Delete(ctx *core.Context, body *ChatMemb
}
}
-type ChatAnnouncementGetReqCall struct {
- ctx *core.Context
- chatAnnouncements *ChatAnnouncementService
- pathParams map[string]interface{}
- queryParams map[string]interface{}
- optFns []request.OptFn
-}
-
-func (rc *ChatAnnouncementGetReqCall) SetChatId(chatId string) {
- rc.pathParams["chat_id"] = chatId
-}
-func (rc *ChatAnnouncementGetReqCall) SetUserIdType(userIdType string) {
- rc.queryParams["user_id_type"] = userIdType
-}
-
-func (rc *ChatAnnouncementGetReqCall) Do() (*ChatAnnouncementGetResult, error) {
- rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
- rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
- var result = &ChatAnnouncementGetResult{}
- req := request.NewRequest("im/v1/chats/:chat_id/announcement", "GET",
- []request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
- err := api.Send(rc.ctx, rc.chatAnnouncements.service.conf, req)
- return result, err
-}
-
-func (chatAnnouncements *ChatAnnouncementService) Get(ctx *core.Context, optFns ...request.OptFn) *ChatAnnouncementGetReqCall {
- return &ChatAnnouncementGetReqCall{
- ctx: ctx,
- chatAnnouncements: chatAnnouncements,
- pathParams: map[string]interface{}{},
- queryParams: map[string]interface{}{},
- optFns: optFns,
- }
-}
-
type ChatMembersGetReqCall struct {
ctx *core.Context
chatMemberss *ChatMembersService
@@ -862,7 +803,7 @@ func (rc *ChatMembersGetReqCall) Do() (*ChatMembersGetResult, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &ChatMembersGetResult{}
- req := request.NewRequest("im/v1/chats/:chat_id/members", "GET",
+ req := request.NewRequest("/open-apis/im/v1/chats/:chat_id/members", "GET",
[]request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.chatMemberss.service.conf, req)
return result, err
@@ -878,6 +819,41 @@ func (chatMemberss *ChatMembersService) Get(ctx *core.Context, optFns ...request
}
}
+type ChatAnnouncementGetReqCall struct {
+ ctx *core.Context
+ chatAnnouncements *ChatAnnouncementService
+ pathParams map[string]interface{}
+ queryParams map[string]interface{}
+ optFns []request.OptFn
+}
+
+func (rc *ChatAnnouncementGetReqCall) SetChatId(chatId string) {
+ rc.pathParams["chat_id"] = chatId
+}
+func (rc *ChatAnnouncementGetReqCall) SetUserIdType(userIdType string) {
+ rc.queryParams["user_id_type"] = userIdType
+}
+
+func (rc *ChatAnnouncementGetReqCall) Do() (*ChatAnnouncementGetResult, error) {
+ rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
+ rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
+ var result = &ChatAnnouncementGetResult{}
+ req := request.NewRequest("/open-apis/im/v1/chats/:chat_id/announcement", "GET",
+ []request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
+ err := api.Send(rc.ctx, rc.chatAnnouncements.service.conf, req)
+ return result, err
+}
+
+func (chatAnnouncements *ChatAnnouncementService) Get(ctx *core.Context, optFns ...request.OptFn) *ChatAnnouncementGetReqCall {
+ return &ChatAnnouncementGetReqCall{
+ ctx: ctx,
+ chatAnnouncements: chatAnnouncements,
+ pathParams: map[string]interface{}{},
+ queryParams: map[string]interface{}{},
+ optFns: optFns,
+ }
+}
+
type MessageResourceGetReqCall struct {
ctx *core.Context
messageResources *MessageResourceService
@@ -904,7 +880,7 @@ func (rc *MessageResourceGetReqCall) Do() (io.Writer, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
rc.optFns = append(rc.optFns, request.SetResponseStream())
- req := request.NewRequest("im/v1/messages/:message_id/resources/:file_key", "GET",
+ req := request.NewRequest("/open-apis/im/v1/messages/:message_id/resources/:file_key", "GET",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, nil, rc.result, rc.optFns...)
err := api.Send(rc.ctx, rc.messageResources.service.conf, req)
return rc.result, err
@@ -934,7 +910,7 @@ func (rc *ChatMembersIsInChatReqCall) SetChatId(chatId string) {
func (rc *ChatMembersIsInChatReqCall) Do() (*ChatMembersIsInChatResult, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &ChatMembersIsInChatResult{}
- req := request.NewRequest("im/v1/chats/:chat_id/members/is_in_chat", "GET",
+ req := request.NewRequest("/open-apis/im/v1/chats/:chat_id/members/is_in_chat", "GET",
[]request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.chatMemberss.service.conf, req)
return result, err
@@ -963,7 +939,7 @@ func (rc *ChatMembersMeJoinReqCall) SetChatId(chatId string) {
func (rc *ChatMembersMeJoinReqCall) Do() (*response.NoData, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &response.NoData{}
- req := request.NewRequest("im/v1/chats/:chat_id/members/me_join", "PATCH",
+ req := request.NewRequest("/open-apis/im/v1/chats/:chat_id/members/me_join", "PATCH",
[]request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.chatMemberss.service.conf, req)
return result, err
@@ -993,7 +969,7 @@ func (rc *ChatAnnouncementPatchReqCall) SetChatId(chatId string) {
func (rc *ChatAnnouncementPatchReqCall) Do() (*response.NoData, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &response.NoData{}
- req := request.NewRequest("im/v1/chats/:chat_id/announcement", "PATCH",
+ req := request.NewRequest("/open-apis/im/v1/chats/:chat_id/announcement", "PATCH",
[]request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.chatAnnouncements.service.conf, req)
return result, err
@@ -1008,223 +984,3 @@ func (chatAnnouncements *ChatAnnouncementService) Patch(ctx *core.Context, body
optFns: optFns,
}
}
-
-type ChatCustomBotCreateReqCall struct {
- ctx *core.Context
- chatCustomBots *ChatCustomBotService
- body *ChatCustomBotCreateReqBody
- optFns []request.OptFn
-}
-
-func (rc *ChatCustomBotCreateReqCall) Do() (*ChatCustomBotCreateResult, error) {
- var result = &ChatCustomBotCreateResult{}
- req := request.NewRequest("im/v1/chat_custom_bots", "POST",
- []request.AccessTokenType{request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
- err := api.Send(rc.ctx, rc.chatCustomBots.service.conf, req)
- return result, err
-}
-
-func (chatCustomBots *ChatCustomBotService) Create(ctx *core.Context, body *ChatCustomBotCreateReqBody, optFns ...request.OptFn) *ChatCustomBotCreateReqCall {
- return &ChatCustomBotCreateReqCall{
- ctx: ctx,
- chatCustomBots: chatCustomBots,
- body: body,
- optFns: optFns,
- }
-}
-
-type ChatCustomBotDeleteReqCall struct {
- ctx *core.Context
- chatCustomBots *ChatCustomBotService
- pathParams map[string]interface{}
- optFns []request.OptFn
-}
-
-func (rc *ChatCustomBotDeleteReqCall) SetBotId(botId int64) {
- rc.pathParams["bot_id"] = botId
-}
-
-func (rc *ChatCustomBotDeleteReqCall) Do() (*response.NoData, error) {
- rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
- var result = &response.NoData{}
- req := request.NewRequest("im/v1/chat_custom_bots/:bot_id", "DELETE",
- []request.AccessTokenType{request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
- err := api.Send(rc.ctx, rc.chatCustomBots.service.conf, req)
- return result, err
-}
-
-func (chatCustomBots *ChatCustomBotService) Delete(ctx *core.Context, optFns ...request.OptFn) *ChatCustomBotDeleteReqCall {
- return &ChatCustomBotDeleteReqCall{
- ctx: ctx,
- chatCustomBots: chatCustomBots,
- pathParams: map[string]interface{}{},
- optFns: optFns,
- }
-}
-
-type ChatCustomBotGetReqCall struct {
- ctx *core.Context
- chatCustomBots *ChatCustomBotService
- pathParams map[string]interface{}
- optFns []request.OptFn
-}
-
-func (rc *ChatCustomBotGetReqCall) SetBotId(botId int64) {
- rc.pathParams["bot_id"] = botId
-}
-
-func (rc *ChatCustomBotGetReqCall) Do() (*ChatCustomBotGetResult, error) {
- rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
- var result = &ChatCustomBotGetResult{}
- req := request.NewRequest("im/v1/chat_custom_bots/:bot_id", "GET",
- []request.AccessTokenType{request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
- err := api.Send(rc.ctx, rc.chatCustomBots.service.conf, req)
- return result, err
-}
-
-func (chatCustomBots *ChatCustomBotService) Get(ctx *core.Context, optFns ...request.OptFn) *ChatCustomBotGetReqCall {
- return &ChatCustomBotGetReqCall{
- ctx: ctx,
- chatCustomBots: chatCustomBots,
- pathParams: map[string]interface{}{},
- optFns: optFns,
- }
-}
-
-type ChatCustomBotPatchReqCall struct {
- ctx *core.Context
- chatCustomBots *ChatCustomBotService
- body *ChatCustomBotPatchReqBody
- pathParams map[string]interface{}
- optFns []request.OptFn
-}
-
-func (rc *ChatCustomBotPatchReqCall) SetBotId(botId int64) {
- rc.pathParams["bot_id"] = botId
-}
-
-func (rc *ChatCustomBotPatchReqCall) Do() (*response.NoData, error) {
- rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
- var result = &response.NoData{}
- req := request.NewRequest("im/v1/chat_custom_bots/:bot_id", "PATCH",
- []request.AccessTokenType{request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
- err := api.Send(rc.ctx, rc.chatCustomBots.service.conf, req)
- return result, err
-}
-
-func (chatCustomBots *ChatCustomBotService) Patch(ctx *core.Context, body *ChatCustomBotPatchReqBody, optFns ...request.OptFn) *ChatCustomBotPatchReqCall {
- return &ChatCustomBotPatchReqCall{
- ctx: ctx,
- chatCustomBots: chatCustomBots,
- body: body,
- pathParams: map[string]interface{}{},
- optFns: optFns,
- }
-}
-
-type MessageReactionCreateReqCall struct {
- ctx *core.Context
- messageReactions *MessageReactionService
- body *MessageReactionCreateReqBody
- pathParams map[string]interface{}
- optFns []request.OptFn
-}
-
-func (rc *MessageReactionCreateReqCall) SetMessageId(messageId string) {
- rc.pathParams["message_id"] = messageId
-}
-
-func (rc *MessageReactionCreateReqCall) Do() (*MessageReaction, error) {
- rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
- var result = &MessageReaction{}
- req := request.NewRequest("im/v1/messages/:message_id/reactions", "POST",
- []request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
- err := api.Send(rc.ctx, rc.messageReactions.service.conf, req)
- return result, err
-}
-
-func (messageReactions *MessageReactionService) Create(ctx *core.Context, body *MessageReactionCreateReqBody, optFns ...request.OptFn) *MessageReactionCreateReqCall {
- return &MessageReactionCreateReqCall{
- ctx: ctx,
- messageReactions: messageReactions,
- body: body,
- pathParams: map[string]interface{}{},
- optFns: optFns,
- }
-}
-
-type MessageReactionDeleteReqCall struct {
- ctx *core.Context
- messageReactions *MessageReactionService
- pathParams map[string]interface{}
- optFns []request.OptFn
-}
-
-func (rc *MessageReactionDeleteReqCall) SetMessageId(messageId string) {
- rc.pathParams["message_id"] = messageId
-}
-func (rc *MessageReactionDeleteReqCall) SetReactionId(reactionId string) {
- rc.pathParams["reaction_id"] = reactionId
-}
-
-func (rc *MessageReactionDeleteReqCall) Do() (*MessageReaction, error) {
- rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
- var result = &MessageReaction{}
- req := request.NewRequest("im/v1/messages/:message_id/reactions/:reaction_id", "DELETE",
- []request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
- err := api.Send(rc.ctx, rc.messageReactions.service.conf, req)
- return result, err
-}
-
-func (messageReactions *MessageReactionService) Delete(ctx *core.Context, optFns ...request.OptFn) *MessageReactionDeleteReqCall {
- return &MessageReactionDeleteReqCall{
- ctx: ctx,
- messageReactions: messageReactions,
- pathParams: map[string]interface{}{},
- optFns: optFns,
- }
-}
-
-type MessageReactionListReqCall struct {
- ctx *core.Context
- messageReactions *MessageReactionService
- pathParams map[string]interface{}
- queryParams map[string]interface{}
- optFns []request.OptFn
-}
-
-func (rc *MessageReactionListReqCall) SetMessageId(messageId string) {
- rc.pathParams["message_id"] = messageId
-}
-func (rc *MessageReactionListReqCall) SetReactionType(reactionType string) {
- rc.queryParams["reaction_type"] = reactionType
-}
-func (rc *MessageReactionListReqCall) SetPageToken(pageToken string) {
- rc.queryParams["page_token"] = pageToken
-}
-func (rc *MessageReactionListReqCall) SetPageSize(pageSize int) {
- rc.queryParams["page_size"] = pageSize
-}
-func (rc *MessageReactionListReqCall) SetUserIdType(userIdType string) {
- rc.queryParams["user_id_type"] = userIdType
-}
-
-func (rc *MessageReactionListReqCall) Do() (*MessageReactionListResult, error) {
- rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
- rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
- var result = &MessageReactionListResult{}
- req := request.NewRequest("im/v1/messages/:message_id/reactions", "GET",
- []request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
- err := api.Send(rc.ctx, rc.messageReactions.service.conf, req)
- return result, err
-}
-
-func (messageReactions *MessageReactionService) List(ctx *core.Context, optFns ...request.OptFn) *MessageReactionListReqCall {
- return &MessageReactionListReqCall{
- ctx: ctx,
- messageReactions: messageReactions,
- pathParams: map[string]interface{}{},
- queryParams: map[string]interface{}{},
- optFns: optFns,
- }
-}
diff --git a/service/im/v1/event.go b/service/im/v1/event.go
index f423d259..4fa40162 100644
--- a/service/im/v1/event.go
+++ b/service/im/v1/event.go
@@ -55,22 +55,6 @@ func SetChatDisbandedEventHandler(conf *config.Config, fn func(ctx *core.Context
event.SetTypeHandler(conf, "im.chat.disbanded_v1", &ChatDisbandedEventHandler{Fn: fn})
}
-type ChatMemberUserAddedEventHandler struct {
- Fn func(*core.Context, *ChatMemberUserAddedEvent) error
-}
-
-func (h *ChatMemberUserAddedEventHandler) GetEvent() interface{} {
- return &ChatMemberUserAddedEvent{}
-}
-
-func (h *ChatMemberUserAddedEventHandler) Handle(ctx *core.Context, event interface{}) error {
- return h.Fn(ctx, event.(*ChatMemberUserAddedEvent))
-}
-
-func SetChatMemberUserAddedEventHandler(conf *config.Config, fn func(ctx *core.Context, event *ChatMemberUserAddedEvent) error) {
- event.SetTypeHandler(conf, "im.chat.member.user.added_v1", &ChatMemberUserAddedEventHandler{Fn: fn})
-}
-
type ChatMemberBotAddedEventHandler struct {
Fn func(*core.Context, *ChatMemberBotAddedEvent) error
}
@@ -87,6 +71,22 @@ func SetChatMemberBotAddedEventHandler(conf *config.Config, fn func(ctx *core.Co
event.SetTypeHandler(conf, "im.chat.member.bot.added_v1", &ChatMemberBotAddedEventHandler{Fn: fn})
}
+type ChatMemberUserAddedEventHandler struct {
+ Fn func(*core.Context, *ChatMemberUserAddedEvent) error
+}
+
+func (h *ChatMemberUserAddedEventHandler) GetEvent() interface{} {
+ return &ChatMemberUserAddedEvent{}
+}
+
+func (h *ChatMemberUserAddedEventHandler) Handle(ctx *core.Context, event interface{}) error {
+ return h.Fn(ctx, event.(*ChatMemberUserAddedEvent))
+}
+
+func SetChatMemberUserAddedEventHandler(conf *config.Config, fn func(ctx *core.Context, event *ChatMemberUserAddedEvent) error) {
+ event.SetTypeHandler(conf, "im.chat.member.user.added_v1", &ChatMemberUserAddedEventHandler{Fn: fn})
+}
+
type ChatMemberBotDeletedEventHandler struct {
Fn func(*core.Context, *ChatMemberBotDeletedEvent) error
}
@@ -135,22 +135,6 @@ func SetChatMemberUserDeletedEventHandler(conf *config.Config, fn func(ctx *core
event.SetTypeHandler(conf, "im.chat.member.user.deleted_v1", &ChatMemberUserDeletedEventHandler{Fn: fn})
}
-type MessageAtMessageReadEventHandler struct {
- Fn func(*core.Context, *MessageAtMessageReadEvent) error
-}
-
-func (h *MessageAtMessageReadEventHandler) GetEvent() interface{} {
- return &MessageAtMessageReadEvent{}
-}
-
-func (h *MessageAtMessageReadEventHandler) Handle(ctx *core.Context, event interface{}) error {
- return h.Fn(ctx, event.(*MessageAtMessageReadEvent))
-}
-
-func SetMessageAtMessageReadEventHandler(conf *config.Config, fn func(ctx *core.Context, event *MessageAtMessageReadEvent) error) {
- event.SetTypeHandler(conf, "im.message.at_message_read_v1", &MessageAtMessageReadEventHandler{Fn: fn})
-}
-
type MessageMessageReadEventHandler struct {
Fn func(*core.Context, *MessageMessageReadEvent) error
}
@@ -166,51 +150,3 @@ func (h *MessageMessageReadEventHandler) Handle(ctx *core.Context, event interfa
func SetMessageMessageReadEventHandler(conf *config.Config, fn func(ctx *core.Context, event *MessageMessageReadEvent) error) {
event.SetTypeHandler(conf, "im.message.message_read_v1", &MessageMessageReadEventHandler{Fn: fn})
}
-
-type MessageUrgentMessageReadEventHandler struct {
- Fn func(*core.Context, *MessageUrgentMessageReadEvent) error
-}
-
-func (h *MessageUrgentMessageReadEventHandler) GetEvent() interface{} {
- return &MessageUrgentMessageReadEvent{}
-}
-
-func (h *MessageUrgentMessageReadEventHandler) Handle(ctx *core.Context, event interface{}) error {
- return h.Fn(ctx, event.(*MessageUrgentMessageReadEvent))
-}
-
-func SetMessageUrgentMessageReadEventHandler(conf *config.Config, fn func(ctx *core.Context, event *MessageUrgentMessageReadEvent) error) {
- event.SetTypeHandler(conf, "im.message.urgent_message_read_v1", &MessageUrgentMessageReadEventHandler{Fn: fn})
-}
-
-type MessageReactionCreatedEventHandler struct {
- Fn func(*core.Context, *MessageReactionCreatedEvent) error
-}
-
-func (h *MessageReactionCreatedEventHandler) GetEvent() interface{} {
- return &MessageReactionCreatedEvent{}
-}
-
-func (h *MessageReactionCreatedEventHandler) Handle(ctx *core.Context, event interface{}) error {
- return h.Fn(ctx, event.(*MessageReactionCreatedEvent))
-}
-
-func SetMessageReactionCreatedEventHandler(conf *config.Config, fn func(ctx *core.Context, event *MessageReactionCreatedEvent) error) {
- event.SetTypeHandler(conf, "im.message.reaction.created_v1", &MessageReactionCreatedEventHandler{Fn: fn})
-}
-
-type MessageReactionDeletedEventHandler struct {
- Fn func(*core.Context, *MessageReactionDeletedEvent) error
-}
-
-func (h *MessageReactionDeletedEventHandler) GetEvent() interface{} {
- return &MessageReactionDeletedEvent{}
-}
-
-func (h *MessageReactionDeletedEventHandler) Handle(ctx *core.Context, event interface{}) error {
- return h.Fn(ctx, event.(*MessageReactionDeletedEvent))
-}
-
-func SetMessageReactionDeletedEventHandler(conf *config.Config, fn func(ctx *core.Context, event *MessageReactionDeletedEvent) error) {
- event.SetTypeHandler(conf, "im.message.reaction.deleted_v1", &MessageReactionDeletedEventHandler{Fn: fn})
-}
diff --git a/service/im/v1/model.go b/service/im/v1/model.go
index ccf60784..91790c5b 100644
--- a/service/im/v1/model.go
+++ b/service/im/v1/model.go
@@ -212,6 +212,17 @@ func (s *ChatChange) MarshalJSON() ([]byte, error) {
return tools.MarshalJSON(raw, s.ForceSendFields)
}
+type Emoji struct {
+ EmojiType string `json:"emoji_type,omitempty"`
+ ForceSendFields []string `json:"-"`
+}
+
+func (s *Emoji) MarshalJSON() ([]byte, error) {
+ type cp Emoji
+ raw := cp(*s)
+ return tools.MarshalJSON(raw, s.ForceSendFields)
+}
+
type EventMessageReader struct {
ReaderId *UserId `json:"reader_id,omitempty"`
ReadTime string `json:"read_time,omitempty"`
@@ -311,48 +322,6 @@ func (s *Mention) MarshalJSON() ([]byte, error) {
return tools.MarshalJSON(raw, s.ForceSendFields)
}
-type ReadUser struct {
- UserIdType string `json:"user_id_type,omitempty"`
- UserId string `json:"user_id,omitempty"`
- Timestamp string `json:"timestamp,omitempty"`
- TenantKey string `json:"tenant_key,omitempty"`
- ForceSendFields []string `json:"-"`
-}
-
-func (s *ReadUser) MarshalJSON() ([]byte, error) {
- type cp ReadUser
- raw := cp(*s)
- return tools.MarshalJSON(raw, s.ForceSendFields)
-}
-
-type Sender struct {
- Id string `json:"id,omitempty"`
- IdType string `json:"id_type,omitempty"`
- SenderType string `json:"sender_type,omitempty"`
- TenantKey string `json:"tenant_key,omitempty"`
- ForceSendFields []string `json:"-"`
-}
-
-func (s *Sender) MarshalJSON() ([]byte, error) {
- type cp Sender
- raw := cp(*s)
- return tools.MarshalJSON(raw, s.ForceSendFields)
-}
-
-type ChatCustomBot struct {
-}
-
-type Emoji struct {
- EmojiType string `json:"emoji_type,omitempty"`
- ForceSendFields []string `json:"-"`
-}
-
-func (s *Emoji) MarshalJSON() ([]byte, error) {
- type cp Emoji
- raw := cp(*s)
- return tools.MarshalJSON(raw, s.ForceSendFields)
-}
-
type MentionEvent struct {
Key string `json:"key,omitempty"`
Id *UserId `json:"id,omitempty"`
@@ -393,6 +362,34 @@ func (s *Operator) MarshalJSON() ([]byte, error) {
return tools.MarshalJSON(raw, s.ForceSendFields)
}
+type ReadUser struct {
+ UserIdType string `json:"user_id_type,omitempty"`
+ UserId string `json:"user_id,omitempty"`
+ Timestamp string `json:"timestamp,omitempty"`
+ TenantKey string `json:"tenant_key,omitempty"`
+ ForceSendFields []string `json:"-"`
+}
+
+func (s *ReadUser) MarshalJSON() ([]byte, error) {
+ type cp ReadUser
+ raw := cp(*s)
+ return tools.MarshalJSON(raw, s.ForceSendFields)
+}
+
+type Sender struct {
+ Id string `json:"id,omitempty"`
+ IdType string `json:"id_type,omitempty"`
+ SenderType string `json:"sender_type,omitempty"`
+ TenantKey string `json:"tenant_key,omitempty"`
+ ForceSendFields []string `json:"-"`
+}
+
+func (s *Sender) MarshalJSON() ([]byte, error) {
+ type cp Sender
+ raw := cp(*s)
+ return tools.MarshalJSON(raw, s.ForceSendFields)
+}
+
type MessageListResult struct {
HasMore bool `json:"has_more,omitempty"`
PageToken string `json:"page_token,omitempty"`
@@ -585,6 +582,13 @@ type ChatMembersDeleteResult struct {
InvalidIdList []string `json:"invalid_id_list,omitempty"`
}
+type ChatMembersGetResult struct {
+ Items []*ListMember `json:"items,omitempty"`
+ PageToken string `json:"page_token,omitempty"`
+ HasMore bool `json:"has_more,omitempty"`
+ MemberTotal int `json:"member_total,omitempty"`
+}
+
type ChatAnnouncementGetResult struct {
Content string `json:"content,omitempty"`
Revision string `json:"revision,omitempty"`
@@ -596,13 +600,6 @@ type ChatAnnouncementGetResult struct {
ModifierId string `json:"modifier_id,omitempty"`
}
-type ChatMembersGetResult struct {
- Items []*ListMember `json:"items,omitempty"`
- PageToken string `json:"page_token,omitempty"`
- HasMore bool `json:"has_more,omitempty"`
- MemberTotal int `json:"member_total,omitempty"`
-}
-
type ChatMembersIsInChatResult struct {
IsInChat bool `json:"is_in_chat,omitempty"`
}
@@ -619,97 +616,6 @@ func (s *ChatAnnouncementPatchReqBody) MarshalJSON() ([]byte, error) {
return tools.MarshalJSON(raw, s.ForceSendFields)
}
-type ChatCustomBotCreateReqBody struct {
- ChatId int64 `json:"chat_id,omitempty,string"`
- AvatarKey string `json:"avatar_key,omitempty"`
- Name string `json:"name,omitempty"`
- Description string `json:"description,omitempty"`
- AllowIps []string `json:"allow_ips,omitempty"`
- KeyWords []string `json:"key_words,omitempty"`
- SignatureStatus bool `json:"signature_status,omitempty"`
- Uuid int64 `json:"uuid,omitempty,string"`
- ForceSendFields []string `json:"-"`
-}
-
-func (s *ChatCustomBotCreateReqBody) MarshalJSON() ([]byte, error) {
- type cp ChatCustomBotCreateReqBody
- raw := cp(*s)
- return tools.MarshalJSON(raw, s.ForceSendFields)
-}
-
-type ChatCustomBotCreateResult struct {
- BotId int64 `json:"bot_id,omitempty,string"`
- ChatId int64 `json:"chat_id,omitempty,string"`
- AvatarKey string `json:"avatar_key,omitempty"`
- Name string `json:"name,omitempty"`
- Description string `json:"description,omitempty"`
- I18nNames *I18nNames `json:"i18n_names,omitempty"`
- I18nDescriptions *I18nNames `json:"i18n_descriptions,omitempty"`
- Webhook string `json:"webhook,omitempty"`
- AllowIps []string `json:"allow_ips,omitempty"`
- KeyWords []string `json:"key_words,omitempty"`
- SignatureStatus bool `json:"signature_status,omitempty"`
- Signature string `json:"signature,omitempty"`
- Enable bool `json:"enable,omitempty"`
- InvitorId int64 `json:"invitor_id,omitempty,string"`
- InvitorIdType string `json:"invitor_id_type,omitempty"`
- Version int64 `json:"version,omitempty,string"`
-}
-
-type ChatCustomBotGetResult struct {
- BotId int64 `json:"bot_id,omitempty,string"`
- ChatId int64 `json:"chat_id,omitempty,string"`
- AvatarKey string `json:"avatar_key,omitempty"`
- Name string `json:"name,omitempty"`
- Description string `json:"description,omitempty"`
- I18nNames *I18nNames `json:"i18n_names,omitempty"`
- I18nDescriptions *I18nNames `json:"i18n_descriptions,omitempty"`
- Webhook string `json:"webhook,omitempty"`
- AllowIps []string `json:"allow_ips,omitempty"`
- KeyWords []string `json:"key_words,omitempty"`
- SignatureStatus bool `json:"signature_status,omitempty"`
- Signature string `json:"signature,omitempty"`
- Enable bool `json:"enable,omitempty"`
- InvitorId int64 `json:"invitor_id,omitempty,string"`
- InvitorIdType string `json:"invitor_id_type,omitempty"`
- Version int64 `json:"version,omitempty,string"`
-}
-
-type ChatCustomBotPatchReqBody struct {
- AvatarKey string `json:"avatar_key,omitempty"`
- Name string `json:"name,omitempty"`
- Description string `json:"description,omitempty"`
- AllowIps []string `json:"allow_ips,omitempty"`
- KeyWords []string `json:"key_words,omitempty"`
- SignatureStatus bool `json:"signature_status,omitempty"`
- ChangeSignature bool `json:"change_signature,omitempty"`
- Enable bool `json:"enable,omitempty"`
- ForceSendFields []string `json:"-"`
-}
-
-func (s *ChatCustomBotPatchReqBody) MarshalJSON() ([]byte, error) {
- type cp ChatCustomBotPatchReqBody
- raw := cp(*s)
- return tools.MarshalJSON(raw, s.ForceSendFields)
-}
-
-type MessageReactionCreateReqBody struct {
- ReactionType *Emoji `json:"reaction_type,omitempty"`
- ForceSendFields []string `json:"-"`
-}
-
-func (s *MessageReactionCreateReqBody) MarshalJSON() ([]byte, error) {
- type cp MessageReactionCreateReqBody
- raw := cp(*s)
- return tools.MarshalJSON(raw, s.ForceSendFields)
-}
-
-type MessageReactionListResult struct {
- Items []*MessageReaction `json:"items,omitempty"`
- HasMore bool `json:"has_more,omitempty"`
- PageToken string `json:"page_token,omitempty"`
-}
-
type MessageReceiveEventData struct {
Sender *EventSender `json:"sender,omitempty"`
Message *EventMessage `json:"message,omitempty"`
@@ -747,6 +653,18 @@ type ChatDisbandedEvent struct {
Event *ChatDisbandedEventData `json:"event"`
}
+type ChatMemberBotAddedEventData struct {
+ ChatId string `json:"chat_id,omitempty"`
+ OperatorId *UserId `json:"operator_id,omitempty"`
+ External bool `json:"external,omitempty"`
+ OperatorTenantKey string `json:"operator_tenant_key,omitempty"`
+}
+
+type ChatMemberBotAddedEvent struct {
+ *model.BaseEventV2
+ Event *ChatMemberBotAddedEventData `json:"event"`
+}
+
type ChatMemberUserAddedEventData struct {
ChatId string `json:"chat_id,omitempty"`
OperatorId *UserId `json:"operator_id,omitempty"`
@@ -760,18 +678,6 @@ type ChatMemberUserAddedEvent struct {
Event *ChatMemberUserAddedEventData `json:"event"`
}
-type ChatMemberBotAddedEventData struct {
- ChatId string `json:"chat_id,omitempty"`
- OperatorId *UserId `json:"operator_id,omitempty"`
- External bool `json:"external,omitempty"`
- OperatorTenantKey string `json:"operator_tenant_key,omitempty"`
-}
-
-type ChatMemberBotAddedEvent struct {
- *model.BaseEventV2
- Event *ChatMemberBotAddedEventData `json:"event"`
-}
-
type ChatMemberBotDeletedEventData struct {
ChatId string `json:"chat_id,omitempty"`
OperatorId *UserId `json:"operator_id,omitempty"`
@@ -810,16 +716,6 @@ type ChatMemberUserDeletedEvent struct {
Event *ChatMemberUserDeletedEventData `json:"event"`
}
-type MessageAtMessageReadEventData struct {
- Reader *EventMessageReader `json:"reader,omitempty"`
- MessageIdList []string `json:"message_id_list,omitempty"`
-}
-
-type MessageAtMessageReadEvent struct {
- *model.BaseEventV2
- Event *MessageAtMessageReadEventData `json:"event"`
-}
-
type MessageMessageReadEventData struct {
Reader *EventMessageReader `json:"reader,omitempty"`
MessageIdList []string `json:"message_id_list,omitempty"`
@@ -829,41 +725,3 @@ type MessageMessageReadEvent struct {
*model.BaseEventV2
Event *MessageMessageReadEventData `json:"event"`
}
-
-type MessageUrgentMessageReadEventData struct {
- Reader *EventMessageReader `json:"reader,omitempty"`
- MessageId string `json:"message_id,omitempty"`
-}
-
-type MessageUrgentMessageReadEvent struct {
- *model.BaseEventV2
- Event *MessageUrgentMessageReadEventData `json:"event"`
-}
-
-type MessageReactionCreatedEventData struct {
- MessageId string `json:"message_id,omitempty"`
- ReactionType *Emoji `json:"reaction_type,omitempty"`
- OperatorType string `json:"operator_type,omitempty"`
- UserId *UserId `json:"user_id,omitempty"`
- AppId string `json:"app_id,omitempty"`
- ActionTime string `json:"action_time,omitempty"`
-}
-
-type MessageReactionCreatedEvent struct {
- *model.BaseEventV2
- Event *MessageReactionCreatedEventData `json:"event"`
-}
-
-type MessageReactionDeletedEventData struct {
- MessageId string `json:"message_id,omitempty"`
- ReactionType *Emoji `json:"reaction_type,omitempty"`
- OperatorType string `json:"operator_type,omitempty"`
- UserId *UserId `json:"user_id,omitempty"`
- AppId string `json:"app_id,omitempty"`
- ActionTime string `json:"action_time,omitempty"`
-}
-
-type MessageReactionDeletedEvent struct {
- *model.BaseEventV2
- Event *MessageReactionDeletedEventData `json:"event"`
-}
diff --git a/service/image/v4/api.go b/service/image/v4/api.go
index 5f0ceb16..8fb98eb1 100644
--- a/service/image/v4/api.go
+++ b/service/image/v4/api.go
@@ -50,7 +50,7 @@ func (rc *ImageGetReqCall) SetResponseStream(result io.Writer) {
func (rc *ImageGetReqCall) Do() (io.Writer, error) {
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
rc.optFns = append(rc.optFns, request.SetResponseStream())
- req := request.NewRequest("image/v4/get", "GET",
+ req := request.NewRequest("/open-apis/image/v4/get", "GET",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, nil, rc.result, rc.optFns...)
err := api.Send(rc.ctx, rc.images.service.conf, req)
return rc.result, err
@@ -81,7 +81,7 @@ func (rc *ImagePutReqCall) SetImageType(imageType string) {
func (rc *ImagePutReqCall) Do() (*Image, error) {
var result = &Image{}
- req := request.NewRequest("image/v4/put", "POST",
+ req := request.NewRequest("/open-apis/image/v4/put", "POST",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.images.service.conf, req)
return result, err
diff --git a/service/mail/v1/api.go b/service/mail/v1/api.go
index 937d1073..63a07ae0 100644
--- a/service/mail/v1/api.go
+++ b/service/mail/v1/api.go
@@ -97,7 +97,7 @@ func (rc *MailgroupPermissionMemberDeleteReqCall) SetPermissionMemberId(permissi
func (rc *MailgroupPermissionMemberDeleteReqCall) Do() (*response.NoData, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &response.NoData{}
- req := request.NewRequest("mail/v1/mailgroups/:mailgroup_id/permission_members/:permission_member_id", "DELETE",
+ req := request.NewRequest("/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/:permission_member_id", "DELETE",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.mailgroupPermissionMembers.service.conf, req)
return result, err
@@ -134,7 +134,7 @@ func (rc *PublicMailboxMemberGetReqCall) Do() (*PublicMailboxMember, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &PublicMailboxMember{}
- req := request.NewRequest("mail/v1/public_mailboxes/:public_mailbox_id/members/:member_id", "GET",
+ req := request.NewRequest("/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/:member_id", "GET",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.publicMailboxMembers.service.conf, req)
return result, err
@@ -167,7 +167,7 @@ func (rc *PublicMailboxMemberDeleteReqCall) SetMemberId(memberId string) {
func (rc *PublicMailboxMemberDeleteReqCall) Do() (*response.NoData, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &response.NoData{}
- req := request.NewRequest("mail/v1/public_mailboxes/:public_mailbox_id/members/:member_id", "DELETE",
+ req := request.NewRequest("/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/:member_id", "DELETE",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.publicMailboxMembers.service.conf, req)
return result, err
@@ -210,7 +210,7 @@ func (rc *MailgroupMemberListReqCall) Do() (*MailgroupMemberListResult, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &MailgroupMemberListResult{}
- req := request.NewRequest("mail/v1/mailgroups/:mailgroup_id/members", "GET",
+ req := request.NewRequest("/open-apis/mail/v1/mailgroups/:mailgroup_id/members", "GET",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.mailgroupMembers.service.conf, req)
return result, err
@@ -251,7 +251,7 @@ func (rc *MailgroupPermissionMemberGetReqCall) Do() (*MailgroupPermissionMember,
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &MailgroupPermissionMember{}
- req := request.NewRequest("mail/v1/mailgroups/:mailgroup_id/permission_members/:permission_member_id", "GET",
+ req := request.NewRequest("/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/:permission_member_id", "GET",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.mailgroupPermissionMembers.service.conf, req)
return result, err
@@ -295,7 +295,7 @@ func (rc *MailgroupPermissionMemberListReqCall) Do() (*MailgroupPermissionMember
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &MailgroupPermissionMemberListResult{}
- req := request.NewRequest("mail/v1/mailgroups/:mailgroup_id/permission_members", "GET",
+ req := request.NewRequest("/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members", "GET",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.mailgroupPermissionMembers.service.conf, req)
return result, err
@@ -326,7 +326,7 @@ func (rc *PublicMailboxUpdateReqCall) SetPublicMailboxId(publicMailboxId string)
func (rc *PublicMailboxUpdateReqCall) Do() (*PublicMailbox, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &PublicMailbox{}
- req := request.NewRequest("mail/v1/public_mailboxes/:public_mailbox_id", "PUT",
+ req := request.NewRequest("/open-apis/mail/v1/public_mailboxes/:public_mailbox_id", "PUT",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.publicMailboxs.service.conf, req)
return result, err
@@ -356,7 +356,7 @@ func (rc *PublicMailboxMemberClearReqCall) SetPublicMailboxId(publicMailboxId st
func (rc *PublicMailboxMemberClearReqCall) Do() (*response.NoData, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &response.NoData{}
- req := request.NewRequest("mail/v1/public_mailboxes/:public_mailbox_id/members/clear", "POST",
+ req := request.NewRequest("/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/clear", "POST",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.publicMailboxMembers.service.conf, req)
return result, err
@@ -396,7 +396,7 @@ func (rc *PublicMailboxMemberListReqCall) Do() (*PublicMailboxMemberListResult,
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &PublicMailboxMemberListResult{}
- req := request.NewRequest("mail/v1/public_mailboxes/:public_mailbox_id/members", "GET",
+ req := request.NewRequest("/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members", "GET",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.publicMailboxMembers.service.conf, req)
return result, err
@@ -432,7 +432,7 @@ func (rc *PublicMailboxMemberCreateReqCall) Do() (*PublicMailboxMember, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &PublicMailboxMember{}
- req := request.NewRequest("mail/v1/public_mailboxes/:public_mailbox_id/members", "POST",
+ req := request.NewRequest("/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members", "POST",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.publicMailboxMembers.service.conf, req)
return result, err
@@ -463,7 +463,7 @@ func (rc *MailgroupGetReqCall) SetMailgroupId(mailgroupId string) {
func (rc *MailgroupGetReqCall) Do() (*Mailgroup, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &Mailgroup{}
- req := request.NewRequest("mail/v1/mailgroups/:mailgroup_id", "GET",
+ req := request.NewRequest("/open-apis/mail/v1/mailgroups/:mailgroup_id", "GET",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.mailgroups.service.conf, req)
return result, err
@@ -493,7 +493,7 @@ func (rc *MailgroupUpdateReqCall) SetMailgroupId(mailgroupId string) {
func (rc *MailgroupUpdateReqCall) Do() (*Mailgroup, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &Mailgroup{}
- req := request.NewRequest("mail/v1/mailgroups/:mailgroup_id", "PUT",
+ req := request.NewRequest("/open-apis/mail/v1/mailgroups/:mailgroup_id", "PUT",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.mailgroups.service.conf, req)
return result, err
@@ -526,7 +526,7 @@ func (rc *PublicMailboxListReqCall) SetPageSize(pageSize int) {
func (rc *PublicMailboxListReqCall) Do() (*PublicMailboxListResult, error) {
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &PublicMailboxListResult{}
- req := request.NewRequest("mail/v1/public_mailboxes", "GET",
+ req := request.NewRequest("/open-apis/mail/v1/public_mailboxes", "GET",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.publicMailboxs.service.conf, req)
return result, err
@@ -555,7 +555,7 @@ func (rc *MailgroupDeleteReqCall) SetMailgroupId(mailgroupId string) {
func (rc *MailgroupDeleteReqCall) Do() (*response.NoData, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &response.NoData{}
- req := request.NewRequest("mail/v1/mailgroups/:mailgroup_id", "DELETE",
+ req := request.NewRequest("/open-apis/mail/v1/mailgroups/:mailgroup_id", "DELETE",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.mailgroups.service.conf, req)
return result, err
@@ -593,7 +593,7 @@ func (rc *MailgroupPermissionMemberCreateReqCall) Do() (*MailgroupPermissionMemb
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &MailgroupPermissionMember{}
- req := request.NewRequest("mail/v1/mailgroups/:mailgroup_id/permission_members", "POST",
+ req := request.NewRequest("/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members", "POST",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.mailgroupPermissionMembers.service.conf, req)
return result, err
@@ -619,7 +619,7 @@ type PublicMailboxCreateReqCall struct {
func (rc *PublicMailboxCreateReqCall) Do() (*PublicMailbox, error) {
var result = &PublicMailbox{}
- req := request.NewRequest("mail/v1/public_mailboxes", "POST",
+ req := request.NewRequest("/open-apis/mail/v1/public_mailboxes", "POST",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.publicMailboxs.service.conf, req)
return result, err
@@ -659,7 +659,7 @@ func (rc *MailgroupMemberGetReqCall) Do() (*MailgroupMember, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &MailgroupMember{}
- req := request.NewRequest("mail/v1/mailgroups/:mailgroup_id/members/:member_id", "GET",
+ req := request.NewRequest("/open-apis/mail/v1/mailgroups/:mailgroup_id/members/:member_id", "GET",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.mailgroupMembers.service.conf, req)
return result, err
@@ -689,7 +689,7 @@ func (rc *PublicMailboxGetReqCall) SetPublicMailboxId(publicMailboxId string) {
func (rc *PublicMailboxGetReqCall) Do() (*PublicMailbox, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &PublicMailbox{}
- req := request.NewRequest("mail/v1/public_mailboxes/:public_mailbox_id", "GET",
+ req := request.NewRequest("/open-apis/mail/v1/public_mailboxes/:public_mailbox_id", "GET",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.publicMailboxs.service.conf, req)
return result, err
@@ -719,7 +719,7 @@ func (rc *PublicMailboxPatchReqCall) SetPublicMailboxId(publicMailboxId string)
func (rc *PublicMailboxPatchReqCall) Do() (*PublicMailbox, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &PublicMailbox{}
- req := request.NewRequest("mail/v1/public_mailboxes/:public_mailbox_id", "PATCH",
+ req := request.NewRequest("/open-apis/mail/v1/public_mailboxes/:public_mailbox_id", "PATCH",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.publicMailboxs.service.conf, req)
return result, err
@@ -744,7 +744,7 @@ type MailgroupCreateReqCall struct {
func (rc *MailgroupCreateReqCall) Do() (*Mailgroup, error) {
var result = &Mailgroup{}
- req := request.NewRequest("mail/v1/mailgroups", "POST",
+ req := request.NewRequest("/open-apis/mail/v1/mailgroups", "POST",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.mailgroups.service.conf, req)
return result, err
@@ -776,7 +776,7 @@ func (rc *MailgroupListReqCall) SetPageSize(pageSize int) {
func (rc *MailgroupListReqCall) Do() (*MailgroupListResult, error) {
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &MailgroupListResult{}
- req := request.NewRequest("mail/v1/mailgroups", "GET",
+ req := request.NewRequest("/open-apis/mail/v1/mailgroups", "GET",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.mailgroups.service.conf, req)
return result, err
@@ -806,7 +806,7 @@ func (rc *MailgroupPatchReqCall) SetMailgroupId(mailgroupId string) {
func (rc *MailgroupPatchReqCall) Do() (*Mailgroup, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &Mailgroup{}
- req := request.NewRequest("mail/v1/mailgroups/:mailgroup_id", "PATCH",
+ req := request.NewRequest("/open-apis/mail/v1/mailgroups/:mailgroup_id", "PATCH",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.mailgroups.service.conf, req)
return result, err
@@ -845,7 +845,7 @@ func (rc *MailgroupMemberCreateReqCall) Do() (*MailgroupMember, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &MailgroupMember{}
- req := request.NewRequest("mail/v1/mailgroups/:mailgroup_id/members", "POST",
+ req := request.NewRequest("/open-apis/mail/v1/mailgroups/:mailgroup_id/members", "POST",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.mailgroupMembers.service.conf, req)
return result, err
@@ -879,7 +879,7 @@ func (rc *MailgroupMemberDeleteReqCall) SetMemberId(memberId string) {
func (rc *MailgroupMemberDeleteReqCall) Do() (*response.NoData, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &response.NoData{}
- req := request.NewRequest("mail/v1/mailgroups/:mailgroup_id/members/:member_id", "DELETE",
+ req := request.NewRequest("/open-apis/mail/v1/mailgroups/:mailgroup_id/members/:member_id", "DELETE",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.mailgroupMembers.service.conf, req)
return result, err
diff --git a/service/meeting_room/v1/api.go b/service/meeting_room/v1/api.go
index 76e9db8a..45c05eea 100644
--- a/service/meeting_room/v1/api.go
+++ b/service/meeting_room/v1/api.go
@@ -125,7 +125,7 @@ type SummaryBatchGetReqCall struct {
func (rc *SummaryBatchGetReqCall) Do() (*SummaryBatchGetResult, error) {
var result = &SummaryBatchGetResult{}
- req := request.NewRequest("meeting_room/summary/batch_get", "POST",
+ req := request.NewRequest("/open-apis/meeting_room/summary/batch_get", "POST",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.summarys.service.conf, req)
return result, err
@@ -140,6 +140,38 @@ func (summarys *SummaryService) BatchGet(ctx *core.Context, body *SummaryBatchGe
}
}
+type RoomBatchGetReqCall struct {
+ ctx *core.Context
+ rooms *RoomService
+ queryParams map[string]interface{}
+ optFns []request.OptFn
+}
+
+func (rc *RoomBatchGetReqCall) SetRoomIds(roomIds ...string) {
+ rc.queryParams["room_ids"] = roomIds
+}
+func (rc *RoomBatchGetReqCall) SetFields(fields string) {
+ rc.queryParams["fields"] = fields
+}
+
+func (rc *RoomBatchGetReqCall) Do() (*RoomBatchGetResult, error) {
+ rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
+ var result = &RoomBatchGetResult{}
+ req := request.NewRequest("/open-apis/meeting_room/room/batch_get", "GET",
+ []request.AccessTokenType{request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
+ err := api.Send(rc.ctx, rc.rooms.service.conf, req)
+ return result, err
+}
+
+func (rooms *RoomService) BatchGet(ctx *core.Context, optFns ...request.OptFn) *RoomBatchGetReqCall {
+ return &RoomBatchGetReqCall{
+ ctx: ctx,
+ rooms: rooms,
+ queryParams: map[string]interface{}{},
+ optFns: optFns,
+ }
+}
+
type FreebusyBatchGetReqCall struct {
ctx *core.Context
freebusys *FreebusyService
@@ -160,7 +192,7 @@ func (rc *FreebusyBatchGetReqCall) SetTimeMax(timeMax string) {
func (rc *FreebusyBatchGetReqCall) Do() (*FreebusyBatchGetResult, error) {
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &FreebusyBatchGetResult{}
- req := request.NewRequest("meeting_room/freebusy/batch_get", "GET",
+ req := request.NewRequest("/open-apis/meeting_room/freebusy/batch_get", "GET",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.freebusys.service.conf, req)
return result, err
@@ -192,7 +224,7 @@ func (rc *BuildingBatchGetReqCall) SetFields(fields string) {
func (rc *BuildingBatchGetReqCall) Do() (*BuildingBatchGetResult, error) {
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &BuildingBatchGetResult{}
- req := request.NewRequest("meeting_room/building/batch_get", "GET",
+ req := request.NewRequest("/open-apis/meeting_room/building/batch_get", "GET",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.buildings.service.conf, req)
return result, err
@@ -207,38 +239,6 @@ func (buildings *BuildingService) BatchGet(ctx *core.Context, optFns ...request.
}
}
-type RoomBatchGetReqCall struct {
- ctx *core.Context
- rooms *RoomService
- queryParams map[string]interface{}
- optFns []request.OptFn
-}
-
-func (rc *RoomBatchGetReqCall) SetRoomIds(roomIds ...string) {
- rc.queryParams["room_ids"] = roomIds
-}
-func (rc *RoomBatchGetReqCall) SetFields(fields string) {
- rc.queryParams["fields"] = fields
-}
-
-func (rc *RoomBatchGetReqCall) Do() (*RoomBatchGetResult, error) {
- rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
- var result = &RoomBatchGetResult{}
- req := request.NewRequest("meeting_room/room/batch_get", "GET",
- []request.AccessTokenType{request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
- err := api.Send(rc.ctx, rc.rooms.service.conf, req)
- return result, err
-}
-
-func (rooms *RoomService) BatchGet(ctx *core.Context, optFns ...request.OptFn) *RoomBatchGetReqCall {
- return &RoomBatchGetReqCall{
- ctx: ctx,
- rooms: rooms,
- queryParams: map[string]interface{}{},
- optFns: optFns,
- }
-}
-
type BuildingBatchGetIdReqCall struct {
ctx *core.Context
buildings *BuildingService
@@ -253,7 +253,7 @@ func (rc *BuildingBatchGetIdReqCall) SetCustomBuildingIds(customBuildingIds ...s
func (rc *BuildingBatchGetIdReqCall) Do() (*BuildingBatchGetIdResult, error) {
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &BuildingBatchGetIdResult{}
- req := request.NewRequest("meeting_room/building/batch_get_id", "GET",
+ req := request.NewRequest("/open-apis/meeting_room/building/batch_get_id", "GET",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.buildings.service.conf, req)
return result, err
@@ -282,7 +282,7 @@ func (rc *RoomBatchGetIdReqCall) SetCustomRoomIds(customRoomIds ...string) {
func (rc *RoomBatchGetIdReqCall) Do() (*RoomBatchGetIdResult, error) {
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &RoomBatchGetIdResult{}
- req := request.NewRequest("meeting_room/room/batch_get_id", "GET",
+ req := request.NewRequest("/open-apis/meeting_room/room/batch_get_id", "GET",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.rooms.service.conf, req)
return result, err
@@ -297,30 +297,6 @@ func (rooms *RoomService) BatchGetId(ctx *core.Context, optFns ...request.OptFn)
}
}
-type RoomCreateReqCall struct {
- ctx *core.Context
- rooms *RoomService
- body *RoomCreateReqBody
- optFns []request.OptFn
-}
-
-func (rc *RoomCreateReqCall) Do() (*RoomCreateResult, error) {
- var result = &RoomCreateResult{}
- req := request.NewRequest("meeting_room/room/create", "POST",
- []request.AccessTokenType{request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
- err := api.Send(rc.ctx, rc.rooms.service.conf, req)
- return result, err
-}
-
-func (rooms *RoomService) Create(ctx *core.Context, body *RoomCreateReqBody, optFns ...request.OptFn) *RoomCreateReqCall {
- return &RoomCreateReqCall{
- ctx: ctx,
- rooms: rooms,
- body: body,
- optFns: optFns,
- }
-}
-
type BuildingCreateReqCall struct {
ctx *core.Context
buildings *BuildingService
@@ -330,7 +306,7 @@ type BuildingCreateReqCall struct {
func (rc *BuildingCreateReqCall) Do() (*BuildingCreateResult, error) {
var result = &BuildingCreateResult{}
- req := request.NewRequest("meeting_room/building/create", "POST",
+ req := request.NewRequest("/open-apis/meeting_room/building/create", "POST",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.buildings.service.conf, req)
return result, err
@@ -345,6 +321,30 @@ func (buildings *BuildingService) Create(ctx *core.Context, body *BuildingCreate
}
}
+type RoomCreateReqCall struct {
+ ctx *core.Context
+ rooms *RoomService
+ body *RoomCreateReqBody
+ optFns []request.OptFn
+}
+
+func (rc *RoomCreateReqCall) Do() (*RoomCreateResult, error) {
+ var result = &RoomCreateResult{}
+ req := request.NewRequest("/open-apis/meeting_room/room/create", "POST",
+ []request.AccessTokenType{request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
+ err := api.Send(rc.ctx, rc.rooms.service.conf, req)
+ return result, err
+}
+
+func (rooms *RoomService) Create(ctx *core.Context, body *RoomCreateReqBody, optFns ...request.OptFn) *RoomCreateReqCall {
+ return &RoomCreateReqCall{
+ ctx: ctx,
+ rooms: rooms,
+ body: body,
+ optFns: optFns,
+ }
+}
+
type BuildingDeleteReqCall struct {
ctx *core.Context
buildings *BuildingService
@@ -354,7 +354,7 @@ type BuildingDeleteReqCall struct {
func (rc *BuildingDeleteReqCall) Do() (*response.NoData, error) {
var result = &response.NoData{}
- req := request.NewRequest("meeting_room/building/delete", "POST",
+ req := request.NewRequest("/open-apis/meeting_room/building/delete", "POST",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.buildings.service.conf, req)
return result, err
@@ -378,7 +378,7 @@ type RoomDeleteReqCall struct {
func (rc *RoomDeleteReqCall) Do() (*response.NoData, error) {
var result = &response.NoData{}
- req := request.NewRequest("meeting_room/room/delete", "POST",
+ req := request.NewRequest("/open-apis/meeting_room/room/delete", "POST",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.rooms.service.conf, req)
return result, err
@@ -393,47 +393,57 @@ func (rooms *RoomService) Delete(ctx *core.Context, body *RoomDeleteReqBody, opt
}
}
-type RoomListReqCall struct {
+type DistrictListReqCall struct {
ctx *core.Context
- rooms *RoomService
+ districts *DistrictService
queryParams map[string]interface{}
optFns []request.OptFn
}
-func (rc *RoomListReqCall) SetBuildingId(buildingId string) {
- rc.queryParams["building_id"] = buildingId
-}
-func (rc *RoomListReqCall) SetOrderBy(orderBy string) {
- rc.queryParams["order_by"] = orderBy
-}
-func (rc *RoomListReqCall) SetFields(fields string) {
- rc.queryParams["fields"] = fields
-}
-func (rc *RoomListReqCall) SetPageToken(pageToken string) {
- rc.queryParams["page_token"] = pageToken
-}
-func (rc *RoomListReqCall) SetPageSize(pageSize int) {
- rc.queryParams["page_size"] = pageSize
+func (rc *DistrictListReqCall) SetCountryId(countryId int) {
+ rc.queryParams["country_id"] = countryId
}
-func (rc *RoomListReqCall) Do() (*RoomListResult, error) {
+func (rc *DistrictListReqCall) Do() (*DistrictListResult, error) {
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
- var result = &RoomListResult{}
- req := request.NewRequest("meeting_room/room/list", "GET",
+ var result = &DistrictListResult{}
+ req := request.NewRequest("/open-apis/meeting_room/district/list", "GET",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
- err := api.Send(rc.ctx, rc.rooms.service.conf, req)
+ err := api.Send(rc.ctx, rc.districts.service.conf, req)
return result, err
}
-func (rooms *RoomService) List(ctx *core.Context, optFns ...request.OptFn) *RoomListReqCall {
- return &RoomListReqCall{
+func (districts *DistrictService) List(ctx *core.Context, optFns ...request.OptFn) *DistrictListReqCall {
+ return &DistrictListReqCall{
ctx: ctx,
- rooms: rooms,
+ districts: districts,
queryParams: map[string]interface{}{},
optFns: optFns,
}
}
+type CountryListReqCall struct {
+ ctx *core.Context
+ countrys *CountryService
+ optFns []request.OptFn
+}
+
+func (rc *CountryListReqCall) Do() (*CountryListResult, error) {
+ var result = &CountryListResult{}
+ req := request.NewRequest("/open-apis/meeting_room/country/list", "GET",
+ []request.AccessTokenType{request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
+ err := api.Send(rc.ctx, rc.countrys.service.conf, req)
+ return result, err
+}
+
+func (countrys *CountryService) List(ctx *core.Context, optFns ...request.OptFn) *CountryListReqCall {
+ return &CountryListReqCall{
+ ctx: ctx,
+ countrys: countrys,
+ optFns: optFns,
+ }
+}
+
type BuildingListReqCall struct {
ctx *core.Context
buildings *BuildingService
@@ -457,7 +467,7 @@ func (rc *BuildingListReqCall) SetPageSize(pageSize int) {
func (rc *BuildingListReqCall) Do() (*BuildingListResult, error) {
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &BuildingListResult{}
- req := request.NewRequest("meeting_room/building/list", "GET",
+ req := request.NewRequest("/open-apis/meeting_room/building/list", "GET",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.buildings.service.conf, req)
return result, err
@@ -472,57 +482,47 @@ func (buildings *BuildingService) List(ctx *core.Context, optFns ...request.OptF
}
}
-type DistrictListReqCall struct {
+type RoomListReqCall struct {
ctx *core.Context
- districts *DistrictService
+ rooms *RoomService
queryParams map[string]interface{}
optFns []request.OptFn
}
-func (rc *DistrictListReqCall) SetCountryId(countryId int) {
- rc.queryParams["country_id"] = countryId
+func (rc *RoomListReqCall) SetBuildingId(buildingId string) {
+ rc.queryParams["building_id"] = buildingId
+}
+func (rc *RoomListReqCall) SetOrderBy(orderBy string) {
+ rc.queryParams["order_by"] = orderBy
+}
+func (rc *RoomListReqCall) SetFields(fields string) {
+ rc.queryParams["fields"] = fields
+}
+func (rc *RoomListReqCall) SetPageToken(pageToken string) {
+ rc.queryParams["page_token"] = pageToken
+}
+func (rc *RoomListReqCall) SetPageSize(pageSize int) {
+ rc.queryParams["page_size"] = pageSize
}
-func (rc *DistrictListReqCall) Do() (*DistrictListResult, error) {
+func (rc *RoomListReqCall) Do() (*RoomListResult, error) {
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
- var result = &DistrictListResult{}
- req := request.NewRequest("meeting_room/district/list", "GET",
+ var result = &RoomListResult{}
+ req := request.NewRequest("/open-apis/meeting_room/room/list", "GET",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
- err := api.Send(rc.ctx, rc.districts.service.conf, req)
+ err := api.Send(rc.ctx, rc.rooms.service.conf, req)
return result, err
}
-func (districts *DistrictService) List(ctx *core.Context, optFns ...request.OptFn) *DistrictListReqCall {
- return &DistrictListReqCall{
+func (rooms *RoomService) List(ctx *core.Context, optFns ...request.OptFn) *RoomListReqCall {
+ return &RoomListReqCall{
ctx: ctx,
- districts: districts,
+ rooms: rooms,
queryParams: map[string]interface{}{},
optFns: optFns,
}
}
-type CountryListReqCall struct {
- ctx *core.Context
- countrys *CountryService
- optFns []request.OptFn
-}
-
-func (rc *CountryListReqCall) Do() (*CountryListResult, error) {
- var result = &CountryListResult{}
- req := request.NewRequest("meeting_room/country/list", "GET",
- []request.AccessTokenType{request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
- err := api.Send(rc.ctx, rc.countrys.service.conf, req)
- return result, err
-}
-
-func (countrys *CountryService) List(ctx *core.Context, optFns ...request.OptFn) *CountryListReqCall {
- return &CountryListReqCall{
- ctx: ctx,
- countrys: countrys,
- optFns: optFns,
- }
-}
-
type InstanceReplyReqCall struct {
ctx *core.Context
instances *InstanceService
@@ -532,7 +532,7 @@ type InstanceReplyReqCall struct {
func (rc *InstanceReplyReqCall) Do() (*response.NoData, error) {
var result = &response.NoData{}
- req := request.NewRequest("meeting_room/instance/reply", "POST",
+ req := request.NewRequest("/open-apis/meeting_room/instance/reply", "POST",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.instances.service.conf, req)
return result, err
@@ -547,30 +547,6 @@ func (instances *InstanceService) Reply(ctx *core.Context, body *InstanceReplyRe
}
}
-type BuildingUpdateReqCall struct {
- ctx *core.Context
- buildings *BuildingService
- body *BuildingUpdateReqBody
- optFns []request.OptFn
-}
-
-func (rc *BuildingUpdateReqCall) Do() (*response.NoData, error) {
- var result = &response.NoData{}
- req := request.NewRequest("meeting_room/building/update", "POST",
- []request.AccessTokenType{request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
- err := api.Send(rc.ctx, rc.buildings.service.conf, req)
- return result, err
-}
-
-func (buildings *BuildingService) Update(ctx *core.Context, body *BuildingUpdateReqBody, optFns ...request.OptFn) *BuildingUpdateReqCall {
- return &BuildingUpdateReqCall{
- ctx: ctx,
- buildings: buildings,
- body: body,
- optFns: optFns,
- }
-}
-
type RoomUpdateReqCall struct {
ctx *core.Context
rooms *RoomService
@@ -580,7 +556,7 @@ type RoomUpdateReqCall struct {
func (rc *RoomUpdateReqCall) Do() (*response.NoData, error) {
var result = &response.NoData{}
- req := request.NewRequest("meeting_room/room/update", "POST",
+ req := request.NewRequest("/open-apis/meeting_room/room/update", "POST",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.rooms.service.conf, req)
return result, err
@@ -594,3 +570,27 @@ func (rooms *RoomService) Update(ctx *core.Context, body *RoomUpdateReqBody, opt
optFns: optFns,
}
}
+
+type BuildingUpdateReqCall struct {
+ ctx *core.Context
+ buildings *BuildingService
+ body *BuildingUpdateReqBody
+ optFns []request.OptFn
+}
+
+func (rc *BuildingUpdateReqCall) Do() (*response.NoData, error) {
+ var result = &response.NoData{}
+ req := request.NewRequest("/open-apis/meeting_room/building/update", "POST",
+ []request.AccessTokenType{request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
+ err := api.Send(rc.ctx, rc.buildings.service.conf, req)
+ return result, err
+}
+
+func (buildings *BuildingService) Update(ctx *core.Context, body *BuildingUpdateReqBody, optFns ...request.OptFn) *BuildingUpdateReqCall {
+ return &BuildingUpdateReqCall{
+ ctx: ctx,
+ buildings: buildings,
+ body: body,
+ optFns: optFns,
+ }
+}
diff --git a/service/meeting_room/v1/model.go b/service/meeting_room/v1/model.go
index 0f15c18a..99b401bc 100644
--- a/service/meeting_room/v1/model.go
+++ b/service/meeting_room/v1/model.go
@@ -188,6 +188,10 @@ type SummaryBatchGetResult struct {
ErrorEventUids []*ErrorEventUid `json:"ErrorEventUids,omitempty"`
}
+type RoomBatchGetResult struct {
+ Rooms []*Room `json:"rooms,omitempty"`
+}
+
type FreebusyBatchGetResult struct {
TimeMin string `json:"time_min,omitempty"`
TimeMax string `json:"time_max,omitempty"`
@@ -198,10 +202,6 @@ type BuildingBatchGetResult struct {
Buildings []*Building `json:"buildings,omitempty"`
}
-type RoomBatchGetResult struct {
- Rooms []*Room `json:"rooms,omitempty"`
-}
-
type BuildingBatchGetIdResult struct {
Buildings []*BuildingId `json:"buildings,omitempty"`
}
@@ -210,6 +210,25 @@ type RoomBatchGetIdResult struct {
Rooms []*RoomId `json:"rooms,omitempty"`
}
+type BuildingCreateReqBody struct {
+ Name string `json:"name,omitempty"`
+ Floors []string `json:"floors,omitempty"`
+ CountryId string `json:"country_id,omitempty"`
+ DistrictId string `json:"district_id,omitempty"`
+ CustomBuildingId string `json:"custom_building_id,omitempty"`
+ ForceSendFields []string `json:"-"`
+}
+
+func (s *BuildingCreateReqBody) MarshalJSON() ([]byte, error) {
+ type cp BuildingCreateReqBody
+ raw := cp(*s)
+ return tools.MarshalJSON(raw, s.ForceSendFields)
+}
+
+type BuildingCreateResult struct {
+ BuildingId string `json:"building_id,omitempty"`
+}
+
type RoomCreateReqBody struct {
BuildingId string `json:"building_id,omitempty"`
Floor string `json:"floor,omitempty"`
@@ -230,25 +249,6 @@ type RoomCreateResult struct {
RoomId string `json:"room_id,omitempty"`
}
-type BuildingCreateReqBody struct {
- Name string `json:"name,omitempty"`
- Floors []string `json:"floors,omitempty"`
- CountryId string `json:"country_id,omitempty"`
- DistrictId string `json:"district_id,omitempty"`
- CustomBuildingId string `json:"custom_building_id,omitempty"`
- ForceSendFields []string `json:"-"`
-}
-
-func (s *BuildingCreateReqBody) MarshalJSON() ([]byte, error) {
- type cp BuildingCreateReqBody
- raw := cp(*s)
- return tools.MarshalJSON(raw, s.ForceSendFields)
-}
-
-type BuildingCreateResult struct {
- BuildingId string `json:"building_id,omitempty"`
-}
-
type BuildingDeleteReqBody struct {
BuildingId string `json:"building_id,omitempty"`
ForceSendFields []string `json:"-"`
@@ -271,10 +271,12 @@ func (s *RoomDeleteReqBody) MarshalJSON() ([]byte, error) {
return tools.MarshalJSON(raw, s.ForceSendFields)
}
-type RoomListResult struct {
- PageToken string `json:"page_token,omitempty"`
- HasMore bool `json:"has_more,omitempty"`
- Rooms []*Room `json:"rooms,omitempty"`
+type DistrictListResult struct {
+ Districts []*District `json:"districts,omitempty"`
+}
+
+type CountryListResult struct {
+ Countries []*Country `json:"countries,omitempty"`
}
type BuildingListResult struct {
@@ -283,12 +285,10 @@ type BuildingListResult struct {
Buildings []*Building `json:"buildings,omitempty"`
}
-type DistrictListResult struct {
- Districts []*District `json:"districts,omitempty"`
-}
-
-type CountryListResult struct {
- Countries []*Country `json:"countries,omitempty"`
+type RoomListResult struct {
+ PageToken string `json:"page_token,omitempty"`
+ HasMore bool `json:"has_more,omitempty"`
+ Rooms []*Room `json:"rooms,omitempty"`
}
type InstanceReplyReqBody struct {
@@ -305,6 +305,21 @@ func (s *InstanceReplyReqBody) MarshalJSON() ([]byte, error) {
return tools.MarshalJSON(raw, s.ForceSendFields)
}
+type RoomUpdateReqBody struct {
+ RoomId string `json:"room_id,omitempty"`
+ Name string `json:"name,omitempty"`
+ Capacity int `json:"capacity,omitempty"`
+ IsDisabled bool `json:"is_disabled,omitempty"`
+ CustomRoomId string `json:"custom_room_id,omitempty"`
+ ForceSendFields []string `json:"-"`
+}
+
+func (s *RoomUpdateReqBody) MarshalJSON() ([]byte, error) {
+ type cp RoomUpdateReqBody
+ raw := cp(*s)
+ return tools.MarshalJSON(raw, s.ForceSendFields)
+}
+
type BuildingUpdateReqBody struct {
BuildingId string `json:"building_id,omitempty"`
Name string `json:"name,omitempty"`
@@ -321,21 +336,6 @@ func (s *BuildingUpdateReqBody) MarshalJSON() ([]byte, error) {
return tools.MarshalJSON(raw, s.ForceSendFields)
}
-type RoomUpdateReqBody struct {
- RoomId string `json:"room_id,omitempty"`
- Name string `json:"name,omitempty"`
- Capacity int `json:"capacity,omitempty"`
- IsDisabled bool `json:"is_disabled,omitempty"`
- CustomRoomId string `json:"custom_room_id,omitempty"`
- ForceSendFields []string `json:"-"`
-}
-
-func (s *RoomUpdateReqBody) MarshalJSON() ([]byte, error) {
- type cp RoomUpdateReqBody
- raw := cp(*s)
- return tools.MarshalJSON(raw, s.ForceSendFields)
-}
-
type RoomCreatedEventData struct {
RoomId string `json:"room_id,omitempty"`
RoomName string `json:"room_name,omitempty"`
diff --git a/service/optical_char_recognition/v1/api.go b/service/optical_char_recognition/v1/api.go
index f4b51c92..4a872b4c 100644
--- a/service/optical_char_recognition/v1/api.go
+++ b/service/optical_char_recognition/v1/api.go
@@ -40,7 +40,7 @@ type ImageBasicRecognizeReqCall struct {
func (rc *ImageBasicRecognizeReqCall) Do() (*ImageBasicRecognizeResult, error) {
var result = &ImageBasicRecognizeResult{}
- req := request.NewRequest("optical_char_recognition/v1/image/basic_recognize", "POST",
+ req := request.NewRequest("/open-apis/optical_char_recognition/v1/image/basic_recognize", "POST",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.images.service.conf, req)
return result, err
diff --git a/service/optical_char_recognition/v1/model.go b/service/optical_char_recognition/v1/model.go
index cfd9aa29..b0dc568b 100644
--- a/service/optical_char_recognition/v1/model.go
+++ b/service/optical_char_recognition/v1/model.go
@@ -10,7 +10,6 @@ type Image struct {
type ImageBasicRecognizeReqBody struct {
Image string `json:"image,omitempty"`
- ImageKey string `json:"image_key,omitempty"`
ForceSendFields []string `json:"-"`
}
diff --git a/service/sheets/v2/api.go b/service/sheets/v2/api.go
index b78ac0e4..82b6c989 100644
--- a/service/sheets/v2/api.go
+++ b/service/sheets/v2/api.go
@@ -47,7 +47,7 @@ func (rc *SpreadsheetsConditionFormatsBatchCreateReqCall) SetSpreadsheetToken(sp
func (rc *SpreadsheetsConditionFormatsBatchCreateReqCall) Do() (*SpreadsheetsConditionFormatsBatchCreateResult, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &SpreadsheetsConditionFormatsBatchCreateResult{}
- req := request.NewRequest("sheets/v2/spreadsheets/:spreadsheetToken/condition_formats/batch_create", "POST",
+ req := request.NewRequest("/open-apis/sheets/v2/spreadsheets/:spreadsheetToken/condition_formats/batch_create", "POST",
[]request.AccessTokenType{request.AccessTokenTypeTenant, request.AccessTokenTypeUser}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.spreadsheetss.service.conf, req)
return result, err
@@ -78,7 +78,7 @@ func (rc *SpreadsheetsConditionFormatsBatchDeleteReqCall) SetSpreadsheetToken(sp
func (rc *SpreadsheetsConditionFormatsBatchDeleteReqCall) Do() (*SpreadsheetsConditionFormatsBatchDeleteResult, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &SpreadsheetsConditionFormatsBatchDeleteResult{}
- req := request.NewRequest("sheets/v2/spreadsheets/:spreadsheetToken/condition_formats/batch_delete", "DELETE",
+ req := request.NewRequest("/open-apis/sheets/v2/spreadsheets/:spreadsheetToken/condition_formats/batch_delete", "DELETE",
[]request.AccessTokenType{request.AccessTokenTypeTenant, request.AccessTokenTypeUser}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.spreadsheetss.service.conf, req)
return result, err
@@ -113,7 +113,7 @@ func (rc *SpreadsheetsConditionFormatsBatchGetReqCall) Do() (*SpreadsheetsCondit
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &SpreadsheetsConditionFormatsBatchGetResult{}
- req := request.NewRequest("sheets/v2/spreadsheets/:spreadsheetToken/condition_formats", "GET",
+ req := request.NewRequest("/open-apis/sheets/v2/spreadsheets/:spreadsheetToken/condition_formats", "GET",
[]request.AccessTokenType{request.AccessTokenTypeTenant, request.AccessTokenTypeUser}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.spreadsheetss.service.conf, req)
return result, err
@@ -144,7 +144,7 @@ func (rc *SpreadsheetsConditionFormatsBatchUpdateReqCall) SetSpreadsheetToken(sp
func (rc *SpreadsheetsConditionFormatsBatchUpdateReqCall) Do() (*SpreadsheetsConditionFormatsBatchUpdateResult, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &SpreadsheetsConditionFormatsBatchUpdateResult{}
- req := request.NewRequest("sheets/v2/spreadsheets/:spreadsheetToken/condition_formats/batch_update", "POST",
+ req := request.NewRequest("/open-apis/sheets/v2/spreadsheets/:spreadsheetToken/condition_formats/batch_update", "POST",
[]request.AccessTokenType{request.AccessTokenTypeTenant, request.AccessTokenTypeUser}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.spreadsheetss.service.conf, req)
return result, err
@@ -175,7 +175,7 @@ func (rc *SpreadsheetsDataValidationCreateReqCall) SetSpreadsheetToken(spreadshe
func (rc *SpreadsheetsDataValidationCreateReqCall) Do() (*response.NoData, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &response.NoData{}
- req := request.NewRequest("sheets/v2/spreadsheets/:spreadsheetToken/dataValidation", "POST",
+ req := request.NewRequest("/open-apis/sheets/v2/spreadsheets/:spreadsheetToken/dataValidation", "POST",
[]request.AccessTokenType{request.AccessTokenTypeTenant, request.AccessTokenTypeUser}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.spreadsheetss.service.conf, req)
return result, err
@@ -206,7 +206,7 @@ func (rc *SpreadsheetsDataValidationDeleteReqCall) SetSpreadsheetToken(spreadshe
func (rc *SpreadsheetsDataValidationDeleteReqCall) Do() (*SpreadsheetsDataValidationDeleteResult, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &SpreadsheetsDataValidationDeleteResult{}
- req := request.NewRequest("sheets/v2/spreadsheets/:spreadsheetToken/dataValidation", "DELETE",
+ req := request.NewRequest("/open-apis/sheets/v2/spreadsheets/:spreadsheetToken/dataValidation", "DELETE",
[]request.AccessTokenType{request.AccessTokenTypeTenant, request.AccessTokenTypeUser}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.spreadsheetss.service.conf, req)
return result, err
@@ -242,7 +242,7 @@ func (rc *SpreadsheetsDataValidationGetReqCall) SetDataValidationType(dataValida
func (rc *SpreadsheetsDataValidationGetReqCall) Do() (*SpreadsheetsDataValidationGetResult, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &SpreadsheetsDataValidationGetResult{}
- req := request.NewRequest("sheets/v2/spreadsheets/:spreadsheetToken/dataValidation", "GET",
+ req := request.NewRequest("/open-apis/sheets/v2/spreadsheets/:spreadsheetToken/dataValidation", "GET",
[]request.AccessTokenType{request.AccessTokenTypeTenant, request.AccessTokenTypeUser}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.spreadsheetss.service.conf, req)
return result, err
@@ -278,7 +278,7 @@ func (rc *SpreadsheetsDataValidationUpdateReqCall) SetDataValidationId(dataValid
func (rc *SpreadsheetsDataValidationUpdateReqCall) Do() (*SpreadsheetsDataValidationUpdateResult, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &SpreadsheetsDataValidationUpdateResult{}
- req := request.NewRequest("sheets/v2/spreadsheets/:spreadsheetToken/dataValidation/:sheetId/:dataValidationId", "PUT",
+ req := request.NewRequest("/open-apis/sheets/v2/spreadsheets/:spreadsheetToken/dataValidation/:sheetId/:dataValidationId", "PUT",
[]request.AccessTokenType{request.AccessTokenTypeTenant, request.AccessTokenTypeUser}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.spreadsheetss.service.conf, req)
return result, err
@@ -309,7 +309,7 @@ func (rc *SpreadsheetsDimensionRangeAddReqCall) SetSpreadsheetToken(spreadsheetT
func (rc *SpreadsheetsDimensionRangeAddReqCall) Do() (*SpreadsheetsDimensionRangeAddResult, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &SpreadsheetsDimensionRangeAddResult{}
- req := request.NewRequest("sheets/v2/spreadsheets/:spreadsheetToken/dimension_range", "POST",
+ req := request.NewRequest("/open-apis/sheets/v2/spreadsheets/:spreadsheetToken/dimension_range", "POST",
[]request.AccessTokenType{request.AccessTokenTypeTenant, request.AccessTokenTypeUser}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.spreadsheetss.service.conf, req)
return result, err
@@ -340,7 +340,7 @@ func (rc *SpreadsheetsDimensionRangeDeleteReqCall) SetSpreadsheetToken(spreadshe
func (rc *SpreadsheetsDimensionRangeDeleteReqCall) Do() (*SpreadsheetsDimensionRangeDeleteResult, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &SpreadsheetsDimensionRangeDeleteResult{}
- req := request.NewRequest("sheets/v2/spreadsheets/:spreadsheetToken/dimension_range", "DELETE",
+ req := request.NewRequest("/open-apis/sheets/v2/spreadsheets/:spreadsheetToken/dimension_range", "DELETE",
[]request.AccessTokenType{request.AccessTokenTypeTenant, request.AccessTokenTypeUser}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.spreadsheetss.service.conf, req)
return result, err
@@ -371,7 +371,7 @@ func (rc *SpreadsheetsDimensionRangeUpdateReqCall) SetSpreadsheetToken(spreadshe
func (rc *SpreadsheetsDimensionRangeUpdateReqCall) Do() (*response.NoData, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &response.NoData{}
- req := request.NewRequest("sheets/v2/spreadsheets/:spreadsheetToken/dimension_range", "PUT",
+ req := request.NewRequest("/open-apis/sheets/v2/spreadsheets/:spreadsheetToken/dimension_range", "PUT",
[]request.AccessTokenType{request.AccessTokenTypeTenant, request.AccessTokenTypeUser}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.spreadsheetss.service.conf, req)
return result, err
@@ -396,7 +396,7 @@ type SpreadsheetsImportReqCall struct {
func (rc *SpreadsheetsImportReqCall) Do() (*SpreadsheetsImportResult, error) {
var result = &SpreadsheetsImportResult{}
- req := request.NewRequest("sheets/v2/import", "POST",
+ req := request.NewRequest("/open-apis/sheets/v2/import", "POST",
[]request.AccessTokenType{request.AccessTokenTypeTenant, request.AccessTokenTypeUser}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.spreadsheetss.service.conf, req)
return result, err
@@ -425,7 +425,7 @@ func (rc *SpreadsheetsImportResultReqCall) SetTicket(ticket string) {
func (rc *SpreadsheetsImportResultReqCall) Do() (*SpreadsheetsImportResultResult, error) {
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &SpreadsheetsImportResultResult{}
- req := request.NewRequest("sheets/v2/import/result", "GET",
+ req := request.NewRequest("/open-apis/sheets/v2/import/result", "GET",
[]request.AccessTokenType{request.AccessTokenTypeTenant, request.AccessTokenTypeUser}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.spreadsheetss.service.conf, req)
return result, err
@@ -455,7 +455,7 @@ func (rc *SpreadsheetsInsertDimensionRangeReqCall) SetSpreadsheetToken(spreadshe
func (rc *SpreadsheetsInsertDimensionRangeReqCall) Do() (*response.NoData, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &response.NoData{}
- req := request.NewRequest("sheets/v2/spreadsheets/:spreadsheetToken/insert_dimension_range", "POST",
+ req := request.NewRequest("/open-apis/sheets/v2/spreadsheets/:spreadsheetToken/insert_dimension_range", "POST",
[]request.AccessTokenType{request.AccessTokenTypeTenant, request.AccessTokenTypeUser}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.spreadsheetss.service.conf, req)
return result, err
@@ -486,7 +486,7 @@ func (rc *SpreadsheetsMergeCellsReqCall) SetSpreadsheetToken(spreadsheetToken st
func (rc *SpreadsheetsMergeCellsReqCall) Do() (*SpreadsheetsMergeCellsResult, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &SpreadsheetsMergeCellsResult{}
- req := request.NewRequest("sheets/v2/spreadsheets/:spreadsheetToken/merge_cells", "POST",
+ req := request.NewRequest("/open-apis/sheets/v2/spreadsheets/:spreadsheetToken/merge_cells", "POST",
[]request.AccessTokenType{request.AccessTokenTypeTenant, request.AccessTokenTypeUser}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.spreadsheetss.service.conf, req)
return result, err
@@ -521,7 +521,7 @@ func (rc *SpreadsheetsMetainfoReqCall) Do() (*SpreadsheetsMetainfoResult, error)
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &SpreadsheetsMetainfoResult{}
- req := request.NewRequest("sheets/v2/spreadsheets/:spreadsheetToken/metainfo", "GET",
+ req := request.NewRequest("/open-apis/sheets/v2/spreadsheets/:spreadsheetToken/metainfo", "GET",
[]request.AccessTokenType{request.AccessTokenTypeTenant, request.AccessTokenTypeUser}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.spreadsheetss.service.conf, req)
return result, err
@@ -552,7 +552,7 @@ func (rc *SpreadsheetsProtectedRangeBatchCreateReqCall) SetSpreadsheetToken(spre
func (rc *SpreadsheetsProtectedRangeBatchCreateReqCall) Do() (*SpreadsheetsProtectedRangeBatchCreateResult, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &SpreadsheetsProtectedRangeBatchCreateResult{}
- req := request.NewRequest("sheets/v2/spreadsheets/:spreadsheetToken/protected_dimension", "POST",
+ req := request.NewRequest("/open-apis/sheets/v2/spreadsheets/:spreadsheetToken/protected_dimension", "POST",
[]request.AccessTokenType{request.AccessTokenTypeTenant, request.AccessTokenTypeUser}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.spreadsheetss.service.conf, req)
return result, err
@@ -583,7 +583,7 @@ func (rc *SpreadsheetsProtectedRangeBatchDeleteReqCall) SetSpreadsheetToken(spre
func (rc *SpreadsheetsProtectedRangeBatchDeleteReqCall) Do() (*SpreadsheetsProtectedRangeBatchDeleteResult, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &SpreadsheetsProtectedRangeBatchDeleteResult{}
- req := request.NewRequest("sheets/v2/spreadsheets/:spreadsheetToken/protected_range_batch_del", "DELETE",
+ req := request.NewRequest("/open-apis/sheets/v2/spreadsheets/:spreadsheetToken/protected_range_batch_del", "DELETE",
[]request.AccessTokenType{request.AccessTokenTypeTenant, request.AccessTokenTypeUser}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.spreadsheetss.service.conf, req)
return result, err
@@ -621,7 +621,7 @@ func (rc *SpreadsheetsProtectedRangeBatchGetReqCall) Do() (*SpreadsheetsProtecte
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &SpreadsheetsProtectedRangeBatchGetResult{}
- req := request.NewRequest("sheets/v2/spreadsheets/:spreadsheetToken/protected_range_batch_get", "GET",
+ req := request.NewRequest("/open-apis/sheets/v2/spreadsheets/:spreadsheetToken/protected_range_batch_get", "GET",
[]request.AccessTokenType{request.AccessTokenTypeTenant, request.AccessTokenTypeUser}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.spreadsheetss.service.conf, req)
return result, err
@@ -652,7 +652,7 @@ func (rc *SpreadsheetsProtectedRangeBatchUpdateReqCall) SetSpreadsheetToken(spre
func (rc *SpreadsheetsProtectedRangeBatchUpdateReqCall) Do() (*SpreadsheetsProtectedRangeBatchUpdateResult, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &SpreadsheetsProtectedRangeBatchUpdateResult{}
- req := request.NewRequest("sheets/v2/spreadsheets/:spreadsheetToken/protected_range_batch_update", "POST",
+ req := request.NewRequest("/open-apis/sheets/v2/spreadsheets/:spreadsheetToken/protected_range_batch_update", "POST",
[]request.AccessTokenType{request.AccessTokenTypeTenant, request.AccessTokenTypeUser}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.spreadsheetss.service.conf, req)
return result, err
@@ -683,7 +683,7 @@ func (rc *SpreadsheetsSheetsBatchUpdateReqCall) SetSpreadsheetToken(spreadsheetT
func (rc *SpreadsheetsSheetsBatchUpdateReqCall) Do() (*SpreadsheetsSheetsBatchUpdateResult, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &SpreadsheetsSheetsBatchUpdateResult{}
- req := request.NewRequest("sheets/v2/spreadsheets/:spreadsheetToken/sheets_batch_update", "POST",
+ req := request.NewRequest("/open-apis/sheets/v2/spreadsheets/:spreadsheetToken/sheets_batch_update", "POST",
[]request.AccessTokenType{request.AccessTokenTypeTenant, request.AccessTokenTypeUser}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.spreadsheetss.service.conf, req)
return result, err
@@ -714,7 +714,7 @@ func (rc *SpreadsheetsSheetsUpdatePropertiesReqCall) SetSpreadsheetToken(spreads
func (rc *SpreadsheetsSheetsUpdatePropertiesReqCall) Do() (*SpreadsheetsSheetsUpdatePropertiesResult, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &SpreadsheetsSheetsUpdatePropertiesResult{}
- req := request.NewRequest("sheets/v2/spreadsheets/:spreadsheetToken/properties", "PUT",
+ req := request.NewRequest("/open-apis/sheets/v2/spreadsheets/:spreadsheetToken/properties", "PUT",
[]request.AccessTokenType{request.AccessTokenTypeTenant, request.AccessTokenTypeUser}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.spreadsheetss.service.conf, req)
return result, err
@@ -745,7 +745,7 @@ func (rc *SpreadsheetsStyleUpdateReqCall) SetSpreadsheetToken(spreadsheetToken s
func (rc *SpreadsheetsStyleUpdateReqCall) Do() (*SpreadsheetsStyleUpdateResult, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &SpreadsheetsStyleUpdateResult{}
- req := request.NewRequest("sheets/v2/spreadsheets/:spreadsheetToken/style", "PUT",
+ req := request.NewRequest("/open-apis/sheets/v2/spreadsheets/:spreadsheetToken/style", "PUT",
[]request.AccessTokenType{request.AccessTokenTypeTenant, request.AccessTokenTypeUser}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.spreadsheetss.service.conf, req)
return result, err
@@ -776,7 +776,7 @@ func (rc *SpreadsheetsStylesBatchUpdateReqCall) SetSpreadsheetToken(spreadsheetT
func (rc *SpreadsheetsStylesBatchUpdateReqCall) Do() (*SpreadsheetsStylesBatchUpdateResult, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &SpreadsheetsStylesBatchUpdateResult{}
- req := request.NewRequest("sheets/v2/spreadsheets/:spreadsheetToken/styles_batch_update", "PUT",
+ req := request.NewRequest("/open-apis/sheets/v2/spreadsheets/:spreadsheetToken/styles_batch_update", "PUT",
[]request.AccessTokenType{request.AccessTokenTypeTenant, request.AccessTokenTypeUser}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.spreadsheetss.service.conf, req)
return result, err
@@ -807,7 +807,7 @@ func (rc *SpreadsheetsUnmergeCellsReqCall) SetSpreadsheetToken(spreadsheetToken
func (rc *SpreadsheetsUnmergeCellsReqCall) Do() (*SpreadsheetsUnmergeCellsResult, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &SpreadsheetsUnmergeCellsResult{}
- req := request.NewRequest("sheets/v2/spreadsheets/:spreadsheetToken/unmerge_cells", "POST",
+ req := request.NewRequest("/open-apis/sheets/v2/spreadsheets/:spreadsheetToken/unmerge_cells", "POST",
[]request.AccessTokenType{request.AccessTokenTypeTenant, request.AccessTokenTypeUser}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.spreadsheetss.service.conf, req)
return result, err
@@ -843,7 +843,7 @@ func (rc *SpreadsheetsValuesAppendReqCall) Do() (*SpreadsheetsValuesAppendResult
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &SpreadsheetsValuesAppendResult{}
- req := request.NewRequest("sheets/v2/spreadsheets/:spreadsheetToken/values_append", "POST",
+ req := request.NewRequest("/open-apis/sheets/v2/spreadsheets/:spreadsheetToken/values_append", "POST",
[]request.AccessTokenType{request.AccessTokenTypeTenant, request.AccessTokenTypeUser}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.spreadsheetss.service.conf, req)
return result, err
@@ -885,7 +885,7 @@ func (rc *SpreadsheetsValuesBatchGetReqCall) Do() (*SpreadsheetsValuesBatchGetRe
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &SpreadsheetsValuesBatchGetResult{}
- req := request.NewRequest("sheets/v2/spreadsheets/:spreadsheetToken/values_batch_get", "GET",
+ req := request.NewRequest("/open-apis/sheets/v2/spreadsheets/:spreadsheetToken/values_batch_get", "GET",
[]request.AccessTokenType{request.AccessTokenTypeTenant, request.AccessTokenTypeUser}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.spreadsheetss.service.conf, req)
return result, err
@@ -916,7 +916,7 @@ func (rc *SpreadsheetsValuesBatchUpdateReqCall) SetSpreadsheetToken(spreadsheetT
func (rc *SpreadsheetsValuesBatchUpdateReqCall) Do() (*SpreadsheetsValuesBatchUpdateResult, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &SpreadsheetsValuesBatchUpdateResult{}
- req := request.NewRequest("sheets/v2/spreadsheets/:spreadsheetToken/values_batch_update", "POST",
+ req := request.NewRequest("/open-apis/sheets/v2/spreadsheets/:spreadsheetToken/values_batch_update", "POST",
[]request.AccessTokenType{request.AccessTokenTypeTenant, request.AccessTokenTypeUser}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.spreadsheetss.service.conf, req)
return result, err
@@ -957,7 +957,7 @@ func (rc *SpreadsheetsValuesGetReqCall) Do() (*SpreadsheetsValuesGetResult, erro
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &SpreadsheetsValuesGetResult{}
- req := request.NewRequest("sheets/v2/spreadsheets/:spreadsheetToken/values/:range", "GET",
+ req := request.NewRequest("/open-apis/sheets/v2/spreadsheets/:spreadsheetToken/values/:range", "GET",
[]request.AccessTokenType{request.AccessTokenTypeTenant, request.AccessTokenTypeUser}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.spreadsheetss.service.conf, req)
return result, err
@@ -988,7 +988,7 @@ func (rc *SpreadsheetsValuesImageReqCall) SetSpreadsheetToken(spreadsheetToken s
func (rc *SpreadsheetsValuesImageReqCall) Do() (*SpreadsheetsValuesImageResult, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &SpreadsheetsValuesImageResult{}
- req := request.NewRequest("sheets/v2/spreadsheets/:spreadsheetToken/values_image", "POST",
+ req := request.NewRequest("/open-apis/sheets/v2/spreadsheets/:spreadsheetToken/values_image", "POST",
[]request.AccessTokenType{request.AccessTokenTypeTenant, request.AccessTokenTypeUser}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.spreadsheetss.service.conf, req)
return result, err
@@ -1019,7 +1019,7 @@ func (rc *SpreadsheetsValuesPrependReqCall) SetSpreadsheetToken(spreadsheetToken
func (rc *SpreadsheetsValuesPrependReqCall) Do() (*SpreadsheetsValuesPrependResult, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &SpreadsheetsValuesPrependResult{}
- req := request.NewRequest("sheets/v2/spreadsheets/:spreadsheetToken/values_prepend", "POST",
+ req := request.NewRequest("/open-apis/sheets/v2/spreadsheets/:spreadsheetToken/values_prepend", "POST",
[]request.AccessTokenType{request.AccessTokenTypeTenant, request.AccessTokenTypeUser}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.spreadsheetss.service.conf, req)
return result, err
@@ -1050,7 +1050,7 @@ func (rc *SpreadsheetsValuesUpdateReqCall) SetSpreadsheetToken(spreadsheetToken
func (rc *SpreadsheetsValuesUpdateReqCall) Do() (*SpreadsheetsValuesUpdateResult, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &SpreadsheetsValuesUpdateResult{}
- req := request.NewRequest("sheets/v2/spreadsheets/:spreadsheetToken/values", "PUT",
+ req := request.NewRequest("/open-apis/sheets/v2/spreadsheets/:spreadsheetToken/values", "PUT",
[]request.AccessTokenType{request.AccessTokenTypeTenant, request.AccessTokenTypeUser}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.spreadsheetss.service.conf, req)
return result, err
diff --git a/service/sheets/v2/model.go b/service/sheets/v2/model.go
index 7fa8048b..6dfc8b46 100644
--- a/service/sheets/v2/model.go
+++ b/service/sheets/v2/model.go
@@ -147,6 +147,17 @@ func (s *CopySheet) MarshalJSON() ([]byte, error) {
return tools.MarshalJSON(raw, s.ForceSendFields)
}
+type CopySheetReply struct {
+ Properties *Properties `json:"properties,omitempty"`
+ ForceSendFields []string `json:"-"`
+}
+
+func (s *CopySheetReply) MarshalJSON() ([]byte, error) {
+ type cp CopySheetReply
+ raw := cp(*s)
+ return tools.MarshalJSON(raw, s.ForceSendFields)
+}
+
type DataValidationDeleteResult struct {
Range string `json:"range,omitempty"`
Msg string `json:"msg,omitempty"`
@@ -363,7 +374,7 @@ func (s *Properties) MarshalJSON() ([]byte, error) {
type Protect struct {
Lock string `json:"lock,omitempty"`
LockInfo string `json:"lockInfo,omitempty"`
- UserIds []int `json:"userIds,omitempty"`
+ UserIds []int64 `json:"userIds,omitempty"`
ForceSendFields []string `json:"-"`
}
@@ -405,8 +416,8 @@ func (s *ProtectedRangeUpdate) MarshalJSON() ([]byte, error) {
type Reply struct {
UpdateSheet *Properties `json:"updateSheet,omitempty"`
- AddSheet *Properties `json:"addSheet,omitempty"`
- CopySheet *Properties `json:"copySheet,omitempty"`
+ AddSheet *AddSheet `json:"addSheet,omitempty"`
+ CopySheet *CopySheetReply `json:"copySheet,omitempty"`
DeleteSheet *DeleteSheetReply `json:"deleteSheet,omitempty"`
ForceSendFields []string `json:"-"`
}
@@ -421,7 +432,7 @@ type Requests struct {
AddSheet *AddSheet `json:"addSheet,omitempty"`
CopySheet *CopySheet `json:"copySheet,omitempty"`
DeleteSheet *DeleteSheet `json:"deleteSheet,omitempty"`
- UpdateSheet *Properties `json:"updateSheet,omitempty"`
+ UpdateSheet *UpdateSheet `json:"updateSheet,omitempty"`
ForceSendFields []string `json:"-"`
}
@@ -535,6 +546,17 @@ func (s *UpdateResponse) MarshalJSON() ([]byte, error) {
return tools.MarshalJSON(raw, s.ForceSendFields)
}
+type UpdateSheet struct {
+ Properties *Properties `json:"properties,omitempty"`
+ ForceSendFields []string `json:"-"`
+}
+
+func (s *UpdateSheet) MarshalJSON() ([]byte, error) {
+ type cp UpdateSheet
+ raw := cp(*s)
+ return tools.MarshalJSON(raw, s.ForceSendFields)
+}
+
type Updates struct {
SpreadsheetToken string `json:"spreadsheetToken,omitempty"`
UpdatedRange string `json:"updatedRange,omitempty"`
diff --git a/service/speech_to_text/v1/api.go b/service/speech_to_text/v1/api.go
index 8e6f044d..c0c7d24d 100644
--- a/service/speech_to_text/v1/api.go
+++ b/service/speech_to_text/v1/api.go
@@ -40,7 +40,7 @@ type SpeechFileRecognizeReqCall struct {
func (rc *SpeechFileRecognizeReqCall) Do() (*SpeechFileRecognizeResult, error) {
var result = &SpeechFileRecognizeResult{}
- req := request.NewRequest("speech_to_text/v1/speech/file_recognize", "POST",
+ req := request.NewRequest("/open-apis/speech_to_text/v1/speech/file_recognize", "POST",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.speechs.service.conf, req)
return result, err
@@ -64,7 +64,7 @@ type SpeechStreamRecognizeReqCall struct {
func (rc *SpeechStreamRecognizeReqCall) Do() (*SpeechStreamRecognizeResult, error) {
var result = &SpeechStreamRecognizeResult{}
- req := request.NewRequest("speech_to_text/v1/speech/stream_recognize", "POST",
+ req := request.NewRequest("/open-apis/speech_to_text/v1/speech/stream_recognize", "POST",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.speechs.service.conf, req)
return result, err
diff --git a/service/speech_to_text/v1/model.go b/service/speech_to_text/v1/model.go
index 71a0977c..cf175e62 100644
--- a/service/speech_to_text/v1/model.go
+++ b/service/speech_to_text/v1/model.go
@@ -18,6 +18,18 @@ func (s *FileConfig) MarshalJSON() ([]byte, error) {
return tools.MarshalJSON(raw, s.ForceSendFields)
}
+type Speech struct {
+ Speech string `json:"speech,omitempty"`
+ SpeechKey string `json:"speech_key,omitempty"`
+ ForceSendFields []string `json:"-"`
+}
+
+func (s *Speech) MarshalJSON() ([]byte, error) {
+ type cp Speech
+ raw := cp(*s)
+ return tools.MarshalJSON(raw, s.ForceSendFields)
+}
+
type StreamConfig struct {
StreamId string `json:"stream_id,omitempty"`
SequenceId int `json:"sequence_id,omitempty"`
@@ -33,18 +45,6 @@ func (s *StreamConfig) MarshalJSON() ([]byte, error) {
return tools.MarshalJSON(raw, s.ForceSendFields)
}
-type Speech struct {
- Speech string `json:"speech,omitempty"`
- SpeechKey string `json:"speech_key,omitempty"`
- ForceSendFields []string `json:"-"`
-}
-
-func (s *Speech) MarshalJSON() ([]byte, error) {
- type cp Speech
- raw := cp(*s)
- return tools.MarshalJSON(raw, s.ForceSendFields)
-}
-
type SpeechFileRecognizeReqBody struct {
Speech *Speech `json:"speech,omitempty"`
Config *FileConfig `json:"config,omitempty"`
diff --git a/service/suite/v1/api.go b/service/suite/v1/api.go
index 913e974a..5524b5c8 100644
--- a/service/suite/v1/api.go
+++ b/service/suite/v1/api.go
@@ -40,7 +40,7 @@ type DocsApiMetaReqCall struct {
func (rc *DocsApiMetaReqCall) Do() (*DocsApiMetaResult, error) {
var result = &DocsApiMetaResult{}
- req := request.NewRequest("suite/docs-api/meta", "POST",
+ req := request.NewRequest("/open-apis/suite/docs-api/meta", "POST",
[]request.AccessTokenType{request.AccessTokenTypeUser}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.docsApis.service.conf, req)
return result, err
@@ -64,7 +64,7 @@ type DocsApiSearchReqCall struct {
func (rc *DocsApiSearchReqCall) Do() (*DocsApiSearchResult, error) {
var result = &DocsApiSearchResult{}
- req := request.NewRequest("suite/docs-api/search/object", "POST",
+ req := request.NewRequest("/open-apis/suite/docs-api/search/object", "POST",
[]request.AccessTokenType{request.AccessTokenTypeUser}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.docsApis.service.conf, req)
return result, err
diff --git a/service/translation/v1/api.go b/service/translation/v1/api.go
index 980f7c45..ecb7bfe0 100644
--- a/service/translation/v1/api.go
+++ b/service/translation/v1/api.go
@@ -40,7 +40,7 @@ type TextTranslateReqCall struct {
func (rc *TextTranslateReqCall) Do() (*TextTranslateResult, error) {
var result = &TextTranslateResult{}
- req := request.NewRequest("translation/v1/text/translate", "POST",
+ req := request.NewRequest("/open-apis/translation/v1/text/translate", "POST",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.texts.service.conf, req)
return result, err
@@ -64,7 +64,7 @@ type TextDetectReqCall struct {
func (rc *TextDetectReqCall) Do() (*TextDetectResult, error) {
var result = &TextDetectResult{}
- req := request.NewRequest("translation/v1/text/detect", "POST",
+ req := request.NewRequest("/open-apis/translation/v1/text/detect", "POST",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.texts.service.conf, req)
return result, err
diff --git a/service/vc/v1/api.go b/service/vc/v1/api.go
index fb88c047..0f378a96 100644
--- a/service/vc/v1/api.go
+++ b/service/vc/v1/api.go
@@ -11,41 +11,41 @@ import (
type Service struct {
conf *config.Config
- MeetingRecordings *MeetingRecordingService
Meetings *MeetingService
+ MeetingRecordings *MeetingRecordingService
Reports *ReportService
- RoomConfigs *RoomConfigService
Reserves *ReserveService
+ RoomConfigs *RoomConfigService
}
func NewService(conf *config.Config) *Service {
s := &Service{
conf: conf,
}
- s.MeetingRecordings = newMeetingRecordingService(s)
s.Meetings = newMeetingService(s)
+ s.MeetingRecordings = newMeetingRecordingService(s)
s.Reports = newReportService(s)
- s.RoomConfigs = newRoomConfigService(s)
s.Reserves = newReserveService(s)
+ s.RoomConfigs = newRoomConfigService(s)
return s
}
-type MeetingRecordingService struct {
+type MeetingService struct {
service *Service
}
-func newMeetingRecordingService(service *Service) *MeetingRecordingService {
- return &MeetingRecordingService{
+func newMeetingService(service *Service) *MeetingService {
+ return &MeetingService{
service: service,
}
}
-type MeetingService struct {
+type MeetingRecordingService struct {
service *Service
}
-func newMeetingService(service *Service) *MeetingService {
- return &MeetingService{
+func newMeetingRecordingService(service *Service) *MeetingRecordingService {
+ return &MeetingRecordingService{
service: service,
}
}
@@ -60,22 +60,22 @@ func newReportService(service *Service) *ReportService {
}
}
-type RoomConfigService struct {
+type ReserveService struct {
service *Service
}
-func newRoomConfigService(service *Service) *RoomConfigService {
- return &RoomConfigService{
+func newReserveService(service *Service) *ReserveService {
+ return &ReserveService{
service: service,
}
}
-type ReserveService struct {
+type RoomConfigService struct {
service *Service
}
-func newReserveService(service *Service) *ReserveService {
- return &ReserveService{
+func newRoomConfigService(service *Service) *RoomConfigService {
+ return &RoomConfigService{
service: service,
}
}
@@ -109,7 +109,7 @@ func (rc *RoomConfigQueryReqCall) SetRoomId(roomId int64) {
func (rc *RoomConfigQueryReqCall) Do() (*RoomConfig, error) {
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &RoomConfig{}
- req := request.NewRequest("vc/v1/room_configs/query", "GET",
+ req := request.NewRequest("/open-apis/vc/v1/room_configs/query", "GET",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.roomConfigs.service.conf, req)
return result, err
@@ -144,7 +144,7 @@ func (rc *MeetingInviteReqCall) Do() (*MeetingInviteResult, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &MeetingInviteResult{}
- req := request.NewRequest("vc/v1/meetings/:meeting_id/invite", "PATCH",
+ req := request.NewRequest("/open-apis/vc/v1/meetings/:meeting_id/invite", "PATCH",
[]request.AccessTokenType{request.AccessTokenTypeUser}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.meetings.service.conf, req)
return result, err
@@ -161,50 +161,6 @@ func (meetings *MeetingService) Invite(ctx *core.Context, body *MeetingInviteReq
}
}
-type MeetingListReqCall struct {
- ctx *core.Context
- meetings *MeetingService
- queryParams map[string]interface{}
- optFns []request.OptFn
-}
-
-func (rc *MeetingListReqCall) SetRoomId(roomId int64) {
- rc.queryParams["room_id"] = roomId
-}
-func (rc *MeetingListReqCall) SetStartTime(startTime int64) {
- rc.queryParams["start_time"] = startTime
-}
-func (rc *MeetingListReqCall) SetEndTime(endTime int64) {
- rc.queryParams["end_time"] = endTime
-}
-func (rc *MeetingListReqCall) SetStatus(status int) {
- rc.queryParams["status"] = status
-}
-func (rc *MeetingListReqCall) SetPageToken(pageToken string) {
- rc.queryParams["page_token"] = pageToken
-}
-func (rc *MeetingListReqCall) SetPageSize(pageSize int) {
- rc.queryParams["page_size"] = pageSize
-}
-
-func (rc *MeetingListReqCall) Do() (*MeetingListResult, error) {
- rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
- var result = &MeetingListResult{}
- req := request.NewRequest("vc/v1/meetings", "GET",
- []request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
- err := api.Send(rc.ctx, rc.meetings.service.conf, req)
- return result, err
-}
-
-func (meetings *MeetingService) List(ctx *core.Context, optFns ...request.OptFn) *MeetingListReqCall {
- return &MeetingListReqCall{
- ctx: ctx,
- meetings: meetings,
- queryParams: map[string]interface{}{},
- optFns: optFns,
- }
-}
-
type ReportGetTopUserReqCall struct {
ctx *core.Context
reports *ReportService
@@ -224,11 +180,14 @@ func (rc *ReportGetTopUserReqCall) SetLimit(limit int) {
func (rc *ReportGetTopUserReqCall) SetOrderBy(orderBy int) {
rc.queryParams["order_by"] = orderBy
}
+func (rc *ReportGetTopUserReqCall) SetUserIdType(userIdType string) {
+ rc.queryParams["user_id_type"] = userIdType
+}
func (rc *ReportGetTopUserReqCall) Do() (*ReportGetTopUserResult, error) {
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &ReportGetTopUserResult{}
- req := request.NewRequest("vc/v1/reports/get_top_user", "GET",
+ req := request.NewRequest("/open-apis/vc/v1/reports/get_top_user", "GET",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.reports.service.conf, req)
return result, err
@@ -263,8 +222,8 @@ func (rc *MeetingSetHostReqCall) Do() (*MeetingSetHostResult, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &MeetingSetHostResult{}
- req := request.NewRequest("vc/v1/meetings/:meeting_id/set_host", "PATCH",
- []request.AccessTokenType{request.AccessTokenTypeUser}, rc.body, result, rc.optFns...)
+ req := request.NewRequest("/open-apis/vc/v1/meetings/:meeting_id/set_host", "PATCH",
+ []request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.meetings.service.conf, req)
return result, err
}
@@ -294,7 +253,7 @@ func (rc *MeetingRecordingGetReqCall) SetMeetingId(meetingId int64) {
func (rc *MeetingRecordingGetReqCall) Do() (*MeetingRecordingGetResult, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &MeetingRecordingGetResult{}
- req := request.NewRequest("vc/v1/meetings/:meeting_id/recording", "GET",
+ req := request.NewRequest("/open-apis/vc/v1/meetings/:meeting_id/recording", "GET",
[]request.AccessTokenType{request.AccessTokenTypeUser}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.meetingRecordings.service.conf, req)
return result, err
@@ -323,7 +282,7 @@ func (rc *MeetingEndReqCall) SetMeetingId(meetingId int64) {
func (rc *MeetingEndReqCall) Do() (*response.NoData, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &response.NoData{}
- req := request.NewRequest("vc/v1/meetings/:meeting_id/end", "PATCH",
+ req := request.NewRequest("/open-apis/vc/v1/meetings/:meeting_id/end", "PATCH",
[]request.AccessTokenType{request.AccessTokenTypeUser}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.meetings.service.conf, req)
return result, err
@@ -352,7 +311,7 @@ func (rc *MeetingRecordingStopReqCall) SetMeetingId(meetingId int64) {
func (rc *MeetingRecordingStopReqCall) Do() (*response.NoData, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &response.NoData{}
- req := request.NewRequest("vc/v1/meetings/:meeting_id/recording/stop", "PATCH",
+ req := request.NewRequest("/open-apis/vc/v1/meetings/:meeting_id/recording/stop", "PATCH",
[]request.AccessTokenType{request.AccessTokenTypeUser}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.meetingRecordings.service.conf, req)
return result, err
@@ -384,7 +343,7 @@ func (rc *ReportGetDailyReqCall) SetEndTime(endTime int64) {
func (rc *ReportGetDailyReqCall) Do() (*ReportGetDailyResult, error) {
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &ReportGetDailyResult{}
- req := request.NewRequest("vc/v1/reports/get_daily", "GET",
+ req := request.NewRequest("/open-apis/vc/v1/reports/get_daily", "GET",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.reports.service.conf, req)
return result, err
@@ -424,7 +383,7 @@ func (rc *MeetingGetReqCall) Do() (*MeetingGetResult, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &MeetingGetResult{}
- req := request.NewRequest("vc/v1/meetings/:meeting_id", "GET",
+ req := request.NewRequest("/open-apis/vc/v1/meetings/:meeting_id", "GET",
[]request.AccessTokenType{request.AccessTokenTypeUser, request.AccessTokenTypeTenant}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.meetings.service.conf, req)
return result, err
@@ -449,7 +408,7 @@ type RoomConfigSetReqCall struct {
func (rc *RoomConfigSetReqCall) Do() (*response.NoData, error) {
var result = &response.NoData{}
- req := request.NewRequest("vc/v1/room_configs/set", "POST",
+ req := request.NewRequest("/open-apis/vc/v1/room_configs/set", "POST",
[]request.AccessTokenType{request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.roomConfigs.service.conf, req)
return result, err
@@ -484,7 +443,7 @@ func (rc *MeetingRecordingSetPermissionReqCall) Do() (*response.NoData, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &response.NoData{}
- req := request.NewRequest("vc/v1/meetings/:meeting_id/recording/set_permission", "PATCH",
+ req := request.NewRequest("/open-apis/vc/v1/meetings/:meeting_id/recording/set_permission", "PATCH",
[]request.AccessTokenType{request.AccessTokenTypeUser}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.meetingRecordings.service.conf, req)
return result, err
@@ -516,7 +475,7 @@ func (rc *MeetingRecordingStartReqCall) SetMeetingId(meetingId int64) {
func (rc *MeetingRecordingStartReqCall) Do() (*response.NoData, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &response.NoData{}
- req := request.NewRequest("vc/v1/meetings/:meeting_id/recording/start", "PATCH",
+ req := request.NewRequest("/open-apis/vc/v1/meetings/:meeting_id/recording/start", "PATCH",
[]request.AccessTokenType{request.AccessTokenTypeUser}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.meetingRecordings.service.conf, req)
return result, err
@@ -552,7 +511,7 @@ func (rc *ReserveUpdateReqCall) Do() (*ReserveUpdateResult, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &ReserveUpdateResult{}
- req := request.NewRequest("vc/v1/reserves/:reserve_id", "PUT",
+ req := request.NewRequest("/open-apis/vc/v1/reserves/:reserve_id", "PUT",
[]request.AccessTokenType{request.AccessTokenTypeUser}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.reserves.service.conf, req)
return result, err
@@ -584,7 +543,7 @@ func (rc *ReserveApplyReqCall) SetUserIdType(userIdType string) {
func (rc *ReserveApplyReqCall) Do() (*ReserveApplyResult, error) {
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &ReserveApplyResult{}
- req := request.NewRequest("vc/v1/reserves/apply", "POST",
+ req := request.NewRequest("/open-apis/vc/v1/reserves/apply", "POST",
[]request.AccessTokenType{request.AccessTokenTypeUser}, rc.body, result, rc.optFns...)
err := api.Send(rc.ctx, rc.reserves.service.conf, req)
return result, err
@@ -601,20 +560,25 @@ func (reserves *ReserveService) Apply(ctx *core.Context, body *ReserveApplyReqBo
}
type ReserveGetReqCall struct {
- ctx *core.Context
- reserves *ReserveService
- pathParams map[string]interface{}
- optFns []request.OptFn
+ ctx *core.Context
+ reserves *ReserveService
+ pathParams map[string]interface{}
+ queryParams map[string]interface{}
+ optFns []request.OptFn
}
func (rc *ReserveGetReqCall) SetReserveId(reserveId int64) {
rc.pathParams["reserve_id"] = reserveId
}
+func (rc *ReserveGetReqCall) SetUserIdType(userIdType string) {
+ rc.queryParams["user_id_type"] = userIdType
+}
func (rc *ReserveGetReqCall) Do() (*ReserveGetResult, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
+ rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &ReserveGetResult{}
- req := request.NewRequest("vc/v1/reserves/:reserve_id", "GET",
+ req := request.NewRequest("/open-apis/vc/v1/reserves/:reserve_id", "GET",
[]request.AccessTokenType{request.AccessTokenTypeUser}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.reserves.service.conf, req)
return result, err
@@ -622,10 +586,11 @@ func (rc *ReserveGetReqCall) Do() (*ReserveGetResult, error) {
func (reserves *ReserveService) Get(ctx *core.Context, optFns ...request.OptFn) *ReserveGetReqCall {
return &ReserveGetReqCall{
- ctx: ctx,
- reserves: reserves,
- pathParams: map[string]interface{}{},
- optFns: optFns,
+ ctx: ctx,
+ reserves: reserves,
+ pathParams: map[string]interface{}{},
+ queryParams: map[string]interface{}{},
+ optFns: optFns,
}
}
@@ -643,12 +608,15 @@ func (rc *ReserveGetActiveMeetingReqCall) SetReserveId(reserveId int64) {
func (rc *ReserveGetActiveMeetingReqCall) SetWithParticipants(withParticipants bool) {
rc.queryParams["with_participants"] = withParticipants
}
+func (rc *ReserveGetActiveMeetingReqCall) SetUserIdType(userIdType string) {
+ rc.queryParams["user_id_type"] = userIdType
+}
func (rc *ReserveGetActiveMeetingReqCall) Do() (*ReserveGetActiveMeetingResult, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams))
var result = &ReserveGetActiveMeetingResult{}
- req := request.NewRequest("vc/v1/reserves/:reserve_id/get_active_meeting", "GET",
+ req := request.NewRequest("/open-apis/vc/v1/reserves/:reserve_id/get_active_meeting", "GET",
[]request.AccessTokenType{request.AccessTokenTypeUser}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.reserves.service.conf, req)
return result, err
@@ -678,7 +646,7 @@ func (rc *ReserveDeleteReqCall) SetReserveId(reserveId int64) {
func (rc *ReserveDeleteReqCall) Do() (*response.NoData, error) {
rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams))
var result = &response.NoData{}
- req := request.NewRequest("vc/v1/reserves/:reserve_id", "DELETE",
+ req := request.NewRequest("/open-apis/vc/v1/reserves/:reserve_id", "DELETE",
[]request.AccessTokenType{request.AccessTokenTypeUser}, nil, result, rc.optFns...)
err := api.Send(rc.ctx, rc.reserves.service.conf, req)
return result, err
diff --git a/service/vc/v1/event.go b/service/vc/v1/event.go
index d5be3a46..ce9e35bf 100644
--- a/service/vc/v1/event.go
+++ b/service/vc/v1/event.go
@@ -119,22 +119,6 @@ func SetMeetingRecordingStartedEventHandler(conf *config.Config, fn func(ctx *co
event.SetTypeHandler(conf, "vc.meeting.recording_started_v1", &MeetingRecordingStartedEventHandler{Fn: fn})
}
-type MeetingSendMeetingImEventHandler struct {
- Fn func(*core.Context, *MeetingSendMeetingImEvent) error
-}
-
-func (h *MeetingSendMeetingImEventHandler) GetEvent() interface{} {
- return &MeetingSendMeetingImEvent{}
-}
-
-func (h *MeetingSendMeetingImEventHandler) Handle(ctx *core.Context, event interface{}) error {
- return h.Fn(ctx, event.(*MeetingSendMeetingImEvent))
-}
-
-func SetMeetingSendMeetingImEventHandler(conf *config.Config, fn func(ctx *core.Context, event *MeetingSendMeetingImEvent) error) {
- event.SetTypeHandler(conf, "vc.meeting.send_meeting_im_v1", &MeetingSendMeetingImEventHandler{Fn: fn})
-}
-
type MeetingShareStartedEventHandler struct {
Fn func(*core.Context, *MeetingShareStartedEvent) error
}
diff --git a/service/vc/v1/model.go b/service/vc/v1/model.go
index 0eacdec4..2d9324f6 100644
--- a/service/vc/v1/model.go
+++ b/service/vc/v1/model.go
@@ -19,6 +19,41 @@ func (s *UserId) MarshalJSON() ([]byte, error) {
return tools.MarshalJSON(raw, s.ForceSendFields)
}
+type Meeting struct {
+ Id int64 `json:"id,omitempty,string"`
+ Topic string `json:"topic,omitempty"`
+ Url string `json:"url,omitempty"`
+ CreateTime int64 `json:"create_time,omitempty,string"`
+ StartTime int64 `json:"start_time,omitempty,string"`
+ EndTime int64 `json:"end_time,omitempty,string"`
+ HostUser *MeetingUser `json:"host_user,omitempty"`
+ Status int `json:"status,omitempty"`
+ ParticipantCount int64 `json:"participant_count,omitempty,string"`
+ Participants []*MeetingParticipant `json:"participants,omitempty"`
+ Ability *MeetingAbility `json:"ability,omitempty"`
+ ForceSendFields []string `json:"-"`
+}
+
+func (s *Meeting) MarshalJSON() ([]byte, error) {
+ type cp Meeting
+ raw := cp(*s)
+ return tools.MarshalJSON(raw, s.ForceSendFields)
+}
+
+type MeetingRecording struct {
+ Id int64 `json:"id,omitempty,string"`
+ MeetingId int64 `json:"meeting_id,omitempty,string"`
+ Url string `json:"url,omitempty"`
+ Duration int64 `json:"duration,omitempty,string"`
+ ForceSendFields []string `json:"-"`
+}
+
+func (s *MeetingRecording) MarshalJSON() ([]byte, error) {
+ type cp MeetingRecording
+ raw := cp(*s)
+ return tools.MarshalJSON(raw, s.ForceSendFields)
+}
+
type MeetingAbility struct {
UseVideo bool `json:"use_video,omitempty"`
UseAudio bool `json:"use_audio,omitempty"`
@@ -35,105 +70,73 @@ func (s *MeetingAbility) MarshalJSON() ([]byte, error) {
return tools.MarshalJSON(raw, s.ForceSendFields)
}
-type MeetingParticipant struct {
- Id string `json:"id,omitempty"`
- UserType int `json:"user_type,omitempty"`
- IsHost bool `json:"is_host,omitempty"`
- IsCohost bool `json:"is_cohost,omitempty"`
- IsExternal bool `json:"is_external,omitempty"`
- Status int `json:"status,omitempty"`
- ForceSendFields []string `json:"-"`
+type MeetingEventMeeting struct {
+ Id int64 `json:"id,omitempty,string"`
+ Topic string `json:"topic,omitempty"`
+ MeetingNo string `json:"meeting_no,omitempty"`
+ StartTime int64 `json:"start_time,omitempty,string"`
+ EndTime int64 `json:"end_time,omitempty,string"`
+ HostUser *MeetingEventUser `json:"host_user,omitempty"`
+ Owner *MeetingEventUser `json:"owner,omitempty"`
+ ForceSendFields []string `json:"-"`
}
-func (s *MeetingParticipant) MarshalJSON() ([]byte, error) {
- type cp MeetingParticipant
+func (s *MeetingEventMeeting) MarshalJSON() ([]byte, error) {
+ type cp MeetingEventMeeting
raw := cp(*s)
return tools.MarshalJSON(raw, s.ForceSendFields)
}
-type MeetingParticipantResult struct {
- Id string `json:"id,omitempty"`
+type MeetingEventUser struct {
+ Id *UserId `json:"id,omitempty"`
+ UserRole int `json:"user_role,omitempty"`
UserType int `json:"user_type,omitempty"`
- Result int `json:"result,omitempty"`
ForceSendFields []string `json:"-"`
}
-func (s *MeetingParticipantResult) MarshalJSON() ([]byte, error) {
- type cp MeetingParticipantResult
+func (s *MeetingEventUser) MarshalJSON() ([]byte, error) {
+ type cp MeetingEventUser
raw := cp(*s)
return tools.MarshalJSON(raw, s.ForceSendFields)
}
-type MeetingUser struct {
+type MeetingInviteStatus struct {
Id string `json:"id,omitempty"`
UserType int `json:"user_type,omitempty"`
+ Status int `json:"status,omitempty"`
ForceSendFields []string `json:"-"`
}
-func (s *MeetingUser) MarshalJSON() ([]byte, error) {
- type cp MeetingUser
- raw := cp(*s)
- return tools.MarshalJSON(raw, s.ForceSendFields)
-}
-
-type RoomDigitalSignage struct {
- Enable bool `json:"enable,omitempty"`
- Mute bool `json:"mute,omitempty"`
- StartDisplay int `json:"start_display,omitempty"`
- StopDisplay int `json:"stop_display,omitempty"`
- Materials []*RoomDigitalSignageMaterial `json:"materials,omitempty"`
- ForceSendFields []string `json:"-"`
-}
-
-func (s *RoomDigitalSignage) MarshalJSON() ([]byte, error) {
- type cp RoomDigitalSignage
+func (s *MeetingInviteStatus) MarshalJSON() ([]byte, error) {
+ type cp MeetingInviteStatus
raw := cp(*s)
return tools.MarshalJSON(raw, s.ForceSendFields)
}
-type RoomDigitalSignageMaterial struct {
+type MeetingParticipant struct {
Id string `json:"id,omitempty"`
- Name string `json:"name,omitempty"`
- MaterialType int `json:"material_type,omitempty"`
- Url string `json:"url,omitempty"`
- Duration int `json:"duration,omitempty"`
- Cover string `json:"cover,omitempty"`
- Md5 string `json:"md5,omitempty"`
+ UserType int `json:"user_type,omitempty"`
+ IsHost bool `json:"is_host,omitempty"`
+ IsCohost bool `json:"is_cohost,omitempty"`
+ IsExternal bool `json:"is_external,omitempty"`
+ Status int `json:"status,omitempty"`
ForceSendFields []string `json:"-"`
}
-func (s *RoomDigitalSignageMaterial) MarshalJSON() ([]byte, error) {
- type cp RoomDigitalSignageMaterial
- raw := cp(*s)
- return tools.MarshalJSON(raw, s.ForceSendFields)
-}
-
-type MeetingEventMeeting struct {
- Id int64 `json:"id,omitempty,string"`
- Topic string `json:"topic,omitempty"`
- MeetingNo string `json:"meeting_no,omitempty"`
- StartTime int64 `json:"start_time,omitempty,string"`
- EndTime int64 `json:"end_time,omitempty,string"`
- HostUser *MeetingEventUser `json:"host_user,omitempty"`
- Owner *MeetingEventUser `json:"owner,omitempty"`
- ForceSendFields []string `json:"-"`
-}
-
-func (s *MeetingEventMeeting) MarshalJSON() ([]byte, error) {
- type cp MeetingEventMeeting
+func (s *MeetingParticipant) MarshalJSON() ([]byte, error) {
+ type cp MeetingParticipant
raw := cp(*s)
return tools.MarshalJSON(raw, s.ForceSendFields)
}
-type MeetingEventUser struct {
- Id *UserId `json:"id,omitempty"`
- UserRole int `json:"user_role,omitempty"`
+type MeetingUser struct {
+ Id string `json:"id,omitempty"`
UserType int `json:"user_type,omitempty"`
ForceSendFields []string `json:"-"`
}
-func (s *MeetingEventUser) MarshalJSON() ([]byte, error) {
- type cp MeetingEventUser
+func (s *MeetingUser) MarshalJSON() ([]byte, error) {
+ type cp MeetingUser
raw := cp(*s)
return tools.MarshalJSON(raw, s.ForceSendFields)
}
@@ -151,6 +154,20 @@ func (s *RecordingPermissionObject) MarshalJSON() ([]byte, error) {
return tools.MarshalJSON(raw, s.ForceSendFields)
}
+type Report struct {
+ TotalMeetingCount int64 `json:"total_meeting_count,omitempty,string"`
+ TotalMeetingDuration int64 `json:"total_meeting_duration,omitempty,string"`
+ TotalParticipantCount int64 `json:"total_participant_count,omitempty,string"`
+ DailyReport []*ReportMeetingDaily `json:"daily_report,omitempty"`
+ ForceSendFields []string `json:"-"`
+}
+
+func (s *Report) MarshalJSON() ([]byte, error) {
+ type cp Report
+ raw := cp(*s)
+ return tools.MarshalJSON(raw, s.ForceSendFields)
+}
+
type ReportMeetingDaily struct {
Date int64 `json:"date,omitempty,string"`
MeetingCount int64 `json:"meeting_count,omitempty,string"`
@@ -180,6 +197,56 @@ func (s *ReportTopUser) MarshalJSON() ([]byte, error) {
return tools.MarshalJSON(raw, s.ForceSendFields)
}
+type ReserveActionPermission struct {
+ Permission int `json:"permission,omitempty"`
+ PermissionCheckers []*ReservePermissionChecker `json:"permission_checkers,omitempty"`
+ ForceSendFields []string `json:"-"`
+}
+
+func (s *ReserveActionPermission) MarshalJSON() ([]byte, error) {
+ type cp ReserveActionPermission
+ raw := cp(*s)
+ return tools.MarshalJSON(raw, s.ForceSendFields)
+}
+
+type ReserveCallSetting struct {
+ Callee *ReserveCallee `json:"callee,omitempty"`
+ ForceSendFields []string `json:"-"`
+}
+
+func (s *ReserveCallSetting) MarshalJSON() ([]byte, error) {
+ type cp ReserveCallSetting
+ raw := cp(*s)
+ return tools.MarshalJSON(raw, s.ForceSendFields)
+}
+
+type ReserveCallee struct {
+ Id string `json:"id,omitempty"`
+ UserType int `json:"user_type,omitempty"`
+ PstnSipInfo *PstnSipInfo `json:"pstn_sip_info,omitempty"`
+ ForceSendFields []string `json:"-"`
+}
+
+func (s *ReserveCallee) MarshalJSON() ([]byte, error) {
+ type cp ReserveCallee
+ raw := cp(*s)
+ return tools.MarshalJSON(raw, s.ForceSendFields)
+}
+
+type ReserveMeetingSetting struct {
+ Topic string `json:"topic,omitempty"`
+ ActionPermissions []*ReserveActionPermission `json:"action_permissions,omitempty"`
+ MeetingInitialType int `json:"meeting_initial_type,omitempty"`
+ CallSetting *ReserveCallSetting `json:"call_setting,omitempty"`
+ ForceSendFields []string `json:"-"`
+}
+
+func (s *ReserveMeetingSetting) MarshalJSON() ([]byte, error) {
+ type cp ReserveMeetingSetting
+ raw := cp(*s)
+ return tools.MarshalJSON(raw, s.ForceSendFields)
+}
+
type ReservePermissionChecker struct {
CheckField int `json:"check_field,omitempty"`
CheckMode int `json:"check_mode,omitempty"`
@@ -193,88 +260,125 @@ func (s *ReservePermissionChecker) MarshalJSON() ([]byte, error) {
return tools.MarshalJSON(raw, s.ForceSendFields)
}
-type ReserveActionPermission struct {
- Permission int `json:"permission,omitempty"`
- PermissionCheckers []*ReservePermissionChecker `json:"permission_checkers,omitempty"`
- ForceSendFields []string `json:"-"`
+type RoomConfig struct {
+ RoomBackground string `json:"room_background,omitempty"`
+ DisplayBackground string `json:"display_background,omitempty"`
+ DigitalSignage *RoomDigitalSignage `json:"digital_signage,omitempty"`
+ ForceSendFields []string `json:"-"`
}
-func (s *ReserveActionPermission) MarshalJSON() ([]byte, error) {
- type cp ReserveActionPermission
+func (s *RoomConfig) MarshalJSON() ([]byte, error) {
+ type cp RoomConfig
raw := cp(*s)
return tools.MarshalJSON(raw, s.ForceSendFields)
}
-type ReserveMeetingSetting struct {
- Topic string `json:"topic,omitempty"`
- ActionPermissions []*ReserveActionPermission `json:"action_permissions,omitempty"`
- ForceSendFields []string `json:"-"`
+type RoomDigitalSignage struct {
+ Enable bool `json:"enable,omitempty"`
+ Mute bool `json:"mute,omitempty"`
+ StartDisplay int `json:"start_display,omitempty"`
+ StopDisplay int `json:"stop_display,omitempty"`
+ Materials []*RoomDigitalSignageMaterial `json:"materials,omitempty"`
+ ForceSendFields []string `json:"-"`
}
-func (s *ReserveMeetingSetting) MarshalJSON() ([]byte, error) {
- type cp ReserveMeetingSetting
+func (s *RoomDigitalSignage) MarshalJSON() ([]byte, error) {
+ type cp RoomDigitalSignage
raw := cp(*s)
return tools.MarshalJSON(raw, s.ForceSendFields)
}
-type MeetingInviteStatus struct {
+type RoomDigitalSignageMaterial struct {
Id string `json:"id,omitempty"`
- UserType int `json:"user_type,omitempty"`
- Status int `json:"status,omitempty"`
+ Name string `json:"name,omitempty"`
+ MaterialType int `json:"material_type,omitempty"`
+ Url string `json:"url,omitempty"`
+ Duration int `json:"duration,omitempty"`
+ Cover string `json:"cover,omitempty"`
+ Md5 string `json:"md5,omitempty"`
ForceSendFields []string `json:"-"`
}
-func (s *MeetingInviteStatus) MarshalJSON() ([]byte, error) {
- type cp MeetingInviteStatus
+func (s *RoomDigitalSignageMaterial) MarshalJSON() ([]byte, error) {
+ type cp RoomDigitalSignageMaterial
raw := cp(*s)
return tools.MarshalJSON(raw, s.ForceSendFields)
}
-type Meeting struct {
- Id int64 `json:"id,omitempty,string"`
- Topic string `json:"topic,omitempty"`
- Url string `json:"url,omitempty"`
- CreateTime int64 `json:"create_time,omitempty,string"`
- StartTime int64 `json:"start_time,omitempty,string"`
- EndTime int64 `json:"end_time,omitempty,string"`
- HostUser *MeetingUser `json:"host_user,omitempty"`
- Status int `json:"status,omitempty"`
- ParticipantCount int64 `json:"participant_count,omitempty,string"`
- Participants []*MeetingParticipant `json:"participants,omitempty"`
- Ability *MeetingAbility `json:"ability,omitempty"`
- ForceSendFields []string `json:"-"`
+type Material struct {
+ Name string `json:"name,omitempty"`
+ FileToken string `json:"file_token,omitempty"`
+ FileSize int `json:"file_size,omitempty"`
+ DeviceType int `json:"device_type,omitempty"`
+ MaterialType int `json:"material_type,omitempty"`
+ ReviewResult int `json:"review_result,omitempty"`
+ MaterialSource int `json:"material_source,omitempty"`
+ ForceSendFields []string `json:"-"`
}
-func (s *Meeting) MarshalJSON() ([]byte, error) {
- type cp Meeting
+func (s *Material) MarshalJSON() ([]byte, error) {
+ type cp Material
raw := cp(*s)
return tools.MarshalJSON(raw, s.ForceSendFields)
}
-type MeetingRecording struct {
- Id int64 `json:"id,omitempty,string"`
- MeetingId int64 `json:"meeting_id,omitempty,string"`
- Url string `json:"url,omitempty"`
- Duration int64 `json:"duration,omitempty,string"`
+type MaterialDeleteResult struct {
+ FileToken string `json:"file_token,omitempty"`
+ Result int `json:"result,omitempty"`
ForceSendFields []string `json:"-"`
}
-func (s *MeetingRecording) MarshalJSON() ([]byte, error) {
- type cp MeetingRecording
+func (s *MaterialDeleteResult) MarshalJSON() ([]byte, error) {
+ type cp MaterialDeleteResult
raw := cp(*s)
return tools.MarshalJSON(raw, s.ForceSendFields)
}
-type Report struct {
- TotalMeetingCount int64 `json:"total_meeting_count,omitempty,string"`
- TotalMeetingDuration int64 `json:"total_meeting_duration,omitempty,string"`
- TotalParticipantCount int64 `json:"total_participant_count,omitempty,string"`
- DailyReport []*ReportMeetingDaily `json:"daily_report,omitempty"`
- ForceSendFields []string `json:"-"`
+type MaterialReviewResult struct {
+ FileToken string `json:"file_token,omitempty"`
+ Result int `json:"result,omitempty"`
+ ForceSendFields []string `json:"-"`
}
-func (s *Report) MarshalJSON() ([]byte, error) {
- type cp Report
+func (s *MaterialReviewResult) MarshalJSON() ([]byte, error) {
+ type cp MaterialReviewResult
+ raw := cp(*s)
+ return tools.MarshalJSON(raw, s.ForceSendFields)
+}
+
+type MaterialUploadResult struct {
+ FileToken string `json:"file_token,omitempty"`
+ Result int `json:"result,omitempty"`
+ ForceSendFields []string `json:"-"`
+}
+
+func (s *MaterialUploadResult) MarshalJSON() ([]byte, error) {
+ type cp MaterialUploadResult
+ raw := cp(*s)
+ return tools.MarshalJSON(raw, s.ForceSendFields)
+}
+
+type MeetingParticipantResult struct {
+ Id string `json:"id,omitempty"`
+ UserType int `json:"user_type,omitempty"`
+ Result int `json:"result,omitempty"`
+ ForceSendFields []string `json:"-"`
+}
+
+func (s *MeetingParticipantResult) MarshalJSON() ([]byte, error) {
+ type cp MeetingParticipantResult
+ raw := cp(*s)
+ return tools.MarshalJSON(raw, s.ForceSendFields)
+}
+
+type PstnSipInfo struct {
+ Nickname string `json:"nickname,omitempty"`
+ MainAddress string `json:"main_address,omitempty"`
+ ForceSendFields []string `json:"-"`
+}
+
+func (s *PstnSipInfo) MarshalJSON() ([]byte, error) {
+ type cp PstnSipInfo
raw := cp(*s)
return tools.MarshalJSON(raw, s.ForceSendFields)
}
@@ -284,6 +388,7 @@ type Reserve struct {
MeetingNo string `json:"meeting_no,omitempty"`
Url string `json:"url,omitempty"`
AppLink string `json:"app_link,omitempty"`
+ LiveLink string `json:"live_link,omitempty"`
EndTime int64 `json:"end_time,omitempty,string"`
ExpireStatus int `json:"expire_status,omitempty"`
ReserveUserId string `json:"reserve_user_id,omitempty"`
@@ -297,19 +402,6 @@ func (s *Reserve) MarshalJSON() ([]byte, error) {
return tools.MarshalJSON(raw, s.ForceSendFields)
}
-type RoomConfig struct {
- RoomBackground string `json:"room_background,omitempty"`
- DisplayBackground string `json:"display_background,omitempty"`
- DigitalSignage *RoomDigitalSignage `json:"digital_signage,omitempty"`
- ForceSendFields []string `json:"-"`
-}
-
-func (s *RoomConfig) MarshalJSON() ([]byte, error) {
- type cp RoomConfig
- raw := cp(*s)
- return tools.MarshalJSON(raw, s.ForceSendFields)
-}
-
type MeetingInviteReqBody struct {
Invitees []*MeetingUser `json:"invitees,omitempty"`
ForceSendFields []string `json:"-"`
@@ -325,12 +417,6 @@ type MeetingInviteResult struct {
InviteResults []*MeetingInviteStatus `json:"invite_results,omitempty"`
}
-type MeetingListResult struct {
- HasMore bool `json:"has_more,omitempty"`
- PageToken string `json:"page_token,omitempty"`
- Meetings []*Meeting `json:"meetings,omitempty"`
-}
-
type ReportGetTopUserResult struct {
TopUserReport []*ReportTopUser `json:"top_user_report,omitempty"`
}
@@ -513,17 +599,6 @@ type MeetingRecordingStartedEvent struct {
Event *MeetingRecordingStartedEventData `json:"event"`
}
-type MeetingSendMeetingImEventData struct {
- Meeting *MeetingEventMeeting `json:"meeting,omitempty"`
- Operator *MeetingEventUser `json:"operator,omitempty"`
- Content string `json:"content,omitempty"`
-}
-
-type MeetingSendMeetingImEvent struct {
- *model.BaseEventV2
- Event *MeetingSendMeetingImEventData `json:"event"`
-}
-
type MeetingShareStartedEventData struct {
Meeting *MeetingEventMeeting `json:"meeting,omitempty"`
Operator *MeetingEventUser `json:"operator,omitempty"`
diff --git a/test_download.png b/test_download.png
new file mode 100644
index 00000000..bea74ce5
Binary files /dev/null and b/test_download.png differ