Skip to content

Commit cceaa7c

Browse files
committed
feat:update api
Change-Id: I6ef53c6e8ca32f4c947e66e48fb8fdf0aed3207b
1 parent 92f41c6 commit cceaa7c

File tree

29 files changed

+3311
-726
lines changed

29 files changed

+3311
-726
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,4 @@ modules.txt
1010
*.json
1111
*.sh
1212
test.go
13-
sensitive_info_result.txt
1413
.env

client.go

Lines changed: 92 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -81,60 +81,60 @@ import (
8181

8282
type Client struct {
8383
config *larkcore.Config
84-
Aily *aily.Service
85-
Lingo *lingo.Service
86-
Search *search.Service
87-
Admin *admin.Service
88-
Docx *docx.Service
89-
Mdm *mdm.Service
90-
Vc *vc.Service
91-
SpeechToText *speech_to_text.Service
92-
Block *block.Service
93-
Contact *contact.Service
94-
Hire *hire.Service
95-
Tenant *tenant.Service
96-
Verification *verification.Service
97-
Baike *baike.Service
98-
Corehr *corehr.Service
99-
SecurityAndCompliance *security_and_compliance.Service
100-
Sheets *sheets.Service
101-
Board *board.Service
102-
Event *event.Service
103-
Performance *performance.Service
104-
PersonalSettings *personal_settings.Service
105-
Workplace *workplace.Service
106-
Application *application.Service
107-
Approval *approval.Service
108-
Auth *auth.Service
109-
Bitable *bitable.Service
110-
DocumentAi *document_ai.Service
111-
Ehr *ehr.Service
112-
Mail *mail.Service
113-
Minutes *minutes.Service
114-
Okr *okr.Service
115-
Task *task.Service
116-
Wiki *wiki.Service
117-
Docs *docs.Service
118-
Passport *passport.Service
119-
Apaas *apaas.Service
120-
Attendance *attendance.Service
121-
Calendar *calendar.Service
12284
Acs *acs.Service
12385
Cardkit *cardkit.Service
86+
Performance *performance.Service
12487
Compensation *compensation.Service
125-
Payroll *payroll.Service
126-
Authen *authen.Service
88+
Wiki *wiki.Service
89+
Minutes *minutes.Service
90+
Sheets *sheets.Service
91+
Task *task.Service
12792
Directory *directory.Service
128-
Drive *drive.Service
129-
Im *im.Service
93+
Event *event.Service
94+
Payroll *payroll.Service
95+
Vc *vc.Service
96+
Calendar *calendar.Service
97+
Mdm *mdm.Service
13098
HumanAuthentication *human_authentication.Service
13199
MeetingRoom *meeting_room.Service
132-
OpticalCharRecognition *optical_char_recognition.Service
133-
Translation *translation.Service
100+
Attendance *attendance.Service
101+
Baike *baike.Service
102+
Contact *contact.Service
103+
DocumentAi *document_ai.Service
104+
SpeechToText *speech_to_text.Service
105+
Auth *auth.Service
134106
Base *base.Service
135-
Helpdesk *helpdesk.Service
136-
Moments *moments.Service
107+
OpticalCharRecognition *optical_char_recognition.Service
108+
Authen *authen.Service
109+
Corehr *corehr.Service
110+
Drive *drive.Service
111+
Admin *admin.Service
112+
Apaas *apaas.Service
137113
Report *report.Service
114+
Board *board.Service
115+
Ehr *ehr.Service
116+
Im *im.Service
117+
Passport *passport.Service
118+
Approval *approval.Service
119+
Hire *hire.Service
120+
Okr *okr.Service
121+
Lingo *lingo.Service
122+
Aily *aily.Service
123+
Docs *docs.Service
124+
Verification *verification.Service
125+
Application *application.Service
126+
Moments *moments.Service
127+
Docx *docx.Service
128+
Mail *mail.Service
129+
Search *search.Service
130+
SecurityAndCompliance *security_and_compliance.Service
131+
Tenant *tenant.Service
132+
PersonalSettings *personal_settings.Service
133+
Helpdesk *helpdesk.Service
134+
Translation *translation.Service
135+
Workplace *workplace.Service
136+
Bitable *bitable.Service
137+
Block *block.Service
138138
Ext *larkext.ExtService
139139
}
140140

@@ -258,60 +258,60 @@ func NewClient(appId, appSecret string, options ...ClientOptionFunc) *Client {
258258
}
259259

260260
func initService(client *Client, config *larkcore.Config) {
261-
client.Aily = aily.NewService(config)
262-
client.Lingo = lingo.NewService(config)
263-
client.Search = search.NewService(config)
264-
client.Admin = admin.NewService(config)
265-
client.Docx = docx.NewService(config)
266-
client.Mdm = mdm.NewService(config)
267-
client.Vc = vc.NewService(config)
268-
client.SpeechToText = speech_to_text.NewService(config)
269-
client.Block = block.NewService(config)
270-
client.Contact = contact.NewService(config)
271-
client.Hire = hire.NewService(config)
272-
client.Tenant = tenant.NewService(config)
273-
client.Verification = verification.NewService(config)
274-
client.Baike = baike.NewService(config)
275-
client.Corehr = corehr.NewService(config)
276-
client.SecurityAndCompliance = security_and_compliance.NewService(config)
277-
client.Sheets = sheets.NewService(config)
278-
client.Board = board.NewService(config)
279-
client.Event = event.NewService(config)
280-
client.Performance = performance.NewService(config)
281-
client.PersonalSettings = personal_settings.NewService(config)
282-
client.Workplace = workplace.NewService(config)
283-
client.Application = application.NewService(config)
284-
client.Approval = approval.NewService(config)
285-
client.Auth = auth.NewService(config)
286-
client.Bitable = bitable.NewService(config)
287-
client.DocumentAi = document_ai.NewService(config)
288-
client.Ehr = ehr.NewService(config)
289-
client.Mail = mail.NewService(config)
290-
client.Minutes = minutes.NewService(config)
291-
client.Okr = okr.NewService(config)
292-
client.Task = task.NewService(config)
293-
client.Wiki = wiki.NewService(config)
294-
client.Docs = docs.NewService(config)
295-
client.Passport = passport.NewService(config)
296-
client.Apaas = apaas.NewService(config)
297-
client.Attendance = attendance.NewService(config)
298-
client.Calendar = calendar.NewService(config)
299261
client.Acs = acs.NewService(config)
300262
client.Cardkit = cardkit.NewService(config)
263+
client.Performance = performance.NewService(config)
301264
client.Compensation = compensation.NewService(config)
302-
client.Payroll = payroll.NewService(config)
303-
client.Authen = authen.NewService(config)
265+
client.Wiki = wiki.NewService(config)
266+
client.Minutes = minutes.NewService(config)
267+
client.Sheets = sheets.NewService(config)
268+
client.Task = task.NewService(config)
304269
client.Directory = directory.NewService(config)
305-
client.Drive = drive.NewService(config)
306-
client.Im = im.NewService(config)
270+
client.Event = event.NewService(config)
271+
client.Payroll = payroll.NewService(config)
272+
client.Vc = vc.NewService(config)
273+
client.Calendar = calendar.NewService(config)
274+
client.Mdm = mdm.NewService(config)
307275
client.HumanAuthentication = human_authentication.NewService(config)
308276
client.MeetingRoom = meeting_room.NewService(config)
309-
client.OpticalCharRecognition = optical_char_recognition.NewService(config)
310-
client.Translation = translation.NewService(config)
277+
client.Attendance = attendance.NewService(config)
278+
client.Baike = baike.NewService(config)
279+
client.Contact = contact.NewService(config)
280+
client.DocumentAi = document_ai.NewService(config)
281+
client.SpeechToText = speech_to_text.NewService(config)
282+
client.Auth = auth.NewService(config)
311283
client.Base = base.NewService(config)
312-
client.Helpdesk = helpdesk.NewService(config)
313-
client.Moments = moments.NewService(config)
284+
client.OpticalCharRecognition = optical_char_recognition.NewService(config)
285+
client.Authen = authen.NewService(config)
286+
client.Corehr = corehr.NewService(config)
287+
client.Drive = drive.NewService(config)
288+
client.Admin = admin.NewService(config)
289+
client.Apaas = apaas.NewService(config)
314290
client.Report = report.NewService(config)
291+
client.Board = board.NewService(config)
292+
client.Ehr = ehr.NewService(config)
293+
client.Im = im.NewService(config)
294+
client.Passport = passport.NewService(config)
295+
client.Approval = approval.NewService(config)
296+
client.Hire = hire.NewService(config)
297+
client.Okr = okr.NewService(config)
298+
client.Lingo = lingo.NewService(config)
299+
client.Aily = aily.NewService(config)
300+
client.Docs = docs.NewService(config)
301+
client.Verification = verification.NewService(config)
302+
client.Application = application.NewService(config)
303+
client.Moments = moments.NewService(config)
304+
client.Docx = docx.NewService(config)
305+
client.Mail = mail.NewService(config)
306+
client.Search = search.NewService(config)
307+
client.SecurityAndCompliance = security_and_compliance.NewService(config)
308+
client.Tenant = tenant.NewService(config)
309+
client.PersonalSettings = personal_settings.NewService(config)
310+
client.Helpdesk = helpdesk.NewService(config)
311+
client.Translation = translation.NewService(config)
312+
client.Workplace = workplace.NewService(config)
313+
client.Bitable = bitable.NewService(config)
314+
client.Block = block.NewService(config)
315315
client.Ext = larkext.NewService(config)
316316
}
317317

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// Package dispatcher code generated by oapi sdk gen
2+
/*
3+
* MIT License
4+
*
5+
* Copyright (c) 2022 Lark Technologies Pte. Ltd.
6+
*
7+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
8+
*
9+
* The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software.
10+
*
11+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
12+
*/
13+
14+
package dispatcher
15+
16+
import (
17+
"context"
18+
"github.com/larksuite/oapi-sdk-go/v3/service/apaas/v1"
19+
)
20+
//
21+
//
22+
// -
23+
//
24+
// - 事件描述文档链接:
25+
func ( dispatcher * EventDispatcher ) OnP2WorkspaceRecordChangeV1(handler func(ctx context.Context, event *larkapaas.P2WorkspaceRecordChangeV1) error) * EventDispatcher{
26+
_, existed := dispatcher.eventType2EventHandler["apaas.workspace.record_change_v1"]
27+
if existed {
28+
panic("event: multiple handler registrations for " + "apaas.workspace.record_change_v1")
29+
}
30+
dispatcher.eventType2EventHandler["apaas.workspace.record_change_v1"] = larkapaas.NewP2WorkspaceRecordChangeV1Handler(handler)
31+
return dispatcher
32+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// Package apaas code generated by oapi sdk gen
2+
/*
3+
* MIT License
4+
*
5+
* Copyright (c) 2022 Lark Technologies Pte. Ltd.
6+
*
7+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
8+
*
9+
* The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software.
10+
*
11+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
12+
*/
13+
14+
package main
15+
16+
import (
17+
"context"
18+
"fmt"
19+
"github.com/larksuite/oapi-sdk-go/v3"
20+
"github.com/larksuite/oapi-sdk-go/v3/core"
21+
"github.com/larksuite/oapi-sdk-go/v3/service/apaas/v1"
22+
)
23+
24+
// GET /open-apis/apaas/v1/workspaces/:workspace_id/enums/:enum_name
25+
func main() {
26+
// 创建 Client
27+
client := lark.NewClient("appID", "appSecret")
28+
// 创建请求对象
29+
req := larkapaas.NewEnumGetWorkspaceEnumReqBuilder().
30+
WorkspaceId("workspace_abc").
31+
EnumName("enum_demo_1").
32+
Build()
33+
// 发起请求
34+
resp, err := client.Apaas.V1.WorkspaceEnum.EnumGet(context.Background(), req)
35+
36+
// 处理错误
37+
if err != nil {
38+
fmt.Println(err)
39+
return
40+
}
41+
42+
// 服务端错误处理
43+
if !resp.Success() {
44+
fmt.Println(resp.Code, resp.Msg, resp.RequestId())
45+
return
46+
}
47+
48+
// 业务处理
49+
fmt.Println(larkcore.Prettify(resp))
50+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
// Package apaas code generated by oapi sdk gen
2+
/*
3+
* MIT License
4+
*
5+
* Copyright (c) 2022 Lark Technologies Pte. Ltd.
6+
*
7+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
8+
*
9+
* The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software.
10+
*
11+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
12+
*/
13+
14+
package main
15+
16+
import (
17+
"context"
18+
"fmt"
19+
"github.com/larksuite/oapi-sdk-go/v3"
20+
"github.com/larksuite/oapi-sdk-go/v3/core"
21+
"github.com/larksuite/oapi-sdk-go/v3/service/apaas/v1"
22+
)
23+
24+
// GET /open-apis/apaas/v1/workspaces/:workspace_id/enums
25+
func main() {
26+
// 创建 Client
27+
client := lark.NewClient("appID", "appSecret")
28+
// 创建请求对象
29+
req := larkapaas.NewListWorkspaceEnumReqBuilder().
30+
WorkspaceId("workspace_abc").
31+
PageSize(10).
32+
PageToken("AQD9/Rn9eij9Pm39ED40/RD/cIFmu77WxpxPB/2oHfQLZ+G8JG6tK7+ZnHiT7COhD2hMSICh/eBl7cpzU6JEC3J7COKNe4jrQ8ExwBCR").
33+
Build()
34+
// 发起请求
35+
resp, err := client.Apaas.V1.WorkspaceEnum.List(context.Background(), req)
36+
37+
// 处理错误
38+
if err != nil {
39+
fmt.Println(err)
40+
return
41+
}
42+
43+
// 服务端错误处理
44+
if !resp.Success() {
45+
fmt.Println(resp.Code, resp.Msg, resp.RequestId())
46+
return
47+
}
48+
49+
// 业务处理
50+
fmt.Println(larkcore.Prettify(resp))
51+
}

0 commit comments

Comments
 (0)