1use reqwest;
13use serde::{Deserialize, Serialize};
14use crate::{apis::ResponseContent, models};
15use super::{Error, configuration};
16
17
18#[derive(Debug, Clone, Serialize, Deserialize)]
20#[serde(untagged)]
21pub enum AcknowledgeAllCriticalAlertsError {
22 UnknownValue(serde_json::Value),
23}
24
25#[derive(Debug, Clone, Serialize, Deserialize)]
27#[serde(untagged)]
28pub enum AcknowledgeCriticalAlertError {
29 UnknownValue(serde_json::Value),
30}
31
32#[derive(Debug, Clone, Serialize, Deserialize)]
34#[serde(untagged)]
35pub enum ComputeObjectStorageUsageError {
36 UnknownValue(serde_json::Value),
37}
38
39#[derive(Debug, Clone, Serialize, Deserialize)]
41#[serde(untagged)]
42pub enum CreateCustomerPortalSessionError {
43 UnknownValue(serde_json::Value),
44}
45
46#[derive(Debug, Clone, Serialize, Deserialize)]
48#[serde(untagged)]
49pub enum DeleteSamlConfigError {
50 UnknownValue(serde_json::Value),
51}
52
53#[derive(Debug, Clone, Serialize, Deserialize)]
55#[serde(untagged)]
56pub enum DropCustomInstanceDbError {
57 UnknownValue(serde_json::Value),
58}
59
60#[derive(Debug, Clone, Serialize, Deserialize)]
62#[serde(untagged)]
63pub enum GetCriticalAlertsError {
64 UnknownValue(serde_json::Value),
65}
66
67#[derive(Debug, Clone, Serialize, Deserialize)]
69#[serde(untagged)]
70pub enum GetGlobalError {
71 UnknownValue(serde_json::Value),
72}
73
74#[derive(Debug, Clone, Serialize, Deserialize)]
76#[serde(untagged)]
77pub enum GetInstanceConfigError {
78 UnknownValue(serde_json::Value),
79}
80
81#[derive(Debug, Clone, Serialize, Deserialize)]
83#[serde(untagged)]
84pub enum GetJwksError {
85 UnknownValue(serde_json::Value),
86}
87
88#[derive(Debug, Clone, Serialize, Deserialize)]
90#[serde(untagged)]
91pub enum GetLatestKeyRenewalAttemptError {
92 UnknownValue(serde_json::Value),
93}
94
95#[derive(Debug, Clone, Serialize, Deserialize)]
97#[serde(untagged)]
98pub enum GetLocalError {
99 UnknownValue(serde_json::Value),
100}
101
102#[derive(Debug, Clone, Serialize, Deserialize)]
104#[serde(untagged)]
105pub enum GetLogCleanupStatusError {
106 UnknownValue(serde_json::Value),
107}
108
109#[derive(Debug, Clone, Serialize, Deserialize)]
111#[serde(untagged)]
112pub enum GetMinKeepAliveVersionError {
113 UnknownValue(serde_json::Value),
114}
115
116#[derive(Debug, Clone, Serialize, Deserialize)]
118#[serde(untagged)]
119pub enum GetObjectStorageUsageError {
120 UnknownValue(serde_json::Value),
121}
122
123#[derive(Debug, Clone, Serialize, Deserialize)]
125#[serde(untagged)]
126pub enum GetRuffConfigError {
127 UnknownValue(serde_json::Value),
128}
129
130#[derive(Debug, Clone, Serialize, Deserialize)]
132#[serde(untagged)]
133pub enum GetSamlConfigError {
134 UnknownValue(serde_json::Value),
135}
136
137#[derive(Debug, Clone, Serialize, Deserialize)]
139#[serde(untagged)]
140pub enum GetSamlSpMetadataError {
141 UnknownValue(serde_json::Value),
142}
143
144#[derive(Debug, Clone, Serialize, Deserialize)]
146#[serde(untagged)]
147pub enum GetSecondaryStorageNamesError {
148 UnknownValue(serde_json::Value),
149}
150
151#[derive(Debug, Clone, Serialize, Deserialize)]
153#[serde(untagged)]
154pub enum GetStatsError {
155 UnknownValue(serde_json::Value),
156}
157
158#[derive(Debug, Clone, Serialize, Deserialize)]
160#[serde(untagged)]
161pub enum ListCustomInstanceDbsError {
162 UnknownValue(serde_json::Value),
163}
164
165#[derive(Debug, Clone, Serialize, Deserialize)]
167#[serde(untagged)]
168pub enum ListGlobalSettingsError {
169 UnknownValue(serde_json::Value),
170}
171
172#[derive(Debug, Clone, Serialize, Deserialize)]
174#[serde(untagged)]
175pub enum MigrateSecretsFromAwsSmError {
176 UnknownValue(serde_json::Value),
177}
178
179#[derive(Debug, Clone, Serialize, Deserialize)]
181#[serde(untagged)]
182pub enum MigrateSecretsFromAzureKvError {
183 UnknownValue(serde_json::Value),
184}
185
186#[derive(Debug, Clone, Serialize, Deserialize)]
188#[serde(untagged)]
189pub enum MigrateSecretsToAwsSmError {
190 UnknownValue(serde_json::Value),
191}
192
193#[derive(Debug, Clone, Serialize, Deserialize)]
195#[serde(untagged)]
196pub enum MigrateSecretsToAzureKvError {
197 UnknownValue(serde_json::Value),
198}
199
200#[derive(Debug, Clone, Serialize, Deserialize)]
202#[serde(untagged)]
203pub enum MigrateSecretsToDatabaseError {
204 UnknownValue(serde_json::Value),
205}
206
207#[derive(Debug, Clone, Serialize, Deserialize)]
209#[serde(untagged)]
210pub enum MigrateSecretsToVaultError {
211 UnknownValue(serde_json::Value),
212}
213
214#[derive(Debug, Clone, Serialize, Deserialize)]
216#[serde(untagged)]
217pub enum RefreshCustomInstanceUserPwdError {
218 UnknownValue(serde_json::Value),
219}
220
221#[derive(Debug, Clone, Serialize, Deserialize)]
223#[serde(untagged)]
224pub enum RenewLicenseKeyError {
225 UnknownValue(serde_json::Value),
226}
227
228#[derive(Debug, Clone, Serialize, Deserialize)]
230#[serde(untagged)]
231pub enum RestartWorkerGroupError {
232 UnknownValue(serde_json::Value),
233}
234
235#[derive(Debug, Clone, Serialize, Deserialize)]
237#[serde(untagged)]
238pub enum RestartWorkerPoolError {
239 UnknownValue(serde_json::Value),
240}
241
242#[derive(Debug, Clone, Serialize, Deserialize)]
244#[serde(untagged)]
245pub enum RevalidateLicenseError {
246 UnknownValue(serde_json::Value),
247}
248
249#[derive(Debug, Clone, Serialize, Deserialize)]
251#[serde(untagged)]
252pub enum RunLogCleanupError {
253 UnknownValue(serde_json::Value),
254}
255
256#[derive(Debug, Clone, Serialize, Deserialize)]
258#[serde(untagged)]
259pub enum SaveSamlConfigError {
260 UnknownValue(serde_json::Value),
261}
262
263#[derive(Debug, Clone, Serialize, Deserialize)]
265#[serde(untagged)]
266pub enum SendStatsError {
267 UnknownValue(serde_json::Value),
268}
269
270#[derive(Debug, Clone, Serialize, Deserialize)]
272#[serde(untagged)]
273pub enum SetGlobalError {
274 UnknownValue(serde_json::Value),
275}
276
277#[derive(Debug, Clone, Serialize, Deserialize)]
279#[serde(untagged)]
280pub enum SetInstanceConfigError {
281 UnknownValue(serde_json::Value),
282}
283
284#[derive(Debug, Clone, Serialize, Deserialize)]
286#[serde(untagged)]
287pub enum SetPublicAppRateLimitError {
288 UnknownValue(serde_json::Value),
289}
290
291#[derive(Debug, Clone, Serialize, Deserialize)]
293#[serde(untagged)]
294pub enum SetupCustomInstanceDbError {
295 UnknownValue(serde_json::Value),
296}
297
298#[derive(Debug, Clone, Serialize, Deserialize)]
300#[serde(untagged)]
301pub enum TestAwsSmBackendError {
302 UnknownValue(serde_json::Value),
303}
304
305#[derive(Debug, Clone, Serialize, Deserialize)]
307#[serde(untagged)]
308pub enum TestAzureKvBackendError {
309 UnknownValue(serde_json::Value),
310}
311
312#[derive(Debug, Clone, Serialize, Deserialize)]
314#[serde(untagged)]
315pub enum TestCriticalChannelsError {
316 UnknownValue(serde_json::Value),
317}
318
319#[derive(Debug, Clone, Serialize, Deserialize)]
321#[serde(untagged)]
322pub enum TestLicenseKeyError {
323 UnknownValue(serde_json::Value),
324}
325
326#[derive(Debug, Clone, Serialize, Deserialize)]
328#[serde(untagged)]
329pub enum TestMetadataError {
330 UnknownValue(serde_json::Value),
331}
332
333#[derive(Debug, Clone, Serialize, Deserialize)]
335#[serde(untagged)]
336pub enum TestObjectStorageConfigError {
337 UnknownValue(serde_json::Value),
338}
339
340#[derive(Debug, Clone, Serialize, Deserialize)]
342#[serde(untagged)]
343pub enum TestSecretBackendError {
344 UnknownValue(serde_json::Value),
345}
346
347#[derive(Debug, Clone, Serialize, Deserialize)]
349#[serde(untagged)]
350pub enum TestSmtpError {
351 UnknownValue(serde_json::Value),
352}
353
354#[derive(Debug, Clone, Serialize, Deserialize)]
356#[serde(untagged)]
357pub enum UpdateSamlMetadataError {
358 UnknownValue(serde_json::Value),
359}
360
361#[derive(Debug, Clone, Serialize, Deserialize)]
363#[serde(untagged)]
364pub enum WorkspaceAcknowledgeAllCriticalAlertsError {
365 UnknownValue(serde_json::Value),
366}
367
368#[derive(Debug, Clone, Serialize, Deserialize)]
370#[serde(untagged)]
371pub enum WorkspaceAcknowledgeCriticalAlertError {
372 UnknownValue(serde_json::Value),
373}
374
375#[derive(Debug, Clone, Serialize, Deserialize)]
377#[serde(untagged)]
378pub enum WorkspaceGetCriticalAlertsError {
379 UnknownValue(serde_json::Value),
380}
381
382#[derive(Debug, Clone, Serialize, Deserialize)]
384#[serde(untagged)]
385pub enum WorkspaceMuteCriticalAlertsUiError {
386 UnknownValue(serde_json::Value),
387}
388
389
390pub async fn acknowledge_all_critical_alerts(configuration: &configuration::Configuration, ) -> Result<String, Error<AcknowledgeAllCriticalAlertsError>> {
391 let local_var_configuration = configuration;
392
393 let local_var_client = &local_var_configuration.client;
394
395 let local_var_uri_str = format!("{}/settings/critical_alerts/acknowledge_all", local_var_configuration.base_path);
396 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
397
398 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
399 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
400 }
401 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
402 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
403 };
404
405 let local_var_req = local_var_req_builder.build()?;
406 let local_var_resp = local_var_client.execute(local_var_req).await?;
407
408 let local_var_status = local_var_resp.status();
409 let local_var_content = local_var_resp.text().await?;
410
411 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
412 crate::from_str_patched(&local_var_content).map_err(Error::from)
413 } else {
414 let local_var_entity: Option<AcknowledgeAllCriticalAlertsError> = crate::from_str_patched(&local_var_content).ok();
415 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
416 Err(Error::ResponseError(local_var_error))
417 }
418}
419
420pub async fn acknowledge_critical_alert(configuration: &configuration::Configuration, id: i32) -> Result<String, Error<AcknowledgeCriticalAlertError>> {
421 let local_var_configuration = configuration;
422
423 let local_var_client = &local_var_configuration.client;
424
425 let local_var_uri_str = format!("{}/settings/critical_alerts/{id}/acknowledge", local_var_configuration.base_path, id=id);
426 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
427
428 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
429 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
430 }
431 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
432 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
433 };
434
435 let local_var_req = local_var_req_builder.build()?;
436 let local_var_resp = local_var_client.execute(local_var_req).await?;
437
438 let local_var_status = local_var_resp.status();
439 let local_var_content = local_var_resp.text().await?;
440
441 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
442 crate::from_str_patched(&local_var_content).map_err(Error::from)
443 } else {
444 let local_var_entity: Option<AcknowledgeCriticalAlertError> = crate::from_str_patched(&local_var_content).ok();
445 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
446 Err(Error::ResponseError(local_var_error))
447 }
448}
449
450pub async fn compute_object_storage_usage(configuration: &configuration::Configuration, ) -> Result<String, Error<ComputeObjectStorageUsageError>> {
451 let local_var_configuration = configuration;
452
453 let local_var_client = &local_var_configuration.client;
454
455 let local_var_uri_str = format!("{}/settings/object_storage_usage", local_var_configuration.base_path);
456 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
457
458 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
459 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
460 }
461 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
462 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
463 };
464
465 let local_var_req = local_var_req_builder.build()?;
466 let local_var_resp = local_var_client.execute(local_var_req).await?;
467
468 let local_var_status = local_var_resp.status();
469 let local_var_content = local_var_resp.text().await?;
470
471 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
472 crate::from_str_patched(&local_var_content).map_err(Error::from)
473 } else {
474 let local_var_entity: Option<ComputeObjectStorageUsageError> = crate::from_str_patched(&local_var_content).ok();
475 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
476 Err(Error::ResponseError(local_var_error))
477 }
478}
479
480pub async fn create_customer_portal_session(configuration: &configuration::Configuration, license_key: Option<&str>) -> Result<String, Error<CreateCustomerPortalSessionError>> {
481 let local_var_configuration = configuration;
482
483 let local_var_client = &local_var_configuration.client;
484
485 let local_var_uri_str = format!("{}/settings/customer_portal", local_var_configuration.base_path);
486 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
487
488 if let Some(ref local_var_str) = license_key {
489 local_var_req_builder = local_var_req_builder.query(&[("license_key", &local_var_str.to_string())]);
490 }
491 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
492 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
493 }
494 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
495 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
496 };
497
498 let local_var_req = local_var_req_builder.build()?;
499 let local_var_resp = local_var_client.execute(local_var_req).await?;
500
501 let local_var_status = local_var_resp.status();
502 let local_var_content = local_var_resp.text().await?;
503
504 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
505 crate::from_str_patched(&local_var_content).map_err(Error::from)
506 } else {
507 let local_var_entity: Option<CreateCustomerPortalSessionError> = crate::from_str_patched(&local_var_content).ok();
508 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
509 Err(Error::ResponseError(local_var_error))
510 }
511}
512
513pub async fn delete_saml_config(configuration: &configuration::Configuration, ) -> Result<String, Error<DeleteSamlConfigError>> {
514 let local_var_configuration = configuration;
515
516 let local_var_client = &local_var_configuration.client;
517
518 let local_var_uri_str = format!("{}/saml/config", local_var_configuration.base_path);
519 let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
520
521 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
522 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
523 }
524 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
525 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
526 };
527
528 let local_var_req = local_var_req_builder.build()?;
529 let local_var_resp = local_var_client.execute(local_var_req).await?;
530
531 let local_var_status = local_var_resp.status();
532 let local_var_content = local_var_resp.text().await?;
533
534 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
535 crate::from_str_patched(&local_var_content).map_err(Error::from)
536 } else {
537 let local_var_entity: Option<DeleteSamlConfigError> = crate::from_str_patched(&local_var_content).ok();
538 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
539 Err(Error::ResponseError(local_var_error))
540 }
541}
542
543pub async fn drop_custom_instance_db(configuration: &configuration::Configuration, name: &str) -> Result<String, Error<DropCustomInstanceDbError>> {
544 let local_var_configuration = configuration;
545
546 let local_var_client = &local_var_configuration.client;
547
548 let local_var_uri_str = format!("{}/settings/drop_custom_instance_pg_database/{name}", local_var_configuration.base_path, name=crate::apis::urlencode(name));
549 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
550
551 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
552 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
553 }
554 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
555 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
556 };
557
558 let local_var_req = local_var_req_builder.build()?;
559 let local_var_resp = local_var_client.execute(local_var_req).await?;
560
561 let local_var_status = local_var_resp.status();
562 let local_var_content = local_var_resp.text().await?;
563
564 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
565 crate::from_str_patched(&local_var_content).map_err(Error::from)
566 } else {
567 let local_var_entity: Option<DropCustomInstanceDbError> = crate::from_str_patched(&local_var_content).ok();
568 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
569 Err(Error::ResponseError(local_var_error))
570 }
571}
572
573pub async fn get_critical_alerts(configuration: &configuration::Configuration, page: Option<i32>, page_size: Option<i32>, acknowledged: Option<bool>) -> Result<models::GetCriticalAlerts200Response, Error<GetCriticalAlertsError>> {
574 let local_var_configuration = configuration;
575
576 let local_var_client = &local_var_configuration.client;
577
578 let local_var_uri_str = format!("{}/settings/critical_alerts", local_var_configuration.base_path);
579 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
580
581 if let Some(ref local_var_str) = page {
582 local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
583 }
584 if let Some(ref local_var_str) = page_size {
585 local_var_req_builder = local_var_req_builder.query(&[("page_size", &local_var_str.to_string())]);
586 }
587 if let Some(ref local_var_str) = acknowledged {
588 local_var_req_builder = local_var_req_builder.query(&[("acknowledged", &local_var_str.to_string())]);
589 }
590 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
591 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
592 }
593 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
594 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
595 };
596
597 let local_var_req = local_var_req_builder.build()?;
598 let local_var_resp = local_var_client.execute(local_var_req).await?;
599
600 let local_var_status = local_var_resp.status();
601 let local_var_content = local_var_resp.text().await?;
602
603 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
604 crate::from_str_patched(&local_var_content).map_err(Error::from)
605 } else {
606 let local_var_entity: Option<GetCriticalAlertsError> = crate::from_str_patched(&local_var_content).ok();
607 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
608 Err(Error::ResponseError(local_var_error))
609 }
610}
611
612pub async fn get_global(configuration: &configuration::Configuration, key: &str) -> Result<serde_json::Value, Error<GetGlobalError>> {
613 let local_var_configuration = configuration;
614
615 let local_var_client = &local_var_configuration.client;
616
617 let local_var_uri_str = format!("{}/settings/global/{key}", local_var_configuration.base_path, key=crate::apis::urlencode(key));
618 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
619
620 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
621 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
622 }
623 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
624 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
625 };
626
627 let local_var_req = local_var_req_builder.build()?;
628 let local_var_resp = local_var_client.execute(local_var_req).await?;
629
630 let local_var_status = local_var_resp.status();
631 let local_var_content = local_var_resp.text().await?;
632
633 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
634 crate::from_str_patched(&local_var_content).map_err(Error::from)
635 } else {
636 let local_var_entity: Option<GetGlobalError> = crate::from_str_patched(&local_var_content).ok();
637 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
638 Err(Error::ResponseError(local_var_error))
639 }
640}
641
642pub async fn get_instance_config(configuration: &configuration::Configuration, ) -> Result<models::InstanceConfig, Error<GetInstanceConfigError>> {
643 let local_var_configuration = configuration;
644
645 let local_var_client = &local_var_configuration.client;
646
647 let local_var_uri_str = format!("{}/settings/instance_config", local_var_configuration.base_path);
648 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
649
650 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
651 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
652 }
653 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
654 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
655 };
656
657 let local_var_req = local_var_req_builder.build()?;
658 let local_var_resp = local_var_client.execute(local_var_req).await?;
659
660 let local_var_status = local_var_resp.status();
661 let local_var_content = local_var_resp.text().await?;
662
663 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
664 crate::from_str_patched(&local_var_content).map_err(Error::from)
665 } else {
666 let local_var_entity: Option<GetInstanceConfigError> = crate::from_str_patched(&local_var_content).ok();
667 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
668 Err(Error::ResponseError(local_var_error))
669 }
670}
671
672pub async fn get_jwks(configuration: &configuration::Configuration, ) -> Result<models::JwksResponse, Error<GetJwksError>> {
673 let local_var_configuration = configuration;
674
675 let local_var_client = &local_var_configuration.client;
676
677 let local_var_uri_str = format!("{}/.well-known/jwks.json", local_var_configuration.base_path);
678 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
679
680 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
681 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
682 }
683 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
684 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
685 };
686
687 let local_var_req = local_var_req_builder.build()?;
688 let local_var_resp = local_var_client.execute(local_var_req).await?;
689
690 let local_var_status = local_var_resp.status();
691 let local_var_content = local_var_resp.text().await?;
692
693 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
694 crate::from_str_patched(&local_var_content).map_err(Error::from)
695 } else {
696 let local_var_entity: Option<GetJwksError> = crate::from_str_patched(&local_var_content).ok();
697 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
698 Err(Error::ResponseError(local_var_error))
699 }
700}
701
702pub async fn get_latest_key_renewal_attempt(configuration: &configuration::Configuration, ) -> Result<models::GetLatestKeyRenewalAttempt200Response, Error<GetLatestKeyRenewalAttemptError>> {
703 let local_var_configuration = configuration;
704
705 let local_var_client = &local_var_configuration.client;
706
707 let local_var_uri_str = format!("{}/settings/latest_key_renewal_attempt", local_var_configuration.base_path);
708 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
709
710 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
711 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
712 }
713 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
714 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
715 };
716
717 let local_var_req = local_var_req_builder.build()?;
718 let local_var_resp = local_var_client.execute(local_var_req).await?;
719
720 let local_var_status = local_var_resp.status();
721 let local_var_content = local_var_resp.text().await?;
722
723 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
724 crate::from_str_patched(&local_var_content).map_err(Error::from)
725 } else {
726 let local_var_entity: Option<GetLatestKeyRenewalAttemptError> = crate::from_str_patched(&local_var_content).ok();
727 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
728 Err(Error::ResponseError(local_var_error))
729 }
730}
731
732pub async fn get_local(configuration: &configuration::Configuration, ) -> Result<serde_json::Value, Error<GetLocalError>> {
733 let local_var_configuration = configuration;
734
735 let local_var_client = &local_var_configuration.client;
736
737 let local_var_uri_str = format!("{}/settings/local", local_var_configuration.base_path);
738 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
739
740 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
741 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
742 }
743 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
744 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
745 };
746
747 let local_var_req = local_var_req_builder.build()?;
748 let local_var_resp = local_var_client.execute(local_var_req).await?;
749
750 let local_var_status = local_var_resp.status();
751 let local_var_content = local_var_resp.text().await?;
752
753 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
754 crate::from_str_patched(&local_var_content).map_err(Error::from)
755 } else {
756 let local_var_entity: Option<GetLocalError> = crate::from_str_patched(&local_var_content).ok();
757 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
758 Err(Error::ResponseError(local_var_error))
759 }
760}
761
762pub async fn get_log_cleanup_status(configuration: &configuration::Configuration, ) -> Result<models::GetLogCleanupStatus200Response, Error<GetLogCleanupStatusError>> {
763 let local_var_configuration = configuration;
764
765 let local_var_client = &local_var_configuration.client;
766
767 let local_var_uri_str = format!("{}/settings/log_cleanup_status", local_var_configuration.base_path);
768 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
769
770 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
771 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
772 }
773 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
774 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
775 };
776
777 let local_var_req = local_var_req_builder.build()?;
778 let local_var_resp = local_var_client.execute(local_var_req).await?;
779
780 let local_var_status = local_var_resp.status();
781 let local_var_content = local_var_resp.text().await?;
782
783 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
784 crate::from_str_patched(&local_var_content).map_err(Error::from)
785 } else {
786 let local_var_entity: Option<GetLogCleanupStatusError> = crate::from_str_patched(&local_var_content).ok();
787 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
788 Err(Error::ResponseError(local_var_error))
789 }
790}
791
792pub async fn get_min_keep_alive_version(configuration: &configuration::Configuration, ) -> Result<models::GetMinKeepAliveVersion200Response, Error<GetMinKeepAliveVersionError>> {
793 let local_var_configuration = configuration;
794
795 let local_var_client = &local_var_configuration.client;
796
797 let local_var_uri_str = format!("{}/min_keep_alive_version", local_var_configuration.base_path);
798 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
799
800 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
801 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
802 }
803 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
804 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
805 };
806
807 let local_var_req = local_var_req_builder.build()?;
808 let local_var_resp = local_var_client.execute(local_var_req).await?;
809
810 let local_var_status = local_var_resp.status();
811 let local_var_content = local_var_resp.text().await?;
812
813 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
814 crate::from_str_patched(&local_var_content).map_err(Error::from)
815 } else {
816 let local_var_entity: Option<GetMinKeepAliveVersionError> = crate::from_str_patched(&local_var_content).ok();
817 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
818 Err(Error::ResponseError(local_var_error))
819 }
820}
821
822pub async fn get_object_storage_usage(configuration: &configuration::Configuration, ) -> Result<models::GetObjectStorageUsage200Response, Error<GetObjectStorageUsageError>> {
823 let local_var_configuration = configuration;
824
825 let local_var_client = &local_var_configuration.client;
826
827 let local_var_uri_str = format!("{}/settings/object_storage_usage", local_var_configuration.base_path);
828 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
829
830 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
831 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
832 }
833 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
834 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
835 };
836
837 let local_var_req = local_var_req_builder.build()?;
838 let local_var_resp = local_var_client.execute(local_var_req).await?;
839
840 let local_var_status = local_var_resp.status();
841 let local_var_content = local_var_resp.text().await?;
842
843 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
844 crate::from_str_patched(&local_var_content).map_err(Error::from)
845 } else {
846 let local_var_entity: Option<GetObjectStorageUsageError> = crate::from_str_patched(&local_var_content).ok();
847 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
848 Err(Error::ResponseError(local_var_error))
849 }
850}
851
852pub async fn get_ruff_config(configuration: &configuration::Configuration, ) -> Result<String, Error<GetRuffConfigError>> {
854 let local_var_configuration = configuration;
855
856 let local_var_client = &local_var_configuration.client;
857
858 let local_var_uri_str = format!("{}/settings_u/ruff_config", local_var_configuration.base_path);
859 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
860
861 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
862 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
863 }
864 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
865 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
866 };
867
868 let local_var_req = local_var_req_builder.build()?;
869 let local_var_resp = local_var_client.execute(local_var_req).await?;
870
871 let local_var_status = local_var_resp.status();
872 let local_var_content = local_var_resp.text().await?;
873
874 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
875 crate::from_str_patched(&local_var_content).map_err(Error::from)
876 } else {
877 let local_var_entity: Option<GetRuffConfigError> = crate::from_str_patched(&local_var_content).ok();
878 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
879 Err(Error::ResponseError(local_var_error))
880 }
881}
882
883pub async fn get_saml_config(configuration: &configuration::Configuration, ) -> Result<models::SamlConfig, Error<GetSamlConfigError>> {
884 let local_var_configuration = configuration;
885
886 let local_var_client = &local_var_configuration.client;
887
888 let local_var_uri_str = format!("{}/saml/config", local_var_configuration.base_path);
889 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
890
891 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
892 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
893 }
894 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
895 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
896 };
897
898 let local_var_req = local_var_req_builder.build()?;
899 let local_var_resp = local_var_client.execute(local_var_req).await?;
900
901 let local_var_status = local_var_resp.status();
902 let local_var_content = local_var_resp.text().await?;
903
904 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
905 crate::from_str_patched(&local_var_content).map_err(Error::from)
906 } else {
907 let local_var_entity: Option<GetSamlConfigError> = crate::from_str_patched(&local_var_content).ok();
908 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
909 Err(Error::ResponseError(local_var_error))
910 }
911}
912
913pub async fn get_saml_sp_metadata(configuration: &configuration::Configuration, ) -> Result<String, Error<GetSamlSpMetadataError>> {
914 let local_var_configuration = configuration;
915
916 let local_var_client = &local_var_configuration.client;
917
918 let local_var_uri_str = format!("{}/saml/metadata", local_var_configuration.base_path);
919 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
920
921 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
922 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
923 }
924 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
925 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
926 };
927
928 let local_var_req = local_var_req_builder.build()?;
929 let local_var_resp = local_var_client.execute(local_var_req).await?;
930
931 let local_var_status = local_var_resp.status();
932 let local_var_content = local_var_resp.text().await?;
933
934 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
935 crate::from_str_patched(&local_var_content).map_err(Error::from)
936 } else {
937 let local_var_entity: Option<GetSamlSpMetadataError> = crate::from_str_patched(&local_var_content).ok();
938 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
939 Err(Error::ResponseError(local_var_error))
940 }
941}
942
943pub async fn get_secondary_storage_names(configuration: &configuration::Configuration, workspace: &str, include_default: Option<bool>) -> Result<Vec<String>, Error<GetSecondaryStorageNamesError>> {
944 let local_var_configuration = configuration;
945
946 let local_var_client = &local_var_configuration.client;
947
948 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_secondary_storage_names", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
949 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
950
951 if let Some(ref local_var_str) = include_default {
952 local_var_req_builder = local_var_req_builder.query(&[("include_default", &local_var_str.to_string())]);
953 }
954 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
955 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
956 }
957 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
958 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
959 };
960
961 let local_var_req = local_var_req_builder.build()?;
962 let local_var_resp = local_var_client.execute(local_var_req).await?;
963
964 let local_var_status = local_var_resp.status();
965 let local_var_content = local_var_resp.text().await?;
966
967 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
968 crate::from_str_patched(&local_var_content).map_err(Error::from)
969 } else {
970 let local_var_entity: Option<GetSecondaryStorageNamesError> = crate::from_str_patched(&local_var_content).ok();
971 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
972 Err(Error::ResponseError(local_var_error))
973 }
974}
975
976pub async fn get_stats(configuration: &configuration::Configuration, ) -> Result<models::GetStats200Response, Error<GetStatsError>> {
977 let local_var_configuration = configuration;
978
979 let local_var_client = &local_var_configuration.client;
980
981 let local_var_uri_str = format!("{}/settings/get_stats", local_var_configuration.base_path);
982 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
983
984 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
985 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
986 }
987 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
988 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
989 };
990
991 let local_var_req = local_var_req_builder.build()?;
992 let local_var_resp = local_var_client.execute(local_var_req).await?;
993
994 let local_var_status = local_var_resp.status();
995 let local_var_content = local_var_resp.text().await?;
996
997 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
998 crate::from_str_patched(&local_var_content).map_err(Error::from)
999 } else {
1000 let local_var_entity: Option<GetStatsError> = crate::from_str_patched(&local_var_content).ok();
1001 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1002 Err(Error::ResponseError(local_var_error))
1003 }
1004}
1005
1006pub async fn list_custom_instance_dbs(configuration: &configuration::Configuration, ) -> Result<std::collections::HashMap<String, models::CustomInstanceDb>, Error<ListCustomInstanceDbsError>> {
1007 let local_var_configuration = configuration;
1008
1009 let local_var_client = &local_var_configuration.client;
1010
1011 let local_var_uri_str = format!("{}/settings/list_custom_instance_pg_databases", local_var_configuration.base_path);
1012 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1013
1014 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1015 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1016 }
1017 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1018 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1019 };
1020
1021 let local_var_req = local_var_req_builder.build()?;
1022 let local_var_resp = local_var_client.execute(local_var_req).await?;
1023
1024 let local_var_status = local_var_resp.status();
1025 let local_var_content = local_var_resp.text().await?;
1026
1027 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1028 crate::from_str_patched(&local_var_content).map_err(Error::from)
1029 } else {
1030 let local_var_entity: Option<ListCustomInstanceDbsError> = crate::from_str_patched(&local_var_content).ok();
1031 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1032 Err(Error::ResponseError(local_var_error))
1033 }
1034}
1035
1036pub async fn list_global_settings(configuration: &configuration::Configuration, ) -> Result<Vec<models::GlobalSetting>, Error<ListGlobalSettingsError>> {
1037 let local_var_configuration = configuration;
1038
1039 let local_var_client = &local_var_configuration.client;
1040
1041 let local_var_uri_str = format!("{}/settings/list_global", local_var_configuration.base_path);
1042 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1043
1044 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1045 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1046 }
1047 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1048 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1049 };
1050
1051 let local_var_req = local_var_req_builder.build()?;
1052 let local_var_resp = local_var_client.execute(local_var_req).await?;
1053
1054 let local_var_status = local_var_resp.status();
1055 let local_var_content = local_var_resp.text().await?;
1056
1057 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1058 crate::from_str_patched(&local_var_content).map_err(Error::from)
1059 } else {
1060 let local_var_entity: Option<ListGlobalSettingsError> = crate::from_str_patched(&local_var_content).ok();
1061 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1062 Err(Error::ResponseError(local_var_error))
1063 }
1064}
1065
1066pub async fn migrate_secrets_from_aws_sm(configuration: &configuration::Configuration, aws_secrets_manager_settings: models::AwsSecretsManagerSettings) -> Result<models::SecretMigrationReport, Error<MigrateSecretsFromAwsSmError>> {
1067 let local_var_configuration = configuration;
1068
1069 let local_var_client = &local_var_configuration.client;
1070
1071 let local_var_uri_str = format!("{}/settings/migrate_secrets_from_aws_sm", local_var_configuration.base_path);
1072 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1073
1074 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1075 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1076 }
1077 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1078 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1079 };
1080 local_var_req_builder = local_var_req_builder.json(&aws_secrets_manager_settings);
1081
1082 let local_var_req = local_var_req_builder.build()?;
1083 let local_var_resp = local_var_client.execute(local_var_req).await?;
1084
1085 let local_var_status = local_var_resp.status();
1086 let local_var_content = local_var_resp.text().await?;
1087
1088 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1089 crate::from_str_patched(&local_var_content).map_err(Error::from)
1090 } else {
1091 let local_var_entity: Option<MigrateSecretsFromAwsSmError> = crate::from_str_patched(&local_var_content).ok();
1092 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1093 Err(Error::ResponseError(local_var_error))
1094 }
1095}
1096
1097pub async fn migrate_secrets_from_azure_kv(configuration: &configuration::Configuration, azure_key_vault_settings: models::AzureKeyVaultSettings) -> Result<models::SecretMigrationReport, Error<MigrateSecretsFromAzureKvError>> {
1098 let local_var_configuration = configuration;
1099
1100 let local_var_client = &local_var_configuration.client;
1101
1102 let local_var_uri_str = format!("{}/settings/migrate_secrets_from_azure_kv", local_var_configuration.base_path);
1103 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1104
1105 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1106 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1107 }
1108 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1109 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1110 };
1111 local_var_req_builder = local_var_req_builder.json(&azure_key_vault_settings);
1112
1113 let local_var_req = local_var_req_builder.build()?;
1114 let local_var_resp = local_var_client.execute(local_var_req).await?;
1115
1116 let local_var_status = local_var_resp.status();
1117 let local_var_content = local_var_resp.text().await?;
1118
1119 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1120 crate::from_str_patched(&local_var_content).map_err(Error::from)
1121 } else {
1122 let local_var_entity: Option<MigrateSecretsFromAzureKvError> = crate::from_str_patched(&local_var_content).ok();
1123 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1124 Err(Error::ResponseError(local_var_error))
1125 }
1126}
1127
1128pub async fn migrate_secrets_to_aws_sm(configuration: &configuration::Configuration, aws_secrets_manager_settings: models::AwsSecretsManagerSettings) -> Result<models::SecretMigrationReport, Error<MigrateSecretsToAwsSmError>> {
1129 let local_var_configuration = configuration;
1130
1131 let local_var_client = &local_var_configuration.client;
1132
1133 let local_var_uri_str = format!("{}/settings/migrate_secrets_to_aws_sm", local_var_configuration.base_path);
1134 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1135
1136 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1137 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1138 }
1139 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1140 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1141 };
1142 local_var_req_builder = local_var_req_builder.json(&aws_secrets_manager_settings);
1143
1144 let local_var_req = local_var_req_builder.build()?;
1145 let local_var_resp = local_var_client.execute(local_var_req).await?;
1146
1147 let local_var_status = local_var_resp.status();
1148 let local_var_content = local_var_resp.text().await?;
1149
1150 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1151 crate::from_str_patched(&local_var_content).map_err(Error::from)
1152 } else {
1153 let local_var_entity: Option<MigrateSecretsToAwsSmError> = crate::from_str_patched(&local_var_content).ok();
1154 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1155 Err(Error::ResponseError(local_var_error))
1156 }
1157}
1158
1159pub async fn migrate_secrets_to_azure_kv(configuration: &configuration::Configuration, azure_key_vault_settings: models::AzureKeyVaultSettings) -> Result<models::SecretMigrationReport, Error<MigrateSecretsToAzureKvError>> {
1160 let local_var_configuration = configuration;
1161
1162 let local_var_client = &local_var_configuration.client;
1163
1164 let local_var_uri_str = format!("{}/settings/migrate_secrets_to_azure_kv", local_var_configuration.base_path);
1165 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1166
1167 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1168 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1169 }
1170 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1171 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1172 };
1173 local_var_req_builder = local_var_req_builder.json(&azure_key_vault_settings);
1174
1175 let local_var_req = local_var_req_builder.build()?;
1176 let local_var_resp = local_var_client.execute(local_var_req).await?;
1177
1178 let local_var_status = local_var_resp.status();
1179 let local_var_content = local_var_resp.text().await?;
1180
1181 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1182 crate::from_str_patched(&local_var_content).map_err(Error::from)
1183 } else {
1184 let local_var_entity: Option<MigrateSecretsToAzureKvError> = crate::from_str_patched(&local_var_content).ok();
1185 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1186 Err(Error::ResponseError(local_var_error))
1187 }
1188}
1189
1190pub async fn migrate_secrets_to_database(configuration: &configuration::Configuration, vault_settings: models::VaultSettings) -> Result<models::SecretMigrationReport, Error<MigrateSecretsToDatabaseError>> {
1191 let local_var_configuration = configuration;
1192
1193 let local_var_client = &local_var_configuration.client;
1194
1195 let local_var_uri_str = format!("{}/settings/migrate_secrets_to_database", local_var_configuration.base_path);
1196 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1197
1198 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1199 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1200 }
1201 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1202 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1203 };
1204 local_var_req_builder = local_var_req_builder.json(&vault_settings);
1205
1206 let local_var_req = local_var_req_builder.build()?;
1207 let local_var_resp = local_var_client.execute(local_var_req).await?;
1208
1209 let local_var_status = local_var_resp.status();
1210 let local_var_content = local_var_resp.text().await?;
1211
1212 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1213 crate::from_str_patched(&local_var_content).map_err(Error::from)
1214 } else {
1215 let local_var_entity: Option<MigrateSecretsToDatabaseError> = crate::from_str_patched(&local_var_content).ok();
1216 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1217 Err(Error::ResponseError(local_var_error))
1218 }
1219}
1220
1221pub async fn migrate_secrets_to_vault(configuration: &configuration::Configuration, vault_settings: models::VaultSettings) -> Result<models::SecretMigrationReport, Error<MigrateSecretsToVaultError>> {
1222 let local_var_configuration = configuration;
1223
1224 let local_var_client = &local_var_configuration.client;
1225
1226 let local_var_uri_str = format!("{}/settings/migrate_secrets_to_vault", local_var_configuration.base_path);
1227 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1228
1229 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1230 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1231 }
1232 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1233 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1234 };
1235 local_var_req_builder = local_var_req_builder.json(&vault_settings);
1236
1237 let local_var_req = local_var_req_builder.build()?;
1238 let local_var_resp = local_var_client.execute(local_var_req).await?;
1239
1240 let local_var_status = local_var_resp.status();
1241 let local_var_content = local_var_resp.text().await?;
1242
1243 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1244 crate::from_str_patched(&local_var_content).map_err(Error::from)
1245 } else {
1246 let local_var_entity: Option<MigrateSecretsToVaultError> = crate::from_str_patched(&local_var_content).ok();
1247 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1248 Err(Error::ResponseError(local_var_error))
1249 }
1250}
1251
1252pub async fn refresh_custom_instance_user_pwd(configuration: &configuration::Configuration, ) -> Result<serde_json::Value, Error<RefreshCustomInstanceUserPwdError>> {
1253 let local_var_configuration = configuration;
1254
1255 let local_var_client = &local_var_configuration.client;
1256
1257 let local_var_uri_str = format!("{}/settings/refresh_custom_instance_user_pwd", local_var_configuration.base_path);
1258 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1259
1260 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1261 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1262 }
1263 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1264 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1265 };
1266
1267 let local_var_req = local_var_req_builder.build()?;
1268 let local_var_resp = local_var_client.execute(local_var_req).await?;
1269
1270 let local_var_status = local_var_resp.status();
1271 let local_var_content = local_var_resp.text().await?;
1272
1273 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1274 crate::from_str_patched(&local_var_content).map_err(Error::from)
1275 } else {
1276 let local_var_entity: Option<RefreshCustomInstanceUserPwdError> = crate::from_str_patched(&local_var_content).ok();
1277 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1278 Err(Error::ResponseError(local_var_error))
1279 }
1280}
1281
1282pub async fn renew_license_key(configuration: &configuration::Configuration, license_key: Option<&str>) -> Result<String, Error<RenewLicenseKeyError>> {
1283 let local_var_configuration = configuration;
1284
1285 let local_var_client = &local_var_configuration.client;
1286
1287 let local_var_uri_str = format!("{}/settings/renew_license_key", local_var_configuration.base_path);
1288 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1289
1290 if let Some(ref local_var_str) = license_key {
1291 local_var_req_builder = local_var_req_builder.query(&[("license_key", &local_var_str.to_string())]);
1292 }
1293 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1294 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1295 }
1296 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1297 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1298 };
1299
1300 let local_var_req = local_var_req_builder.build()?;
1301 let local_var_resp = local_var_client.execute(local_var_req).await?;
1302
1303 let local_var_status = local_var_resp.status();
1304 let local_var_content = local_var_resp.text().await?;
1305
1306 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1307 crate::from_str_patched(&local_var_content).map_err(Error::from)
1308 } else {
1309 let local_var_entity: Option<RenewLicenseKeyError> = crate::from_str_patched(&local_var_content).ok();
1310 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1311 Err(Error::ResponseError(local_var_error))
1312 }
1313}
1314
1315pub async fn restart_worker_group(configuration: &configuration::Configuration, worker_group: &str) -> Result<String, Error<RestartWorkerGroupError>> {
1317 let local_var_configuration = configuration;
1318
1319 let local_var_client = &local_var_configuration.client;
1320
1321 let local_var_uri_str = format!("{}/settings/restart_worker_group/{worker_group}", local_var_configuration.base_path, worker_group=crate::apis::urlencode(worker_group));
1322 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1323
1324 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1325 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1326 }
1327 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1328 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1329 };
1330
1331 let local_var_req = local_var_req_builder.build()?;
1332 let local_var_resp = local_var_client.execute(local_var_req).await?;
1333
1334 let local_var_status = local_var_resp.status();
1335 let local_var_content = local_var_resp.text().await?;
1336
1337 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1338 crate::from_str_patched(&local_var_content).map_err(Error::from)
1339 } else {
1340 let local_var_entity: Option<RestartWorkerGroupError> = crate::from_str_patched(&local_var_content).ok();
1341 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1342 Err(Error::ResponseError(local_var_error))
1343 }
1344}
1345
1346pub async fn restart_worker_pool(configuration: &configuration::Configuration, worker_pool: &str) -> Result<String, Error<RestartWorkerPoolError>> {
1348 let local_var_configuration = configuration;
1349
1350 let local_var_client = &local_var_configuration.client;
1351
1352 let local_var_uri_str = format!("{}/settings/restart_worker_pool/{worker_pool}", local_var_configuration.base_path, worker_pool=crate::apis::urlencode(worker_pool));
1353 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1354
1355 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1356 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1357 }
1358 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1359 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1360 };
1361
1362 let local_var_req = local_var_req_builder.build()?;
1363 let local_var_resp = local_var_client.execute(local_var_req).await?;
1364
1365 let local_var_status = local_var_resp.status();
1366 let local_var_content = local_var_resp.text().await?;
1367
1368 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1369 crate::from_str_patched(&local_var_content).map_err(Error::from)
1370 } else {
1371 let local_var_entity: Option<RestartWorkerPoolError> = crate::from_str_patched(&local_var_content).ok();
1372 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1373 Err(Error::ResponseError(local_var_error))
1374 }
1375}
1376
1377pub async fn revalidate_license(configuration: &configuration::Configuration, ) -> Result<models::RevalidateLicense200Response, Error<RevalidateLicenseError>> {
1379 let local_var_configuration = configuration;
1380
1381 let local_var_client = &local_var_configuration.client;
1382
1383 let local_var_uri_str = format!("{}/settings/revalidate_license", local_var_configuration.base_path);
1384 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1385
1386 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1387 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1388 }
1389 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1390 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1391 };
1392
1393 let local_var_req = local_var_req_builder.build()?;
1394 let local_var_resp = local_var_client.execute(local_var_req).await?;
1395
1396 let local_var_status = local_var_resp.status();
1397 let local_var_content = local_var_resp.text().await?;
1398
1399 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1400 crate::from_str_patched(&local_var_content).map_err(Error::from)
1401 } else {
1402 let local_var_entity: Option<RevalidateLicenseError> = crate::from_str_patched(&local_var_content).ok();
1403 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1404 Err(Error::ResponseError(local_var_error))
1405 }
1406}
1407
1408pub async fn run_log_cleanup(configuration: &configuration::Configuration, ) -> Result<String, Error<RunLogCleanupError>> {
1409 let local_var_configuration = configuration;
1410
1411 let local_var_client = &local_var_configuration.client;
1412
1413 let local_var_uri_str = format!("{}/settings/run_log_cleanup", local_var_configuration.base_path);
1414 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1415
1416 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1417 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1418 }
1419 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1420 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1421 };
1422
1423 let local_var_req = local_var_req_builder.build()?;
1424 let local_var_resp = local_var_client.execute(local_var_req).await?;
1425
1426 let local_var_status = local_var_resp.status();
1427 let local_var_content = local_var_resp.text().await?;
1428
1429 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1430 crate::from_str_patched(&local_var_content).map_err(Error::from)
1431 } else {
1432 let local_var_entity: Option<RunLogCleanupError> = crate::from_str_patched(&local_var_content).ok();
1433 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1434 Err(Error::ResponseError(local_var_error))
1435 }
1436}
1437
1438pub async fn save_saml_config(configuration: &configuration::Configuration, saml_config_request: models::SamlConfigRequest) -> Result<models::SamlConfig, Error<SaveSamlConfigError>> {
1439 let local_var_configuration = configuration;
1440
1441 let local_var_client = &local_var_configuration.client;
1442
1443 let local_var_uri_str = format!("{}/saml/config", local_var_configuration.base_path);
1444 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1445
1446 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1447 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1448 }
1449 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1450 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1451 };
1452 local_var_req_builder = local_var_req_builder.json(&saml_config_request);
1453
1454 let local_var_req = local_var_req_builder.build()?;
1455 let local_var_resp = local_var_client.execute(local_var_req).await?;
1456
1457 let local_var_status = local_var_resp.status();
1458 let local_var_content = local_var_resp.text().await?;
1459
1460 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1461 crate::from_str_patched(&local_var_content).map_err(Error::from)
1462 } else {
1463 let local_var_entity: Option<SaveSamlConfigError> = crate::from_str_patched(&local_var_content).ok();
1464 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1465 Err(Error::ResponseError(local_var_error))
1466 }
1467}
1468
1469pub async fn send_stats(configuration: &configuration::Configuration, ) -> Result<String, Error<SendStatsError>> {
1470 let local_var_configuration = configuration;
1471
1472 let local_var_client = &local_var_configuration.client;
1473
1474 let local_var_uri_str = format!("{}/settings/send_stats", local_var_configuration.base_path);
1475 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1476
1477 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1478 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1479 }
1480 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1481 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1482 };
1483
1484 let local_var_req = local_var_req_builder.build()?;
1485 let local_var_resp = local_var_client.execute(local_var_req).await?;
1486
1487 let local_var_status = local_var_resp.status();
1488 let local_var_content = local_var_resp.text().await?;
1489
1490 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1491 crate::from_str_patched(&local_var_content).map_err(Error::from)
1492 } else {
1493 let local_var_entity: Option<SendStatsError> = crate::from_str_patched(&local_var_content).ok();
1494 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1495 Err(Error::ResponseError(local_var_error))
1496 }
1497}
1498
1499pub async fn set_global(configuration: &configuration::Configuration, key: &str, set_global_request: models::SetGlobalRequest) -> Result<String, Error<SetGlobalError>> {
1500 let local_var_configuration = configuration;
1501
1502 let local_var_client = &local_var_configuration.client;
1503
1504 let local_var_uri_str = format!("{}/settings/global/{key}", local_var_configuration.base_path, key=crate::apis::urlencode(key));
1505 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1506
1507 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1508 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1509 }
1510 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1511 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1512 };
1513 local_var_req_builder = local_var_req_builder.json(&set_global_request);
1514
1515 let local_var_req = local_var_req_builder.build()?;
1516 let local_var_resp = local_var_client.execute(local_var_req).await?;
1517
1518 let local_var_status = local_var_resp.status();
1519 let local_var_content = local_var_resp.text().await?;
1520
1521 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1522 crate::from_str_patched(&local_var_content).map_err(Error::from)
1523 } else {
1524 let local_var_entity: Option<SetGlobalError> = crate::from_str_patched(&local_var_content).ok();
1525 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1526 Err(Error::ResponseError(local_var_error))
1527 }
1528}
1529
1530pub async fn set_instance_config(configuration: &configuration::Configuration, instance_config: models::InstanceConfig) -> Result<String, Error<SetInstanceConfigError>> {
1531 let local_var_configuration = configuration;
1532
1533 let local_var_client = &local_var_configuration.client;
1534
1535 let local_var_uri_str = format!("{}/settings/instance_config", local_var_configuration.base_path);
1536 let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
1537
1538 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1539 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1540 }
1541 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1542 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1543 };
1544 local_var_req_builder = local_var_req_builder.json(&instance_config);
1545
1546 let local_var_req = local_var_req_builder.build()?;
1547 let local_var_resp = local_var_client.execute(local_var_req).await?;
1548
1549 let local_var_status = local_var_resp.status();
1550 let local_var_content = local_var_resp.text().await?;
1551
1552 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1553 crate::from_str_patched(&local_var_content).map_err(Error::from)
1554 } else {
1555 let local_var_entity: Option<SetInstanceConfigError> = crate::from_str_patched(&local_var_content).ok();
1556 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1557 Err(Error::ResponseError(local_var_error))
1558 }
1559}
1560
1561pub async fn set_public_app_rate_limit(configuration: &configuration::Configuration, workspace: &str, set_public_app_rate_limit_request: models::SetPublicAppRateLimitRequest) -> Result<String, Error<SetPublicAppRateLimitError>> {
1562 let local_var_configuration = configuration;
1563
1564 let local_var_client = &local_var_configuration.client;
1565
1566 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/public_app_rate_limit", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1567 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1568
1569 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1570 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1571 }
1572 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1573 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1574 };
1575 local_var_req_builder = local_var_req_builder.json(&set_public_app_rate_limit_request);
1576
1577 let local_var_req = local_var_req_builder.build()?;
1578 let local_var_resp = local_var_client.execute(local_var_req).await?;
1579
1580 let local_var_status = local_var_resp.status();
1581 let local_var_content = local_var_resp.text().await?;
1582
1583 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1584 crate::from_str_patched(&local_var_content).map_err(Error::from)
1585 } else {
1586 let local_var_entity: Option<SetPublicAppRateLimitError> = crate::from_str_patched(&local_var_content).ok();
1587 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1588 Err(Error::ResponseError(local_var_error))
1589 }
1590}
1591
1592pub async fn setup_custom_instance_db(configuration: &configuration::Configuration, name: &str, setup_custom_instance_db_request: models::SetupCustomInstanceDbRequest) -> Result<models::CustomInstanceDb, Error<SetupCustomInstanceDbError>> {
1593 let local_var_configuration = configuration;
1594
1595 let local_var_client = &local_var_configuration.client;
1596
1597 let local_var_uri_str = format!("{}/settings/setup_custom_instance_pg_database/{name}", local_var_configuration.base_path, name=crate::apis::urlencode(name));
1598 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1599
1600 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1601 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1602 }
1603 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1604 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1605 };
1606 local_var_req_builder = local_var_req_builder.json(&setup_custom_instance_db_request);
1607
1608 let local_var_req = local_var_req_builder.build()?;
1609 let local_var_resp = local_var_client.execute(local_var_req).await?;
1610
1611 let local_var_status = local_var_resp.status();
1612 let local_var_content = local_var_resp.text().await?;
1613
1614 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1615 crate::from_str_patched(&local_var_content).map_err(Error::from)
1616 } else {
1617 let local_var_entity: Option<SetupCustomInstanceDbError> = crate::from_str_patched(&local_var_content).ok();
1618 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1619 Err(Error::ResponseError(local_var_error))
1620 }
1621}
1622
1623pub async fn test_aws_sm_backend(configuration: &configuration::Configuration, aws_secrets_manager_settings: models::AwsSecretsManagerSettings) -> Result<String, Error<TestAwsSmBackendError>> {
1624 let local_var_configuration = configuration;
1625
1626 let local_var_client = &local_var_configuration.client;
1627
1628 let local_var_uri_str = format!("{}/settings/test_aws_sm_backend", local_var_configuration.base_path);
1629 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1630
1631 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1632 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1633 }
1634 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1635 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1636 };
1637 local_var_req_builder = local_var_req_builder.json(&aws_secrets_manager_settings);
1638
1639 let local_var_req = local_var_req_builder.build()?;
1640 let local_var_resp = local_var_client.execute(local_var_req).await?;
1641
1642 let local_var_status = local_var_resp.status();
1643 let local_var_content = local_var_resp.text().await?;
1644
1645 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1646 crate::from_str_patched(&local_var_content).map_err(Error::from)
1647 } else {
1648 let local_var_entity: Option<TestAwsSmBackendError> = crate::from_str_patched(&local_var_content).ok();
1649 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1650 Err(Error::ResponseError(local_var_error))
1651 }
1652}
1653
1654pub async fn test_azure_kv_backend(configuration: &configuration::Configuration, azure_key_vault_settings: models::AzureKeyVaultSettings) -> Result<String, Error<TestAzureKvBackendError>> {
1655 let local_var_configuration = configuration;
1656
1657 let local_var_client = &local_var_configuration.client;
1658
1659 let local_var_uri_str = format!("{}/settings/test_azure_kv_backend", local_var_configuration.base_path);
1660 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1661
1662 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1663 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1664 }
1665 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1666 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1667 };
1668 local_var_req_builder = local_var_req_builder.json(&azure_key_vault_settings);
1669
1670 let local_var_req = local_var_req_builder.build()?;
1671 let local_var_resp = local_var_client.execute(local_var_req).await?;
1672
1673 let local_var_status = local_var_resp.status();
1674 let local_var_content = local_var_resp.text().await?;
1675
1676 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1677 crate::from_str_patched(&local_var_content).map_err(Error::from)
1678 } else {
1679 let local_var_entity: Option<TestAzureKvBackendError> = crate::from_str_patched(&local_var_content).ok();
1680 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1681 Err(Error::ResponseError(local_var_error))
1682 }
1683}
1684
1685pub async fn test_critical_channels(configuration: &configuration::Configuration, test_critical_channels_request_inner: Vec<models::TestCriticalChannelsRequestInner>) -> Result<String, Error<TestCriticalChannelsError>> {
1686 let local_var_configuration = configuration;
1687
1688 let local_var_client = &local_var_configuration.client;
1689
1690 let local_var_uri_str = format!("{}/settings/test_critical_channels", local_var_configuration.base_path);
1691 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1692
1693 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1694 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1695 }
1696 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1697 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1698 };
1699 local_var_req_builder = local_var_req_builder.json(&test_critical_channels_request_inner);
1700
1701 let local_var_req = local_var_req_builder.build()?;
1702 let local_var_resp = local_var_client.execute(local_var_req).await?;
1703
1704 let local_var_status = local_var_resp.status();
1705 let local_var_content = local_var_resp.text().await?;
1706
1707 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1708 crate::from_str_patched(&local_var_content).map_err(Error::from)
1709 } else {
1710 let local_var_entity: Option<TestCriticalChannelsError> = crate::from_str_patched(&local_var_content).ok();
1711 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1712 Err(Error::ResponseError(local_var_error))
1713 }
1714}
1715
1716pub async fn test_license_key(configuration: &configuration::Configuration, test_license_key_request: models::TestLicenseKeyRequest) -> Result<String, Error<TestLicenseKeyError>> {
1717 let local_var_configuration = configuration;
1718
1719 let local_var_client = &local_var_configuration.client;
1720
1721 let local_var_uri_str = format!("{}/settings/test_license_key", local_var_configuration.base_path);
1722 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1723
1724 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1725 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1726 }
1727 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1728 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1729 };
1730 local_var_req_builder = local_var_req_builder.json(&test_license_key_request);
1731
1732 let local_var_req = local_var_req_builder.build()?;
1733 let local_var_resp = local_var_client.execute(local_var_req).await?;
1734
1735 let local_var_status = local_var_resp.status();
1736 let local_var_content = local_var_resp.text().await?;
1737
1738 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1739 crate::from_str_patched(&local_var_content).map_err(Error::from)
1740 } else {
1741 let local_var_entity: Option<TestLicenseKeyError> = crate::from_str_patched(&local_var_content).ok();
1742 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1743 Err(Error::ResponseError(local_var_error))
1744 }
1745}
1746
1747pub async fn test_metadata(configuration: &configuration::Configuration, body: &str) -> Result<String, Error<TestMetadataError>> {
1748 let local_var_configuration = configuration;
1749
1750 let local_var_client = &local_var_configuration.client;
1751
1752 let local_var_uri_str = format!("{}/saml/test_metadata", local_var_configuration.base_path);
1753 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1754
1755 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1756 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1757 }
1758 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1759 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1760 };
1761 local_var_req_builder = local_var_req_builder.json(&body);
1762
1763 let local_var_req = local_var_req_builder.build()?;
1764 let local_var_resp = local_var_client.execute(local_var_req).await?;
1765
1766 let local_var_status = local_var_resp.status();
1767 let local_var_content = local_var_resp.text().await?;
1768
1769 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1770 crate::from_str_patched(&local_var_content).map_err(Error::from)
1771 } else {
1772 let local_var_entity: Option<TestMetadataError> = crate::from_str_patched(&local_var_content).ok();
1773 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1774 Err(Error::ResponseError(local_var_error))
1775 }
1776}
1777
1778pub async fn test_object_storage_config(configuration: &configuration::Configuration, request_body: std::collections::HashMap<String, serde_json::Value>) -> Result<String, Error<TestObjectStorageConfigError>> {
1779 let local_var_configuration = configuration;
1780
1781 let local_var_client = &local_var_configuration.client;
1782
1783 let local_var_uri_str = format!("{}/settings/test_object_storage_config", local_var_configuration.base_path);
1784 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1785
1786 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1787 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1788 }
1789 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1790 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1791 };
1792 local_var_req_builder = local_var_req_builder.json(&request_body);
1793
1794 let local_var_req = local_var_req_builder.build()?;
1795 let local_var_resp = local_var_client.execute(local_var_req).await?;
1796
1797 let local_var_status = local_var_resp.status();
1798 let local_var_content = local_var_resp.text().await?;
1799
1800 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1801 crate::from_str_patched(&local_var_content).map_err(Error::from)
1802 } else {
1803 let local_var_entity: Option<TestObjectStorageConfigError> = crate::from_str_patched(&local_var_content).ok();
1804 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1805 Err(Error::ResponseError(local_var_error))
1806 }
1807}
1808
1809pub async fn test_secret_backend(configuration: &configuration::Configuration, vault_settings: models::VaultSettings) -> Result<String, Error<TestSecretBackendError>> {
1810 let local_var_configuration = configuration;
1811
1812 let local_var_client = &local_var_configuration.client;
1813
1814 let local_var_uri_str = format!("{}/settings/test_secret_backend", local_var_configuration.base_path);
1815 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1816
1817 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1818 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1819 }
1820 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1821 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1822 };
1823 local_var_req_builder = local_var_req_builder.json(&vault_settings);
1824
1825 let local_var_req = local_var_req_builder.build()?;
1826 let local_var_resp = local_var_client.execute(local_var_req).await?;
1827
1828 let local_var_status = local_var_resp.status();
1829 let local_var_content = local_var_resp.text().await?;
1830
1831 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1832 crate::from_str_patched(&local_var_content).map_err(Error::from)
1833 } else {
1834 let local_var_entity: Option<TestSecretBackendError> = crate::from_str_patched(&local_var_content).ok();
1835 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1836 Err(Error::ResponseError(local_var_error))
1837 }
1838}
1839
1840pub async fn test_smtp(configuration: &configuration::Configuration, test_smtp_request: models::TestSmtpRequest) -> Result<String, Error<TestSmtpError>> {
1841 let local_var_configuration = configuration;
1842
1843 let local_var_client = &local_var_configuration.client;
1844
1845 let local_var_uri_str = format!("{}/settings/test_smtp", local_var_configuration.base_path);
1846 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1847
1848 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1849 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1850 }
1851 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1852 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1853 };
1854 local_var_req_builder = local_var_req_builder.json(&test_smtp_request);
1855
1856 let local_var_req = local_var_req_builder.build()?;
1857 let local_var_resp = local_var_client.execute(local_var_req).await?;
1858
1859 let local_var_status = local_var_resp.status();
1860 let local_var_content = local_var_resp.text().await?;
1861
1862 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1863 crate::from_str_patched(&local_var_content).map_err(Error::from)
1864 } else {
1865 let local_var_entity: Option<TestSmtpError> = crate::from_str_patched(&local_var_content).ok();
1866 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1867 Err(Error::ResponseError(local_var_error))
1868 }
1869}
1870
1871pub async fn update_saml_metadata(configuration: &configuration::Configuration, ) -> Result<models::SamlConfig, Error<UpdateSamlMetadataError>> {
1872 let local_var_configuration = configuration;
1873
1874 let local_var_client = &local_var_configuration.client;
1875
1876 let local_var_uri_str = format!("{}/saml/update_metadata", local_var_configuration.base_path);
1877 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1878
1879 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1880 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1881 }
1882 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1883 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1884 };
1885
1886 let local_var_req = local_var_req_builder.build()?;
1887 let local_var_resp = local_var_client.execute(local_var_req).await?;
1888
1889 let local_var_status = local_var_resp.status();
1890 let local_var_content = local_var_resp.text().await?;
1891
1892 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1893 crate::from_str_patched(&local_var_content).map_err(Error::from)
1894 } else {
1895 let local_var_entity: Option<UpdateSamlMetadataError> = crate::from_str_patched(&local_var_content).ok();
1896 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1897 Err(Error::ResponseError(local_var_error))
1898 }
1899}
1900
1901pub async fn workspace_acknowledge_all_critical_alerts(configuration: &configuration::Configuration, workspace: &str) -> Result<String, Error<WorkspaceAcknowledgeAllCriticalAlertsError>> {
1902 let local_var_configuration = configuration;
1903
1904 let local_var_client = &local_var_configuration.client;
1905
1906 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/critical_alerts/acknowledge_all", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1907 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1908
1909 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1910 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1911 }
1912 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1913 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1914 };
1915
1916 let local_var_req = local_var_req_builder.build()?;
1917 let local_var_resp = local_var_client.execute(local_var_req).await?;
1918
1919 let local_var_status = local_var_resp.status();
1920 let local_var_content = local_var_resp.text().await?;
1921
1922 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1923 crate::from_str_patched(&local_var_content).map_err(Error::from)
1924 } else {
1925 let local_var_entity: Option<WorkspaceAcknowledgeAllCriticalAlertsError> = crate::from_str_patched(&local_var_content).ok();
1926 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1927 Err(Error::ResponseError(local_var_error))
1928 }
1929}
1930
1931pub async fn workspace_acknowledge_critical_alert(configuration: &configuration::Configuration, workspace: &str, id: i32) -> Result<String, Error<WorkspaceAcknowledgeCriticalAlertError>> {
1932 let local_var_configuration = configuration;
1933
1934 let local_var_client = &local_var_configuration.client;
1935
1936 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/critical_alerts/{id}/acknowledge", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), id=id);
1937 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1938
1939 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1940 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1941 }
1942 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1943 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1944 };
1945
1946 let local_var_req = local_var_req_builder.build()?;
1947 let local_var_resp = local_var_client.execute(local_var_req).await?;
1948
1949 let local_var_status = local_var_resp.status();
1950 let local_var_content = local_var_resp.text().await?;
1951
1952 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1953 crate::from_str_patched(&local_var_content).map_err(Error::from)
1954 } else {
1955 let local_var_entity: Option<WorkspaceAcknowledgeCriticalAlertError> = crate::from_str_patched(&local_var_content).ok();
1956 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1957 Err(Error::ResponseError(local_var_error))
1958 }
1959}
1960
1961pub async fn workspace_get_critical_alerts(configuration: &configuration::Configuration, workspace: &str, page: Option<i32>, page_size: Option<i32>, acknowledged: Option<bool>) -> Result<models::GetCriticalAlerts200Response, Error<WorkspaceGetCriticalAlertsError>> {
1962 let local_var_configuration = configuration;
1963
1964 let local_var_client = &local_var_configuration.client;
1965
1966 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/critical_alerts", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1967 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1968
1969 if let Some(ref local_var_str) = page {
1970 local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
1971 }
1972 if let Some(ref local_var_str) = page_size {
1973 local_var_req_builder = local_var_req_builder.query(&[("page_size", &local_var_str.to_string())]);
1974 }
1975 if let Some(ref local_var_str) = acknowledged {
1976 local_var_req_builder = local_var_req_builder.query(&[("acknowledged", &local_var_str.to_string())]);
1977 }
1978 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1979 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1980 }
1981 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1982 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1983 };
1984
1985 let local_var_req = local_var_req_builder.build()?;
1986 let local_var_resp = local_var_client.execute(local_var_req).await?;
1987
1988 let local_var_status = local_var_resp.status();
1989 let local_var_content = local_var_resp.text().await?;
1990
1991 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1992 crate::from_str_patched(&local_var_content).map_err(Error::from)
1993 } else {
1994 let local_var_entity: Option<WorkspaceGetCriticalAlertsError> = crate::from_str_patched(&local_var_content).ok();
1995 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1996 Err(Error::ResponseError(local_var_error))
1997 }
1998}
1999
2000pub async fn workspace_mute_critical_alerts_ui(configuration: &configuration::Configuration, workspace: &str, workspace_mute_critical_alerts_ui_request: models::WorkspaceMuteCriticalAlertsUiRequest) -> Result<String, Error<WorkspaceMuteCriticalAlertsUiError>> {
2001 let local_var_configuration = configuration;
2002
2003 let local_var_client = &local_var_configuration.client;
2004
2005 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/critical_alerts/mute", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2006 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2007
2008 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2009 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2010 }
2011 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2012 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2013 };
2014 local_var_req_builder = local_var_req_builder.json(&workspace_mute_critical_alerts_ui_request);
2015
2016 let local_var_req = local_var_req_builder.build()?;
2017 let local_var_resp = local_var_client.execute(local_var_req).await?;
2018
2019 let local_var_status = local_var_resp.status();
2020 let local_var_content = local_var_resp.text().await?;
2021
2022 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2023 crate::from_str_patched(&local_var_content).map_err(Error::from)
2024 } else {
2025 let local_var_entity: Option<WorkspaceMuteCriticalAlertsUiError> = crate::from_str_patched(&local_var_content).ok();
2026 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2027 Err(Error::ResponseError(local_var_error))
2028 }
2029}
2030