Skip to main content

zoom_cli/commands/
mod.rs

1pub mod config;
2pub mod init;
3pub mod meetings;
4pub mod recordings;
5pub mod reports;
6pub mod users;
7pub mod webinars;
8
9use crate::output::OutputConfig;
10
11pub fn schema(resource: &str, out: &OutputConfig) {
12    let content = match resource {
13        "meetings" => serde_json::json!({
14            "resource": "meetings",
15            "commands": {
16                "list": {
17                    "description": "List meetings for a user",
18                    "flags": {
19                        "--user": "User ID or 'me' (default: me)",
20                        "--type": "Filter: scheduled|live|upcoming"
21                    }
22                },
23                "get": {
24                    "description": "Get a meeting by numeric ID",
25                    "args": { "id": "Meeting ID (u64)" }
26                },
27                "create": {
28                    "description": "Create a meeting",
29                    "flags": {
30                        "--topic": "(required) Meeting topic",
31                        "--duration": "Duration in minutes",
32                        "--start": "Start time (ISO 8601, e.g. 2026-04-03T09:00:00Z)",
33                        "--password": "Meeting password"
34                    }
35                },
36                "update": {
37                    "description": "Update a meeting",
38                    "args": { "id": "Meeting ID" },
39                    "flags": {
40                        "--topic": "New topic",
41                        "--duration": "New duration in minutes",
42                        "--start": "New start time (ISO 8601)"
43                    }
44                },
45                "delete": {
46                    "description": "Delete a meeting",
47                    "args": { "id": "Meeting ID" }
48                },
49                "end": {
50                    "description": "End a live meeting",
51                    "args": { "id": "Meeting ID" }
52                },
53                "participants": {
54                    "description": "List participants from a past meeting",
55                    "args": { "meeting_id": "Meeting ID or UUID" }
56                }
57            },
58            "fields": {
59                "id": "u64 — meeting ID",
60                "topic": "string",
61                "start_time": "string — ISO 8601",
62                "duration": "u32 — minutes",
63                "join_url": "string",
64                "start_url": "string",
65                "status": "string — waiting|started|finished",
66                "password": "string",
67                "meeting_type": "u8 — 1=instant 2=scheduled"
68            }
69        }),
70        "recordings" => serde_json::json!({
71            "resource": "recordings",
72            "commands": {
73                "list": {
74                    "description": "List cloud recordings for a user",
75                    "flags": {
76                        "--user": "User ID or 'me' (default: me)",
77                        "--from": "Start date (YYYY-MM-DD)",
78                        "--to": "End date (YYYY-MM-DD)"
79                    }
80                },
81                "get": {
82                    "description": "Get recording details for a meeting",
83                    "args": { "meeting_id": "Meeting ID or UUID" }
84                },
85                "download": {
86                    "description": "Download recording files to disk",
87                    "args": { "meeting_id": "Meeting ID or UUID" },
88                    "flags": { "--out": "Output directory (default: .)" }
89                },
90                "delete": {
91                    "description": "Delete all cloud recordings for a meeting (default: moves to trash)",
92                    "args": { "meeting_id": "Meeting ID or UUID" },
93                    "flags": {
94                        "--permanent": "Permanently delete immediately instead of moving to trash (irreversible)"
95                    }
96                }
97            },
98            "fields": {
99                "id": "string — meeting UUID",
100                "topic": "string",
101                "start_time": "string — ISO 8601",
102                "duration": "u32 — minutes",
103                "total_size": "u64 — bytes",
104                "recording_files": "array of RecordingFile",
105                "recording_file.file_type": "string — MP4|M4A|CHAT|TRANSCRIPT|TIMELINE",
106                "recording_file.file_size": "u64 — bytes",
107                "recording_file.download_url": "string",
108                "recording_file.status": "string — completed|processing"
109            }
110        }),
111        "users" => serde_json::json!({
112            "resource": "users",
113            "commands": {
114                "list": {
115                    "description": "List users in the account",
116                    "flags": {
117                        "--status": "Filter: active|inactive|pending"
118                    }
119                },
120                "get": {
121                    "description": "Get a user by ID or email address",
122                    "args": { "id_or_email": "User ID or email" }
123                },
124                "me": {
125                    "description": "Get the current authenticated user"
126                }
127            },
128            "fields": {
129                "id": "string — user ID",
130                "email": "string",
131                "display_name": "string",
132                "first_name": "string",
133                "last_name": "string",
134                "status": "string — active|inactive|pending",
135                "user_type": "u8 — 1=Basic 2=Licensed 3=On-Prem"
136            }
137        }),
138        "reports" => serde_json::json!({
139            "resource": "reports",
140            "commands": {
141                "meetings": {
142                    "description": "Meeting summary report for a user",
143                    "flags": {
144                        "--from": "(required) Start date (YYYY-MM-DD)",
145                        "--to": "End date (YYYY-MM-DD, default: today)",
146                        "--user": "User ID or 'me' (default: me)"
147                    }
148                }
149            },
150            "fields": {
151                "id": "u64 — meeting ID",
152                "uuid": "string — meeting UUID",
153                "topic": "string",
154                "start_time": "string — ISO 8601",
155                "duration": "u32 — minutes",
156                "participants_count": "u32",
157                "total_minutes": "u32 — total participant-minutes"
158            }
159        }),
160        "webinars" => serde_json::json!({
161            "resource": "webinars",
162            "commands": {
163                "list": {
164                    "description": "List webinars for a user",
165                    "flags": { "--user": "User ID or 'me' (default: me)" }
166                },
167                "get": {
168                    "description": "Get a webinar by ID",
169                    "args": { "id": "Webinar ID (u64)" }
170                }
171            },
172            "fields": {
173                "id": "u64 — webinar ID",
174                "topic": "string",
175                "start_time": "string — ISO 8601",
176                "duration": "u32 — minutes",
177                "join_url": "string",
178                "status": "string — waiting|started|finished",
179                "agenda": "string",
180                "webinar_type": "u8 — 5=webinar 6=recurring no fixed time 9=recurring fixed time"
181            }
182        }),
183        _ => {
184            eprintln!(
185                "Unknown resource '{resource}'. Available: meetings, recordings, reports, users, webinars"
186            );
187            std::process::exit(1);
188        }
189    };
190
191    out.print_data(&serde_json::to_string_pretty(&content).expect("serialize"));
192}