Skip to content

Commit f4fc60a

Browse files
committed
feat: update api
1 parent ca52949 commit f4fc60a

File tree

1,088 files changed

+48340
-20991
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,088 files changed

+48340
-20991
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
<dependency>
4747
<groupId>com.larksuite.oapi</groupId>
4848
<artifactId>oapi-sdk</artifactId>
49-
<version>2.0.28</version>
49+
<version>2.0.29</version>
5050
</dependency>
5151
```
5252
- 如无法获取oapi-sdk依赖,请在 pom.xml 的 <project> 里增加 <repositories>

larksuite-oapi/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,5 +242,5 @@
242242

243243
<url>https://github.com/larksuite/oapi-sdk-java</url>
244244

245-
<version>2.0.28</version>
245+
<version>2.0.29</version>
246246
</project>

larksuite-oapi/src/main/java/com/lark/oapi/Client.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
import com.lark.oapi.service.hire.v1.HireService;
5151
import com.lark.oapi.service.human_authentication.v1.HumanAuthenticationService;
5252
import com.lark.oapi.service.im.v1.ImService;
53+
import com.lark.oapi.service.lingo.v1.LingoService;
5354
import com.lark.oapi.service.mail.v1.MailService;
5455
import com.lark.oapi.service.mdm.v1.MdmService;
5556
import com.lark.oapi.service.meeting_room.v1.MeetingRoomService;
@@ -58,6 +59,7 @@
5859
import com.lark.oapi.service.passport.v1.PassportService;
5960
import com.lark.oapi.service.personal_settings.v1.PersonalSettingsService;
6061
import com.lark.oapi.service.search.v2.SearchService;
62+
import com.lark.oapi.service.security_and_compliance.v1.SecurityAndComplianceService;
6163
import com.lark.oapi.service.sheets.v3.SheetsService;
6264
import com.lark.oapi.service.speech_to_text.v1.SpeechToTextService;
6365
import com.lark.oapi.service.task.v1.TaskService;
@@ -95,6 +97,7 @@ public class Client {
9597
private HireService hire; // 招聘
9698
private HumanAuthenticationService humanAuthentication; // 实名认证
9799
private ImService im; // 消息与群组
100+
private LingoService lingo; //
98101
private MailService mail; // 邮箱
99102
private MdmService mdm; // 主数据
100103
private MeetingRoomService meetingRoom; //
@@ -103,6 +106,7 @@ public class Client {
103106
private PassportService passport; // 帐号
104107
private PersonalSettingsService personalSettings; // 个人设置
105108
private SearchService search; // 搜索
109+
private SecurityAndComplianceService securityAndCompliance; //
106110
private SheetsService sheets; // 云文档-电子表格
107111
private SpeechToTextService speechToText; // AI能力
108112
private TaskService task; // 任务
@@ -318,6 +322,13 @@ public ImService im() {
318322
return im;
319323
}
320324

325+
/**
326+
* @return
327+
*/
328+
public LingoService lingo() {
329+
return lingo;
330+
}
331+
321332
/**
322333
* 邮箱
323334
*
@@ -388,6 +399,13 @@ public SearchService search() {
388399
return search;
389400
}
390401

402+
/**
403+
* @return
404+
*/
405+
public SecurityAndComplianceService securityAndCompliance() {
406+
return securityAndCompliance;
407+
}
408+
391409
/**
392410
* 云文档-电子表格
393411
*
@@ -651,6 +669,7 @@ public Client build() {
651669
client.hire = new HireService(config);
652670
client.humanAuthentication = new HumanAuthenticationService(config);
653671
client.im = new ImService(config);
672+
client.lingo = new LingoService(config);
654673
client.mail = new MailService(config);
655674
client.mdm = new MdmService(config);
656675
client.meetingRoom = new MeetingRoomService(config);
@@ -659,6 +678,7 @@ public Client build() {
659678
client.passport = new PassportService(config);
660679
client.personalSettings = new PersonalSettingsService(config);
661680
client.search = new SearchService(config);
681+
client.securityAndCompliance = new SecurityAndComplianceService(config);
662682
client.sheets = new SheetsService(config);
663683
client.speechToText = new SpeechToTextService(config);
664684
client.task = new TaskService(config);

larksuite-oapi/src/main/java/com/lark/oapi/event/EventDispatcher.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -921,6 +921,21 @@ public Builder onP2PersonUpdatedV1(CorehrService.P2PersonUpdatedV1Handler handle
921921
return this;
922922
}
923923

924+
/**
925+
* <p> ,
926+
* <p> 事件描述文档链接:<a href=""></a>
927+
*
928+
* @param handler
929+
* @return
930+
*/
931+
public Builder onP2PreHireUpdatedV1(CorehrService.P2PreHireUpdatedV1Handler handler) {
932+
if (eventType2EventHandler.containsKey("corehr.pre_hire.updated_v1")) {
933+
throw new EventTypeAlreadyHasHandlerException("corehr.pre_hire.updated_v1");
934+
}
935+
eventType2EventHandler.put("corehr.pre_hire.updated_v1", handler);
936+
return this;
937+
}
938+
924939

925940
/**
926941
* <p> 多维表格字段变更,多维表格字段变更

larksuite-oapi/src/main/java/com/lark/oapi/service/application/v6/ApplicationService.java

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
public class ApplicationService {
3232
private static final Logger log = LoggerFactory.getLogger(ApplicationService.class);
33+
private final AppBadge appBadge; // 应用红点
3334
private final AppRecommendRule appRecommendRule; // 我的常用推荐规则
3435
private final Application application; // 应用
3536
private final ApplicationAppUsage applicationAppUsage; // 应用使用情况
@@ -40,6 +41,7 @@ public class ApplicationService {
4041
private final Bot bot; // 事件
4142

4243
public ApplicationService(Config config) {
44+
this.appBadge = new AppBadge(config);
4345
this.appRecommendRule = new AppRecommendRule(config);
4446
this.application = new Application(config);
4547
this.applicationAppUsage = new ApplicationAppUsage(config);
@@ -50,6 +52,15 @@ public ApplicationService(Config config) {
5052
this.bot = new Bot(config);
5153
}
5254

55+
/**
56+
* 应用红点
57+
*
58+
* @return
59+
*/
60+
public AppBadge appBadge() {
61+
return appBadge;
62+
}
63+
5364
/**
5465
* 我的常用推荐规则
5566
*
@@ -122,6 +133,80 @@ public Bot bot() {
122133
return bot;
123134
}
124135

136+
public static class AppBadge {
137+
private final Config config;
138+
139+
public AppBadge(Config config) {
140+
this.config = config;
141+
}
142+
143+
/**
144+
* 更新应用红点,更新应用红点信息,用于工作台场景
145+
* <p> 官网API文档链接:<a href="https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/app_badge/set">https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/app_badge/set</a> ;
146+
* <p> 使用Demo链接: <a href="https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/SetAppBadgeSample.java">https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/SetAppBadgeSample.java</a> ;
147+
*/
148+
public SetAppBadgeResp set(SetAppBadgeReq req, RequestOptions reqOptions) throws Exception {
149+
// 请求参数选项
150+
if (reqOptions == null) {
151+
reqOptions = new RequestOptions();
152+
}
153+
154+
// 发起请求
155+
RawResponse httpResponse = Transport.send(config, reqOptions, "POST"
156+
, "/open-apis/application/v6/app_badge/set"
157+
, Sets.newHashSet(AccessTokenType.Tenant)
158+
, req);
159+
160+
// 反序列化
161+
SetAppBadgeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SetAppBadgeResp.class);
162+
if (resp == null) {
163+
log.error(String.format(
164+
"%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/app_badge/set"
165+
, Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()),
166+
httpResponse.getStatusCode(), new String(httpResponse.getBody(),
167+
StandardCharsets.UTF_8)));
168+
throw new IllegalArgumentException("The result returned by the server is illegal");
169+
}
170+
171+
resp.setRawResponse(httpResponse);
172+
resp.setRequest(req);
173+
174+
return resp;
175+
}
176+
177+
/**
178+
* 更新应用红点,更新应用红点信息,用于工作台场景
179+
* <p> 官网API文档链接:<a href="https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/app_badge/set">https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/app_badge/set</a> ;
180+
* <p> 使用Demo链接: <a href="https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/SetAppBadgeSample.java">https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/applicationv6/SetAppBadgeSample.java</a> ;
181+
*/
182+
public SetAppBadgeResp set(SetAppBadgeReq req) throws Exception {
183+
// 请求参数选项
184+
RequestOptions reqOptions = new RequestOptions();
185+
186+
// 发起请求
187+
RawResponse httpResponse = Transport.send(config, reqOptions, "POST"
188+
, "/open-apis/application/v6/app_badge/set"
189+
, Sets.newHashSet(AccessTokenType.Tenant)
190+
, req);
191+
192+
// 反序列化
193+
SetAppBadgeResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SetAppBadgeResp.class);
194+
if (resp == null) {
195+
log.error(String.format(
196+
"%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/application/v6/app_badge/set"
197+
, Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()),
198+
httpResponse.getStatusCode(), new String(httpResponse.getBody(),
199+
StandardCharsets.UTF_8)));
200+
throw new IllegalArgumentException("The result returned by the server is illegal");
201+
}
202+
203+
resp.setRawResponse(httpResponse);
204+
resp.setRequest(req);
205+
206+
return resp;
207+
}
208+
}
209+
125210
public static class AppRecommendRule {
126211
private final Config config;
127212

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// Code generated by lark suite 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 com.lark.oapi.service.application.v6.enums;
15+
16+
/**
17+
* 此次调用中使用的用户ID的类型
18+
*/
19+
public enum SetAppBadgeUserIdTypeEnum {
20+
USER_ID("user_id"), // 以user_id来识别用户
21+
UNION_ID("union_id"), // 以union_id来识别用户
22+
OPEN_ID("open_id"), // 以open_id来识别用户
23+
;
24+
private String value;
25+
26+
SetAppBadgeUserIdTypeEnum(String value) {
27+
this.value = value;
28+
}
29+
30+
public String getValue() {
31+
return this.value;
32+
}
33+
}

larksuite-oapi/src/main/java/com/lark/oapi/service/application/v6/model/Application.java

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ public class Application {
4646
*/
4747
@SerializedName("payment_type")
4848
private Integer paymentType;
49+
/**
50+
* 应用创建来源(目前仅Base应用返回)
51+
* <p> 示例值:base
52+
*/
53+
@SerializedName("create_source")
54+
private String createSource;
4955
/**
5056
* 安全设置中的重定向 URL
5157
* <p> 示例值:
@@ -149,6 +155,11 @@ public Application(Builder builder) {
149155
* <p> 示例值:0
150156
*/
151157
this.paymentType = builder.paymentType;
158+
/**
159+
* 应用创建来源(目前仅Base应用返回)
160+
* <p> 示例值:base
161+
*/
162+
this.createSource = builder.createSource;
152163
/**
153164
* 安全设置中的重定向 URL
154165
* <p> 示例值:
@@ -255,6 +266,14 @@ public void setPaymentType(Integer paymentType) {
255266
this.paymentType = paymentType;
256267
}
257268

269+
public String getCreateSource() {
270+
return this.createSource;
271+
}
272+
273+
public void setCreateSource(String createSource) {
274+
this.createSource = createSource;
275+
}
276+
258277
public String[] getRedirectUrls() {
259278
return this.redirectUrls;
260279
}
@@ -377,6 +396,11 @@ public static class Builder {
377396
* <p> 示例值:0
378397
*/
379398
private Integer paymentType;
399+
/**
400+
* 应用创建来源(目前仅Base应用返回)
401+
* <p> 示例值:base
402+
*/
403+
private String createSource;
380404
/**
381405
* 安全设置中的重定向 URL
382406
* <p> 示例值:
@@ -539,6 +563,19 @@ public Builder paymentType(com.lark.oapi.service.application.v6.enums.Applicatio
539563
}
540564

541565

566+
/**
567+
* 应用创建来源(目前仅Base应用返回)
568+
* <p> 示例值:base
569+
*
570+
* @param createSource
571+
* @return
572+
*/
573+
public Builder createSource(String createSource) {
574+
this.createSource = createSource;
575+
return this;
576+
}
577+
578+
542579
/**
543580
* 安全设置中的重定向 URL
544581
* <p> 示例值:

0 commit comments

Comments
 (0)