-
-
Notifications
You must be signed in to change notification settings - Fork 71
/
Copy pathapi_calendar_calendar_event_attendee_chat_member_list.go
98 lines (87 loc) · 8.49 KB
/
api_calendar_calendar_event_attendee_chat_member_list.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
// 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"
)
// GetCalendarEventAttendeeChatMemberList 调用该接口以当前身份(应用或用户)获取日程的群组类型参与人的群成员列表。
//
// - 当前身份由 Header Authorization 的 Token 类型决定。tenant_access_token 指应用身份, user_access_token 指用户身份。
// - 如果使用应用身份调用该接口, 则需要确保应用开启了[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)。
// - 当前身份必须有权限查看日程的参与人列表, 即当前身份需要是日程的组织者, 或者是日程参与人且日程设置了参与人可查看参与人列表权限。你可以调用[获取日程](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event/get)接口, 获取日程的参与人权限(attendee_ability)。
// - 当前身份必须在群成员列表中。如果不在群成员列表中, 会调用失败并返回错误信息。
//
// doc: https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event-attendee-chat_member/list
// new doc: https://open.feishu.cn/document/server-docs/calendar-v4/calendar-event-attendee/list
func (r *CalendarService) GetCalendarEventAttendeeChatMemberList(ctx context.Context, request *GetCalendarEventAttendeeChatMemberListReq, options ...MethodOptionFunc) (*GetCalendarEventAttendeeChatMemberListResp, *Response, error) {
if r.cli.mock.mockCalendarGetCalendarEventAttendeeChatMemberList != nil {
r.cli.Log(ctx, LogLevelDebug, "[lark] Calendar#GetCalendarEventAttendeeChatMemberList mock enable")
return r.cli.mock.mockCalendarGetCalendarEventAttendeeChatMemberList(ctx, request, options...)
}
req := &RawRequestReq{
Scope: "Calendar",
API: "GetCalendarEventAttendeeChatMemberList",
Method: "GET",
URL: r.cli.openBaseURL + "/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees/:attendee_id/chat_members",
Body: request,
MethodOption: newMethodOption(options),
NeedTenantAccessToken: true,
NeedUserAccessToken: true,
}
resp := new(getCalendarEventAttendeeChatMemberListResp)
response, err := r.cli.RawRequest(ctx, req, resp)
return resp.Data, response, err
}
// MockCalendarGetCalendarEventAttendeeChatMemberList mock CalendarGetCalendarEventAttendeeChatMemberList method
func (r *Mock) MockCalendarGetCalendarEventAttendeeChatMemberList(f func(ctx context.Context, request *GetCalendarEventAttendeeChatMemberListReq, options ...MethodOptionFunc) (*GetCalendarEventAttendeeChatMemberListResp, *Response, error)) {
r.mockCalendarGetCalendarEventAttendeeChatMemberList = f
}
// UnMockCalendarGetCalendarEventAttendeeChatMemberList un-mock CalendarGetCalendarEventAttendeeChatMemberList method
func (r *Mock) UnMockCalendarGetCalendarEventAttendeeChatMemberList() {
r.mockCalendarGetCalendarEventAttendeeChatMemberList = nil
}
// GetCalendarEventAttendeeChatMemberListReq ...
type GetCalendarEventAttendeeChatMemberListReq struct {
CalendarID string `path:"calendar_id" json:"-"` // 日程所在的日历 ID。关于日历 ID 可参见[日历 ID 说明](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/introduction), 示例值: "[email protected]"
EventID string `path:"event_id" json:"-"` // 日程 ID, 创建日程时会返回日程 ID。你也可以调用以下接口获取某一日历的 ID, [获取日程列表](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event/list), [搜索日程](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event/search), 示例值: "xxxxxxxxx_0"
AttendeeID string `path:"attendee_id" json:"-"` // 群组类型参与人 ID, 添加日程参与人时, 会返回参与人 ID(attendee_id), 你也可以调用[获取日程参与人列表](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event-attendee/list)接口, 查询指定日程的参与人 ID, 示例值: "chat_xxxxxx"
PageToken *string `query:"page_token" json:"-"` // 分页标记, 第一次请求不填, 表示从头开始遍历;分页查询结果还有更多项时会同时返回新的 page_token, 下次遍历可采用该 page_token 获取查询结果, 示例值: 23jhysaxxxxsysy
PageSize *int64 `query:"page_size" json:"-"` // 一次请求返回的最大群成员数量, 示例值: 10, 默认值: `20`, 最大值: `100`
UserIDType *IDType `query:"user_id_type" json:"-"` // 用户 ID 类型, 示例值: open_id, 可选值有: open_id: 标识一个用户在某个应用中的身份。同一个用户在不同应用中的 Open ID 不同。[了解更多: 如何获取 Open ID](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-obtain-openid), union_id: 标识一个用户在某个应用开发商下的身份。同一用户在同一开发商下的应用中的 Union ID 是相同的, 在不同开发商下的应用中的 Union ID 是不同的。通过 Union ID, 应用开发商可以把同个用户在多个应用中的身份关联起来。[了解更多: 如何获取 Union ID?](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-obtain-union-id), user_id: 标识一个用户在某个租户内的身份。同一个用户在租户 A 和租户 B 内的 User ID 是不同的。在同一个租户内, 一个用户的 User ID 在所有应用(包括商店应用)中都保持一致。User ID 主要用于在不同的应用间打通用户数据。[了解更多: 如何获取 User ID?](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-obtain-user-id), 默认值: `open_id`, 当值为 `user_id`, 字段权限要求: 获取用户 user ID
}
// GetCalendarEventAttendeeChatMemberListResp ...
type GetCalendarEventAttendeeChatMemberListResp struct {
Items []*GetCalendarEventAttendeeChatMemberListRespItem `json:"items,omitempty"` // 群组类型参与人的群成员列表。
HasMore bool `json:"has_more,omitempty"` // 是否还有更多项
PageToken string `json:"page_token,omitempty"` // 分页标记, 当 has_more 为 true 时, 会同时返回新的 page_token, 否则不返回 page_token
}
// GetCalendarEventAttendeeChatMemberListRespItem ...
type GetCalendarEventAttendeeChatMemberListRespItem struct {
RsvpStatus string `json:"rsvp_status,omitempty"` // 参与人 RSVP 状态, 即日程回复状态, 可选值有: needs_action: 参与人尚未回复状态, 或表示会议室预约中, accept: 参与人回复接受, 或表示会议室预约成功, tentative: 参与人回复待定, decline: 参与人回复拒绝, 或表示会议室预约失败, removed: 参与人或会议室已经从日程中被移除
IsOptional bool `json:"is_optional,omitempty"` // 参与人是否为可选参加。
DisplayName string `json:"display_name,omitempty"` // 参与人名称。
OpenID string `json:"open_id,omitempty"` // 参与人的 open_id。关于用户 ID 可参见[用户相关的 ID 概念](https://open.feishu.cn/document/home/user-identity-introduction/introduction)。
IsOrganizer bool `json:"is_organizer,omitempty"` // 参与人是否为日程组织者。
IsExternal bool `json:"is_external,omitempty"` // 参与人是否为外部参与人。
}
// getCalendarEventAttendeeChatMemberListResp ...
type getCalendarEventAttendeeChatMemberListResp struct {
Code int64 `json:"code,omitempty"` // 错误码, 非 0 表示失败
Msg string `json:"msg,omitempty"` // 错误描述
Data *GetCalendarEventAttendeeChatMemberListResp `json:"data,omitempty"`
Error *ErrorDetail `json:"error,omitempty"`
}