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

// BatchDeleteMailGroupMember 一次请求可以删除一个邮件组中的多个成员。
//
// doc: https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-member/batch_delete
// new doc: https://open.feishu.cn/document/server-docs/mail-v1/mail-group/mailgroup-member/batch_delete
func (r *MailService) BatchDeleteMailGroupMember(ctx context.Context, request *BatchDeleteMailGroupMemberReq, options ...MethodOptionFunc) (*BatchDeleteMailGroupMemberResp, *Response, error) {
	if r.cli.mock.mockMailBatchDeleteMailGroupMember != nil {
		r.cli.Log(ctx, LogLevelDebug, "[lark] Mail#BatchDeleteMailGroupMember mock enable")
		return r.cli.mock.mockMailBatchDeleteMailGroupMember(ctx, request, options...)
	}

	req := &RawRequestReq{
		Scope:                 "Mail",
		API:                   "BatchDeleteMailGroupMember",
		Method:                "DELETE",
		URL:                   r.cli.openBaseURL + "/open-apis/mail/v1/mailgroups/:mailgroup_id/members/batch_delete",
		Body:                  request,
		MethodOption:          newMethodOption(options),
		NeedTenantAccessToken: true,
	}
	resp := new(batchDeleteMailGroupMemberResp)

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

// MockMailBatchDeleteMailGroupMember mock MailBatchDeleteMailGroupMember method
func (r *Mock) MockMailBatchDeleteMailGroupMember(f func(ctx context.Context, request *BatchDeleteMailGroupMemberReq, options ...MethodOptionFunc) (*BatchDeleteMailGroupMemberResp, *Response, error)) {
	r.mockMailBatchDeleteMailGroupMember = f
}

// UnMockMailBatchDeleteMailGroupMember un-mock MailBatchDeleteMailGroupMember method
func (r *Mock) UnMockMailBatchDeleteMailGroupMember() {
	r.mockMailBatchDeleteMailGroupMember = nil
}

// BatchDeleteMailGroupMemberReq ...
type BatchDeleteMailGroupMemberReq struct {
	MailGroupID  string   `path:"mailgroup_id" json:"-"`    // The unique ID or email address of a mail group, 示例值: "xxxxxxxxxxxxxxx or test_mail_group@xxx.xx"
	MemberIDList []string `json:"member_id_list,omitempty"` // 本次调用删除的成员ID列表, 示例值: ["xxxxxxxxxxxxxxx"], 长度范围: `1` ～ `200`
}

// BatchDeleteMailGroupMemberResp ...
type BatchDeleteMailGroupMemberResp struct {
}

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