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

// CreateHireEcoExamLoginInfo 回传笔试安排结果, 如果安排成功需返回笔试链接和登录凭证
//
// doc: https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_exam/login_info
// new doc: https://open.feishu.cn/document/server-docs/hire-v1/ecological-docking/eco_exam/login_info
func (r *HireService) CreateHireEcoExamLoginInfo(ctx context.Context, request *CreateHireEcoExamLoginInfoReq, options ...MethodOptionFunc) (*CreateHireEcoExamLoginInfoResp, *Response, error) {
	if r.cli.mock.mockHireCreateHireEcoExamLoginInfo != nil {
		r.cli.Log(ctx, LogLevelDebug, "[lark] Hire#CreateHireEcoExamLoginInfo mock enable")
		return r.cli.mock.mockHireCreateHireEcoExamLoginInfo(ctx, request, options...)
	}

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

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

// MockHireCreateHireEcoExamLoginInfo mock HireCreateHireEcoExamLoginInfo method
func (r *Mock) MockHireCreateHireEcoExamLoginInfo(f func(ctx context.Context, request *CreateHireEcoExamLoginInfoReq, options ...MethodOptionFunc) (*CreateHireEcoExamLoginInfoResp, *Response, error)) {
	r.mockHireCreateHireEcoExamLoginInfo = f
}

// UnMockHireCreateHireEcoExamLoginInfo un-mock HireCreateHireEcoExamLoginInfo method
func (r *Mock) UnMockHireCreateHireEcoExamLoginInfo() {
	r.mockHireCreateHireEcoExamLoginInfo = nil
}

// CreateHireEcoExamLoginInfoReq ...
type CreateHireEcoExamLoginInfoReq struct {
	ExamID        string                                      `path:"exam_id" json:"-"`          // exam id, 示例值: "7178536692385679677"
	Result        *int64                                      `json:"result,omitempty"`          // 状态码, 0-成功 非零-错误码, 示例值: 0
	Msg           *string                                     `json:"msg,omitempty"`             // 成功或失败的描述信息, 示例值: "success"
	ExamLoginInfo *CreateHireEcoExamLoginInfoReqExamLoginInfo `json:"exam_login_info,omitempty"` // 笔试作答信息
}

// CreateHireEcoExamLoginInfoReqExamLoginInfo ...
type CreateHireEcoExamLoginInfoReqExamLoginInfo struct {
	ExamURL  string  `json:"exam_url,omitempty"` // 笔试链接。如果返回的链接是附带候选人唯一标识且无需登录鉴权的, 可只返回此地址, 示例值: "https://xxxx/xxxx/xxxx"
	Username *string `json:"username,omitempty"` // 用户名, 示例值: "waxsdfbhg"
	Password *string `json:"password,omitempty"` // 密码, 示例值: "xxxxxx"
}

// CreateHireEcoExamLoginInfoResp ...
type CreateHireEcoExamLoginInfoResp struct {
}

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