-
-
Notifications
You must be signed in to change notification settings - Fork 71
/
Copy pathapi_corehr_country_region_subdivision_search.go
108 lines (94 loc) · 7.15 KB
/
api_corehr_country_region_subdivision_search.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
// 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"
)
// SearchCoreHRCountryRegionSubdivision 根据省份/行政区 ID、状态批量查询行政区、省份、州等数据
//
// doc: https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/corehr-v2/basic_info-country_region_subdivision/search
func (r *CoreHRService) SearchCoreHRCountryRegionSubdivision(ctx context.Context, request *SearchCoreHRCountryRegionSubdivisionReq, options ...MethodOptionFunc) (*SearchCoreHRCountryRegionSubdivisionResp, *Response, error) {
if r.cli.mock.mockCoreHRSearchCoreHRCountryRegionSubdivision != nil {
r.cli.Log(ctx, LogLevelDebug, "[lark] CoreHR#SearchCoreHRCountryRegionSubdivision mock enable")
return r.cli.mock.mockCoreHRSearchCoreHRCountryRegionSubdivision(ctx, request, options...)
}
req := &RawRequestReq{
Scope: "CoreHR",
API: "SearchCoreHRCountryRegionSubdivision",
Method: "POST",
URL: r.cli.openBaseURL + "/open-apis/corehr/v2/basic_info/country_region_subdivisions/search",
Body: request,
MethodOption: newMethodOption(options),
NeedTenantAccessToken: true,
}
resp := new(searchCoreHRCountryRegionSubdivisionResp)
response, err := r.cli.RawRequest(ctx, req, resp)
return resp.Data, response, err
}
// MockCoreHRSearchCoreHRCountryRegionSubdivision mock CoreHRSearchCoreHRCountryRegionSubdivision method
func (r *Mock) MockCoreHRSearchCoreHRCountryRegionSubdivision(f func(ctx context.Context, request *SearchCoreHRCountryRegionSubdivisionReq, options ...MethodOptionFunc) (*SearchCoreHRCountryRegionSubdivisionResp, *Response, error)) {
r.mockCoreHRSearchCoreHRCountryRegionSubdivision = f
}
// UnMockCoreHRSearchCoreHRCountryRegionSubdivision un-mock CoreHRSearchCoreHRCountryRegionSubdivision method
func (r *Mock) UnMockCoreHRSearchCoreHRCountryRegionSubdivision() {
r.mockCoreHRSearchCoreHRCountryRegionSubdivision = nil
}
// SearchCoreHRCountryRegionSubdivisionReq ...
type SearchCoreHRCountryRegionSubdivisionReq struct {
PageSize int64 `query:"page_size" json:"-"` // 分页大小, 最大 100, 示例值: 100, 取值范围: `1` ~ `100`
PageToken *string `query:"page_token" json:"-"` // 分页标记, 第一次请求不填, 表示从头开始遍历;分页查询结果还有更多项时会同时返回新的 page_token, 下次遍历可采用该 page_token 获取查询结果, 示例值: 6891251722631890445
CountryRegionIDList []string `json:"country_region_id_list,omitempty"` // 国家/地区 ID 列表, 可通过[查询国家 / 地区信息](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/corehr-v2/basic_info-country_region/search)接口获取, 不填写则返回全部列表, 示例值: ["6891251722631891995"], 最大长度: `100`
CountryRegionSubdivisionIDList []string `json:"country_region_subdivision_id_list,omitempty"` // 省份/行政区 ID 列表, 不填写则返回全部列表, 示例值: ["6891251222631891995"], 最大长度: `100`
StatusList []int64 `json:"status_list,omitempty"` // 省份/行政区状态列表, 不填写则返回全部列表, 示例值: [1], 可选值有: 1: 生效, 0: 失效, 默认值: `[1]`, 最大长度: `2`
}
// SearchCoreHRCountryRegionSubdivisionResp ...
type SearchCoreHRCountryRegionSubdivisionResp struct {
Items []*SearchCoreHRCountryRegionSubdivisionRespItem `json:"items,omitempty"` // 查询的省份/行政区信息
PageToken string `json:"page_token,omitempty"` // 分页标记, 当 has_more 为 true 时, 会同时返回新的 page_token, 否则不返回 page_token
HasMore bool `json:"has_more,omitempty"` // 是否还有更多项
}
// SearchCoreHRCountryRegionSubdivisionRespItem ...
type SearchCoreHRCountryRegionSubdivisionRespItem struct {
CountryRegionSubdivisionID string `json:"country_region_subdivision_id,omitempty"` // 省份/行政区 ID
Name []*SearchCoreHRCountryRegionSubdivisionRespItemName `json:"name,omitempty"` // 省份/行政区名称
CountryRegionID string `json:"country_region_id,omitempty"` // 所属国家/地区 ID, 详细信息可通过[查询国家 / 地区信息](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/corehr-v2/basic_info-country_region/search)接口查询获得
SubdivisionType *SearchCoreHRCountryRegionSubdivisionRespItemSubdivisionType `json:"subdivision_type,omitempty"` // 行政区类型, 枚举值可通过文档[枚举常量](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/feishu-people-enum-constant)行政区类型(subdivision_type)枚举定义部分获得
IsoCode string `json:"iso_code,omitempty"` // 省份/行政区三字码
Status int64 `json:"status,omitempty"` // 状态, 可选值有: 1: 生效, 0: 失效
}
// SearchCoreHRCountryRegionSubdivisionRespItemName ...
type SearchCoreHRCountryRegionSubdivisionRespItemName struct {
Lang string `json:"lang,omitempty"` // 语言
Value string `json:"value,omitempty"` // 内容
}
// SearchCoreHRCountryRegionSubdivisionRespItemSubdivisionType ...
type SearchCoreHRCountryRegionSubdivisionRespItemSubdivisionType struct {
EnumName string `json:"enum_name,omitempty"` // 枚举值
Display []*SearchCoreHRCountryRegionSubdivisionRespItemSubdivisionTypeDisplay `json:"display,omitempty"` // 枚举多语展示
}
// SearchCoreHRCountryRegionSubdivisionRespItemSubdivisionTypeDisplay ...
type SearchCoreHRCountryRegionSubdivisionRespItemSubdivisionTypeDisplay struct {
Lang string `json:"lang,omitempty"` // 语言
Value string `json:"value,omitempty"` // 内容
}
// searchCoreHRCountryRegionSubdivisionResp ...
type searchCoreHRCountryRegionSubdivisionResp struct {
Code int64 `json:"code,omitempty"` // 错误码, 非 0 表示失败
Msg string `json:"msg,omitempty"` // 错误描述
Data *SearchCoreHRCountryRegionSubdivisionResp `json:"data,omitempty"`
Error *ErrorDetail `json:"error,omitempty"`
}