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

// GetVCRoomLevel 该接口可以使用会议室层级 ID 查询会议室层级详情。
//
// doc: https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room_level/get
// new doc: https://open.feishu.cn/document/server-docs/vc-v1/room_level/get
func (r *VCService) GetVCRoomLevel(ctx context.Context, request *GetVCRoomLevelReq, options ...MethodOptionFunc) (*GetVCRoomLevelResp, *Response, error) {
	if r.cli.mock.mockVCGetVCRoomLevel != nil {
		r.cli.Log(ctx, LogLevelDebug, "[lark] VC#GetVCRoomLevel mock enable")
		return r.cli.mock.mockVCGetVCRoomLevel(ctx, request, options...)
	}

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

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

// MockVCGetVCRoomLevel mock VCGetVCRoomLevel method
func (r *Mock) MockVCGetVCRoomLevel(f func(ctx context.Context, request *GetVCRoomLevelReq, options ...MethodOptionFunc) (*GetVCRoomLevelResp, *Response, error)) {
	r.mockVCGetVCRoomLevel = f
}

// UnMockVCGetVCRoomLevel un-mock VCGetVCRoomLevel method
func (r *Mock) UnMockVCGetVCRoomLevel() {
	r.mockVCGetVCRoomLevel = nil
}

// GetVCRoomLevelReq ...
type GetVCRoomLevelReq struct {
	RoomLevelID string `path:"room_level_id" json:"-"` // 层级ID, 查询租户层级可传0, 示例值: "omb_57c9cc7d9a81e27e54c8fabfd02759e7"
}

// GetVCRoomLevelResp ...
type GetVCRoomLevelResp struct {
	RoomLevel *GetVCRoomLevelRespRoomLevel `json:"room_level,omitempty"` // 会议室层级详情
}

// GetVCRoomLevelRespRoomLevel ...
type GetVCRoomLevelRespRoomLevel 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
}

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