com.lark.oapi.service.hire.v1.resource.EcoAccountCustomField Maven / Gradle / Ivy
Show all versions of oapi-sdk Show documentation
// Code generated by lark suite oapi sdk gen
/*
* MIT License
*
* Copyright (c) 2022 Lark Technologies Pte. Ltd.
*
* 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:
*
* The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software.
*
* 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.
*/
package com.lark.oapi.service.hire.v1.resource;
import com.lark.oapi.core.token.AccessTokenType;
import com.lark.oapi.core.Transport;
import com.lark.oapi.core.response.RawResponse;
import com.lark.oapi.core.utils.UnmarshalRespUtil;
import com.lark.oapi.core.utils.Jsons;
import com.lark.oapi.core.utils.Sets;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.nio.charset.StandardCharsets;
import com.lark.oapi.core.Config;
import com.lark.oapi.core.request.RequestOptions;
import java.io.ByteArrayOutputStream;
import com.lark.oapi.service.hire.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 EcoAccountCustomField {
private static final Logger log = LoggerFactory.getLogger(EcoAccountCustomField.class);
private final Config config;
public EcoAccountCustomField(Config config) {
this.config = config;
}
/**
* 删除帐号自定义字段,删除用户在服务商处的身份标示字段(如用户在服务商处的租户 ID)。删除后,不影响已添加帐号对应的自定义字段的值。但在添加新帐号时,将不能再使用此自定义字段。删除不支持撤销,对应的 key 将无法再次复用。
* 官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_account_custom_field/batch_delete ;
*
使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchDeleteEcoAccountCustomFieldSample.java ;
*/
public BatchDeleteEcoAccountCustomFieldResp batchDelete(BatchDeleteEcoAccountCustomFieldReq req, RequestOptions reqOptions) throws Exception {
// 请求参数选项
if (reqOptions == null) {
reqOptions = new RequestOptions();
}
// 发起请求
RawResponse httpResponse = Transport.send(config, reqOptions, "POST"
, "/open-apis/hire/v1/eco_account_custom_fields/batch_delete"
, Sets.newHashSet(AccessTokenType.Tenant)
, req);
// 反序列化
BatchDeleteEcoAccountCustomFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeleteEcoAccountCustomFieldResp.class);
if (resp == null) {
log.error(String.format(
"%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_account_custom_fields/batch_delete"
, Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()),
httpResponse.getStatusCode(), new String(httpResponse.getBody(),
StandardCharsets.UTF_8)));
throw new IllegalArgumentException("The result returned by the server is illegal");
}
resp.setRawResponse(httpResponse);
resp.setRequest(req);
return resp;
}
/**
* 删除帐号自定义字段,删除用户在服务商处的身份标示字段(如用户在服务商处的租户 ID)。删除后,不影响已添加帐号对应的自定义字段的值。但在添加新帐号时,将不能再使用此自定义字段。删除不支持撤销,对应的 key 将无法再次复用。
*
官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_account_custom_field/batch_delete ;
*
使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchDeleteEcoAccountCustomFieldSample.java ;
*/
public BatchDeleteEcoAccountCustomFieldResp batchDelete(BatchDeleteEcoAccountCustomFieldReq req) throws Exception {
// 请求参数选项
RequestOptions reqOptions = new RequestOptions();
// 发起请求
RawResponse httpResponse = Transport.send(config, reqOptions, "POST"
, "/open-apis/hire/v1/eco_account_custom_fields/batch_delete"
, Sets.newHashSet(AccessTokenType.Tenant)
, req);
// 反序列化
BatchDeleteEcoAccountCustomFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchDeleteEcoAccountCustomFieldResp.class);
if (resp == null) {
log.error(String.format(
"%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_account_custom_fields/batch_delete"
, Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()),
httpResponse.getStatusCode(), new String(httpResponse.getBody(),
StandardCharsets.UTF_8)));
throw new IllegalArgumentException("The result returned by the server is illegal");
}
resp.setRawResponse(httpResponse);
resp.setRequest(req);
return resp;
}
/**
* 更新帐号自定义字段,更新用户在服务商处的身份标示字段(如用户在服务商处的租户 ID),此方法只会更新同一 scope 内 key 一致的自定义字段。
*
官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_account_custom_field/batch_update ;
*
使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchUpdateEcoAccountCustomFieldSample.java ;
*/
public BatchUpdateEcoAccountCustomFieldResp batchUpdate(BatchUpdateEcoAccountCustomFieldReq req, RequestOptions reqOptions) throws Exception {
// 请求参数选项
if (reqOptions == null) {
reqOptions = new RequestOptions();
}
// 发起请求
RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH"
, "/open-apis/hire/v1/eco_account_custom_fields/batch_update"
, Sets.newHashSet(AccessTokenType.Tenant)
, req);
// 反序列化
BatchUpdateEcoAccountCustomFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchUpdateEcoAccountCustomFieldResp.class);
if (resp == null) {
log.error(String.format(
"%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_account_custom_fields/batch_update"
, Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()),
httpResponse.getStatusCode(), new String(httpResponse.getBody(),
StandardCharsets.UTF_8)));
throw new IllegalArgumentException("The result returned by the server is illegal");
}
resp.setRawResponse(httpResponse);
resp.setRequest(req);
return resp;
}
/**
* 更新帐号自定义字段,更新用户在服务商处的身份标示字段(如用户在服务商处的租户 ID),此方法只会更新同一 scope 内 key 一致的自定义字段。
*
官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_account_custom_field/batch_update ;
*
使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/BatchUpdateEcoAccountCustomFieldSample.java ;
*/
public BatchUpdateEcoAccountCustomFieldResp batchUpdate(BatchUpdateEcoAccountCustomFieldReq req) throws Exception {
// 请求参数选项
RequestOptions reqOptions = new RequestOptions();
// 发起请求
RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH"
, "/open-apis/hire/v1/eco_account_custom_fields/batch_update"
, Sets.newHashSet(AccessTokenType.Tenant)
, req);
// 反序列化
BatchUpdateEcoAccountCustomFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, BatchUpdateEcoAccountCustomFieldResp.class);
if (resp == null) {
log.error(String.format(
"%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_account_custom_fields/batch_update"
, Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()),
httpResponse.getStatusCode(), new String(httpResponse.getBody(),
StandardCharsets.UTF_8)));
throw new IllegalArgumentException("The result returned by the server is illegal");
}
resp.setRawResponse(httpResponse);
resp.setRequest(req);
return resp;
}
/**
* 创建帐号自定义字段,定制用户在服务商处的身份标示字段(如用户在服务商处的租户 ID)。用户在飞书招聘后台添加帐号后,系统会推送「帐号绑定」事件给开发者,事件将携带用户填写的自定义字段信息,开发者可根据此信息识别飞书招聘用户在服务商处的身份信息,完成飞书招聘用户和服务商帐号的绑定,并以此来推送对应的套餐或试卷列表等。
*
官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_account_custom_field/create ;
*
使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateEcoAccountCustomFieldSample.java ;
*/
public CreateEcoAccountCustomFieldResp create(CreateEcoAccountCustomFieldReq req, RequestOptions reqOptions) throws Exception {
// 请求参数选项
if (reqOptions == null) {
reqOptions = new RequestOptions();
}
// 发起请求
RawResponse httpResponse = Transport.send(config, reqOptions, "POST"
, "/open-apis/hire/v1/eco_account_custom_fields"
, Sets.newHashSet(AccessTokenType.Tenant)
, req);
// 反序列化
CreateEcoAccountCustomFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateEcoAccountCustomFieldResp.class);
if (resp == null) {
log.error(String.format(
"%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_account_custom_fields"
, Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()),
httpResponse.getStatusCode(), new String(httpResponse.getBody(),
StandardCharsets.UTF_8)));
throw new IllegalArgumentException("The result returned by the server is illegal");
}
resp.setRawResponse(httpResponse);
resp.setRequest(req);
return resp;
}
/**
* 创建帐号自定义字段,定制用户在服务商处的身份标示字段(如用户在服务商处的租户 ID)。用户在飞书招聘后台添加帐号后,系统会推送「帐号绑定」事件给开发者,事件将携带用户填写的自定义字段信息,开发者可根据此信息识别飞书招聘用户在服务商处的身份信息,完成飞书招聘用户和服务商帐号的绑定,并以此来推送对应的套餐或试卷列表等。
*
官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_account_custom_field/create ;
*
使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/hirev1/CreateEcoAccountCustomFieldSample.java ;
*/
public CreateEcoAccountCustomFieldResp create(CreateEcoAccountCustomFieldReq req) throws Exception {
// 请求参数选项
RequestOptions reqOptions = new RequestOptions();
// 发起请求
RawResponse httpResponse = Transport.send(config, reqOptions, "POST"
, "/open-apis/hire/v1/eco_account_custom_fields"
, Sets.newHashSet(AccessTokenType.Tenant)
, req);
// 反序列化
CreateEcoAccountCustomFieldResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateEcoAccountCustomFieldResp.class);
if (resp == null) {
log.error(String.format(
"%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/hire/v1/eco_account_custom_fields"
, Jsons.DEFAULT.toJson(req), Jsons.DEFAULT.toJson(httpResponse.getHeaders()),
httpResponse.getStatusCode(), new String(httpResponse.getBody(),
StandardCharsets.UTF_8)));
throw new IllegalArgumentException("The result returned by the server is illegal");
}
resp.setRawResponse(httpResponse);
resp.setRequest(req);
return resp;
}
}