zoom_api/tracking_field.rs
1use crate::Client;
2use crate::ClientResult;
3
4pub struct TrackingField {
5 pub client: Client,
6}
7
8impl TrackingField {
9 #[doc(hidden)]
10 pub fn new(client: Client) -> Self {
11 TrackingField { client }
12 }
13
14 /**
15 * List tracking fields.
16 *
17 * This function performs a `GET` to the `/tracking_fields` endpoint.
18 *
19 * [Tracking fields](https://support.zoom.us/hc/en-us/articles/115000293426-Scheduling-Tracking-Fields) allow you to analyze usage by various fields within an organization.<br> Use this API to list all the tracking fields on your Zoom account.<br><br>
20 * **Scopes:** `trackingfield:read:admin`<br>
21 *
22 * **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Medium`<br>
23 * **Prerequisites:**
24 * * Business, Education, API or higher plan
25 */
26 pub async fn trackingfield_list(&self) -> ClientResult<crate::Response<crate::types::Domains>> {
27 let url = self.client.url("/tracking_fields", None);
28 self.client
29 .get(
30 &url,
31 crate::Message {
32 body: None,
33 content_type: None,
34 },
35 )
36 .await
37 }
38 /**
39 * Create a tracking field.
40 *
41 * This function performs a `POST` to the `/tracking_fields` endpoint.
42 *
43 * [Tracking fields](https://support.zoom.us/hc/en-us/articles/115000293426-Scheduling-Tracking-Fields) allow you to analyze usage by various fields within an organization.<br> Use this API to create a new tracking field.<br><br>
44 * **Scope:** `trackingfield:write:admin`<br>
45 *
46 * **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Light`<br>
47 * **Prerequisites:**
48 * * Business, Education, API or higher plan
49 */
50 pub async fn trackingfield_create(
51 &self,
52 body: &crate::types::TrackingField,
53 ) -> ClientResult<crate::Response<crate::types::TrackingfieldGetResponseAllOf>> {
54 let url = self.client.url("/tracking_fields", None);
55 self.client
56 .post(
57 &url,
58 crate::Message {
59 body: Some(reqwest::Body::from(serde_json::to_vec(body)?)),
60 content_type: Some("application/json".to_string()),
61 },
62 )
63 .await
64 }
65 /**
66 * Get a tracking field.
67 *
68 * This function performs a `GET` to the `/tracking_fields/{fieldId}` endpoint.
69 *
70 * [Tracking fields](https://support.zoom.us/hc/en-us/articles/115000293426-Scheduling-Tracking-Fields) allow you to analyze usage by various fields within an organization.<br><br> When scheduling a meeting, the tracking field will be included in the meeting options.<br>Use this API to get information on a tracking field.<br><br>
71 * **Scopes:** `trackingfield:read:admin`<br>
72 *
73 * **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Light`<br>
74 * **Prerequisites:**
75 * * Business, Education, API or higher plan
76 *
77 *
78 * **Parameters:**
79 *
80 * * `field_id: &str` -- The Tracking Field ID.
81 */
82 pub async fn trackingfield_get(
83 &self,
84 field_id: &str,
85 ) -> ClientResult<crate::Response<crate::types::TrackingfieldGetResponseAllOf>> {
86 let url = self.client.url(
87 &format!(
88 "/tracking_fields/{}",
89 crate::progenitor_support::encode_path(field_id),
90 ),
91 None,
92 );
93 self.client
94 .get(
95 &url,
96 crate::Message {
97 body: None,
98 content_type: None,
99 },
100 )
101 .await
102 }
103 /**
104 * Delete a tracking field.
105 *
106 * This function performs a `DELETE` to the `/tracking_fields/{fieldId}` endpoint.
107 *
108 * [Tracking fields](https://support.zoom.us/hc/en-us/articles/115000293426-Scheduling-Tracking-Fields) allow you to analyze usage by various fields within an organization.<br> Use this API to delete a tracking field.<br><br>
109 * **Scope:** `trackingfield:write:admin`<br>
110 *
111 * **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Light`<br>
112 * **Prerequisites:**
113 * * Business, Education, API or higher plan
114 *
115 * **Parameters:**
116 *
117 * * `field_id: &str` -- The Tracking Field ID.
118 */
119 pub async fn trackingfield_delete(&self, field_id: &str) -> ClientResult<crate::Response<()>> {
120 let url = self.client.url(
121 &format!(
122 "/tracking_fields/{}",
123 crate::progenitor_support::encode_path(field_id),
124 ),
125 None,
126 );
127 self.client
128 .delete(
129 &url,
130 crate::Message {
131 body: None,
132 content_type: None,
133 },
134 )
135 .await
136 }
137 /**
138 * Update a tracking field.
139 *
140 * This function performs a `PATCH` to the `/tracking_fields/{fieldId}` endpoint.
141 *
142 * [Tracking fields](https://support.zoom.us/hc/en-us/articles/115000293426-Scheduling-Tracking-Fields) allow you to analyze usage by various fields within an organization.<br> Use this API to update a tracking field.<br><br>
143 * **Scope:** `trackingfield:write:admin`<br>
144 *
145 * **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Light`<br>
146 * **Prerequisites:**
147 * * Business, Education, API or higher plan
148 *
149 * **Parameters:**
150 *
151 * * `field_id: &str` -- The Tracking Field ID.
152 */
153 pub async fn trackingfield_update(
154 &self,
155 field_id: &str,
156 body: &crate::types::TrackingField,
157 ) -> ClientResult<crate::Response<()>> {
158 let url = self.client.url(
159 &format!(
160 "/tracking_fields/{}",
161 crate::progenitor_support::encode_path(field_id),
162 ),
163 None,
164 );
165 self.client
166 .patch(
167 &url,
168 crate::Message {
169 body: Some(reqwest::Body::from(serde_json::to_vec(body)?)),
170 content_type: Some("application/json".to_string()),
171 },
172 )
173 .await
174 }
175}