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

// UpdateHireEcoBackgroundCheckProgress 更新指定背调的进展信息和阶段报告, 进度信息将会被展示在背调卡片上, 用以推送背调进度、阶段报告。用以告知用户目前系统订单的流转状态。 当订单状态已完成时, 将无法通过此接口更新阶段报告、更新进度事件信息。
//
// doc: https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_background_check/update_progress
// new doc: https://open.feishu.cn/document/server-docs/hire-v1/ecological-docking/eco_background_check/update_progress
func (r *HireService) UpdateHireEcoBackgroundCheckProgress(ctx context.Context, request *UpdateHireEcoBackgroundCheckProgressReq, options ...MethodOptionFunc) (*UpdateHireEcoBackgroundCheckProgressResp, *Response, error) {
	if r.cli.mock.mockHireUpdateHireEcoBackgroundCheckProgress != nil {
		r.cli.Log(ctx, LogLevelDebug, "[lark] Hire#UpdateHireEcoBackgroundCheckProgress mock enable")
		return r.cli.mock.mockHireUpdateHireEcoBackgroundCheckProgress(ctx, request, options...)
	}

	req := &RawRequestReq{
		Scope:                 "Hire",
		API:                   "UpdateHireEcoBackgroundCheckProgress",
		Method:                "POST",
		URL:                   r.cli.openBaseURL + "/open-apis/hire/v1/eco_background_checks/update_progress",
		Body:                  request,
		MethodOption:          newMethodOption(options),
		NeedTenantAccessToken: true,
	}
	resp := new(updateHireEcoBackgroundCheckProgressResp)

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

// MockHireUpdateHireEcoBackgroundCheckProgress mock HireUpdateHireEcoBackgroundCheckProgress method
func (r *Mock) MockHireUpdateHireEcoBackgroundCheckProgress(f func(ctx context.Context, request *UpdateHireEcoBackgroundCheckProgressReq, options ...MethodOptionFunc) (*UpdateHireEcoBackgroundCheckProgressResp, *Response, error)) {
	r.mockHireUpdateHireEcoBackgroundCheckProgress = f
}

// UnMockHireUpdateHireEcoBackgroundCheckProgress un-mock HireUpdateHireEcoBackgroundCheckProgress method
func (r *Mock) UnMockHireUpdateHireEcoBackgroundCheckProgress() {
	r.mockHireUpdateHireEcoBackgroundCheckProgress = nil
}

// UpdateHireEcoBackgroundCheckProgressReq ...
type UpdateHireEcoBackgroundCheckProgressReq struct {
	BackgroundCheckID string                                               `json:"background_check_id,omitempty"` // 背调 ID, 招聘侧的 ID, 示例值: "6931286400470354183"
	StageID           string                                               `json:"stage_id,omitempty"`            // 阶段 ID, 同一背调订单此 ID 不能重复, 示例值: "6931286400470354183"
	StageEnName       *string                                              `json:"stage_en_name,omitempty"`       // 背调阶段英文名称, 示例值: "stage report"
	StageName         string                                               `json:"stage_name,omitempty"`          // 背调阶段名称, 示例值: "阶段报告"
	StageTime         string                                               `json:"stage_time,omitempty"`          // 阶段进度更新时间。 毫秒级时间戳, 每次调用此字段应严格递增, 示例值: "1660123456789"
	Result            *string                                              `json:"result,omitempty"`              // 背调结果（阶段性背调结果）, 注意: 若需回传该字段, report_file_list为必填, 示例值: "通过"
	ReportFileList    []*UpdateHireEcoBackgroundCheckProgressReqReportFile `json:"report_file_list,omitempty"`    // 报告列表
}

// UpdateHireEcoBackgroundCheckProgressReqReportFile ...
type UpdateHireEcoBackgroundCheckProgressReqReportFile struct {
	ReportName    string `json:"report_name,omitempty"`     // 报告名称, 示例值: "阶段报告.pdf"
	ReportURL     string `json:"report_url,omitempty"`      // 报告地址；当report_url_type 为空或为 1 时需为可下载 pdf 的链接；为 2 时为预览型链接, 示例值: "https://xxxxx/xxxxxx/xxxx.pdf"
	ReportURLType *int64 `json:"report_url_type,omitempty"` // 报告地址类型；枚举值 1 或为空时为可下载的 pdf 链接, 2 为预览型链接, 示例值: 1, 可选值有: 1: 可下载的链接, 2: 外链型链接
}

// UpdateHireEcoBackgroundCheckProgressResp ...
type UpdateHireEcoBackgroundCheckProgressResp struct {
}

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