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

// GetVCRoomLevelList 该接口用来查询某个会议室层级下的子层级列表。
//
// doc: https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room_level/list
// new doc: https://open.feishu.cn/document/server-docs/vc-v1/room_level/list
func (r *VCService) GetVCRoomLevelList(ctx context.Context, request *GetVCRoomLevelListReq, options ...MethodOptionFunc) (*GetVCRoomLevelListResp, *Response, error) {
	if r.cli.mock.mockVCGetVCRoomLevelList != nil {
		r.cli.Log(ctx, LogLevelDebug, "[lark] VC#GetVCRoomLevelList mock enable")
		return r.cli.mock.mockVCGetVCRoomLevelList(ctx, request, options...)
	}

	req := &RawRequestReq{
		Scope:                 "VC",
		API:                   "GetVCRoomLevelList",
		Method:                "GET",
		URL:                   r.cli.openBaseURL + "/open-apis/vc/v1/room_levels",
		Body:                  request,
		MethodOption:          newMethodOption(options),
		NeedTenantAccessToken: true,
	}
	resp := new(getVCRoomLevelListResp)

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

// MockVCGetVCRoomLevelList mock VCGetVCRoomLevelList method
func (r *Mock) MockVCGetVCRoomLevelList(f func(ctx context.Context, request *GetVCRoomLevelListReq, options ...MethodOptionFunc) (*GetVCRoomLevelListResp, *Response, error)) {
	r.mockVCGetVCRoomLevelList = f
}

// UnMockVCGetVCRoomLevelList un-mock VCGetVCRoomLevelList method
func (r *Mock) UnMockVCGetVCRoomLevelList() {
	r.mockVCGetVCRoomLevelList = nil
}

// GetVCRoomLevelListReq ...
type GetVCRoomLevelListReq struct {
	RoomLevelID *string `query:"room_level_id" json:"-"` // 层级ID, 当需要获取租户下层级列表时, room_level_id可传空, 示例值: omb_4ad1a2c7a2fbc5fc9570f38456931293
	PageSize    *int64  `query:"page_size" json:"-"`     // 分页尺寸大小, 示例值: 10, 最大值: `100`
	PageToken   *string `query:"page_token" json:"-"`    // 分页标记, 第一次请求不填, 表示从头开始遍历；分页查询结果还有更多项时会同时返回新的 page_token, 下次遍历可采用该 page_token 获取查询结果, 示例值:
}

// GetVCRoomLevelListResp ...
type GetVCRoomLevelListResp struct {
	Items     []*GetVCRoomLevelListRespItem `json:"items,omitempty"`      // 会议室层级列表
	PageToken string                        `json:"page_token,omitempty"` // 分页标记, 当 has_more 为 true 时, 会同时返回新的 page_token, 否则不返回 page_token
	HasMore   bool                          `json:"has_more,omitempty"`   // 是否还有更多项
}

// GetVCRoomLevelListRespItem ...
type GetVCRoomLevelListRespItem struct {
	RoomLevelID   string   `json:"room_level_id,omitempty"`   // 层级ID
	Name          string   `json:"name,omitempty"`            // 层级名称
	ParentID      string   `json:"parent_id,omitempty"`       // 父层级ID
	Path          []string `json:"path,omitempty"`            // 层级路径
	HasChild      bool     `json:"has_child,omitempty"`       // 是否有子层级
	CustomGroupID string   `json:"custom_group_id,omitempty"` // 自定义层级ID
}

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