-
-
Notifications
You must be signed in to change notification settings - Fork 71
/
Copy pathapi_corehr_job_list.go
120 lines (105 loc) · 6.08 KB
/
api_corehr_job_list.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
// 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"
)
// GetCoreHRJobList 批量查询职务。
//
// doc: https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job/list
// new doc: https://open.feishu.cn/document/server-docs/corehr-v1/job-management/job/list
func (r *CoreHRService) GetCoreHRJobList(ctx context.Context, request *GetCoreHRJobListReq, options ...MethodOptionFunc) (*GetCoreHRJobListResp, *Response, error) {
if r.cli.mock.mockCoreHRGetCoreHRJobList != nil {
r.cli.Log(ctx, LogLevelDebug, "[lark] CoreHR#GetCoreHRJobList mock enable")
return r.cli.mock.mockCoreHRGetCoreHRJobList(ctx, request, options...)
}
req := &RawRequestReq{
Scope: "CoreHR",
API: "GetCoreHRJobList",
Method: "GET",
URL: r.cli.openBaseURL + "/open-apis/corehr/v1/jobs",
Body: request,
MethodOption: newMethodOption(options),
NeedTenantAccessToken: true,
}
resp := new(getCoreHRJobListResp)
response, err := r.cli.RawRequest(ctx, req, resp)
return resp.Data, response, err
}
// MockCoreHRGetCoreHRJobList mock CoreHRGetCoreHRJobList method
func (r *Mock) MockCoreHRGetCoreHRJobList(f func(ctx context.Context, request *GetCoreHRJobListReq, options ...MethodOptionFunc) (*GetCoreHRJobListResp, *Response, error)) {
r.mockCoreHRGetCoreHRJobList = f
}
// UnMockCoreHRGetCoreHRJobList un-mock CoreHRGetCoreHRJobList method
func (r *Mock) UnMockCoreHRGetCoreHRJobList() {
r.mockCoreHRGetCoreHRJobList = nil
}
// GetCoreHRJobListReq ...
type GetCoreHRJobListReq struct {
PageToken *string `query:"page_token" json:"-"` // 分页标记, 第一次请求不填, 表示从头开始遍历;分页查询结果还有更多项时会同时返回新的 page_token, 下次遍历可采用该 page_token 获取查询结果, 示例值: 1231231987
PageSize int64 `query:"page_size" json:"-"` // 分页大小, 示例值: 100
Name *string `query:"name" json:"-"` // 名称, 示例值: keyword
QueryLanguage *string `query:"query_language" json:"-"` // 语言, 示例值: zh
}
// GetCoreHRJobListResp ...
type GetCoreHRJobListResp struct {
Items []*GetCoreHRJobListRespItem `json:"items,omitempty"` // 查询的职务信息
HasMore bool `json:"has_more,omitempty"` // 是否还有更多项
PageToken string `json:"page_token,omitempty"` // 分页标记, 当 has_more 为 true 时, 会同时返回新的 page_token, 否则不返回 page_token
}
// GetCoreHRJobListRespItem ...
type GetCoreHRJobListRespItem struct {
ID string `json:"id,omitempty"` // 职务 ID
Code string `json:"code,omitempty"` // 编码
Name []*GetCoreHRJobListRespItemName `json:"name,omitempty"` // 名称
Description []*GetCoreHRJobListRespItemDescription `json:"description,omitempty"` // 描述
Active bool `json:"active,omitempty"` // 是否启用
JobTitle []*GetCoreHRJobListRespItemJobTitle `json:"job_title,omitempty"` // 职务头衔
JobFamilyIDList []string `json:"job_family_id_list,omitempty"` // 职务序列 ID 列表, 枚举值及详细信息可通过[批量查询职务序列]接口查询获得
JobLevelIDList []string `json:"job_level_id_list,omitempty"` // 职务级别 ID 列表, 枚举值及详细信息可通过[批量查询职务级别]接口查询获得
WorkingHoursTypeID string `json:"working_hours_type_id,omitempty"` // 工时制度 ID, 枚举值及详细信息可通过[批量查询工时制度]接口查询获得
EffectiveTime string `json:"effective_time,omitempty"` // 生效时间
ExpirationTime string `json:"expiration_time,omitempty"` // 失效时间
CustomFields []*GetCoreHRJobListRespItemCustomField `json:"custom_fields,omitempty"` // 自定义字段
}
// GetCoreHRJobListRespItemCustomField ...
type GetCoreHRJobListRespItemCustomField struct {
FieldName string `json:"field_name,omitempty"` // 字段名
Value string `json:"value,omitempty"` // 字段值, 是json转义后的字符串, 根据元数据定义不同, 字段格式不同(如123, 123.23, "true", [\"id1\", \"id2\"], "2006-01-02 15:04:05")
}
// GetCoreHRJobListRespItemDescription ...
type GetCoreHRJobListRespItemDescription struct {
Lang string `json:"lang,omitempty"` // 名称信息的语言
Value string `json:"value,omitempty"` // 名称信息的内容
}
// GetCoreHRJobListRespItemJobTitle ...
type GetCoreHRJobListRespItemJobTitle struct {
Lang string `json:"lang,omitempty"` // 名称信息的语言
Value string `json:"value,omitempty"` // 名称信息的内容
}
// GetCoreHRJobListRespItemName ...
type GetCoreHRJobListRespItemName struct {
Lang string `json:"lang,omitempty"` // 名称信息的语言
Value string `json:"value,omitempty"` // 名称信息的内容
}
// getCoreHRJobListResp ...
type getCoreHRJobListResp struct {
Code int64 `json:"code,omitempty"` // 错误码, 非 0 表示失败
Msg string `json:"msg,omitempty"` // 错误描述
Data *GetCoreHRJobListResp `json:"data,omitempty"`
Error *ErrorDetail `json:"error,omitempty"`
}