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

// BatchUpdateHireEcoExamPaper 更新指定帐号可用的试卷列表
//
// doc: https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_exam_paper/batch_update
// new doc: https://open.feishu.cn/document/server-docs/hire-v1/ecological-docking/eco_exam_paper/batch_update
func (r *HireService) BatchUpdateHireEcoExamPaper(ctx context.Context, request *BatchUpdateHireEcoExamPaperReq, options ...MethodOptionFunc) (*BatchUpdateHireEcoExamPaperResp, *Response, error) {
	if r.cli.mock.mockHireBatchUpdateHireEcoExamPaper != nil {
		r.cli.Log(ctx, LogLevelDebug, "[lark] Hire#BatchUpdateHireEcoExamPaper mock enable")
		return r.cli.mock.mockHireBatchUpdateHireEcoExamPaper(ctx, request, options...)
	}

	req := &RawRequestReq{
		Scope:                 "Hire",
		API:                   "BatchUpdateHireEcoExamPaper",
		Method:                "PATCH",
		URL:                   r.cli.openBaseURL + "/open-apis/hire/v1/eco_exam_papers/batch_update",
		Body:                  request,
		MethodOption:          newMethodOption(options),
		NeedTenantAccessToken: true,
	}
	resp := new(batchUpdateHireEcoExamPaperResp)

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

// MockHireBatchUpdateHireEcoExamPaper mock HireBatchUpdateHireEcoExamPaper method
func (r *Mock) MockHireBatchUpdateHireEcoExamPaper(f func(ctx context.Context, request *BatchUpdateHireEcoExamPaperReq, options ...MethodOptionFunc) (*BatchUpdateHireEcoExamPaperResp, *Response, error)) {
	r.mockHireBatchUpdateHireEcoExamPaper = f
}

// UnMockHireBatchUpdateHireEcoExamPaper un-mock HireBatchUpdateHireEcoExamPaper method
func (r *Mock) UnMockHireBatchUpdateHireEcoExamPaper() {
	r.mockHireBatchUpdateHireEcoExamPaper = nil
}

// BatchUpdateHireEcoExamPaperReq ...
type BatchUpdateHireEcoExamPaperReq struct {
	AccountID string                                 `json:"account_id,omitempty"` // 账号 ID, 可在「账号绑定」事件中获取, 示例值: "7147998241542539527"
	PaperList []*BatchUpdateHireEcoExamPaperReqPaper `json:"paper_list,omitempty"` // 试卷列表
}

// BatchUpdateHireEcoExamPaperReqPaper ...
type BatchUpdateHireEcoExamPaperReqPaper struct {
	ID            string  `json:"id,omitempty"`             // 试卷 ID, 示例值: "7147998241542539527", 最小长度: `1` 字符
	Name          string  `json:"name,omitempty"`           // 试卷名称, 示例值: "春季测评", 最小长度: `1` 字符
	Duration      *int64  `json:"duration,omitempty"`       // 考试时长（分钟）, 示例值: 30
	QuestionCount *int64  `json:"question_count,omitempty"` // 试卷题目数量, 示例值: 30
	StartTime     *string `json:"start_time,omitempty"`     // 开始时间, 留空或不传表示不限制开始时间, 示例值: "1658676234053"
	EndTime       *string `json:"end_time,omitempty"`       // 结束时间, 留空或不传表示不限制结束时间, 示例值: "1672444800000"
}

// BatchUpdateHireEcoExamPaperResp ...
type BatchUpdateHireEcoExamPaperResp struct {
}

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