-
-
Notifications
You must be signed in to change notification settings - Fork 71
/
Copy pathapi_hire_offer_get.go
300 lines (264 loc) · 21.4 KB
/
api_hire_offer_get.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
// 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"
)
// GetHireOffer 根据 Offer ID 获取 Offer 详细信息。
//
// doc: https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/offer/get
// new doc: https://open.feishu.cn/document/server-docs/hire-v1/candidate-management/delivery-process-management/offer/get
func (r *HireService) GetHireOffer(ctx context.Context, request *GetHireOfferReq, options ...MethodOptionFunc) (*GetHireOfferResp, *Response, error) {
if r.cli.mock.mockHireGetHireOffer != nil {
r.cli.Log(ctx, LogLevelDebug, "[lark] Hire#GetHireOffer mock enable")
return r.cli.mock.mockHireGetHireOffer(ctx, request, options...)
}
req := &RawRequestReq{
Scope: "Hire",
API: "GetHireOffer",
Method: "GET",
URL: r.cli.openBaseURL + "/open-apis/hire/v1/offers/:offer_id",
Body: request,
MethodOption: newMethodOption(options),
NeedTenantAccessToken: true,
}
resp := new(getHireOfferResp)
response, err := r.cli.RawRequest(ctx, req, resp)
return resp.Data, response, err
}
// MockHireGetHireOffer mock HireGetHireOffer method
func (r *Mock) MockHireGetHireOffer(f func(ctx context.Context, request *GetHireOfferReq, options ...MethodOptionFunc) (*GetHireOfferResp, *Response, error)) {
r.mockHireGetHireOffer = f
}
// UnMockHireGetHireOffer un-mock HireGetHireOffer method
func (r *Mock) UnMockHireGetHireOffer() {
r.mockHireGetHireOffer = nil
}
// GetHireOfferReq ...
type GetHireOfferReq struct {
OfferID string `path:"offer_id" json:"-"` // Offer ID, 示例值: "1111111"
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), people_admin_id: 以 people_admin_id 来识别用户, 默认值: `open_id`, 当值为 `user_id`, 字段权限要求: 获取用户 user ID
DepartmentIDType *DepartmentIDType `query:"department_id_type" json:"-"` // 此次调用中使用的部门 ID 的类型, 示例值: 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`
}
// GetHireOfferResp ...
type GetHireOfferResp struct {
Offer *GetHireOfferRespOffer `json:"offer,omitempty"` // Offer 详情
}
// GetHireOfferRespOffer ...
type GetHireOfferRespOffer struct {
ID string `json:"id,omitempty"` // Offer ID
ApplicationID string `json:"application_id,omitempty"` // 投递 ID
BasicInfo *GetHireOfferRespOfferBasicInfo `json:"basic_info,omitempty"` // 基础信息
SalaryPlan *GetHireOfferRespOfferSalaryPlan `json:"salary_plan,omitempty"` // 薪酬计划, 字段权限要求(满足任一): 获取 offer 信息, 更新 offer 信息
SchemaID string `json:"schema_id,omitempty"` // 当前 Offer 使用的 Schema
OfferStatus int64 `json:"offer_status,omitempty"` // Offer 状态, 可选值有: 1: 未申请, 2: 审批中, 3: 审批已撤回, 4: 审批通过, 5: 审批不通过, 6: Offer 已发出, 7: 候选人已接受, 8: 候选人已拒绝, 9: Offer 已失效, 10: 未审批, 11: 实习待入职(仅实习 Offer 具有), 12: 实习已入职(仅实习 Offer 具有), 13: 实习已离职(仅实习 Offer 具有)
OfferType int64 `json:"offer_type,omitempty"` // Offer 类型, 可选值有: 1: 正式 Offer, 2: 实习 Offer
JobInfo *GetHireOfferRespOfferJobInfo `json:"job_info,omitempty"` // 职位信息
CustomizedModuleList []*GetHireOfferRespOfferCustomizedModule `json:"customized_module_list,omitempty"` // offer自定义模块列表, 字段权限要求(满足任一): 获取 offer 信息, 更新 offer 信息
}
// GetHireOfferRespOfferBasicInfo ...
type GetHireOfferRespOfferBasicInfo struct {
OfferType int64 `json:"offer_type,omitempty"` // Offer 类型, 可选值有: 1: 社招offer, 2: 校招offer, 3: 实习offer, 4: 实习生转正offer, 商业化租户无此选项
Remark string `json:"remark,omitempty"` // 备注, 字段权限要求(满足任一): 获取 offer 信息, 更新 offer 信息
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 *GetHireOfferRespOfferBasicInfoEmployeeType `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 *GetHireOfferRespOfferBasicInfoContractPeriod `json:"contract_period,omitempty"` // 合同期(年/月)
RecruitmentType *GetHireOfferRespOfferBasicInfoRecruitmentType `json:"recruitment_type,omitempty"` // 雇员类型
Sequence *GetHireOfferRespOfferBasicInfoSequence `json:"sequence,omitempty"` // 序列
Level *GetHireOfferRespOfferBasicInfoLevel `json:"level,omitempty"` // 级别, 字段权限要求(满足任一): 获取 offer 信息, 更新 offer 信息
OnboardAddress *GetHireOfferRespOfferBasicInfoOnboardAddress `json:"onboard_address,omitempty"` // 入职地点
WorkAddress *GetHireOfferRespOfferBasicInfoWorkAddress `json:"work_address,omitempty"` // 工作地点
CustomizeInfoList []*GetHireOfferRespOfferBasicInfoCustomizeInfo `json:"customize_info_list,omitempty"` // 自定义字段信息, 字段权限要求(满足任一): 获取 offer 信息, 更新 offer 信息
WorkLocationAddressInfo *GetHireOfferRespOfferBasicInfoWorkLocationAddressInfo `json:"work_location_address_info,omitempty"` // 人事侧的办公地点与地址(目前仅字节可用)
}
// GetHireOfferRespOfferBasicInfoContractPeriod ...
type GetHireOfferRespOfferBasicInfoContractPeriod struct {
PeriodType int64 `json:"period_type,omitempty"` // 合同周期类型, 可选值有: 1: 月, 2: 年
Period int64 `json:"period,omitempty"` // 合同时长
}
// GetHireOfferRespOfferBasicInfoCustomizeInfo ...
type GetHireOfferRespOfferBasicInfoCustomizeInfo struct {
ObjectID string `json:"object_id,omitempty"` // 自定义字段 ID
CustomizeValue string `json:"customize_value,omitempty"` // 自定义字段 value
}
// GetHireOfferRespOfferBasicInfoEmployeeType ...
type GetHireOfferRespOfferBasicInfoEmployeeType struct {
ID string `json:"id,omitempty"` // ID
ZhName string `json:"zh_name,omitempty"` // 中文名称
EnName string `json:"en_name,omitempty"` // 英文名称
}
// GetHireOfferRespOfferBasicInfoLevel ...
type GetHireOfferRespOfferBasicInfoLevel struct {
ID string `json:"id,omitempty"` // ID
ZhName string `json:"zh_name,omitempty"` // 中文名称
EnName string `json:"en_name,omitempty"` // 英文名称
}
// GetHireOfferRespOfferBasicInfoOnboardAddress ...
type GetHireOfferRespOfferBasicInfoOnboardAddress struct {
ID string `json:"id,omitempty"` // ID
ZhName string `json:"zh_name,omitempty"` // 中文名称
EnName string `json:"en_name,omitempty"` // 英文名称
District *GetHireOfferRespOfferBasicInfoOnboardAddressDistrict `json:"district,omitempty"` // 区域信息
City *GetHireOfferRespOfferBasicInfoOnboardAddressCity `json:"city,omitempty"` // 城市信息
State *GetHireOfferRespOfferBasicInfoOnboardAddressState `json:"state,omitempty"` // 省信息
Country *GetHireOfferRespOfferBasicInfoOnboardAddressCountry `json:"country,omitempty"` // 国家信息
}
// GetHireOfferRespOfferBasicInfoOnboardAddressCity ...
type GetHireOfferRespOfferBasicInfoOnboardAddressCity 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
}
// GetHireOfferRespOfferBasicInfoOnboardAddressCountry ...
type GetHireOfferRespOfferBasicInfoOnboardAddressCountry 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
}
// GetHireOfferRespOfferBasicInfoOnboardAddressDistrict ...
type GetHireOfferRespOfferBasicInfoOnboardAddressDistrict struct {
ZhName string `json:"zh_name,omitempty"` // 中文名称
EnName string `json:"en_name,omitempty"` // 英文名称
Code string `json:"code,omitempty"` // 编码
LocationType int64 `json:"location_type,omitempty"` // 地址类型
}
// GetHireOfferRespOfferBasicInfoOnboardAddressState ...
type GetHireOfferRespOfferBasicInfoOnboardAddressState 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
}
// GetHireOfferRespOfferBasicInfoRecruitmentType ...
type GetHireOfferRespOfferBasicInfoRecruitmentType struct {
ID string `json:"id,omitempty"` // ID
ZhName string `json:"zh_name,omitempty"` // 中文名称
EnName string `json:"en_name,omitempty"` // 英文名称
}
// GetHireOfferRespOfferBasicInfoSequence ...
type GetHireOfferRespOfferBasicInfoSequence struct {
ID string `json:"id,omitempty"` // ID
ZhName string `json:"zh_name,omitempty"` // 中文名称
EnName string `json:"en_name,omitempty"` // 英文名称
}
// GetHireOfferRespOfferBasicInfoWorkAddress ...
type GetHireOfferRespOfferBasicInfoWorkAddress struct {
ID string `json:"id,omitempty"` // ID
ZhName string `json:"zh_name,omitempty"` // 中文名称
EnName string `json:"en_name,omitempty"` // 英文名称
District *GetHireOfferRespOfferBasicInfoWorkAddressDistrict `json:"district,omitempty"` // 区域信息
City *GetHireOfferRespOfferBasicInfoWorkAddressCity `json:"city,omitempty"` // 城市信息
State *GetHireOfferRespOfferBasicInfoWorkAddressState `json:"state,omitempty"` // 省信息
Country *GetHireOfferRespOfferBasicInfoWorkAddressCountry `json:"country,omitempty"` // 国家信息
}
// GetHireOfferRespOfferBasicInfoWorkAddressCity ...
type GetHireOfferRespOfferBasicInfoWorkAddressCity 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
}
// GetHireOfferRespOfferBasicInfoWorkAddressCountry ...
type GetHireOfferRespOfferBasicInfoWorkAddressCountry 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
}
// GetHireOfferRespOfferBasicInfoWorkAddressDistrict ...
type GetHireOfferRespOfferBasicInfoWorkAddressDistrict struct {
ZhName string `json:"zh_name,omitempty"` // 中文名称
EnName string `json:"en_name,omitempty"` // 英文名称
Code string `json:"code,omitempty"` // 编码
LocationType int64 `json:"location_type,omitempty"` // 地址类型
}
// GetHireOfferRespOfferBasicInfoWorkAddressState ...
type GetHireOfferRespOfferBasicInfoWorkAddressState 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
}
// GetHireOfferRespOfferBasicInfoWorkLocationAddressInfo ...
type GetHireOfferRespOfferBasicInfoWorkLocationAddressInfo struct {
LocationInfo *GetHireOfferRespOfferBasicInfoWorkLocationAddressInfoLocationInfo `json:"location_info,omitempty"` // 办公地点
AddressInfo *GetHireOfferRespOfferBasicInfoWorkLocationAddressInfoAddressInfo `json:"address_info,omitempty"` // 办公地址
}
// GetHireOfferRespOfferBasicInfoWorkLocationAddressInfoAddressInfo ...
type GetHireOfferRespOfferBasicInfoWorkLocationAddressInfoAddressInfo struct {
ID string `json:"id,omitempty"` // 地址ID
ZhName string `json:"zh_name,omitempty"` // 地址中文名称
EnName string `json:"en_name,omitempty"` // 地址英文名称
}
// GetHireOfferRespOfferBasicInfoWorkLocationAddressInfoLocationInfo ...
type GetHireOfferRespOfferBasicInfoWorkLocationAddressInfoLocationInfo struct {
ID string `json:"id,omitempty"` // 地点ID
ZhName string `json:"zh_name,omitempty"` // 中文名称
EnName string `json:"en_name,omitempty"` // 英文名称
}
// GetHireOfferRespOfferCustomizedModule ...
type GetHireOfferRespOfferCustomizedModule struct {
ID string `json:"ID,omitempty"` // 自定义模块ID
ObjectList []*GetHireOfferRespOfferCustomizedModuleObject `json:"object_list,omitempty"` // 自定义模块下字段的值
}
// GetHireOfferRespOfferCustomizedModuleObject ...
type GetHireOfferRespOfferCustomizedModuleObject struct {
ObjectID string `json:"object_id,omitempty"` // 自定义字段ID
CustomizeValue string `json:"customize_value,omitempty"` // 自定义字段Value
}
// GetHireOfferRespOfferJobInfo ...
type GetHireOfferRespOfferJobInfo struct {
JobID string `json:"job_id,omitempty"` // Offer 职位 ID
JobName string `json:"job_name,omitempty"` // Offer 职位名称
}
// GetHireOfferRespOfferSalaryPlan ...
type GetHireOfferRespOfferSalaryPlan 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 []*GetHireOfferRespOfferSalaryPlanCustomizeInfo `json:"customize_info_list,omitempty"` // 自定义字段的 value 信息
}
// GetHireOfferRespOfferSalaryPlanCustomizeInfo ...
type GetHireOfferRespOfferSalaryPlanCustomizeInfo struct {
ObjectID string `json:"object_id,omitempty"` // 自定义字段 ID
CustomizeValue string `json:"customize_value,omitempty"` // 自定义字段 value
}
// getHireOfferResp ...
type getHireOfferResp struct {
Code int64 `json:"code,omitempty"` // 错误码, 非 0 表示失败
Msg string `json:"msg,omitempty"` // 错误描述
Data *GetHireOfferResp `json:"data,omitempty"`
Error *ErrorDetail `json:"error,omitempty"`
}