/
meeting_list.go
69 lines (60 loc) · 2.34 KB
/
meeting_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
package zoom
import "fmt"
type (
// ListMeetingType are the allowed meeting types
ListMeetingType string
// ListMeetingsOptions contains options for ListMeetings
ListMeetingsOptions struct {
HostID string `url:"-"`
Type ListMeetingType `url:"type,omitempty"`
PageSize *int `url:"page_size,omitempty"` // Default: 30, Maximum: 300
PageNumber *int `url:"page_number,omitempty"` // Default: 1
}
// ListMeetingsResponse container the response from a call to ListMeetings
ListMeetingsResponse struct {
PageCount int `json:"page_count"`
TotalRecords int `json:"total_records"`
PageNumber int `json:"page_number"`
PageSize int `json:"page_size"`
Meetings []ListMeeting `json:"meetings"`
}
// ListMeeting represents a meeting object returned by ListMeetings endpoint
ListMeeting struct {
UUID string `json:"uuid"`
ID int `json:"id"`
HostID string `json:"host_id"`
Topic string `json:"topic"`
Type MeetingType `json:"type"`
StartTime *Time `json:"start_time"`
Duration int `json:"duration"`
Timezone string `json:"timezone"`
CreatedAt *Time `json:"created_at"`
JoinURL string `json:"join_url"`
Agenda string `json:"agenda"`
}
)
const (
// ListMeetingsPath - v2 lists all the meetings that were scheduled for a user
ListMeetingsPath = "/users/%s/meetings"
// ListMeetingTypeScheduled is a meeting that is scheduled
ListMeetingTypeScheduled ListMeetingType = "scheduled"
// ListMeetingTypeLive is a live meeting
ListMeetingTypeLive ListMeetingType = "live" // DEFAULT
// ListMeetingTypeUpcoming is an upcoming meeting
ListMeetingTypeUpcoming ListMeetingType = "upcoming"
)
// ListMeetings calls /users/ID/meetings
func ListMeetings(opts ListMeetingsOptions) (ListMeetingsResponse, error) {
return defaultClient.ListMeetings(opts)
}
// ListMeetings calls /users/ID/meetings
// https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetings
func (c *Client) ListMeetings(opts ListMeetingsOptions) (ListMeetingsResponse, error) {
var ret = ListMeetingsResponse{}
return ret, c.requestV2(requestV2Opts{
Method: Get,
Path: fmt.Sprintf(ListMeetingsPath, opts.HostID),
URLParameters: &opts,
Ret: &ret,
})
}