-
-
Notifications
You must be signed in to change notification settings - Fork 71
/
Copy pathapi_attendance_group_list.go
84 lines (73 loc) · 3.76 KB
/
api_attendance_group_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
// 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"
)
// GetAttendanceGroupList 翻页获取所有考勤组列表。
//
// doc: https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/group/list
// new doc: https://open.feishu.cn/document/server-docs/attendance-v1/group/list
func (r *AttendanceService) GetAttendanceGroupList(ctx context.Context, request *GetAttendanceGroupListReq, options ...MethodOptionFunc) (*GetAttendanceGroupListResp, *Response, error) {
if r.cli.mock.mockAttendanceGetAttendanceGroupList != nil {
r.cli.Log(ctx, LogLevelDebug, "[lark] Attendance#GetAttendanceGroupList mock enable")
return r.cli.mock.mockAttendanceGetAttendanceGroupList(ctx, request, options...)
}
req := &RawRequestReq{
Scope: "Attendance",
API: "GetAttendanceGroupList",
Method: "GET",
URL: r.cli.openBaseURL + "/open-apis/attendance/v1/groups",
Body: request,
MethodOption: newMethodOption(options),
NeedTenantAccessToken: true,
}
resp := new(getAttendanceGroupListResp)
response, err := r.cli.RawRequest(ctx, req, resp)
return resp.Data, response, err
}
// MockAttendanceGetAttendanceGroupList mock AttendanceGetAttendanceGroupList method
func (r *Mock) MockAttendanceGetAttendanceGroupList(f func(ctx context.Context, request *GetAttendanceGroupListReq, options ...MethodOptionFunc) (*GetAttendanceGroupListResp, *Response, error)) {
r.mockAttendanceGetAttendanceGroupList = f
}
// UnMockAttendanceGetAttendanceGroupList un-mock AttendanceGetAttendanceGroupList method
func (r *Mock) UnMockAttendanceGetAttendanceGroupList() {
r.mockAttendanceGetAttendanceGroupList = nil
}
// GetAttendanceGroupListReq ...
type GetAttendanceGroupListReq struct {
PageSize *int64 `query:"page_size" json:"-"` // 分页大小, 示例值: 10, 默认值: `10`, 取值范围: `1` ~ `50`
PageToken *string `query:"page_token" json:"-"` // 分页标记, 第一次请求不填, 表示从头开始遍历;分页查询结果还有更多项时会同时返回新的 page_token, 下次遍历可采用该 page_token 获取查询结果, 示例值: wgNOR1rmxogRvAsGl6CXlQ[
}
// GetAttendanceGroupListResp ...
type GetAttendanceGroupListResp struct {
GroupList []*GetAttendanceGroupListRespGroup `json:"group_list,omitempty"` // 考勤组列表
PageToken string `json:"page_token,omitempty"` // 分页标记, 当 has_more 为 true 时, 会同时返回新的 page_token, 否则不返回 page_token
HasMore bool `json:"has_more,omitempty"` // 是否还有更多项
}
// GetAttendanceGroupListRespGroup ...
type GetAttendanceGroupListRespGroup struct {
GroupID string `json:"group_id,omitempty"` // 考勤组 ID
GroupName string `json:"group_name,omitempty"` // 考勤组名称
}
// getAttendanceGroupListResp ...
type getAttendanceGroupListResp struct {
Code int64 `json:"code,omitempty"` // 错误码, 非 0 表示失败
Msg string `json:"msg,omitempty"` // 错误描述
Data *GetAttendanceGroupListResp `json:"data,omitempty"`
Error *ErrorDetail `json:"error,omitempty"`
}