Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.larksuite.oapi.service.im.v1.ImService Maven / Gradle / Ivy
Go to download
Larksuite open platform facilitates the integration of enterprise applications and larksuite, making
collaboration and management more efficient
// Code generated by lark suite oapi sdk gen
package com.larksuite.oapi.service.im.v1;
import com.larksuite.oapi.core.api.AccessTokenType;
import com.larksuite.oapi.core.api.Api;
import com.larksuite.oapi.core.api.ReqCaller;
import com.larksuite.oapi.core.api.request.*;
import com.larksuite.oapi.core.api.response.*;
import com.larksuite.oapi.core.Config;
import com.larksuite.oapi.core.event.Event;
import com.larksuite.oapi.core.event.IHandler;
import com.larksuite.oapi.service.im.v1.model.*;
import java.io.*;
import java.util.Map;
import java.util.HashMap;
import java.util.Arrays;
import java.util.List;
import java.util.ArrayList;
public class ImService {
private final Config config;
private final Messages messages;
private final Chats chats;
private final ChatMemberUsers chatMemberUsers;
private final ChatMemberBots chatMemberBots;
private final ChatAnnouncements chatAnnouncements;
private final ChatMemberss chatMemberss;
private final Files files;
private final Images images;
private final MessageResources messageResources;
public ImService(Config config) {
this.config = config;
this.messages = new Messages(this);
this.chats = new Chats(this);
this.chatMemberUsers = new ChatMemberUsers(this);
this.chatMemberBots = new ChatMemberBots(this);
this.chatAnnouncements = new ChatAnnouncements(this);
this.chatMemberss = new ChatMemberss(this);
this.files = new Files(this);
this.images = new Images(this);
this.messageResources = new MessageResources(this);
}
public Messages getMessages() {
return messages;
}
public static class Messages {
private final ImService service;
public Messages(ImService service) {
this.service = service;
}
public MessageListReqCall list(RequestOptFn... optFns) {
return new MessageListReqCall(this, optFns);
}
public MessagePatchReqCall patch(MessagePatchReqBody body, RequestOptFn... optFns) {
return new MessagePatchReqCall(this, body, optFns);
}
public MessageReplyReqCall reply(MessageReplyReqBody body, RequestOptFn... optFns) {
return new MessageReplyReqCall(this, body, optFns);
}
public MessageCreateReqCall create(MessageCreateReqBody body, RequestOptFn... optFns) {
return new MessageCreateReqCall(this, body, optFns);
}
public MessageDeleteReqCall delete(RequestOptFn... optFns) {
return new MessageDeleteReqCall(this, optFns);
}
public MessageReadUsersReqCall readUsers(RequestOptFn... optFns) {
return new MessageReadUsersReqCall(this, optFns);
}
public MessageGetReqCall get(RequestOptFn... optFns) {
return new MessageGetReqCall(this, optFns);
}
}
public static class MessageListReqCall extends ReqCaller {
private final Messages messages;
private final Map queryParams;
private final List optFns;
private MessageListResult result;
private MessageListReqCall(Messages messages, RequestOptFn... optFns) {
this.queryParams = new HashMap<>();
this.optFns = new ArrayList<>();
this.optFns.addAll(Arrays.asList(optFns));
this.result = new MessageListResult();
this.messages = messages;
}
public MessageListReqCall setContainerIdType(String containerIdType){
this.queryParams.put("container_id_type", containerIdType);
return this;
}
public MessageListReqCall setContainerId(String containerId){
this.queryParams.put("container_id", containerId);
return this;
}
public MessageListReqCall setStartTime(String startTime){
this.queryParams.put("start_time", startTime);
return this;
}
public MessageListReqCall setEndTime(String endTime){
this.queryParams.put("end_time", endTime);
return this;
}
public MessageListReqCall setPageToken(String pageToken){
this.queryParams.put("page_token", pageToken);
return this;
}
public MessageListReqCall setPageSize(Integer pageSize){
this.queryParams.put("page_size", pageSize);
return this;
}
@Override
public Response execute() throws Exception {
this.optFns.add(com.larksuite.oapi.core.api.request.Request.setQueryParams(this.queryParams));
com.larksuite.oapi.core.api.request.Request request = com.larksuite.oapi.core.api.request.Request.newRequest("/open-apis/im/v1/messages", "GET",
new AccessTokenType[]{AccessTokenType.Tenant},
null, this.result, this.optFns.toArray(new RequestOptFn[]{}));
return Api.send(this.messages.service.config, request);
}
}
public static class MessagePatchReqCall extends ReqCaller {
private final Messages messages;
private final MessagePatchReqBody body;
private final Map pathParams;
private final List optFns;
private EmptyData result;
private MessagePatchReqCall(Messages messages, MessagePatchReqBody body, RequestOptFn... optFns) {
this.body = body;
this.pathParams = new HashMap<>();
this.optFns = new ArrayList<>();
this.optFns.addAll(Arrays.asList(optFns));
this.result = new EmptyData();
this.messages = messages;
}
public MessagePatchReqCall setMessageId(String messageId){
this.pathParams.put("message_id", messageId);
return this;
}
@Override
public Response execute() throws Exception {
this.optFns.add(com.larksuite.oapi.core.api.request.Request.setPathParams(this.pathParams));
com.larksuite.oapi.core.api.request.Request request = com.larksuite.oapi.core.api.request.Request.newRequest("/open-apis/im/v1/messages/:message_id", "PATCH",
new AccessTokenType[]{AccessTokenType.Tenant, AccessTokenType.User},
this.body, this.result, this.optFns.toArray(new RequestOptFn[]{}));
return Api.send(this.messages.service.config, request);
}
}
public static class MessageReplyReqCall extends ReqCaller {
private final Messages messages;
private final MessageReplyReqBody body;
private final Map pathParams;
private final List optFns;
private Message result;
private MessageReplyReqCall(Messages messages, MessageReplyReqBody body, RequestOptFn... optFns) {
this.body = body;
this.pathParams = new HashMap<>();
this.optFns = new ArrayList<>();
this.optFns.addAll(Arrays.asList(optFns));
this.result = new Message();
this.messages = messages;
}
public MessageReplyReqCall setMessageId(String messageId){
this.pathParams.put("message_id", messageId);
return this;
}
@Override
public Response execute() throws Exception {
this.optFns.add(com.larksuite.oapi.core.api.request.Request.setPathParams(this.pathParams));
com.larksuite.oapi.core.api.request.Request request = com.larksuite.oapi.core.api.request.Request.newRequest("/open-apis/im/v1/messages/:message_id/reply", "POST",
new AccessTokenType[]{AccessTokenType.Tenant},
this.body, this.result, this.optFns.toArray(new RequestOptFn[]{}));
return Api.send(this.messages.service.config, request);
}
}
public static class MessageCreateReqCall extends ReqCaller {
private final Messages messages;
private final MessageCreateReqBody body;
private final Map queryParams;
private final List optFns;
private Message result;
private MessageCreateReqCall(Messages messages, MessageCreateReqBody body, RequestOptFn... optFns) {
this.body = body;
this.queryParams = new HashMap<>();
this.optFns = new ArrayList<>();
this.optFns.addAll(Arrays.asList(optFns));
this.result = new Message();
this.messages = messages;
}
public MessageCreateReqCall setReceiveIdType(String receiveIdType){
this.queryParams.put("receive_id_type", receiveIdType);
return this;
}
@Override
public Response execute() throws Exception {
this.optFns.add(com.larksuite.oapi.core.api.request.Request.setQueryParams(this.queryParams));
com.larksuite.oapi.core.api.request.Request request = com.larksuite.oapi.core.api.request.Request.newRequest("/open-apis/im/v1/messages", "POST",
new AccessTokenType[]{AccessTokenType.Tenant},
this.body, this.result, this.optFns.toArray(new RequestOptFn[]{}));
return Api.send(this.messages.service.config, request);
}
}
public static class MessageDeleteReqCall extends ReqCaller {
private final Messages messages;
private final Map pathParams;
private final List optFns;
private EmptyData result;
private MessageDeleteReqCall(Messages messages, RequestOptFn... optFns) {
this.pathParams = new HashMap<>();
this.optFns = new ArrayList<>();
this.optFns.addAll(Arrays.asList(optFns));
this.result = new EmptyData();
this.messages = messages;
}
public MessageDeleteReqCall setMessageId(String messageId){
this.pathParams.put("message_id", messageId);
return this;
}
@Override
public Response execute() throws Exception {
this.optFns.add(com.larksuite.oapi.core.api.request.Request.setPathParams(this.pathParams));
com.larksuite.oapi.core.api.request.Request request = com.larksuite.oapi.core.api.request.Request.newRequest("/open-apis/im/v1/messages/:message_id", "DELETE",
new AccessTokenType[]{AccessTokenType.Tenant, AccessTokenType.User},
null, this.result, this.optFns.toArray(new RequestOptFn[]{}));
return Api.send(this.messages.service.config, request);
}
}
public static class MessageReadUsersReqCall extends ReqCaller {
private final Messages messages;
private final Map pathParams;
private final Map queryParams;
private final List optFns;
private MessageReadUsersResult result;
private MessageReadUsersReqCall(Messages messages, RequestOptFn... optFns) {
this.pathParams = new HashMap<>();
this.queryParams = new HashMap<>();
this.optFns = new ArrayList<>();
this.optFns.addAll(Arrays.asList(optFns));
this.result = new MessageReadUsersResult();
this.messages = messages;
}
public MessageReadUsersReqCall setMessageId(String messageId){
this.pathParams.put("message_id", messageId);
return this;
}
public MessageReadUsersReqCall setUserIdType(String userIdType){
this.queryParams.put("user_id_type", userIdType);
return this;
}
public MessageReadUsersReqCall setPageSize(Integer pageSize){
this.queryParams.put("page_size", pageSize);
return this;
}
public MessageReadUsersReqCall setPageToken(String pageToken){
this.queryParams.put("page_token", pageToken);
return this;
}
@Override
public Response execute() throws Exception {
this.optFns.add(com.larksuite.oapi.core.api.request.Request.setPathParams(this.pathParams));
this.optFns.add(com.larksuite.oapi.core.api.request.Request.setQueryParams(this.queryParams));
com.larksuite.oapi.core.api.request.Request request = com.larksuite.oapi.core.api.request.Request.newRequest("/open-apis/im/v1/messages/:message_id/read_users", "GET",
new AccessTokenType[]{AccessTokenType.Tenant},
null, this.result, this.optFns.toArray(new RequestOptFn[]{}));
return Api.send(this.messages.service.config, request);
}
}
public static class MessageGetReqCall extends ReqCaller {
private final Messages messages;
private final Map pathParams;
private final List optFns;
private MessageGetResult result;
private MessageGetReqCall(Messages messages, RequestOptFn... optFns) {
this.pathParams = new HashMap<>();
this.optFns = new ArrayList<>();
this.optFns.addAll(Arrays.asList(optFns));
this.result = new MessageGetResult();
this.messages = messages;
}
public MessageGetReqCall setMessageId(String messageId){
this.pathParams.put("message_id", messageId);
return this;
}
@Override
public Response execute() throws Exception {
this.optFns.add(com.larksuite.oapi.core.api.request.Request.setPathParams(this.pathParams));
com.larksuite.oapi.core.api.request.Request request = com.larksuite.oapi.core.api.request.Request.newRequest("/open-apis/im/v1/messages/:message_id", "GET",
new AccessTokenType[]{AccessTokenType.Tenant},
null, this.result, this.optFns.toArray(new RequestOptFn[]{}));
return Api.send(this.messages.service.config, request);
}
}
public Chats getChats() {
return chats;
}
public static class Chats {
private final ImService service;
public Chats(ImService service) {
this.service = service;
}
public ChatUpdateReqCall update(ChatUpdateReqBody body, RequestOptFn... optFns) {
return new ChatUpdateReqCall(this, body, optFns);
}
public ChatListReqCall list(RequestOptFn... optFns) {
return new ChatListReqCall(this, optFns);
}
public ChatDeleteReqCall delete(RequestOptFn... optFns) {
return new ChatDeleteReqCall(this, optFns);
}
public ChatGetReqCall get(RequestOptFn... optFns) {
return new ChatGetReqCall(this, optFns);
}
public ChatCreateReqCall create(ChatCreateReqBody body, RequestOptFn... optFns) {
return new ChatCreateReqCall(this, body, optFns);
}
public ChatSearchReqCall search(RequestOptFn... optFns) {
return new ChatSearchReqCall(this, optFns);
}
}
public static class ChatUpdateReqCall extends ReqCaller {
private final Chats chats;
private final ChatUpdateReqBody body;
private final Map pathParams;
private final Map queryParams;
private final List optFns;
private EmptyData result;
private ChatUpdateReqCall(Chats chats, ChatUpdateReqBody body, RequestOptFn... optFns) {
this.body = body;
this.pathParams = new HashMap<>();
this.queryParams = new HashMap<>();
this.optFns = new ArrayList<>();
this.optFns.addAll(Arrays.asList(optFns));
this.result = new EmptyData();
this.chats = chats;
}
public ChatUpdateReqCall setChatId(String chatId){
this.pathParams.put("chat_id", chatId);
return this;
}
public ChatUpdateReqCall setUserIdType(String userIdType){
this.queryParams.put("user_id_type", userIdType);
return this;
}
@Override
public Response execute() throws Exception {
this.optFns.add(com.larksuite.oapi.core.api.request.Request.setPathParams(this.pathParams));
this.optFns.add(com.larksuite.oapi.core.api.request.Request.setQueryParams(this.queryParams));
com.larksuite.oapi.core.api.request.Request request = com.larksuite.oapi.core.api.request.Request.newRequest("/open-apis/im/v1/chats/:chat_id", "PUT",
new AccessTokenType[]{AccessTokenType.Tenant, AccessTokenType.User},
this.body, this.result, this.optFns.toArray(new RequestOptFn[]{}));
return Api.send(this.chats.service.config, request);
}
}
public static class ChatListReqCall extends ReqCaller {
private final Chats chats;
private final Map queryParams;
private final List optFns;
private ChatListResult result;
private ChatListReqCall(Chats chats, RequestOptFn... optFns) {
this.queryParams = new HashMap<>();
this.optFns = new ArrayList<>();
this.optFns.addAll(Arrays.asList(optFns));
this.result = new ChatListResult();
this.chats = chats;
}
public ChatListReqCall setUserIdType(String userIdType){
this.queryParams.put("user_id_type", userIdType);
return this;
}
public ChatListReqCall setPageToken(String pageToken){
this.queryParams.put("page_token", pageToken);
return this;
}
public ChatListReqCall setPageSize(Integer pageSize){
this.queryParams.put("page_size", pageSize);
return this;
}
@Override
public Response execute() throws Exception {
this.optFns.add(com.larksuite.oapi.core.api.request.Request.setQueryParams(this.queryParams));
com.larksuite.oapi.core.api.request.Request request = com.larksuite.oapi.core.api.request.Request.newRequest("/open-apis/im/v1/chats", "GET",
new AccessTokenType[]{AccessTokenType.User, AccessTokenType.Tenant},
null, this.result, this.optFns.toArray(new RequestOptFn[]{}));
return Api.send(this.chats.service.config, request);
}
}
public static class ChatDeleteReqCall extends ReqCaller {
private final Chats chats;
private final Map pathParams;
private final List optFns;
private EmptyData result;
private ChatDeleteReqCall(Chats chats, RequestOptFn... optFns) {
this.pathParams = new HashMap<>();
this.optFns = new ArrayList<>();
this.optFns.addAll(Arrays.asList(optFns));
this.result = new EmptyData();
this.chats = chats;
}
public ChatDeleteReqCall setChatId(String chatId){
this.pathParams.put("chat_id", chatId);
return this;
}
@Override
public Response execute() throws Exception {
this.optFns.add(com.larksuite.oapi.core.api.request.Request.setPathParams(this.pathParams));
com.larksuite.oapi.core.api.request.Request request = com.larksuite.oapi.core.api.request.Request.newRequest("/open-apis/im/v1/chats/:chat_id", "DELETE",
new AccessTokenType[]{AccessTokenType.User, AccessTokenType.Tenant},
null, this.result, this.optFns.toArray(new RequestOptFn[]{}));
return Api.send(this.chats.service.config, request);
}
}
public static class ChatGetReqCall extends ReqCaller {
private final Chats chats;
private final Map pathParams;
private final Map queryParams;
private final List optFns;
private ChatGetResult result;
private ChatGetReqCall(Chats chats, RequestOptFn... optFns) {
this.pathParams = new HashMap<>();
this.queryParams = new HashMap<>();
this.optFns = new ArrayList<>();
this.optFns.addAll(Arrays.asList(optFns));
this.result = new ChatGetResult();
this.chats = chats;
}
public ChatGetReqCall setChatId(String chatId){
this.pathParams.put("chat_id", chatId);
return this;
}
public ChatGetReqCall setUserIdType(String userIdType){
this.queryParams.put("user_id_type", userIdType);
return this;
}
@Override
public Response execute() throws Exception {
this.optFns.add(com.larksuite.oapi.core.api.request.Request.setPathParams(this.pathParams));
this.optFns.add(com.larksuite.oapi.core.api.request.Request.setQueryParams(this.queryParams));
com.larksuite.oapi.core.api.request.Request request = com.larksuite.oapi.core.api.request.Request.newRequest("/open-apis/im/v1/chats/:chat_id", "GET",
new AccessTokenType[]{AccessTokenType.User, AccessTokenType.Tenant},
null, this.result, this.optFns.toArray(new RequestOptFn[]{}));
return Api.send(this.chats.service.config, request);
}
}
public static class ChatCreateReqCall extends ReqCaller {
private final Chats chats;
private final ChatCreateReqBody body;
private final Map queryParams;
private final List optFns;
private ChatCreateResult result;
private ChatCreateReqCall(Chats chats, ChatCreateReqBody body, RequestOptFn... optFns) {
this.body = body;
this.queryParams = new HashMap<>();
this.optFns = new ArrayList<>();
this.optFns.addAll(Arrays.asList(optFns));
this.result = new ChatCreateResult();
this.chats = chats;
}
public ChatCreateReqCall setUserIdType(String userIdType){
this.queryParams.put("user_id_type", userIdType);
return this;
}
@Override
public Response execute() throws Exception {
this.optFns.add(com.larksuite.oapi.core.api.request.Request.setQueryParams(this.queryParams));
com.larksuite.oapi.core.api.request.Request request = com.larksuite.oapi.core.api.request.Request.newRequest("/open-apis/im/v1/chats", "POST",
new AccessTokenType[]{AccessTokenType.Tenant},
this.body, this.result, this.optFns.toArray(new RequestOptFn[]{}));
return Api.send(this.chats.service.config, request);
}
}
public static class ChatSearchReqCall extends ReqCaller {
private final Chats chats;
private final Map queryParams;
private final List optFns;
private ChatSearchResult result;
private ChatSearchReqCall(Chats chats, RequestOptFn... optFns) {
this.queryParams = new HashMap<>();
this.optFns = new ArrayList<>();
this.optFns.addAll(Arrays.asList(optFns));
this.result = new ChatSearchResult();
this.chats = chats;
}
public ChatSearchReqCall setUserIdType(String userIdType){
this.queryParams.put("user_id_type", userIdType);
return this;
}
public ChatSearchReqCall setQuery(String query){
this.queryParams.put("query", query);
return this;
}
public ChatSearchReqCall setPageToken(String pageToken){
this.queryParams.put("page_token", pageToken);
return this;
}
public ChatSearchReqCall setPageSize(Integer pageSize){
this.queryParams.put("page_size", pageSize);
return this;
}
@Override
public Response execute() throws Exception {
this.optFns.add(com.larksuite.oapi.core.api.request.Request.setQueryParams(this.queryParams));
com.larksuite.oapi.core.api.request.Request request = com.larksuite.oapi.core.api.request.Request.newRequest("/open-apis/im/v1/chats/search", "GET",
new AccessTokenType[]{AccessTokenType.User, AccessTokenType.Tenant},
null, this.result, this.optFns.toArray(new RequestOptFn[]{}));
return Api.send(this.chats.service.config, request);
}
}
public ChatMemberUsers getChatMemberUsers() {
return chatMemberUsers;
}
public static class ChatMemberUsers {
private final ImService service;
public ChatMemberUsers(ImService service) {
this.service = service;
}
}
public ChatMemberBots getChatMemberBots() {
return chatMemberBots;
}
public static class ChatMemberBots {
private final ImService service;
public ChatMemberBots(ImService service) {
this.service = service;
}
}
public ChatAnnouncements getChatAnnouncements() {
return chatAnnouncements;
}
public static class ChatAnnouncements {
private final ImService service;
public ChatAnnouncements(ImService service) {
this.service = service;
}
public ChatAnnouncementGetReqCall get(RequestOptFn... optFns) {
return new ChatAnnouncementGetReqCall(this, optFns);
}
public ChatAnnouncementPatchReqCall patch(ChatAnnouncementPatchReqBody body, RequestOptFn... optFns) {
return new ChatAnnouncementPatchReqCall(this, body, optFns);
}
}
public static class ChatAnnouncementGetReqCall extends ReqCaller {
private final ChatAnnouncements chatAnnouncements;
private final Map pathParams;
private final Map queryParams;
private final List optFns;
private ChatAnnouncementGetResult result;
private ChatAnnouncementGetReqCall(ChatAnnouncements chatAnnouncements, RequestOptFn... optFns) {
this.pathParams = new HashMap<>();
this.queryParams = new HashMap<>();
this.optFns = new ArrayList<>();
this.optFns.addAll(Arrays.asList(optFns));
this.result = new ChatAnnouncementGetResult();
this.chatAnnouncements = chatAnnouncements;
}
public ChatAnnouncementGetReqCall setChatId(String chatId){
this.pathParams.put("chat_id", chatId);
return this;
}
public ChatAnnouncementGetReqCall setUserIdType(String userIdType){
this.queryParams.put("user_id_type", userIdType);
return this;
}
@Override
public Response execute() throws Exception {
this.optFns.add(com.larksuite.oapi.core.api.request.Request.setPathParams(this.pathParams));
this.optFns.add(com.larksuite.oapi.core.api.request.Request.setQueryParams(this.queryParams));
com.larksuite.oapi.core.api.request.Request request = com.larksuite.oapi.core.api.request.Request.newRequest("/open-apis/im/v1/chats/:chat_id/announcement", "GET",
new AccessTokenType[]{AccessTokenType.User, AccessTokenType.Tenant},
null, this.result, this.optFns.toArray(new RequestOptFn[]{}));
return Api.send(this.chatAnnouncements.service.config, request);
}
}
public static class ChatAnnouncementPatchReqCall extends ReqCaller {
private final ChatAnnouncements chatAnnouncements;
private final ChatAnnouncementPatchReqBody body;
private final Map pathParams;
private final List optFns;
private EmptyData result;
private ChatAnnouncementPatchReqCall(ChatAnnouncements chatAnnouncements, ChatAnnouncementPatchReqBody body, RequestOptFn... optFns) {
this.body = body;
this.pathParams = new HashMap<>();
this.optFns = new ArrayList<>();
this.optFns.addAll(Arrays.asList(optFns));
this.result = new EmptyData();
this.chatAnnouncements = chatAnnouncements;
}
public ChatAnnouncementPatchReqCall setChatId(String chatId){
this.pathParams.put("chat_id", chatId);
return this;
}
@Override
public Response execute() throws Exception {
this.optFns.add(com.larksuite.oapi.core.api.request.Request.setPathParams(this.pathParams));
com.larksuite.oapi.core.api.request.Request request = com.larksuite.oapi.core.api.request.Request.newRequest("/open-apis/im/v1/chats/:chat_id/announcement", "PATCH",
new AccessTokenType[]{AccessTokenType.User, AccessTokenType.Tenant},
this.body, this.result, this.optFns.toArray(new RequestOptFn[]{}));
return Api.send(this.chatAnnouncements.service.config, request);
}
}
public ChatMemberss getChatMemberss() {
return chatMemberss;
}
public static class ChatMemberss {
private final ImService service;
public ChatMemberss(ImService service) {
this.service = service;
}
public ChatMembersCreateReqCall create(ChatMembersCreateReqBody body, RequestOptFn... optFns) {
return new ChatMembersCreateReqCall(this, body, optFns);
}
public ChatMembersDeleteReqCall delete(ChatMembersDeleteReqBody body, RequestOptFn... optFns) {
return new ChatMembersDeleteReqCall(this, body, optFns);
}
public ChatMembersGetReqCall get(RequestOptFn... optFns) {
return new ChatMembersGetReqCall(this, optFns);
}
public ChatMembersIsInChatReqCall isInChat(RequestOptFn... optFns) {
return new ChatMembersIsInChatReqCall(this, optFns);
}
public ChatMembersMeJoinReqCall meJoin(RequestOptFn... optFns) {
return new ChatMembersMeJoinReqCall(this, optFns);
}
}
public static class ChatMembersCreateReqCall extends ReqCaller {
private final ChatMemberss chatMemberss;
private final ChatMembersCreateReqBody body;
private final Map pathParams;
private final Map queryParams;
private final List optFns;
private ChatMembersCreateResult result;
private ChatMembersCreateReqCall(ChatMemberss chatMemberss, ChatMembersCreateReqBody body, RequestOptFn... optFns) {
this.body = body;
this.pathParams = new HashMap<>();
this.queryParams = new HashMap<>();
this.optFns = new ArrayList<>();
this.optFns.addAll(Arrays.asList(optFns));
this.result = new ChatMembersCreateResult();
this.chatMemberss = chatMemberss;
}
public ChatMembersCreateReqCall setChatId(String chatId){
this.pathParams.put("chat_id", chatId);
return this;
}
public ChatMembersCreateReqCall setMemberIdType(String memberIdType){
this.queryParams.put("member_id_type", memberIdType);
return this;
}
@Override
public Response execute() throws Exception {
this.optFns.add(com.larksuite.oapi.core.api.request.Request.setPathParams(this.pathParams));
this.optFns.add(com.larksuite.oapi.core.api.request.Request.setQueryParams(this.queryParams));
com.larksuite.oapi.core.api.request.Request request = com.larksuite.oapi.core.api.request.Request.newRequest("/open-apis/im/v1/chats/:chat_id/members", "POST",
new AccessTokenType[]{AccessTokenType.User, AccessTokenType.Tenant},
this.body, this.result, this.optFns.toArray(new RequestOptFn[]{}));
return Api.send(this.chatMemberss.service.config, request);
}
}
public static class ChatMembersDeleteReqCall extends ReqCaller {
private final ChatMemberss chatMemberss;
private final ChatMembersDeleteReqBody body;
private final Map pathParams;
private final Map queryParams;
private final List optFns;
private ChatMembersDeleteResult result;
private ChatMembersDeleteReqCall(ChatMemberss chatMemberss, ChatMembersDeleteReqBody body, RequestOptFn... optFns) {
this.body = body;
this.pathParams = new HashMap<>();
this.queryParams = new HashMap<>();
this.optFns = new ArrayList<>();
this.optFns.addAll(Arrays.asList(optFns));
this.result = new ChatMembersDeleteResult();
this.chatMemberss = chatMemberss;
}
public ChatMembersDeleteReqCall setChatId(String chatId){
this.pathParams.put("chat_id", chatId);
return this;
}
public ChatMembersDeleteReqCall setMemberIdType(String memberIdType){
this.queryParams.put("member_id_type", memberIdType);
return this;
}
@Override
public Response execute() throws Exception {
this.optFns.add(com.larksuite.oapi.core.api.request.Request.setPathParams(this.pathParams));
this.optFns.add(com.larksuite.oapi.core.api.request.Request.setQueryParams(this.queryParams));
com.larksuite.oapi.core.api.request.Request request = com.larksuite.oapi.core.api.request.Request.newRequest("/open-apis/im/v1/chats/:chat_id/members", "DELETE",
new AccessTokenType[]{AccessTokenType.User, AccessTokenType.Tenant},
this.body, this.result, this.optFns.toArray(new RequestOptFn[]{}));
return Api.send(this.chatMemberss.service.config, request);
}
}
public static class ChatMembersGetReqCall extends ReqCaller {
private final ChatMemberss chatMemberss;
private final Map pathParams;
private final Map queryParams;
private final List optFns;
private ChatMembersGetResult result;
private ChatMembersGetReqCall(ChatMemberss chatMemberss, RequestOptFn... optFns) {
this.pathParams = new HashMap<>();
this.queryParams = new HashMap<>();
this.optFns = new ArrayList<>();
this.optFns.addAll(Arrays.asList(optFns));
this.result = new ChatMembersGetResult();
this.chatMemberss = chatMemberss;
}
public ChatMembersGetReqCall setChatId(String chatId){
this.pathParams.put("chat_id", chatId);
return this;
}
public ChatMembersGetReqCall setMemberIdType(String memberIdType){
this.queryParams.put("member_id_type", memberIdType);
return this;
}
public ChatMembersGetReqCall setPageToken(String pageToken){
this.queryParams.put("page_token", pageToken);
return this;
}
public ChatMembersGetReqCall setPageSize(Integer pageSize){
this.queryParams.put("page_size", pageSize);
return this;
}
@Override
public Response execute() throws Exception {
this.optFns.add(com.larksuite.oapi.core.api.request.Request.setPathParams(this.pathParams));
this.optFns.add(com.larksuite.oapi.core.api.request.Request.setQueryParams(this.queryParams));
com.larksuite.oapi.core.api.request.Request request = com.larksuite.oapi.core.api.request.Request.newRequest("/open-apis/im/v1/chats/:chat_id/members", "GET",
new AccessTokenType[]{AccessTokenType.User, AccessTokenType.Tenant},
null, this.result, this.optFns.toArray(new RequestOptFn[]{}));
return Api.send(this.chatMemberss.service.config, request);
}
}
public static class ChatMembersIsInChatReqCall extends ReqCaller {
private final ChatMemberss chatMemberss;
private final Map pathParams;
private final List optFns;
private ChatMembersIsInChatResult result;
private ChatMembersIsInChatReqCall(ChatMemberss chatMemberss, RequestOptFn... optFns) {
this.pathParams = new HashMap<>();
this.optFns = new ArrayList<>();
this.optFns.addAll(Arrays.asList(optFns));
this.result = new ChatMembersIsInChatResult();
this.chatMemberss = chatMemberss;
}
public ChatMembersIsInChatReqCall setChatId(String chatId){
this.pathParams.put("chat_id", chatId);
return this;
}
@Override
public Response execute() throws Exception {
this.optFns.add(com.larksuite.oapi.core.api.request.Request.setPathParams(this.pathParams));
com.larksuite.oapi.core.api.request.Request request = com.larksuite.oapi.core.api.request.Request.newRequest("/open-apis/im/v1/chats/:chat_id/members/is_in_chat", "GET",
new AccessTokenType[]{AccessTokenType.User, AccessTokenType.Tenant},
null, this.result, this.optFns.toArray(new RequestOptFn[]{}));
return Api.send(this.chatMemberss.service.config, request);
}
}
public static class ChatMembersMeJoinReqCall extends ReqCaller {
private final ChatMemberss chatMemberss;
private final Map pathParams;
private final List optFns;
private EmptyData result;
private ChatMembersMeJoinReqCall(ChatMemberss chatMemberss, RequestOptFn... optFns) {
this.pathParams = new HashMap<>();
this.optFns = new ArrayList<>();
this.optFns.addAll(Arrays.asList(optFns));
this.result = new EmptyData();
this.chatMemberss = chatMemberss;
}
public ChatMembersMeJoinReqCall setChatId(String chatId){
this.pathParams.put("chat_id", chatId);
return this;
}
@Override
public Response execute() throws Exception {
this.optFns.add(com.larksuite.oapi.core.api.request.Request.setPathParams(this.pathParams));
com.larksuite.oapi.core.api.request.Request request = com.larksuite.oapi.core.api.request.Request.newRequest("/open-apis/im/v1/chats/:chat_id/members/me_join", "PATCH",
new AccessTokenType[]{AccessTokenType.User, AccessTokenType.Tenant},
null, this.result, this.optFns.toArray(new RequestOptFn[]{}));
return Api.send(this.chatMemberss.service.config, request);
}
}
public Files getFiles() {
return files;
}
public static class Files {
private final ImService service;
public Files(ImService service) {
this.service = service;
}
public FileCreateReqCall create(RequestOptFn... optFns) {
return new FileCreateReqCall(this, optFns);
}
public FileGetReqCall get(RequestOptFn... optFns) {
return new FileGetReqCall(this, optFns);
}
}
public static class FileCreateReqCall extends ReqCaller {
private final Files files;
private final FormData body;
private final List optFns;
private FileCreateResult result;
private FileCreateReqCall(Files files, RequestOptFn... optFns) {
this.body = new FormData();
this.optFns = new ArrayList<>();
this.optFns.addAll(Arrays.asList(optFns));
this.result = new FileCreateResult();
this.files = files;
}
public FileCreateReqCall setFileType(String fileType){
this.body.addField("file_type", fileType);
return this;
}
public FileCreateReqCall setFileName(String fileName){
this.body.addField("file_name", fileName);
return this;
}
public FileCreateReqCall setDuration(Integer duration){
this.body.addField("duration", duration);
return this;
}
public FileCreateReqCall setFile(FormDataFile file){
this.body.addFile("file", file);
return this;
}
@Override
public Response execute() throws Exception {
com.larksuite.oapi.core.api.request.Request request = com.larksuite.oapi.core.api.request.Request.newRequest("/open-apis/im/v1/files", "POST",
new AccessTokenType[]{AccessTokenType.Tenant},
this.body, this.result, this.optFns.toArray(new RequestOptFn[]{}));
return Api.send(this.files.service.config, request);
}
}
public static class FileGetReqCall extends ReqCaller {
private final Files files;
private final Map pathParams;
private final List optFns;
private OutputStream result;
private FileGetReqCall(Files files, RequestOptFn... optFns) {
this.pathParams = new HashMap<>();
this.optFns = new ArrayList<>();
this.optFns.addAll(Arrays.asList(optFns));
this.files = files;
}
public FileGetReqCall setFileKey(String fileKey){
this.pathParams.put("file_key", fileKey);
return this;
}
public FileGetReqCall setResponseStream(OutputStream result){
this.result = result;
return this;
}
@Override
public Response execute() throws Exception {
this.optFns.add(com.larksuite.oapi.core.api.request.Request.setPathParams(this.pathParams));
this.optFns.add(com.larksuite.oapi.core.api.request.Request.setResponseStream());
com.larksuite.oapi.core.api.request.Request request = com.larksuite.oapi.core.api.request.Request.newRequest("/open-apis/im/v1/files/:file_key", "GET",
new AccessTokenType[]{AccessTokenType.Tenant},
null, this.result, this.optFns.toArray(new RequestOptFn[]{}));
return Api.send(this.files.service.config, request);
}
}
public Images getImages() {
return images;
}
public static class Images {
private final ImService service;
public Images(ImService service) {
this.service = service;
}
public ImageCreateReqCall create(RequestOptFn... optFns) {
return new ImageCreateReqCall(this, optFns);
}
public ImageGetReqCall get(RequestOptFn... optFns) {
return new ImageGetReqCall(this, optFns);
}
}
public static class ImageCreateReqCall extends ReqCaller {
private final Images images;
private final FormData body;
private final List optFns;
private ImageCreateResult result;
private ImageCreateReqCall(Images images, RequestOptFn... optFns) {
this.body = new FormData();
this.optFns = new ArrayList<>();
this.optFns.addAll(Arrays.asList(optFns));
this.result = new ImageCreateResult();
this.images = images;
}
public ImageCreateReqCall setImageType(String imageType){
this.body.addField("image_type", imageType);
return this;
}
public ImageCreateReqCall setImage(FormDataFile image){
this.body.addFile("image", image);
return this;
}
@Override
public Response execute() throws Exception {
com.larksuite.oapi.core.api.request.Request request = com.larksuite.oapi.core.api.request.Request.newRequest("/open-apis/im/v1/images", "POST",
new AccessTokenType[]{AccessTokenType.Tenant},
this.body, this.result, this.optFns.toArray(new RequestOptFn[]{}));
return Api.send(this.images.service.config, request);
}
}
public static class ImageGetReqCall extends ReqCaller {
private final Images images;
private final Map pathParams;
private final List optFns;
private OutputStream result;
private ImageGetReqCall(Images images, RequestOptFn... optFns) {
this.pathParams = new HashMap<>();
this.optFns = new ArrayList<>();
this.optFns.addAll(Arrays.asList(optFns));
this.images = images;
}
public ImageGetReqCall setImageKey(String imageKey){
this.pathParams.put("image_key", imageKey);
return this;
}
public ImageGetReqCall setResponseStream(OutputStream result){
this.result = result;
return this;
}
@Override
public Response execute() throws Exception {
this.optFns.add(com.larksuite.oapi.core.api.request.Request.setPathParams(this.pathParams));
this.optFns.add(com.larksuite.oapi.core.api.request.Request.setResponseStream());
com.larksuite.oapi.core.api.request.Request request = com.larksuite.oapi.core.api.request.Request.newRequest("/open-apis/im/v1/images/:image_key", "GET",
new AccessTokenType[]{AccessTokenType.Tenant},
null, this.result, this.optFns.toArray(new RequestOptFn[]{}));
return Api.send(this.images.service.config, request);
}
}
public MessageResources getMessageResources() {
return messageResources;
}
public static class MessageResources {
private final ImService service;
public MessageResources(ImService service) {
this.service = service;
}
public MessageResourceGetReqCall get(RequestOptFn... optFns) {
return new MessageResourceGetReqCall(this, optFns);
}
}
public static class MessageResourceGetReqCall extends ReqCaller {
private final MessageResources messageResources;
private final Map pathParams;
private final Map queryParams;
private final List optFns;
private OutputStream result;
private MessageResourceGetReqCall(MessageResources messageResources, RequestOptFn... optFns) {
this.pathParams = new HashMap<>();
this.queryParams = new HashMap<>();
this.optFns = new ArrayList<>();
this.optFns.addAll(Arrays.asList(optFns));
this.messageResources = messageResources;
}
public MessageResourceGetReqCall setMessageId(String messageId){
this.pathParams.put("message_id", messageId);
return this;
}
public MessageResourceGetReqCall setFileKey(String fileKey){
this.pathParams.put("file_key", fileKey);
return this;
}
public MessageResourceGetReqCall setType(String type){
this.queryParams.put("type", type);
return this;
}
public MessageResourceGetReqCall setResponseStream(OutputStream result){
this.result = result;
return this;
}
@Override
public Response execute() throws Exception {
this.optFns.add(com.larksuite.oapi.core.api.request.Request.setPathParams(this.pathParams));
this.optFns.add(com.larksuite.oapi.core.api.request.Request.setQueryParams(this.queryParams));
this.optFns.add(com.larksuite.oapi.core.api.request.Request.setResponseStream());
com.larksuite.oapi.core.api.request.Request request = com.larksuite.oapi.core.api.request.Request.newRequest("/open-apis/im/v1/messages/:message_id/resources/:file_key", "GET",
new AccessTokenType[]{AccessTokenType.Tenant},
null, this.result, this.optFns.toArray(new RequestOptFn[]{}));
return Api.send(this.messageResources.service.config, request);
}
}
public void setChatUpdatedEventHandler(ChatUpdatedEventHandler handler) {
Event.setTypeHandler(this.config, "im.chat.updated_v1", handler);
}
public abstract static class ChatUpdatedEventHandler implements IHandler {
@Override
public ChatUpdatedEvent getEvent() {
return new ChatUpdatedEvent();
}
}
public void setChatDisbandedEventHandler(ChatDisbandedEventHandler handler) {
Event.setTypeHandler(this.config, "im.chat.disbanded_v1", handler);
}
public abstract static class ChatDisbandedEventHandler implements IHandler {
@Override
public ChatDisbandedEvent getEvent() {
return new ChatDisbandedEvent();
}
}
public void setChatMemberBotAddedEventHandler(ChatMemberBotAddedEventHandler handler) {
Event.setTypeHandler(this.config, "im.chat.member.bot.added_v1", handler);
}
public abstract static class ChatMemberBotAddedEventHandler implements IHandler {
@Override
public ChatMemberBotAddedEvent getEvent() {
return new ChatMemberBotAddedEvent();
}
}
public void setChatMemberBotDeletedEventHandler(ChatMemberBotDeletedEventHandler handler) {
Event.setTypeHandler(this.config, "im.chat.member.bot.deleted_v1", handler);
}
public abstract static class ChatMemberBotDeletedEventHandler implements IHandler {
@Override
public ChatMemberBotDeletedEvent getEvent() {
return new ChatMemberBotDeletedEvent();
}
}
public void setChatMemberUserAddedEventHandler(ChatMemberUserAddedEventHandler handler) {
Event.setTypeHandler(this.config, "im.chat.member.user.added_v1", handler);
}
public abstract static class ChatMemberUserAddedEventHandler implements IHandler {
@Override
public ChatMemberUserAddedEvent getEvent() {
return new ChatMemberUserAddedEvent();
}
}
public void setChatMemberUserWithdrawnEventHandler(ChatMemberUserWithdrawnEventHandler handler) {
Event.setTypeHandler(this.config, "im.chat.member.user.withdrawn_v1", handler);
}
public abstract static class ChatMemberUserWithdrawnEventHandler implements IHandler {
@Override
public ChatMemberUserWithdrawnEvent getEvent() {
return new ChatMemberUserWithdrawnEvent();
}
}
public void setChatMemberUserDeletedEventHandler(ChatMemberUserDeletedEventHandler handler) {
Event.setTypeHandler(this.config, "im.chat.member.user.deleted_v1", handler);
}
public abstract static class ChatMemberUserDeletedEventHandler implements IHandler {
@Override
public ChatMemberUserDeletedEvent getEvent() {
return new ChatMemberUserDeletedEvent();
}
}
public void setMessageReceiveEventHandler(MessageReceiveEventHandler handler) {
Event.setTypeHandler(this.config, "im.message.receive_v1", handler);
}
public abstract static class MessageReceiveEventHandler implements IHandler {
@Override
public MessageReceiveEvent getEvent() {
return new MessageReceiveEvent();
}
}
public void setMessageMessageReadEventHandler(MessageMessageReadEventHandler handler) {
Event.setTypeHandler(this.config, "im.message.message_read_v1", handler);
}
public abstract static class MessageMessageReadEventHandler implements IHandler {
@Override
public MessageMessageReadEvent getEvent() {
return new MessageMessageReadEvent();
}
}
}