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 DeleteFrameworkByDoctypeByNameError {
22 UnknownValue(serde_json::Value),
23}
24
25#[derive(Debug, Clone, Serialize, Deserialize)]
27#[serde(untagged)]
28pub enum DeleteFrameworkDoctypesByNameError {
29 UnknownValue(serde_json::Value),
30}
31
32#[derive(Debug, Clone, Serialize, Deserialize)]
34#[serde(untagged)]
35pub enum DeleteFrameworkRolesByUserByRoleError {
36 UnknownValue(serde_json::Value),
37}
38
39#[derive(Debug, Clone, Serialize, Deserialize)]
41#[serde(untagged)]
42pub enum GetFrameworkByDoctypeError {
43 UnknownValue(serde_json::Value),
44}
45
46#[derive(Debug, Clone, Serialize, Deserialize)]
48#[serde(untagged)]
49pub enum GetFrameworkByDoctypeByNameError {
50 UnknownValue(serde_json::Value),
51}
52
53#[derive(Debug, Clone, Serialize, Deserialize)]
55#[serde(untagged)]
56pub enum GetFrameworkDoctypesError {
57 UnknownValue(serde_json::Value),
58}
59
60#[derive(Debug, Clone, Serialize, Deserialize)]
62#[serde(untagged)]
63pub enum GetFrameworkDoctypesByNameError {
64 UnknownValue(serde_json::Value),
65}
66
67#[derive(Debug, Clone, Serialize, Deserialize)]
69#[serde(untagged)]
70pub enum GetFrameworkModulesError {
71 UnknownValue(serde_json::Value),
72}
73
74#[derive(Debug, Clone, Serialize, Deserialize)]
76#[serde(untagged)]
77pub enum GetFrameworkModulesByModuleError {
78 UnknownValue(serde_json::Value),
79}
80
81#[derive(Debug, Clone, Serialize, Deserialize)]
83#[serde(untagged)]
84pub enum GetFrameworkRolesError {
85 UnknownValue(serde_json::Value),
86}
87
88#[derive(Debug, Clone, Serialize, Deserialize)]
90#[serde(untagged)]
91pub enum GetFrameworkSummaryError {
92 UnknownValue(serde_json::Value),
93}
94
95#[derive(Debug, Clone, Serialize, Deserialize)]
97#[serde(untagged)]
98pub enum PostFrameworkByDoctypeError {
99 UnknownValue(serde_json::Value),
100}
101
102#[derive(Debug, Clone, Serialize, Deserialize)]
104#[serde(untagged)]
105pub enum PostFrameworkByDoctypeByNameCancelError {
106 UnknownValue(serde_json::Value),
107}
108
109#[derive(Debug, Clone, Serialize, Deserialize)]
111#[serde(untagged)]
112pub enum PostFrameworkByDoctypeByNameSubmitError {
113 UnknownValue(serde_json::Value),
114}
115
116#[derive(Debug, Clone, Serialize, Deserialize)]
118#[serde(untagged)]
119pub enum PostFrameworkDoctypesError {
120 UnknownValue(serde_json::Value),
121}
122
123#[derive(Debug, Clone, Serialize, Deserialize)]
125#[serde(untagged)]
126pub enum PostFrameworkModulesByModuleInstallError {
127 UnknownValue(serde_json::Value),
128}
129
130#[derive(Debug, Clone, Serialize, Deserialize)]
132#[serde(untagged)]
133pub enum PostFrameworkRolesError {
134 UnknownValue(serde_json::Value),
135}
136
137#[derive(Debug, Clone, Serialize, Deserialize)]
139#[serde(untagged)]
140pub enum PutFrameworkByDoctypeByNameError {
141 UnknownValue(serde_json::Value),
142}
143
144#[derive(Debug, Clone, Serialize, Deserialize)]
146#[serde(untagged)]
147pub enum PutFrameworkDoctypesByNameError {
148 UnknownValue(serde_json::Value),
149}
150
151
152pub async fn delete_framework_by_doctype_by_name(configuration: &configuration::Configuration, doctype: &str, name: &str) -> Result<(), Error<DeleteFrameworkByDoctypeByNameError>> {
154 let p_doctype = doctype;
156 let p_name = name;
157
158 let uri_str = format!("{}/v1/framework/{doctype}/{name}", configuration.base_path, doctype=crate::apis::urlencode(p_doctype), name=crate::apis::urlencode(p_name));
159 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
160
161 if let Some(ref user_agent) = configuration.user_agent {
162 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
163 }
164 if let Some(ref token) = configuration.bearer_access_token {
165 req_builder = req_builder.bearer_auth(token.to_owned());
166 };
167
168 let req = req_builder.build()?;
169 let resp = configuration.client.execute(req).await?;
170
171 let status = resp.status();
172
173 if !status.is_client_error() && !status.is_server_error() {
174 Ok(())
175 } else {
176 let content = resp.text().await?;
177 let entity: Option<DeleteFrameworkByDoctypeByNameError> = serde_json::from_str(&content).ok();
178 Err(Error::ResponseError(ResponseContent { status, content, entity }))
179 }
180}
181
182pub async fn delete_framework_doctypes_by_name(configuration: &configuration::Configuration, name: &str) -> Result<(), Error<DeleteFrameworkDoctypesByNameError>> {
184 let p_name = name;
186
187 let uri_str = format!("{}/v1/framework/doctypes/{name}", configuration.base_path, name=crate::apis::urlencode(p_name));
188 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
189
190 if let Some(ref user_agent) = configuration.user_agent {
191 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
192 }
193 if let Some(ref token) = configuration.bearer_access_token {
194 req_builder = req_builder.bearer_auth(token.to_owned());
195 };
196
197 let req = req_builder.build()?;
198 let resp = configuration.client.execute(req).await?;
199
200 let status = resp.status();
201
202 if !status.is_client_error() && !status.is_server_error() {
203 Ok(())
204 } else {
205 let content = resp.text().await?;
206 let entity: Option<DeleteFrameworkDoctypesByNameError> = serde_json::from_str(&content).ok();
207 Err(Error::ResponseError(ResponseContent { status, content, entity }))
208 }
209}
210
211pub async fn delete_framework_roles_by_user_by_role(configuration: &configuration::Configuration, user: &str, role: &str) -> Result<(), Error<DeleteFrameworkRolesByUserByRoleError>> {
213 let p_user = user;
215 let p_role = role;
216
217 let uri_str = format!("{}/v1/framework/roles/{user}/{role}", configuration.base_path, user=crate::apis::urlencode(p_user), role=crate::apis::urlencode(p_role));
218 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
219
220 if let Some(ref user_agent) = configuration.user_agent {
221 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
222 }
223 if let Some(ref token) = configuration.bearer_access_token {
224 req_builder = req_builder.bearer_auth(token.to_owned());
225 };
226
227 let req = req_builder.build()?;
228 let resp = configuration.client.execute(req).await?;
229
230 let status = resp.status();
231
232 if !status.is_client_error() && !status.is_server_error() {
233 Ok(())
234 } else {
235 let content = resp.text().await?;
236 let entity: Option<DeleteFrameworkRolesByUserByRoleError> = serde_json::from_str(&content).ok();
237 Err(Error::ResponseError(ResponseContent { status, content, entity }))
238 }
239}
240
241pub async fn get_framework_by_doctype(configuration: &configuration::Configuration, doctype: &str, filters: Option<&str>, fields: Option<&str>, order_by: Option<&str>, limit: Option<&str>) -> Result<models::DocumentList, Error<GetFrameworkByDoctypeError>> {
243 let p_doctype = doctype;
245 let p_filters = filters;
246 let p_fields = fields;
247 let p_order_by = order_by;
248 let p_limit = limit;
249
250 let uri_str = format!("{}/v1/framework/{doctype}", configuration.base_path, doctype=crate::apis::urlencode(p_doctype));
251 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
252
253 if let Some(ref param_value) = p_filters {
254 req_builder = req_builder.query(&[("filters", ¶m_value.to_string())]);
255 }
256 if let Some(ref param_value) = p_fields {
257 req_builder = req_builder.query(&[("fields", ¶m_value.to_string())]);
258 }
259 if let Some(ref param_value) = p_order_by {
260 req_builder = req_builder.query(&[("order_by", ¶m_value.to_string())]);
261 }
262 if let Some(ref param_value) = p_limit {
263 req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]);
264 }
265 if let Some(ref user_agent) = configuration.user_agent {
266 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
267 }
268 if let Some(ref token) = configuration.bearer_access_token {
269 req_builder = req_builder.bearer_auth(token.to_owned());
270 };
271
272 let req = req_builder.build()?;
273 let resp = configuration.client.execute(req).await?;
274
275 let status = resp.status();
276 let content_type = resp
277 .headers()
278 .get("content-type")
279 .and_then(|v| v.to_str().ok())
280 .unwrap_or("application/octet-stream");
281 let content_type = super::ContentType::from(content_type);
282
283 if !status.is_client_error() && !status.is_server_error() {
284 let content = resp.text().await?;
285 match content_type {
286 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
287 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DocumentList`"))),
288 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::DocumentList`")))),
289 }
290 } else {
291 let content = resp.text().await?;
292 let entity: Option<GetFrameworkByDoctypeError> = serde_json::from_str(&content).ok();
293 Err(Error::ResponseError(ResponseContent { status, content, entity }))
294 }
295}
296
297pub async fn get_framework_by_doctype_by_name(configuration: &configuration::Configuration, doctype: &str, name: &str) -> Result<std::collections::HashMap<String, serde_json::Value>, Error<GetFrameworkByDoctypeByNameError>> {
299 let p_doctype = doctype;
301 let p_name = name;
302
303 let uri_str = format!("{}/v1/framework/{doctype}/{name}", configuration.base_path, doctype=crate::apis::urlencode(p_doctype), name=crate::apis::urlencode(p_name));
304 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
305
306 if let Some(ref user_agent) = configuration.user_agent {
307 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
308 }
309 if let Some(ref token) = configuration.bearer_access_token {
310 req_builder = req_builder.bearer_auth(token.to_owned());
311 };
312
313 let req = req_builder.build()?;
314 let resp = configuration.client.execute(req).await?;
315
316 let status = resp.status();
317 let content_type = resp
318 .headers()
319 .get("content-type")
320 .and_then(|v| v.to_str().ok())
321 .unwrap_or("application/octet-stream");
322 let content_type = super::ContentType::from(content_type);
323
324 if !status.is_client_error() && !status.is_server_error() {
325 let content = resp.text().await?;
326 match content_type {
327 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
328 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `std::collections::HashMap<String, serde_json::Value>`"))),
329 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `std::collections::HashMap<String, serde_json::Value>`")))),
330 }
331 } else {
332 let content = resp.text().await?;
333 let entity: Option<GetFrameworkByDoctypeByNameError> = serde_json::from_str(&content).ok();
334 Err(Error::ResponseError(ResponseContent { status, content, entity }))
335 }
336}
337
338pub async fn get_framework_doctypes(configuration: &configuration::Configuration, ) -> Result<models::DocTypeList, Error<GetFrameworkDoctypesError>> {
340
341 let uri_str = format!("{}/v1/framework/doctypes", configuration.base_path);
342 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
343
344 if let Some(ref user_agent) = configuration.user_agent {
345 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
346 }
347 if let Some(ref token) = configuration.bearer_access_token {
348 req_builder = req_builder.bearer_auth(token.to_owned());
349 };
350
351 let req = req_builder.build()?;
352 let resp = configuration.client.execute(req).await?;
353
354 let status = resp.status();
355 let content_type = resp
356 .headers()
357 .get("content-type")
358 .and_then(|v| v.to_str().ok())
359 .unwrap_or("application/octet-stream");
360 let content_type = super::ContentType::from(content_type);
361
362 if !status.is_client_error() && !status.is_server_error() {
363 let content = resp.text().await?;
364 match content_type {
365 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
366 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DocTypeList`"))),
367 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::DocTypeList`")))),
368 }
369 } else {
370 let content = resp.text().await?;
371 let entity: Option<GetFrameworkDoctypesError> = serde_json::from_str(&content).ok();
372 Err(Error::ResponseError(ResponseContent { status, content, entity }))
373 }
374}
375
376pub async fn get_framework_doctypes_by_name(configuration: &configuration::Configuration, name: &str) -> Result<models::DocType, Error<GetFrameworkDoctypesByNameError>> {
378 let p_name = name;
380
381 let uri_str = format!("{}/v1/framework/doctypes/{name}", configuration.base_path, name=crate::apis::urlencode(p_name));
382 let mut req_builder = configuration.client.request(reqwest::Method::GET, &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 => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DocType`"))),
407 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::DocType`")))),
408 }
409 } else {
410 let content = resp.text().await?;
411 let entity: Option<GetFrameworkDoctypesByNameError> = serde_json::from_str(&content).ok();
412 Err(Error::ResponseError(ResponseContent { status, content, entity }))
413 }
414}
415
416pub async fn get_framework_modules(configuration: &configuration::Configuration, ) -> Result<models::ModuleList, Error<GetFrameworkModulesError>> {
418
419 let uri_str = format!("{}/v1/framework/modules", configuration.base_path);
420 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
421
422 if let Some(ref user_agent) = configuration.user_agent {
423 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
424 }
425 if let Some(ref token) = configuration.bearer_access_token {
426 req_builder = req_builder.bearer_auth(token.to_owned());
427 };
428
429 let req = req_builder.build()?;
430 let resp = configuration.client.execute(req).await?;
431
432 let status = resp.status();
433 let content_type = resp
434 .headers()
435 .get("content-type")
436 .and_then(|v| v.to_str().ok())
437 .unwrap_or("application/octet-stream");
438 let content_type = super::ContentType::from(content_type);
439
440 if !status.is_client_error() && !status.is_server_error() {
441 let content = resp.text().await?;
442 match content_type {
443 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
444 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ModuleList`"))),
445 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::ModuleList`")))),
446 }
447 } else {
448 let content = resp.text().await?;
449 let entity: Option<GetFrameworkModulesError> = serde_json::from_str(&content).ok();
450 Err(Error::ResponseError(ResponseContent { status, content, entity }))
451 }
452}
453
454pub async fn get_framework_modules_by_module(configuration: &configuration::Configuration, module: &str) -> Result<models::ModuleState, Error<GetFrameworkModulesByModuleError>> {
456 let p_module = module;
458
459 let uri_str = format!("{}/v1/framework/modules/{module}", configuration.base_path, module=crate::apis::urlencode(p_module));
460 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
461
462 if let Some(ref user_agent) = configuration.user_agent {
463 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
464 }
465 if let Some(ref token) = configuration.bearer_access_token {
466 req_builder = req_builder.bearer_auth(token.to_owned());
467 };
468
469 let req = req_builder.build()?;
470 let resp = configuration.client.execute(req).await?;
471
472 let status = resp.status();
473 let content_type = resp
474 .headers()
475 .get("content-type")
476 .and_then(|v| v.to_str().ok())
477 .unwrap_or("application/octet-stream");
478 let content_type = super::ContentType::from(content_type);
479
480 if !status.is_client_error() && !status.is_server_error() {
481 let content = resp.text().await?;
482 match content_type {
483 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
484 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ModuleState`"))),
485 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::ModuleState`")))),
486 }
487 } else {
488 let content = resp.text().await?;
489 let entity: Option<GetFrameworkModulesByModuleError> = serde_json::from_str(&content).ok();
490 Err(Error::ResponseError(ResponseContent { status, content, entity }))
491 }
492}
493
494pub async fn get_framework_roles(configuration: &configuration::Configuration, ) -> Result<models::RoleList, Error<GetFrameworkRolesError>> {
496
497 let uri_str = format!("{}/v1/framework/roles", configuration.base_path);
498 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
499
500 if let Some(ref user_agent) = configuration.user_agent {
501 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
502 }
503 if let Some(ref token) = configuration.bearer_access_token {
504 req_builder = req_builder.bearer_auth(token.to_owned());
505 };
506
507 let req = req_builder.build()?;
508 let resp = configuration.client.execute(req).await?;
509
510 let status = resp.status();
511 let content_type = resp
512 .headers()
513 .get("content-type")
514 .and_then(|v| v.to_str().ok())
515 .unwrap_or("application/octet-stream");
516 let content_type = super::ContentType::from(content_type);
517
518 if !status.is_client_error() && !status.is_server_error() {
519 let content = resp.text().await?;
520 match content_type {
521 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
522 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RoleList`"))),
523 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::RoleList`")))),
524 }
525 } else {
526 let content = resp.text().await?;
527 let entity: Option<GetFrameworkRolesError> = serde_json::from_str(&content).ok();
528 Err(Error::ResponseError(ResponseContent { status, content, entity }))
529 }
530}
531
532pub async fn get_framework_summary(configuration: &configuration::Configuration, ) -> Result<models::SummaryView, Error<GetFrameworkSummaryError>> {
534
535 let uri_str = format!("{}/v1/framework/summary", configuration.base_path);
536 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
537
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 => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SummaryView`"))),
561 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::SummaryView`")))),
562 }
563 } else {
564 let content = resp.text().await?;
565 let entity: Option<GetFrameworkSummaryError> = serde_json::from_str(&content).ok();
566 Err(Error::ResponseError(ResponseContent { status, content, entity }))
567 }
568}
569
570pub async fn post_framework_by_doctype(configuration: &configuration::Configuration, doctype: &str) -> Result<(), Error<PostFrameworkByDoctypeError>> {
572 let p_doctype = doctype;
574
575 let uri_str = format!("{}/v1/framework/{doctype}", configuration.base_path, doctype=crate::apis::urlencode(p_doctype));
576 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
577
578 if let Some(ref user_agent) = configuration.user_agent {
579 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
580 }
581 if let Some(ref token) = configuration.bearer_access_token {
582 req_builder = req_builder.bearer_auth(token.to_owned());
583 };
584
585 let req = req_builder.build()?;
586 let resp = configuration.client.execute(req).await?;
587
588 let status = resp.status();
589
590 if !status.is_client_error() && !status.is_server_error() {
591 Ok(())
592 } else {
593 let content = resp.text().await?;
594 let entity: Option<PostFrameworkByDoctypeError> = serde_json::from_str(&content).ok();
595 Err(Error::ResponseError(ResponseContent { status, content, entity }))
596 }
597}
598
599pub async fn post_framework_by_doctype_by_name_cancel(configuration: &configuration::Configuration, doctype: &str, name: &str) -> Result<std::collections::HashMap<String, serde_json::Value>, Error<PostFrameworkByDoctypeByNameCancelError>> {
601 let p_doctype = doctype;
603 let p_name = name;
604
605 let uri_str = format!("{}/v1/framework/{doctype}/{name}/cancel", configuration.base_path, doctype=crate::apis::urlencode(p_doctype), name=crate::apis::urlencode(p_name));
606 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
607
608 if let Some(ref user_agent) = configuration.user_agent {
609 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
610 }
611 if let Some(ref token) = configuration.bearer_access_token {
612 req_builder = req_builder.bearer_auth(token.to_owned());
613 };
614
615 let req = req_builder.build()?;
616 let resp = configuration.client.execute(req).await?;
617
618 let status = resp.status();
619 let content_type = resp
620 .headers()
621 .get("content-type")
622 .and_then(|v| v.to_str().ok())
623 .unwrap_or("application/octet-stream");
624 let content_type = super::ContentType::from(content_type);
625
626 if !status.is_client_error() && !status.is_server_error() {
627 let content = resp.text().await?;
628 match content_type {
629 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
630 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `std::collections::HashMap<String, serde_json::Value>`"))),
631 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `std::collections::HashMap<String, serde_json::Value>`")))),
632 }
633 } else {
634 let content = resp.text().await?;
635 let entity: Option<PostFrameworkByDoctypeByNameCancelError> = serde_json::from_str(&content).ok();
636 Err(Error::ResponseError(ResponseContent { status, content, entity }))
637 }
638}
639
640pub async fn post_framework_by_doctype_by_name_submit(configuration: &configuration::Configuration, doctype: &str, name: &str) -> Result<std::collections::HashMap<String, serde_json::Value>, Error<PostFrameworkByDoctypeByNameSubmitError>> {
642 let p_doctype = doctype;
644 let p_name = name;
645
646 let uri_str = format!("{}/v1/framework/{doctype}/{name}/submit", configuration.base_path, doctype=crate::apis::urlencode(p_doctype), name=crate::apis::urlencode(p_name));
647 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
648
649 if let Some(ref user_agent) = configuration.user_agent {
650 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
651 }
652 if let Some(ref token) = configuration.bearer_access_token {
653 req_builder = req_builder.bearer_auth(token.to_owned());
654 };
655
656 let req = req_builder.build()?;
657 let resp = configuration.client.execute(req).await?;
658
659 let status = resp.status();
660 let content_type = resp
661 .headers()
662 .get("content-type")
663 .and_then(|v| v.to_str().ok())
664 .unwrap_or("application/octet-stream");
665 let content_type = super::ContentType::from(content_type);
666
667 if !status.is_client_error() && !status.is_server_error() {
668 let content = resp.text().await?;
669 match content_type {
670 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
671 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `std::collections::HashMap<String, serde_json::Value>`"))),
672 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `std::collections::HashMap<String, serde_json::Value>`")))),
673 }
674 } else {
675 let content = resp.text().await?;
676 let entity: Option<PostFrameworkByDoctypeByNameSubmitError> = serde_json::from_str(&content).ok();
677 Err(Error::ResponseError(ResponseContent { status, content, entity }))
678 }
679}
680
681pub async fn post_framework_doctypes(configuration: &configuration::Configuration, doc_type: models::DocType) -> Result<models::DocType, Error<PostFrameworkDoctypesError>> {
683 let p_doc_type = doc_type;
685
686 let uri_str = format!("{}/v1/framework/doctypes", configuration.base_path);
687 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
688
689 if let Some(ref user_agent) = configuration.user_agent {
690 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
691 }
692 if let Some(ref token) = configuration.bearer_access_token {
693 req_builder = req_builder.bearer_auth(token.to_owned());
694 };
695 req_builder = req_builder.json(&p_doc_type);
696
697 let req = req_builder.build()?;
698 let resp = configuration.client.execute(req).await?;
699
700 let status = resp.status();
701 let content_type = resp
702 .headers()
703 .get("content-type")
704 .and_then(|v| v.to_str().ok())
705 .unwrap_or("application/octet-stream");
706 let content_type = super::ContentType::from(content_type);
707
708 if !status.is_client_error() && !status.is_server_error() {
709 let content = resp.text().await?;
710 match content_type {
711 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
712 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DocType`"))),
713 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::DocType`")))),
714 }
715 } else {
716 let content = resp.text().await?;
717 let entity: Option<PostFrameworkDoctypesError> = serde_json::from_str(&content).ok();
718 Err(Error::ResponseError(ResponseContent { status, content, entity }))
719 }
720}
721
722pub async fn post_framework_modules_by_module_install(configuration: &configuration::Configuration, module: &str) -> Result<models::Install, Error<PostFrameworkModulesByModuleInstallError>> {
724 let p_module = module;
726
727 let uri_str = format!("{}/v1/framework/modules/{module}/install", configuration.base_path, module=crate::apis::urlencode(p_module));
728 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
729
730 if let Some(ref user_agent) = configuration.user_agent {
731 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
732 }
733 if let Some(ref token) = configuration.bearer_access_token {
734 req_builder = req_builder.bearer_auth(token.to_owned());
735 };
736
737 let req = req_builder.build()?;
738 let resp = configuration.client.execute(req).await?;
739
740 let status = resp.status();
741 let content_type = resp
742 .headers()
743 .get("content-type")
744 .and_then(|v| v.to_str().ok())
745 .unwrap_or("application/octet-stream");
746 let content_type = super::ContentType::from(content_type);
747
748 if !status.is_client_error() && !status.is_server_error() {
749 let content = resp.text().await?;
750 match content_type {
751 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
752 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Install`"))),
753 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::Install`")))),
754 }
755 } else {
756 let content = resp.text().await?;
757 let entity: Option<PostFrameworkModulesByModuleInstallError> = serde_json::from_str(&content).ok();
758 Err(Error::ResponseError(ResponseContent { status, content, entity }))
759 }
760}
761
762pub async fn post_framework_roles(configuration: &configuration::Configuration, role_assignment: models::RoleAssignment) -> Result<models::RoleAssignment, Error<PostFrameworkRolesError>> {
764 let p_role_assignment = role_assignment;
766
767 let uri_str = format!("{}/v1/framework/roles", configuration.base_path);
768 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
769
770 if let Some(ref user_agent) = configuration.user_agent {
771 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
772 }
773 if let Some(ref token) = configuration.bearer_access_token {
774 req_builder = req_builder.bearer_auth(token.to_owned());
775 };
776 req_builder = req_builder.json(&p_role_assignment);
777
778 let req = req_builder.build()?;
779 let resp = configuration.client.execute(req).await?;
780
781 let status = resp.status();
782 let content_type = resp
783 .headers()
784 .get("content-type")
785 .and_then(|v| v.to_str().ok())
786 .unwrap_or("application/octet-stream");
787 let content_type = super::ContentType::from(content_type);
788
789 if !status.is_client_error() && !status.is_server_error() {
790 let content = resp.text().await?;
791 match content_type {
792 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
793 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RoleAssignment`"))),
794 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::RoleAssignment`")))),
795 }
796 } else {
797 let content = resp.text().await?;
798 let entity: Option<PostFrameworkRolesError> = serde_json::from_str(&content).ok();
799 Err(Error::ResponseError(ResponseContent { status, content, entity }))
800 }
801}
802
803pub async fn put_framework_by_doctype_by_name(configuration: &configuration::Configuration, doctype: &str, name: &str) -> Result<(), Error<PutFrameworkByDoctypeByNameError>> {
805 let p_doctype = doctype;
807 let p_name = name;
808
809 let uri_str = format!("{}/v1/framework/{doctype}/{name}", configuration.base_path, doctype=crate::apis::urlencode(p_doctype), name=crate::apis::urlencode(p_name));
810 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
811
812 if let Some(ref user_agent) = configuration.user_agent {
813 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
814 }
815 if let Some(ref token) = configuration.bearer_access_token {
816 req_builder = req_builder.bearer_auth(token.to_owned());
817 };
818
819 let req = req_builder.build()?;
820 let resp = configuration.client.execute(req).await?;
821
822 let status = resp.status();
823
824 if !status.is_client_error() && !status.is_server_error() {
825 Ok(())
826 } else {
827 let content = resp.text().await?;
828 let entity: Option<PutFrameworkByDoctypeByNameError> = serde_json::from_str(&content).ok();
829 Err(Error::ResponseError(ResponseContent { status, content, entity }))
830 }
831}
832
833pub async fn put_framework_doctypes_by_name(configuration: &configuration::Configuration, name: &str, doc_type: models::DocType) -> Result<models::DocType, Error<PutFrameworkDoctypesByNameError>> {
835 let p_name = name;
837 let p_doc_type = doc_type;
838
839 let uri_str = format!("{}/v1/framework/doctypes/{name}", configuration.base_path, name=crate::apis::urlencode(p_name));
840 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
841
842 if let Some(ref user_agent) = configuration.user_agent {
843 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
844 }
845 if let Some(ref token) = configuration.bearer_access_token {
846 req_builder = req_builder.bearer_auth(token.to_owned());
847 };
848 req_builder = req_builder.json(&p_doc_type);
849
850 let req = req_builder.build()?;
851 let resp = configuration.client.execute(req).await?;
852
853 let status = resp.status();
854 let content_type = resp
855 .headers()
856 .get("content-type")
857 .and_then(|v| v.to_str().ok())
858 .unwrap_or("application/octet-stream");
859 let content_type = super::ContentType::from(content_type);
860
861 if !status.is_client_error() && !status.is_server_error() {
862 let content = resp.text().await?;
863 match content_type {
864 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
865 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DocType`"))),
866 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::DocType`")))),
867 }
868 } else {
869 let content = resp.text().await?;
870 let entity: Option<PutFrameworkDoctypesByNameError> = serde_json::from_str(&content).ok();
871 Err(Error::ResponseError(ResponseContent { status, content, entity }))
872 }
873}
874