com.larksuite.oapi.service.doc.v2.DocService Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of larksuite-oapi Show documentation
Show all versions of larksuite-oapi Show documentation
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.doc.v2;
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.service.doc.v2.model.*;
import java.util.Map;
import java.util.HashMap;
import java.util.Arrays;
import java.util.List;
import java.util.ArrayList;
public class DocService {
private final Config config;
private final Docs docs;
public DocService(Config config) {
this.config = config;
this.docs = new Docs(this);
}
public Docs getDocs() {
return docs;
}
public static class Docs {
private final DocService service;
public Docs(DocService service) {
this.service = service;
}
public DocBatchUpdateReqCall batchUpdate(DocBatchUpdateReqBody body, RequestOptFn... optFns) {
return new DocBatchUpdateReqCall(this, body, optFns);
}
public DocContentReqCall content(RequestOptFn... optFns) {
return new DocContentReqCall(this, optFns);
}
public DocCreateReqCall create(DocCreateReqBody body, RequestOptFn... optFns) {
return new DocCreateReqCall(this, body, optFns);
}
public DocMetaReqCall meta(RequestOptFn... optFns) {
return new DocMetaReqCall(this, optFns);
}
public DocRawContentReqCall rawContent(RequestOptFn... optFns) {
return new DocRawContentReqCall(this, optFns);
}
}
public static class DocBatchUpdateReqCall extends ReqCaller {
private final Docs docs;
private final DocBatchUpdateReqBody body;
private final Map pathParams;
private final List optFns;
private EmptyData result;
private DocBatchUpdateReqCall(Docs docs, DocBatchUpdateReqBody 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.docs = docs;
}
public DocBatchUpdateReqCall setDocToken(String docToken){
this.pathParams.put("docToken", docToken);
return this;
}
@Override
public Response execute() throws Exception {
this.optFns.add(Request.setPathParams(this.pathParams));
Request request = Request.newRequest("doc/v2/:docToken/batch_update", "POST",
new AccessTokenType[]{AccessTokenType.User, AccessTokenType.Tenant},
this.body, this.result, this.optFns.toArray(new RequestOptFn[]{}));
return Api.send(this.docs.service.config, request);
}
}
public static class DocContentReqCall extends ReqCaller