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 GetDataroomAnalyticsDataroomByDataroomidError {
22 UnknownValue(serde_json::Value),
23}
24
25#[derive(Debug, Clone, Serialize, Deserialize)]
27#[serde(untagged)]
28pub enum GetDataroomAnalyticsLinkByLinkidError {
29 UnknownValue(serde_json::Value),
30}
31
32#[derive(Debug, Clone, Serialize, Deserialize)]
34#[serde(untagged)]
35pub enum GetDataroomDataroomsError {
36 UnknownValue(serde_json::Value),
37}
38
39#[derive(Debug, Clone, Serialize, Deserialize)]
41#[serde(untagged)]
42pub enum GetDataroomDataroomsByIdError {
43 UnknownValue(serde_json::Value),
44}
45
46#[derive(Debug, Clone, Serialize, Deserialize)]
48#[serde(untagged)]
49pub enum GetDataroomDocumentsError {
50 UnknownValue(serde_json::Value),
51}
52
53#[derive(Debug, Clone, Serialize, Deserialize)]
55#[serde(untagged)]
56pub enum GetDataroomDocumentsByIdError {
57 UnknownValue(serde_json::Value),
58}
59
60#[derive(Debug, Clone, Serialize, Deserialize)]
62#[serde(untagged)]
63pub enum GetDataroomDocumentsByIdFileError {
64 UnknownValue(serde_json::Value),
65}
66
67#[derive(Debug, Clone, Serialize, Deserialize)]
69#[serde(untagged)]
70pub enum GetDataroomHealthError {
71 UnknownValue(serde_json::Value),
72}
73
74#[derive(Debug, Clone, Serialize, Deserialize)]
76#[serde(untagged)]
77pub enum GetDataroomLinksError {
78 UnknownValue(serde_json::Value),
79}
80
81#[derive(Debug, Clone, Serialize, Deserialize)]
83#[serde(untagged)]
84pub enum GetDataroomTrustError {
85 UnknownValue(serde_json::Value),
86}
87
88#[derive(Debug, Clone, Serialize, Deserialize)]
90#[serde(untagged)]
91pub enum GetDataroomTrustCenterBySlugError {
92 UnknownValue(serde_json::Value),
93}
94
95#[derive(Debug, Clone, Serialize, Deserialize)]
97#[serde(untagged)]
98pub enum GetDataroomTrustCenterBySlugFileByItemError {
99 UnknownValue(serde_json::Value),
100}
101
102#[derive(Debug, Clone, Serialize, Deserialize)]
104#[serde(untagged)]
105pub enum GetDataroomViewByLinkidError {
106 UnknownValue(serde_json::Value),
107}
108
109#[derive(Debug, Clone, Serialize, Deserialize)]
111#[serde(untagged)]
112pub enum GetDataroomViewByLinkidDocumentByDocumentidFileError {
113 UnknownValue(serde_json::Value),
114}
115
116#[derive(Debug, Clone, Serialize, Deserialize)]
118#[serde(untagged)]
119pub enum PatchDataroomTrustArtifactsByIdError {
120 UnknownValue(serde_json::Value),
121}
122
123#[derive(Debug, Clone, Serialize, Deserialize)]
125#[serde(untagged)]
126pub enum PostDataroomDataroomsError {
127 UnknownValue(serde_json::Value),
128}
129
130#[derive(Debug, Clone, Serialize, Deserialize)]
132#[serde(untagged)]
133pub enum PostDataroomDataroomsByIdDocumentsError {
134 UnknownValue(serde_json::Value),
135}
136
137#[derive(Debug, Clone, Serialize, Deserialize)]
139#[serde(untagged)]
140pub enum PostDataroomDocumentsError {
141 UnknownValue(serde_json::Value),
142}
143
144#[derive(Debug, Clone, Serialize, Deserialize)]
146#[serde(untagged)]
147pub enum PostDataroomLinksError {
148 UnknownValue(serde_json::Value),
149}
150
151#[derive(Debug, Clone, Serialize, Deserialize)]
153#[serde(untagged)]
154pub enum PostDataroomTrustArtifactsError {
155 UnknownValue(serde_json::Value),
156}
157
158#[derive(Debug, Clone, Serialize, Deserialize)]
160#[serde(untagged)]
161pub enum PostDataroomTrustCenterBySlugRequestsError {
162 UnknownValue(serde_json::Value),
163}
164
165#[derive(Debug, Clone, Serialize, Deserialize)]
167#[serde(untagged)]
168pub enum PostDataroomTrustRequestsByIdGrantError {
169 UnknownValue(serde_json::Value),
170}
171
172#[derive(Debug, Clone, Serialize, Deserialize)]
174#[serde(untagged)]
175pub enum PostDataroomTrustRequestsByIdRefuseError {
176 UnknownValue(serde_json::Value),
177}
178
179#[derive(Debug, Clone, Serialize, Deserialize)]
181#[serde(untagged)]
182pub enum PostDataroomViewByLinkidAuthenticateError {
183 UnknownValue(serde_json::Value),
184}
185
186#[derive(Debug, Clone, Serialize, Deserialize)]
188#[serde(untagged)]
189pub enum PostDataroomViewByLinkidPageviewError {
190 UnknownValue(serde_json::Value),
191}
192
193#[derive(Debug, Clone, Serialize, Deserialize)]
195#[serde(untagged)]
196pub enum PutDataroomTrustError {
197 UnknownValue(serde_json::Value),
198}
199
200
201pub async fn get_dataroom_analytics_dataroom_by_dataroomid(configuration: &configuration::Configuration, dataroom_id: &str) -> Result<models::DataroomStats, Error<GetDataroomAnalyticsDataroomByDataroomidError>> {
203 let p_dataroom_id = dataroom_id;
205
206 let uri_str = format!("{}/v1/dataroom/analytics/dataroom/{dataroomId}", configuration.base_path, dataroomId=crate::apis::urlencode(p_dataroom_id));
207 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
208
209 if let Some(ref user_agent) = configuration.user_agent {
210 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
211 }
212 if let Some(ref token) = configuration.bearer_access_token {
213 req_builder = req_builder.bearer_auth(token.to_owned());
214 };
215
216 let req = req_builder.build()?;
217 let resp = configuration.client.execute(req).await?;
218
219 let status = resp.status();
220 let content_type = resp
221 .headers()
222 .get("content-type")
223 .and_then(|v| v.to_str().ok())
224 .unwrap_or("application/octet-stream");
225 let content_type = super::ContentType::from(content_type);
226
227 if !status.is_client_error() && !status.is_server_error() {
228 let content = resp.text().await?;
229 match content_type {
230 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
231 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DataroomStats`"))),
232 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::DataroomStats`")))),
233 }
234 } else {
235 let content = resp.text().await?;
236 let entity: Option<GetDataroomAnalyticsDataroomByDataroomidError> = serde_json::from_str(&content).ok();
237 Err(Error::ResponseError(ResponseContent { status, content, entity }))
238 }
239}
240
241pub async fn get_dataroom_analytics_link_by_linkid(configuration: &configuration::Configuration, link_id: &str) -> Result<models::DataroomLinkStats, Error<GetDataroomAnalyticsLinkByLinkidError>> {
243 let p_link_id = link_id;
245
246 let uri_str = format!("{}/v1/dataroom/analytics/link/{linkId}", configuration.base_path, linkId=crate::apis::urlencode(p_link_id));
247 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
248
249 if let Some(ref user_agent) = configuration.user_agent {
250 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
251 }
252 if let Some(ref token) = configuration.bearer_access_token {
253 req_builder = req_builder.bearer_auth(token.to_owned());
254 };
255
256 let req = req_builder.build()?;
257 let resp = configuration.client.execute(req).await?;
258
259 let status = resp.status();
260 let content_type = resp
261 .headers()
262 .get("content-type")
263 .and_then(|v| v.to_str().ok())
264 .unwrap_or("application/octet-stream");
265 let content_type = super::ContentType::from(content_type);
266
267 if !status.is_client_error() && !status.is_server_error() {
268 let content = resp.text().await?;
269 match content_type {
270 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
271 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DataroomLinkStats`"))),
272 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::DataroomLinkStats`")))),
273 }
274 } else {
275 let content = resp.text().await?;
276 let entity: Option<GetDataroomAnalyticsLinkByLinkidError> = serde_json::from_str(&content).ok();
277 Err(Error::ResponseError(ResponseContent { status, content, entity }))
278 }
279}
280
281pub async fn get_dataroom_datarooms(configuration: &configuration::Configuration, ) -> Result<models::DataroomRooms, Error<GetDataroomDataroomsError>> {
283
284 let uri_str = format!("{}/v1/dataroom/datarooms", configuration.base_path);
285 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
286
287 if let Some(ref user_agent) = configuration.user_agent {
288 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
289 }
290 if let Some(ref token) = configuration.bearer_access_token {
291 req_builder = req_builder.bearer_auth(token.to_owned());
292 };
293
294 let req = req_builder.build()?;
295 let resp = configuration.client.execute(req).await?;
296
297 let status = resp.status();
298 let content_type = resp
299 .headers()
300 .get("content-type")
301 .and_then(|v| v.to_str().ok())
302 .unwrap_or("application/octet-stream");
303 let content_type = super::ContentType::from(content_type);
304
305 if !status.is_client_error() && !status.is_server_error() {
306 let content = resp.text().await?;
307 match content_type {
308 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
309 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DataroomRooms`"))),
310 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::DataroomRooms`")))),
311 }
312 } else {
313 let content = resp.text().await?;
314 let entity: Option<GetDataroomDataroomsError> = serde_json::from_str(&content).ok();
315 Err(Error::ResponseError(ResponseContent { status, content, entity }))
316 }
317}
318
319pub async fn get_dataroom_datarooms_by_id(configuration: &configuration::Configuration, id: &str) -> Result<models::DataroomRoomDetailOne, Error<GetDataroomDataroomsByIdError>> {
321 let p_id = id;
323
324 let uri_str = format!("{}/v1/dataroom/datarooms/{id}", configuration.base_path, id=crate::apis::urlencode(p_id));
325 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
326
327 if let Some(ref user_agent) = configuration.user_agent {
328 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
329 }
330 if let Some(ref token) = configuration.bearer_access_token {
331 req_builder = req_builder.bearer_auth(token.to_owned());
332 };
333
334 let req = req_builder.build()?;
335 let resp = configuration.client.execute(req).await?;
336
337 let status = resp.status();
338 let content_type = resp
339 .headers()
340 .get("content-type")
341 .and_then(|v| v.to_str().ok())
342 .unwrap_or("application/octet-stream");
343 let content_type = super::ContentType::from(content_type);
344
345 if !status.is_client_error() && !status.is_server_error() {
346 let content = resp.text().await?;
347 match content_type {
348 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
349 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DataroomRoomDetailOne`"))),
350 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::DataroomRoomDetailOne`")))),
351 }
352 } else {
353 let content = resp.text().await?;
354 let entity: Option<GetDataroomDataroomsByIdError> = serde_json::from_str(&content).ok();
355 Err(Error::ResponseError(ResponseContent { status, content, entity }))
356 }
357}
358
359pub async fn get_dataroom_documents(configuration: &configuration::Configuration, ) -> Result<models::DataroomDocuments, Error<GetDataroomDocumentsError>> {
361
362 let uri_str = format!("{}/v1/dataroom/documents", configuration.base_path);
363 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
364
365 if let Some(ref user_agent) = configuration.user_agent {
366 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
367 }
368 if let Some(ref token) = configuration.bearer_access_token {
369 req_builder = req_builder.bearer_auth(token.to_owned());
370 };
371
372 let req = req_builder.build()?;
373 let resp = configuration.client.execute(req).await?;
374
375 let status = resp.status();
376 let content_type = resp
377 .headers()
378 .get("content-type")
379 .and_then(|v| v.to_str().ok())
380 .unwrap_or("application/octet-stream");
381 let content_type = super::ContentType::from(content_type);
382
383 if !status.is_client_error() && !status.is_server_error() {
384 let content = resp.text().await?;
385 match content_type {
386 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
387 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DataroomDocuments`"))),
388 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::DataroomDocuments`")))),
389 }
390 } else {
391 let content = resp.text().await?;
392 let entity: Option<GetDataroomDocumentsError> = serde_json::from_str(&content).ok();
393 Err(Error::ResponseError(ResponseContent { status, content, entity }))
394 }
395}
396
397pub async fn get_dataroom_documents_by_id(configuration: &configuration::Configuration, id: &str) -> Result<models::DataroomDocumentOne, Error<GetDataroomDocumentsByIdError>> {
399 let p_id = id;
401
402 let uri_str = format!("{}/v1/dataroom/documents/{id}", configuration.base_path, id=crate::apis::urlencode(p_id));
403 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
404
405 if let Some(ref user_agent) = configuration.user_agent {
406 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
407 }
408 if let Some(ref token) = configuration.bearer_access_token {
409 req_builder = req_builder.bearer_auth(token.to_owned());
410 };
411
412 let req = req_builder.build()?;
413 let resp = configuration.client.execute(req).await?;
414
415 let status = resp.status();
416 let content_type = resp
417 .headers()
418 .get("content-type")
419 .and_then(|v| v.to_str().ok())
420 .unwrap_or("application/octet-stream");
421 let content_type = super::ContentType::from(content_type);
422
423 if !status.is_client_error() && !status.is_server_error() {
424 let content = resp.text().await?;
425 match content_type {
426 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
427 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DataroomDocumentOne`"))),
428 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::DataroomDocumentOne`")))),
429 }
430 } else {
431 let content = resp.text().await?;
432 let entity: Option<GetDataroomDocumentsByIdError> = serde_json::from_str(&content).ok();
433 Err(Error::ResponseError(ResponseContent { status, content, entity }))
434 }
435}
436
437pub async fn get_dataroom_documents_by_id_file(configuration: &configuration::Configuration, id: &str) -> Result<(), Error<GetDataroomDocumentsByIdFileError>> {
439 let p_id = id;
441
442 let uri_str = format!("{}/v1/dataroom/documents/{id}/file", configuration.base_path, id=crate::apis::urlencode(p_id));
443 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
444
445 if let Some(ref user_agent) = configuration.user_agent {
446 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
447 }
448 if let Some(ref token) = configuration.bearer_access_token {
449 req_builder = req_builder.bearer_auth(token.to_owned());
450 };
451
452 let req = req_builder.build()?;
453 let resp = configuration.client.execute(req).await?;
454
455 let status = resp.status();
456
457 if !status.is_client_error() && !status.is_server_error() {
458 Ok(())
459 } else {
460 let content = resp.text().await?;
461 let entity: Option<GetDataroomDocumentsByIdFileError> = serde_json::from_str(&content).ok();
462 Err(Error::ResponseError(ResponseContent { status, content, entity }))
463 }
464}
465
466pub async fn get_dataroom_health(configuration: &configuration::Configuration, ) -> Result<models::DataroomLiveness, Error<GetDataroomHealthError>> {
468
469 let uri_str = format!("{}/v1/dataroom/health", configuration.base_path);
470 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
471
472 if let Some(ref user_agent) = configuration.user_agent {
473 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
474 }
475 if let Some(ref token) = configuration.bearer_access_token {
476 req_builder = req_builder.bearer_auth(token.to_owned());
477 };
478
479 let req = req_builder.build()?;
480 let resp = configuration.client.execute(req).await?;
481
482 let status = resp.status();
483 let content_type = resp
484 .headers()
485 .get("content-type")
486 .and_then(|v| v.to_str().ok())
487 .unwrap_or("application/octet-stream");
488 let content_type = super::ContentType::from(content_type);
489
490 if !status.is_client_error() && !status.is_server_error() {
491 let content = resp.text().await?;
492 match content_type {
493 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
494 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DataroomLiveness`"))),
495 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::DataroomLiveness`")))),
496 }
497 } else {
498 let content = resp.text().await?;
499 let entity: Option<GetDataroomHealthError> = serde_json::from_str(&content).ok();
500 Err(Error::ResponseError(ResponseContent { status, content, entity }))
501 }
502}
503
504pub async fn get_dataroom_links(configuration: &configuration::Configuration, ) -> Result<models::DataroomLinks, Error<GetDataroomLinksError>> {
506
507 let uri_str = format!("{}/v1/dataroom/links", configuration.base_path);
508 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
509
510 if let Some(ref user_agent) = configuration.user_agent {
511 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
512 }
513 if let Some(ref token) = configuration.bearer_access_token {
514 req_builder = req_builder.bearer_auth(token.to_owned());
515 };
516
517 let req = req_builder.build()?;
518 let resp = configuration.client.execute(req).await?;
519
520 let status = resp.status();
521 let content_type = resp
522 .headers()
523 .get("content-type")
524 .and_then(|v| v.to_str().ok())
525 .unwrap_or("application/octet-stream");
526 let content_type = super::ContentType::from(content_type);
527
528 if !status.is_client_error() && !status.is_server_error() {
529 let content = resp.text().await?;
530 match content_type {
531 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
532 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DataroomLinks`"))),
533 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::DataroomLinks`")))),
534 }
535 } else {
536 let content = resp.text().await?;
537 let entity: Option<GetDataroomLinksError> = serde_json::from_str(&content).ok();
538 Err(Error::ResponseError(ResponseContent { status, content, entity }))
539 }
540}
541
542pub async fn get_dataroom_trust(configuration: &configuration::Configuration, ) -> Result<models::TrustDesk, Error<GetDataroomTrustError>> {
544
545 let uri_str = format!("{}/v1/dataroom/trust", configuration.base_path);
546 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
547
548 if let Some(ref user_agent) = configuration.user_agent {
549 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
550 }
551 if let Some(ref token) = configuration.bearer_access_token {
552 req_builder = req_builder.bearer_auth(token.to_owned());
553 };
554
555 let req = req_builder.build()?;
556 let resp = configuration.client.execute(req).await?;
557
558 let status = resp.status();
559 let content_type = resp
560 .headers()
561 .get("content-type")
562 .and_then(|v| v.to_str().ok())
563 .unwrap_or("application/octet-stream");
564 let content_type = super::ContentType::from(content_type);
565
566 if !status.is_client_error() && !status.is_server_error() {
567 let content = resp.text().await?;
568 match content_type {
569 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
570 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TrustDesk`"))),
571 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::TrustDesk`")))),
572 }
573 } else {
574 let content = resp.text().await?;
575 let entity: Option<GetDataroomTrustError> = serde_json::from_str(&content).ok();
576 Err(Error::ResponseError(ResponseContent { status, content, entity }))
577 }
578}
579
580pub async fn get_dataroom_trust_center_by_slug(configuration: &configuration::Configuration, slug: &str) -> Result<models::TrustPage, Error<GetDataroomTrustCenterBySlugError>> {
582 let p_slug = slug;
584
585 let uri_str = format!("{}/v1/dataroom/trust/center/{slug}", configuration.base_path, slug=crate::apis::urlencode(p_slug));
586 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
587
588 if let Some(ref user_agent) = configuration.user_agent {
589 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
590 }
591 if let Some(ref token) = configuration.bearer_access_token {
592 req_builder = req_builder.bearer_auth(token.to_owned());
593 };
594
595 let req = req_builder.build()?;
596 let resp = configuration.client.execute(req).await?;
597
598 let status = resp.status();
599 let content_type = resp
600 .headers()
601 .get("content-type")
602 .and_then(|v| v.to_str().ok())
603 .unwrap_or("application/octet-stream");
604 let content_type = super::ContentType::from(content_type);
605
606 if !status.is_client_error() && !status.is_server_error() {
607 let content = resp.text().await?;
608 match content_type {
609 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
610 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TrustPage`"))),
611 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::TrustPage`")))),
612 }
613 } else {
614 let content = resp.text().await?;
615 let entity: Option<GetDataroomTrustCenterBySlugError> = serde_json::from_str(&content).ok();
616 Err(Error::ResponseError(ResponseContent { status, content, entity }))
617 }
618}
619
620pub async fn get_dataroom_trust_center_by_slug_file_by_item(configuration: &configuration::Configuration, slug: &str, item: &str) -> Result<(), Error<GetDataroomTrustCenterBySlugFileByItemError>> {
622 let p_slug = slug;
624 let p_item = item;
625
626 let uri_str = format!("{}/v1/dataroom/trust/center/{slug}/file/{item}", configuration.base_path, slug=crate::apis::urlencode(p_slug), item=crate::apis::urlencode(p_item));
627 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
628
629 if let Some(ref user_agent) = configuration.user_agent {
630 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
631 }
632 if let Some(ref token) = configuration.bearer_access_token {
633 req_builder = req_builder.bearer_auth(token.to_owned());
634 };
635
636 let req = req_builder.build()?;
637 let resp = configuration.client.execute(req).await?;
638
639 let status = resp.status();
640
641 if !status.is_client_error() && !status.is_server_error() {
642 Ok(())
643 } else {
644 let content = resp.text().await?;
645 let entity: Option<GetDataroomTrustCenterBySlugFileByItemError> = serde_json::from_str(&content).ok();
646 Err(Error::ResponseError(ResponseContent { status, content, entity }))
647 }
648}
649
650pub async fn get_dataroom_view_by_linkid(configuration: &configuration::Configuration, link_id: &str) -> Result<(), Error<GetDataroomViewByLinkidError>> {
652 let p_link_id = link_id;
654
655 let uri_str = format!("{}/v1/dataroom/view/{linkId}", configuration.base_path, linkId=crate::apis::urlencode(p_link_id));
656 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
657
658 if let Some(ref user_agent) = configuration.user_agent {
659 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
660 }
661 if let Some(ref token) = configuration.bearer_access_token {
662 req_builder = req_builder.bearer_auth(token.to_owned());
663 };
664
665 let req = req_builder.build()?;
666 let resp = configuration.client.execute(req).await?;
667
668 let status = resp.status();
669
670 if !status.is_client_error() && !status.is_server_error() {
671 Ok(())
672 } else {
673 let content = resp.text().await?;
674 let entity: Option<GetDataroomViewByLinkidError> = serde_json::from_str(&content).ok();
675 Err(Error::ResponseError(ResponseContent { status, content, entity }))
676 }
677}
678
679pub async fn get_dataroom_view_by_linkid_document_by_documentid_file(configuration: &configuration::Configuration, link_id: &str, document_id: &str) -> Result<(), Error<GetDataroomViewByLinkidDocumentByDocumentidFileError>> {
681 let p_link_id = link_id;
683 let p_document_id = document_id;
684
685 let uri_str = format!("{}/v1/dataroom/view/{linkId}/document/{documentId}/file", configuration.base_path, linkId=crate::apis::urlencode(p_link_id), documentId=crate::apis::urlencode(p_document_id));
686 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
687
688 if let Some(ref user_agent) = configuration.user_agent {
689 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
690 }
691 if let Some(ref token) = configuration.bearer_access_token {
692 req_builder = req_builder.bearer_auth(token.to_owned());
693 };
694
695 let req = req_builder.build()?;
696 let resp = configuration.client.execute(req).await?;
697
698 let status = resp.status();
699
700 if !status.is_client_error() && !status.is_server_error() {
701 Ok(())
702 } else {
703 let content = resp.text().await?;
704 let entity: Option<GetDataroomViewByLinkidDocumentByDocumentidFileError> = serde_json::from_str(&content).ok();
705 Err(Error::ResponseError(ResponseContent { status, content, entity }))
706 }
707}
708
709pub async fn patch_dataroom_trust_artifacts_by_id(configuration: &configuration::Configuration, id: &str, trust_edit: models::TrustEdit) -> Result<models::TrustItemView, Error<PatchDataroomTrustArtifactsByIdError>> {
711 let p_id = id;
713 let p_trust_edit = trust_edit;
714
715 let uri_str = format!("{}/v1/dataroom/trust/artifacts/{id}", configuration.base_path, id=crate::apis::urlencode(p_id));
716 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
717
718 if let Some(ref user_agent) = configuration.user_agent {
719 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
720 }
721 if let Some(ref token) = configuration.bearer_access_token {
722 req_builder = req_builder.bearer_auth(token.to_owned());
723 };
724 req_builder = req_builder.json(&p_trust_edit);
725
726 let req = req_builder.build()?;
727 let resp = configuration.client.execute(req).await?;
728
729 let status = resp.status();
730 let content_type = resp
731 .headers()
732 .get("content-type")
733 .and_then(|v| v.to_str().ok())
734 .unwrap_or("application/octet-stream");
735 let content_type = super::ContentType::from(content_type);
736
737 if !status.is_client_error() && !status.is_server_error() {
738 let content = resp.text().await?;
739 match content_type {
740 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
741 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TrustItemView`"))),
742 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::TrustItemView`")))),
743 }
744 } else {
745 let content = resp.text().await?;
746 let entity: Option<PatchDataroomTrustArtifactsByIdError> = serde_json::from_str(&content).ok();
747 Err(Error::ResponseError(ResponseContent { status, content, entity }))
748 }
749}
750
751pub async fn post_dataroom_datarooms(configuration: &configuration::Configuration, dataroom_create: models::DataroomCreate) -> Result<models::DataroomRoomOne, Error<PostDataroomDataroomsError>> {
753 let p_dataroom_create = dataroom_create;
755
756 let uri_str = format!("{}/v1/dataroom/datarooms", configuration.base_path);
757 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
758
759 if let Some(ref user_agent) = configuration.user_agent {
760 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
761 }
762 if let Some(ref token) = configuration.bearer_access_token {
763 req_builder = req_builder.bearer_auth(token.to_owned());
764 };
765 req_builder = req_builder.json(&p_dataroom_create);
766
767 let req = req_builder.build()?;
768 let resp = configuration.client.execute(req).await?;
769
770 let status = resp.status();
771 let content_type = resp
772 .headers()
773 .get("content-type")
774 .and_then(|v| v.to_str().ok())
775 .unwrap_or("application/octet-stream");
776 let content_type = super::ContentType::from(content_type);
777
778 if !status.is_client_error() && !status.is_server_error() {
779 let content = resp.text().await?;
780 match content_type {
781 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
782 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DataroomRoomOne`"))),
783 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::DataroomRoomOne`")))),
784 }
785 } else {
786 let content = resp.text().await?;
787 let entity: Option<PostDataroomDataroomsError> = serde_json::from_str(&content).ok();
788 Err(Error::ResponseError(ResponseContent { status, content, entity }))
789 }
790}
791
792pub async fn post_dataroom_datarooms_by_id_documents(configuration: &configuration::Configuration, id: &str, dataroom_add_document: models::DataroomAddDocument) -> Result<models::DataroomMembership, Error<PostDataroomDataroomsByIdDocumentsError>> {
794 let p_id = id;
796 let p_dataroom_add_document = dataroom_add_document;
797
798 let uri_str = format!("{}/v1/dataroom/datarooms/{id}/documents", configuration.base_path, id=crate::apis::urlencode(p_id));
799 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
800
801 if let Some(ref user_agent) = configuration.user_agent {
802 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
803 }
804 if let Some(ref token) = configuration.bearer_access_token {
805 req_builder = req_builder.bearer_auth(token.to_owned());
806 };
807 req_builder = req_builder.json(&p_dataroom_add_document);
808
809 let req = req_builder.build()?;
810 let resp = configuration.client.execute(req).await?;
811
812 let status = resp.status();
813 let content_type = resp
814 .headers()
815 .get("content-type")
816 .and_then(|v| v.to_str().ok())
817 .unwrap_or("application/octet-stream");
818 let content_type = super::ContentType::from(content_type);
819
820 if !status.is_client_error() && !status.is_server_error() {
821 let content = resp.text().await?;
822 match content_type {
823 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
824 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DataroomMembership`"))),
825 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::DataroomMembership`")))),
826 }
827 } else {
828 let content = resp.text().await?;
829 let entity: Option<PostDataroomDataroomsByIdDocumentsError> = serde_json::from_str(&content).ok();
830 Err(Error::ResponseError(ResponseContent { status, content, entity }))
831 }
832}
833
834pub async fn post_dataroom_documents(configuration: &configuration::Configuration, ) -> Result<(), Error<PostDataroomDocumentsError>> {
836
837 let uri_str = format!("{}/v1/dataroom/documents", configuration.base_path);
838 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
839
840 if let Some(ref user_agent) = configuration.user_agent {
841 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
842 }
843 if let Some(ref token) = configuration.bearer_access_token {
844 req_builder = req_builder.bearer_auth(token.to_owned());
845 };
846
847 let req = req_builder.build()?;
848 let resp = configuration.client.execute(req).await?;
849
850 let status = resp.status();
851
852 if !status.is_client_error() && !status.is_server_error() {
853 Ok(())
854 } else {
855 let content = resp.text().await?;
856 let entity: Option<PostDataroomDocumentsError> = serde_json::from_str(&content).ok();
857 Err(Error::ResponseError(ResponseContent { status, content, entity }))
858 }
859}
860
861pub async fn post_dataroom_links(configuration: &configuration::Configuration, dataroom_link_create: models::DataroomLinkCreate) -> Result<models::DataroomLinkOne, Error<PostDataroomLinksError>> {
863 let p_dataroom_link_create = dataroom_link_create;
865
866 let uri_str = format!("{}/v1/dataroom/links", configuration.base_path);
867 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
868
869 if let Some(ref user_agent) = configuration.user_agent {
870 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
871 }
872 if let Some(ref token) = configuration.bearer_access_token {
873 req_builder = req_builder.bearer_auth(token.to_owned());
874 };
875 req_builder = req_builder.json(&p_dataroom_link_create);
876
877 let req = req_builder.build()?;
878 let resp = configuration.client.execute(req).await?;
879
880 let status = resp.status();
881 let content_type = resp
882 .headers()
883 .get("content-type")
884 .and_then(|v| v.to_str().ok())
885 .unwrap_or("application/octet-stream");
886 let content_type = super::ContentType::from(content_type);
887
888 if !status.is_client_error() && !status.is_server_error() {
889 let content = resp.text().await?;
890 match content_type {
891 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
892 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DataroomLinkOne`"))),
893 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::DataroomLinkOne`")))),
894 }
895 } else {
896 let content = resp.text().await?;
897 let entity: Option<PostDataroomLinksError> = serde_json::from_str(&content).ok();
898 Err(Error::ResponseError(ResponseContent { status, content, entity }))
899 }
900}
901
902pub async fn post_dataroom_trust_artifacts(configuration: &configuration::Configuration, trust_publish: models::TrustPublish) -> Result<models::TrustItemView, Error<PostDataroomTrustArtifactsError>> {
904 let p_trust_publish = trust_publish;
906
907 let uri_str = format!("{}/v1/dataroom/trust/artifacts", configuration.base_path);
908 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
909
910 if let Some(ref user_agent) = configuration.user_agent {
911 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
912 }
913 if let Some(ref token) = configuration.bearer_access_token {
914 req_builder = req_builder.bearer_auth(token.to_owned());
915 };
916 req_builder = req_builder.json(&p_trust_publish);
917
918 let req = req_builder.build()?;
919 let resp = configuration.client.execute(req).await?;
920
921 let status = resp.status();
922 let content_type = resp
923 .headers()
924 .get("content-type")
925 .and_then(|v| v.to_str().ok())
926 .unwrap_or("application/octet-stream");
927 let content_type = super::ContentType::from(content_type);
928
929 if !status.is_client_error() && !status.is_server_error() {
930 let content = resp.text().await?;
931 match content_type {
932 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
933 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TrustItemView`"))),
934 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::TrustItemView`")))),
935 }
936 } else {
937 let content = resp.text().await?;
938 let entity: Option<PostDataroomTrustArtifactsError> = serde_json::from_str(&content).ok();
939 Err(Error::ResponseError(ResponseContent { status, content, entity }))
940 }
941}
942
943pub async fn post_dataroom_trust_center_by_slug_requests(configuration: &configuration::Configuration, slug: &str, trust_ask: models::TrustAsk) -> Result<models::TrustAsked, Error<PostDataroomTrustCenterBySlugRequestsError>> {
945 let p_slug = slug;
947 let p_trust_ask = trust_ask;
948
949 let uri_str = format!("{}/v1/dataroom/trust/center/{slug}/requests", configuration.base_path, slug=crate::apis::urlencode(p_slug));
950 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
951
952 if let Some(ref user_agent) = configuration.user_agent {
953 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
954 }
955 if let Some(ref token) = configuration.bearer_access_token {
956 req_builder = req_builder.bearer_auth(token.to_owned());
957 };
958 req_builder = req_builder.json(&p_trust_ask);
959
960 let req = req_builder.build()?;
961 let resp = configuration.client.execute(req).await?;
962
963 let status = resp.status();
964 let content_type = resp
965 .headers()
966 .get("content-type")
967 .and_then(|v| v.to_str().ok())
968 .unwrap_or("application/octet-stream");
969 let content_type = super::ContentType::from(content_type);
970
971 if !status.is_client_error() && !status.is_server_error() {
972 let content = resp.text().await?;
973 match content_type {
974 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
975 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TrustAsked`"))),
976 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::TrustAsked`")))),
977 }
978 } else {
979 let content = resp.text().await?;
980 let entity: Option<PostDataroomTrustCenterBySlugRequestsError> = serde_json::from_str(&content).ok();
981 Err(Error::ResponseError(ResponseContent { status, content, entity }))
982 }
983}
984
985pub async fn post_dataroom_trust_requests_by_id_grant(configuration: &configuration::Configuration, id: &str, trust_decision: models::TrustDecision) -> Result<models::TrustGranted, Error<PostDataroomTrustRequestsByIdGrantError>> {
987 let p_id = id;
989 let p_trust_decision = trust_decision;
990
991 let uri_str = format!("{}/v1/dataroom/trust/requests/{id}/grant", configuration.base_path, id=crate::apis::urlencode(p_id));
992 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
993
994 if let Some(ref user_agent) = configuration.user_agent {
995 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
996 }
997 if let Some(ref token) = configuration.bearer_access_token {
998 req_builder = req_builder.bearer_auth(token.to_owned());
999 };
1000 req_builder = req_builder.json(&p_trust_decision);
1001
1002 let req = req_builder.build()?;
1003 let resp = configuration.client.execute(req).await?;
1004
1005 let status = resp.status();
1006 let content_type = resp
1007 .headers()
1008 .get("content-type")
1009 .and_then(|v| v.to_str().ok())
1010 .unwrap_or("application/octet-stream");
1011 let content_type = super::ContentType::from(content_type);
1012
1013 if !status.is_client_error() && !status.is_server_error() {
1014 let content = resp.text().await?;
1015 match content_type {
1016 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1017 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TrustGranted`"))),
1018 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::TrustGranted`")))),
1019 }
1020 } else {
1021 let content = resp.text().await?;
1022 let entity: Option<PostDataroomTrustRequestsByIdGrantError> = serde_json::from_str(&content).ok();
1023 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1024 }
1025}
1026
1027pub async fn post_dataroom_trust_requests_by_id_refuse(configuration: &configuration::Configuration, id: &str, trust_decision: models::TrustDecision) -> Result<models::TrustRefused, Error<PostDataroomTrustRequestsByIdRefuseError>> {
1029 let p_id = id;
1031 let p_trust_decision = trust_decision;
1032
1033 let uri_str = format!("{}/v1/dataroom/trust/requests/{id}/refuse", configuration.base_path, id=crate::apis::urlencode(p_id));
1034 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1035
1036 if let Some(ref user_agent) = configuration.user_agent {
1037 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1038 }
1039 if let Some(ref token) = configuration.bearer_access_token {
1040 req_builder = req_builder.bearer_auth(token.to_owned());
1041 };
1042 req_builder = req_builder.json(&p_trust_decision);
1043
1044 let req = req_builder.build()?;
1045 let resp = configuration.client.execute(req).await?;
1046
1047 let status = resp.status();
1048 let content_type = resp
1049 .headers()
1050 .get("content-type")
1051 .and_then(|v| v.to_str().ok())
1052 .unwrap_or("application/octet-stream");
1053 let content_type = super::ContentType::from(content_type);
1054
1055 if !status.is_client_error() && !status.is_server_error() {
1056 let content = resp.text().await?;
1057 match content_type {
1058 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1059 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TrustRefused`"))),
1060 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::TrustRefused`")))),
1061 }
1062 } else {
1063 let content = resp.text().await?;
1064 let entity: Option<PostDataroomTrustRequestsByIdRefuseError> = serde_json::from_str(&content).ok();
1065 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1066 }
1067}
1068
1069pub async fn post_dataroom_view_by_linkid_authenticate(configuration: &configuration::Configuration, link_id: &str) -> Result<(), Error<PostDataroomViewByLinkidAuthenticateError>> {
1071 let p_link_id = link_id;
1073
1074 let uri_str = format!("{}/v1/dataroom/view/{linkId}/authenticate", configuration.base_path, linkId=crate::apis::urlencode(p_link_id));
1075 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1076
1077 if let Some(ref user_agent) = configuration.user_agent {
1078 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1079 }
1080 if let Some(ref token) = configuration.bearer_access_token {
1081 req_builder = req_builder.bearer_auth(token.to_owned());
1082 };
1083
1084 let req = req_builder.build()?;
1085 let resp = configuration.client.execute(req).await?;
1086
1087 let status = resp.status();
1088
1089 if !status.is_client_error() && !status.is_server_error() {
1090 Ok(())
1091 } else {
1092 let content = resp.text().await?;
1093 let entity: Option<PostDataroomViewByLinkidAuthenticateError> = serde_json::from_str(&content).ok();
1094 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1095 }
1096}
1097
1098pub async fn post_dataroom_view_by_linkid_pageview(configuration: &configuration::Configuration, link_id: &str) -> Result<(), Error<PostDataroomViewByLinkidPageviewError>> {
1100 let p_link_id = link_id;
1102
1103 let uri_str = format!("{}/v1/dataroom/view/{linkId}/pageview", configuration.base_path, linkId=crate::apis::urlencode(p_link_id));
1104 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1105
1106 if let Some(ref user_agent) = configuration.user_agent {
1107 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1108 }
1109 if let Some(ref token) = configuration.bearer_access_token {
1110 req_builder = req_builder.bearer_auth(token.to_owned());
1111 };
1112
1113 let req = req_builder.build()?;
1114 let resp = configuration.client.execute(req).await?;
1115
1116 let status = resp.status();
1117
1118 if !status.is_client_error() && !status.is_server_error() {
1119 Ok(())
1120 } else {
1121 let content = resp.text().await?;
1122 let entity: Option<PostDataroomViewByLinkidPageviewError> = serde_json::from_str(&content).ok();
1123 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1124 }
1125}
1126
1127pub async fn put_dataroom_trust(configuration: &configuration::Configuration, trust_settings: models::TrustSettings) -> Result<models::TrustDesk, Error<PutDataroomTrustError>> {
1129 let p_trust_settings = trust_settings;
1131
1132 let uri_str = format!("{}/v1/dataroom/trust", configuration.base_path);
1133 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
1134
1135 if let Some(ref user_agent) = configuration.user_agent {
1136 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1137 }
1138 if let Some(ref token) = configuration.bearer_access_token {
1139 req_builder = req_builder.bearer_auth(token.to_owned());
1140 };
1141 req_builder = req_builder.json(&p_trust_settings);
1142
1143 let req = req_builder.build()?;
1144 let resp = configuration.client.execute(req).await?;
1145
1146 let status = resp.status();
1147 let content_type = resp
1148 .headers()
1149 .get("content-type")
1150 .and_then(|v| v.to_str().ok())
1151 .unwrap_or("application/octet-stream");
1152 let content_type = super::ContentType::from(content_type);
1153
1154 if !status.is_client_error() && !status.is_server_error() {
1155 let content = resp.text().await?;
1156 match content_type {
1157 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1158 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TrustDesk`"))),
1159 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::TrustDesk`")))),
1160 }
1161 } else {
1162 let content = resp.text().await?;
1163 let entity: Option<PutDataroomTrustError> = serde_json::from_str(&content).ok();
1164 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1165 }
1166}
1167