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

// DeleteDriveMemberPermission 该接口用于根据文件的 token 移除文档协作者的权限。
//
// doc: https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/permission-member/delete
// new doc: https://open.feishu.cn/document/server-docs/docs/permission/permission-member/delete
func (r *DriveService) DeleteDriveMemberPermission(ctx context.Context, request *DeleteDriveMemberPermissionReq, options ...MethodOptionFunc) (*DeleteDriveMemberPermissionResp, *Response, error) {
	if r.cli.mock.mockDriveDeleteDriveMemberPermission != nil {
		r.cli.Log(ctx, LogLevelDebug, "[lark] Drive#DeleteDriveMemberPermission mock enable")
		return r.cli.mock.mockDriveDeleteDriveMemberPermission(ctx, request, options...)
	}

	req := &RawRequestReq{
		Scope:                 "Drive",
		API:                   "DeleteDriveMemberPermission",
		Method:                "DELETE",
		URL:                   r.cli.openBaseURL + "/open-apis/drive/v1/permissions/:token/members/:member_id",
		Body:                  request,
		MethodOption:          newMethodOption(options),
		NeedTenantAccessToken: true,
		NeedUserAccessToken:   true,
	}
	resp := new(deleteDriveMemberPermissionResp)

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

// MockDriveDeleteDriveMemberPermission mock DriveDeleteDriveMemberPermission method
func (r *Mock) MockDriveDeleteDriveMemberPermission(f func(ctx context.Context, request *DeleteDriveMemberPermissionReq, options ...MethodOptionFunc) (*DeleteDriveMemberPermissionResp, *Response, error)) {
	r.mockDriveDeleteDriveMemberPermission = f
}

// UnMockDriveDeleteDriveMemberPermission un-mock DriveDeleteDriveMemberPermission method
func (r *Mock) UnMockDriveDeleteDriveMemberPermission() {
	r.mockDriveDeleteDriveMemberPermission = nil
}

// DeleteDriveMemberPermissionReq ...
type DeleteDriveMemberPermissionReq struct {
	Token      string  `path:"token" json:"-"`        // 文件的 token, 获取方式见 [如何获取云文档资源相关 token](https://open.feishu.cn/document/ukTMukTMukTM/uczNzUjL3czM14yN3MTN#08bb5df6), 示例值: "doccnBKgoMyY5OMbUG6FioTXuBe"
	MemberID   string  `path:"member_id" json:"-"`    // 协作者 ID, 与协作者 ID 类型需要对应, 示例值: "ou_7dab8a3d3cdcc9da365777c7ad535d62"
	Type       string  `query:"type" json:"-"`        // 文件类型, 需要与文件的 token 相匹配, 示例值: doc, 可选值有: doc: 文档, sheet: 电子表格, file: 云空间文件, wiki: 知识库节点, bitable: 多维表格, docx: 新版文档, folder: 文件夹, mindnote: 思维笔记, minutes: 妙记, slides: 幻灯片
	MemberType string  `query:"member_type" json:"-"` // 协作者 ID 类型, 与协作者 ID 需要对应, 示例值: openid, 可选值有: email: 邮箱地址, openid: 开放平台 ID, openchat: 开放平台群组 ID, opendepartmentid: 开放平台部门 ID, userid: 用户自定义 ID, unionid: 开放平台 UnionID, groupid: 自定义用户组 ID, wikispaceid: 知识空间 ID, 注意: 仅知识库文档支持该参数, 当需要操作知识库文档里的「知识库成员」类型协作者时传该参数
	Type2      *string `json:"type2,omitempty"`       // 协作者类型, 注意: 当 `member_type` 参数为 `wikispaceid` 时必须传该参数, 默认值: "", 示例值: "user", 可选值有: user: 用户, chat: 群组, department: 组织架构, group: 用户组, wiki_space_member: 知识库成员, 注意: 在知识库启用了成员分组功能后不支持该参数, wiki_space_viewer: 知识库可阅读成员, 注意: 仅在知识库启用了成员分组功能后才支持该参数, wiki_space_editor: 知识库可编辑成员, 注意: 仅在知识库启用了成员分组功能后才支持该参数
}

// DeleteDriveMemberPermissionResp ...
type DeleteDriveMemberPermissionResp struct {
}

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