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

// CreateHireEcoBackgroundCheckCustomField 定制用户在发起背调时的自定义字段, 此接口为覆盖更新, 多次调用时最后一次调用推送的自定义字段生效。
//
// doc: https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_background_check_custom_field/create
// new doc: https://open.feishu.cn/document/server-docs/hire-v1/ecological-docking/eco_background_check_custom_field/create
func (r *HireService) CreateHireEcoBackgroundCheckCustomField(ctx context.Context, request *CreateHireEcoBackgroundCheckCustomFieldReq, options ...MethodOptionFunc) (*CreateHireEcoBackgroundCheckCustomFieldResp, *Response, error) {
	if r.cli.mock.mockHireCreateHireEcoBackgroundCheckCustomField != nil {
		r.cli.Log(ctx, LogLevelDebug, "[lark] Hire#CreateHireEcoBackgroundCheckCustomField mock enable")
		return r.cli.mock.mockHireCreateHireEcoBackgroundCheckCustomField(ctx, request, options...)
	}

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

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

// MockHireCreateHireEcoBackgroundCheckCustomField mock HireCreateHireEcoBackgroundCheckCustomField method
func (r *Mock) MockHireCreateHireEcoBackgroundCheckCustomField(f func(ctx context.Context, request *CreateHireEcoBackgroundCheckCustomFieldReq, options ...MethodOptionFunc) (*CreateHireEcoBackgroundCheckCustomFieldResp, *Response, error)) {
	r.mockHireCreateHireEcoBackgroundCheckCustomField = f
}

// UnMockHireCreateHireEcoBackgroundCheckCustomField un-mock HireCreateHireEcoBackgroundCheckCustomField method
func (r *Mock) UnMockHireCreateHireEcoBackgroundCheckCustomField() {
	r.mockHireCreateHireEcoBackgroundCheckCustomField = nil
}

// CreateHireEcoBackgroundCheckCustomFieldReq ...
type CreateHireEcoBackgroundCheckCustomFieldReq struct {
	AccountID       string                                                   `json:"account_id,omitempty"`        // 背调账号 ID, 可在「账号绑定」事件中获取, 示例值: "6995842370159937061"
	CustomFieldList []*CreateHireEcoBackgroundCheckCustomFieldReqCustomField `json:"custom_field_list,omitempty"` // 自定义字段列表
}

// CreateHireEcoBackgroundCheckCustomFieldReqCustomField ...
type CreateHireEcoBackgroundCheckCustomFieldReqCustomField struct {
	Type        string                                                            `json:"type,omitempty"`        // 自定义字段类型, 示例值: "text", 可选值有: text: 单行文本, 最多100个汉字, textarea: 多行文本, 最多200个汉字, number: 数字, boolean: 布尔, select: 单选, multiselect: 多选, date: 日期, file: 附件, resume: 候选人简历
	Key         string                                                            `json:"key,omitempty"`         // 自定义字段的标识, 在同一账号内唯一, 示例值: "candidate_resume"
	Name        *CreateHireEcoBackgroundCheckCustomFieldReqCustomFieldName        `json:"name,omitempty"`        // 自定义字段的名称, 用户在安排背调表单看到的控件标题
	IsRequired  bool                                                              `json:"is_required,omitempty"` // 是否必填, 示例值: true
	Description *CreateHireEcoBackgroundCheckCustomFieldReqCustomFieldDescription `json:"description,omitempty"` // 自定义字段的描述, 如果是输入控件, 为用户在安排背调表单看到的 placeholder 或 提示文字
	Options     []*CreateHireEcoBackgroundCheckCustomFieldReqCustomFieldOption    `json:"options,omitempty"`     // type 为 select 或 multiselect 时必填, 单选或多选的选项
}

// CreateHireEcoBackgroundCheckCustomFieldReqCustomFieldDescription ...
type CreateHireEcoBackgroundCheckCustomFieldReqCustomFieldDescription struct {
	ZhCn *string `json:"zh_cn,omitempty"` // 中文, 示例值: "测试"
	EnUs *string `json:"en_us,omitempty"` // 英文, 示例值: "test"
}

// CreateHireEcoBackgroundCheckCustomFieldReqCustomFieldName ...
type CreateHireEcoBackgroundCheckCustomFieldReqCustomFieldName struct {
	ZhCn *string `json:"zh_cn,omitempty"` // 中文, 示例值: "测试"
	EnUs *string `json:"en_us,omitempty"` // 英文, 示例值: "test"
}

// CreateHireEcoBackgroundCheckCustomFieldReqCustomFieldOption ...
type CreateHireEcoBackgroundCheckCustomFieldReqCustomFieldOption struct {
	Key  string                                                           `json:"key,omitempty"`  // 选项的 key, 示例值: "A"
	Name *CreateHireEcoBackgroundCheckCustomFieldReqCustomFieldOptionName `json:"name,omitempty"` // 选项的名称
}

// CreateHireEcoBackgroundCheckCustomFieldReqCustomFieldOptionName ...
type CreateHireEcoBackgroundCheckCustomFieldReqCustomFieldOptionName struct {
	ZhCn *string `json:"zh_cn,omitempty"` // 中文, 示例值: "测试"
	EnUs *string `json:"en_us,omitempty"` // 英文, 示例值: "test"
}

// CreateHireEcoBackgroundCheckCustomFieldResp ...
type CreateHireEcoBackgroundCheckCustomFieldResp struct {
}

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