zoom_api/
accounts.rs

1use crate::Client;
2use crate::ClientResult;
3
4pub struct Accounts {
5    pub client: Client,
6}
7
8impl Accounts {
9    #[doc(hidden)]
10    pub fn new(client: Client) -> Self {
11        Accounts { client }
12    }
13
14    /**
15     * List sub accounts.
16     *
17     * This function performs a `GET` to the `/accounts` endpoint.
18     *
19     * List all the sub accounts that have been created by a master account.<br><br>Zoom allows only [approved partners](https://marketplace.zoom.us/docs/api-reference/master-account-apis) to use master APIs and manage sub accounts. Email the partner programs team at **partner-success@zoom.us** for more details.
20     *
21     * <br>**Prerequisites:**<br>
22     * * Pro or a higher paid account with master account option enabled. <br>
23     *
24     * **Scope**: `account:read:admin`
25     * <br>**[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Medium`<br>
26     *
27     *
28     *
29     * **Parameters:**
30     *
31     * * `page_size: i64` -- The number of records returned within a single API call.
32     * * `page_number: i64` --
33     *   **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.
34     *   
35     *   The page number of the current page in the returned records.
36     * * `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.
37     */
38    pub async fn get(
39        &self,
40        page_size: i64,
41        page_number: i64,
42        next_page_token: &str,
43    ) -> ClientResult<crate::Response<crate::types::Domains>> {
44        let mut query_args: Vec<(String, String)> = Default::default();
45        if !next_page_token.is_empty() {
46            query_args.push(("next_page_token".to_string(), next_page_token.to_string()));
47        }
48        if page_number > 0 {
49            query_args.push(("page_number".to_string(), page_number.to_string()));
50        }
51        if page_size > 0 {
52            query_args.push(("page_size".to_string(), page_size.to_string()));
53        }
54        let query_ = serde_urlencoded::to_string(&query_args).unwrap();
55        let url = self.client.url(&format!("/accounts?{}", query_), None);
56        self.client
57            .get(
58                &url,
59                crate::Message {
60                    body: None,
61                    content_type: None,
62                },
63            )
64            .await
65    }
66    /**
67     * Create a sub account.
68     *
69     * This function performs a `POST` to the `/accounts` endpoint.
70     *
71     * Create a sub account under a master account. Your account must be a master account in order to create sub accounts.
72     * <br><br>Zoom allows only [approved partners](https://marketplace.zoom.us/docs/api-reference/master-account-apis) to use master APIs and manage sub accounts. Email the partner programs team at partner-success@zoom.us. for more details. Please note that the created account user will receive a confirmation email.<br><br>
73     * <br>
74     * **Prerequisites:**<br>
75     * * Pro or a higher paid account with master account option enabled. <br>
76     *
77     * **Scope**: `account:write:admin`<br>
78     * **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Light`<br>
79     *
80     *
81     *  
82     */
83    pub async fn create(
84        &self,
85        body: &crate::types::AccountCreateRequest,
86    ) -> ClientResult<crate::Response<crate::types::AccountCreateResponse>> {
87        let url = self.client.url("/accounts", None);
88        self.client
89            .post(
90                &url,
91                crate::Message {
92                    body: Some(reqwest::Body::from(serde_json::to_vec(body)?)),
93                    content_type: Some("application/json".to_string()),
94                },
95            )
96            .await
97    }
98    /**
99     * Get sub account details.
100     *
101     * This function performs a `GET` to the `/accounts/{accountId}` endpoint.
102     *
103     * Get details of a sub account that is listed under a master account. Your account must be a master account in order to retrieve sub accounts' details. Zoom allows only [approved partners](https://marketplace.zoom.us/docs/api-reference/master-account-apis) to use master APIs and create sub accounts. Email the partner programs team at **partner-success@zoom.us** for more details.
104     *
105     * **Prerequisites:**
106     * * Pro or a higher paid account with master account option enabled. <br>
107     *
108     * **Scope**: `account:write:admin`<br>
109     * **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Light`<br>
110     *
111     *
112     *  
113     *
114     *
115     * **Parameters:**
116     *
117     * * `account_id: &str` -- User's first name.
118     */
119    pub async fn account(
120        &self,
121        account_id: &str,
122    ) -> ClientResult<crate::Response<crate::types::AccountResponse>> {
123        let url = self.client.url(
124            &format!(
125                "/accounts/{}",
126                crate::progenitor_support::encode_path(account_id),
127            ),
128            None,
129        );
130        self.client
131            .get(
132                &url,
133                crate::Message {
134                    body: None,
135                    content_type: None,
136                },
137            )
138            .await
139    }
140    /**
141     * Disassociate a sub account.
142     *
143     * This function performs a `DELETE` to the `/accounts/{accountId}` endpoint.
144     *
145     * Disassociate a sub account from its master account. This will leave the sub account intact but it will no longer be associated with the master account.<br>  
146     *
147     * **Prerequisites:**
148     * * Pro or a higher paid account with master account option enabled. <br>
149     * * The account making this API request must be a [master account](https://marketplace.zoom.us/docs/api-reference/master-account-apis).<br><br>
150     *
151     *
152     * **Scope**: `account:write:admin`<br>
153     * **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Light`<br>
154     *
155     *
156     *  
157     *
158     * **Parameters:**
159     *
160     * * `account_id: &str` -- User's first name.
161     */
162    pub async fn disassociate(&self, account_id: &str) -> ClientResult<crate::Response<()>> {
163        let url = self.client.url(
164            &format!(
165                "/accounts/{}",
166                crate::progenitor_support::encode_path(account_id),
167            ),
168            None,
169        );
170        self.client
171            .delete(
172                &url,
173                crate::Message {
174                    body: None,
175                    content_type: None,
176                },
177            )
178            .await
179    }
180    /**
181     * Update options.
182     *
183     * This function performs a `PATCH` to the `/accounts/{accountId}/options` endpoint.
184     *
185     * Update a sub account's options under the master account.<br> <aside>Your account must be a master account in order to update the options for sub accounts. Zoom only assigns this privilege to trusted partners. </aside>
186     *
187     * **Prerequisites:**
188     * * Pro or a higher paid account with master account option enabled.
189     * * The account making this API request must be a [master account](https://marketplace.zoom.us/docs/api-reference/master-account-apis).<br><br>
190     *
191     * **Scope**: `account:write:admin`<br>
192     * **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Light`<br>
193     *
194     *
195     *  
196     *
197     * **Parameters:**
198     *
199     * * `account_id: &str` -- User's first name.
200     */
201    pub async fn options_update(
202        &self,
203        account_id: &str,
204        body: &crate::types::Options,
205    ) -> ClientResult<crate::Response<()>> {
206        let url = self.client.url(
207            &format!(
208                "/accounts/{}/options",
209                crate::progenitor_support::encode_path(account_id),
210            ),
211            None,
212        );
213        self.client
214            .patch(
215                &url,
216                crate::Message {
217                    body: Some(reqwest::Body::from(serde_json::to_vec(body)?)),
218                    content_type: Some("application/json".to_string()),
219                },
220            )
221            .await
222    }
223    /**
224     * Get settings.
225     *
226     * This function performs a `GET` to the `/accounts/{accountId}/settings` endpoint.
227     *
228     * Use this API to get an account's settings information.
229     *
230     * To get the settings of a master account, use `me` as the value for the `accountId` path parameter.
231     *
232     * **Scopes:** `account:read:admin`<br>**[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Medium`
233     *
234     * **Prerequisites**:
235     * * The account must be a paid account
236     *
237     * **Parameters:**
238     *
239     * * `account_id: &str` -- User's first name.
240     * * `option: crate::types::OptionData` -- Use the following options to filter the results of the account's information:
241     *  \* `meeting_authentication` — View the account's [meeting authentication settings](https://support.zoom.us/hc/en-us/articles/360037117472-Authentication-Profiles-for-Meetings-and-Webinars).
242     *  \* `recording_authentication` — View the account's [recording authentication settings](https://support.zoom.us/hc/en-us/articles/360037756671-Authentication-Profiles-for-Cloud-Recordings).
243     *  \* `security` — View the account's security settings. For example, password requirements for user login or two-factor authentication.<br>
244     *  \* `meeting_security` — View the account's meeting security settings.
245     * * `custom_query_fields: &str` -- The name of the field by which to filter the response. For example, if you provide the `host_video` value for this field, you will get a response similar to the following:
246     *   
247     *   `{ "schedule_meeting": { "host_video": false    } }`
248     *   
249     *   To use multiple values, comma-separate each value. For example: `host_video,participant_video`.
250     */
251    pub async fn settings_domains(
252        &self,
253        account_id: &str,
254        option: crate::types::OptionData,
255        custom_query_fields: &str,
256    ) -> ClientResult<crate::Response<crate::types::Domains>> {
257        let mut query_args: Vec<(String, String)> = Default::default();
258        if !custom_query_fields.is_empty() {
259            query_args.push((
260                "custom_query_fields".to_string(),
261                custom_query_fields.to_string(),
262            ));
263        }
264        if !option.to_string().is_empty() {
265            query_args.push(("option".to_string(), option.to_string()));
266        }
267        let query_ = serde_urlencoded::to_string(&query_args).unwrap();
268        let url = self.client.url(
269            &format!(
270                "/accounts/{}/settings?{}",
271                crate::progenitor_support::encode_path(account_id),
272                query_
273            ),
274            None,
275        );
276        self.client
277            .get(
278                &url,
279                crate::Message {
280                    body: None,
281                    content_type: None,
282                },
283            )
284            .await
285    }
286    /**
287     * Get settings.
288     *
289     * This function performs a `GET` to the `/accounts/{accountId}/settings` endpoint.
290     *
291     * Use this API to get an account's settings information.
292     *
293     * To get the settings of a master account, use `me` as the value for the `accountId` path parameter.
294     *
295     * **Scopes:** `account:read:admin`<br>**[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Medium`
296     *
297     * **Prerequisites**:
298     * * The account must be a paid account
299     *
300     * **Parameters:**
301     *
302     * * `account_id: &str` -- User's first name.
303     * * `option: crate::types::OptionData` -- Use the following options to filter the results of the account's information:
304     *  \* `meeting_authentication` — View the account's [meeting authentication settings](https://support.zoom.us/hc/en-us/articles/360037117472-Authentication-Profiles-for-Meetings-and-Webinars).
305     *  \* `recording_authentication` — View the account's [recording authentication settings](https://support.zoom.us/hc/en-us/articles/360037756671-Authentication-Profiles-for-Cloud-Recordings).
306     *  \* `security` — View the account's security settings. For example, password requirements for user login or two-factor authentication.<br>
307     *  \* `meeting_security` — View the account's meeting security settings.
308     * * `custom_query_fields: &str` -- The name of the field by which to filter the response. For example, if you provide the `host_video` value for this field, you will get a response similar to the following:
309     *   
310     *   `{ "schedule_meeting": { "host_video": false    } }`
311     *   
312     *   To use multiple values, comma-separate each value. For example: `host_video,participant_video`.
313     */
314    pub async fn settings_security(
315        &self,
316        account_id: &str,
317        option: crate::types::OptionData,
318        custom_query_fields: &str,
319    ) -> ClientResult<crate::Response<crate::types::Security>> {
320        let mut query_args: Vec<(String, String)> = Default::default();
321        if !custom_query_fields.is_empty() {
322            query_args.push((
323                "custom_query_fields".to_string(),
324                custom_query_fields.to_string(),
325            ));
326        }
327        if !option.to_string().is_empty() {
328            query_args.push(("option".to_string(), option.to_string()));
329        }
330        let query_ = serde_urlencoded::to_string(&query_args).unwrap();
331        let url = self.client.url(
332            &format!(
333                "/accounts/{}/settings?{}",
334                crate::progenitor_support::encode_path(account_id),
335                query_
336            ),
337            None,
338        );
339        self.client
340            .get(
341                &url,
342                crate::Message {
343                    body: None,
344                    content_type: None,
345                },
346            )
347            .await
348    }
349    /**
350     * Get settings.
351     *
352     * This function performs a `GET` to the `/accounts/{accountId}/settings` endpoint.
353     *
354     * Use this API to get an account's settings information.
355     *
356     * To get the settings of a master account, use `me` as the value for the `accountId` path parameter.
357     *
358     * **Scopes:** `account:read:admin`<br>**[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Medium`
359     *
360     * **Prerequisites**:
361     * * The account must be a paid account
362     *
363     * **Parameters:**
364     *
365     * * `account_id: &str` -- User's first name.
366     * * `option: crate::types::OptionData` -- Use the following options to filter the results of the account's information:
367     *  \* `meeting_authentication` — View the account's [meeting authentication settings](https://support.zoom.us/hc/en-us/articles/360037117472-Authentication-Profiles-for-Meetings-and-Webinars).
368     *  \* `recording_authentication` — View the account's [recording authentication settings](https://support.zoom.us/hc/en-us/articles/360037756671-Authentication-Profiles-for-Cloud-Recordings).
369     *  \* `security` — View the account's security settings. For example, password requirements for user login or two-factor authentication.<br>
370     *  \* `meeting_security` — View the account's meeting security settings.
371     * * `custom_query_fields: &str` -- The name of the field by which to filter the response. For example, if you provide the `host_video` value for this field, you will get a response similar to the following:
372     *   
373     *   `{ "schedule_meeting": { "host_video": false    } }`
374     *   
375     *   To use multiple values, comma-separate each value. For example: `host_video,participant_video`.
376     */
377    pub async fn settings_account(
378        &self,
379        account_id: &str,
380        option: crate::types::OptionData,
381        custom_query_fields: &str,
382    ) -> ClientResult<crate::Response<crate::types::AccountSettings>> {
383        let mut query_args: Vec<(String, String)> = Default::default();
384        if !custom_query_fields.is_empty() {
385            query_args.push((
386                "custom_query_fields".to_string(),
387                custom_query_fields.to_string(),
388            ));
389        }
390        if !option.to_string().is_empty() {
391            query_args.push(("option".to_string(), option.to_string()));
392        }
393        let query_ = serde_urlencoded::to_string(&query_args).unwrap();
394        let url = self.client.url(
395            &format!(
396                "/accounts/{}/settings?{}",
397                crate::progenitor_support::encode_path(account_id),
398                query_
399            ),
400            None,
401        );
402        self.client
403            .get(
404                &url,
405                crate::Message {
406                    body: None,
407                    content_type: None,
408                },
409            )
410            .await
411    }
412    /**
413     * Get settings.
414     *
415     * This function performs a `GET` to the `/accounts/{accountId}/settings` endpoint.
416     *
417     * Use this API to get an account's settings information.
418     *
419     * To get the settings of a master account, use `me` as the value for the `accountId` path parameter.
420     *
421     * **Scopes:** `account:read:admin`<br>**[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Medium`
422     *
423     * **Prerequisites**:
424     * * The account must be a paid account
425     *
426     * **Parameters:**
427     *
428     * * `account_id: &str` -- User's first name.
429     * * `option: crate::types::OptionData` -- Use the following options to filter the results of the account's information:
430     *  \* `meeting_authentication` — View the account's [meeting authentication settings](https://support.zoom.us/hc/en-us/articles/360037117472-Authentication-Profiles-for-Meetings-and-Webinars).
431     *  \* `recording_authentication` — View the account's [recording authentication settings](https://support.zoom.us/hc/en-us/articles/360037756671-Authentication-Profiles-for-Cloud-Recordings).
432     *  \* `security` — View the account's security settings. For example, password requirements for user login or two-factor authentication.<br>
433     *  \* `meeting_security` — View the account's meeting security settings.
434     * * `custom_query_fields: &str` -- The name of the field by which to filter the response. For example, if you provide the `host_video` value for this field, you will get a response similar to the following:
435     *   
436     *   `{ "schedule_meeting": { "host_video": false    } }`
437     *   
438     *   To use multiple values, comma-separate each value. For example: `host_video,participant_video`.
439     */
440    pub async fn settings_meeting_security(
441        &self,
442        account_id: &str,
443        option: crate::types::OptionData,
444        custom_query_fields: &str,
445    ) -> ClientResult<crate::Response<crate::types::MeetingSecuritySettings>> {
446        let mut query_args: Vec<(String, String)> = Default::default();
447        if !custom_query_fields.is_empty() {
448            query_args.push((
449                "custom_query_fields".to_string(),
450                custom_query_fields.to_string(),
451            ));
452        }
453        if !option.to_string().is_empty() {
454            query_args.push(("option".to_string(), option.to_string()));
455        }
456        let query_ = serde_urlencoded::to_string(&query_args).unwrap();
457        let url = self.client.url(
458            &format!(
459                "/accounts/{}/settings?{}",
460                crate::progenitor_support::encode_path(account_id),
461                query_
462            ),
463            None,
464        );
465        self.client
466            .get(
467                &url,
468                crate::Message {
469                    body: None,
470                    content_type: None,
471                },
472            )
473            .await
474    }
475    /**
476     * Get settings.
477     *
478     * This function performs a `GET` to the `/accounts/{accountId}/settings` endpoint.
479     *
480     * Use this API to get an account's settings information.
481     *
482     * To get the settings of a master account, use `me` as the value for the `accountId` path parameter.
483     *
484     * **Scopes:** `account:read:admin`<br>**[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Medium`
485     *
486     * **Prerequisites**:
487     * * The account must be a paid account
488     *
489     * **Parameters:**
490     *
491     * * `account_id: &str` -- User's first name.
492     * * `option: crate::types::OptionData` -- Use the following options to filter the results of the account's information:
493     *  \* `meeting_authentication` — View the account's [meeting authentication settings](https://support.zoom.us/hc/en-us/articles/360037117472-Authentication-Profiles-for-Meetings-and-Webinars).
494     *  \* `recording_authentication` — View the account's [recording authentication settings](https://support.zoom.us/hc/en-us/articles/360037756671-Authentication-Profiles-for-Cloud-Recordings).
495     *  \* `security` — View the account's security settings. For example, password requirements for user login or two-factor authentication.<br>
496     *  \* `meeting_security` — View the account's meeting security settings.
497     * * `custom_query_fields: &str` -- The name of the field by which to filter the response. For example, if you provide the `host_video` value for this field, you will get a response similar to the following:
498     *   
499     *   `{ "schedule_meeting": { "host_video": false    } }`
500     *   
501     *   To use multiple values, comma-separate each value. For example: `host_video,participant_video`.
502     */
503    pub async fn setting(
504        &self,
505        account_id: &str,
506        option: crate::types::OptionData,
507        custom_query_fields: &str,
508    ) -> ClientResult<crate::Response<crate::types::AccountSettingsResponseOneOf>> {
509        let mut query_args: Vec<(String, String)> = Default::default();
510        if !custom_query_fields.is_empty() {
511            query_args.push((
512                "custom_query_fields".to_string(),
513                custom_query_fields.to_string(),
514            ));
515        }
516        if !option.to_string().is_empty() {
517            query_args.push(("option".to_string(), option.to_string()));
518        }
519        let query_ = serde_urlencoded::to_string(&query_args).unwrap();
520        let url = self.client.url(
521            &format!(
522                "/accounts/{}/settings?{}",
523                crate::progenitor_support::encode_path(account_id),
524                query_
525            ),
526            None,
527        );
528        self.client
529            .get(
530                &url,
531                crate::Message {
532                    body: None,
533                    content_type: None,
534                },
535            )
536            .await
537    }
538    /**
539     * Update settings.
540     *
541     * This function performs a `PATCH` to the `/accounts/{accountId}/settings` endpoint.
542     *
543     * Update the settings of a sub account that is under a master account.<br> To update the settings of the master account, use `me` as the value of the `accountId` path parameter.<br><br>
544     * **Prerequisites**:
545     *  * The sub account must be a paid account.<br>
546     * **Scopes**: `account:write:admin`
547     * <br>
548     * **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Medium`
549     *
550     * **Parameters:**
551     *
552     * * `account_id: &str` -- User's first name.
553     * * `option: crate::types::AccountSettingsUpdateOption`
554     */
555    pub async fn settings_update(
556        &self,
557        account_id: &str,
558        option: crate::types::AccountSettingsUpdateOption,
559        body: &crate::types::AccountSettingsUpdateRequestOneOf,
560    ) -> ClientResult<crate::Response<()>> {
561        let mut query_args: Vec<(String, String)> = Default::default();
562        if !option.to_string().is_empty() {
563            query_args.push(("option".to_string(), option.to_string()));
564        }
565        let query_ = serde_urlencoded::to_string(&query_args).unwrap();
566        let url = self.client.url(
567            &format!(
568                "/accounts/{}/settings?{}",
569                crate::progenitor_support::encode_path(account_id),
570                query_
571            ),
572            None,
573        );
574        self.client
575            .patch(
576                &url,
577                crate::Message {
578                    body: Some(reqwest::Body::from(serde_json::to_vec(body)?)),
579                    content_type: Some("application/json".to_string()),
580                },
581            )
582            .await
583    }
584    /**
585     * Get managed domains.
586     *
587     * This function performs a `GET` to the `/accounts/{accountId}/managed_domains` endpoint.
588     *
589     * Get a sub account's [managed domains](https://support.zoom.us/hc/en-us/articles/203395207-What-is-Managed-Domain-).<br><br>
590     *
591     * **Note:** This API can be used by Zoom Accounts that are on a Pro or a higher plan as well accounts that have master and sub accounts options enabled. <br><br>
592     * To get managed domains of the master account, provide `me` as the value for accountId in the path parameter. Provide the sub account's Account ID as the value of accountId path parameter to get managed domains of the sub account.<br><br>
593     * **Prerequisites:**<br>
594     * * Pro or a higher paid account with master account option enabled. <br>
595     *
596     * **Scope:** `account:read:admin`<br>
597     * **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Light`<br>
598     *
599     *
600     *
601     *
602     *
603     * **Parameters:**
604     *
605     * * `account_id: &str` -- Unique Identifier of the account. To retrieve locked settings of the master account or a regular account, provide "me" as the value of this field. <br> To retrieve locked settings of a sub account, provide the Account ID of the sub account in this field.
606     */
607    pub async fn managed_domain(
608        &self,
609        account_id: &str,
610    ) -> ClientResult<crate::Response<crate::types::DomainsList>> {
611        let url = self.client.url(
612            &format!(
613                "/accounts/{}/managed_domains",
614                crate::progenitor_support::encode_path(account_id),
615            ),
616            None,
617        );
618        self.client
619            .get(
620                &url,
621                crate::Message {
622                    body: None,
623                    content_type: None,
624                },
625            )
626            .await
627    }
628    /**
629     * Get trusted domains.
630     *
631     * This function performs a `GET` to the `/accounts/{accountId}/trusted_domains` endpoint.
632     *
633     * Get trusted domains of a sub account. To get the trusted domains of a master account, use `me` as the value for the `accountId` path parameter.
634     *
635     * **Prerequisites:**<br>
636     * * The sub account must be a paid account.<br>
637     * **Scope:** `account:read:admin`<br>
638     *  **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Light`
639     *
640     * **Parameters:**
641     *
642     * * `account_id: &str` -- User's first name.
643     */
644    pub async fn trusted_domain(
645        &self,
646        account_id: &str,
647    ) -> ClientResult<crate::Response<crate::types::AccountTrustedDomainResponse>> {
648        let url = self.client.url(
649            &format!(
650                "/accounts/{}/trusted_domains",
651                crate::progenitor_support::encode_path(account_id),
652            ),
653            None,
654        );
655        self.client
656            .get(
657                &url,
658                crate::Message {
659                    body: None,
660                    content_type: None,
661                },
662            )
663            .await
664    }
665    /**
666     * Get locked settings.
667     *
668     * This function performs a `GET` to the `/accounts/{accountId}/lock_settings` endpoint.
669     *
670     * [Account Locked Settings](https://support.zoom.us/hc/en-us/articles/115005269866) allow you turn settings on or off for all users in your account. No user except the account admin or account owner can change these settings. With lock settings, you force the settings on for all users.
671     * Use this API to retrieve an account's locked settings.
672     *
673     * **Note:** This API can be used by Zoom Accounts that are on a Pro or a higher plan as well accounts that have master and sub accounts options enabled. <br><br>
674     * **Prerequisites:**
675     * * Pro or a higher paid account. <br>
676     *
677     * **Scope**: `account:read:admin`.
678     * <br> **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Medium`<br>
679     *
680     *
681     *
682     *
683     *
684     * **Scope:** account:read:admin
685     *
686     * **Parameters:**
687     *
688     * * `account_id: &str` -- Unique Identifier of the account. To retrieve locked settings of the master account or a regular account, provide "me" as the value of this field. <br> To retrieve locked settings of a sub account, provide the Account ID of the sub account in this field.
689     * * `option: &str` -- `meeting_security`: Use this query parameter to view meeting security settings applied on the account.<br>.
690     * * `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>
691     *   {
692     *       "schedule_meeting": {
693     *           "host_video": false
694     *       }
695     *   }
696     *   <br>You can provide multiple values by separating them with commas(example: "host_video,participant_video”).
697     */
698    pub async fn get_lock_setting(
699        &self,
700        account_id: &str,
701        option: &str,
702        custom_query_fields: &str,
703    ) -> ClientResult<crate::Response<crate::types::Domains>> {
704        let mut query_args: Vec<(String, String)> = Default::default();
705        if !custom_query_fields.is_empty() {
706            query_args.push((
707                "custom_query_fields".to_string(),
708                custom_query_fields.to_string(),
709            ));
710        }
711        if !option.is_empty() {
712            query_args.push(("option".to_string(), option.to_string()));
713        }
714        let query_ = serde_urlencoded::to_string(&query_args).unwrap();
715        let url = self.client.url(
716            &format!(
717                "/accounts/{}/lock_settings?{}",
718                crate::progenitor_support::encode_path(account_id),
719                query_
720            ),
721            None,
722        );
723        self.client
724            .get(
725                &url,
726                crate::Message {
727                    body: None,
728                    content_type: None,
729                },
730            )
731            .await
732    }
733    /**
734     * Update locked settings.
735     *
736     * This function performs a `PATCH` to the `/accounts/{accountId}/lock_settings` endpoint.
737     *
738     * [Account Locked Settings](https://support.zoom.us/hc/en-us/articles/115005269866) allow you turn settings on or off for all users in your account. No user except the account admin or account owner can change these settings. With lock settings, you force the settings on for all users. Use this API to update an account's locked settings.
739     *
740     * **Note:** This API can be used by Zoom Accounts that are on a Pro or a higher plan as well accounts that have master and sub accounts options enabled.<br><br>
741     * **Prerequisites:**<br>
742     * * Pro or a higher paid account. <br>
743     *
744     * **Scope:** `account:write:admin`<br>
745     * **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Medium`<br>
746     *
747     *
748     *  
749     *
750     * **Parameters:**
751     *
752     * * `account_id: &str` -- Unique Identifier of the account. To retrieve locked settings of the master account or a regular account, provide "me" as the value of this field. <br> To retrieve locked settings of a sub account, provide the Account ID of the sub account in this field.
753     */
754    pub async fn update_lock_settings(
755        &self,
756        account_id: &str,
757    ) -> ClientResult<crate::Response<()>> {
758        let url = self.client.url(
759            &format!(
760                "/accounts/{}/lock_settings",
761                crate::progenitor_support::encode_path(account_id),
762            ),
763            None,
764        );
765        self.client
766            .patch(
767                &url,
768                crate::Message {
769                    body: None,
770                    content_type: Some("application/json".to_string()),
771                },
772            )
773            .await
774    }
775    /**
776     * Update the account owner.
777     *
778     * This function performs a `PUT` to the `/accounts/{accountId}/owner` endpoint.
779     *
780     * Use this API to change an account's owner.
781     *
782     * An account's current owner can [change the account's owner](https://support.zoom.us/hc/en-us/articles/115005686983-Change-Account-Owner) to another user on the same account.
783     *
784     * **Scopes:** `account:write:admin` or `account:master`<br>**[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Heavy`
785     *
786     * **Prerequisites:**
787     * * An account owner or admin permissions of an account
788     * * The account making this API request must be on a Pro or a higher account plan with [Master account](https://marketplace.zoom.us/docs/api-reference/master-account-apis) privileges
789     *
790     * **Parameters:**
791     *
792     * * `account_id: &str` -- The account's account ID.
793     */
794    pub async fn update_owner(
795        &self,
796        account_id: &str,
797        body: &crate::types::Members,
798    ) -> ClientResult<crate::Response<()>> {
799        let url = self.client.url(
800            &format!(
801                "/accounts/{}/owner",
802                crate::progenitor_support::encode_path(account_id),
803            ),
804            None,
805        );
806        self.client
807            .put(
808                &url,
809                crate::Message {
810                    body: Some(reqwest::Body::from(serde_json::to_vec(body)?)),
811                    content_type: Some("application/json".to_string()),
812                },
813            )
814            .await
815    }
816    /**
817     * Upload virtual background files.
818     *
819     * This function performs a `POST` to the `/accounts/{accountId}/settings/virtual_backgrounds` endpoint.
820     *
821     * Use this API to [upload virtual background files](https://support.zoom.us/hc/en-us/articles/210707503-Virtual-Background#h_01EJF3YFEWGT8YA0ZJ079JEDQE) for all users on the account to use.
822     *
823     *
824     * **Prerequisites:**<br>
825     * * 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.
826     * <br> **Scope:** `account:write:admin`<br><br>
827     * **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Medium`<br>
828     *
829     *
830     *
831     * **Parameters:**
832     *
833     * * `account_id: &str` -- Unique identifier of the account.
834     */
835    pub async fn upload_vb(
836        &self,
837        account_id: &str,
838        body: &crate::types::UploadVbRequest,
839    ) -> ClientResult<crate::Response<crate::types::Files>> {
840        let url = self.client.url(
841            &format!(
842                "/accounts/{}/settings/virtual_backgrounds",
843                crate::progenitor_support::encode_path(account_id),
844            ),
845            None,
846        );
847        self.client
848            .post(
849                &url,
850                crate::Message {
851                    body: Some(reqwest::Body::from(serde_json::to_vec(body)?)),
852                    content_type: None,
853                },
854            )
855            .await
856    }
857    /**
858     * Delete virtual background files.
859     *
860     * This function performs a `DELETE` to the `/accounts/{accountId}/settings/virtual_backgrounds` endpoint.
861     *
862     * Delete existing virtual background file(s) from an account.
863     *
864     * **Prerequisites:**<br>
865     * * 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.
866     * <br> **Scope:** `account:write:admin`<br> <br>
867     * **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Light`<br>
868     *
869     *
870     *
871     * **Parameters:**
872     *
873     * * `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.
874     */
875    pub async fn del_vb(
876        &self,
877        account_id: &str,
878        file_ids: &str,
879    ) -> ClientResult<crate::Response<()>> {
880        let mut query_args: Vec<(String, String)> = Default::default();
881        if !file_ids.is_empty() {
882            query_args.push(("file_ids".to_string(), file_ids.to_string()));
883        }
884        let query_ = serde_urlencoded::to_string(&query_args).unwrap();
885        let url = self.client.url(
886            &format!(
887                "/accounts/{}/settings/virtual_backgrounds?{}",
888                crate::progenitor_support::encode_path(account_id),
889                query_
890            ),
891            None,
892        );
893        self.client
894            .delete(
895                &url,
896                crate::Message {
897                    body: None,
898                    content_type: None,
899                },
900            )
901            .await
902    }
903}