-
-
Notifications
You must be signed in to change notification settings - Fork 80
Expand file tree
/
Copy pathapi_apaas_application_object_record_batch_create.go
More file actions
92 lines (80 loc) · 4.71 KB
/
api_apaas_application_object_record_batch_create.go
File metadata and controls
92 lines (80 loc) · 4.71 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
// 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"
)
// BatchCreateAPaaSApplicationObjectRecord 一次新建多条对象中的记录
//
// doc: https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/apaas-v1/application-object-record/batch_create
// new doc: https://open.feishu.cn/document/apaas-v1/application-object-record/batch_create
func (r *APaaSService) BatchCreateAPaaSApplicationObjectRecord(ctx context.Context, request *BatchCreateAPaaSApplicationObjectRecordReq, options ...MethodOptionFunc) (*BatchCreateAPaaSApplicationObjectRecordResp, *Response, error) {
if r.cli.mock.mockAPaaSBatchCreateAPaaSApplicationObjectRecord != nil {
r.cli.Log(ctx, LogLevelDebug, "[lark] APaaS#BatchCreateAPaaSApplicationObjectRecord mock enable")
return r.cli.mock.mockAPaaSBatchCreateAPaaSApplicationObjectRecord(ctx, request, options...)
}
req := &RawRequestReq{
Scope: "APaaS",
API: "BatchCreateAPaaSApplicationObjectRecord",
Method: "POST",
URL: r.cli.openBaseURL + "/open-apis/apaas/v1/applications/:namespace/objects/:object_api_name/records/batch_create",
Body: request,
MethodOption: newMethodOption(options),
NeedTenantAccessToken: true,
}
resp := new(batchCreateAPaaSApplicationObjectRecordResp)
response, err := r.cli.RawRequest(ctx, req, resp)
return resp.Data, response, err
}
// MockAPaaSBatchCreateAPaaSApplicationObjectRecord mock APaaSBatchCreateAPaaSApplicationObjectRecord method
func (r *Mock) MockAPaaSBatchCreateAPaaSApplicationObjectRecord(f func(ctx context.Context, request *BatchCreateAPaaSApplicationObjectRecordReq, options ...MethodOptionFunc) (*BatchCreateAPaaSApplicationObjectRecordResp, *Response, error)) {
r.mockAPaaSBatchCreateAPaaSApplicationObjectRecord = f
}
// UnMockAPaaSBatchCreateAPaaSApplicationObjectRecord un-mock APaaSBatchCreateAPaaSApplicationObjectRecord method
func (r *Mock) UnMockAPaaSBatchCreateAPaaSApplicationObjectRecord() {
r.mockAPaaSBatchCreateAPaaSApplicationObjectRecord = nil
}
// BatchCreateAPaaSApplicationObjectRecordReq ...
type BatchCreateAPaaSApplicationObjectRecordReq struct {
Namespace string `path:"namespace" json:"-"` // 应用命名空间示例值: "package_test__c" 长度范围: `0` ~ `255` 字符
ObjectApiName string `path:"object_api_name" json:"-"` // 对象唯一标识示例值: "user" 长度范围: `0` ~ `256` 字符
Records []string `json:"records,omitempty"` // 记录详情列表, 格式为 List<Map<string, ANY>>, 操作记录数上限为 500 条示例值: "[{\"book_name\":\"name21\", \"book_count\":2}]"
}
// BatchCreateAPaaSApplicationObjectRecordResp ...
type BatchCreateAPaaSApplicationObjectRecordResp struct {
Items []*BatchCreateAPaaSApplicationObjectRecordRespItem `json:"items,omitempty"` // 处理结果
}
// BatchCreateAPaaSApplicationObjectRecordRespItem ...
type BatchCreateAPaaSApplicationObjectRecordRespItem struct {
Success bool `json:"success,omitempty"` // 是否成功
ID string `json:"id,omitempty"` // 记录 ID
Errors []*BatchCreateAPaaSApplicationObjectRecordRespItemError `json:"errors,omitempty"` // 权限错误时的细分 code
}
// BatchCreateAPaaSApplicationObjectRecordRespItemError ...
type BatchCreateAPaaSApplicationObjectRecordRespItemError struct {
Code string `json:"code,omitempty"` // 错误码
Message string `json:"message,omitempty"` // success
SubCode string `json:"sub_code,omitempty"` // 权限错误时的细分 code
Fields []string `json:"fields,omitempty"` // 权限错误时的涉及的字段 APIID 集合
}
// batchCreateAPaaSApplicationObjectRecordResp ...
type batchCreateAPaaSApplicationObjectRecordResp struct {
Code int64 `json:"code,omitempty"` // 错误码, 非 0 表示失败
Msg string `json:"msg,omitempty"` // 错误描述
Data *BatchCreateAPaaSApplicationObjectRecordResp `json:"data,omitempty"`
Error *ErrorDetail `json:"error,omitempty"`
}