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

// GetHireOfferByApplication 根据投递 ID 获取 Offer 信息。
//
// doc: https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/application/offer
// new doc: https://open.feishu.cn/document/server-docs/hire-v1/candidate-management/delivery-process-management/offer/offer
func (r *HireService) GetHireOfferByApplication(ctx context.Context, request *GetHireOfferByApplicationReq, options ...MethodOptionFunc) (*GetHireOfferByApplicationResp, *Response, error) {
	if r.cli.mock.mockHireGetHireOfferByApplication != nil {
		r.cli.Log(ctx, LogLevelDebug, "[lark] Hire#GetHireOfferByApplication mock enable")
		return r.cli.mock.mockHireGetHireOfferByApplication(ctx, request, options...)
	}

	req := &RawRequestReq{
		Scope:                 "Hire",
		API:                   "GetHireOfferByApplication",
		Method:                "GET",
		URL:                   r.cli.openBaseURL + "/open-apis/hire/v1/applications/:application_id/offer",
		Body:                  request,
		MethodOption:          newMethodOption(options),
		NeedTenantAccessToken: true,
	}
	resp := new(getHireOfferByApplicationResp)

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

// MockHireGetHireOfferByApplication mock HireGetHireOfferByApplication method
func (r *Mock) MockHireGetHireOfferByApplication(f func(ctx context.Context, request *GetHireOfferByApplicationReq, options ...MethodOptionFunc) (*GetHireOfferByApplicationResp, *Response, error)) {
	r.mockHireGetHireOfferByApplication = f
}

// UnMockHireGetHireOfferByApplication un-mock HireGetHireOfferByApplication method
func (r *Mock) UnMockHireGetHireOfferByApplication() {
	r.mockHireGetHireOfferByApplication = nil
}

// GetHireOfferByApplicationReq ...
type GetHireOfferByApplicationReq struct {
	ApplicationID      string            `path:"application_id" json:"-"`         // 投递ID, 示例值: "6949805467799537964"
	UserIDType         *IDType           `query:"user_id_type" json:"-"`          // 用户 ID 类型, 示例值: open_id, 可选值有: open_id: 标识一个用户在某个应用中的身份。同一个用户在不同应用中的 Open ID 不同。[了解更多: 如何获取 Open ID](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-obtain-openid), union_id: 标识一个用户在某个应用开发商下的身份。同一用户在同一开发商下的应用中的 Union ID 是相同的, 在不同开发商下的应用中的 Union ID 是不同的。通过 Union ID, 应用开发商可以把同个用户在多个应用中的身份关联起来。[了解更多: 如何获取 Union ID？](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-obtain-union-id), user_id: 标识一个用户在某个租户内的身份。同一个用户在租户 A 和租户 B 内的 User ID 是不同的。在同一个租户内, 一个用户的 User ID 在所有应用（包括商店应用）中都保持一致。User ID 主要用于在不同的应用间打通用户数据。[了解更多: 如何获取 User ID？](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-obtain-user-id), 默认值: `open_id`, 当值为 `user_id`, 字段权限要求: 获取用户 user ID
	DepartmentIDType   *DepartmentIDType `query:"department_id_type" json:"-"`    // 此次调用中使用的部门 ID 的类型, 示例值: open_department_id, 可选值有: open_department_id: 以 open_department_id 来标识部门, department_id: 以 department_id 来标识部门, 默认值: `open_department_id`
	JobLevelIDType     *IDType           `query:"job_level_id_type" json:"-"`     // 此次调用中使用的「职级 ID」的类型, 示例值: 6942778198054125570, 可选值有: people_admin_job_level_id: 「人力系统管理后台」适用的职级 ID。人力系统管理后台逐步下线中, 建议不继续使用此 ID。, job_level_id: 「飞书管理后台」适用的职级 ID, 通过[「获取租户职级列表」](https://open.feishu.cn/document/server-docs/contact-v3/job_level/list)接口获取, 默认值: `people_admin_job_level_id`
	JobFamilyIDType    *IDType           `query:"job_family_id_type" json:"-"`    // 此次调用中使用的「序列 ID」的类型, 示例值: 6942778198054125571, 可选值有: people_admin_job_category_id: 「人力系统管理后台」适用的序列 ID。人力系统管理后台逐步下线中, 建议不继续使用此 ID。, job_family_id: 「飞书管理后台」适用的序列 ID, 通过[「获取租户序列列表」](https://open.feishu.cn/document/server-docs/contact-v3/job_family/list)接口获取, 默认值: `people_admin_job_category_id`
	EmployeeTypeIDType *IDType           `query:"employee_type_id_type" json:"-"` // 此次调用中使用的「人员类型 ID」的类型, 示例值: 1, 可选值有: people_admin_employee_type_id: 「人力系统管理后台」适用的人员类型 ID。人力系统管理后台逐步下线中, 建议不继续使用此 ID。, employee_type_enum_id: 「飞书管理后台」适用的人员类型 ID, 通过[「查询人员类型」](https://open.feishu.cn/document/server-docs/contact-v3/employee_type_enum/list)接口获取, 默认值: `people_admin_employee_type_id`
}

// GetHireOfferByApplicationResp ...
type GetHireOfferByApplicationResp struct {
	Offer *GetHireOfferByApplicationRespOffer `json:"offer,omitempty"` // Offer数据
}

// GetHireOfferByApplicationRespOffer ...
type GetHireOfferByApplicationRespOffer struct {
	ID                   string                                                `json:"id,omitempty"`                     // Offer id
	ApplicationID        string                                                `json:"application_id,omitempty"`         // 投递id
	BasicInfo            *GetHireOfferByApplicationRespOfferBasicInfo          `json:"basic_info,omitempty"`             // 基础信息
	SalaryPlan           *GetHireOfferByApplicationRespOfferSalaryPlan         `json:"salary_plan,omitempty"`            // 薪酬计划
	SchemaID             string                                                `json:"schema_id,omitempty"`              // 当前 Offer 使用的 schema
	OfferStatus          int64                                                 `json:"offer_status,omitempty"`           // Offer 状态, 可选值有: 0: 所有, 1: 未申请, 2: 审批中, 3: 审批已撤回, 4: 审批通过, 5: 审批不通过, 6: Offer 已发出, 7: 候选人已接受, 8: 候选人已拒绝, 9: Offer 已失效, 10: 未审批, 11: 实习待入职（仅实习 Offer 具有）, 12: 实习已入职（仅实习 Offer 具有）, 13: 实习已离职（仅实习 Offer 具有）
	JobInfo              *GetHireOfferByApplicationRespOfferJobInfo            `json:"job_info,omitempty"`               // 职位信息
	CustomizedModuleList []*GetHireOfferByApplicationRespOfferCustomizedModule `json:"customized_module_list,omitempty"` // offer自定义模块列表
}

// GetHireOfferByApplicationRespOfferBasicInfo ...
type GetHireOfferByApplicationRespOfferBasicInfo struct {
	OfferType         int64                                                       `json:"offer_type,omitempty"`          // Offer 类型, 可选值有: 1: 社招offer, 2: 校招offer, 3: 实习offer, 4: 实习生转正offer
	Remark            string                                                      `json:"remark,omitempty"`              // 备注
	ExpireTime        int64                                                       `json:"expire_time,omitempty"`         // Offer 过期时间
	OwnerUserID       string                                                      `json:"owner_user_id,omitempty"`       // Offer 负责人 ID
	CreatorUserID     string                                                      `json:"creator_user_id,omitempty"`     // Offer 创建人 ID
	EmployeeType      *GetHireOfferByApplicationRespOfferBasicInfoEmployeeType    `json:"employee_type,omitempty"`       // Offer 人员类型
	CreateTime        string                                                      `json:"create_time,omitempty"`         // 创建时间
	LeaderUserID      string                                                      `json:"leader_user_id,omitempty"`      // 直属上级 ID
	OnboardDate       string                                                      `json:"onboard_date,omitempty"`        // 入职日期
	DepartmentID      string                                                      `json:"department_id,omitempty"`       // 入职部门
	ProbationMonth    int64                                                       `json:"probation_month,omitempty"`     // 试用期, 比如试用期6个月
	ContractYear      int64                                                       `json:"contract_year,omitempty"`       // 合同期(年), 推荐使用「contract_period」, 如果Offer申请表中「合同期(年)」字段已停用, 则不可使用该字段
	ContractPeriod    *GetHireOfferByApplicationRespOfferBasicInfoContractPeriod  `json:"contract_period,omitempty"`     // 合同期（年/月）
	RecruitmentType   *GetHireOfferByApplicationRespOfferBasicInfoRecruitmentType `json:"recruitment_type,omitempty"`    // 雇员类型
	Sequence          *GetHireOfferByApplicationRespOfferBasicInfoSequence        `json:"sequence,omitempty"`            // 序列
	Level             *GetHireOfferByApplicationRespOfferBasicInfoLevel           `json:"level,omitempty"`               // 级别
	OnboardAddress    *GetHireOfferByApplicationRespOfferBasicInfoOnboardAddress  `json:"onboard_address,omitempty"`     // 入职地点
	WorkAddress       *GetHireOfferByApplicationRespOfferBasicInfoWorkAddress     `json:"work_address,omitempty"`        // 工作地点
	CustomizeInfoList []*GetHireOfferByApplicationRespOfferBasicInfoCustomizeInfo `json:"customize_info_list,omitempty"` // 自定义字段信息
}

// GetHireOfferByApplicationRespOfferBasicInfoContractPeriod ...
type GetHireOfferByApplicationRespOfferBasicInfoContractPeriod struct {
	PeriodType int64 `json:"period_type,omitempty"` // 合同周期类型, 可选值有: 1: 月, 2: 年
	Period     int64 `json:"period,omitempty"`      // 合同时长
}

// GetHireOfferByApplicationRespOfferBasicInfoCustomizeInfo ...
type GetHireOfferByApplicationRespOfferBasicInfoCustomizeInfo struct {
	ObjectID       string `json:"object_id,omitempty"`       // 自定义字段 ID
	CustomizeValue string `json:"customize_value,omitempty"` // 自定义字段 value
}

// GetHireOfferByApplicationRespOfferBasicInfoEmployeeType ...
type GetHireOfferByApplicationRespOfferBasicInfoEmployeeType struct {
	ID     string `json:"id,omitempty"`      // ID
	ZhName string `json:"zh_name,omitempty"` // 中文名称
	EnName string `json:"en_name,omitempty"` // 英文名称
}

// GetHireOfferByApplicationRespOfferBasicInfoLevel ...
type GetHireOfferByApplicationRespOfferBasicInfoLevel struct {
	ID     string `json:"id,omitempty"`      // ID
	ZhName string `json:"zh_name,omitempty"` // 中文名称
	EnName string `json:"en_name,omitempty"` // 英文名称
}

// GetHireOfferByApplicationRespOfferBasicInfoOnboardAddress ...
type GetHireOfferByApplicationRespOfferBasicInfoOnboardAddress struct {
	ID       string                                                             `json:"id,omitempty"`       // ID
	ZhName   string                                                             `json:"zh_name,omitempty"`  // 中文名称
	EnName   string                                                             `json:"en_name,omitempty"`  // 英文名称
	District *GetHireOfferByApplicationRespOfferBasicInfoOnboardAddressDistrict `json:"district,omitempty"` // 区域信息
	City     *GetHireOfferByApplicationRespOfferBasicInfoOnboardAddressCity     `json:"city,omitempty"`     // 城市信息
	State    *GetHireOfferByApplicationRespOfferBasicInfoOnboardAddressState    `json:"state,omitempty"`    // 省信息
	Country  *GetHireOfferByApplicationRespOfferBasicInfoOnboardAddressCountry  `json:"country,omitempty"`  // 国家信息
}

// GetHireOfferByApplicationRespOfferBasicInfoOnboardAddressCity ...
type GetHireOfferByApplicationRespOfferBasicInfoOnboardAddressCity struct {
	ZhName       string `json:"zh_name,omitempty"`       // 中文名称
	EnName       string `json:"en_name,omitempty"`       // 英文名称
	Code         string `json:"code,omitempty"`          // 编码
	LocationType int64  `json:"location_type,omitempty"` // 地址类型, 可选值有: 1: COUNTRY, 2: STATE, 3: CITY, 4: DISTRICT, 5: ADDRESS
}

// GetHireOfferByApplicationRespOfferBasicInfoOnboardAddressCountry ...
type GetHireOfferByApplicationRespOfferBasicInfoOnboardAddressCountry struct {
	ZhName       string `json:"zh_name,omitempty"`       // 中文名称
	EnName       string `json:"en_name,omitempty"`       // 英文名称
	Code         string `json:"code,omitempty"`          // 编码
	LocationType int64  `json:"location_type,omitempty"` // 地址类型, 可选值有: 1: COUNTRY, 2: STATE, 3: CITY, 4: DISTRICT, 5: ADDRESS
}

// GetHireOfferByApplicationRespOfferBasicInfoOnboardAddressDistrict ...
type GetHireOfferByApplicationRespOfferBasicInfoOnboardAddressDistrict struct {
	ZhName       string `json:"zh_name,omitempty"`       // 中文名称
	EnName       string `json:"en_name,omitempty"`       // 英文名称
	Code         string `json:"code,omitempty"`          // 编码
	LocationType int64  `json:"location_type,omitempty"` // 地址类型
}

// GetHireOfferByApplicationRespOfferBasicInfoOnboardAddressState ...
type GetHireOfferByApplicationRespOfferBasicInfoOnboardAddressState struct {
	ZhName       string `json:"zh_name,omitempty"`       // 中文名称
	EnName       string `json:"en_name,omitempty"`       // 英文名称
	Code         string `json:"code,omitempty"`          // 编码
	LocationType int64  `json:"location_type,omitempty"` // 地址类型, 可选值有: 1: COUNTRY, 2: STATE, 3: CITY, 4: DISTRICT, 5: ADDRESS
}

// GetHireOfferByApplicationRespOfferBasicInfoRecruitmentType ...
type GetHireOfferByApplicationRespOfferBasicInfoRecruitmentType struct {
	ID     string `json:"id,omitempty"`      // ID
	ZhName string `json:"zh_name,omitempty"` // 中文名称
	EnName string `json:"en_name,omitempty"` // 英文名称
}

// GetHireOfferByApplicationRespOfferBasicInfoSequence ...
type GetHireOfferByApplicationRespOfferBasicInfoSequence struct {
	ID     string `json:"id,omitempty"`      // ID
	ZhName string `json:"zh_name,omitempty"` // 中文名称
	EnName string `json:"en_name,omitempty"` // 英文名称
}

// GetHireOfferByApplicationRespOfferBasicInfoWorkAddress ...
type GetHireOfferByApplicationRespOfferBasicInfoWorkAddress struct {
	ID       string                                                          `json:"id,omitempty"`       // ID
	ZhName   string                                                          `json:"zh_name,omitempty"`  // 中文名称
	EnName   string                                                          `json:"en_name,omitempty"`  // 英文名称
	District *GetHireOfferByApplicationRespOfferBasicInfoWorkAddressDistrict `json:"district,omitempty"` // 区域信息
	City     *GetHireOfferByApplicationRespOfferBasicInfoWorkAddressCity     `json:"city,omitempty"`     // 城市信息
	State    *GetHireOfferByApplicationRespOfferBasicInfoWorkAddressState    `json:"state,omitempty"`    // 省信息
	Country  *GetHireOfferByApplicationRespOfferBasicInfoWorkAddressCountry  `json:"country,omitempty"`  // 国家信息
}

// GetHireOfferByApplicationRespOfferBasicInfoWorkAddressCity ...
type GetHireOfferByApplicationRespOfferBasicInfoWorkAddressCity struct {
	ZhName       string `json:"zh_name,omitempty"`       // 中文名称
	EnName       string `json:"en_name,omitempty"`       // 英文名称
	Code         string `json:"code,omitempty"`          // 编码
	LocationType int64  `json:"location_type,omitempty"` // 地址类型, 可选值有: 1: COUNTRY, 2: STATE, 3: CITY, 4: DISTRICT, 5: ADDRESS
}

// GetHireOfferByApplicationRespOfferBasicInfoWorkAddressCountry ...
type GetHireOfferByApplicationRespOfferBasicInfoWorkAddressCountry struct {
	ZhName       string `json:"zh_name,omitempty"`       // 中文名称
	EnName       string `json:"en_name,omitempty"`       // 英文名称
	Code         string `json:"code,omitempty"`          // 编码
	LocationType int64  `json:"location_type,omitempty"` // 地址类型, 可选值有: 1: COUNTRY, 2: STATE, 3: CITY, 4: DISTRICT, 5: ADDRESS
}

// GetHireOfferByApplicationRespOfferBasicInfoWorkAddressDistrict ...
type GetHireOfferByApplicationRespOfferBasicInfoWorkAddressDistrict struct {
	ZhName       string `json:"zh_name,omitempty"`       // 中文名称
	EnName       string `json:"en_name,omitempty"`       // 英文名称
	Code         string `json:"code,omitempty"`          // 编码
	LocationType int64  `json:"location_type,omitempty"` // 地址类型
}

// GetHireOfferByApplicationRespOfferBasicInfoWorkAddressState ...
type GetHireOfferByApplicationRespOfferBasicInfoWorkAddressState struct {
	ZhName       string `json:"zh_name,omitempty"`       // 中文名称
	EnName       string `json:"en_name,omitempty"`       // 英文名称
	Code         string `json:"code,omitempty"`          // 编码
	LocationType int64  `json:"location_type,omitempty"` // 地址类型, 可选值有: 1: COUNTRY, 2: STATE, 3: CITY, 4: DISTRICT, 5: ADDRESS
}

// GetHireOfferByApplicationRespOfferCustomizedModule ...
type GetHireOfferByApplicationRespOfferCustomizedModule struct {
	ID         string                                                      `json:"ID,omitempty"`          // 自定义模块ID
	ObjectList []*GetHireOfferByApplicationRespOfferCustomizedModuleObject `json:"object_list,omitempty"` // 自定义模块下字段的值
}

// GetHireOfferByApplicationRespOfferCustomizedModuleObject ...
type GetHireOfferByApplicationRespOfferCustomizedModuleObject struct {
	ObjectID       string `json:"object_id,omitempty"`       // 自定义字段ID
	CustomizeValue string `json:"customize_value,omitempty"` // 自定义字段Value
}

// GetHireOfferByApplicationRespOfferJobInfo ...
type GetHireOfferByApplicationRespOfferJobInfo struct {
	JobID   string `json:"job_id,omitempty"`   // Offer 职位 ID
	JobName string `json:"job_name,omitempty"` // Offer 职位名称
}

// GetHireOfferByApplicationRespOfferSalaryPlan ...
type GetHireOfferByApplicationRespOfferSalaryPlan struct {
	Currency                  string                                                       `json:"currency,omitempty"`                    // 币种
	BasicSalary               string                                                       `json:"basic_salary,omitempty"`                // 基本薪资, 为JSON 格式, amount 代表基本薪资的金额, peroid 代表基本薪资的周期单位, 如: "{\"amount\":\"10000\", "\period\":2}"
	ProbationSalaryPercentage string                                                       `json:"probation_salary_percentage,omitempty"` // 试用期百分比
	AwardSalaryMultiple       string                                                       `json:"award_salary_multiple,omitempty"`       // 年终奖月数
	OptionShares              string                                                       `json:"option_shares,omitempty"`               // 期权股数
	QuarterlyBonus            string                                                       `json:"quarterly_bonus,omitempty"`             // 季度奖金额
	HalfYearBonus             string                                                       `json:"half_year_bonus,omitempty"`             // 半年奖金额
	TotalAnnualCash           string                                                       `json:"total_annual_cash,omitempty"`           // 年度现金总额(数量, 非公式)
	CustomizeInfoList         []*GetHireOfferByApplicationRespOfferSalaryPlanCustomizeInfo `json:"customize_info_list,omitempty"`         // 自定义字段的 value 信息
}

// GetHireOfferByApplicationRespOfferSalaryPlanCustomizeInfo ...
type GetHireOfferByApplicationRespOfferSalaryPlanCustomizeInfo struct {
	ObjectID       string `json:"object_id,omitempty"`       // 自定义字段 ID
	CustomizeValue string `json:"customize_value,omitempty"` // 自定义字段 value
}

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