zoom_api/users.rs
1use crate::Client;
2use crate::ClientResult;
3
4pub struct Users {
5 pub client: Client,
6}
7
8impl Users {
9 #[doc(hidden)]
10 pub fn new(client: Client) -> Self {
11 Users { client }
12 }
13
14 /**
15 * List users.
16 *
17 * This function performs a `GET` to the `/users` endpoint.
18 *
19 * Use this API to list your account's users.
20 *
21 * **Scopes:** `user:read:admin`<br>**[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Medium`
22 *
23 * **Parameters:**
24 *
25 * * `status: crate::types::UsersStatus` -- The user's status:
26 * \* `active` — An active user.
27 * \* `inactive` — A deactivated user.
28 * \* `pending` — A pending user.
29 *
30 * This value defaults to `active`.
31 * * `page_size: i64` -- The number of records returned within a single API call.
32 * * `role_id: &str` -- The role's unique ID. Use this parameter to filter the response by a specific role. You can use the [List Roles](https://marketplace.zoom.us/docs/api-reference/zoom-api/roles/roles) API to get a role's unique ID value.
33 * * `page_number: &str` -- The page number of the current page in the returned records.
34 * * `include_fields: crate::types::UsersIncludeFields` -- Use this parameter to display one of the following attributes in the API call's response:
35 * \* `custom_attributes` — Return the user's custom attributes.
36 * \* `host_key` — Return the user's [host key](https://support.zoom.us/hc/en-us/articles/205172555-Using-your-host-key).
37 * * `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.
38 */
39 pub async fn get_page(
40 &self,
41 status: crate::types::UsersStatus,
42 page_size: i64,
43 role_id: &str,
44 page_number: &str,
45 include_fields: crate::types::UsersIncludeFields,
46 next_page_token: &str,
47 ) -> ClientResult<crate::Response<Vec<crate::types::UsersResponse>>> {
48 let mut query_args: Vec<(String, String)> = Default::default();
49 if !include_fields.to_string().is_empty() {
50 query_args.push(("include_fields".to_string(), include_fields.to_string()));
51 }
52 if !next_page_token.is_empty() {
53 query_args.push(("next_page_token".to_string(), next_page_token.to_string()));
54 }
55 if !page_number.is_empty() {
56 query_args.push(("page_number".to_string(), page_number.to_string()));
57 }
58 if page_size > 0 {
59 query_args.push(("page_size".to_string(), page_size.to_string()));
60 }
61 if !role_id.is_empty() {
62 query_args.push(("role_id".to_string(), role_id.to_string()));
63 }
64 if !status.to_string().is_empty() {
65 query_args.push(("status".to_string(), status.to_string()));
66 }
67 let query_ = serde_urlencoded::to_string(&query_args).unwrap();
68 let url = self.client.url(&format!("/users?{}", query_), None);
69 let resp: crate::Response<crate::types::UsersResponseData> = self
70 .client
71 .get(
72 &url,
73 crate::Message {
74 body: None,
75 content_type: None,
76 },
77 )
78 .await?;
79
80 // Return our response data.
81 Ok(crate::Response::new(
82 resp.status,
83 resp.headers,
84 resp.body.users.to_vec(),
85 ))
86 }
87 /**
88 * List users.
89 *
90 * This function performs a `GET` to the `/users` endpoint.
91 *
92 * As opposed to `get`, this function returns all the pages of the request at once.
93 *
94 * Use this API to list your account's users.
95 *
96 * **Scopes:** `user:read:admin`<br>**[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Medium`
97 */
98 pub async fn get_all(
99 &self,
100 status: crate::types::UsersStatus,
101 role_id: &str,
102 include_fields: crate::types::UsersIncludeFields,
103 ) -> ClientResult<crate::Response<Vec<crate::types::UsersResponse>>> {
104 let mut query_args: Vec<(String, String)> = Default::default();
105 if !include_fields.to_string().is_empty() {
106 query_args.push(("include_fields".to_string(), include_fields.to_string()));
107 }
108 if !role_id.is_empty() {
109 query_args.push(("role_id".to_string(), role_id.to_string()));
110 }
111 if !status.to_string().is_empty() {
112 query_args.push(("status".to_string(), status.to_string()));
113 }
114 let query_ = serde_urlencoded::to_string(&query_args).unwrap();
115 let url = self.client.url(&format!("/users?{}", query_), None);
116 let crate::Response::<crate::types::UsersResponseData> {
117 mut status,
118 mut headers,
119 mut body,
120 } = self
121 .client
122 .get(
123 &url,
124 crate::Message {
125 body: None,
126 content_type: None,
127 },
128 )
129 .await?;
130
131 let mut users = body.users;
132 let mut page = body.next_page_token;
133
134 // Paginate if we should.
135 while !page.is_empty() {
136 // Check if we already have URL params and need to concat the token.
137 if !url.contains('?') {
138 crate::Response::<crate::types::UsersResponseData> {
139 status,
140 headers,
141 body,
142 } = self
143 .client
144 .get(
145 &format!("{}?next_page_token={}", url, page),
146 crate::Message {
147 body: None,
148 content_type: None,
149 },
150 )
151 .await?;
152 } else {
153 crate::Response::<crate::types::UsersResponseData> {
154 status,
155 headers,
156 body,
157 } = self
158 .client
159 .get(
160 &format!("{}&next_page_token={}", url, page),
161 crate::Message {
162 body: None,
163 content_type: None,
164 },
165 )
166 .await?;
167 }
168
169 users.append(&mut body.users);
170
171 if !body.next_page_token.is_empty() && body.next_page_token != page {
172 page = body.next_page_token.to_string();
173 } else {
174 page = "".to_string();
175 }
176 }
177
178 // Return our response data.
179 Ok(crate::Response::new(status, headers, users))
180 }
181 /**
182 * Create users.
183 *
184 * This function performs a `POST` to the `/users` endpoint.
185 *
186 * A Zoom account can have one or more users. Use this API to add a new user to your account.<br><br>
187 * **Prerequisites:**<br>
188 * * Pro or higher plan<br><br>
189 * **Scopes:** `user:write:admin` `user:write`<br>
190 *
191 * **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Light`
192 */
193 pub async fn create(
194 &self,
195 body: &crate::types::UserCreateRequest,
196 ) -> ClientResult<crate::Response<crate::types::UserCreateResponse>> {
197 let url = self.client.url("/users", None);
198 self.client
199 .post(
200 &url,
201 crate::Message {
202 body: Some(reqwest::Body::from(serde_json::to_vec(body)?)),
203 content_type: Some("application/json".to_string()),
204 },
205 )
206 .await
207 }
208 /**
209 * Get a user.
210 *
211 * This function performs a `GET` to the `/users/{userId}` endpoint.
212 *
213 * View a specific user's information on a Zoom account. A Zoom account can have one or more users. For user-level apps, pass [the `me` value](https://marketplace.zoom.us/docs/api-reference/using-zoom-apis#mekeyword) instead of the `userId` parameter.
214 *
215 * <p style="background-color:#e1f5fe; color:#000000; padding:8px"> <b>Note:</b> Users who have not activated their account have a status of <i>pending</i>, and the <code>created_at</code> time displays the time at which the API call was made.</p>
216 *
217 * **Scopes:** `user:read:admin`, `user:read`, `user_info:read`<p style="background-color:#e1f5fe; color:#000000; padding:8px"> <b>Note:</b> The `user_info:read` scope is only available when you pass the `me` value for the `$userId` value.</p></br>**[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Light`
218 *
219 * **Parameters:**
220 *
221 * * `user_id: &str` -- The user ID or email address of the user. For user-level apps, pass `me` as the value for userId.
222 * * `login_type: crate::types::LoginType` -- The user's login method:
223 *
224 * `0` — Facebook OAuth</br>`1` — Google OAuth</br>`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)
225 *
226 * The following login methods are only available in China:
227 *
228 * `11` — Phone number</br>`21` — WeChat</br>`23` — Alipay.
229 * * `encrypted_email: bool` -- Enable/disable the option for a sub account to use shared [Virtual Room Connector(s)](https://support.zoom.us/hc/en-us/articles/202134758-Getting-Started-With-Virtual-Room-Connector) that are set up by the master account. Virtual Room Connectors can only be used by On-prem users.
230 */
231 pub async fn user(
232 &self,
233 user_id: &str,
234 login_type: crate::types::LoginType,
235 encrypted_email: bool,
236 ) -> ClientResult<crate::Response<crate::types::UserResponseAllOf>> {
237 let mut query_args: Vec<(String, String)> = Default::default();
238 if encrypted_email {
239 query_args.push(("encrypted_email".to_string(), encrypted_email.to_string()));
240 }
241 if !login_type.to_string().is_empty() {
242 query_args.push(("login_type".to_string(), login_type.to_string()));
243 }
244 let query_ = serde_urlencoded::to_string(&query_args).unwrap();
245 let url = self.client.url(
246 &format!(
247 "/users/{}?{}",
248 crate::progenitor_support::encode_path(user_id),
249 query_
250 ),
251 None,
252 );
253 self.client
254 .get(
255 &url,
256 crate::Message {
257 body: None,
258 content_type: None,
259 },
260 )
261 .await
262 }
263 /**
264 * Delete a user.
265 *
266 * This function performs a `DELETE` to the `/users/{userId}` endpoint.
267 *
268 * Use this API to disassociate (unlink) a user or permanently delete a user. For user-level apps, pass [the `me` value](https://marketplace.zoom.us/docs/api-reference/using-zoom-apis#mekeyword) instead of the `userId` parameter.
269 *
270 * **Deleting** a user **permanently** removes the user and their data from Zoom. Users can create a new Zoom account using the same email address. An account owner or an account admin can transfer meetings, webinars and cloud recordings to another Zoom user account before deleting.
271 *
272 * **Disassociating** a user unlinks the user from the associated Zoom account and provides the user their own basic free Zoom account. The disassociated user can then purchase their own Zoom licenses. An account owner or account admin can transfer the user's meetings, webinars, and cloud recordings to another user before disassociation.
273 *
274 * **Scopes:** `user:write:admin`, `user:write`<br>**[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Light`
275 *
276 * **Parameters:**
277 *
278 * * `user_id: &str` -- The user ID or email address of the user. For user-level apps, pass `me` as the value for userId.
279 * * `action: crate::types::UserDeleteAction` -- Delete action options:<br>`disassociate` - Disassociate a user.<br>`delete`- Permanently delete a user.<br>Note: To delete pending user in the account, use `disassociate`.
280 * * `transfer_email: &str` -- User's first name.
281 * * `transfer_meeting: bool` -- Enable/disable the option for a sub account to use shared [Virtual Room Connector(s)](https://support.zoom.us/hc/en-us/articles/202134758-Getting-Started-With-Virtual-Room-Connector) that are set up by the master account. Virtual Room Connectors can only be used by On-prem users.
282 * * `transfer_webinar: bool` -- Enable/disable the option for a sub account to use shared [Virtual Room Connector(s)](https://support.zoom.us/hc/en-us/articles/202134758-Getting-Started-With-Virtual-Room-Connector) that are set up by the master account. Virtual Room Connectors can only be used by On-prem users.
283 * * `transfer_recording: bool` -- Enable/disable the option for a sub account to use shared [Virtual Room Connector(s)](https://support.zoom.us/hc/en-us/articles/202134758-Getting-Started-With-Virtual-Room-Connector) that are set up by the master account. Virtual Room Connectors can only be used by On-prem users.
284 */
285 pub async fn delete(
286 &self,
287 user_id: &str,
288 action: crate::types::UserDeleteAction,
289 transfer_email: &str,
290 transfer_meeting: bool,
291 transfer_webinar: bool,
292 transfer_recording: bool,
293 ) -> ClientResult<crate::Response<()>> {
294 let mut query_args: Vec<(String, String)> = Default::default();
295 if !action.to_string().is_empty() {
296 query_args.push(("action".to_string(), action.to_string()));
297 }
298 if !transfer_email.is_empty() {
299 query_args.push(("transfer_email".to_string(), transfer_email.to_string()));
300 }
301 if transfer_meeting {
302 query_args.push(("transfer_meeting".to_string(), transfer_meeting.to_string()));
303 }
304 if transfer_recording {
305 query_args.push((
306 "transfer_recording".to_string(),
307 transfer_recording.to_string(),
308 ));
309 }
310 if transfer_webinar {
311 query_args.push(("transfer_webinar".to_string(), transfer_webinar.to_string()));
312 }
313 let query_ = serde_urlencoded::to_string(&query_args).unwrap();
314 let url = self.client.url(
315 &format!(
316 "/users/{}?{}",
317 crate::progenitor_support::encode_path(user_id),
318 query_
319 ),
320 None,
321 );
322 self.client
323 .delete(
324 &url,
325 crate::Message {
326 body: None,
327 content_type: None,
328 },
329 )
330 .await
331 }
332 /**
333 * Update a user.
334 *
335 * This function performs a `PATCH` to the `/users/{userId}` endpoint.
336 *
337 * Update information on a user's [Zoom profile](https://support.zoom.us/hc/en-us/articles/201363203-My-Profile). For user-level apps, pass [the `me` value](https://marketplace.zoom.us/docs/api-reference/using-zoom-apis#mekeyword) instead of the `userId` parameter.
338 *
339 * **Scopes:** `user:write:admin` `user:write`<br>**[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Light`
340 *
341 * **Parameters:**
342 *
343 * * `user_id: &str` -- The user ID or email address of the user. For user-level apps, pass `me` as the value for userId.
344 * * `login_type: crate::types::LoginType` -- The user's login method:
345 *
346 * `0` — Facebook OAuth</br>`1` — Google OAuth</br>`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)
347 *
348 * The following login methods are only available in China:
349 *
350 * `11` — Phone number</br>`21` — WeChat</br>`23` — Alipay.
351 */
352 pub async fn update(
353 &self,
354 user_id: &str,
355 login_type: crate::types::LoginType,
356 body: &crate::types::UserUpdate,
357 ) -> ClientResult<crate::Response<()>> {
358 let mut query_args: Vec<(String, String)> = Default::default();
359 if !login_type.to_string().is_empty() {
360 query_args.push(("login_type".to_string(), login_type.to_string()));
361 }
362 let query_ = serde_urlencoded::to_string(&query_args).unwrap();
363 let url = self.client.url(
364 &format!(
365 "/users/{}?{}",
366 crate::progenitor_support::encode_path(user_id),
367 query_
368 ),
369 None,
370 );
371 self.client
372 .patch(
373 &url,
374 crate::Message {
375 body: Some(reqwest::Body::from(serde_json::to_vec(body)?)),
376 content_type: Some("application/json".to_string()),
377 },
378 )
379 .await
380 }
381 /**
382 * Get user's ZAK.
383 *
384 * This function performs a `GET` to the `/users/me/zak` endpoint.
385 *
386 * Get User’s Zoom Access Token (ZAK). You can use a ZAK to enable a non-login user to join a meeting on your app. Non-login users do not need to enter their username and password to join meetings.
387 *
388 * **Scope:** `user_zak:read`<br>
389 * **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Light`
390 *
391 *
392 */
393 pub async fn zak(&self) -> ClientResult<crate::Response<crate::types::UserZakResponse>> {
394 let url = self.client.url("/users/me/zak", None);
395 self.client
396 .get(
397 &url,
398 crate::Message {
399 body: None,
400 content_type: None,
401 },
402 )
403 .await
404 }
405 /**
406 * List user assistants.
407 *
408 * This function performs a `GET` to the `/users/{userId}/assistants` endpoint.
409 *
410 * List a user's assistants. For user-level apps, pass [the `me` value](https://marketplace.zoom.us/docs/api-reference/using-zoom-apis#mekeyword) instead of the `userId` parameter.
411 *
412 * Assistants are the users to whom the current user has assigned [scheduling privilege](https://support.zoom.us/hc/en-us/articles/201362803-Scheduling-Privilege). These assistants can schedule meeting on behalf of the current user as well as manage and act as an alternative host for all meetings if the admin has enabled [Co-host option](https://zoom.us/account/setting) on the account.
413 *
414 * **Scopes:** `user:read:admin`, `user:read`<br>**[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Medium`
415 *
416 * **Prerequisites:**
417 * * Current user as well as the assistant must have Licensed or an On-prem license.
418 * * Assistants must be under the current user's account.
419 *
420 * **Parameters:**
421 *
422 * * `user_id: &str` -- The user ID or email address of the user. For user-level apps, pass `me` as the value for userId.
423 */
424 pub async fn assistant(
425 &self,
426 user_id: &str,
427 ) -> ClientResult<crate::Response<crate::types::UserAssistantsList>> {
428 let url = self.client.url(
429 &format!(
430 "/users/{}/assistants",
431 crate::progenitor_support::encode_path(user_id),
432 ),
433 None,
434 );
435 self.client
436 .get(
437 &url,
438 crate::Message {
439 body: None,
440 content_type: None,
441 },
442 )
443 .await
444 }
445 /**
446 * Add assistants.
447 *
448 * This function performs a `POST` to the `/users/{userId}/assistants` endpoint.
449 *
450 * Use this API to assign assistants to a user. In the request body, provide either the user's ID or the user's email address. For user-level apps, pass [the `me` value](https://marketplace.zoom.us/docs/api-reference/using-zoom-apis#mekeyword) instead of the `userId` parameter.
451 *
452 * Assistants are the users to whom the current user has assigned [scheduling privilege](https://support.zoom.us/hc/en-us/articles/201362803-Scheduling-Privilege). These assistants can schedule meeting on behalf of the current user as well as manage and act as an alternative host for all meetings if the admin has enabled [Co-host option](https://zoom.us/account/setting) on the account.
453 *
454 * **Scopes:** `user:write:admin`, `user:write`</br>**[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Medium`
455 *
456 * **Prerequisites:**
457 * * The user as well as the assistant must have Licensed or an On-prem license.
458 * * Assistants must be under the current user's account.
459 *
460 * **Parameters:**
461 *
462 * * `user_id: &str` -- The user ID or email address of the user. For user-level apps, pass `me` as the value for userId.
463 */
464 pub async fn assistant_create(
465 &self,
466 user_id: &str,
467 body: &crate::types::UserAssistantsList,
468 ) -> ClientResult<crate::Response<crate::types::AddRoleMembersResponse>> {
469 let url = self.client.url(
470 &format!(
471 "/users/{}/assistants",
472 crate::progenitor_support::encode_path(user_id),
473 ),
474 None,
475 );
476 self.client
477 .post(
478 &url,
479 crate::Message {
480 body: Some(reqwest::Body::from(serde_json::to_vec(body)?)),
481 content_type: Some("application/json".to_string()),
482 },
483 )
484 .await
485 }
486 /**
487 * Delete user assistants.
488 *
489 * This function performs a `DELETE` to the `/users/{userId}/assistants` endpoint.
490 *
491 * Delete all assistants of the current user. For user-level apps, pass [the `me` value](https://marketplace.zoom.us/docs/api-reference/using-zoom-apis#mekeyword) instead of the `userId` parameter.
492 *
493 * Assistants are the users to whom the current user has assigned [scheduling privilege](https://support.zoom.us/hc/en-us/articles/201362803-Scheduling-Privilege). These assistants can schedule meeting on behalf of the current user as well as manage and act as an alternative host for all meetings if the admin has enabled [Co-host option](https://zoom.us/account/setting) on the account.
494 *
495 * **Scopes:** `user:write:admin`, `user:write`<br>**[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Light`
496 *
497 * **Prerequisites:**
498 * * The user as well as the assistant must have Licensed or an On-prem license.
499 * * Assistants must be under the current user's account.
500 *
501 * **Parameters:**
502 *
503 * * `user_id: &str` -- The user ID or email address of the user. For user-level apps, pass `me` as the value for userId.
504 */
505 pub async fn assistants_delete(&self, user_id: &str) -> ClientResult<crate::Response<()>> {
506 let url = self.client.url(
507 &format!(
508 "/users/{}/assistants",
509 crate::progenitor_support::encode_path(user_id),
510 ),
511 None,
512 );
513 self.client
514 .delete(
515 &url,
516 crate::Message {
517 body: None,
518 content_type: None,
519 },
520 )
521 .await
522 }
523 /**
524 * Delete a user assistant.
525 *
526 * This function performs a `DELETE` to the `/users/{userId}/assistants/{assistantId}` endpoint.
527 *
528 * Delete a specific assistant of a user. For user-level apps, pass [the `me` value](https://marketplace.zoom.us/docs/api-reference/using-zoom-apis#mekeyword) instead of the `userId` parameter.
529 *
530 * Assistants are the users to whom the current user has assigned [scheduling privilege](https://support.zoom.us/hc/en-us/articles/201362803-Scheduling-Privilege). These assistants can schedule meeting on behalf of the current user as well as manage and act as an alternative host for all meetings if the admin has enabled [Co-host option](https://zoom.us/account/setting) on the account.
531 *
532 * **Scopes:** `user:write:admin`, `user:write`</br>**[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Light`
533 *
534 * **Prerequisites:**
535 * * The user as well as the assistant must have Licensed or an On-prem license.
536 * * Assistants must be under the current user's account.
537 *
538 * **Parameters:**
539 *
540 * * `user_id: &str` -- The user ID or email address of the user. For user-level apps, pass `me` as the value for userId.
541 * * `assistant_id: &str` -- User's first name.
542 */
543 pub async fn assistant_delete(
544 &self,
545 user_id: &str,
546 assistant_id: &str,
547 ) -> ClientResult<crate::Response<()>> {
548 let url = self.client.url(
549 &format!(
550 "/users/{}/assistants/{}",
551 crate::progenitor_support::encode_path(user_id),
552 crate::progenitor_support::encode_path(assistant_id),
553 ),
554 None,
555 );
556 self.client
557 .delete(
558 &url,
559 crate::Message {
560 body: None,
561 content_type: None,
562 },
563 )
564 .await
565 }
566 /**
567 * List user schedulers.
568 *
569 * This function performs a `GET` to the `/users/{userId}/schedulers` endpoint.
570 *
571 * List all the schedulers of a user. For user-level apps, pass [the `me` value](https://marketplace.zoom.us/docs/api-reference/using-zoom-apis#mekeyword) instead of the `userId` parameter.
572 *
573 * Schedulers in this context are the users for whom the current user can schedule meetings for. For example, if the current user (the user whose `userId` was passed in the `path` parameter) is "user A", the response of this API will contain a list of user(s), for whom user A can schedule and manage meetings. User A is the assistant of these users and thus has scheduling privilege for these user(s).
574 *
575 * **Scopes:** `user:read:admin`, `user:read`<br>**[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Medium`
576 *
577 * **Prerequisites:**
578 * * Current user must be under the same account as the scheduler.
579 *
580 * **Parameters:**
581 *
582 * * `user_id: &str` -- The user ID or email address of the user. For user-level apps, pass `me` as the value for userId.
583 */
584 pub async fn scheduler(
585 &self,
586 user_id: &str,
587 ) -> ClientResult<crate::Response<crate::types::UserSchedulersList>> {
588 let url = self.client.url(
589 &format!(
590 "/users/{}/schedulers",
591 crate::progenitor_support::encode_path(user_id),
592 ),
593 None,
594 );
595 self.client
596 .get(
597 &url,
598 crate::Message {
599 body: None,
600 content_type: None,
601 },
602 )
603 .await
604 }
605 /**
606 * Delete user schedulers.
607 *
608 * This function performs a `DELETE` to the `/users/{userId}/schedulers` endpoint.
609 *
610 * Delete all of a user's schedulers. For user-level apps, pass [the `me` value](https://marketplace.zoom.us/docs/api-reference/using-zoom-apis#mekeyword) instead of the `userId` parameter.
611 *
612 * Schedulers are users on whose behalf the current user (assistant) can schedule meetings for. By calling this API, the current user will no longer be a scheduling assistant of any user.
613 *
614 * **Scopes:** `user:write:admin`, `user:write`</br>**[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Light`
615 *
616 * **Prerequisites:**
617 * * Current user (assistant) must be under the same account as the scheduler.
618 *
619 * **Parameters:**
620 *
621 * * `user_id: &str` -- The user ID or email address of the user. For user-level apps, pass `me` as the value for userId.
622 */
623 pub async fn schedulers_delete(&self, user_id: &str) -> ClientResult<crate::Response<()>> {
624 let url = self.client.url(
625 &format!(
626 "/users/{}/schedulers",
627 crate::progenitor_support::encode_path(user_id),
628 ),
629 None,
630 );
631 self.client
632 .delete(
633 &url,
634 crate::Message {
635 body: None,
636 content_type: None,
637 },
638 )
639 .await
640 }
641 /**
642 * Delete a scheduler.
643 *
644 * This function performs a `DELETE` to the `/users/{userId}/schedulers/{schedulerId}` endpoint.
645 *
646 * Delete a scheduler. For user-level apps, pass [the `me` value](https://marketplace.zoom.us/docs/api-reference/using-zoom-apis#mekeyword) instead of the `userId` parameter.
647 *
648 * Schedulers are users on whose behalf the current user (assistant) can schedule meetings for. By calling this API, the current user will no longer be a scheduling assistant of this scheduler.
649 *
650 * **Scopes:** `user:write:admin`, `user:write`</br>**[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Light`
651 *
652 * **Prerequisites:**
653 * * Current user must be under the same account as the scheduler.
654 *
655 * **Parameters:**
656 *
657 * * `user_id: &str` -- The user ID or email address of the user. For user-level apps, pass `me` as the value for userId.
658 * * `scheduler_id: &str` -- User's first name.
659 */
660 pub async fn scheduler_delete(
661 &self,
662 user_id: &str,
663 scheduler_id: &str,
664 ) -> ClientResult<crate::Response<()>> {
665 let url = self.client.url(
666 &format!(
667 "/users/{}/schedulers/{}",
668 crate::progenitor_support::encode_path(user_id),
669 crate::progenitor_support::encode_path(scheduler_id),
670 ),
671 None,
672 );
673 self.client
674 .delete(
675 &url,
676 crate::Message {
677 body: None,
678 content_type: None,
679 },
680 )
681 .await
682 }
683 /**
684 * Upload a user's profile picture.
685 *
686 * This function performs a `POST` to the `/users/{userId}/picture` endpoint.
687 *
688 * Upload a user's profile picture. For user-level apps, pass [the `me` value](https://marketplace.zoom.us/docs/api-reference/using-zoom-apis#mekeyword) instead of the `userId` parameter.
689 *
690 * Provide `multipart/form-data` as the value of the `content-type` header for this request. This API supports `.jpeg` and `.png` file formats.
691 *
692 * **Scopes:** `user:write:admin`, `user:write`<br>**[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Medium`
693 *
694 * **Parameters:**
695 *
696 * * `user_id: &str` -- The user ID or email address of the user. For user-level apps, pass `me` as the value for userId.
697 */
698 pub async fn picture(&self, user_id: &str) -> ClientResult<crate::Response<()>> {
699 let url = self.client.url(
700 &format!(
701 "/users/{}/picture",
702 crate::progenitor_support::encode_path(user_id),
703 ),
704 None,
705 );
706 self.client
707 .post(
708 &url,
709 crate::Message {
710 body: None,
711 content_type: Some("multipart/form-data".to_string()),
712 },
713 )
714 .await
715 }
716 /**
717 * Get user settings.
718 *
719 * This function performs a `GET` to the `/users/{userId}/settings` endpoint.
720 *
721 * Retrieve a user's settings. For user-level apps, pass [the `me` value](https://marketplace.zoom.us/docs/api-reference/using-zoom-apis#mekeyword) instead of the `userId` parameter.
722 *
723 * **Scopes:** `user:read:admin`, `user:read`<br>**[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Medium`
724 *
725 * **Parameters:**
726 *
727 * * `user_id: &str` -- The user ID or email address of the user. For user-level apps, pass `me` as the value for userId.
728 * * `login_type: crate::types::LoginType` -- The user's login method:
729 *
730 * `0` — Facebook OAuth</br>`1` — Google OAuth</br>`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)
731 *
732 * The following login methods are only available in China:
733 *
734 * `11` — Phone number</br>`21` — WeChat</br>`23` — Alipay.
735 * * `option: crate::types::OptionData` -- Use the following options to filter the results of the account's information:
736 * \* `meeting_authentication` — View the account's [meeting authentication settings](https://support.zoom.us/hc/en-us/articles/360037117472-Authentication-Profiles-for-Meetings-and-Webinars).
737 * \* `recording_authentication` — View the account's [recording authentication settings](https://support.zoom.us/hc/en-us/articles/360037756671-Authentication-Profiles-for-Cloud-Recordings).
738 * \* `security` — View the account's security settings. For example, password requirements for user login or two-factor authentication.<br>
739 * \* `meeting_security` — View the account's meeting security settings.
740 * * `custom_query_fields: &str` -- Provide the name of the field by which you would like to filter the response. For example, if you provide "host_video" as the value of this field, you will get a response similar to the following:<br>
741 * {
742 * "schedule_meeting": {
743 * "host_video": false
744 * }
745 * }
746 * <br>You can provide multiple values by separating them with commas(example: "host_video,participant_video”).
747 */
748 pub async fn settings_domains(
749 &self,
750 user_id: &str,
751 login_type: crate::types::LoginType,
752 option: crate::types::OptionData,
753 custom_query_fields: &str,
754 ) -> ClientResult<crate::Response<crate::types::Domains>> {
755 let mut query_args: Vec<(String, String)> = Default::default();
756 if !custom_query_fields.is_empty() {
757 query_args.push((
758 "custom_query_fields".to_string(),
759 custom_query_fields.to_string(),
760 ));
761 }
762 if !login_type.to_string().is_empty() {
763 query_args.push(("login_type".to_string(), login_type.to_string()));
764 }
765 if !option.to_string().is_empty() {
766 query_args.push(("option".to_string(), option.to_string()));
767 }
768 let query_ = serde_urlencoded::to_string(&query_args).unwrap();
769 let url = self.client.url(
770 &format!(
771 "/users/{}/settings?{}",
772 crate::progenitor_support::encode_path(user_id),
773 query_
774 ),
775 None,
776 );
777 self.client
778 .get(
779 &url,
780 crate::Message {
781 body: None,
782 content_type: None,
783 },
784 )
785 .await
786 }
787 /**
788 * Get user settings.
789 *
790 * This function performs a `GET` to the `/users/{userId}/settings` endpoint.
791 *
792 * Retrieve a user's settings. For user-level apps, pass [the `me` value](https://marketplace.zoom.us/docs/api-reference/using-zoom-apis#mekeyword) instead of the `userId` parameter.
793 *
794 * **Scopes:** `user:read:admin`, `user:read`<br>**[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Medium`
795 *
796 * **Parameters:**
797 *
798 * * `user_id: &str` -- The user ID or email address of the user. For user-level apps, pass `me` as the value for userId.
799 * * `login_type: crate::types::LoginType` -- The user's login method:
800 *
801 * `0` — Facebook OAuth</br>`1` — Google OAuth</br>`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)
802 *
803 * The following login methods are only available in China:
804 *
805 * `11` — Phone number</br>`21` — WeChat</br>`23` — Alipay.
806 * * `option: crate::types::OptionData` -- Use the following options to filter the results of the account's information:
807 * \* `meeting_authentication` — View the account's [meeting authentication settings](https://support.zoom.us/hc/en-us/articles/360037117472-Authentication-Profiles-for-Meetings-and-Webinars).
808 * \* `recording_authentication` — View the account's [recording authentication settings](https://support.zoom.us/hc/en-us/articles/360037756671-Authentication-Profiles-for-Cloud-Recordings).
809 * \* `security` — View the account's security settings. For example, password requirements for user login or two-factor authentication.<br>
810 * \* `meeting_security` — View the account's meeting security settings.
811 * * `custom_query_fields: &str` -- Provide the name of the field by which you would like to filter the response. For example, if you provide "host_video" as the value of this field, you will get a response similar to the following:<br>
812 * {
813 * "schedule_meeting": {
814 * "host_video": false
815 * }
816 * }
817 * <br>You can provide multiple values by separating them with commas(example: "host_video,participant_video”).
818 */
819 pub async fn settings_user(
820 &self,
821 user_id: &str,
822 login_type: crate::types::LoginType,
823 option: crate::types::OptionData,
824 custom_query_fields: &str,
825 ) -> ClientResult<crate::Response<crate::types::UserSettings>> {
826 let mut query_args: Vec<(String, String)> = Default::default();
827 if !custom_query_fields.is_empty() {
828 query_args.push((
829 "custom_query_fields".to_string(),
830 custom_query_fields.to_string(),
831 ));
832 }
833 if !login_type.to_string().is_empty() {
834 query_args.push(("login_type".to_string(), login_type.to_string()));
835 }
836 if !option.to_string().is_empty() {
837 query_args.push(("option".to_string(), option.to_string()));
838 }
839 let query_ = serde_urlencoded::to_string(&query_args).unwrap();
840 let url = self.client.url(
841 &format!(
842 "/users/{}/settings?{}",
843 crate::progenitor_support::encode_path(user_id),
844 query_
845 ),
846 None,
847 );
848 self.client
849 .get(
850 &url,
851 crate::Message {
852 body: None,
853 content_type: None,
854 },
855 )
856 .await
857 }
858 /**
859 * Get user settings.
860 *
861 * This function performs a `GET` to the `/users/{userId}/settings` endpoint.
862 *
863 * Retrieve a user's settings. For user-level apps, pass [the `me` value](https://marketplace.zoom.us/docs/api-reference/using-zoom-apis#mekeyword) instead of the `userId` parameter.
864 *
865 * **Scopes:** `user:read:admin`, `user:read`<br>**[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Medium`
866 *
867 * **Parameters:**
868 *
869 * * `user_id: &str` -- The user ID or email address of the user. For user-level apps, pass `me` as the value for userId.
870 * * `login_type: crate::types::LoginType` -- The user's login method:
871 *
872 * `0` — Facebook OAuth</br>`1` — Google OAuth</br>`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)
873 *
874 * The following login methods are only available in China:
875 *
876 * `11` — Phone number</br>`21` — WeChat</br>`23` — Alipay.
877 * * `option: crate::types::OptionData` -- Use the following options to filter the results of the account's information:
878 * \* `meeting_authentication` — View the account's [meeting authentication settings](https://support.zoom.us/hc/en-us/articles/360037117472-Authentication-Profiles-for-Meetings-and-Webinars).
879 * \* `recording_authentication` — View the account's [recording authentication settings](https://support.zoom.us/hc/en-us/articles/360037756671-Authentication-Profiles-for-Cloud-Recordings).
880 * \* `security` — View the account's security settings. For example, password requirements for user login or two-factor authentication.<br>
881 * \* `meeting_security` — View the account's meeting security settings.
882 * * `custom_query_fields: &str` -- Provide the name of the field by which you would like to filter the response. For example, if you provide "host_video" as the value of this field, you will get a response similar to the following:<br>
883 * {
884 * "schedule_meeting": {
885 * "host_video": false
886 * }
887 * }
888 * <br>You can provide multiple values by separating them with commas(example: "host_video,participant_video”).
889 */
890 pub async fn settings_meeting_security(
891 &self,
892 user_id: &str,
893 login_type: crate::types::LoginType,
894 option: crate::types::OptionData,
895 custom_query_fields: &str,
896 ) -> ClientResult<crate::Response<crate::types::MeetingSecuritySettings>> {
897 let mut query_args: Vec<(String, String)> = Default::default();
898 if !custom_query_fields.is_empty() {
899 query_args.push((
900 "custom_query_fields".to_string(),
901 custom_query_fields.to_string(),
902 ));
903 }
904 if !login_type.to_string().is_empty() {
905 query_args.push(("login_type".to_string(), login_type.to_string()));
906 }
907 if !option.to_string().is_empty() {
908 query_args.push(("option".to_string(), option.to_string()));
909 }
910 let query_ = serde_urlencoded::to_string(&query_args).unwrap();
911 let url = self.client.url(
912 &format!(
913 "/users/{}/settings?{}",
914 crate::progenitor_support::encode_path(user_id),
915 query_
916 ),
917 None,
918 );
919 self.client
920 .get(
921 &url,
922 crate::Message {
923 body: None,
924 content_type: None,
925 },
926 )
927 .await
928 }
929 /**
930 * Get user settings.
931 *
932 * This function performs a `GET` to the `/users/{userId}/settings` endpoint.
933 *
934 * Retrieve a user's settings. For user-level apps, pass [the `me` value](https://marketplace.zoom.us/docs/api-reference/using-zoom-apis#mekeyword) instead of the `userId` parameter.
935 *
936 * **Scopes:** `user:read:admin`, `user:read`<br>**[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Medium`
937 *
938 * **Parameters:**
939 *
940 * * `user_id: &str` -- The user ID or email address of the user. For user-level apps, pass `me` as the value for userId.
941 * * `login_type: crate::types::LoginType` -- The user's login method:
942 *
943 * `0` — Facebook OAuth</br>`1` — Google OAuth</br>`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)
944 *
945 * The following login methods are only available in China:
946 *
947 * `11` — Phone number</br>`21` — WeChat</br>`23` — Alipay.
948 * * `option: crate::types::OptionData` -- Use the following options to filter the results of the account's information:
949 * \* `meeting_authentication` — View the account's [meeting authentication settings](https://support.zoom.us/hc/en-us/articles/360037117472-Authentication-Profiles-for-Meetings-and-Webinars).
950 * \* `recording_authentication` — View the account's [recording authentication settings](https://support.zoom.us/hc/en-us/articles/360037756671-Authentication-Profiles-for-Cloud-Recordings).
951 * \* `security` — View the account's security settings. For example, password requirements for user login or two-factor authentication.<br>
952 * \* `meeting_security` — View the account's meeting security settings.
953 * * `custom_query_fields: &str` -- Provide the name of the field by which you would like to filter the response. For example, if you provide "host_video" as the value of this field, you will get a response similar to the following:<br>
954 * {
955 * "schedule_meeting": {
956 * "host_video": false
957 * }
958 * }
959 * <br>You can provide multiple values by separating them with commas(example: "host_video,participant_video”).
960 */
961 pub async fn setting(
962 &self,
963 user_id: &str,
964 login_type: crate::types::LoginType,
965 option: crate::types::OptionData,
966 custom_query_fields: &str,
967 ) -> ClientResult<crate::Response<crate::types::UserSettingsResponseOneOf>> {
968 let mut query_args: Vec<(String, String)> = Default::default();
969 if !custom_query_fields.is_empty() {
970 query_args.push((
971 "custom_query_fields".to_string(),
972 custom_query_fields.to_string(),
973 ));
974 }
975 if !login_type.to_string().is_empty() {
976 query_args.push(("login_type".to_string(), login_type.to_string()));
977 }
978 if !option.to_string().is_empty() {
979 query_args.push(("option".to_string(), option.to_string()));
980 }
981 let query_ = serde_urlencoded::to_string(&query_args).unwrap();
982 let url = self.client.url(
983 &format!(
984 "/users/{}/settings?{}",
985 crate::progenitor_support::encode_path(user_id),
986 query_
987 ),
988 None,
989 );
990 self.client
991 .get(
992 &url,
993 crate::Message {
994 body: None,
995 content_type: None,
996 },
997 )
998 .await
999 }
1000 /**
1001 * Update user settings.
1002 *
1003 * This function performs a `PATCH` to the `/users/{userId}/settings` endpoint.
1004 *
1005 * Update a user's settings. For user-level apps, pass [the `me` value](https://marketplace.zoom.us/docs/api-reference/using-zoom-apis#mekeyword) instead of the `userId` parameter.
1006 *
1007 * **Scopes:** `user:write:admin`, `user:write`<br>**[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Medium`
1008 *
1009 * **Parameters:**
1010 *
1011 * * `option: crate::types::UserSettingsUpdateOption`
1012 * * `user_id: &str` -- The user ID or email address of the user. For user-level apps, pass `me` as the value for userId.
1013 */
1014 pub async fn settings_update(
1015 &self,
1016 option: crate::types::UserSettingsUpdateOption,
1017 user_id: &str,
1018 body: &crate::types::UserSettingsUpdateRequestOneOf,
1019 ) -> ClientResult<crate::Response<()>> {
1020 let mut query_args: Vec<(String, String)> = Default::default();
1021 if !option.to_string().is_empty() {
1022 query_args.push(("option".to_string(), option.to_string()));
1023 }
1024 let query_ = serde_urlencoded::to_string(&query_args).unwrap();
1025 let url = self.client.url(
1026 &format!(
1027 "/users/{}/settings?{}",
1028 crate::progenitor_support::encode_path(user_id),
1029 query_
1030 ),
1031 None,
1032 );
1033 self.client
1034 .patch(
1035 &url,
1036 crate::Message {
1037 body: Some(reqwest::Body::from(serde_json::to_vec(body)?)),
1038 content_type: Some("application/json".to_string()),
1039 },
1040 )
1041 .await
1042 }
1043 /**
1044 * Update user status.
1045 *
1046 * This function performs a `PUT` to the `/users/{userId}/status` endpoint.
1047 *
1048 * Use this API to [deactivate](https://support.zoom.us/hc/en-us/articles/115005269946-Remove-User-from-your-Account#h_6a9bc1c3-d739-4945-b1f2-00b3b88fb5cc) an active user or to [reactivate](https://support.zoom.us/hc/en-us/articles/115005269946-Remove-User-from-your-Account#h_16319724-d120-4be6-af5d-31582d134ea0) a deactivated user. For user-level apps, pass [the `me` value](https://marketplace.zoom.us/docs/api-reference/using-zoom-apis#mekeyword) instead of the `userId` parameter.
1049 *
1050 * An account owner or admins can deactivate as well as activate a user in a Zoom account. Deactivating a user will remove all licenses associated with a user. It will prevent the deactivated user from logging into their Zoom account. A deactivated user can be reactivated. Reactivating a user grants the user access to login to their Zoom account.
1051 *
1052 * **Scopes:** `user:write:admin`, `user:write`<br>**[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Light`
1053 *
1054 * **Parameters:**
1055 *
1056 * * `user_id: &str` -- The user ID or email address of the user. For user-level apps, pass `me` as the value for userId.
1057 */
1058 pub async fn status(
1059 &self,
1060 user_id: &str,
1061 body: &crate::types::UserStatusRequest,
1062 ) -> ClientResult<crate::Response<()>> {
1063 let url = self.client.url(
1064 &format!(
1065 "/users/{}/status",
1066 crate::progenitor_support::encode_path(user_id),
1067 ),
1068 None,
1069 );
1070 self.client
1071 .put(
1072 &url,
1073 crate::Message {
1074 body: Some(reqwest::Body::from(serde_json::to_vec(body)?)),
1075 content_type: Some("application/json".to_string()),
1076 },
1077 )
1078 .await
1079 }
1080 /**
1081 * Update a user's password.
1082 *
1083 * This function performs a `PUT` to the `/users/{userId}/password` endpoint.
1084 *
1085 * Update the [password](https://support.zoom.us/hc/en-us/articles/206344385-Change-a-User-s-Password) of a user using which the user can login to Zoom. For user-level apps, pass [the `me` value](https://marketplace.zoom.us/docs/api-reference/using-zoom-apis#mekeyword) instead of the `userId` parameter.
1086 *
1087 * After this request is processed successfully, an email notification will be sent to the user stating that the password was changed.<br>
1088 * **Scopes:** `user:write:admin` `user:write`<br>
1089 *
1090 * **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Medium`
1091 * **Prerequisites:**<br>
1092 * * Owner or admin of the Zoom account.
1093 *
1094 * **Parameters:**
1095 *
1096 * * `user_id: &str` -- The user ID or email address of the user. For user-level apps, pass `me` as the value for userId.
1097 */
1098 pub async fn password(
1099 &self,
1100 user_id: &str,
1101 body: &crate::types::UserPasswordRequest,
1102 ) -> ClientResult<crate::Response<()>> {
1103 let url = self.client.url(
1104 &format!(
1105 "/users/{}/password",
1106 crate::progenitor_support::encode_path(user_id),
1107 ),
1108 None,
1109 );
1110 self.client
1111 .put(
1112 &url,
1113 crate::Message {
1114 body: Some(reqwest::Body::from(serde_json::to_vec(body)?)),
1115 content_type: Some("application/json".to_string()),
1116 },
1117 )
1118 .await
1119 }
1120 /**
1121 * Get user permissions.
1122 *
1123 * This function performs a `GET` to the `/users/{userId}/permissions` endpoint.
1124 *
1125 * Use this API to get permissions that have been granted to the user. For user-level apps, pass [the `me` value](https://marketplace.zoom.us/docs/api-reference/using-zoom-apis#mekeyword) instead of the `userId` parameter.
1126 *
1127 * Users can be assigned a set of permissions that allows them to access only the pages/information that a user needs to view or edit.
1128 *
1129 * **Scopes:** `user:read:admin`, `user:read`<br>**[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Light`
1130 *
1131 * **Parameters:**
1132 *
1133 * * `user_id: &str` -- The user ID or email address of the user. For user-level apps, pass `me` as the value for userId.
1134 */
1135 pub async fn permission(
1136 &self,
1137 user_id: &str,
1138 ) -> ClientResult<crate::Response<crate::types::UserPermissions>> {
1139 let url = self.client.url(
1140 &format!(
1141 "/users/{}/permissions",
1142 crate::progenitor_support::encode_path(user_id),
1143 ),
1144 None,
1145 );
1146 self.client
1147 .get(
1148 &url,
1149 crate::Message {
1150 body: None,
1151 content_type: None,
1152 },
1153 )
1154 .await
1155 }
1156 /**
1157 * Get a user token.
1158 *
1159 * This function performs a `GET` to the `/users/{userId}/token` endpoint.
1160 *
1161 * Retrieve a user's token. For user-level apps, pass [the `me` value](https://marketplace.zoom.us/docs/api-reference/using-zoom-apis#mekeyword) instead of the `userId` parameter.
1162 *
1163 * This token is used for starting meetings with the Client SDK. If a user signed into Zoom using Google or Facebook, a null value will be returned for the token. To get the token with this API, ask the user to sign into Zoom using their email and password instead.
1164 *
1165 * **Scopes:** `user:read:admin`, `user:read`<br>**[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Light`
1166 *
1167 * **Parameters:**
1168 *
1169 * * `user_id: &str` -- The user ID or email address of the user. For user-level apps, pass `me` as the value for userId.
1170 * * `type_: crate::types::UserTokenType` -- User token types:<br>`token` - Used for starting meetings with the client SDK. This token expires in 14 days and a new token will be returned after the expiry.<br>`zak` - Used for generating the start meeting URL. The token expiration time is two hours. For API users, the expiration time is 90 days.
1171 * * `ttl: i64` -- Use this field in conjunction with the `type` field where the value of `type` field is `zak`. The value of this field denotes the expiry time of the `zak` token in seconds. For example, if you would like the zak token to be expired after one hour of the token generation, the value of this field should be `3600`.
1172 */
1173 pub async fn token(
1174 &self,
1175 user_id: &str,
1176 type_: crate::types::UserTokenType,
1177 ttl: i64,
1178 ) -> ClientResult<crate::Response<crate::types::UserZakResponse>> {
1179 let mut query_args: Vec<(String, String)> = Default::default();
1180 if ttl > 0 {
1181 query_args.push(("ttl".to_string(), ttl.to_string()));
1182 }
1183 if !type_.to_string().is_empty() {
1184 query_args.push(("type".to_string(), type_.to_string()));
1185 }
1186 let query_ = serde_urlencoded::to_string(&query_args).unwrap();
1187 let url = self.client.url(
1188 &format!(
1189 "/users/{}/token?{}",
1190 crate::progenitor_support::encode_path(user_id),
1191 query_
1192 ),
1193 None,
1194 );
1195 self.client
1196 .get(
1197 &url,
1198 crate::Message {
1199 body: None,
1200 content_type: None,
1201 },
1202 )
1203 .await
1204 }
1205 /**
1206 * Revoke a user's SSO token.
1207 *
1208 * This function performs a `DELETE` to the `/users/{userId}/token` endpoint.
1209 *
1210 * Revoke a user's SSO token. For user-level apps, pass [the `me` value](https://marketplace.zoom.us/docs/api-reference/using-zoom-apis#mekeyword) instead of the `userId` parameter.
1211 *
1212 * After calling this API, the SSO user will be logged out of their current Zoom session.
1213 *
1214 * **Scopes:** `user:write:admin`, `user:write`<br>**[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Light`
1215 *
1216 * **Parameters:**
1217 *
1218 * * `user_id: &str` -- The user ID or email address of the user. For user-level apps, pass `me` as the value for userId.
1219 */
1220 pub async fn sso_token_delete(&self, user_id: &str) -> ClientResult<crate::Response<()>> {
1221 let url = self.client.url(
1222 &format!(
1223 "/users/{}/token",
1224 crate::progenitor_support::encode_path(user_id),
1225 ),
1226 None,
1227 );
1228 self.client
1229 .delete(
1230 &url,
1231 crate::Message {
1232 body: None,
1233 content_type: None,
1234 },
1235 )
1236 .await
1237 }
1238 /**
1239 * Check a user email.
1240 *
1241 * This function performs a `GET` to the `/users/email` endpoint.
1242 *
1243 * Verify if a user's email is registered with Zoom.<br><br>
1244 *
1245 * <b>Note: </b>You can successfully check if a user is a registered Zoom user only if the user **signed up for Zoom via email and is within your account.** If you provide an email address of a user who is not in your account, the value of "existed_email" parameter will be "false" irrespective of whether or not the user is registered with Zoom. The response of this API call will not include users who joined Zoom using options such as "Sign in with SSO", "Sign in with Google" or "Sign in with Facebook" even if they are in the same account as yours.
1246 *
1247 * **Scopes:** `user:read:admin` `user:read`
1248 *
1249 * **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Light`
1250 *
1251 *
1252 * **Parameters:**
1253 *
1254 * * `email: &str` -- The email address to be verified.
1255 */
1256 pub async fn email(
1257 &self,
1258 email: &str,
1259 ) -> ClientResult<crate::Response<crate::types::UserEmailResponse>> {
1260 let mut query_args: Vec<(String, String)> = Default::default();
1261 if !email.is_empty() {
1262 query_args.push(("email".to_string(), email.to_string()));
1263 }
1264 let query_ = serde_urlencoded::to_string(&query_args).unwrap();
1265 let url = self.client.url(&format!("/users/email?{}", query_), None);
1266 self.client
1267 .get(
1268 &url,
1269 crate::Message {
1270 body: None,
1271 content_type: None,
1272 },
1273 )
1274 .await
1275 }
1276 /**
1277 * Update a user's email.
1278 *
1279 * This function performs a `PUT` to the `/users/{userId}/email` endpoint.
1280 *
1281 * Change a user's [email address](https://support.zoom.us/hc/en-us/articles/201362563-How-Do-I-Change-the-Email-on-My-Account-) on a Zoom account that has managed domain set up. For user-level apps, pass [the `me` value](https://marketplace.zoom.us/docs/api-reference/using-zoom-apis#mekeyword) instead of the `userId` parameter.
1282 *
1283 * * If the Zoom account in which the user belongs has multiple [managed domains](https://support.zoom.us/hc/en-us/articles/203395207-What-is-Managed-Domain-), then the email to be updated **must** match one of the managed domains.
1284 * * A user's email address can **only** be changed for a maximum of 3 times in a day (24 hours).
1285 *
1286 * **Scopes:** `user:write:admin`, `user:write`<br>**[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Light`
1287 *
1288 * **Prerequisites:**
1289 * * Managed domain must be enabled in the account.
1290 * * The new email address should not already exist in Zoom.
1291 *
1292 * **Parameters:**
1293 *
1294 * * `user_id: &str` -- The user ID or email address of the user. For user-level apps, pass `me` as the value for userId.
1295 */
1296 pub async fn email_update(
1297 &self,
1298 user_id: &str,
1299 body: &crate::types::Members,
1300 ) -> ClientResult<crate::Response<()>> {
1301 let url = self.client.url(
1302 &format!(
1303 "/users/{}/email",
1304 crate::progenitor_support::encode_path(user_id),
1305 ),
1306 None,
1307 );
1308 self.client
1309 .put(
1310 &url,
1311 crate::Message {
1312 body: Some(reqwest::Body::from(serde_json::to_vec(body)?)),
1313 content_type: Some("application/json".to_string()),
1314 },
1315 )
1316 .await
1317 }
1318 /**
1319 * Check a user's PM room.
1320 *
1321 * This function performs a `GET` to the `/users/vanity_name` endpoint.
1322 *
1323 * A personal meeting room is a virtual meeting room that can be permanently assigned to a user.
1324 * Use this API to check if a personal meeting room with the given name exists or not.<br><br>
1325 * **Scopes:** `user:read:admin` `user:read`<br>
1326 *
1327 * **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Light`
1328 *
1329 * **Parameters:**
1330 *
1331 * * `vanity_name: &str` -- Personal meeting room name.
1332 */
1333 pub async fn vanity_name(
1334 &self,
1335 vanity_name: &str,
1336 ) -> ClientResult<crate::Response<crate::types::UserVanityNameResponse>> {
1337 let mut query_args: Vec<(String, String)> = Default::default();
1338 if !vanity_name.is_empty() {
1339 query_args.push(("vanity_name".to_string(), vanity_name.to_string()));
1340 }
1341 let query_ = serde_urlencoded::to_string(&query_args).unwrap();
1342 let url = self
1343 .client
1344 .url(&format!("/users/vanity_name?{}", query_), None);
1345 self.client
1346 .get(
1347 &url,
1348 crate::Message {
1349 body: None,
1350 content_type: None,
1351 },
1352 )
1353 .await
1354 }
1355 /**
1356 * Switch a user's account.
1357 *
1358 * This function performs a `PUT` to the `/accounts/{accountId}/users/{userId}/account` endpoint.
1359 *
1360 * Disassociate a user from one Account and move the user to another Account under the same master account.
1361 *
1362 * With this API, a user under a master account or a sub account can be moved to another sub account within the same master account. To move a user from a master account to a sub account, use `me` as the value for `accountId`. In this scenario, "me" refers to the Account ID of the master account.
1363 *
1364 * To move a user from one sub account to another sub account, provide the sub account's Account ID as the value for `accountId`.
1365 *
1366 * **Prerequisites**:
1367 * * The account should have Pro or a higher plan with master account option enabled.
1368 * * The user whose account needs to be switched should not be an admin or an owner of that account.
1369 * * The user should not have the same [managed domain](https://support.zoom.us/hc/en-us/articles/203395207-What-is-Managed-Domain-) as the account owner.
1370 *
1371 * **Scope:** `user:master`<br>
1372 *
1373 * **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Light`
1374 *
1375 * **Parameters:**
1376 *
1377 * * `account_id: &str` -- User's first name.
1378 */
1379 pub async fn switch_account(
1380 &self,
1381 account_id: &str,
1382 user_id: &str,
1383 body: &crate::types::SwitchUserAccountRequest,
1384 ) -> ClientResult<crate::Response<()>> {
1385 let url = self.client.url(
1386 &format!(
1387 "/accounts/{}/users/{}/account",
1388 crate::progenitor_support::encode_path(account_id),
1389 crate::progenitor_support::encode_path(user_id),
1390 ),
1391 None,
1392 );
1393 self.client
1394 .put(
1395 &url,
1396 crate::Message {
1397 body: Some(reqwest::Body::from(serde_json::to_vec(body)?)),
1398 content_type: Some("application/json".to_string()),
1399 },
1400 )
1401 .await
1402 }
1403 /**
1404 * Update a user's presence status.
1405 *
1406 * This function performs a `PUT` to the `/users/{userId}/presence_status` endpoint.
1407 *
1408 * Use this API to update a user's presence status. For user-level apps, pass [the `me` value](https://marketplace.zoom.us/docs/api-reference/using-zoom-apis#mekeyword) instead of the `userId` parameter.
1409 *
1410 * A user's status **cannot** be updated more than once per minute. For example, you can only submit a maximum of one update request per minute for a single user.
1411 *
1412 * Users in the Zoom desktop client and mobile apps are assigned with a [presence status](https://support.zoom.us/hc/en-us/articles/360032554051-Status-Icons). The presence status informs users of their contact's availability. Users can also change their own presence status to one the following:
1413 * * **Away**
1414 * * **Do not disturb**
1415 * * **Available**
1416 * * **In a calendar event**
1417 * * **Presenting**
1418 * * **In a Zoom meeting**
1419 * * **On a call**
1420 *
1421 * Note that a user's presence status **cannot** be updated via this API if the user is not logged in to the Zoom client.
1422 *
1423 * **Scopes:** `user:write`, `user:write:admin`<br>**[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Medium`
1424 */
1425 pub async fn update_presence_status(
1426 &self,
1427 user_id: &str,
1428 body: &crate::types::UpdatePresenceStatusRequestData,
1429 ) -> ClientResult<crate::Response<()>> {
1430 let url = self.client.url(
1431 &format!(
1432 "/users/{}/presence_status",
1433 crate::progenitor_support::encode_path(user_id),
1434 ),
1435 None,
1436 );
1437 self.client
1438 .put(
1439 &url,
1440 crate::Message {
1441 body: Some(reqwest::Body::from(serde_json::to_vec(body)?)),
1442 content_type: Some("application/json".to_string()),
1443 },
1444 )
1445 .await
1446 }
1447 /**
1448 * Upload virtual background files.
1449 *
1450 * This function performs a `POST` to the `/users/{userId}/settings/virtual_backgrounds` endpoint.
1451 *
1452 * Use this API to [upload virtual background files](https://support.zoom.us/hc/en-us/articles/210707503-Virtual-Background) to a user's profile. For user-level apps, pass [the `me` value](https://marketplace.zoom.us/docs/api-reference/using-zoom-apis#mekeyword) instead of the `userId` parameter.
1453 *
1454 * > **Note:** A user profile cannot exceed more than 10 files.
1455 *
1456 * **Scopes:** `user:write:admin`
1457 * **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Medium`
1458 *
1459 * **Prerequisites:**
1460 * * Virtual background feature must be [enabled](https://support.zoom.us/hc/en-us/articles/210707503-Virtual-Background#h_2ef28080-fce9-4ac2-b567-dc958afab1b7) on the account.
1461 *
1462 * **Parameters:**
1463 *
1464 * * `user_id: &str` -- Unique identifier of the user. Retrieve the value for this field by calling the [List users](https://marketplace.zoom.us/docs/api-reference/zoom-api/users/users) API.
1465 */
1466 pub async fn upload_v_buser(
1467 &self,
1468 user_id: &str,
1469 body: &crate::types::UploadVbRequest,
1470 ) -> ClientResult<crate::Response<crate::types::Files>> {
1471 let url = self.client.url(
1472 &format!(
1473 "/users/{}/settings/virtual_backgrounds",
1474 crate::progenitor_support::encode_path(user_id),
1475 ),
1476 None,
1477 );
1478 self.client
1479 .post(
1480 &url,
1481 crate::Message {
1482 body: Some(reqwest::Body::from(serde_json::to_vec(body)?)),
1483 content_type: None,
1484 },
1485 )
1486 .await
1487 }
1488 /**
1489 * Delete virtual background files.
1490 *
1491 * This function performs a `DELETE` to the `/users/{userId}/settings/virtual_backgrounds` endpoint.
1492 *
1493 * Delete existing virtual background file(s) of a user. For user-level apps, pass [the `me` value](https://marketplace.zoom.us/docs/api-reference/using-zoom-apis#mekeyword) instead of the `userId` parameter.
1494 *
1495 * **Scopes:** `user:write:admin`<br>**[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Light`
1496 *
1497 * **Prerequisites:**
1498 * * Virtual background feature must be [enabled](https://support.zoom.us/hc/en-us/articles/210707503-Virtual-Background#h_2ef28080-fce9-4ac2-b567-dc958afab1b7) on the account.
1499 *
1500 * **Parameters:**
1501 *
1502 * * `file_ids: &str` -- Provide the id of the file that is to be deleted. To delete multiple files, provide comma separated values for this field.
1503 * * `user_id: &str` -- Unique identifier of the user. Retrieve the value of this field by calling the [List users](https://marketplace.zoom.us/docs/api-reference/zoom-api/users/users) API. .
1504 */
1505 pub async fn del_vb(&self, user_id: &str, file_ids: &str) -> ClientResult<crate::Response<()>> {
1506 let mut query_args: Vec<(String, String)> = Default::default();
1507 if !file_ids.is_empty() {
1508 query_args.push(("file_ids".to_string(), file_ids.to_string()));
1509 }
1510 let query_ = serde_urlencoded::to_string(&query_args).unwrap();
1511 let url = self.client.url(
1512 &format!(
1513 "/users/{}/settings/virtual_backgrounds?{}",
1514 crate::progenitor_support::encode_path(user_id),
1515 query_
1516 ),
1517 None,
1518 );
1519 self.client
1520 .delete(
1521 &url,
1522 crate::Message {
1523 body: None,
1524 content_type: None,
1525 },
1526 )
1527 .await
1528 }
1529}