-
-
Notifications
You must be signed in to change notification settings - Fork 70
/
api_application_is_user_admin.go
78 lines (68 loc) · 3.44 KB
/
api_application_is_user_admin.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
// 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"
)
// IsApplicationUserAdmin 该接口用于查询用户是否为应用管理员。
//
// > 此处应用管理员是指可以进入企业管理后台对应用进行审核和管理的企业管理员, 并不是应用的开发者。
//
// doc: https://open.feishu.cn/document/ukTMukTMukTM/uITN1EjLyUTNx4iM1UTM
// new doc: https://open.feishu.cn/document/server-docs/application-v6/admin/verify-app-admin
func (r *ApplicationService) IsApplicationUserAdmin(ctx context.Context, request *IsApplicationUserAdminReq, options ...MethodOptionFunc) (*IsApplicationUserAdminResp, *Response, error) {
if r.cli.mock.mockApplicationIsApplicationUserAdmin != nil {
r.cli.Log(ctx, LogLevelDebug, "[lark] Application#IsApplicationUserAdmin mock enable")
return r.cli.mock.mockApplicationIsApplicationUserAdmin(ctx, request, options...)
}
req := &RawRequestReq{
Scope: "Application",
API: "IsApplicationUserAdmin",
Method: "GET",
URL: r.cli.openBaseURL + "/open-apis/application/v3/is_user_admin",
Body: request,
MethodOption: newMethodOption(options),
NeedTenantAccessToken: true,
}
resp := new(isApplicationUserAdminResp)
response, err := r.cli.RawRequest(ctx, req, resp)
return resp.Data, response, err
}
// MockApplicationIsApplicationUserAdmin mock ApplicationIsApplicationUserAdmin method
func (r *Mock) MockApplicationIsApplicationUserAdmin(f func(ctx context.Context, request *IsApplicationUserAdminReq, options ...MethodOptionFunc) (*IsApplicationUserAdminResp, *Response, error)) {
r.mockApplicationIsApplicationUserAdmin = f
}
// UnMockApplicationIsApplicationUserAdmin un-mock ApplicationIsApplicationUserAdmin method
func (r *Mock) UnMockApplicationIsApplicationUserAdmin() {
r.mockApplicationIsApplicationUserAdmin = nil
}
// IsApplicationUserAdminReq ...
type IsApplicationUserAdminReq struct {
OpenID *string `query:"open_id" json:"-"` // 用户 open_id, open_id 和 employee_id 两个参数必须包含其一, 若同时传入取 open_id
EmployeeID *string `query:"employee_id" json:"-"` // 用户 employee_id(同通讯录 v3 版本中的 user_id), open_id 和 employee_id 两个参数必须包含其一, 若同时传入取 open_id
}
// IsApplicationUserAdminResp ...
type IsApplicationUserAdminResp struct {
IsAppAdmin bool `json:"is_app_admin,omitempty"` // 用户是否为管理员, true 为是, false 为否
}
// isApplicationUserAdminResp ...
type isApplicationUserAdminResp struct {
Code int64 `json:"code,omitempty"` // 返回码, 非 0 表示失败
Msg string `json:"msg,omitempty"` // 返回码的描述
Data *IsApplicationUserAdminResp `json:"data,omitempty"` // 返回的业务信息
Error *ErrorDetail `json:"error,omitempty"`
}