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

// ReplyCalendarMeetingRoomInstance 调用该接口用于回复会议室日程实例, 支持回复未签到释放、提前结束释放、被管理员置为接受、被管理员置为拒绝。
//
// 说明: 你可以先调用[查询会议室忙闲](https://open.feishu.cn/document/ukTMukTMukTM/uIDOyUjLygjM14iM4ITN)接口, 获取指定会议室的某一日程的 uid、original_time 信息, 然后再调用本接口回复会议室日程。<BR>
// ID说明: 日程 ID（event_id）格式为 `<Uid>_<Original time>`, 因此你可以通过 event_id 获取日程的 Uid 和 Original time。例如, 日程 ID 为 `c32537e6-e0a8-4506-b42f-47440655cdb4_0`, 则 Uid 为 `c32537e6-e0a8-4506-b42f-47440655cdb4`、Original time 为 `0`。
//
// doc: https://open.feishu.cn/document/ukTMukTMukTM/uYzN4UjL2cDO14iN3gTN
// new doc: https://open.feishu.cn/document/server-docs/calendar-v4/meeting-room-event/reply-meeting-room-event-instance
func (r *CalendarService) ReplyCalendarMeetingRoomInstance(ctx context.Context, request *ReplyCalendarMeetingRoomInstanceReq, options ...MethodOptionFunc) (*ReplyCalendarMeetingRoomInstanceResp, *Response, error) {
	if r.cli.mock.mockCalendarReplyCalendarMeetingRoomInstance != nil {
		r.cli.Log(ctx, LogLevelDebug, "[lark] Calendar#ReplyCalendarMeetingRoomInstance mock enable")
		return r.cli.mock.mockCalendarReplyCalendarMeetingRoomInstance(ctx, request, options...)
	}

	req := &RawRequestReq{
		Scope:                 "Calendar",
		API:                   "ReplyCalendarMeetingRoomInstance",
		Method:                "POST",
		URL:                   r.cli.openBaseURL + "/open-apis/meeting_room/instance/reply",
		Body:                  request,
		MethodOption:          newMethodOption(options),
		NeedTenantAccessToken: true,
	}
	resp := new(replyCalendarMeetingRoomInstanceResp)

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

// MockCalendarReplyCalendarMeetingRoomInstance mock CalendarReplyCalendarMeetingRoomInstance method
func (r *Mock) MockCalendarReplyCalendarMeetingRoomInstance(f func(ctx context.Context, request *ReplyCalendarMeetingRoomInstanceReq, options ...MethodOptionFunc) (*ReplyCalendarMeetingRoomInstanceResp, *Response, error)) {
	r.mockCalendarReplyCalendarMeetingRoomInstance = f
}

// UnMockCalendarReplyCalendarMeetingRoomInstance un-mock CalendarReplyCalendarMeetingRoomInstance method
func (r *Mock) UnMockCalendarReplyCalendarMeetingRoomInstance() {
	r.mockCalendarReplyCalendarMeetingRoomInstance = nil
}

// ReplyCalendarMeetingRoomInstanceReq ...
type ReplyCalendarMeetingRoomInstanceReq struct {
	RoomID       string `json:"room_id,omitempty"`       // 会议室 ID。
	Uid          string `json:"uid,omitempty"`           // 会议室对应的日程 Uid。
	OriginalTime int64  `json:"original_time,omitempty"` // 日程实例原始时间。非重复性日程和重复性日程, 此处传 0；重复性日程的例外日程, 此处传对应的 original_time 值（时间戳类型）。
	Status       string `json:"status,omitempty"`        // 回复状态。 可选值有: - NOT_CHECK_IN: 未签到 - ENDED_BEFORE_DUE: 提前结束 - ACCEPTED_BY_ADMIN: 被管理员置为接受 DECLINED_BY_ADMIN: 被管理员置为拒绝
}

// ReplyCalendarMeetingRoomInstanceResp ...
type ReplyCalendarMeetingRoomInstanceResp struct {
}

// replyCalendarMeetingRoomInstanceResp ...
type replyCalendarMeetingRoomInstanceResp struct {
	Code  int64                                 `json:"code,omitempty"` // 返回码, 非 0 表示失败。 说明: 如果返回 105003 表示 original_time 不合法。该问题可能是重复日程的整个开始时间被修改导致的, 建议应用重新查询会议室的日程列表, 获取最新的 original_time, 然后再次尝试调用本接口。
	Msg   string                                `json:"msg,omitempty"`  // 返回码的描述, `success` 表示成功, 其他为错误提示信息。
	Data  *ReplyCalendarMeetingRoomInstanceResp `json:"data,omitempty"`
	Error *ErrorDetail                          `json:"error,omitempty"`
}
