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

// ListVCMeetingByNo 获取指定时间范围（90天内)会议号关联的会议简要信息列表。
//
// doc: https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/meeting/list_by_no
// new doc: https://open.feishu.cn/document/server-docs/vc-v1/meeting/list_by_no
func (r *VCService) ListVCMeetingByNo(ctx context.Context, request *ListVCMeetingByNoReq, options ...MethodOptionFunc) (*ListVCMeetingByNoResp, *Response, error) {
	if r.cli.mock.mockVCListVCMeetingByNo != nil {
		r.cli.Log(ctx, LogLevelDebug, "[lark] VC#ListVCMeetingByNo mock enable")
		return r.cli.mock.mockVCListVCMeetingByNo(ctx, request, options...)
	}

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

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

// MockVCListVCMeetingByNo mock VCListVCMeetingByNo method
func (r *Mock) MockVCListVCMeetingByNo(f func(ctx context.Context, request *ListVCMeetingByNoReq, options ...MethodOptionFunc) (*ListVCMeetingByNoResp, *Response, error)) {
	r.mockVCListVCMeetingByNo = f
}

// UnMockVCListVCMeetingByNo un-mock VCListVCMeetingByNo method
func (r *Mock) UnMockVCListVCMeetingByNo() {
	r.mockVCListVCMeetingByNo = nil
}

// ListVCMeetingByNoReq ...
type ListVCMeetingByNoReq struct {
	MeetingNo string  `query:"meeting_no" json:"-"` // 9位会议号, 示例值: 123456789
	StartTime string  `query:"start_time" json:"-"` // 查询开始时间（unix时间, 单位sec）, 示例值: 1608888867
	EndTime   string  `query:"end_time" json:"-"`   // 查询结束时间（unix时间, 单位sec）, 示例值: 1608888867
	PageToken *string `query:"page_token" json:"-"` // 分页标记, 第一次请求不填, 表示从头开始遍历；分页查询结果还有更多项时会同时返回新的 page_token, 下次遍历可采用该 page_token 获取查询结果, 示例值: 5
	PageSize  *int64  `query:"page_size" json:"-"`  // 分页大小, 示例值: 10, 默认值: `20`, 最大值: `50`
}

// ListVCMeetingByNoResp ...
type ListVCMeetingByNoResp struct {
	HasMore       bool                                 `json:"has_more,omitempty"`       // 是否还有更多项
	PageToken     string                               `json:"page_token,omitempty"`     // 分页标记, 当 has_more 为 true 时, 会同时返回新的 page_token, 否则不返回 page_token
	MeetingBriefs []*ListVCMeetingByNoRespMeetingBrief `json:"meeting_briefs,omitempty"` // 会议简要信息列表
}

// ListVCMeetingByNoRespMeetingBrief ...
type ListVCMeetingByNoRespMeetingBrief struct {
	ID        string `json:"id,omitempty"`         // 会议ID（视频会议的唯一标识, 视频会议开始后才会产生）
	Topic     string `json:"topic,omitempty"`      // 会议主题
	URL       string `json:"url,omitempty"`        // 会议链接（飞书用户可通过点击会议链接快捷入会）
	MeetingNo string `json:"meeting_no,omitempty"` // 会议号
	Password  string `json:"password,omitempty"`   // 会议密码
}

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