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

// DeleteTaskTasklistActivitySubscription 给定一个清单的GUID和一个订阅的GUID, 将其删除。删除后的数据不可恢复。
//
// 删除订阅需要有该清单的编辑权限。
//
// doc: https://open.larkoffice.com/document/uAjLw4CM/ukTMukTMukTM/task-v2/tasklist-activity_subscription/delete
func (r *TaskService) DeleteTaskTasklistActivitySubscription(ctx context.Context, request *DeleteTaskTasklistActivitySubscriptionReq, options ...MethodOptionFunc) (*DeleteTaskTasklistActivitySubscriptionResp, *Response, error) {
	if r.cli.mock.mockTaskDeleteTaskTasklistActivitySubscription != nil {
		r.cli.Log(ctx, LogLevelDebug, "[lark] Task#DeleteTaskTasklistActivitySubscription mock enable")
		return r.cli.mock.mockTaskDeleteTaskTasklistActivitySubscription(ctx, request, options...)
	}

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

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

// MockTaskDeleteTaskTasklistActivitySubscription mock TaskDeleteTaskTasklistActivitySubscription method
func (r *Mock) MockTaskDeleteTaskTasklistActivitySubscription(f func(ctx context.Context, request *DeleteTaskTasklistActivitySubscriptionReq, options ...MethodOptionFunc) (*DeleteTaskTasklistActivitySubscriptionResp, *Response, error)) {
	r.mockTaskDeleteTaskTasklistActivitySubscription = f
}

// UnMockTaskDeleteTaskTasklistActivitySubscription un-mock TaskDeleteTaskTasklistActivitySubscription method
func (r *Mock) UnMockTaskDeleteTaskTasklistActivitySubscription() {
	r.mockTaskDeleteTaskTasklistActivitySubscription = nil
}

// DeleteTaskTasklistActivitySubscriptionReq ...
type DeleteTaskTasklistActivitySubscriptionReq struct {
	TasklistGuid             string `path:"tasklist_guid" json:"-"`              // 清单GUID。可以通过[创建清单](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/task-v2/tasklist/create), 或者通过[获取清单列表](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/task-v2/tasklist/list)接口查询得到, 示例值: "f5ca6747-5ac3-422e-a97e-972c1b2c24f3"
	ActivitySubscriptionGuid string `path:"activity_subscription_guid" json:"-"` // 要删除的订阅GUID。可以通过[创建动态订阅](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/task-v2/tasklist-activity_subscription/create)接口创建, 或者通过[列取动态订阅](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/task-v2/tasklist-activity_subscription/list)查询得到, 示例值: "d19e3a2a-edc0-4e4e-b7cc-950e162b53ae"
}

// DeleteTaskTasklistActivitySubscriptionResp ...
type DeleteTaskTasklistActivitySubscriptionResp struct {
}

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