zoom_api/reports.rs
1use crate::Client;
2use crate::ClientResult;
3
4pub struct Reports {
5 pub client: Client,
6}
7
8impl Reports {
9 #[doc(hidden)]
10 pub fn new(client: Client) -> Self {
11 Reports { client }
12 }
13
14 /**
15 * Get daily usage report.
16 *
17 * This function performs a `GET` to the `/report/daily` endpoint.
18 *
19 * Retrieve daily report to access the account-wide usage of Zoom services for each day in a given month. It lists the number of new users, meetings, participants, and meeting minutes.<br>
20 * **Prerequisites**<br>
21 * * Pro or higher plan.<br>
22 * **Scopes:** `report:read:admin`<br>
23 *
24 * **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Heavy`
25 *
26 * **Parameters:**
27 *
28 * * `year: i64` -- Year for this report.
29 * * `month: i64` -- Month for this report.
30 */
31 pub async fn daily(
32 &self,
33 year: i64,
34 month: i64,
35 ) -> ClientResult<crate::Response<crate::types::ReportDailyResponse>> {
36 let mut query_args: Vec<(String, String)> = Default::default();
37 if month > 0 {
38 query_args.push(("month".to_string(), month.to_string()));
39 }
40 if year > 0 {
41 query_args.push(("year".to_string(), year.to_string()));
42 }
43 let query_ = serde_urlencoded::to_string(&query_args).unwrap();
44 let url = self.client.url(&format!("/report/daily?{}", query_), None);
45 self.client
46 .get(
47 &url,
48 crate::Message {
49 body: None,
50 content_type: None,
51 },
52 )
53 .await
54 }
55 /**
56 * Get active/inactive host reports.
57 *
58 * This function performs a `GET` to the `/report/users` endpoint.
59 *
60 * A user is considered to be an active host during the month specified in the "from" and "to" range, if the user has hosted at least one meeting during this period. If the user didn't host any meetings during this period, the user is considered to be inactive.<br>The Active Hosts report displays a list of meetings, participants, and meeting minutes for a specific time range, up to one month. The month should fall within the last six months.<br>The Inactive Hosts report pulls a list of users who were not active during a specific period of time.
61 * Use this API to retrieve an active or inactive host report for a specified period of time. The time range for the report is limited to a month and the month should fall under the past six months. <br>You can specify the type of report and date range using the query parameters.<br>
62 * **Scopes:** `report:read:admin`<br>
63 *
64 * **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Heavy`<br>
65 * **Prerequisites:**<br>
66 * * Pro or higher plan.
67 *
68 * **Parameters:**
69 *
70 * * `type_: crate::types::ReportUsersType` -- Active or inactive hosts.<br>`active` - Active hosts. <br>`inactive` - Inactive hosts.
71 * * `from: chrono::NaiveDate` -- Start date in 'yyyy-mm-dd' format. The date range defined by the "from" and "to" parameters should only be one month as the report includes only one month worth of data at once.
72 * * `to: chrono::NaiveDate` -- Start Date.
73 * * `page_size: i64` -- The number of records returned within a single API call.
74 * * `page_number: i64` -- The page number of the current page in the returned records.
75 * * `next_page_token: &str` -- The next page token is used to paginate through large result sets. A next page token will be returned whenever the set of available results exceeds the current page size. The expiration period for this token is 15 minutes.
76 */
77 pub async fn user(
78 &self,
79 type_: crate::types::ReportUsersType,
80 from: chrono::NaiveDate,
81 to: chrono::NaiveDate,
82 page_size: i64,
83 page_number: i64,
84 next_page_token: &str,
85 ) -> ClientResult<crate::Response<crate::types::Domains>> {
86 let mut query_args: Vec<(String, String)> = Default::default();
87 if !from.to_string().is_empty() {
88 query_args.push(("from".to_string(), from.to_string()));
89 }
90 if !next_page_token.is_empty() {
91 query_args.push(("next_page_token".to_string(), next_page_token.to_string()));
92 }
93 if page_number > 0 {
94 query_args.push(("page_number".to_string(), page_number.to_string()));
95 }
96 if page_size > 0 {
97 query_args.push(("page_size".to_string(), page_size.to_string()));
98 }
99 if !to.to_string().is_empty() {
100 query_args.push(("to".to_string(), to.to_string()));
101 }
102 if !type_.to_string().is_empty() {
103 query_args.push(("type".to_string(), type_.to_string()));
104 }
105 let query_ = serde_urlencoded::to_string(&query_args).unwrap();
106 let url = self.client.url(&format!("/report/users?{}", query_), None);
107 self.client
108 .get(
109 &url,
110 crate::Message {
111 body: None,
112 content_type: None,
113 },
114 )
115 .await
116 }
117 /**
118 * Get meeting reports.
119 *
120 * This function performs a `GET` to the `/report/users/{userId}/meetings` endpoint.
121 *
122 * Retrieve [report](https://support.zoom.us/hc/en-us/articles/216378603-Meeting-Reporting) on past meetings and webinars for a specified time period. The time range for the report is limited to a month and the month must fall within the past six months.
123 *
124 * Meetings and webinars are returned only if they have two or more unique participants. <br><br>
125 * **Scopes:** `report:read:admin`<br>
126 *
127 * **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Heavy`<br>
128 * **Prerequisites:**<br>
129 * * Pro or higher plan.
130 *
131 * **Parameters:**
132 *
133 * * `user_id: &str` -- The user ID or email address of the user. For user-level apps, pass `me` as the value for userId.
134 * * `from: chrono::NaiveDate` -- Start date in 'yyyy-mm-dd' format. The date range defined by the "from" and "to" parameters should only be one month as the report includes only one month worth of data at once.
135 * * `to: chrono::NaiveDate` -- Start Date.
136 * * `page_size: i64` -- The number of records returned within a single API call.
137 * * `next_page_token: &str` -- The next page token is used to paginate through large result sets. A next page token will be returned whenever the set of available results exceeds the current page size. The expiration period for this token is 15 minutes.
138 * * `type_: crate::types::ReportMeetingsType` -- The meeting types: <br>`past` - Past meetings.<br>`pastOne` - Past one user meetings.
139 */
140 pub async fn meeting(
141 &self,
142 user_id: &str,
143 from: chrono::NaiveDate,
144 to: chrono::NaiveDate,
145 page_size: i64,
146 next_page_token: &str,
147 type_: crate::types::ReportMeetingsType,
148 ) -> ClientResult<crate::Response<crate::types::ReportMeetingsResponseAllOf>> {
149 let mut query_args: Vec<(String, String)> = Default::default();
150 if !from.to_string().is_empty() {
151 query_args.push(("from".to_string(), from.to_string()));
152 }
153 if !next_page_token.is_empty() {
154 query_args.push(("next_page_token".to_string(), next_page_token.to_string()));
155 }
156 if page_size > 0 {
157 query_args.push(("page_size".to_string(), page_size.to_string()));
158 }
159 if !to.to_string().is_empty() {
160 query_args.push(("to".to_string(), to.to_string()));
161 }
162 if !type_.to_string().is_empty() {
163 query_args.push(("type".to_string(), type_.to_string()));
164 }
165 let query_ = serde_urlencoded::to_string(&query_args).unwrap();
166 let url = self.client.url(
167 &format!(
168 "/report/users/{}/meetings?{}",
169 crate::progenitor_support::encode_path(user_id),
170 query_
171 ),
172 None,
173 );
174 self.client
175 .get(
176 &url,
177 crate::Message {
178 body: None,
179 content_type: None,
180 },
181 )
182 .await
183 }
184 /**
185 * Get meeting detail reports.
186 *
187 * This function performs a `GET` to the `/report/meetings/{meetingId}` endpoint.
188 *
189 * Get a detailed report for a past meeting. <br>
190 * **Scopes:** `report:read:admin`<br>
191 *
192 * **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Heavy`<br>
193 * **Prerequisites:**<br>
194 * * Pro or a higher plan.<br>
195 *
196 *
197 * **Parameters:**
198 *
199 * * `meeting_id: &str` -- The meeting ID or the meeting UUID. If a meeting ID is provided in the request instead of a UUID, the response will be for the latest meeting instance.
200 *
201 * If a UUID starts with "/" or contains "//" (example: "/ajXp112QmuoKj4854875==\"), you must **double encode** the UUID before making an API request.
202 */
203 pub async fn meeting_details(
204 &self,
205 meeting_id: &str,
206 ) -> ClientResult<crate::Response<crate::types::ReportMeetingDetailsResponse>> {
207 let url = self.client.url(
208 &format!(
209 "/report/meetings/{}",
210 crate::progenitor_support::encode_path(meeting_id),
211 ),
212 None,
213 );
214 self.client
215 .get(
216 &url,
217 crate::Message {
218 body: None,
219 content_type: None,
220 },
221 )
222 .await
223 }
224 /**
225 * Get meeting participant reports.
226 *
227 * This function performs a `GET` to the `/report/meetings/{meetingId}/participants` endpoint.
228 *
229 * Use this API to return a report of a past meeting with two or more participants, including the host.
230 *
231 * To return a report for past meeting with only **one** participant, use the [List meeting participants](https://marketplace.zoom.us/docs/api-reference/zoom-api/dashboards/dashboardmeetingparticipants) API.
232 *
233 * **Scopes:** `report:read:admin`<br>**[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Heavy`
234 *
235 * **Prerequisites:**
236 * * Pro or a higher plan.
237 *
238 * **Parameters:**
239 *
240 * * `meeting_id: &str` -- The meeting ID or the meeting UUID. If a meeting ID is provided in the request instead of a UUID, the response will be for the latest meeting instance.
241 *
242 * If a UUID starts with "/" or contains "//" (example: "/ajXp112QmuoKj4854875==\"), you must **double encode** the UUID before making an API request.
243 * * `page_size: i64` -- The number of records returned within a single API call.
244 * * `next_page_token: &str` -- The next page token is used to paginate through large result sets. A next page token will be returned whenever the set of available results exceeds the current page size. The expiration period for this token is 15 minutes.
245 * * `include_fields: crate::types::DashboardMeetingParticipantsIncludeFields` -- Provide `registrant_id` as the value for this field if you would like to see the registrant ID attribute in the response of this API call. A registrant ID is a unique identifier of a [meeting registrant](https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetingregistrants). This is not supported for `live` meeting types.
246 */
247 pub async fn meeting_participant(
248 &self,
249 meeting_id: &str,
250 page_size: i64,
251 next_page_token: &str,
252 include_fields: crate::types::DashboardMeetingParticipantsIncludeFields,
253 ) -> ClientResult<crate::Response<crate::types::ReportMeetingParticipantsResponseAllOf>> {
254 let mut query_args: Vec<(String, String)> = Default::default();
255 if !include_fields.to_string().is_empty() {
256 query_args.push(("include_fields".to_string(), include_fields.to_string()));
257 }
258 if !next_page_token.is_empty() {
259 query_args.push(("next_page_token".to_string(), next_page_token.to_string()));
260 }
261 if page_size > 0 {
262 query_args.push(("page_size".to_string(), page_size.to_string()));
263 }
264 let query_ = serde_urlencoded::to_string(&query_args).unwrap();
265 let url = self.client.url(
266 &format!(
267 "/report/meetings/{}/participants?{}",
268 crate::progenitor_support::encode_path(meeting_id),
269 query_
270 ),
271 None,
272 );
273 self.client
274 .get(
275 &url,
276 crate::Message {
277 body: None,
278 content_type: None,
279 },
280 )
281 .await
282 }
283 /**
284 * Get meeting poll reports.
285 *
286 * This function performs a `GET` to the `/report/meetings/{meetingId}/polls` endpoint.
287 *
288 * Retrieve a report of [poll](https://support.zoom.us/hc/en-us/articles/213756303-Polling-for-Meetings) results for a past meeting. <br><br>
289 * **Scopes:** `report:read:admin`<br>
290 *
291 * **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Heavy`<br>
292 * **Prerequisites:**<br>
293 * * Pro or a higher plan.<br>
294 *
295 *
296 * **Parameters:**
297 *
298 * * `meeting_id: &str` -- The meeting ID or the meeting UUID. If a meeting ID is provided in the request instead of a UUID, the response will be for the latest meeting instance.
299 *
300 * If a UUID starts with "/" or contains "//" (example: "/ajXp112QmuoKj4854875==\"), you must **double encode** the UUID before making an API request.
301 */
302 pub async fn meeting_polls(
303 &self,
304 meeting_id: &str,
305 ) -> ClientResult<crate::Response<crate::types::ReportMeetingPollsResponse>> {
306 let url = self.client.url(
307 &format!(
308 "/report/meetings/{}/polls",
309 crate::progenitor_support::encode_path(meeting_id),
310 ),
311 None,
312 );
313 self.client
314 .get(
315 &url,
316 crate::Message {
317 body: None,
318 content_type: None,
319 },
320 )
321 .await
322 }
323 /**
324 * Get webinar detail reports.
325 *
326 * This function performs a `GET` to the `/report/webinars/{webinarId}` endpoint.
327 *
328 * Retrieve a [report](https://support.zoom.us/hc/en-us/articles/201393719-Webinar-Reporting) containing past webinar details. <br><br>
329 * **Scopes:** `report:read:admin`<br>
330 *
331 * **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Heavy`<br>
332 * **Prerequisites:**<br>
333 * * Pro or higher plan with Webinar add-on.
334 *
335 * **Parameters:**
336 *
337 * * `webinar_id: &str` -- The webinar ID or the webinar UUID. If a webinar ID is provided in the request instead of a UUID, the response will be for the latest webinar instance.
338 *
339 * If a UUID starts with "/" or contains "//" (example: "/ajXp112QmuoKj4854875==\"), you must **double encode** the UUID before making an API request.
340 */
341 pub async fn webinar_details(
342 &self,
343 webinar_id: &str,
344 ) -> ClientResult<crate::Response<crate::types::ReportMeetingDetailsResponse>> {
345 let url = self.client.url(
346 &format!(
347 "/report/webinars/{}",
348 crate::progenitor_support::encode_path(webinar_id),
349 ),
350 None,
351 );
352 self.client
353 .get(
354 &url,
355 crate::Message {
356 body: None,
357 content_type: None,
358 },
359 )
360 .await
361 }
362 /**
363 * Get webinar participant reports.
364 *
365 * This function performs a `GET` to the `/report/webinars/{webinarId}/participants` endpoint.
366 *
367 * Get detailed report on each attendee of a webinar.<br><br>
368 * **Scopes:** `report:read:admin`<br>
369 *
370 * **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Heavy`<br>
371 * **Prerequisites:**<br>
372 * * Pro or a higher plan with Webinar add-on enabled.
373 *
374 * **Parameters:**
375 *
376 * * `webinar_id: &str` -- The webinar ID or the webinar UUID. If a webinar ID is provided in the request instead of a UUID, the response will be for the latest webinar instance.
377 *
378 * If a UUID starts with "/" or contains "//" (example: "/ajXp112QmuoKj4854875==\"), you must **double encode** the UUID before making an API request.
379 * * `page_size: i64` -- The number of records returned within a single API call.
380 * * `next_page_token: &str` -- The next page token is used to paginate through large result sets. A next page token will be returned whenever the set of available results exceeds the current page size. The expiration period for this token is 15 minutes.
381 * * `include_fields: crate::types::DashboardMeetingParticipantsIncludeFields` -- Provide `registrant_id` as the value for this field if you would like to see the registrant ID attribute in the response of this API call. A registrant ID is a unique identifier of a [meeting registrant](https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetingregistrants). This is not supported for `live` meeting types.
382 */
383 pub async fn webinar_participant(
384 &self,
385 webinar_id: &str,
386 page_size: i64,
387 next_page_token: &str,
388 include_fields: crate::types::DashboardMeetingParticipantsIncludeFields,
389 ) -> ClientResult<crate::Response<crate::types::ReportWebinarParticipantsResponseAllOf>> {
390 let mut query_args: Vec<(String, String)> = Default::default();
391 if !include_fields.to_string().is_empty() {
392 query_args.push(("include_fields".to_string(), include_fields.to_string()));
393 }
394 if !next_page_token.is_empty() {
395 query_args.push(("next_page_token".to_string(), next_page_token.to_string()));
396 }
397 if page_size > 0 {
398 query_args.push(("page_size".to_string(), page_size.to_string()));
399 }
400 let query_ = serde_urlencoded::to_string(&query_args).unwrap();
401 let url = self.client.url(
402 &format!(
403 "/report/webinars/{}/participants?{}",
404 crate::progenitor_support::encode_path(webinar_id),
405 query_
406 ),
407 None,
408 );
409 self.client
410 .get(
411 &url,
412 crate::Message {
413 body: None,
414 content_type: None,
415 },
416 )
417 .await
418 }
419 /**
420 * Get webinar poll reports.
421 *
422 * This function performs a `GET` to the `/report/webinars/{webinarId}/polls` endpoint.
423 *
424 * Retrieve a report on past [webinar polls](https://support.zoom.us/hc/en-us/articles/203749865-Polling-for-Webinars).<br><br>
425 * **Scopes:** `report:read:admin`<br>
426 *
427 * **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Heavy`<br>
428 * **Prerequisites:**<br>
429 * * Pro or a higher plan with Webinar add-on enabled.
430 *
431 * **Parameters:**
432 *
433 * * `webinar_id: &str` -- The webinar ID or the webinar UUID. If a webinar ID is provided in the request instead of a UUID, the response will be for the latest webinar instance.
434 *
435 * If a UUID starts with "/" or contains "//" (example: "/ajXp112QmuoKj4854875==\"), you must **double encode** the UUID before making an API request.
436 */
437 pub async fn webinar_polls(
438 &self,
439 webinar_id: &str,
440 ) -> ClientResult<crate::Response<crate::types::ReportMeetingPollsResponse>> {
441 let url = self.client.url(
442 &format!(
443 "/report/webinars/{}/polls",
444 crate::progenitor_support::encode_path(webinar_id),
445 ),
446 None,
447 );
448 self.client
449 .get(
450 &url,
451 crate::Message {
452 body: None,
453 content_type: None,
454 },
455 )
456 .await
457 }
458 /**
459 * Get webinar Q&A report.
460 *
461 * This function performs a `GET` to the `/report/webinars/{webinarId}/qa` endpoint.
462 *
463 * The Question & Answer (Q&A) feature for webinars allows attendees to ask questions during the webinar and for the panelists, co-hosts and host to answer their questions.
464 *
465 * Use this API to retrieve a report on question and answers from past webinars. <br><br>
466 * **Scopes:** `report:read:admin`<br>
467 *
468 * **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Heavy`<br>
469 * **Prerequisites:**<br>
470 * * Pro or a higher plan with Webinar add-on enabled.
471 *
472 * **Parameters:**
473 *
474 * * `webinar_id: &str` -- The webinar ID or the webinar UUID. If a webinar ID is provided in the request instead of a UUID, the response will be for the latest webinar instance.
475 *
476 * If a UUID starts with "/" or contains "//" (example: "/ajXp112QmuoKj4854875==\"), you must **double encode** the UUID before making an API request.
477 */
478 pub async fn webinar_qa(
479 &self,
480 webinar_id: &str,
481 ) -> ClientResult<crate::Response<crate::types::ReportWebinarQaResponse>> {
482 let url = self.client.url(
483 &format!(
484 "/report/webinars/{}/qa",
485 crate::progenitor_support::encode_path(webinar_id),
486 ),
487 None,
488 );
489 self.client
490 .get(
491 &url,
492 crate::Message {
493 body: None,
494 content_type: None,
495 },
496 )
497 .await
498 }
499 /**
500 * Get telephone reports.
501 *
502 * This function performs a `GET` to the `/report/telephone` endpoint.
503 *
504 * The [telephone report](https://support.zoom.us/hc/en-us/articles/206514816-Telephone-reports) allows you to view who dialed into meetings via phone (Audio Conferencing or SIP Connected Audio) and which number they dialed into and other details. Use this API to get telephone report for a specified period of time.
505 *
506 * **Scopes:** `report:read:admin`<br>
507 *
508 * **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Heavy`<br>**Prerequisites:**<br>
509 * * Pro or higher plan.
510 *
511 * **Parameters:**
512 *
513 * * `type_: &str` -- Audio types:<br>`1` - Toll-free Call-in & Call-out.<br>`2` - Toll <br>
514 * `3` - SIP Connected Audio.
515 * * `query_date_type: crate::types::QueryDateType` -- Date types:<br>`start_time` - Query by call start time.<br>`end_time` - Query by call end time.
516 * * `from: chrono::NaiveDate` -- Start date in 'yyyy-mm-dd' format. The date range defined by the "from" and "to" parameters should only be one month as the report includes only one month worth of data at once.
517 * * `to: chrono::NaiveDate` -- Start Date.
518 * * `page_size: i64` -- The number of records returned within a single API call.
519 * * `page_number: i64` --
520 * **Deprecated** - This field has been deprecated and we will stop supporting it completely in a future release. Please use "next_page_token" for pagination instead of this field.
521 *
522 * The page number of the current page in the returned records.
523 * * `next_page_token: &str` -- The next page token is used to paginate through large result sets. A next page token will be returned whenever the set of available results exceeds the current page size. The expiration period for this token is 15 minutes.
524 */
525 pub async fn telephone(
526 &self,
527 type_: &str,
528 query_date_type: crate::types::QueryDateType,
529 from: chrono::NaiveDate,
530 to: chrono::NaiveDate,
531 page_size: i64,
532 page_number: i64,
533 next_page_token: &str,
534 ) -> ClientResult<crate::Response<crate::types::Domains>> {
535 let mut query_args: Vec<(String, String)> = Default::default();
536 if !from.to_string().is_empty() {
537 query_args.push(("from".to_string(), from.to_string()));
538 }
539 if !next_page_token.is_empty() {
540 query_args.push(("next_page_token".to_string(), next_page_token.to_string()));
541 }
542 if page_number > 0 {
543 query_args.push(("page_number".to_string(), page_number.to_string()));
544 }
545 if page_size > 0 {
546 query_args.push(("page_size".to_string(), page_size.to_string()));
547 }
548 if !query_date_type.to_string().is_empty() {
549 query_args.push(("query_date_type".to_string(), query_date_type.to_string()));
550 }
551 if !to.to_string().is_empty() {
552 query_args.push(("to".to_string(), to.to_string()));
553 }
554 if !type_.is_empty() {
555 query_args.push(("type".to_string(), type_.to_string()));
556 }
557 let query_ = serde_urlencoded::to_string(&query_args).unwrap();
558 let url = self
559 .client
560 .url(&format!("/report/telephone?{}", query_), None);
561 self.client
562 .get(
563 &url,
564 crate::Message {
565 body: None,
566 content_type: None,
567 },
568 )
569 .await
570 }
571 /**
572 * Get cloud recording usage report.
573 *
574 * This function performs a `GET` to the `/report/cloud_recording` endpoint.
575 *
576 * Retrieve cloud recording usage report for a specified period. You can only get cloud recording reports that is one day ealier than the current date and for the most recent period of 6 months. The date gap between from and to dates should be smaller or equal to 30 days. <br>
577 * **Prerequisites**<br>
578 * * Pro or higher plan.<br>
579 * **Scopes:** `report:read:admin`<br>
580 *
581 * **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Heavy`
582 *
583 * **Parameters:**
584 *
585 * * `from: chrono::NaiveDate` -- Start date in 'yyyy-mm-dd' format. The date range defined by the "from" and "to" parameters should only be one month as the report includes only one month worth of data at once.
586 * * `to: chrono::NaiveDate` -- Start Date.
587 */
588 pub async fn cloud_recording(
589 &self,
590 from: chrono::NaiveDate,
591 to: chrono::NaiveDate,
592 ) -> ClientResult<crate::Response<crate::types::ReportCloudRecordingResponseAllOf>> {
593 let mut query_args: Vec<(String, String)> = Default::default();
594 if !from.to_string().is_empty() {
595 query_args.push(("from".to_string(), from.to_string()));
596 }
597 if !to.to_string().is_empty() {
598 query_args.push(("to".to_string(), to.to_string()));
599 }
600 let query_ = serde_urlencoded::to_string(&query_args).unwrap();
601 let url = self
602 .client
603 .url(&format!("/report/cloud_recording?{}", query_), None);
604 self.client
605 .get(
606 &url,
607 crate::Message {
608 body: None,
609 content_type: None,
610 },
611 )
612 .await
613 }
614 /**
615 * Get operation logs report.
616 *
617 * This function performs a `GET` to the `/report/operationlogs` endpoint.
618 *
619 * The [Operations Logs](https://support.zoom.us/hc/en-us/articles/360032748331-Operation-Logs) report allows you to audit admin and user activity, such as adding a new user, changing account settings, and deleting recordings.<br>
620 * Use this API to retrieve operation logs report for a specified period of time.<br>
621 * **Scopes:** `report:read:admin`<br>
622 *
623 * **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Heavy`<br>
624 * **Prerequisites:**<br>
625 * * Pro or higher plan.
626 *
627 * **Parameters:**
628 *
629 * * `from: chrono::NaiveDate` -- Start date in 'yyyy-mm-dd' format. The date range defined by the "from" and "to" parameters should only be one month as the report includes only one month worth of data at once.
630 * * `to: chrono::NaiveDate` -- Start Date.
631 * * `page_size: i64` -- The number of records returned within a single API call.
632 * * `next_page_token: &str` -- The next page token is used to paginate through large result sets. A next page token will be returned whenever the set of available results exceeds the current page size. The expiration period for this token is 15 minutes.
633 * * `category_type: crate::types::CategoryType` -- \*\*Optional\*\*<br>
634 * Filter your response by a category type to see reports for a specific category.
635 * The value for this field can be one of the following:<br> `all`<br>`user`<br>`user_settings`<br>`account`<br>`billing`<br>`im`<br>`recording`<br>`phone_contacts`<br>`webinar`<br>`sub_account`<br>`role`<br>`zoom_rooms`.
636 */
637 pub async fn operation_log(
638 &self,
639 from: chrono::NaiveDate,
640 to: chrono::NaiveDate,
641 page_size: i64,
642 next_page_token: &str,
643 category_type: crate::types::CategoryType,
644 ) -> ClientResult<crate::Response<crate::types::ReportOperationLogsResponseAllOf>> {
645 let mut query_args: Vec<(String, String)> = Default::default();
646 if !category_type.to_string().is_empty() {
647 query_args.push(("category_type".to_string(), category_type.to_string()));
648 }
649 if !from.to_string().is_empty() {
650 query_args.push(("from".to_string(), from.to_string()));
651 }
652 if !next_page_token.is_empty() {
653 query_args.push(("next_page_token".to_string(), next_page_token.to_string()));
654 }
655 if page_size > 0 {
656 query_args.push(("page_size".to_string(), page_size.to_string()));
657 }
658 if !to.to_string().is_empty() {
659 query_args.push(("to".to_string(), to.to_string()));
660 }
661 let query_ = serde_urlencoded::to_string(&query_args).unwrap();
662 let url = self
663 .client
664 .url(&format!("/report/operationlogs?{}", query_), None);
665 self.client
666 .get(
667 &url,
668 crate::Message {
669 body: None,
670 content_type: None,
671 },
672 )
673 .await
674 }
675 /**
676 * Get sign In / sign out activity report.
677 *
678 * This function performs a `GET` to the `/report/activities` endpoint.
679 *
680 * Retrieve a list of sign in / sign out activity logs [report](https://support.zoom.us/hc/en-us/articles/201363213-Getting-Started-with-Reports) of users under a Zoom account.<br>
681 * **Prerequisites**<br>
682 * * Pro or higher plan.<br>
683 * **Scopes:** `report:read:admin`<br>
684 *
685 * **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Heavy`
686 *
687 * **Parameters:**
688 *
689 * * `from: chrono::NaiveDate` -- Start date for which you would like to view the activity logs report. Using the `from` and `to` parameters, specify a monthly date range for the report as the API only provides one month worth of data in one request. The specified date range should fall within the last six months.
690 * * `to: chrono::NaiveDate` -- End date up to which you would like to view the activity logs report.
691 * * `page_size: i64` -- The number of records to be returned within a single API call.
692 * * `next_page_token: &str` -- Next page token is used to paginate through large result sets.
693 */
694 pub async fn sign_out_activities(
695 &self,
696 from: chrono::NaiveDate,
697 to: chrono::NaiveDate,
698 page_size: i64,
699 next_page_token: &str,
700 ) -> ClientResult<crate::Response<Vec<crate::types::ActivityLogs>>> {
701 let mut query_args: Vec<(String, String)> = Default::default();
702 if !from.to_string().is_empty() {
703 query_args.push(("from".to_string(), from.to_string()));
704 }
705 if !next_page_token.is_empty() {
706 query_args.push(("next_page_token".to_string(), next_page_token.to_string()));
707 }
708 if page_size > 0 {
709 query_args.push(("page_size".to_string(), page_size.to_string()));
710 }
711 if !to.to_string().is_empty() {
712 query_args.push(("to".to_string(), to.to_string()));
713 }
714 let query_ = serde_urlencoded::to_string(&query_args).unwrap();
715 let url = self
716 .client
717 .url(&format!("/report/activities?{}", query_), None);
718 let resp: crate::Response<crate::types::ReportSignInOutActivitiesResponse> = self
719 .client
720 .get(
721 &url,
722 crate::Message {
723 body: None,
724 content_type: None,
725 },
726 )
727 .await?;
728
729 // Return our response data.
730 Ok(crate::Response::new(
731 resp.status,
732 resp.headers,
733 resp.body.activity_logs.to_vec(),
734 ))
735 }
736 /**
737 * Get sign In / sign out activity report.
738 *
739 * This function performs a `GET` to the `/report/activities` endpoint.
740 *
741 * As opposed to `sign_out_activities`, this function returns all the pages of the request at once.
742 *
743 * Retrieve a list of sign in / sign out activity logs [report](https://support.zoom.us/hc/en-us/articles/201363213-Getting-Started-with-Reports) of users under a Zoom account.<br>
744 * **Prerequisites**<br>
745 * * Pro or higher plan.<br>
746 * **Scopes:** `report:read:admin`<br>
747 *
748 * **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Heavy`
749 */
750 pub async fn get_all_sign_out_activities(
751 &self,
752 from: chrono::NaiveDate,
753 to: chrono::NaiveDate,
754 ) -> ClientResult<crate::Response<Vec<crate::types::ActivityLogs>>> {
755 let mut query_args: Vec<(String, String)> = Default::default();
756 if !from.to_string().is_empty() {
757 query_args.push(("from".to_string(), from.to_string()));
758 }
759 if !to.to_string().is_empty() {
760 query_args.push(("to".to_string(), to.to_string()));
761 }
762 let query_ = serde_urlencoded::to_string(&query_args).unwrap();
763 let url = self
764 .client
765 .url(&format!("/report/activities?{}", query_), None);
766 let crate::Response::<crate::types::ReportSignInOutActivitiesResponse> {
767 mut status,
768 mut headers,
769 mut body,
770 } = self
771 .client
772 .get(
773 &url,
774 crate::Message {
775 body: None,
776 content_type: None,
777 },
778 )
779 .await?;
780
781 let mut activity_logs = body.activity_logs;
782 let mut page = body.next_page_token;
783
784 // Paginate if we should.
785 while !page.is_empty() {
786 // Check if we already have URL params and need to concat the token.
787 if !url.contains('?') {
788 crate::Response::<crate::types::ReportSignInOutActivitiesResponse> {
789 status,
790 headers,
791 body,
792 } = self
793 .client
794 .get(
795 &format!("{}?next_page_token={}", url, page),
796 crate::Message {
797 body: None,
798 content_type: None,
799 },
800 )
801 .await?;
802 } else {
803 crate::Response::<crate::types::ReportSignInOutActivitiesResponse> {
804 status,
805 headers,
806 body,
807 } = self
808 .client
809 .get(
810 &format!("{}&next_page_token={}", url, page),
811 crate::Message {
812 body: None,
813 content_type: None,
814 },
815 )
816 .await?;
817 }
818
819 activity_logs.append(&mut body.activity_logs);
820
821 if !body.next_page_token.is_empty() && body.next_page_token != page {
822 page = body.next_page_token.to_string();
823 } else {
824 page = "".to_string();
825 }
826 }
827
828 // Return our response data.
829 Ok(crate::Response::new(status, headers, activity_logs))
830 }
831 /**
832 * Get billing reports.
833 *
834 * This function performs a `GET` to the `/report/billing` endpoint.
835 *
836 * Get department billing reports of a Zoom account.
837 *
838 * **Prerequisites:**<br>
839 * * Pro or a higher account with Department Billing option enabled. Contact Zoom Support team for details.
840 *
841 * **Scopes:** `report:read:admin`, `report:master`
842 *
843 * **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Heavy`
844 */
845 pub async fn get_billing(
846 &self,
847 ) -> ClientResult<crate::Response<crate::types::GetBillingReportResponse>> {
848 let url = self.client.url("/report/billing", None);
849 self.client
850 .get(
851 &url,
852 crate::Message {
853 body: None,
854 content_type: None,
855 },
856 )
857 .await
858 }
859 /**
860 * Get billing invoice reports.
861 *
862 * This function performs a `GET` to the `/report/billing/invoices` endpoint.
863 *
864 * Get department billing invoices reports for a specific billing period. Provide the `billing_id` of the billing period for which you would like to retrieve the invoices for. This ID can be retrieved from **Get Billing Reports** API.
865 *
866 * **Prerequisites:**<br>
867 * * Pro or a higher account with Department Billing option enabled. Contact the Zoom Support team to enable this feature.
868 *
869 * **Scopes:** `report:read:admin`, `report:master`
870 *
871 *
872 * **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Heavy`
873 *
874 * **Parameters:**
875 *
876 * * `billing_id: &str` -- Unique Identifier of the Billing Report. Retrieve this ID from the response of **Get Billing Reports** API request.
877 *
878 * .
879 */
880 pub async fn get_billing_invoices(
881 &self,
882 billing_id: &str,
883 ) -> ClientResult<crate::Response<crate::types::GetBillingInvoicesReportsResponse>> {
884 let mut query_args: Vec<(String, String)> = Default::default();
885 if !billing_id.is_empty() {
886 query_args.push(("billing_id".to_string(), billing_id.to_string()));
887 }
888 let query_ = serde_urlencoded::to_string(&query_args).unwrap();
889 let url = self
890 .client
891 .url(&format!("/report/billing/invoices?{}", query_), None);
892 self.client
893 .get(
894 &url,
895 crate::Message {
896 body: None,
897 content_type: None,
898 },
899 )
900 .await
901 }
902}