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

// GetHelpdeskAgentSkillList 获取全部客服技能。
//
// doc: https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent_skill/list
// new doc: https://open.feishu.cn/document/server-docs/helpdesk-v1/agent-function/agent_skill/list
func (r *HelpdeskService) GetHelpdeskAgentSkillList(ctx context.Context, request *GetHelpdeskAgentSkillListReq, options ...MethodOptionFunc) (*GetHelpdeskAgentSkillListResp, *Response, error) {
	if r.cli.mock.mockHelpdeskGetHelpdeskAgentSkillList != nil {
		r.cli.Log(ctx, LogLevelDebug, "[lark] Helpdesk#GetHelpdeskAgentSkillList mock enable")
		return r.cli.mock.mockHelpdeskGetHelpdeskAgentSkillList(ctx, request, options...)
	}

	req := &RawRequestReq{
		Scope:                 "Helpdesk",
		API:                   "GetHelpdeskAgentSkillList",
		Method:                "GET",
		URL:                   r.cli.openBaseURL + "/open-apis/helpdesk/v1/agent_skills",
		Body:                  request,
		MethodOption:          newMethodOption(options),
		NeedTenantAccessToken: true,
		NeedHelpdeskAuth:      true,
	}
	resp := new(getHelpdeskAgentSkillListResp)

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

// MockHelpdeskGetHelpdeskAgentSkillList mock HelpdeskGetHelpdeskAgentSkillList method
func (r *Mock) MockHelpdeskGetHelpdeskAgentSkillList(f func(ctx context.Context, request *GetHelpdeskAgentSkillListReq, options ...MethodOptionFunc) (*GetHelpdeskAgentSkillListResp, *Response, error)) {
	r.mockHelpdeskGetHelpdeskAgentSkillList = f
}

// UnMockHelpdeskGetHelpdeskAgentSkillList un-mock HelpdeskGetHelpdeskAgentSkillList method
func (r *Mock) UnMockHelpdeskGetHelpdeskAgentSkillList() {
	r.mockHelpdeskGetHelpdeskAgentSkillList = nil
}

// GetHelpdeskAgentSkillListReq ...
type GetHelpdeskAgentSkillListReq struct {
}

// GetHelpdeskAgentSkillListResp ...
type GetHelpdeskAgentSkillListResp struct {
	AgentSkills []*GetHelpdeskAgentSkillListRespAgentSkill `json:"agent_skills,omitempty"` // 客服技能列表
}

// GetHelpdeskAgentSkillListRespAgentSkill ...
type GetHelpdeskAgentSkillListRespAgentSkill struct {
	ID        string   `json:"id,omitempty"`         // 技能id
	Name      string   `json:"name,omitempty"`       // 技能名
	AgentIDs  []string `json:"agent_ids,omitempty"`  // 具有此技能的客服ids
	IsDefault bool     `json:"is_default,omitempty"` // 默认技能
}

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