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

// CreateHireExternalInterview 导入来自其他系统的面试信息, 创建为外部面试。
//
// doc: https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/external_interview/create
// new doc: https://open.feishu.cn/document/server-docs/hire-v1/get-candidates/import-external-system-information/create-3
func (r *HireService) CreateHireExternalInterview(ctx context.Context, request *CreateHireExternalInterviewReq, options ...MethodOptionFunc) (*CreateHireExternalInterviewResp, *Response, error) {
	if r.cli.mock.mockHireCreateHireExternalInterview != nil {
		r.cli.Log(ctx, LogLevelDebug, "[lark] Hire#CreateHireExternalInterview mock enable")
		return r.cli.mock.mockHireCreateHireExternalInterview(ctx, request, options...)
	}

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

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

// MockHireCreateHireExternalInterview mock HireCreateHireExternalInterview method
func (r *Mock) MockHireCreateHireExternalInterview(f func(ctx context.Context, request *CreateHireExternalInterviewReq, options ...MethodOptionFunc) (*CreateHireExternalInterviewResp, *Response, error)) {
	r.mockHireCreateHireExternalInterview = f
}

// UnMockHireCreateHireExternalInterview un-mock HireCreateHireExternalInterview method
func (r *Mock) UnMockHireCreateHireExternalInterview() {
	r.mockHireCreateHireExternalInterview = nil
}

// CreateHireExternalInterviewReq ...
type CreateHireExternalInterviewReq struct {
	ExternalID            *string `json:"external_id,omitempty"`             // 外部系统面试主键 （仅用于幂等）, 示例值: "123"
	ExternalApplicationID string  `json:"external_application_id,omitempty"` // 外部投递 ID, 示例值: "6960663240925956437"
	ParticipateStatus     *int64  `json:"participate_status,omitempty"`      // 参与状态, 示例值: 1, 可选值有: 1: 未参与, 2: 参与, 3: 爽约
	BeginTime             *int64  `json:"begin_time,omitempty"`              // 开始时间, 示例值: 1618500278638
	EndTime               *int64  `json:"end_time,omitempty"`                // 结束时间, 示例值: 1618500278639
}

// CreateHireExternalInterviewResp ...
type CreateHireExternalInterviewResp struct {
	ExternalInterview *CreateHireExternalInterviewRespExternalInterview `json:"external_interview,omitempty"` // 外部面试信息
}

// CreateHireExternalInterviewRespExternalInterview ...
type CreateHireExternalInterviewRespExternalInterview struct {
	ExternalApplicationID string `json:"external_application_id,omitempty"` // 外部投递 ID
	ID                    string `json:"id,omitempty"`                      // 外部面试 ID
	ParticipateStatus     int64  `json:"participate_status,omitempty"`      // 参与状态, 可选值有: 1: 未参与, 2: 参与, 3: 爽约
	BeginTime             int64  `json:"begin_time,omitempty"`              // 开始时间
	EndTime               int64  `json:"end_time,omitempty"`                // 结束时间
}

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