// 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"
)

// ExecuteSendHelpdeskNotification 审核通过后调用此接口设置推送时间, 等待调度系统调度, 发送消息。
//
// doc: https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/execute_send
// new doc: https://open.feishu.cn/document/server-docs/helpdesk-v1/notification/execute_send
func (r *HelpdeskService) ExecuteSendHelpdeskNotification(ctx context.Context, request *ExecuteSendHelpdeskNotificationReq, options ...MethodOptionFunc) (*ExecuteSendHelpdeskNotificationResp, *Response, error) {
	if r.cli.mock.mockHelpdeskExecuteSendHelpdeskNotification != nil {
		r.cli.Log(ctx, LogLevelDebug, "[lark] Helpdesk#ExecuteSendHelpdeskNotification mock enable")
		return r.cli.mock.mockHelpdeskExecuteSendHelpdeskNotification(ctx, request, options...)
	}

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

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

// MockHelpdeskExecuteSendHelpdeskNotification mock HelpdeskExecuteSendHelpdeskNotification method
func (r *Mock) MockHelpdeskExecuteSendHelpdeskNotification(f func(ctx context.Context, request *ExecuteSendHelpdeskNotificationReq, options ...MethodOptionFunc) (*ExecuteSendHelpdeskNotificationResp, *Response, error)) {
	r.mockHelpdeskExecuteSendHelpdeskNotification = f
}

// UnMockHelpdeskExecuteSendHelpdeskNotification un-mock HelpdeskExecuteSendHelpdeskNotification method
func (r *Mock) UnMockHelpdeskExecuteSendHelpdeskNotification() {
	r.mockHelpdeskExecuteSendHelpdeskNotification = nil
}

// ExecuteSendHelpdeskNotificationReq ...
type ExecuteSendHelpdeskNotificationReq struct {
	NotificationID string `path:"notification_id" json:"-"` // 创建接口返回的唯一id, 示例值: "6985032626234982420"
	SendAt         string `json:"send_at,omitempty"`        // 发送时间戳(毫秒), 示例值: "1624326025000"
}

// ExecuteSendHelpdeskNotificationResp ...
type ExecuteSendHelpdeskNotificationResp struct {
}

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