1use reqwest;
13use serde::{Deserialize, Serialize, de::Error as _};
14use crate::{apis::ResponseContent, models};
15use super::{Error, configuration, ContentType};
16
17
18#[derive(Debug, Clone, Serialize, Deserialize)]
20#[serde(untagged)]
21pub enum DeleteTeamAccountCookieError {
22 UnknownValue(serde_json::Value),
23}
24
25#[derive(Debug, Clone, Serialize, Deserialize)]
27#[serde(untagged)]
28pub enum DeleteTeamFilesByWorkspaceByFilenameError {
29 UnknownValue(serde_json::Value),
30}
31
32#[derive(Debug, Clone, Serialize, Deserialize)]
34#[serde(untagged)]
35pub enum GetTeamAccountAuthByProviderError {
36 UnknownValue(serde_json::Value),
37}
38
39#[derive(Debug, Clone, Serialize, Deserialize)]
41#[serde(untagged)]
42pub enum GetTeamAccountAuthByProviderCallbackError {
43 UnknownValue(serde_json::Value),
44}
45
46#[derive(Debug, Clone, Serialize, Deserialize)]
48#[serde(untagged)]
49pub enum GetTeamAccountProvidersError {
50 UnknownValue(serde_json::Value),
51}
52
53#[derive(Debug, Clone, Serialize, Deserialize)]
55#[serde(untagged)]
56pub enum GetTeamBillingPlanError {
57 UnknownValue(serde_json::Value),
58}
59
60#[derive(Debug, Clone, Serialize, Deserialize)]
62#[serde(untagged)]
63pub enum GetTeamBillingUiError {
64 UnknownValue(serde_json::Value),
65}
66
67#[derive(Debug, Clone, Serialize, Deserialize)]
69#[serde(untagged)]
70pub enum GetTeamBotsError {
71 UnknownValue(serde_json::Value),
72}
73
74#[derive(Debug, Clone, Serialize, Deserialize)]
76#[serde(untagged)]
77pub enum GetTeamCollaboratorError {
78 UnknownValue(serde_json::Value),
79}
80
81#[derive(Debug, Clone, Serialize, Deserialize)]
83#[serde(untagged)]
84pub enum GetTeamFilesByWorkspaceByFilenameError {
85 UnknownValue(serde_json::Value),
86}
87
88#[derive(Debug, Clone, Serialize, Deserialize)]
90#[serde(untagged)]
91pub enum GetTeamRoomsError {
92 UnknownValue(serde_json::Value),
93}
94
95#[derive(Debug, Clone, Serialize, Deserialize)]
97#[serde(untagged)]
98pub enum GetTeamTransactorApiV1StatisticsError {
99 UnknownValue(serde_json::Value),
100}
101
102#[derive(Debug, Clone, Serialize, Deserialize)]
104#[serde(untagged)]
105pub enum GetTeamTransactorByTokenError {
106 UnknownValue(serde_json::Value),
107}
108
109#[derive(Debug, Clone, Serialize, Deserialize)]
111#[serde(untagged)]
112pub enum GetTeamTransactorStatisticsError {
113 UnknownValue(serde_json::Value),
114}
115
116#[derive(Debug, Clone, Serialize, Deserialize)]
118#[serde(untagged)]
119pub enum PostTeamAccountError {
120 UnknownValue(serde_json::Value),
121}
122
123#[derive(Debug, Clone, Serialize, Deserialize)]
125#[serde(untagged)]
126pub enum PostTeamBotsSyncError {
127 UnknownValue(serde_json::Value),
128}
129
130#[derive(Debug, Clone, Serialize, Deserialize)]
132#[serde(untagged)]
133pub enum PostTeamCollaboratorRpcByDocumentidError {
134 UnknownValue(serde_json::Value),
135}
136
137#[derive(Debug, Clone, Serialize, Deserialize)]
139#[serde(untagged)]
140pub enum PostTeamFilesByWorkspaceError {
141 UnknownValue(serde_json::Value),
142}
143
144#[derive(Debug, Clone, Serialize, Deserialize)]
146#[serde(untagged)]
147pub enum PutTeamAccountCookieError {
148 UnknownValue(serde_json::Value),
149}
150
151#[derive(Debug, Clone, Serialize, Deserialize)]
153#[serde(untagged)]
154pub enum PutTeamRoomsByIdError {
155 UnknownValue(serde_json::Value),
156}
157
158
159pub async fn delete_team_account_cookie(configuration: &configuration::Configuration, ) -> Result<models::CookieAck, Error<DeleteTeamAccountCookieError>> {
161
162 let uri_str = format!("{}/v1/team/account/cookie", configuration.base_path);
163 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
164
165 if let Some(ref user_agent) = configuration.user_agent {
166 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
167 }
168 if let Some(ref token) = configuration.bearer_access_token {
169 req_builder = req_builder.bearer_auth(token.to_owned());
170 };
171
172 let req = req_builder.build()?;
173 let resp = configuration.client.execute(req).await?;
174
175 let status = resp.status();
176 let content_type = resp
177 .headers()
178 .get("content-type")
179 .and_then(|v| v.to_str().ok())
180 .unwrap_or("application/octet-stream");
181 let content_type = super::ContentType::from(content_type);
182
183 if !status.is_client_error() && !status.is_server_error() {
184 let content = resp.text().await?;
185 match content_type {
186 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
187 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CookieAck`"))),
188 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::CookieAck`")))),
189 }
190 } else {
191 let content = resp.text().await?;
192 let entity: Option<DeleteTeamAccountCookieError> = serde_json::from_str(&content).ok();
193 Err(Error::ResponseError(ResponseContent { status, content, entity }))
194 }
195}
196
197pub async fn delete_team_files_by_workspace_by_filename(configuration: &configuration::Configuration, workspace: &str, filename: &str, file: Option<&str>) -> Result<(), Error<DeleteTeamFilesByWorkspaceByFilenameError>> {
199 let p_workspace = workspace;
201 let p_filename = filename;
202 let p_file = file;
203
204 let uri_str = format!("{}/v1/team/files/{workspace}/{filename}", configuration.base_path, workspace=crate::apis::urlencode(p_workspace), filename=crate::apis::urlencode(p_filename));
205 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
206
207 if let Some(ref param_value) = p_file {
208 req_builder = req_builder.query(&[("file", ¶m_value.to_string())]);
209 }
210 if let Some(ref user_agent) = configuration.user_agent {
211 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
212 }
213 if let Some(ref token) = configuration.bearer_access_token {
214 req_builder = req_builder.bearer_auth(token.to_owned());
215 };
216
217 let req = req_builder.build()?;
218 let resp = configuration.client.execute(req).await?;
219
220 let status = resp.status();
221
222 if !status.is_client_error() && !status.is_server_error() {
223 Ok(())
224 } else {
225 let content = resp.text().await?;
226 let entity: Option<DeleteTeamFilesByWorkspaceByFilenameError> = serde_json::from_str(&content).ok();
227 Err(Error::ResponseError(ResponseContent { status, content, entity }))
228 }
229}
230
231pub async fn get_team_account_auth_by_provider(configuration: &configuration::Configuration, provider: &str) -> Result<(), Error<GetTeamAccountAuthByProviderError>> {
233 let p_provider = provider;
235
236 let uri_str = format!("{}/v1/team/account/auth/{provider}", configuration.base_path, provider=crate::apis::urlencode(p_provider));
237 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
238
239 if let Some(ref user_agent) = configuration.user_agent {
240 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
241 }
242 if let Some(ref token) = configuration.bearer_access_token {
243 req_builder = req_builder.bearer_auth(token.to_owned());
244 };
245
246 let req = req_builder.build()?;
247 let resp = configuration.client.execute(req).await?;
248
249 let status = resp.status();
250
251 if !status.is_client_error() && !status.is_server_error() {
252 Ok(())
253 } else {
254 let content = resp.text().await?;
255 let entity: Option<GetTeamAccountAuthByProviderError> = serde_json::from_str(&content).ok();
256 Err(Error::ResponseError(ResponseContent { status, content, entity }))
257 }
258}
259
260pub async fn get_team_account_auth_by_provider_callback(configuration: &configuration::Configuration, provider: &str) -> Result<(), Error<GetTeamAccountAuthByProviderCallbackError>> {
262 let p_provider = provider;
264
265 let uri_str = format!("{}/v1/team/account/auth/{provider}/callback", configuration.base_path, provider=crate::apis::urlencode(p_provider));
266 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
267
268 if let Some(ref user_agent) = configuration.user_agent {
269 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
270 }
271 if let Some(ref token) = configuration.bearer_access_token {
272 req_builder = req_builder.bearer_auth(token.to_owned());
273 };
274
275 let req = req_builder.build()?;
276 let resp = configuration.client.execute(req).await?;
277
278 let status = resp.status();
279
280 if !status.is_client_error() && !status.is_server_error() {
281 Ok(())
282 } else {
283 let content = resp.text().await?;
284 let entity: Option<GetTeamAccountAuthByProviderCallbackError> = serde_json::from_str(&content).ok();
285 Err(Error::ResponseError(ResponseContent { status, content, entity }))
286 }
287}
288
289pub async fn get_team_account_providers(configuration: &configuration::Configuration, ) -> Result<Vec<models::ProviderInfo>, Error<GetTeamAccountProvidersError>> {
291
292 let uri_str = format!("{}/v1/team/account/providers", configuration.base_path);
293 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
294
295 if let Some(ref user_agent) = configuration.user_agent {
296 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
297 }
298 if let Some(ref token) = configuration.bearer_access_token {
299 req_builder = req_builder.bearer_auth(token.to_owned());
300 };
301
302 let req = req_builder.build()?;
303 let resp = configuration.client.execute(req).await?;
304
305 let status = resp.status();
306 let content_type = resp
307 .headers()
308 .get("content-type")
309 .and_then(|v| v.to_str().ok())
310 .unwrap_or("application/octet-stream");
311 let content_type = super::ContentType::from(content_type);
312
313 if !status.is_client_error() && !status.is_server_error() {
314 let content = resp.text().await?;
315 match content_type {
316 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
317 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::ProviderInfo>`"))),
318 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::ProviderInfo>`")))),
319 }
320 } else {
321 let content = resp.text().await?;
322 let entity: Option<GetTeamAccountProvidersError> = serde_json::from_str(&content).ok();
323 Err(Error::ResponseError(ResponseContent { status, content, entity }))
324 }
325}
326
327pub async fn get_team_billing_plan(configuration: &configuration::Configuration, ) -> Result<models::PlanInfo, Error<GetTeamBillingPlanError>> {
329
330 let uri_str = format!("{}/v1/team/billing/plan", configuration.base_path);
331 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
332
333 if let Some(ref user_agent) = configuration.user_agent {
334 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
335 }
336 if let Some(ref token) = configuration.bearer_access_token {
337 req_builder = req_builder.bearer_auth(token.to_owned());
338 };
339
340 let req = req_builder.build()?;
341 let resp = configuration.client.execute(req).await?;
342
343 let status = resp.status();
344 let content_type = resp
345 .headers()
346 .get("content-type")
347 .and_then(|v| v.to_str().ok())
348 .unwrap_or("application/octet-stream");
349 let content_type = super::ContentType::from(content_type);
350
351 if !status.is_client_error() && !status.is_server_error() {
352 let content = resp.text().await?;
353 match content_type {
354 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
355 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PlanInfo`"))),
356 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PlanInfo`")))),
357 }
358 } else {
359 let content = resp.text().await?;
360 let entity: Option<GetTeamBillingPlanError> = serde_json::from_str(&content).ok();
361 Err(Error::ResponseError(ResponseContent { status, content, entity }))
362 }
363}
364
365pub async fn get_team_billing_ui(configuration: &configuration::Configuration, ) -> Result<reqwest::Response, Error<GetTeamBillingUiError>> {
367
368 let uri_str = format!("{}/v1/team/billing/ui", configuration.base_path);
369 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
370
371 if let Some(ref user_agent) = configuration.user_agent {
372 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
373 }
374 if let Some(ref token) = configuration.bearer_access_token {
375 req_builder = req_builder.bearer_auth(token.to_owned());
376 };
377
378 let req = req_builder.build()?;
379 let resp = configuration.client.execute(req).await?;
380
381 let status = resp.status();
382
383 if !status.is_client_error() && !status.is_server_error() {
384 Ok(resp)
385 } else {
386 let content = resp.text().await?;
387 let entity: Option<GetTeamBillingUiError> = serde_json::from_str(&content).ok();
388 Err(Error::ResponseError(ResponseContent { status, content, entity }))
389 }
390}
391
392pub async fn get_team_bots(configuration: &configuration::Configuration, ) -> Result<models::BotRoster, Error<GetTeamBotsError>> {
394
395 let uri_str = format!("{}/v1/team/bots", configuration.base_path);
396 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
397
398 if let Some(ref user_agent) = configuration.user_agent {
399 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
400 }
401 if let Some(ref token) = configuration.bearer_access_token {
402 req_builder = req_builder.bearer_auth(token.to_owned());
403 };
404
405 let req = req_builder.build()?;
406 let resp = configuration.client.execute(req).await?;
407
408 let status = resp.status();
409 let content_type = resp
410 .headers()
411 .get("content-type")
412 .and_then(|v| v.to_str().ok())
413 .unwrap_or("application/octet-stream");
414 let content_type = super::ContentType::from(content_type);
415
416 if !status.is_client_error() && !status.is_server_error() {
417 let content = resp.text().await?;
418 match content_type {
419 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
420 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::BotRoster`"))),
421 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::BotRoster`")))),
422 }
423 } else {
424 let content = resp.text().await?;
425 let entity: Option<GetTeamBotsError> = serde_json::from_str(&content).ok();
426 Err(Error::ResponseError(ResponseContent { status, content, entity }))
427 }
428}
429
430pub async fn get_team_collaborator(configuration: &configuration::Configuration, ) -> Result<(), Error<GetTeamCollaboratorError>> {
432
433 let uri_str = format!("{}/v1/team/collaborator", configuration.base_path);
434 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
435
436 if let Some(ref user_agent) = configuration.user_agent {
437 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
438 }
439 if let Some(ref token) = configuration.bearer_access_token {
440 req_builder = req_builder.bearer_auth(token.to_owned());
441 };
442
443 let req = req_builder.build()?;
444 let resp = configuration.client.execute(req).await?;
445
446 let status = resp.status();
447
448 if !status.is_client_error() && !status.is_server_error() {
449 Ok(())
450 } else {
451 let content = resp.text().await?;
452 let entity: Option<GetTeamCollaboratorError> = serde_json::from_str(&content).ok();
453 Err(Error::ResponseError(ResponseContent { status, content, entity }))
454 }
455}
456
457pub async fn get_team_files_by_workspace_by_filename(configuration: &configuration::Configuration, workspace: &str, filename: &str) -> Result<reqwest::Response, Error<GetTeamFilesByWorkspaceByFilenameError>> {
459 let p_workspace = workspace;
461 let p_filename = filename;
462
463 let uri_str = format!("{}/v1/team/files/{workspace}/{filename}", configuration.base_path, workspace=crate::apis::urlencode(p_workspace), filename=crate::apis::urlencode(p_filename));
464 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
465
466 if let Some(ref user_agent) = configuration.user_agent {
467 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
468 }
469 if let Some(ref token) = configuration.bearer_access_token {
470 req_builder = req_builder.bearer_auth(token.to_owned());
471 };
472
473 let req = req_builder.build()?;
474 let resp = configuration.client.execute(req).await?;
475
476 let status = resp.status();
477
478 if !status.is_client_error() && !status.is_server_error() {
479 Ok(resp)
480 } else {
481 let content = resp.text().await?;
482 let entity: Option<GetTeamFilesByWorkspaceByFilenameError> = serde_json::from_str(&content).ok();
483 Err(Error::ResponseError(ResponseContent { status, content, entity }))
484 }
485}
486
487pub async fn get_team_rooms(configuration: &configuration::Configuration, ) -> Result<models::TeamRooms, Error<GetTeamRoomsError>> {
489
490 let uri_str = format!("{}/v1/team/rooms", configuration.base_path);
491 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
492
493 if let Some(ref user_agent) = configuration.user_agent {
494 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
495 }
496 if let Some(ref token) = configuration.bearer_access_token {
497 req_builder = req_builder.bearer_auth(token.to_owned());
498 };
499
500 let req = req_builder.build()?;
501 let resp = configuration.client.execute(req).await?;
502
503 let status = resp.status();
504 let content_type = resp
505 .headers()
506 .get("content-type")
507 .and_then(|v| v.to_str().ok())
508 .unwrap_or("application/octet-stream");
509 let content_type = super::ContentType::from(content_type);
510
511 if !status.is_client_error() && !status.is_server_error() {
512 let content = resp.text().await?;
513 match content_type {
514 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
515 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TeamRooms`"))),
516 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::TeamRooms`")))),
517 }
518 } else {
519 let content = resp.text().await?;
520 let entity: Option<GetTeamRoomsError> = serde_json::from_str(&content).ok();
521 Err(Error::ResponseError(ResponseContent { status, content, entity }))
522 }
523}
524
525pub async fn get_team_transactor_api_v1_statistics(configuration: &configuration::Configuration, token: Option<&str>) -> Result<models::StatsOut, Error<GetTeamTransactorApiV1StatisticsError>> {
527 let p_token = token;
529
530 let uri_str = format!("{}/v1/team/transactor/api/v1/statistics", configuration.base_path);
531 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
532
533 if let Some(ref param_value) = p_token {
534 req_builder = req_builder.query(&[("token", ¶m_value.to_string())]);
535 }
536 if let Some(ref user_agent) = configuration.user_agent {
537 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
538 }
539 if let Some(ref token) = configuration.bearer_access_token {
540 req_builder = req_builder.bearer_auth(token.to_owned());
541 };
542
543 let req = req_builder.build()?;
544 let resp = configuration.client.execute(req).await?;
545
546 let status = resp.status();
547 let content_type = resp
548 .headers()
549 .get("content-type")
550 .and_then(|v| v.to_str().ok())
551 .unwrap_or("application/octet-stream");
552 let content_type = super::ContentType::from(content_type);
553
554 if !status.is_client_error() && !status.is_server_error() {
555 let content = resp.text().await?;
556 match content_type {
557 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
558 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::StatsOut`"))),
559 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::StatsOut`")))),
560 }
561 } else {
562 let content = resp.text().await?;
563 let entity: Option<GetTeamTransactorApiV1StatisticsError> = serde_json::from_str(&content).ok();
564 Err(Error::ResponseError(ResponseContent { status, content, entity }))
565 }
566}
567
568pub async fn get_team_transactor_by_token(configuration: &configuration::Configuration, token: &str) -> Result<(), Error<GetTeamTransactorByTokenError>> {
570 let p_token = token;
572
573 let uri_str = format!("{}/v1/team/transactor/{token}", configuration.base_path, token=crate::apis::urlencode(p_token));
574 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
575
576 if let Some(ref user_agent) = configuration.user_agent {
577 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
578 }
579 if let Some(ref token) = configuration.bearer_access_token {
580 req_builder = req_builder.bearer_auth(token.to_owned());
581 };
582
583 let req = req_builder.build()?;
584 let resp = configuration.client.execute(req).await?;
585
586 let status = resp.status();
587
588 if !status.is_client_error() && !status.is_server_error() {
589 Ok(())
590 } else {
591 let content = resp.text().await?;
592 let entity: Option<GetTeamTransactorByTokenError> = serde_json::from_str(&content).ok();
593 Err(Error::ResponseError(ResponseContent { status, content, entity }))
594 }
595}
596
597pub async fn get_team_transactor_statistics(configuration: &configuration::Configuration, token: Option<&str>) -> Result<models::StatsOut, Error<GetTeamTransactorStatisticsError>> {
599 let p_token = token;
601
602 let uri_str = format!("{}/v1/team/transactor/statistics", configuration.base_path);
603 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
604
605 if let Some(ref param_value) = p_token {
606 req_builder = req_builder.query(&[("token", ¶m_value.to_string())]);
607 }
608 if let Some(ref user_agent) = configuration.user_agent {
609 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
610 }
611 if let Some(ref token) = configuration.bearer_access_token {
612 req_builder = req_builder.bearer_auth(token.to_owned());
613 };
614
615 let req = req_builder.build()?;
616 let resp = configuration.client.execute(req).await?;
617
618 let status = resp.status();
619 let content_type = resp
620 .headers()
621 .get("content-type")
622 .and_then(|v| v.to_str().ok())
623 .unwrap_or("application/octet-stream");
624 let content_type = super::ContentType::from(content_type);
625
626 if !status.is_client_error() && !status.is_server_error() {
627 let content = resp.text().await?;
628 match content_type {
629 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
630 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::StatsOut`"))),
631 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::StatsOut`")))),
632 }
633 } else {
634 let content = resp.text().await?;
635 let entity: Option<GetTeamTransactorStatisticsError> = serde_json::from_str(&content).ok();
636 Err(Error::ResponseError(ResponseContent { status, content, entity }))
637 }
638}
639
640pub async fn post_team_account(configuration: &configuration::Configuration, ) -> Result<(), Error<PostTeamAccountError>> {
642
643 let uri_str = format!("{}/v1/team/account", configuration.base_path);
644 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
645
646 if let Some(ref user_agent) = configuration.user_agent {
647 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
648 }
649 if let Some(ref token) = configuration.bearer_access_token {
650 req_builder = req_builder.bearer_auth(token.to_owned());
651 };
652
653 let req = req_builder.build()?;
654 let resp = configuration.client.execute(req).await?;
655
656 let status = resp.status();
657
658 if !status.is_client_error() && !status.is_server_error() {
659 Ok(())
660 } else {
661 let content = resp.text().await?;
662 let entity: Option<PostTeamAccountError> = serde_json::from_str(&content).ok();
663 Err(Error::ResponseError(ResponseContent { status, content, entity }))
664 }
665}
666
667pub async fn post_team_bots_sync(configuration: &configuration::Configuration, ) -> Result<models::BotSync, Error<PostTeamBotsSyncError>> {
669
670 let uri_str = format!("{}/v1/team/bots/sync", configuration.base_path);
671 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
672
673 if let Some(ref user_agent) = configuration.user_agent {
674 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
675 }
676 if let Some(ref token) = configuration.bearer_access_token {
677 req_builder = req_builder.bearer_auth(token.to_owned());
678 };
679
680 let req = req_builder.build()?;
681 let resp = configuration.client.execute(req).await?;
682
683 let status = resp.status();
684 let content_type = resp
685 .headers()
686 .get("content-type")
687 .and_then(|v| v.to_str().ok())
688 .unwrap_or("application/octet-stream");
689 let content_type = super::ContentType::from(content_type);
690
691 if !status.is_client_error() && !status.is_server_error() {
692 let content = resp.text().await?;
693 match content_type {
694 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
695 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::BotSync`"))),
696 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::BotSync`")))),
697 }
698 } else {
699 let content = resp.text().await?;
700 let entity: Option<PostTeamBotsSyncError> = serde_json::from_str(&content).ok();
701 Err(Error::ResponseError(ResponseContent { status, content, entity }))
702 }
703}
704
705pub async fn post_team_collaborator_rpc_by_documentid(configuration: &configuration::Configuration, document_id: &str, collab_request: models::CollabRequest) -> Result<models::CollabResult, Error<PostTeamCollaboratorRpcByDocumentidError>> {
707 let p_document_id = document_id;
709 let p_collab_request = collab_request;
710
711 let uri_str = format!("{}/v1/team/collaborator/rpc/{documentId}", configuration.base_path, documentId=crate::apis::urlencode(p_document_id));
712 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
713
714 if let Some(ref user_agent) = configuration.user_agent {
715 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
716 }
717 if let Some(ref token) = configuration.bearer_access_token {
718 req_builder = req_builder.bearer_auth(token.to_owned());
719 };
720 req_builder = req_builder.json(&p_collab_request);
721
722 let req = req_builder.build()?;
723 let resp = configuration.client.execute(req).await?;
724
725 let status = resp.status();
726 let content_type = resp
727 .headers()
728 .get("content-type")
729 .and_then(|v| v.to_str().ok())
730 .unwrap_or("application/octet-stream");
731 let content_type = super::ContentType::from(content_type);
732
733 if !status.is_client_error() && !status.is_server_error() {
734 let content = resp.text().await?;
735 match content_type {
736 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
737 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CollabResult`"))),
738 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::CollabResult`")))),
739 }
740 } else {
741 let content = resp.text().await?;
742 let entity: Option<PostTeamCollaboratorRpcByDocumentidError> = serde_json::from_str(&content).ok();
743 Err(Error::ResponseError(ResponseContent { status, content, entity }))
744 }
745}
746
747pub async fn post_team_files_by_workspace(configuration: &configuration::Configuration, workspace: &str, body: Option<Vec<u8>>) -> Result<reqwest::Response, Error<PostTeamFilesByWorkspaceError>> {
749 let p_workspace = workspace;
751 let p_body = body;
752
753 let uri_str = format!("{}/v1/team/files/{workspace}", configuration.base_path, workspace=crate::apis::urlencode(p_workspace));
754 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
755
756 if let Some(ref user_agent) = configuration.user_agent {
757 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
758 }
759 if let Some(ref token) = configuration.bearer_access_token {
760 req_builder = req_builder.bearer_auth(token.to_owned());
761 };
762 if let Some(body) = p_body {
763 req_builder = req_builder.body(body);
764 }
765
766 let req = req_builder.build()?;
767 let resp = configuration.client.execute(req).await?;
768
769 let status = resp.status();
770
771 if !status.is_client_error() && !status.is_server_error() {
772 Ok(resp)
773 } else {
774 let content = resp.text().await?;
775 let entity: Option<PostTeamFilesByWorkspaceError> = serde_json::from_str(&content).ok();
776 Err(Error::ResponseError(ResponseContent { status, content, entity }))
777 }
778}
779
780pub async fn put_team_account_cookie(configuration: &configuration::Configuration, ) -> Result<models::CookieAck, Error<PutTeamAccountCookieError>> {
782
783 let uri_str = format!("{}/v1/team/account/cookie", configuration.base_path);
784 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
785
786 if let Some(ref user_agent) = configuration.user_agent {
787 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
788 }
789 if let Some(ref token) = configuration.bearer_access_token {
790 req_builder = req_builder.bearer_auth(token.to_owned());
791 };
792
793 let req = req_builder.build()?;
794 let resp = configuration.client.execute(req).await?;
795
796 let status = resp.status();
797 let content_type = resp
798 .headers()
799 .get("content-type")
800 .and_then(|v| v.to_str().ok())
801 .unwrap_or("application/octet-stream");
802 let content_type = super::ContentType::from(content_type);
803
804 if !status.is_client_error() && !status.is_server_error() {
805 let content = resp.text().await?;
806 match content_type {
807 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
808 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CookieAck`"))),
809 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::CookieAck`")))),
810 }
811 } else {
812 let content = resp.text().await?;
813 let entity: Option<PutTeamAccountCookieError> = serde_json::from_str(&content).ok();
814 Err(Error::ResponseError(ResponseContent { status, content, entity }))
815 }
816}
817
818pub async fn put_team_rooms_by_id(configuration: &configuration::Configuration, id: &str, team_room_bind: models::TeamRoomBind) -> Result<models::TeamRoom, Error<PutTeamRoomsByIdError>> {
820 let p_id = id;
822 let p_team_room_bind = team_room_bind;
823
824 let uri_str = format!("{}/v1/team/rooms/{id}", configuration.base_path, id=crate::apis::urlencode(p_id));
825 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
826
827 if let Some(ref user_agent) = configuration.user_agent {
828 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
829 }
830 if let Some(ref token) = configuration.bearer_access_token {
831 req_builder = req_builder.bearer_auth(token.to_owned());
832 };
833 req_builder = req_builder.json(&p_team_room_bind);
834
835 let req = req_builder.build()?;
836 let resp = configuration.client.execute(req).await?;
837
838 let status = resp.status();
839 let content_type = resp
840 .headers()
841 .get("content-type")
842 .and_then(|v| v.to_str().ok())
843 .unwrap_or("application/octet-stream");
844 let content_type = super::ContentType::from(content_type);
845
846 if !status.is_client_error() && !status.is_server_error() {
847 let content = resp.text().await?;
848 match content_type {
849 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
850 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TeamRoom`"))),
851 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::TeamRoom`")))),
852 }
853 } else {
854 let content = resp.text().await?;
855 let entity: Option<PutTeamRoomsByIdError> = serde_json::from_str(&content).ok();
856 Err(Error::ResponseError(ResponseContent { status, content, entity }))
857 }
858}
859