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

// DeleteMailUserMailbox 该接口会永久删除用户邮箱地址。可用于删除位于邮箱回收站中的用户邮箱地址, 一旦删除, 将无法恢复。该接口支持邮件的转移, 可以将被释放邮箱的邮件转移到另外一个可以使用的邮箱中。
//
// doc: https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/user_mailbox/delete
// new doc: https://open.feishu.cn/document/server-docs/mail-v1/user_mailbox-alias/delete
func (r *MailService) DeleteMailUserMailbox(ctx context.Context, request *DeleteMailUserMailboxReq, options ...MethodOptionFunc) (*DeleteMailUserMailboxResp, *Response, error) {
	if r.cli.mock.mockMailDeleteMailUserMailbox != nil {
		r.cli.Log(ctx, LogLevelDebug, "[lark] Mail#DeleteMailUserMailbox mock enable")
		return r.cli.mock.mockMailDeleteMailUserMailbox(ctx, request, options...)
	}

	req := &RawRequestReq{
		Scope:                 "Mail",
		API:                   "DeleteMailUserMailbox",
		Method:                "DELETE",
		URL:                   r.cli.openBaseURL + "/open-apis/mail/v1/user_mailboxes/:user_mailbox_id",
		Body:                  request,
		MethodOption:          newMethodOption(options),
		NeedTenantAccessToken: true,
	}
	resp := new(deleteMailUserMailboxResp)

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

// MockMailDeleteMailUserMailbox mock MailDeleteMailUserMailbox method
func (r *Mock) MockMailDeleteMailUserMailbox(f func(ctx context.Context, request *DeleteMailUserMailboxReq, options ...MethodOptionFunc) (*DeleteMailUserMailboxResp, *Response, error)) {
	r.mockMailDeleteMailUserMailbox = f
}

// UnMockMailDeleteMailUserMailbox un-mock MailDeleteMailUserMailbox method
func (r *Mock) UnMockMailDeleteMailUserMailbox() {
	r.mockMailDeleteMailUserMailbox = nil
}

// DeleteMailUserMailboxReq ...
type DeleteMailUserMailboxReq struct {
	UserMailboxID   string  `path:"user_mailbox_id" json:"-"`   // 要释放的邮箱地址, 示例值: "111111@abc.com"
	TransferMailbox *string `query:"transfer_mailbox" json:"-"` // 用于接受转移的邮箱地址, 示例值: 888888@abc.com
}

// DeleteMailUserMailboxResp ...
type DeleteMailUserMailboxResp struct {
}

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