-
-
Notifications
You must be signed in to change notification settings - Fork 71
/
Copy pathapi_corehr_location_get.go
217 lines (191 loc) · 14 KB
/
api_corehr_location_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
// 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"
)
// GetCoreHRLocation 根据 ID 查询单个地点。
//
// doc: https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/location/get
// new doc: https://open.feishu.cn/document/server-docs/corehr-v1/organization-management/location/get
func (r *CoreHRService) GetCoreHRLocation(ctx context.Context, request *GetCoreHRLocationReq, options ...MethodOptionFunc) (*GetCoreHRLocationResp, *Response, error) {
if r.cli.mock.mockCoreHRGetCoreHRLocation != nil {
r.cli.Log(ctx, LogLevelDebug, "[lark] CoreHR#GetCoreHRLocation mock enable")
return r.cli.mock.mockCoreHRGetCoreHRLocation(ctx, request, options...)
}
req := &RawRequestReq{
Scope: "CoreHR",
API: "GetCoreHRLocation",
Method: "GET",
URL: r.cli.openBaseURL + "/open-apis/corehr/v1/locations/:location_id",
Body: request,
MethodOption: newMethodOption(options),
NeedTenantAccessToken: true,
}
resp := new(getCoreHRLocationResp)
response, err := r.cli.RawRequest(ctx, req, resp)
return resp.Data, response, err
}
// MockCoreHRGetCoreHRLocation mock CoreHRGetCoreHRLocation method
func (r *Mock) MockCoreHRGetCoreHRLocation(f func(ctx context.Context, request *GetCoreHRLocationReq, options ...MethodOptionFunc) (*GetCoreHRLocationResp, *Response, error)) {
r.mockCoreHRGetCoreHRLocation = f
}
// UnMockCoreHRGetCoreHRLocation un-mock CoreHRGetCoreHRLocation method
func (r *Mock) UnMockCoreHRGetCoreHRLocation() {
r.mockCoreHRGetCoreHRLocation = nil
}
// GetCoreHRLocationReq ...
type GetCoreHRLocationReq struct {
LocationID string `path:"location_id" json:"-"` // 地点 ID, 示例值: "1215"
}
// GetCoreHRLocationResp ...
type GetCoreHRLocationResp struct {
Location *GetCoreHRLocationRespLocation `json:"location,omitempty"` // 地点信息
}
// GetCoreHRLocationRespLocation ...
type GetCoreHRLocationRespLocation struct {
ID string `json:"id,omitempty"` // 实体在CoreHR内部的唯一键
HiberarchyCommon *GetCoreHRLocationRespLocationHiberarchyCommon `json:"hiberarchy_common,omitempty"` // 层级关系, 内层字段见实体
LocationUsageList []*GetCoreHRLocationRespLocationLocationUsage `json:"location_usage_list,omitempty"` // 地点用途
Address []*GetCoreHRLocationRespLocationAddres `json:"address,omitempty"` // 地址
WorkingHoursTypeID string `json:"working_hours_type_id,omitempty"` // 工时制度
EffectiveTime string `json:"effective_time,omitempty"` // 生效时间
ExpirationTime string `json:"expiration_time,omitempty"` // 失效时间
CustomFields []*GetCoreHRLocationRespLocationCustomField `json:"custom_fields,omitempty"` // 自定义字段
Locale *GetCoreHRLocationRespLocationLocale `json:"locale,omitempty"` // 区域设置
TimeZoneID string `json:"time_zone_id,omitempty"` // 时区
DisplayLanguageID string `json:"display_language_id,omitempty"` // 默认显示语言
}
// GetCoreHRLocationRespLocationAddres ...
type GetCoreHRLocationRespLocationAddres struct {
FullAddressLocalScript string `json:"full_address_local_script,omitempty"` // 完整地址(本地文字)
FullAddressWesternScript string `json:"full_address_western_script,omitempty"` // 完整地址(西方文字)
ID string `json:"id,omitempty"` // 地址ID
CountryRegionID string `json:"country_region_id,omitempty"` // 国家 / 地区
RegionID string `json:"region_id,omitempty"` // 主要行政区
CityID string `json:"city_id,omitempty"` // 城市, 该字段已作废, 请使用 city_id_v2 字段
DistinctID string `json:"distinct_id,omitempty"` // 区/县, 该字段已作废, 请使用 district_id_v2 字段
AddressLine1 string `json:"address_line1,omitempty"` // 地址行 1
AddressLine2 string `json:"address_line2,omitempty"` // 地址行 2
AddressLine3 string `json:"address_line3,omitempty"` // 地址行 3
AddressLine4 string `json:"address_line4,omitempty"` // 地址行 4
AddressLine5 string `json:"address_line5,omitempty"` // 地址行 5
AddressLine6 string `json:"address_line6,omitempty"` // 地址行 6
AddressLine7 string `json:"address_line7,omitempty"` // 地址行 7
AddressLine8 string `json:"address_line8,omitempty"` // 地址行 8
AddressLine9 string `json:"address_line9,omitempty"` // 地址行 9
LocalAddressLine1 string `json:"local_address_line1,omitempty"` // 地址行 1(非拉丁语系的本地文字)
LocalAddressLine2 string `json:"local_address_line2,omitempty"` // 地址行 2(非拉丁语系的本地文字)
LocalAddressLine3 string `json:"local_address_line3,omitempty"` // 地址行 3(非拉丁语系的本地文字)
LocalAddressLine4 string `json:"local_address_line4,omitempty"` // 地址行 4(非拉丁语系的本地文字)
LocalAddressLine5 string `json:"local_address_line5,omitempty"` // 地址行 5(非拉丁语系的本地文字)
LocalAddressLine6 string `json:"local_address_line6,omitempty"` // 地址行 6(非拉丁语系的本地文字)
LocalAddressLine7 string `json:"local_address_line7,omitempty"` // 地址行 7(非拉丁语系的本地文字)
LocalAddressLine8 string `json:"local_address_line8,omitempty"` // 地址行 8(非拉丁语系的本地文字)
LocalAddressLine9 string `json:"local_address_line9,omitempty"` // 地址行 9(非拉丁语系的本地文字)
PostalCode string `json:"postal_code,omitempty"` // 邮政编码
AddressTypeList []*GetCoreHRLocationRespLocationAddresAddressType `json:"address_type_list,omitempty"` // 地址类型
IsPrimary bool `json:"is_primary,omitempty"` // 主要地址
IsPublic bool `json:"is_public,omitempty"` // 公开地址
CustomFields []*GetCoreHRLocationRespLocationAddresCustomField `json:"custom_fields,omitempty"` // 自定义字段
}
// GetCoreHRLocationRespLocationAddresAddressType ...
type GetCoreHRLocationRespLocationAddresAddressType struct {
EnumName string `json:"enum_name,omitempty"` // 枚举值
Display []*GetCoreHRLocationRespLocationAddresAddressTypeDisplay `json:"display,omitempty"` // 枚举多语展示
}
// GetCoreHRLocationRespLocationAddresAddressTypeDisplay ...
type GetCoreHRLocationRespLocationAddresAddressTypeDisplay struct {
Lang string `json:"lang,omitempty"` // 语言
Value string `json:"value,omitempty"` // 内容
}
// GetCoreHRLocationRespLocationAddresCustomField ...
type GetCoreHRLocationRespLocationAddresCustomField 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])
}
// GetCoreHRLocationRespLocationCustomField ...
type GetCoreHRLocationRespLocationCustomField 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])
}
// GetCoreHRLocationRespLocationHiberarchyCommon ...
type GetCoreHRLocationRespLocationHiberarchyCommon struct {
ParentID string `json:"parent_id,omitempty"` // 上级地点
Name []*GetCoreHRLocationRespLocationHiberarchyCommonName `json:"name,omitempty"` // 名称
Type *GetCoreHRLocationRespLocationHiberarchyCommonType `json:"type,omitempty"` // 类型
Active bool `json:"active,omitempty"` // 启用
EffectiveTime string `json:"effective_time,omitempty"` // 生效时间
ExpirationTime string `json:"expiration_time,omitempty"` // 失效时间
Code string `json:"code,omitempty"` // 编码
Description []*GetCoreHRLocationRespLocationHiberarchyCommonDescription `json:"description,omitempty"` // 描述
TreeOrder string `json:"tree_order,omitempty"` // 树形排序
ListOrder string `json:"list_order,omitempty"` // 列表排序
CustomFields []*GetCoreHRLocationRespLocationHiberarchyCommonCustomField `json:"custom_fields,omitempty"` // 自定义字段
}
// GetCoreHRLocationRespLocationHiberarchyCommonCustomField ...
type GetCoreHRLocationRespLocationHiberarchyCommonCustomField 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])
}
// GetCoreHRLocationRespLocationHiberarchyCommonDescription ...
type GetCoreHRLocationRespLocationHiberarchyCommonDescription struct {
Lang string `json:"lang,omitempty"` // 语言
Value string `json:"value,omitempty"` // 内容
}
// GetCoreHRLocationRespLocationHiberarchyCommonName ...
type GetCoreHRLocationRespLocationHiberarchyCommonName struct {
Lang string `json:"lang,omitempty"` // 语言
Value string `json:"value,omitempty"` // 内容
}
// GetCoreHRLocationRespLocationHiberarchyCommonType ...
type GetCoreHRLocationRespLocationHiberarchyCommonType struct {
EnumName string `json:"enum_name,omitempty"` // 枚举值
Display []*GetCoreHRLocationRespLocationHiberarchyCommonTypeDisplay `json:"display,omitempty"` // 枚举多语展示
}
// GetCoreHRLocationRespLocationHiberarchyCommonTypeDisplay ...
type GetCoreHRLocationRespLocationHiberarchyCommonTypeDisplay struct {
Lang string `json:"lang,omitempty"` // 语言
Value string `json:"value,omitempty"` // 内容
}
// GetCoreHRLocationRespLocationLocale ...
type GetCoreHRLocationRespLocationLocale struct {
EnumName string `json:"enum_name,omitempty"` // 枚举值
Display []*GetCoreHRLocationRespLocationLocaleDisplay `json:"display,omitempty"` // 枚举多语展示
}
// GetCoreHRLocationRespLocationLocaleDisplay ...
type GetCoreHRLocationRespLocationLocaleDisplay struct {
Lang string `json:"lang,omitempty"` // 语言
Value string `json:"value,omitempty"` // 内容
}
// GetCoreHRLocationRespLocationLocationUsage ...
type GetCoreHRLocationRespLocationLocationUsage struct {
EnumName string `json:"enum_name,omitempty"` // 枚举值
Display []*GetCoreHRLocationRespLocationLocationUsageDisplay `json:"display,omitempty"` // 枚举多语展示
}
// GetCoreHRLocationRespLocationLocationUsageDisplay ...
type GetCoreHRLocationRespLocationLocationUsageDisplay struct {
Lang string `json:"lang,omitempty"` // 语言
Value string `json:"value,omitempty"` // 内容
}
// getCoreHRLocationResp ...
type getCoreHRLocationResp struct {
Code int64 `json:"code,omitempty"` // 错误码, 非 0 表示失败
Msg string `json:"msg,omitempty"` // 错误描述
Data *GetCoreHRLocationResp `json:"data,omitempty"`
Error *ErrorDetail `json:"error,omitempty"`
}