forked from zoom-lib-golang/zoom-lib-golang
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcloud_recording_list_all.go
65 lines (57 loc) · 2.49 KB
/
cloud_recording_list_all.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
package zoom
import "fmt"
const (
// ListAllRecordingsPath - v2 lists all recordings
ListAllRecordingsPath = "/users/%s/recordings"
// TrashTypeMeetingRecordings list all meeting recordings from the trash. Default.
TrashTypeMeetingRecordings TrashType = "meeting_recordings"
// TrashTypeRecordingFile list all individual recording files from the trash
TrashTypeRecordingFile TrashType = "recording_file"
)
type (
// TrashType is the type of Cloud recording that you would like to retrieve from the trash
TrashType string
// ListAllRecordingsOptions contains options for ListAllRecordings.
// NOTE: The query URL parser doesn't like non time.Time fields. It just
// ignores this field if it's a zoom.Date or a zoom.Time. Instead use a
// `string` for `From` and `To` - see below.
ListAllRecordingsOptions struct {
UserID string `url:"-"`
PageSize *int `url:"page_size,omitempty"`
NextPageToken string `url:"next_page_token,omitempty"`
Mc string `url:"mc,omitempty"`
Trash bool `url:"trash,omitempty"`
// From is a YYYY-MM-DD string representing a date
From string `url:"from"`
// To is a YYYY-MM-DD string representing a date
To string `url:"to"`
TrashType TrashType `url:"trash_type,omitempty"`
}
// ListAllRecordingsResponse contains the response from a call to ListAllRecordings
ListAllRecordingsResponse struct {
From *Date `json:"from"`
To *Date `json:"to"`
PageCount int `json:"page_count"`
PageSize int `json:"page_size"`
TotalRecords int `json:"total_records"`
NextPageToken string `json:"next_page_token"`
Meetings []CloudRecordingMeeting `json:"meetings"`
}
)
// ListAllRecordings calls /users/{user_id}/recordings endpoint
// and gets all cloud recordings for a user, using the default
// client.
func ListAllRecordings(opts ListAllRecordingsOptions) (ListAllRecordingsResponse, error) {
return defaultClient.ListAllRecordings(opts)
}
// ListAllRecordings calls /users/{user_id}/recordings endpoint
// and gets all cloud recordings for a user, using the c client
func (c *Client) ListAllRecordings(opts ListAllRecordingsOptions) (ListAllRecordingsResponse, error) {
var ret = ListAllRecordingsResponse{}
return ret, c.requestV2(requestV2Opts{
Method: Get,
Path: fmt.Sprintf(ListAllRecordingsPath, opts.UserID),
URLParameters: &opts,
Ret: &ret,
})
}