-
-
Notifications
You must be signed in to change notification settings - Fork 71
/
Copy pathapi_bitable_view_get.go
114 lines (99 loc) · 5.56 KB
/
api_bitable_view_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
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
// 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"
)
// GetBitableView 该接口根据 view_id 检索现有视图
//
// doc: https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-view/get
// new doc: https://open.feishu.cn/document/server-docs/docs/bitable-v1/app-table-view/get
func (r *BitableService) GetBitableView(ctx context.Context, request *GetBitableViewReq, options ...MethodOptionFunc) (*GetBitableViewResp, *Response, error) {
if r.cli.mock.mockBitableGetBitableView != nil {
r.cli.Log(ctx, LogLevelDebug, "[lark] Bitable#GetBitableView mock enable")
return r.cli.mock.mockBitableGetBitableView(ctx, request, options...)
}
req := &RawRequestReq{
Scope: "Bitable",
API: "GetBitableView",
Method: "GET",
URL: r.cli.openBaseURL + "/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views/:view_id",
Body: request,
MethodOption: newMethodOption(options),
NeedTenantAccessToken: true,
NeedUserAccessToken: true,
}
resp := new(getBitableViewResp)
response, err := r.cli.RawRequest(ctx, req, resp)
return resp.Data, response, err
}
// MockBitableGetBitableView mock BitableGetBitableView method
func (r *Mock) MockBitableGetBitableView(f func(ctx context.Context, request *GetBitableViewReq, options ...MethodOptionFunc) (*GetBitableViewResp, *Response, error)) {
r.mockBitableGetBitableView = f
}
// UnMockBitableGetBitableView un-mock BitableGetBitableView method
func (r *Mock) UnMockBitableGetBitableView() {
r.mockBitableGetBitableView = nil
}
// GetBitableViewReq ...
type GetBitableViewReq struct {
AppToken string `path:"app_token" json:"-"` // base app token, 示例值: "bascnCMII2ORej2RItqpZZUNMIe", 最小长度: `1` 字符
TableID string `path:"table_id" json:"-"` // table id, 示例值: "tblsRc9GRRXKqhvW"
ViewID string `path:"view_id" json:"-"` // 视图 ID, 示例值: "vewTpR1urY"
}
// GetBitableViewResp ...
type GetBitableViewResp struct {
View *GetBitableViewRespView `json:"view,omitempty"` // 视图信息
}
// GetBitableViewRespView ...
type GetBitableViewRespView struct {
ViewID string `json:"view_id,omitempty"` // 视图Id
ViewName string `json:"view_name,omitempty"` // 视图名字
ViewType string `json:"view_type,omitempty"` // 视图类型
Property *GetBitableViewRespViewProperty `json:"property,omitempty"` // 视图属性
}
// GetBitableViewRespViewProperty ...
type GetBitableViewRespViewProperty struct {
FilterInfo *GetBitableViewRespViewPropertyFilterInfo `json:"filter_info,omitempty"` // 过滤条件
HiddenFields []string `json:"hidden_fields,omitempty"` // 隐藏字段ID列表
HierarchyConfig *GetBitableViewRespViewPropertyHierarchyConfig `json:"hierarchy_config,omitempty"` // 表格视图层级结构设置
}
// GetBitableViewRespViewPropertyFilterInfo ...
type GetBitableViewRespViewPropertyFilterInfo struct {
Conjunction string `json:"conjunction,omitempty"` // 多个筛选条件的关系, 可选值有: and: 与, or: 或
Conditions []*GetBitableViewRespViewPropertyFilterInfoCondition `json:"conditions,omitempty"` // 筛选条件
ConditionOmitted bool `json:"condition_omitted,omitempty"` // 筛选条件是否缺省
}
// GetBitableViewRespViewPropertyFilterInfoCondition ...
type GetBitableViewRespViewPropertyFilterInfoCondition struct {
FieldID string `json:"field_id,omitempty"` // 用于过滤的字段唯一ID
Operator string `json:"operator,omitempty"` // 过滤操作的类型, 可选值有: is: 等于, isNot: 不等于, contains: 包含, doesNotContain: 不包含, isEmpty: 为空, isNotEmpty: 不为空, isGreater: 大于, isGreaterEqual: 大于等于, isLess: 小于, isLessEqual: 小于等于
Value string `json:"value,omitempty"` // 筛选值
ConditionID string `json:"condition_id,omitempty"` // 过滤条件的唯一ID
FieldType int64 `json:"field_type,omitempty"` // 用于过滤的字段类型 1: 多行文本 2: 数字 3: 单选 4: 多选 5: 日期 7: 复选框 11: 人员 13: 电话号码 15: 超链接 17: 附件 18: 单向关联 19: 查找引用 20: 公式 21: 双向关联 22: 地理位置 23: 群组 1001: 创建时间 1002: 最后更新时间 1003: 创建人 1004: 修改人 1005: 自动编号
}
// GetBitableViewRespViewPropertyHierarchyConfig ...
type GetBitableViewRespViewPropertyHierarchyConfig struct {
FieldID string `json:"field_id,omitempty"` // 层级结构的关联列id
}
// getBitableViewResp ...
type getBitableViewResp struct {
Code int64 `json:"code,omitempty"` // 错误码, 非 0 表示失败
Msg string `json:"msg,omitempty"` // 错误描述
Data *GetBitableViewResp `json:"data,omitempty"`
Error *ErrorDetail `json:"error,omitempty"`
}