// Code generated by lark_sdk_gen. DO NOT EDIT.
/**
 * Copyright 2022 chyroc
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package lark

import (
	"context"
)

// CancelApproveHelpdeskNotification 提交审核后, 如果需要取消审核, 则调用此接口。
//
// doc: https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/cancel_approve
// new doc: https://open.feishu.cn/document/server-docs/helpdesk-v1/notification/cancel_approve
func (r *HelpdeskService) CancelApproveHelpdeskNotification(ctx context.Context, request *CancelApproveHelpdeskNotificationReq, options ...MethodOptionFunc) (*CancelApproveHelpdeskNotificationResp, *Response, error) {
	if r.cli.mock.mockHelpdeskCancelApproveHelpdeskNotification != nil {
		r.cli.Log(ctx, LogLevelDebug, "[lark] Helpdesk#CancelApproveHelpdeskNotification mock enable")
		return r.cli.mock.mockHelpdeskCancelApproveHelpdeskNotification(ctx, request, options...)
	}

	req := &RawRequestReq{
		Scope:               "Helpdesk",
		API:                 "CancelApproveHelpdeskNotification",
		Method:              "POST",
		URL:                 r.cli.openBaseURL + "/open-apis/helpdesk/v1/notifications/:notification_id/cancel_approve",
		Body:                request,
		MethodOption:        newMethodOption(options),
		NeedUserAccessToken: true,
		NeedHelpdeskAuth:    true,
	}
	resp := new(cancelApproveHelpdeskNotificationResp)

	response, err := r.cli.RawRequest(ctx, req, resp)
	return resp.Data, response, err
}

// MockHelpdeskCancelApproveHelpdeskNotification mock HelpdeskCancelApproveHelpdeskNotification method
func (r *Mock) MockHelpdeskCancelApproveHelpdeskNotification(f func(ctx context.Context, request *CancelApproveHelpdeskNotificationReq, options ...MethodOptionFunc) (*CancelApproveHelpdeskNotificationResp, *Response, error)) {
	r.mockHelpdeskCancelApproveHelpdeskNotification = f
}

// UnMockHelpdeskCancelApproveHelpdeskNotification un-mock HelpdeskCancelApproveHelpdeskNotification method
func (r *Mock) UnMockHelpdeskCancelApproveHelpdeskNotification() {
	r.mockHelpdeskCancelApproveHelpdeskNotification = nil
}

// CancelApproveHelpdeskNotificationReq ...
type CancelApproveHelpdeskNotificationReq struct {
	NotificationID string `path:"notification_id" json:"-"` // 唯一ID, 示例值: "6981801914270744596"
}

// CancelApproveHelpdeskNotificationResp ...
type CancelApproveHelpdeskNotificationResp struct {
}

// cancelApproveHelpdeskNotificationResp ...
type cancelApproveHelpdeskNotificationResp struct {
	Code  int64                                  `json:"code,omitempty"` // 错误码, 非 0 表示失败
	Msg   string                                 `json:"msg,omitempty"`  // 错误描述
	Data  *CancelApproveHelpdeskNotificationResp `json:"data,omitempty"`
	Error *ErrorDetail                           `json:"error,omitempty"`
}
