Skip to main content

zoom_api/
archiving.rs

1use crate::Client;
2use crate::ClientResult;
3
4pub struct Archiving {
5    pub client: Client,
6}
7
8impl Archiving {
9    #[doc(hidden)]
10    pub fn new(client: Client) -> Self {
11        Archiving { client }
12    }
13
14    /**
15     * List archived files.
16     *
17     * This function performs a `GET` to the `/archive_files` endpoint.
18     *
19     * Zoom’s [archiving solution](https://support.zoom.us/hc/en-us/articles/360050431572-Archiving-Meeting-and-Webinar-data) allows account administrators to set up an automated mechanism to record, collect and archive meeting data to a 3rd party platform of their choice and hence, satisfy FINRA and/ or other compliance requirements.<br><br>
20     * Use this API to retrieve archived meeting or webinar files of an account.
21     *
22     * **Scope:** `recording:read:admin`<br>
23     * **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Medium`<br><br>
24     * **Prerequisites:** <br>
25     * * Enable cloud recording.
26     * * Follow the [enablement process](https://support.zoom.us/hc/en-us/articles/360050431572-Archiving-Meeting-and-Webinar-data#h_01ENPBD3WR68D7FAKTBY92SG45) to access the archiving feature.
27     *
28     * **Parameters:**
29     *
30     * * `page_size: i64` -- The number of records returned within a single API call.
31     * * `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.
32     * * `from: &str` -- Start date for the query in "yyyy-MM-dd'T'HH:mm:ss'Z'" format. The duration for the query defined using the "from" and "to" parameters should not exceed 7 days as this API only provides a week's data at once.
33     * * `to: &str` -- End date for the query in "yyyy-MM-dd'T'HH:mm:ss'Z'" format. .
34     * * `query_date_type: crate::types::ListArchivedFilesQueryDateType` -- The query date type for the `from` and `to` parameters.
35     */
36    pub async fn list_archived_files(
37        &self,
38        page_size: i64,
39        next_page_token: &str,
40        from: &str,
41        to: &str,
42        query_date_type: crate::types::ListArchivedFilesQueryDateType,
43    ) -> ClientResult<crate::Response<Vec<crate::types::ListArchivedFilesResponseMeetings>>> {
44        let mut query_args: Vec<(String, String)> = Default::default();
45        if !from.is_empty() {
46            query_args.push(("from".to_string(), from.to_string()));
47        }
48        if !next_page_token.is_empty() {
49            query_args.push(("next_page_token".to_string(), next_page_token.to_string()));
50        }
51        if page_size > 0 {
52            query_args.push(("page_size".to_string(), page_size.to_string()));
53        }
54        if !query_date_type.to_string().is_empty() {
55            query_args.push(("query_date_type".to_string(), query_date_type.to_string()));
56        }
57        if !to.is_empty() {
58            query_args.push(("to".to_string(), to.to_string()));
59        }
60        let query_ = serde_urlencoded::to_string(&query_args).unwrap();
61        let url = self.client.url(&format!("/archive_files?{}", query_), None);
62        let resp: crate::Response<crate::types::ListArchivedFilesResponse> = self
63            .client
64            .get(
65                &url,
66                crate::Message {
67                    body: None,
68                    content_type: None,
69                },
70            )
71            .await?;
72
73        // Return our response data.
74        Ok(crate::Response::new(
75            resp.status,
76            resp.headers,
77            resp.body.meetings.to_vec(),
78        ))
79    }
80    /**
81     * List archived files.
82     *
83     * This function performs a `GET` to the `/archive_files` endpoint.
84     *
85     * As opposed to `list_archived_files`, this function returns all the pages of the request at once.
86     *
87     * Zoom’s [archiving solution](https://support.zoom.us/hc/en-us/articles/360050431572-Archiving-Meeting-and-Webinar-data) allows account administrators to set up an automated mechanism to record, collect and archive meeting data to a 3rd party platform of their choice and hence, satisfy FINRA and/ or other compliance requirements.<br><br>
88     * Use this API to retrieve archived meeting or webinar files of an account.
89     *
90     * **Scope:** `recording:read:admin`<br>
91     * **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Medium`<br><br>
92     * **Prerequisites:** <br>
93     * * Enable cloud recording.
94     * * Follow the [enablement process](https://support.zoom.us/hc/en-us/articles/360050431572-Archiving-Meeting-and-Webinar-data#h_01ENPBD3WR68D7FAKTBY92SG45) to access the archiving feature.
95     */
96    pub async fn list_all_archived_files(
97        &self,
98        from: &str,
99        to: &str,
100        query_date_type: crate::types::ListArchivedFilesQueryDateType,
101    ) -> ClientResult<crate::Response<Vec<crate::types::ListArchivedFilesResponseMeetings>>> {
102        let mut query_args: Vec<(String, String)> = Default::default();
103        if !from.is_empty() {
104            query_args.push(("from".to_string(), from.to_string()));
105        }
106        if !query_date_type.to_string().is_empty() {
107            query_args.push(("query_date_type".to_string(), query_date_type.to_string()));
108        }
109        if !to.is_empty() {
110            query_args.push(("to".to_string(), to.to_string()));
111        }
112        let query_ = serde_urlencoded::to_string(&query_args).unwrap();
113        let url = self.client.url(&format!("/archive_files?{}", query_), None);
114        let crate::Response::<crate::types::ListArchivedFilesResponse> {
115            mut status,
116            mut headers,
117            mut body,
118        } = self
119            .client
120            .get(
121                &url,
122                crate::Message {
123                    body: None,
124                    content_type: None,
125                },
126            )
127            .await?;
128
129        let mut meetings = body.meetings;
130        let mut page = body.next_page_token;
131
132        // Paginate if we should.
133        while !page.is_empty() {
134            // Check if we already have URL params and need to concat the token.
135            if !url.contains('?') {
136                crate::Response::<crate::types::ListArchivedFilesResponse> {
137                    status,
138                    headers,
139                    body,
140                } = self
141                    .client
142                    .get(
143                        &format!("{}?next_page_token={}", url, page),
144                        crate::Message {
145                            body: None,
146                            content_type: None,
147                        },
148                    )
149                    .await?;
150            } else {
151                crate::Response::<crate::types::ListArchivedFilesResponse> {
152                    status,
153                    headers,
154                    body,
155                } = self
156                    .client
157                    .get(
158                        &format!("{}&next_page_token={}", url, page),
159                        crate::Message {
160                            body: None,
161                            content_type: None,
162                        },
163                    )
164                    .await?;
165            }
166
167            meetings.append(&mut body.meetings);
168
169            if !body.next_page_token.is_empty() && body.next_page_token != page {
170                page = body.next_page_token.to_string();
171            } else {
172                page = "".to_string();
173            }
174        }
175
176        // Return our response data.
177        Ok(crate::Response::new(status, headers, meetings))
178    }
179    /**
180     * Get meeting archived files.
181     *
182     * This function performs a `GET` to the `/past_meetings/{meetingUUID}/archive_files` endpoint.
183     *
184     * List the archived recording files of the specific meeting instance. For more information, read our [Managing archiving of meeting and webinar data](https://support.zoom.us/hc/en-us/articles/360050431572-Archiving-Meeting-and-Webinar-data) documentation.
185     *
186     * **Scopes:** `recording:read``24` — Apple OAuth</br>`27` — Microsoft OAuth</br>`97` — Mobile device</br>`98` — RingCentral OAuth</br>`99` — API user</br>`100` — Zoom Work email</br>`101` — Single Sign-On (SSO)
187     *
188     * The following login methods are only available in China:
189     *
190     * `11` — Phone number</br>`21` — WeChat</br>`23` — Alipay
191     *
192     * **Parameters:**
193     *
194     * * `meeting: &str` -- The meeting's universally unique identifier (UUID). Each meeting instance generates a UUID. For example, after a meeting ends, a new UUID is generated for the next meeting instance.
195     *   
196     *   If the meeting UUID begins with a `/` character or contains a `//` character, you **must** double-encode the meeting UUID when using the meeting UUID for other API calls.
197     */
198    pub async fn testget_record_archived_file(
199        &self,
200        meeting_uuid: &str,
201    ) -> ClientResult<crate::Response<crate::types::CloudArchivedFiles>> {
202        let url = self.client.url(
203            &format!(
204                "/past_meetings/{}/archive_files",
205                crate::progenitor_support::encode_path(meeting_uuid),
206            ),
207            None,
208        );
209        self.client
210            .get(
211                &url,
212                crate::Message {
213                    body: None,
214                    content_type: None,
215                },
216            )
217            .await
218    }
219}