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