artcoded_api/apis/
dossier_controller_api.rs

1/*
2 * Artcoded
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 1.0.0
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use super::{configuration, ContentType, Error};
12use crate::{apis::ResponseContent, models};
13use reqwest;
14use serde::{de::Error as _, Deserialize, Serialize};
15
16/// struct for typed errors of method [`active_dossier`]
17#[derive(Debug, Clone, Serialize, Deserialize)]
18#[serde(untagged)]
19pub enum ActiveDossierError {
20    UnknownValue(serde_json::Value),
21}
22
23/// struct for typed errors of method [`add_document_to_dossier`]
24#[derive(Debug, Clone, Serialize, Deserialize)]
25#[serde(untagged)]
26pub enum AddDocumentToDossierError {
27    UnknownValue(serde_json::Value),
28}
29
30/// struct for typed errors of method [`bookmarked`]
31#[derive(Debug, Clone, Serialize, Deserialize)]
32#[serde(untagged)]
33pub enum BookmarkedError {
34    UnknownValue(serde_json::Value),
35}
36
37/// struct for typed errors of method [`close_active_dossier`]
38#[derive(Debug, Clone, Serialize, Deserialize)]
39#[serde(untagged)]
40pub enum CloseActiveDossierError {
41    UnknownValue(serde_json::Value),
42}
43
44/// struct for typed errors of method [`delete3`]
45#[derive(Debug, Clone, Serialize, Deserialize)]
46#[serde(untagged)]
47pub enum Delete3Error {
48    UnknownValue(serde_json::Value),
49}
50
51/// struct for typed errors of method [`find_all8`]
52#[derive(Debug, Clone, Serialize, Deserialize)]
53#[serde(untagged)]
54pub enum FindAll8Error {
55    UnknownValue(serde_json::Value),
56}
57
58/// struct for typed errors of method [`find_all_paged`]
59#[derive(Debug, Clone, Serialize, Deserialize)]
60#[serde(untagged)]
61pub enum FindAllPagedError {
62    UnknownValue(serde_json::Value),
63}
64
65/// struct for typed errors of method [`find_by_fee_id`]
66#[derive(Debug, Clone, Serialize, Deserialize)]
67#[serde(untagged)]
68pub enum FindByFeeIdError {
69    UnknownValue(serde_json::Value),
70}
71
72/// struct for typed errors of method [`find_by_id3`]
73#[derive(Debug, Clone, Serialize, Deserialize)]
74#[serde(untagged)]
75pub enum FindById3Error {
76    UnknownValue(serde_json::Value),
77}
78
79/// struct for typed errors of method [`generate_summary`]
80#[derive(Debug, Clone, Serialize, Deserialize)]
81#[serde(untagged)]
82pub enum GenerateSummaryError {
83    UnknownValue(serde_json::Value),
84}
85
86/// struct for typed errors of method [`get_dossier_total_size`]
87#[derive(Debug, Clone, Serialize, Deserialize)]
88#[serde(untagged)]
89pub enum GetDossierTotalSizeError {
90    UnknownValue(serde_json::Value),
91}
92
93/// struct for typed errors of method [`get_import_dossier_xlsx_example`]
94#[derive(Debug, Clone, Serialize, Deserialize)]
95#[serde(untagged)]
96pub enum GetImportDossierXlsxExampleError {
97    UnknownValue(serde_json::Value),
98}
99
100/// struct for typed errors of method [`get_summaries`]
101#[derive(Debug, Clone, Serialize, Deserialize)]
102#[serde(untagged)]
103pub enum GetSummariesError {
104    UnknownValue(serde_json::Value),
105}
106
107/// struct for typed errors of method [`get_summaries1`]
108#[derive(Debug, Clone, Serialize, Deserialize)]
109#[serde(untagged)]
110pub enum GetSummaries1Error {
111    UnknownValue(serde_json::Value),
112}
113
114/// struct for typed errors of method [`get_summary`]
115#[derive(Debug, Clone, Serialize, Deserialize)]
116#[serde(untagged)]
117pub enum GetSummaryError {
118    UnknownValue(serde_json::Value),
119}
120
121/// struct for typed errors of method [`import_dossier_from_zip`]
122#[derive(Debug, Clone, Serialize, Deserialize)]
123#[serde(untagged)]
124pub enum ImportDossierFromZipError {
125    UnknownValue(serde_json::Value),
126}
127
128/// struct for typed errors of method [`new_dossier`]
129#[derive(Debug, Clone, Serialize, Deserialize)]
130#[serde(untagged)]
131pub enum NewDossierError {
132    UnknownValue(serde_json::Value),
133}
134
135/// struct for typed errors of method [`new_from_previous`]
136#[derive(Debug, Clone, Serialize, Deserialize)]
137#[serde(untagged)]
138pub enum NewFromPreviousError {
139    UnknownValue(serde_json::Value),
140}
141
142/// struct for typed errors of method [`process_fees_for_dossier`]
143#[derive(Debug, Clone, Serialize, Deserialize)]
144#[serde(untagged)]
145pub enum ProcessFeesForDossierError {
146    UnknownValue(serde_json::Value),
147}
148
149/// struct for typed errors of method [`process_invoice_for_dossier`]
150#[derive(Debug, Clone, Serialize, Deserialize)]
151#[serde(untagged)]
152pub enum ProcessInvoiceForDossierError {
153    UnknownValue(serde_json::Value),
154}
155
156/// struct for typed errors of method [`recall_for_modification`]
157#[derive(Debug, Clone, Serialize, Deserialize)]
158#[serde(untagged)]
159pub enum RecallForModificationError {
160    UnknownValue(serde_json::Value),
161}
162
163/// struct for typed errors of method [`remove_document`]
164#[derive(Debug, Clone, Serialize, Deserialize)]
165#[serde(untagged)]
166pub enum RemoveDocumentError {
167    UnknownValue(serde_json::Value),
168}
169
170/// struct for typed errors of method [`remove_fee`]
171#[derive(Debug, Clone, Serialize, Deserialize)]
172#[serde(untagged)]
173pub enum RemoveFeeError {
174    UnknownValue(serde_json::Value),
175}
176
177/// struct for typed errors of method [`remove_invoice`]
178#[derive(Debug, Clone, Serialize, Deserialize)]
179#[serde(untagged)]
180pub enum RemoveInvoiceError {
181    UnknownValue(serde_json::Value),
182}
183
184/// struct for typed errors of method [`toggle_bookmarked3`]
185#[derive(Debug, Clone, Serialize, Deserialize)]
186#[serde(untagged)]
187pub enum ToggleBookmarked3Error {
188    UnknownValue(serde_json::Value),
189}
190
191/// struct for typed errors of method [`update_active_dossier`]
192#[derive(Debug, Clone, Serialize, Deserialize)]
193#[serde(untagged)]
194pub enum UpdateActiveDossierError {
195    UnknownValue(serde_json::Value),
196}
197
198pub async fn active_dossier(
199    configuration: &configuration::Configuration,
200) -> Result<models::Dossier, Error<ActiveDossierError>> {
201    let uri_str = format!("{}/api/dossier/active-dossier", configuration.base_path);
202    let mut req_builder = configuration
203        .client
204        .request(reqwest::Method::POST, &uri_str);
205
206    if let Some(ref user_agent) = configuration.user_agent {
207        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
208    }
209    if let Some(ref token) = configuration.bearer_access_token {
210        req_builder = req_builder.bearer_auth(token.to_owned());
211    };
212
213    let req = req_builder.build()?;
214    let resp = configuration.client.execute(req).await?;
215
216    let status = resp.status();
217    let content_type = resp
218        .headers()
219        .get("content-type")
220        .and_then(|v| v.to_str().ok())
221        .unwrap_or("application/octet-stream");
222    let content_type = super::ContentType::from(content_type);
223
224    if !status.is_client_error() && !status.is_server_error() {
225        let content = resp.text().await?;
226        match content_type {
227            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
228            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Dossier`"))),
229            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Dossier`")))),
230        }
231    } else {
232        let content = resp.text().await?;
233        let entity: Option<ActiveDossierError> = serde_json::from_str(&content).ok();
234        Err(Error::ResponseError(ResponseContent {
235            status,
236            content,
237            entity,
238        }))
239    }
240}
241
242pub async fn add_document_to_dossier(
243    configuration: &configuration::Configuration,
244    id: &str,
245) -> Result<(), Error<AddDocumentToDossierError>> {
246    // add a prefix to parameters to efficiently prevent name collisions
247    let p_query_id = id;
248
249    let uri_str = format!("{}/api/dossier/add-document", configuration.base_path);
250    let mut req_builder = configuration
251        .client
252        .request(reqwest::Method::POST, &uri_str);
253
254    req_builder = req_builder.query(&[("id", &p_query_id.to_string())]);
255    if let Some(ref user_agent) = configuration.user_agent {
256        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
257    }
258    if let Some(ref token) = configuration.bearer_access_token {
259        req_builder = req_builder.bearer_auth(token.to_owned());
260    };
261
262    let req = req_builder.build()?;
263    let resp = configuration.client.execute(req).await?;
264
265    let status = resp.status();
266
267    if !status.is_client_error() && !status.is_server_error() {
268        Ok(())
269    } else {
270        let content = resp.text().await?;
271        let entity: Option<AddDocumentToDossierError> = serde_json::from_str(&content).ok();
272        Err(Error::ResponseError(ResponseContent {
273            status,
274            content,
275            entity,
276        }))
277    }
278}
279
280pub async fn bookmarked(
281    configuration: &configuration::Configuration,
282    arg0: models::Pageable,
283) -> Result<models::PagedModelDossier, Error<BookmarkedError>> {
284    // add a prefix to parameters to efficiently prevent name collisions
285    let p_query_arg0 = arg0;
286
287    let uri_str = format!("{}/api/dossier/bookmarked", configuration.base_path);
288    let mut req_builder = configuration
289        .client
290        .request(reqwest::Method::POST, &uri_str);
291
292    req_builder = req_builder.query(&[("arg0", &p_query_arg0.to_string())]);
293    if let Some(ref user_agent) = configuration.user_agent {
294        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
295    }
296    if let Some(ref token) = configuration.bearer_access_token {
297        req_builder = req_builder.bearer_auth(token.to_owned());
298    };
299
300    let req = req_builder.build()?;
301    let resp = configuration.client.execute(req).await?;
302
303    let status = resp.status();
304    let content_type = resp
305        .headers()
306        .get("content-type")
307        .and_then(|v| v.to_str().ok())
308        .unwrap_or("application/octet-stream");
309    let content_type = super::ContentType::from(content_type);
310
311    if !status.is_client_error() && !status.is_server_error() {
312        let content = resp.text().await?;
313        match content_type {
314            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
315            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PagedModelDossier`"))),
316            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PagedModelDossier`")))),
317        }
318    } else {
319        let content = resp.text().await?;
320        let entity: Option<BookmarkedError> = serde_json::from_str(&content).ok();
321        Err(Error::ResponseError(ResponseContent {
322            status,
323            content,
324            entity,
325        }))
326    }
327}
328
329pub async fn close_active_dossier(
330    configuration: &configuration::Configuration,
331) -> Result<models::Dossier, Error<CloseActiveDossierError>> {
332    let uri_str = format!(
333        "{}/api/dossier/close-active-dossier",
334        configuration.base_path
335    );
336    let mut req_builder = configuration
337        .client
338        .request(reqwest::Method::POST, &uri_str);
339
340    if let Some(ref user_agent) = configuration.user_agent {
341        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
342    }
343    if let Some(ref token) = configuration.bearer_access_token {
344        req_builder = req_builder.bearer_auth(token.to_owned());
345    };
346
347    let req = req_builder.build()?;
348    let resp = configuration.client.execute(req).await?;
349
350    let status = resp.status();
351    let content_type = resp
352        .headers()
353        .get("content-type")
354        .and_then(|v| v.to_str().ok())
355        .unwrap_or("application/octet-stream");
356    let content_type = super::ContentType::from(content_type);
357
358    if !status.is_client_error() && !status.is_server_error() {
359        let content = resp.text().await?;
360        match content_type {
361            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
362            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Dossier`"))),
363            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Dossier`")))),
364        }
365    } else {
366        let content = resp.text().await?;
367        let entity: Option<CloseActiveDossierError> = serde_json::from_str(&content).ok();
368        Err(Error::ResponseError(ResponseContent {
369            status,
370            content,
371            entity,
372        }))
373    }
374}
375
376pub async fn delete3(
377    configuration: &configuration::Configuration,
378) -> Result<models::Restore200Response, Error<Delete3Error>> {
379    let uri_str = format!("{}/api/dossier/active-dossier", configuration.base_path);
380    let mut req_builder = configuration
381        .client
382        .request(reqwest::Method::DELETE, &uri_str);
383
384    if let Some(ref user_agent) = configuration.user_agent {
385        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
386    }
387    if let Some(ref token) = configuration.bearer_access_token {
388        req_builder = req_builder.bearer_auth(token.to_owned());
389    };
390
391    let req = req_builder.build()?;
392    let resp = configuration.client.execute(req).await?;
393
394    let status = resp.status();
395    let content_type = resp
396        .headers()
397        .get("content-type")
398        .and_then(|v| v.to_str().ok())
399        .unwrap_or("application/octet-stream");
400    let content_type = super::ContentType::from(content_type);
401
402    if !status.is_client_error() && !status.is_server_error() {
403        let content = resp.text().await?;
404        match content_type {
405            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
406            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Restore200Response`"))),
407            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Restore200Response`")))),
408        }
409    } else {
410        let content = resp.text().await?;
411        let entity: Option<Delete3Error> = serde_json::from_str(&content).ok();
412        Err(Error::ResponseError(ResponseContent {
413            status,
414            content,
415            entity,
416        }))
417    }
418}
419
420pub async fn find_all8(
421    configuration: &configuration::Configuration,
422    closed: Option<bool>,
423) -> Result<Vec<models::Dossier>, Error<FindAll8Error>> {
424    // add a prefix to parameters to efficiently prevent name collisions
425    let p_query_closed = closed;
426
427    let uri_str = format!("{}/api/dossier/find-all", configuration.base_path);
428    let mut req_builder = configuration
429        .client
430        .request(reqwest::Method::POST, &uri_str);
431
432    if let Some(ref param_value) = p_query_closed {
433        req_builder = req_builder.query(&[("closed", &param_value.to_string())]);
434    }
435    if let Some(ref user_agent) = configuration.user_agent {
436        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
437    }
438    if let Some(ref token) = configuration.bearer_access_token {
439        req_builder = req_builder.bearer_auth(token.to_owned());
440    };
441
442    let req = req_builder.build()?;
443    let resp = configuration.client.execute(req).await?;
444
445    let status = resp.status();
446    let content_type = resp
447        .headers()
448        .get("content-type")
449        .and_then(|v| v.to_str().ok())
450        .unwrap_or("application/octet-stream");
451    let content_type = super::ContentType::from(content_type);
452
453    if !status.is_client_error() && !status.is_server_error() {
454        let content = resp.text().await?;
455        match content_type {
456            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
457            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::Dossier&gt;`"))),
458            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::Dossier&gt;`")))),
459        }
460    } else {
461        let content = resp.text().await?;
462        let entity: Option<FindAll8Error> = serde_json::from_str(&content).ok();
463        Err(Error::ResponseError(ResponseContent {
464            status,
465            content,
466            entity,
467        }))
468    }
469}
470
471pub async fn find_all_paged(
472    configuration: &configuration::Configuration,
473    arg1: models::Pageable,
474    closed: Option<bool>,
475) -> Result<models::PagedModelDossier, Error<FindAllPagedError>> {
476    // add a prefix to parameters to efficiently prevent name collisions
477    let p_query_arg1 = arg1;
478    let p_query_closed = closed;
479
480    let uri_str = format!("{}/api/dossier/find-all-paged", configuration.base_path);
481    let mut req_builder = configuration
482        .client
483        .request(reqwest::Method::POST, &uri_str);
484
485    if let Some(ref param_value) = p_query_closed {
486        req_builder = req_builder.query(&[("closed", &param_value.to_string())]);
487    }
488    req_builder = req_builder.query(&[("arg1", &p_query_arg1.to_string())]);
489    if let Some(ref user_agent) = configuration.user_agent {
490        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
491    }
492    if let Some(ref token) = configuration.bearer_access_token {
493        req_builder = req_builder.bearer_auth(token.to_owned());
494    };
495
496    let req = req_builder.build()?;
497    let resp = configuration.client.execute(req).await?;
498
499    let status = resp.status();
500    let content_type = resp
501        .headers()
502        .get("content-type")
503        .and_then(|v| v.to_str().ok())
504        .unwrap_or("application/octet-stream");
505    let content_type = super::ContentType::from(content_type);
506
507    if !status.is_client_error() && !status.is_server_error() {
508        let content = resp.text().await?;
509        match content_type {
510            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
511            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PagedModelDossier`"))),
512            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PagedModelDossier`")))),
513        }
514    } else {
515        let content = resp.text().await?;
516        let entity: Option<FindAllPagedError> = serde_json::from_str(&content).ok();
517        Err(Error::ResponseError(ResponseContent {
518            status,
519            content,
520            entity,
521        }))
522    }
523}
524
525pub async fn find_by_fee_id(
526    configuration: &configuration::Configuration,
527    id: &str,
528) -> Result<models::Dossier, Error<FindByFeeIdError>> {
529    // add a prefix to parameters to efficiently prevent name collisions
530    let p_query_id = id;
531
532    let uri_str = format!("{}/api/dossier/find-by-fee-id", configuration.base_path);
533    let mut req_builder = configuration
534        .client
535        .request(reqwest::Method::POST, &uri_str);
536
537    req_builder = req_builder.query(&[("id", &p_query_id.to_string())]);
538    if let Some(ref user_agent) = configuration.user_agent {
539        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
540    }
541    if let Some(ref token) = configuration.bearer_access_token {
542        req_builder = req_builder.bearer_auth(token.to_owned());
543    };
544
545    let req = req_builder.build()?;
546    let resp = configuration.client.execute(req).await?;
547
548    let status = resp.status();
549    let content_type = resp
550        .headers()
551        .get("content-type")
552        .and_then(|v| v.to_str().ok())
553        .unwrap_or("application/octet-stream");
554    let content_type = super::ContentType::from(content_type);
555
556    if !status.is_client_error() && !status.is_server_error() {
557        let content = resp.text().await?;
558        match content_type {
559            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
560            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Dossier`"))),
561            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Dossier`")))),
562        }
563    } else {
564        let content = resp.text().await?;
565        let entity: Option<FindByFeeIdError> = serde_json::from_str(&content).ok();
566        Err(Error::ResponseError(ResponseContent {
567            status,
568            content,
569            entity,
570        }))
571    }
572}
573
574pub async fn find_by_id3(
575    configuration: &configuration::Configuration,
576    id: &str,
577) -> Result<models::Dossier, Error<FindById3Error>> {
578    // add a prefix to parameters to efficiently prevent name collisions
579    let p_query_id = id;
580
581    let uri_str = format!("{}/api/dossier/find-by-id", configuration.base_path);
582    let mut req_builder = configuration
583        .client
584        .request(reqwest::Method::POST, &uri_str);
585
586    req_builder = req_builder.query(&[("id", &p_query_id.to_string())]);
587    if let Some(ref user_agent) = configuration.user_agent {
588        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
589    }
590    if let Some(ref token) = configuration.bearer_access_token {
591        req_builder = req_builder.bearer_auth(token.to_owned());
592    };
593
594    let req = req_builder.build()?;
595    let resp = configuration.client.execute(req).await?;
596
597    let status = resp.status();
598    let content_type = resp
599        .headers()
600        .get("content-type")
601        .and_then(|v| v.to_str().ok())
602        .unwrap_or("application/octet-stream");
603    let content_type = super::ContentType::from(content_type);
604
605    if !status.is_client_error() && !status.is_server_error() {
606        let content = resp.text().await?;
607        match content_type {
608            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
609            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Dossier`"))),
610            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Dossier`")))),
611        }
612    } else {
613        let content = resp.text().await?;
614        let entity: Option<FindById3Error> = serde_json::from_str(&content).ok();
615        Err(Error::ResponseError(ResponseContent {
616            status,
617            content,
618            entity,
619        }))
620    }
621}
622
623pub async fn generate_summary(
624    configuration: &configuration::Configuration,
625    id: &str,
626) -> Result<reqwest::Response, Error<GenerateSummaryError>> {
627    // add a prefix to parameters to efficiently prevent name collisions
628    let p_query_id = id;
629
630    let uri_str = format!("{}/api/dossier/generate-summary", configuration.base_path);
631    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
632
633    req_builder = req_builder.query(&[("id", &p_query_id.to_string())]);
634    if let Some(ref user_agent) = configuration.user_agent {
635        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
636    }
637    if let Some(ref token) = configuration.bearer_access_token {
638        req_builder = req_builder.bearer_auth(token.to_owned());
639    };
640
641    let req = req_builder.build()?;
642    let resp = configuration.client.execute(req).await?;
643
644    let status = resp.status();
645
646    if !status.is_client_error() && !status.is_server_error() {
647        Ok(resp)
648    } else {
649        let content = resp.text().await?;
650        let entity: Option<GenerateSummaryError> = serde_json::from_str(&content).ok();
651        Err(Error::ResponseError(ResponseContent {
652            status,
653            content,
654            entity,
655        }))
656    }
657}
658
659pub async fn get_dossier_total_size(
660    configuration: &configuration::Configuration,
661    id: &str,
662) -> Result<i64, Error<GetDossierTotalSizeError>> {
663    // add a prefix to parameters to efficiently prevent name collisions
664    let p_query_id = id;
665
666    let uri_str = format!("{}/api/dossier/size", configuration.base_path);
667    let mut req_builder = configuration
668        .client
669        .request(reqwest::Method::POST, &uri_str);
670
671    req_builder = req_builder.query(&[("id", &p_query_id.to_string())]);
672    if let Some(ref user_agent) = configuration.user_agent {
673        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
674    }
675    if let Some(ref token) = configuration.bearer_access_token {
676        req_builder = req_builder.bearer_auth(token.to_owned());
677    };
678
679    let req = req_builder.build()?;
680    let resp = configuration.client.execute(req).await?;
681
682    let status = resp.status();
683    let content_type = resp
684        .headers()
685        .get("content-type")
686        .and_then(|v| v.to_str().ok())
687        .unwrap_or("application/octet-stream");
688    let content_type = super::ContentType::from(content_type);
689
690    if !status.is_client_error() && !status.is_server_error() {
691        let content = resp.text().await?;
692        match content_type {
693            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
694            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `i64`"))),
695            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `i64`")))),
696        }
697    } else {
698        let content = resp.text().await?;
699        let entity: Option<GetDossierTotalSizeError> = serde_json::from_str(&content).ok();
700        Err(Error::ResponseError(ResponseContent {
701            status,
702            content,
703            entity,
704        }))
705    }
706}
707
708pub async fn get_import_dossier_xlsx_example(
709    configuration: &configuration::Configuration,
710) -> Result<reqwest::Response, Error<GetImportDossierXlsxExampleError>> {
711    let uri_str = format!("{}/api/dossier/import-example", configuration.base_path);
712    let mut req_builder = configuration.client.request(reqwest::Method::GET, &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
721    let req = req_builder.build()?;
722    let resp = configuration.client.execute(req).await?;
723
724    let status = resp.status();
725
726    if !status.is_client_error() && !status.is_server_error() {
727        Ok(resp)
728    } else {
729        let content = resp.text().await?;
730        let entity: Option<GetImportDossierXlsxExampleError> = serde_json::from_str(&content).ok();
731        Err(Error::ResponseError(ResponseContent {
732            status,
733            content,
734            entity,
735        }))
736    }
737}
738
739pub async fn get_summaries(
740    configuration: &configuration::Configuration,
741    id: Vec<String>,
742) -> Result<Vec<models::DossierSummary>, Error<GetSummariesError>> {
743    // add a prefix to parameters to efficiently prevent name collisions
744    let p_query_id = id;
745
746    let uri_str = format!("{}/api/dossier/summaries", configuration.base_path);
747    let mut req_builder = configuration
748        .client
749        .request(reqwest::Method::POST, &uri_str);
750
751    req_builder = match "multi" {
752        "multi" => req_builder.query(
753            &p_query_id
754                .into_iter()
755                .map(|p| ("id".to_owned(), p.to_string()))
756                .collect::<Vec<(std::string::String, std::string::String)>>(),
757        ),
758        _ => req_builder.query(&[(
759            "id",
760            &p_query_id
761                .into_iter()
762                .map(|p| p.to_string())
763                .collect::<Vec<String>>()
764                .join(",")
765                .to_string(),
766        )]),
767    };
768    if let Some(ref user_agent) = configuration.user_agent {
769        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
770    }
771    if let Some(ref token) = configuration.bearer_access_token {
772        req_builder = req_builder.bearer_auth(token.to_owned());
773    };
774
775    let req = req_builder.build()?;
776    let resp = configuration.client.execute(req).await?;
777
778    let status = resp.status();
779    let content_type = resp
780        .headers()
781        .get("content-type")
782        .and_then(|v| v.to_str().ok())
783        .unwrap_or("application/octet-stream");
784    let content_type = super::ContentType::from(content_type);
785
786    if !status.is_client_error() && !status.is_server_error() {
787        let content = resp.text().await?;
788        match content_type {
789            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
790            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::DossierSummary&gt;`"))),
791            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::DossierSummary&gt;`")))),
792        }
793    } else {
794        let content = resp.text().await?;
795        let entity: Option<GetSummariesError> = serde_json::from_str(&content).ok();
796        Err(Error::ResponseError(ResponseContent {
797            status,
798            content,
799            entity,
800        }))
801    }
802}
803
804pub async fn get_summaries1(
805    configuration: &configuration::Configuration,
806    closed: Option<bool>,
807) -> Result<Vec<models::DossierSummary>, Error<GetSummaries1Error>> {
808    // add a prefix to parameters to efficiently prevent name collisions
809    let p_query_closed = closed;
810
811    let uri_str = format!("{}/api/dossier/find-all-summaries", configuration.base_path);
812    let mut req_builder = configuration
813        .client
814        .request(reqwest::Method::POST, &uri_str);
815
816    if let Some(ref param_value) = p_query_closed {
817        req_builder = req_builder.query(&[("closed", &param_value.to_string())]);
818    }
819    if let Some(ref user_agent) = configuration.user_agent {
820        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
821    }
822    if let Some(ref token) = configuration.bearer_access_token {
823        req_builder = req_builder.bearer_auth(token.to_owned());
824    };
825
826    let req = req_builder.build()?;
827    let resp = configuration.client.execute(req).await?;
828
829    let status = resp.status();
830    let content_type = resp
831        .headers()
832        .get("content-type")
833        .and_then(|v| v.to_str().ok())
834        .unwrap_or("application/octet-stream");
835    let content_type = super::ContentType::from(content_type);
836
837    if !status.is_client_error() && !status.is_server_error() {
838        let content = resp.text().await?;
839        match content_type {
840            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
841            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::DossierSummary&gt;`"))),
842            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::DossierSummary&gt;`")))),
843        }
844    } else {
845        let content = resp.text().await?;
846        let entity: Option<GetSummaries1Error> = serde_json::from_str(&content).ok();
847        Err(Error::ResponseError(ResponseContent {
848            status,
849            content,
850            entity,
851        }))
852    }
853}
854
855pub async fn get_summary(
856    configuration: &configuration::Configuration,
857    id: &str,
858) -> Result<models::DossierSummary, Error<GetSummaryError>> {
859    // add a prefix to parameters to efficiently prevent name collisions
860    let p_query_id = id;
861
862    let uri_str = format!("{}/api/dossier/summary", configuration.base_path);
863    let mut req_builder = configuration
864        .client
865        .request(reqwest::Method::POST, &uri_str);
866
867    req_builder = req_builder.query(&[("id", &p_query_id.to_string())]);
868    if let Some(ref user_agent) = configuration.user_agent {
869        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
870    }
871    if let Some(ref token) = configuration.bearer_access_token {
872        req_builder = req_builder.bearer_auth(token.to_owned());
873    };
874
875    let req = req_builder.build()?;
876    let resp = configuration.client.execute(req).await?;
877
878    let status = resp.status();
879    let content_type = resp
880        .headers()
881        .get("content-type")
882        .and_then(|v| v.to_str().ok())
883        .unwrap_or("application/octet-stream");
884    let content_type = super::ContentType::from(content_type);
885
886    if !status.is_client_error() && !status.is_server_error() {
887        let content = resp.text().await?;
888        match content_type {
889            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
890            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DossierSummary`"))),
891            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::DossierSummary`")))),
892        }
893    } else {
894        let content = resp.text().await?;
895        let entity: Option<GetSummaryError> = serde_json::from_str(&content).ok();
896        Err(Error::ResponseError(ResponseContent {
897            status,
898            content,
899            entity,
900        }))
901    }
902}
903
904pub async fn import_dossier_from_zip(
905    configuration: &configuration::Configuration,
906    zip: std::path::PathBuf,
907) -> Result<(), Error<ImportDossierFromZipError>> {
908    // add a prefix to parameters to efficiently prevent name collisions
909    let p_form_zip = zip;
910
911    let uri_str = format!("{}/api/dossier/import", configuration.base_path);
912    let mut req_builder = configuration
913        .client
914        .request(reqwest::Method::POST, &uri_str);
915
916    if let Some(ref user_agent) = configuration.user_agent {
917        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
918    }
919    if let Some(ref token) = configuration.bearer_access_token {
920        req_builder = req_builder.bearer_auth(token.to_owned());
921    };
922    let multipart_form = reqwest::multipart::Form::new();
923    // TODO: support file upload for 'zip' parameter
924    req_builder = req_builder.multipart(multipart_form);
925
926    let req = req_builder.build()?;
927    let resp = configuration.client.execute(req).await?;
928
929    let status = resp.status();
930
931    if !status.is_client_error() && !status.is_server_error() {
932        Ok(())
933    } else {
934        let content = resp.text().await?;
935        let entity: Option<ImportDossierFromZipError> = serde_json::from_str(&content).ok();
936        Err(Error::ResponseError(ResponseContent {
937            status,
938            content,
939            entity,
940        }))
941    }
942}
943
944pub async fn new_dossier(
945    configuration: &configuration::Configuration,
946    dossier: models::Dossier,
947) -> Result<models::Dossier, Error<NewDossierError>> {
948    // add a prefix to parameters to efficiently prevent name collisions
949    let p_body_dossier = dossier;
950
951    let uri_str = format!("{}/api/dossier/new-dossier", configuration.base_path);
952    let mut req_builder = configuration
953        .client
954        .request(reqwest::Method::POST, &uri_str);
955
956    if let Some(ref user_agent) = configuration.user_agent {
957        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
958    }
959    if let Some(ref token) = configuration.bearer_access_token {
960        req_builder = req_builder.bearer_auth(token.to_owned());
961    };
962    req_builder = req_builder.json(&p_body_dossier);
963
964    let req = req_builder.build()?;
965    let resp = configuration.client.execute(req).await?;
966
967    let status = resp.status();
968    let content_type = resp
969        .headers()
970        .get("content-type")
971        .and_then(|v| v.to_str().ok())
972        .unwrap_or("application/octet-stream");
973    let content_type = super::ContentType::from(content_type);
974
975    if !status.is_client_error() && !status.is_server_error() {
976        let content = resp.text().await?;
977        match content_type {
978            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
979            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Dossier`"))),
980            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Dossier`")))),
981        }
982    } else {
983        let content = resp.text().await?;
984        let entity: Option<NewDossierError> = serde_json::from_str(&content).ok();
985        Err(Error::ResponseError(ResponseContent {
986            status,
987            content,
988            entity,
989        }))
990    }
991}
992
993pub async fn new_from_previous(
994    configuration: &configuration::Configuration,
995) -> Result<models::Dossier, Error<NewFromPreviousError>> {
996    let uri_str = format!("{}/api/dossier/new-from-previous", configuration.base_path);
997    let mut req_builder = configuration
998        .client
999        .request(reqwest::Method::POST, &uri_str);
1000
1001    if let Some(ref user_agent) = configuration.user_agent {
1002        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1003    }
1004    if let Some(ref token) = configuration.bearer_access_token {
1005        req_builder = req_builder.bearer_auth(token.to_owned());
1006    };
1007
1008    let req = req_builder.build()?;
1009    let resp = configuration.client.execute(req).await?;
1010
1011    let status = resp.status();
1012    let content_type = resp
1013        .headers()
1014        .get("content-type")
1015        .and_then(|v| v.to_str().ok())
1016        .unwrap_or("application/octet-stream");
1017    let content_type = super::ContentType::from(content_type);
1018
1019    if !status.is_client_error() && !status.is_server_error() {
1020        let content = resp.text().await?;
1021        match content_type {
1022            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1023            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Dossier`"))),
1024            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Dossier`")))),
1025        }
1026    } else {
1027        let content = resp.text().await?;
1028        let entity: Option<NewFromPreviousError> = serde_json::from_str(&content).ok();
1029        Err(Error::ResponseError(ResponseContent {
1030            status,
1031            content,
1032            entity,
1033        }))
1034    }
1035}
1036
1037pub async fn process_fees_for_dossier(
1038    configuration: &configuration::Configuration,
1039    request_body: Vec<String>,
1040) -> Result<(), Error<ProcessFeesForDossierError>> {
1041    // add a prefix to parameters to efficiently prevent name collisions
1042    let p_body_request_body = request_body;
1043
1044    let uri_str = format!("{}/api/dossier/process-fees", configuration.base_path);
1045    let mut req_builder = configuration
1046        .client
1047        .request(reqwest::Method::POST, &uri_str);
1048
1049    if let Some(ref user_agent) = configuration.user_agent {
1050        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1051    }
1052    if let Some(ref token) = configuration.bearer_access_token {
1053        req_builder = req_builder.bearer_auth(token.to_owned());
1054    };
1055    req_builder = req_builder.json(&p_body_request_body);
1056
1057    let req = req_builder.build()?;
1058    let resp = configuration.client.execute(req).await?;
1059
1060    let status = resp.status();
1061
1062    if !status.is_client_error() && !status.is_server_error() {
1063        Ok(())
1064    } else {
1065        let content = resp.text().await?;
1066        let entity: Option<ProcessFeesForDossierError> = serde_json::from_str(&content).ok();
1067        Err(Error::ResponseError(ResponseContent {
1068            status,
1069            content,
1070            entity,
1071        }))
1072    }
1073}
1074
1075pub async fn process_invoice_for_dossier(
1076    configuration: &configuration::Configuration,
1077    id: &str,
1078) -> Result<(), Error<ProcessInvoiceForDossierError>> {
1079    // add a prefix to parameters to efficiently prevent name collisions
1080    let p_query_id = id;
1081
1082    let uri_str = format!("{}/api/dossier/process-invoice", configuration.base_path);
1083    let mut req_builder = configuration
1084        .client
1085        .request(reqwest::Method::POST, &uri_str);
1086
1087    req_builder = req_builder.query(&[("id", &p_query_id.to_string())]);
1088    if let Some(ref user_agent) = configuration.user_agent {
1089        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1090    }
1091    if let Some(ref token) = configuration.bearer_access_token {
1092        req_builder = req_builder.bearer_auth(token.to_owned());
1093    };
1094
1095    let req = req_builder.build()?;
1096    let resp = configuration.client.execute(req).await?;
1097
1098    let status = resp.status();
1099
1100    if !status.is_client_error() && !status.is_server_error() {
1101        Ok(())
1102    } else {
1103        let content = resp.text().await?;
1104        let entity: Option<ProcessInvoiceForDossierError> = serde_json::from_str(&content).ok();
1105        Err(Error::ResponseError(ResponseContent {
1106            status,
1107            content,
1108            entity,
1109        }))
1110    }
1111}
1112
1113pub async fn recall_for_modification(
1114    configuration: &configuration::Configuration,
1115    dossier: models::Dossier,
1116) -> Result<models::Dossier, Error<RecallForModificationError>> {
1117    // add a prefix to parameters to efficiently prevent name collisions
1118    let p_body_dossier = dossier;
1119
1120    let uri_str = format!(
1121        "{}/api/dossier/recall-for-modification",
1122        configuration.base_path
1123    );
1124    let mut req_builder = configuration
1125        .client
1126        .request(reqwest::Method::POST, &uri_str);
1127
1128    if let Some(ref user_agent) = configuration.user_agent {
1129        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1130    }
1131    if let Some(ref token) = configuration.bearer_access_token {
1132        req_builder = req_builder.bearer_auth(token.to_owned());
1133    };
1134    req_builder = req_builder.json(&p_body_dossier);
1135
1136    let req = req_builder.build()?;
1137    let resp = configuration.client.execute(req).await?;
1138
1139    let status = resp.status();
1140    let content_type = resp
1141        .headers()
1142        .get("content-type")
1143        .and_then(|v| v.to_str().ok())
1144        .unwrap_or("application/octet-stream");
1145    let content_type = super::ContentType::from(content_type);
1146
1147    if !status.is_client_error() && !status.is_server_error() {
1148        let content = resp.text().await?;
1149        match content_type {
1150            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1151            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Dossier`"))),
1152            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Dossier`")))),
1153        }
1154    } else {
1155        let content = resp.text().await?;
1156        let entity: Option<RecallForModificationError> = serde_json::from_str(&content).ok();
1157        Err(Error::ResponseError(ResponseContent {
1158            status,
1159            content,
1160            entity,
1161        }))
1162    }
1163}
1164
1165pub async fn remove_document(
1166    configuration: &configuration::Configuration,
1167    id: &str,
1168) -> Result<models::Dossier, Error<RemoveDocumentError>> {
1169    // add a prefix to parameters to efficiently prevent name collisions
1170    let p_query_id = id;
1171
1172    let uri_str = format!("{}/api/dossier/remove-document", configuration.base_path);
1173    let mut req_builder = configuration
1174        .client
1175        .request(reqwest::Method::POST, &uri_str);
1176
1177    req_builder = req_builder.query(&[("id", &p_query_id.to_string())]);
1178    if let Some(ref user_agent) = configuration.user_agent {
1179        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1180    }
1181    if let Some(ref token) = configuration.bearer_access_token {
1182        req_builder = req_builder.bearer_auth(token.to_owned());
1183    };
1184
1185    let req = req_builder.build()?;
1186    let resp = configuration.client.execute(req).await?;
1187
1188    let status = resp.status();
1189    let content_type = resp
1190        .headers()
1191        .get("content-type")
1192        .and_then(|v| v.to_str().ok())
1193        .unwrap_or("application/octet-stream");
1194    let content_type = super::ContentType::from(content_type);
1195
1196    if !status.is_client_error() && !status.is_server_error() {
1197        let content = resp.text().await?;
1198        match content_type {
1199            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1200            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Dossier`"))),
1201            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Dossier`")))),
1202        }
1203    } else {
1204        let content = resp.text().await?;
1205        let entity: Option<RemoveDocumentError> = serde_json::from_str(&content).ok();
1206        Err(Error::ResponseError(ResponseContent {
1207            status,
1208            content,
1209            entity,
1210        }))
1211    }
1212}
1213
1214pub async fn remove_fee(
1215    configuration: &configuration::Configuration,
1216    fee_id: &str,
1217) -> Result<models::Dossier, Error<RemoveFeeError>> {
1218    // add a prefix to parameters to efficiently prevent name collisions
1219    let p_query_fee_id = fee_id;
1220
1221    let uri_str = format!("{}/api/dossier/remove-fee", configuration.base_path);
1222    let mut req_builder = configuration
1223        .client
1224        .request(reqwest::Method::POST, &uri_str);
1225
1226    req_builder = req_builder.query(&[("feeId", &p_query_fee_id.to_string())]);
1227    if let Some(ref user_agent) = configuration.user_agent {
1228        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1229    }
1230    if let Some(ref token) = configuration.bearer_access_token {
1231        req_builder = req_builder.bearer_auth(token.to_owned());
1232    };
1233
1234    let req = req_builder.build()?;
1235    let resp = configuration.client.execute(req).await?;
1236
1237    let status = resp.status();
1238    let content_type = resp
1239        .headers()
1240        .get("content-type")
1241        .and_then(|v| v.to_str().ok())
1242        .unwrap_or("application/octet-stream");
1243    let content_type = super::ContentType::from(content_type);
1244
1245    if !status.is_client_error() && !status.is_server_error() {
1246        let content = resp.text().await?;
1247        match content_type {
1248            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1249            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Dossier`"))),
1250            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Dossier`")))),
1251        }
1252    } else {
1253        let content = resp.text().await?;
1254        let entity: Option<RemoveFeeError> = serde_json::from_str(&content).ok();
1255        Err(Error::ResponseError(ResponseContent {
1256            status,
1257            content,
1258            entity,
1259        }))
1260    }
1261}
1262
1263pub async fn remove_invoice(
1264    configuration: &configuration::Configuration,
1265    id: &str,
1266) -> Result<models::Dossier, Error<RemoveInvoiceError>> {
1267    // add a prefix to parameters to efficiently prevent name collisions
1268    let p_query_id = id;
1269
1270    let uri_str = format!("{}/api/dossier/remove-invoice", configuration.base_path);
1271    let mut req_builder = configuration
1272        .client
1273        .request(reqwest::Method::POST, &uri_str);
1274
1275    req_builder = req_builder.query(&[("id", &p_query_id.to_string())]);
1276    if let Some(ref user_agent) = configuration.user_agent {
1277        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1278    }
1279    if let Some(ref token) = configuration.bearer_access_token {
1280        req_builder = req_builder.bearer_auth(token.to_owned());
1281    };
1282
1283    let req = req_builder.build()?;
1284    let resp = configuration.client.execute(req).await?;
1285
1286    let status = resp.status();
1287    let content_type = resp
1288        .headers()
1289        .get("content-type")
1290        .and_then(|v| v.to_str().ok())
1291        .unwrap_or("application/octet-stream");
1292    let content_type = super::ContentType::from(content_type);
1293
1294    if !status.is_client_error() && !status.is_server_error() {
1295        let content = resp.text().await?;
1296        match content_type {
1297            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1298            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Dossier`"))),
1299            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Dossier`")))),
1300        }
1301    } else {
1302        let content = resp.text().await?;
1303        let entity: Option<RemoveInvoiceError> = serde_json::from_str(&content).ok();
1304        Err(Error::ResponseError(ResponseContent {
1305            status,
1306            content,
1307            entity,
1308        }))
1309    }
1310}
1311
1312pub async fn toggle_bookmarked3(
1313    configuration: &configuration::Configuration,
1314    id: &str,
1315) -> Result<models::Dossier, Error<ToggleBookmarked3Error>> {
1316    // add a prefix to parameters to efficiently prevent name collisions
1317    let p_query_id = id;
1318
1319    let uri_str = format!("{}/api/dossier/toggle-bookmarked", configuration.base_path);
1320    let mut req_builder = configuration
1321        .client
1322        .request(reqwest::Method::POST, &uri_str);
1323
1324    req_builder = req_builder.query(&[("id", &p_query_id.to_string())]);
1325    if let Some(ref user_agent) = configuration.user_agent {
1326        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1327    }
1328    if let Some(ref token) = configuration.bearer_access_token {
1329        req_builder = req_builder.bearer_auth(token.to_owned());
1330    };
1331
1332    let req = req_builder.build()?;
1333    let resp = configuration.client.execute(req).await?;
1334
1335    let status = resp.status();
1336    let content_type = resp
1337        .headers()
1338        .get("content-type")
1339        .and_then(|v| v.to_str().ok())
1340        .unwrap_or("application/octet-stream");
1341    let content_type = super::ContentType::from(content_type);
1342
1343    if !status.is_client_error() && !status.is_server_error() {
1344        let content = resp.text().await?;
1345        match content_type {
1346            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1347            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Dossier`"))),
1348            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Dossier`")))),
1349        }
1350    } else {
1351        let content = resp.text().await?;
1352        let entity: Option<ToggleBookmarked3Error> = serde_json::from_str(&content).ok();
1353        Err(Error::ResponseError(ResponseContent {
1354            status,
1355            content,
1356            entity,
1357        }))
1358    }
1359}
1360
1361pub async fn update_active_dossier(
1362    configuration: &configuration::Configuration,
1363    dossier: models::Dossier,
1364) -> Result<models::Dossier, Error<UpdateActiveDossierError>> {
1365    // add a prefix to parameters to efficiently prevent name collisions
1366    let p_body_dossier = dossier;
1367
1368    let uri_str = format!("{}/api/dossier/update-dossier", configuration.base_path);
1369    let mut req_builder = configuration
1370        .client
1371        .request(reqwest::Method::POST, &uri_str);
1372
1373    if let Some(ref user_agent) = configuration.user_agent {
1374        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1375    }
1376    if let Some(ref token) = configuration.bearer_access_token {
1377        req_builder = req_builder.bearer_auth(token.to_owned());
1378    };
1379    req_builder = req_builder.json(&p_body_dossier);
1380
1381    let req = req_builder.build()?;
1382    let resp = configuration.client.execute(req).await?;
1383
1384    let status = resp.status();
1385    let content_type = resp
1386        .headers()
1387        .get("content-type")
1388        .and_then(|v| v.to_str().ok())
1389        .unwrap_or("application/octet-stream");
1390    let content_type = super::ContentType::from(content_type);
1391
1392    if !status.is_client_error() && !status.is_server_error() {
1393        let content = resp.text().await?;
1394        match content_type {
1395            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1396            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Dossier`"))),
1397            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Dossier`")))),
1398        }
1399    } else {
1400        let content = resp.text().await?;
1401        let entity: Option<UpdateActiveDossierError> = serde_json::from_str(&content).ok();
1402        Err(Error::ResponseError(ResponseContent {
1403            status,
1404            content,
1405            entity,
1406        }))
1407    }
1408}