All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.lark.oapi.service.helpdesk.v1.resource.Notification Maven / Gradle / Ivy

// 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.helpdesk.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.helpdesk.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 Notification {
    private static final Logger log = LoggerFactory.getLogger(Notification.class);
    private final Config config;

    public Notification(Config config) {
        this.config = config;
    }


    /**
     * 取消审核,提交审核后,如果需要取消审核,则调用此接口
     * 

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/cancel_approve ; *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CancelApproveNotificationSample.java ; */ public CancelApproveNotificationResp cancelApprove(CancelApproveNotificationReq req, RequestOptions reqOptions) throws Exception { // 请求参数选项 if (reqOptions == null) { reqOptions = new RequestOptions(); } reqOptions.setNeedHelpDeskAuth(true); // 发起请求 RawResponse httpResponse = Transport.send(config, reqOptions, "POST" , "/open-apis/helpdesk/v1/notifications/:notification_id/cancel_approve" , Sets.newHashSet(AccessTokenType.User) , req); // 反序列化 CancelApproveNotificationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CancelApproveNotificationResp.class); if (resp == null) { log.error(String.format( "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/notifications/:notification_id/cancel_approve" , 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; } /** * 取消审核,提交审核后,如果需要取消审核,则调用此接口 *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/cancel_approve ; *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CancelApproveNotificationSample.java ; */ public CancelApproveNotificationResp cancelApprove(CancelApproveNotificationReq req) throws Exception { // 请求参数选项 RequestOptions reqOptions = new RequestOptions(); reqOptions.setNeedHelpDeskAuth(true); // 发起请求 RawResponse httpResponse = Transport.send(config, reqOptions, "POST" , "/open-apis/helpdesk/v1/notifications/:notification_id/cancel_approve" , Sets.newHashSet(AccessTokenType.User) , req); // 反序列化 CancelApproveNotificationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CancelApproveNotificationResp.class); if (resp == null) { log.error(String.format( "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/notifications/:notification_id/cancel_approve" , 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; } /** * 取消推送,取消推送接口,审核通过后待调度可以调用,发送过程中可以调用(会撤回已发送的消息),发送完成后可以需要推送(会撤回所有已发送的消息) *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/cancel_send ; *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CancelSendNotificationSample.java ; */ public CancelSendNotificationResp cancelSend(CancelSendNotificationReq req, RequestOptions reqOptions) throws Exception { // 请求参数选项 if (reqOptions == null) { reqOptions = new RequestOptions(); } reqOptions.setNeedHelpDeskAuth(true); // 发起请求 RawResponse httpResponse = Transport.send(config, reqOptions, "POST" , "/open-apis/helpdesk/v1/notifications/:notification_id/cancel_send" , Sets.newHashSet(AccessTokenType.User) , req); // 反序列化 CancelSendNotificationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CancelSendNotificationResp.class); if (resp == null) { log.error(String.format( "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/notifications/:notification_id/cancel_send" , 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; } /** * 取消推送,取消推送接口,审核通过后待调度可以调用,发送过程中可以调用(会撤回已发送的消息),发送完成后可以需要推送(会撤回所有已发送的消息) *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/cancel_send ; *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CancelSendNotificationSample.java ; */ public CancelSendNotificationResp cancelSend(CancelSendNotificationReq req) throws Exception { // 请求参数选项 RequestOptions reqOptions = new RequestOptions(); reqOptions.setNeedHelpDeskAuth(true); // 发起请求 RawResponse httpResponse = Transport.send(config, reqOptions, "POST" , "/open-apis/helpdesk/v1/notifications/:notification_id/cancel_send" , Sets.newHashSet(AccessTokenType.User) , req); // 反序列化 CancelSendNotificationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CancelSendNotificationResp.class); if (resp == null) { log.error(String.format( "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/notifications/:notification_id/cancel_send" , 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; } /** * 创建推送,调用接口创建推送,创建成功后为草稿状态 *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/create ; *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateNotificationSample.java ; */ public CreateNotificationResp create(CreateNotificationReq req, RequestOptions reqOptions) throws Exception { // 请求参数选项 if (reqOptions == null) { reqOptions = new RequestOptions(); } reqOptions.setNeedHelpDeskAuth(true); // 发起请求 RawResponse httpResponse = Transport.send(config, reqOptions, "POST" , "/open-apis/helpdesk/v1/notifications" , Sets.newHashSet(AccessTokenType.User) , req); // 反序列化 CreateNotificationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateNotificationResp.class); if (resp == null) { log.error(String.format( "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/notifications" , 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; } /** * 创建推送,调用接口创建推送,创建成功后为草稿状态 *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/create ; *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/CreateNotificationSample.java ; */ public CreateNotificationResp create(CreateNotificationReq req) throws Exception { // 请求参数选项 RequestOptions reqOptions = new RequestOptions(); reqOptions.setNeedHelpDeskAuth(true); // 发起请求 RawResponse httpResponse = Transport.send(config, reqOptions, "POST" , "/open-apis/helpdesk/v1/notifications" , Sets.newHashSet(AccessTokenType.User) , req); // 反序列化 CreateNotificationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, CreateNotificationResp.class); if (resp == null) { log.error(String.format( "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/notifications" , 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; } /** * 执行推送,审核通过后调用此接口设置推送时间,等待调度系统调度,发送消息 *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/execute_send ; *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ExecuteSendNotificationSample.java ; */ public ExecuteSendNotificationResp executeSend(ExecuteSendNotificationReq req, RequestOptions reqOptions) throws Exception { // 请求参数选项 if (reqOptions == null) { reqOptions = new RequestOptions(); } reqOptions.setNeedHelpDeskAuth(true); // 发起请求 RawResponse httpResponse = Transport.send(config, reqOptions, "POST" , "/open-apis/helpdesk/v1/notifications/:notification_id/execute_send" , Sets.newHashSet(AccessTokenType.User) , req); // 反序列化 ExecuteSendNotificationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ExecuteSendNotificationResp.class); if (resp == null) { log.error(String.format( "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/notifications/:notification_id/execute_send" , 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; } /** * 执行推送,审核通过后调用此接口设置推送时间,等待调度系统调度,发送消息 *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/execute_send ; *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/ExecuteSendNotificationSample.java ; */ public ExecuteSendNotificationResp executeSend(ExecuteSendNotificationReq req) throws Exception { // 请求参数选项 RequestOptions reqOptions = new RequestOptions(); reqOptions.setNeedHelpDeskAuth(true); // 发起请求 RawResponse httpResponse = Transport.send(config, reqOptions, "POST" , "/open-apis/helpdesk/v1/notifications/:notification_id/execute_send" , Sets.newHashSet(AccessTokenType.User) , req); // 反序列化 ExecuteSendNotificationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, ExecuteSendNotificationResp.class); if (resp == null) { log.error(String.format( "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/notifications/:notification_id/execute_send" , 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; } /** * 查询推送,查询推送详情 *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/get ; *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/GetNotificationSample.java ; */ public GetNotificationResp get(GetNotificationReq req, RequestOptions reqOptions) throws Exception { // 请求参数选项 if (reqOptions == null) { reqOptions = new RequestOptions(); } reqOptions.setNeedHelpDeskAuth(true); // 发起请求 RawResponse httpResponse = Transport.send(config, reqOptions, "GET" , "/open-apis/helpdesk/v1/notifications/:notification_id" , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) , req); // 反序列化 GetNotificationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetNotificationResp.class); if (resp == null) { log.error(String.format( "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/notifications/:notification_id" , 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; } /** * 查询推送,查询推送详情 *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/get ; *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/GetNotificationSample.java ; */ public GetNotificationResp get(GetNotificationReq req) throws Exception { // 请求参数选项 RequestOptions reqOptions = new RequestOptions(); reqOptions.setNeedHelpDeskAuth(true); // 发起请求 RawResponse httpResponse = Transport.send(config, reqOptions, "GET" , "/open-apis/helpdesk/v1/notifications/:notification_id" , Sets.newHashSet(AccessTokenType.Tenant, AccessTokenType.User) , req); // 反序列化 GetNotificationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, GetNotificationResp.class); if (resp == null) { log.error(String.format( "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/notifications/:notification_id" , 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; } /** * 更新推送,更新推送信息,只有在草稿状态下才可以调用此接口进行更新 *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/patch ; *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PatchNotificationSample.java ; */ public PatchNotificationResp patch(PatchNotificationReq req, RequestOptions reqOptions) throws Exception { // 请求参数选项 if (reqOptions == null) { reqOptions = new RequestOptions(); } reqOptions.setNeedHelpDeskAuth(true); // 发起请求 RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" , "/open-apis/helpdesk/v1/notifications/:notification_id" , Sets.newHashSet(AccessTokenType.User) , req); // 反序列化 PatchNotificationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchNotificationResp.class); if (resp == null) { log.error(String.format( "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/notifications/:notification_id" , 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; } /** * 更新推送,更新推送信息,只有在草稿状态下才可以调用此接口进行更新 *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/patch ; *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PatchNotificationSample.java ; */ public PatchNotificationResp patch(PatchNotificationReq req) throws Exception { // 请求参数选项 RequestOptions reqOptions = new RequestOptions(); reqOptions.setNeedHelpDeskAuth(true); // 发起请求 RawResponse httpResponse = Transport.send(config, reqOptions, "PATCH" , "/open-apis/helpdesk/v1/notifications/:notification_id" , Sets.newHashSet(AccessTokenType.User) , req); // 反序列化 PatchNotificationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PatchNotificationResp.class); if (resp == null) { log.error(String.format( "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/notifications/:notification_id" , 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; } /** * 预览推送内容,在正式执行推送之前是可以调用此接口预览设置的推送内容 *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/preview ; *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PreviewNotificationSample.java ; */ public PreviewNotificationResp preview(PreviewNotificationReq req, RequestOptions reqOptions) throws Exception { // 请求参数选项 if (reqOptions == null) { reqOptions = new RequestOptions(); } reqOptions.setNeedHelpDeskAuth(true); // 发起请求 RawResponse httpResponse = Transport.send(config, reqOptions, "POST" , "/open-apis/helpdesk/v1/notifications/:notification_id/preview" , Sets.newHashSet(AccessTokenType.User) , req); // 反序列化 PreviewNotificationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PreviewNotificationResp.class); if (resp == null) { log.error(String.format( "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/notifications/:notification_id/preview" , 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; } /** * 预览推送内容,在正式执行推送之前是可以调用此接口预览设置的推送内容 *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/preview ; *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/PreviewNotificationSample.java ; */ public PreviewNotificationResp preview(PreviewNotificationReq req) throws Exception { // 请求参数选项 RequestOptions reqOptions = new RequestOptions(); reqOptions.setNeedHelpDeskAuth(true); // 发起请求 RawResponse httpResponse = Transport.send(config, reqOptions, "POST" , "/open-apis/helpdesk/v1/notifications/:notification_id/preview" , Sets.newHashSet(AccessTokenType.User) , req); // 反序列化 PreviewNotificationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, PreviewNotificationResp.class); if (resp == null) { log.error(String.format( "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/notifications/:notification_id/preview" , 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; } /** * 提交审核,正常情况下调用创建推送接口后,就可以调用提交审核接口,如果创建人是服务台owner则会自动审核通过,否则会通知服务台owner审核此推送信息 *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/submit_approve ; *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/SubmitApproveNotificationSample.java ; */ public SubmitApproveNotificationResp submitApprove(SubmitApproveNotificationReq req, RequestOptions reqOptions) throws Exception { // 请求参数选项 if (reqOptions == null) { reqOptions = new RequestOptions(); } reqOptions.setNeedHelpDeskAuth(true); // 发起请求 RawResponse httpResponse = Transport.send(config, reqOptions, "POST" , "/open-apis/helpdesk/v1/notifications/:notification_id/submit_approve" , Sets.newHashSet(AccessTokenType.User) , req); // 反序列化 SubmitApproveNotificationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SubmitApproveNotificationResp.class); if (resp == null) { log.error(String.format( "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/notifications/:notification_id/submit_approve" , 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; } /** * 提交审核,正常情况下调用创建推送接口后,就可以调用提交审核接口,如果创建人是服务台owner则会自动审核通过,否则会通知服务台owner审核此推送信息 *

官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/submit_approve ; *

使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/SubmitApproveNotificationSample.java ; */ public SubmitApproveNotificationResp submitApprove(SubmitApproveNotificationReq req) throws Exception { // 请求参数选项 RequestOptions reqOptions = new RequestOptions(); reqOptions.setNeedHelpDeskAuth(true); // 发起请求 RawResponse httpResponse = Transport.send(config, reqOptions, "POST" , "/open-apis/helpdesk/v1/notifications/:notification_id/submit_approve" , Sets.newHashSet(AccessTokenType.User) , req); // 反序列化 SubmitApproveNotificationResp resp = UnmarshalRespUtil.unmarshalResp(httpResponse, SubmitApproveNotificationResp.class); if (resp == null) { log.error(String.format( "%s,callError,req=%s,respHeader=%s,respStatusCode=%s,respBody=%s,", "/open-apis/helpdesk/v1/notifications/:notification_id/submit_approve" , 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; } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy