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

// DeleteTaskTasklist 删除一个清单。
//
// 删除清单后, 不可对该清单做任何操作, 也无法再访问到清单。清单被删除后不可恢复。
// 删除清单需要清单管理权限。详情见[清单功能概述](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/task-v2/tasklist/overview)中的“清单是如何鉴权的？“章节。
//
// doc: https://open.larkoffice.com/document/uAjLw4CM/ukTMukTMukTM/task-v2/tasklist/delete
func (r *TaskService) DeleteTaskTasklist(ctx context.Context, request *DeleteTaskTasklistReq, options ...MethodOptionFunc) (*DeleteTaskTasklistResp, *Response, error) {
	if r.cli.mock.mockTaskDeleteTaskTasklist != nil {
		r.cli.Log(ctx, LogLevelDebug, "[lark] Task#DeleteTaskTasklist mock enable")
		return r.cli.mock.mockTaskDeleteTaskTasklist(ctx, request, options...)
	}

	req := &RawRequestReq{
		Scope:                 "Task",
		API:                   "DeleteTaskTasklist",
		Method:                "DELETE",
		URL:                   r.cli.openBaseURL + "/open-apis/task/v2/tasklists/:tasklist_guid",
		Body:                  request,
		MethodOption:          newMethodOption(options),
		NeedTenantAccessToken: true,
		NeedUserAccessToken:   true,
	}
	resp := new(deleteTaskTasklistResp)

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

// MockTaskDeleteTaskTasklist mock TaskDeleteTaskTasklist method
func (r *Mock) MockTaskDeleteTaskTasklist(f func(ctx context.Context, request *DeleteTaskTasklistReq, options ...MethodOptionFunc) (*DeleteTaskTasklistResp, *Response, error)) {
	r.mockTaskDeleteTaskTasklist = f
}

// UnMockTaskDeleteTaskTasklist un-mock TaskDeleteTaskTasklist method
func (r *Mock) UnMockTaskDeleteTaskTasklist() {
	r.mockTaskDeleteTaskTasklist = nil
}

// DeleteTaskTasklistReq ...
type DeleteTaskTasklistReq struct {
	TasklistGuid string `path:"tasklist_guid" json:"-"` // 要删除的清单GUID, 示例值: "d300a75f-c56a-4be9-80d1-e47653028ceb"
}

// DeleteTaskTasklistResp ...
type DeleteTaskTasklistResp struct {
}

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