zoom_api/devices.rs
1use crate::Client;
2use crate::ClientResult;
3
4pub struct Devices {
5 pub client: Client,
6}
7
8impl Devices {
9 #[doc(hidden)]
10 pub fn new(client: Client) -> Self {
11 Devices { client }
12 }
13
14 /**
15 * List H.323/SIP devices.
16 *
17 * This function performs a `GET` to the `/h323/devices` endpoint.
18 *
19 * A H.323 or SIP device can make a video call to a [Room Connector](https://support.zoom.us/hc/en-us/articles/201363273-Getting-Started-With-H-323-SIP-Room-Connector) to join a Zoom cloud meeting. A Room Connector can also call out to a H.323 or SIP device to join a Zoom cloud meeting. Use this API to list all H.323/SIP Devices on a Zoom account.<br><br>
20 * **Scopes:** `h323:read:admin`<br>
21 *
22 * **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Medium`<br>
23 *
24 * **Parameters:**
25 *
26 * * `page_size: i64` -- The number of records returned within a single API call.
27 * * `page_number: i64` --
28 * **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.
29 *
30 * The page number of the current page in the returned records.
31 * * `next_page_token: &str` -- The next page token is used to paginate through large result sets. A next page token will be returned whenever the set of available results exceeds the current page size. The expiration period for this token is 15 minutes.
32 */
33 pub async fn list(
34 &self,
35 page_size: i64,
36 page_number: i64,
37 next_page_token: &str,
38 ) -> ClientResult<crate::Response<crate::types::Domains>> {
39 let mut query_args: Vec<(String, String)> = Default::default();
40 if !next_page_token.is_empty() {
41 query_args.push(("next_page_token".to_string(), next_page_token.to_string()));
42 }
43 if page_number > 0 {
44 query_args.push(("page_number".to_string(), page_number.to_string()));
45 }
46 if page_size > 0 {
47 query_args.push(("page_size".to_string(), page_size.to_string()));
48 }
49 let query_ = serde_urlencoded::to_string(&query_args).unwrap();
50 let url = self.client.url(&format!("/h323/devices?{}", query_), None);
51 self.client
52 .get(
53 &url,
54 crate::Message {
55 body: None,
56 content_type: None,
57 },
58 )
59 .await
60 }
61 /**
62 * Create a H.323/SIP device.
63 *
64 * This function performs a `POST` to the `/h323/devices` endpoint.
65 *
66 * A H.323 or SIP device can make a video call to a [Room Connector](https://support.zoom.us/hc/en-us/articles/201363273-Getting-Started-With-H-323-SIP-Room-Connector) to join a Zoom cloud meeting. A Room Connector can also call out to a H.323 or SIP device to join a Zoom cloud meeting. Use this API to add a H.323/SIP device to your Zoom account<br><br>
67 * **Scopes:** `h323:write:admin`<br>
68 *
69 * **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Light` <br>
70 */
71 pub async fn create(&self, body: &crate::types::Device) -> ClientResult<crate::Response<()>> {
72 let url = self.client.url("/h323/devices", None);
73 self.client
74 .post(
75 &url,
76 crate::Message {
77 body: Some(reqwest::Body::from(serde_json::to_vec(body)?)),
78 content_type: Some("application/json".to_string()),
79 },
80 )
81 .await
82 }
83 /**
84 * Delete a H.323/SIP device.
85 *
86 * This function performs a `DELETE` to the `/h323/devices/{deviceId}` endpoint.
87 *
88 * A H.323 or SIP device can make a video call to a [Room Connector](https://support.zoom.us/hc/en-us/articles/201363273-Getting-Started-With-H-323-SIP-Room-Connector) to join a Zoom cloud meeting. A Room Connector can also call out to a H.323 or SIP device to join a Zoom cloud meeting. Use this API to delete a H.323/SIP device from your Zoom account.<br><br>
89 * **Scopes:** `h323:write:admin`<br>
90 *
91 * **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Light`<br>
92 *
93 * **Parameters:**
94 *
95 * * `device_id: &str` -- User's first name.
96 */
97 pub async fn delete(&self, device_id: &str) -> ClientResult<crate::Response<()>> {
98 let url = self.client.url(
99 &format!(
100 "/h323/devices/{}",
101 crate::progenitor_support::encode_path(device_id),
102 ),
103 None,
104 );
105 self.client
106 .delete(
107 &url,
108 crate::Message {
109 body: None,
110 content_type: None,
111 },
112 )
113 .await
114 }
115 /**
116 * Update a H.323/SIP device.
117 *
118 * This function performs a `PATCH` to the `/h323/devices/{deviceId}` endpoint.
119 *
120 * A H.323 or SIP device can make a video call to a [Room Connector](https://support.zoom.us/hc/en-us/articles/201363273-Getting-Started-With-H-323-SIP-Room-Connector) to join a Zoom cloud meeting. A Room Connector can also call out to a H.323 or SIP device to join a Zoom cloud meeting. Use this API to edit information of a H.323/SIP device from your Zoom account.<br><br>
121 * **Scopes:** `h323:write:admin`<br>
122 * <br>
123 * **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Light`
124 *
125 * **Parameters:**
126 *
127 * * `device_id: &str` -- User's first name.
128 */
129 pub async fn update(
130 &self,
131 device_id: &str,
132 body: &crate::types::Device,
133 ) -> ClientResult<crate::Response<()>> {
134 let url = self.client.url(
135 &format!(
136 "/h323/devices/{}",
137 crate::progenitor_support::encode_path(device_id),
138 ),
139 None,
140 );
141 self.client
142 .patch(
143 &url,
144 crate::Message {
145 body: Some(reqwest::Body::from(serde_json::to_vec(body)?)),
146 content_type: Some("application/json".to_string()),
147 },
148 )
149 .await
150 }
151}