forked from chyroc/lark
-
Notifications
You must be signed in to change notification settings - Fork 2
/
api_application_user_admin_scope_get.go
75 lines (65 loc) · 3.5 KB
/
api_application_user_admin_scope_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
// 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"
)
// GetApplicationUserAdminScope 该接口用于获取应用管理员的管理范围, 即该应用管理员能够管理哪些部门。
//
// doc: https://open.feishu.cn/document/ukTMukTMukTM/uMzN3QjLzczN04yM3cDN
func (r *ApplicationService) GetApplicationUserAdminScope(ctx context.Context, request *GetApplicationUserAdminScopeReq, options ...MethodOptionFunc) (*GetApplicationUserAdminScopeResp, *Response, error) {
if r.cli.mock.mockApplicationGetApplicationUserAdminScope != nil {
r.cli.log(ctx, LogLevelDebug, "[lark] Application#GetApplicationUserAdminScope mock enable")
return r.cli.mock.mockApplicationGetApplicationUserAdminScope(ctx, request, options...)
}
req := &RawRequestReq{
Scope: "Application",
API: "GetApplicationUserAdminScope",
Method: "GET",
URL: r.cli.openBaseURL + "/open-apis/contact/v1/user/admin_scope/get",
Body: request,
MethodOption: newMethodOption(options),
NeedTenantAccessToken: true,
}
resp := new(getApplicationUserAdminScopeResp)
response, err := r.cli.RawRequest(ctx, req, resp)
return resp.Data, response, err
}
// MockApplicationGetApplicationUserAdminScope mock ApplicationGetApplicationUserAdminScope method
func (r *Mock) MockApplicationGetApplicationUserAdminScope(f func(ctx context.Context, request *GetApplicationUserAdminScopeReq, options ...MethodOptionFunc) (*GetApplicationUserAdminScopeResp, *Response, error)) {
r.mockApplicationGetApplicationUserAdminScope = f
}
// UnMockApplicationGetApplicationUserAdminScope un-mock ApplicationGetApplicationUserAdminScope method
func (r *Mock) UnMockApplicationGetApplicationUserAdminScope() {
r.mockApplicationGetApplicationUserAdminScope = nil
}
// GetApplicationUserAdminScopeReq ...
type GetApplicationUserAdminScopeReq struct {
EmployeeID string `query:"employee_id" json:"-"` // 支持通过 open_id 或者 employee_id 查询, 不支持混合两种 ID 进行查询, 其中 employee_id 同通讯录 v3 版本中的 user_id
OpenID string `query:"open_id" json:"-"` // 支持通过 open_id 或者 employee_id 查询, 不支持混合两种 ID 进行查询, 其中 employee_id 同通讯录 v3 版本中的 user_id
}
// GetApplicationUserAdminScopeResp ...
type GetApplicationUserAdminScopeResp struct {
IsAll bool `json:"is_all,omitempty"` // 是否管理所有部门
DepartmentList []string `json:"department_list,omitempty"` // 管理的部门列表, 当 is_all 为 true 时, 不返回该字段
}
// getApplicationUserAdminScopeResp ...
type getApplicationUserAdminScopeResp struct {
Code int64 `json:"code,omitempty"` // 返回码, 非 0 表示失败
Msg string `json:"msg,omitempty"` // 返回码的描述
Data *GetApplicationUserAdminScopeResp `json:"data,omitempty"` // 返回业务数据
}