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