diff --git a/api_lingo_repo_list.go b/api_lingo_repo_list.go new file mode 100644 index 00000000..96ca8f35 --- /dev/null +++ b/api_lingo_repo_list.go @@ -0,0 +1,81 @@ +// 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" +) + +// GetLingoRepoList 获取有权限访问的飞书词典词库列表。 +// +// 如以应用身份获取, 需要在“词库设置”页面添加应用;若以用户身份获取, 该用户需要拥有对应词库的可见权限。 +// +// doc: https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/lingo-v1/repo/list +func (r *LingoService) GetLingoRepoList(ctx context.Context, request *GetLingoRepoListReq, options ...MethodOptionFunc) (*GetLingoRepoListResp, *Response, error) { + if r.cli.mock.mockLingoGetLingoRepoList != nil { + r.cli.log(ctx, LogLevelDebug, "[lark] Lingo#GetLingoRepoList mock enable") + return r.cli.mock.mockLingoGetLingoRepoList(ctx, request, options...) + } + + req := &RawRequestReq{ + Scope: "Lingo", + API: "GetLingoRepoList", + Method: "GET", + URL: r.cli.openBaseURL + "/open-apis/lingo/v1/repos", + Body: request, + MethodOption: newMethodOption(options), + NeedTenantAccessToken: true, + NeedUserAccessToken: true, + } + resp := new(getLingoRepoListResp) + + response, err := r.cli.RawRequest(ctx, req, resp) + return resp.Data, response, err +} + +// MockLingoGetLingoRepoList mock LingoGetLingoRepoList method +func (r *Mock) MockLingoGetLingoRepoList(f func(ctx context.Context, request *GetLingoRepoListReq, options ...MethodOptionFunc) (*GetLingoRepoListResp, *Response, error)) { + r.mockLingoGetLingoRepoList = f +} + +// UnMockLingoGetLingoRepoList un-mock LingoGetLingoRepoList method +func (r *Mock) UnMockLingoGetLingoRepoList() { + r.mockLingoGetLingoRepoList = nil +} + +// GetLingoRepoListReq ... +type GetLingoRepoListReq struct { +} + +// GetLingoRepoListResp ... +type GetLingoRepoListResp struct { + Items []*GetLingoRepoListRespItem `json:"items,omitempty"` // 词库列表 +} + +// GetLingoRepoListRespItem ... +type GetLingoRepoListRespItem struct { + ID string `json:"id,omitempty"` // 词库 id + Name string `json:"name,omitempty"` // 词库名 +} + +// getLingoRepoListResp ... +type getLingoRepoListResp struct { + Code int64 `json:"code,omitempty"` // 错误码, 非 0 表示失败 + Msg string `json:"msg,omitempty"` // 错误描述 + Data *GetLingoRepoListResp `json:"data,omitempty"` +}