-
-
Notifications
You must be signed in to change notification settings - Fork 79
Expand file tree
/
Copy pathapi_apaas_application_audit_log_get.go
More file actions
143 lines (126 loc) · 7.94 KB
/
Copy pathapi_apaas_application_audit_log_get.go
File metadata and controls
143 lines (126 loc) · 7.94 KB
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
// 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"
)
// GetAPaaSApplicationAuditLog 根据日志 ID 查询审计日志详情
//
// doc: https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/apaas-v1/application-audit_log/get
// new doc: https://open.feishu.cn/document/apaas-v1/application-audit_log/get
func (r *APaaSService) GetAPaaSApplicationAuditLog(ctx context.Context, request *GetAPaaSApplicationAuditLogReq, options ...MethodOptionFunc) (*GetAPaaSApplicationAuditLogResp, *Response, error) {
if r.cli.mock.mockAPaaSGetAPaaSApplicationAuditLog != nil {
r.cli.Log(ctx, LogLevelDebug, "[lark] APaaS#GetAPaaSApplicationAuditLog mock enable")
return r.cli.mock.mockAPaaSGetAPaaSApplicationAuditLog(ctx, request, options...)
}
req := &RawRequestReq{
Scope: "APaaS",
API: "GetAPaaSApplicationAuditLog",
Method: "GET",
URL: r.cli.openBaseURL + "/open-apis/apaas/v1/applications/:namespace/audit_log",
Body: request,
MethodOption: newMethodOption(options),
NeedUserAccessToken: true,
}
resp := new(getAPaaSApplicationAuditLogResp)
response, err := r.cli.RawRequest(ctx, req, resp)
return resp.Data, response, err
}
// MockAPaaSGetAPaaSApplicationAuditLog mock APaaSGetAPaaSApplicationAuditLog method
func (r *Mock) MockAPaaSGetAPaaSApplicationAuditLog(f func(ctx context.Context, request *GetAPaaSApplicationAuditLogReq, options ...MethodOptionFunc) (*GetAPaaSApplicationAuditLogResp, *Response, error)) {
r.mockAPaaSGetAPaaSApplicationAuditLog = f
}
// UnMockAPaaSGetAPaaSApplicationAuditLog un-mock APaaSGetAPaaSApplicationAuditLog method
func (r *Mock) UnMockAPaaSGetAPaaSApplicationAuditLog() {
r.mockAPaaSGetAPaaSApplicationAuditLog = nil
}
// GetAPaaSApplicationAuditLogReq ...
type GetAPaaSApplicationAuditLogReq struct {
Namespace string `path:"namespace" json:"-"` // 应用命名空间示例值: "package_aaa" 长度范围: `0` ~ `1000` 字符
LogID string `query:"log_id" json:"-"` // 审计日志ID信息(通过[查询审计日志列表](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/apaas-v1/application-audit_log/audit_log_list)获取单条日志ID)示例值: 7405456257290600492 长度范围: `0` ~ `1000` 字符
}
// GetAPaaSApplicationAuditLogResp ...
type GetAPaaSApplicationAuditLogResp struct {
Data *GetAPaaSApplicationAuditLogRespData `json:"data,omitempty"` // 审计日志详情信息
}
// GetAPaaSApplicationAuditLogRespData ...
type GetAPaaSApplicationAuditLogRespData struct {
LogID string `json:"log_id,omitempty"` // 审计日志ID
BasicInfo *GetAPaaSApplicationAuditLogRespDataBasicInfo `json:"basic_info,omitempty"` // 日志基础信息
OpInfo *GetAPaaSApplicationAuditLogRespDataOpInfo `json:"op_info,omitempty"` // 审计日志操作信息
LoginInfo *GetAPaaSApplicationAuditLogRespDataLoginInfo `json:"login_info,omitempty"` // 登录类型信息
DeviceInfo *GetAPaaSApplicationAuditLogRespDataDeviceInfo `json:"device_info,omitempty"` // 设备信息
NetInfo *GetAPaaSApplicationAuditLogRespDataNetInfo `json:"net_info,omitempty"` // 网络信息
}
// GetAPaaSApplicationAuditLogRespDataBasicInfo ...
type GetAPaaSApplicationAuditLogRespDataBasicInfo struct {
LogType string `json:"log_type,omitempty"` // 日志类型: 10000: 全部日志- 10001: 企业管理日志- 10002: 登录日志- 10003: 应用管理日志
AuditScope string `json:"audit_scope,omitempty"` // 审计域: 15001: 企业管理后台- 15002: 应用管理后台- 15003: 应用开发平台
EnvType string `json:"env_type,omitempty"` // 环境类型: 16001: 沙箱环境- 16003: 线上环境
AppID string `json:"app_id,omitempty"` // 应用id
Module string `json:"module,omitempty"` // 审计日志功能模块
OpType string `json:"op_type,omitempty"` // 事件类型
AppName interface{} `json:"app_name,omitempty"` // 应用名称
}
// GetAPaaSApplicationAuditLogRespDataDeviceInfo ...
type GetAPaaSApplicationAuditLogRespDataDeviceInfo struct {
DeviceID string `json:"device_id,omitempty"` // 设备ID
WebDeviceID string `json:"web_device_id,omitempty"` // web端设备ID
TerminalType string `json:"terminal_type,omitempty"` // 终端类型: 13002: PC类型- 13003: Web类型
OsType string `json:"os_type,omitempty"` // 系统类型: 14002: window- 14001: 未知
OsVersion string `json:"os_version,omitempty"` // 系统版本
}
// GetAPaaSApplicationAuditLogRespDataLoginInfo ...
type GetAPaaSApplicationAuditLogRespDataLoginInfo struct {
LoginType string `json:"login_type,omitempty"` // 登录类型: 11001: 飞书登录- 11003: 账号密码登录
}
// GetAPaaSApplicationAuditLogRespDataNetInfo ...
type GetAPaaSApplicationAuditLogRespDataNetInfo struct {
ClientIp string `json:"client_ip,omitempty"` // 客户端IP
IpLoc string `json:"ip_loc,omitempty"` // IP位置
IpProvider string `json:"ip_provider,omitempty"` // IP提供商
Referer string `json:"referer,omitempty"` // 引用页面
Origin string `json:"origin,omitempty"` // 源页面
UserAgent string `json:"user_agent,omitempty"` // 用户代理
}
// GetAPaaSApplicationAuditLogRespDataOpInfo ...
type GetAPaaSApplicationAuditLogRespDataOpInfo struct {
Operator *GetAPaaSApplicationAuditLogRespDataOpInfoOperator `json:"operator,omitempty"` // 操作人
Outsider bool `json:"outsider,omitempty"` // 是否为外部用户, true代表是外部用户
OpDetail interface{} `json:"op_detail,omitempty"` // 操作详情内容
Status string `json:"status,omitempty"` // 操作状态: 18001-成功;18002-失败
FailedReason string `json:"failed_reason,omitempty"` // 失败原因
FailedReasonI18n interface{} `json:"failed_reason_i18n,omitempty"` // 多语类型失败原因
OpTime string `json:"op_time,omitempty"` // 操作时间
DataObject string `json:"data_object,omitempty"` // 数据对象
OpSource string `json:"op_source,omitempty"` // 操作源: 20001-前端;20004-openapi
DataChanges []string `json:"data_changes,omitempty"` // 数据变化(旧值和新值)
}
// GetAPaaSApplicationAuditLogRespDataOpInfoOperator ...
type GetAPaaSApplicationAuditLogRespDataOpInfoOperator struct {
ID string `json:"id,omitempty"` // 用户ID
Name string `json:"name,omitempty"` // 用户名称
TenantID string `json:"tenant_id,omitempty"` // 租户ID
Email string `json:"email,omitempty"` // 用户邮箱
}
// getAPaaSApplicationAuditLogResp ...
type getAPaaSApplicationAuditLogResp struct {
Code int64 `json:"code,omitempty"` // 错误码, 非 0 表示失败
Msg string `json:"msg,omitempty"` // 错误描述
Data *GetAPaaSApplicationAuditLogResp `json:"data,omitempty"`
Error *ErrorDetail `json:"error,omitempty"`
}