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