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 CreateExternalInstancePgDatabaseError {
50 UnknownValue(serde_json::Value),
51}
52
53#[derive(Debug, Clone, Serialize, Deserialize)]
55#[serde(untagged)]
56pub enum CreateInstanceDatatableRoleError {
57 Status409(),
58 UnknownValue(serde_json::Value),
59}
60
61#[derive(Debug, Clone, Serialize, Deserialize)]
63#[serde(untagged)]
64pub enum DeleteInstanceDatatableRoleError {
65 UnknownValue(serde_json::Value),
66}
67
68#[derive(Debug, Clone, Serialize, Deserialize)]
70#[serde(untagged)]
71pub enum DropCustomInstanceDbError {
72 UnknownValue(serde_json::Value),
73}
74
75#[derive(Debug, Clone, Serialize, Deserialize)]
77#[serde(untagged)]
78pub enum DropExternalInstancePgDatabaseError {
79 UnknownValue(serde_json::Value),
80}
81
82#[derive(Debug, Clone, Serialize, Deserialize)]
84#[serde(untagged)]
85pub enum GetAuditLogsS3BackfillStatusError {
86 UnknownValue(serde_json::Value),
87}
88
89#[derive(Debug, Clone, Serialize, Deserialize)]
91#[serde(untagged)]
92pub enum GetAuditLogsS3StatusError {
93 UnknownValue(serde_json::Value),
94}
95
96#[derive(Debug, Clone, Serialize, Deserialize)]
98#[serde(untagged)]
99pub enum GetClientIpDiagnosticsError {
100 UnknownValue(serde_json::Value),
101}
102
103#[derive(Debug, Clone, Serialize, Deserialize)]
105#[serde(untagged)]
106pub enum GetClientIpTrustError {
107 UnknownValue(serde_json::Value),
108}
109
110#[derive(Debug, Clone, Serialize, Deserialize)]
112#[serde(untagged)]
113pub enum GetCriticalAlertsError {
114 UnknownValue(serde_json::Value),
115}
116
117#[derive(Debug, Clone, Serialize, Deserialize)]
119#[serde(untagged)]
120pub enum GetExternalInstancePgStatusError {
121 UnknownValue(serde_json::Value),
122}
123
124#[derive(Debug, Clone, Serialize, Deserialize)]
126#[serde(untagged)]
127pub enum GetGlobalError {
128 UnknownValue(serde_json::Value),
129}
130
131#[derive(Debug, Clone, Serialize, Deserialize)]
133#[serde(untagged)]
134pub enum GetInstanceConfigError {
135 UnknownValue(serde_json::Value),
136}
137
138#[derive(Debug, Clone, Serialize, Deserialize)]
140#[serde(untagged)]
141pub enum GetInstanceHashError {
142 UnknownValue(serde_json::Value),
143}
144
145#[derive(Debug, Clone, Serialize, Deserialize)]
147#[serde(untagged)]
148pub enum GetInstanceUiError {
149 UnknownValue(serde_json::Value),
150}
151
152#[derive(Debug, Clone, Serialize, Deserialize)]
154#[serde(untagged)]
155pub enum GetJwksError {
156 UnknownValue(serde_json::Value),
157}
158
159#[derive(Debug, Clone, Serialize, Deserialize)]
161#[serde(untagged)]
162pub enum GetLatestKeyRenewalAttemptError {
163 UnknownValue(serde_json::Value),
164}
165
166#[derive(Debug, Clone, Serialize, Deserialize)]
168#[serde(untagged)]
169pub enum GetLocalError {
170 UnknownValue(serde_json::Value),
171}
172
173#[derive(Debug, Clone, Serialize, Deserialize)]
175#[serde(untagged)]
176pub enum GetLogCleanupStatusError {
177 UnknownValue(serde_json::Value),
178}
179
180#[derive(Debug, Clone, Serialize, Deserialize)]
182#[serde(untagged)]
183pub enum GetMinKeepAliveVersionError {
184 UnknownValue(serde_json::Value),
185}
186
187#[derive(Debug, Clone, Serialize, Deserialize)]
189#[serde(untagged)]
190pub enum GetObjectStorageUsageError {
191 UnknownValue(serde_json::Value),
192}
193
194#[derive(Debug, Clone, Serialize, Deserialize)]
196#[serde(untagged)]
197pub enum GetOfflineLicenseStatusError {
198 UnknownValue(serde_json::Value),
199}
200
201#[derive(Debug, Clone, Serialize, Deserialize)]
203#[serde(untagged)]
204pub enum GetRuffConfigError {
205 UnknownValue(serde_json::Value),
206}
207
208#[derive(Debug, Clone, Serialize, Deserialize)]
210#[serde(untagged)]
211pub enum GetSecondaryStorageNamesError {
212 UnknownValue(serde_json::Value),
213}
214
215#[derive(Debug, Clone, Serialize, Deserialize)]
217#[serde(untagged)]
218pub enum GetSmtpConfiguredError {
219 UnknownValue(serde_json::Value),
220}
221
222#[derive(Debug, Clone, Serialize, Deserialize)]
224#[serde(untagged)]
225pub enum GetStatsError {
226 UnknownValue(serde_json::Value),
227}
228
229#[derive(Debug, Clone, Serialize, Deserialize)]
231#[serde(untagged)]
232pub enum GithubAppStaleWebhooksError {
233 UnknownValue(serde_json::Value),
234}
235
236#[derive(Debug, Clone, Serialize, Deserialize)]
238#[serde(untagged)]
239pub enum ListCustomInstanceDbsError {
240 UnknownValue(serde_json::Value),
241}
242
243#[derive(Debug, Clone, Serialize, Deserialize)]
245#[serde(untagged)]
246pub enum ListExternalInstancePgDatabasesError {
247 UnknownValue(serde_json::Value),
248}
249
250#[derive(Debug, Clone, Serialize, Deserialize)]
252#[serde(untagged)]
253pub enum ListGlobalSettingsError {
254 UnknownValue(serde_json::Value),
255}
256
257#[derive(Debug, Clone, Serialize, Deserialize)]
259#[serde(untagged)]
260pub enum ListInstanceDatatableRolesError {
261 UnknownValue(serde_json::Value),
262}
263
264#[derive(Debug, Clone, Serialize, Deserialize)]
266#[serde(untagged)]
267pub enum MigrateSecretsFromAwsSmError {
268 UnknownValue(serde_json::Value),
269}
270
271#[derive(Debug, Clone, Serialize, Deserialize)]
273#[serde(untagged)]
274pub enum MigrateSecretsFromAzureKvError {
275 UnknownValue(serde_json::Value),
276}
277
278#[derive(Debug, Clone, Serialize, Deserialize)]
280#[serde(untagged)]
281pub enum MigrateSecretsFromHttpStoreError {
282 UnknownValue(serde_json::Value),
283}
284
285#[derive(Debug, Clone, Serialize, Deserialize)]
287#[serde(untagged)]
288pub enum MigrateSecretsToAwsSmError {
289 UnknownValue(serde_json::Value),
290}
291
292#[derive(Debug, Clone, Serialize, Deserialize)]
294#[serde(untagged)]
295pub enum MigrateSecretsToAzureKvError {
296 UnknownValue(serde_json::Value),
297}
298
299#[derive(Debug, Clone, Serialize, Deserialize)]
301#[serde(untagged)]
302pub enum MigrateSecretsToDatabaseError {
303 UnknownValue(serde_json::Value),
304}
305
306#[derive(Debug, Clone, Serialize, Deserialize)]
308#[serde(untagged)]
309pub enum MigrateSecretsToVaultError {
310 UnknownValue(serde_json::Value),
311}
312
313#[derive(Debug, Clone, Serialize, Deserialize)]
315#[serde(untagged)]
316pub enum RefreshCustomInstanceUserPwdError {
317 UnknownValue(serde_json::Value),
318}
319
320#[derive(Debug, Clone, Serialize, Deserialize)]
322#[serde(untagged)]
323pub enum RenewLicenseKeyError {
324 UnknownValue(serde_json::Value),
325}
326
327#[derive(Debug, Clone, Serialize, Deserialize)]
329#[serde(untagged)]
330pub enum RestartWorkerGroupError {
331 UnknownValue(serde_json::Value),
332}
333
334#[derive(Debug, Clone, Serialize, Deserialize)]
336#[serde(untagged)]
337pub enum RunAuditLogsS3BackfillError {
338 UnknownValue(serde_json::Value),
339}
340
341#[derive(Debug, Clone, Serialize, Deserialize)]
343#[serde(untagged)]
344pub enum RunLogCleanupError {
345 UnknownValue(serde_json::Value),
346}
347
348#[derive(Debug, Clone, Serialize, Deserialize)]
350#[serde(untagged)]
351pub enum SendStatsError {
352 UnknownValue(serde_json::Value),
353}
354
355#[derive(Debug, Clone, Serialize, Deserialize)]
357#[serde(untagged)]
358pub enum SetGlobalError {
359 UnknownValue(serde_json::Value),
360}
361
362#[derive(Debug, Clone, Serialize, Deserialize)]
364#[serde(untagged)]
365pub enum SetInstanceConfigError {
366 UnknownValue(serde_json::Value),
367}
368
369#[derive(Debug, Clone, Serialize, Deserialize)]
371#[serde(untagged)]
372pub enum SetPublicAppRateLimitError {
373 UnknownValue(serde_json::Value),
374}
375
376#[derive(Debug, Clone, Serialize, Deserialize)]
378#[serde(untagged)]
379pub enum SetupCustomInstanceDbError {
380 UnknownValue(serde_json::Value),
381}
382
383#[derive(Debug, Clone, Serialize, Deserialize)]
385#[serde(untagged)]
386pub enum SetupExternalInstancePgError {
387 UnknownValue(serde_json::Value),
388}
389
390#[derive(Debug, Clone, Serialize, Deserialize)]
392#[serde(untagged)]
393pub enum TestAwsSmBackendError {
394 UnknownValue(serde_json::Value),
395}
396
397#[derive(Debug, Clone, Serialize, Deserialize)]
399#[serde(untagged)]
400pub enum TestAzureKvBackendError {
401 UnknownValue(serde_json::Value),
402}
403
404#[derive(Debug, Clone, Serialize, Deserialize)]
406#[serde(untagged)]
407pub enum TestCriticalChannelsError {
408 UnknownValue(serde_json::Value),
409}
410
411#[derive(Debug, Clone, Serialize, Deserialize)]
413#[serde(untagged)]
414pub enum TestHttpStoreBackendError {
415 UnknownValue(serde_json::Value),
416}
417
418#[derive(Debug, Clone, Serialize, Deserialize)]
420#[serde(untagged)]
421pub enum TestLicenseKeyError {
422 UnknownValue(serde_json::Value),
423}
424
425#[derive(Debug, Clone, Serialize, Deserialize)]
427#[serde(untagged)]
428pub enum TestMetadataError {
429 UnknownValue(serde_json::Value),
430}
431
432#[derive(Debug, Clone, Serialize, Deserialize)]
434#[serde(untagged)]
435pub enum TestObjectStorageConfigError {
436 UnknownValue(serde_json::Value),
437}
438
439#[derive(Debug, Clone, Serialize, Deserialize)]
441#[serde(untagged)]
442pub enum TestSecretBackendError {
443 UnknownValue(serde_json::Value),
444}
445
446#[derive(Debug, Clone, Serialize, Deserialize)]
448#[serde(untagged)]
449pub enum TestSmtpError {
450 UnknownValue(serde_json::Value),
451}
452
453#[derive(Debug, Clone, Serialize, Deserialize)]
455#[serde(untagged)]
456pub enum UpdateInstanceDatatableRoleError {
457 UnknownValue(serde_json::Value),
458}
459
460#[derive(Debug, Clone, Serialize, Deserialize)]
462#[serde(untagged)]
463pub enum WorkspaceAcknowledgeAllCriticalAlertsError {
464 UnknownValue(serde_json::Value),
465}
466
467#[derive(Debug, Clone, Serialize, Deserialize)]
469#[serde(untagged)]
470pub enum WorkspaceAcknowledgeCriticalAlertError {
471 UnknownValue(serde_json::Value),
472}
473
474#[derive(Debug, Clone, Serialize, Deserialize)]
476#[serde(untagged)]
477pub enum WorkspaceGetCriticalAlertsError {
478 UnknownValue(serde_json::Value),
479}
480
481#[derive(Debug, Clone, Serialize, Deserialize)]
483#[serde(untagged)]
484pub enum WorkspaceMuteCriticalAlertsUiError {
485 UnknownValue(serde_json::Value),
486}
487
488
489pub async fn acknowledge_all_critical_alerts(configuration: &configuration::Configuration, ) -> Result<String, Error<AcknowledgeAllCriticalAlertsError>> {
490 let local_var_configuration = configuration;
491
492 let local_var_client = &local_var_configuration.client;
493
494 let local_var_uri_str = format!("{}/settings/critical_alerts/acknowledge_all", local_var_configuration.base_path);
495 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
496
497 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
498 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
499 }
500 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
501 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
502 };
503
504 let local_var_req = local_var_req_builder.build()?;
505 let local_var_resp = local_var_client.execute(local_var_req).await?;
506
507 let local_var_status = local_var_resp.status();
508 let local_var_content = local_var_resp.text().await?;
509
510 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
511 crate::from_str_patched(&local_var_content).map_err(Error::from)
512 } else {
513 let local_var_entity: Option<AcknowledgeAllCriticalAlertsError> = crate::from_str_patched(&local_var_content).ok();
514 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
515 Err(Error::ResponseError(local_var_error))
516 }
517}
518
519pub async fn acknowledge_critical_alert(configuration: &configuration::Configuration, id: i32) -> Result<String, Error<AcknowledgeCriticalAlertError>> {
520 let local_var_configuration = configuration;
521
522 let local_var_client = &local_var_configuration.client;
523
524 let local_var_uri_str = format!("{}/settings/critical_alerts/{id}/acknowledge", local_var_configuration.base_path, id=id);
525 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
526
527 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
528 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
529 }
530 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
531 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
532 };
533
534 let local_var_req = local_var_req_builder.build()?;
535 let local_var_resp = local_var_client.execute(local_var_req).await?;
536
537 let local_var_status = local_var_resp.status();
538 let local_var_content = local_var_resp.text().await?;
539
540 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
541 crate::from_str_patched(&local_var_content).map_err(Error::from)
542 } else {
543 let local_var_entity: Option<AcknowledgeCriticalAlertError> = crate::from_str_patched(&local_var_content).ok();
544 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
545 Err(Error::ResponseError(local_var_error))
546 }
547}
548
549pub async fn compute_object_storage_usage(configuration: &configuration::Configuration, ) -> Result<String, Error<ComputeObjectStorageUsageError>> {
550 let local_var_configuration = configuration;
551
552 let local_var_client = &local_var_configuration.client;
553
554 let local_var_uri_str = format!("{}/settings/object_storage_usage", local_var_configuration.base_path);
555 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
556
557 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
558 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
559 }
560 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
561 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
562 };
563
564 let local_var_req = local_var_req_builder.build()?;
565 let local_var_resp = local_var_client.execute(local_var_req).await?;
566
567 let local_var_status = local_var_resp.status();
568 let local_var_content = local_var_resp.text().await?;
569
570 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
571 crate::from_str_patched(&local_var_content).map_err(Error::from)
572 } else {
573 let local_var_entity: Option<ComputeObjectStorageUsageError> = crate::from_str_patched(&local_var_content).ok();
574 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
575 Err(Error::ResponseError(local_var_error))
576 }
577}
578
579pub async fn create_customer_portal_session(configuration: &configuration::Configuration, license_key: Option<&str>) -> Result<String, Error<CreateCustomerPortalSessionError>> {
580 let local_var_configuration = configuration;
581
582 let local_var_client = &local_var_configuration.client;
583
584 let local_var_uri_str = format!("{}/settings/customer_portal", local_var_configuration.base_path);
585 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
586
587 if let Some(ref local_var_str) = license_key {
588 local_var_req_builder = local_var_req_builder.query(&[("license_key", &local_var_str.to_string())]);
589 }
590 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
591 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
592 }
593 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
594 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
595 };
596
597 let local_var_req = local_var_req_builder.build()?;
598 let local_var_resp = local_var_client.execute(local_var_req).await?;
599
600 let local_var_status = local_var_resp.status();
601 let local_var_content = local_var_resp.text().await?;
602
603 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
604 crate::from_str_patched(&local_var_content).map_err(Error::from)
605 } else {
606 let local_var_entity: Option<CreateCustomerPortalSessionError> = crate::from_str_patched(&local_var_content).ok();
607 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
608 Err(Error::ResponseError(local_var_error))
609 }
610}
611
612pub async fn create_external_instance_pg_database(configuration: &configuration::Configuration, name: &str, create_external_instance_pg_database_request: models::CreateExternalInstancePgDatabaseRequest) -> Result<serde_json::Value, Error<CreateExternalInstancePgDatabaseError>> {
613 let local_var_configuration = configuration;
614
615 let local_var_client = &local_var_configuration.client;
616
617 let local_var_uri_str = format!("{}/settings/external_instance_pg/databases/{name}", local_var_configuration.base_path, name=crate::apis::urlencode(name));
618 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
619
620 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
621 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
622 }
623 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
624 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
625 };
626 local_var_req_builder = local_var_req_builder.json(&create_external_instance_pg_database_request);
627
628 let local_var_req = local_var_req_builder.build()?;
629 let local_var_resp = local_var_client.execute(local_var_req).await?;
630
631 let local_var_status = local_var_resp.status();
632 let local_var_content = local_var_resp.text().await?;
633
634 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
635 crate::from_str_patched(&local_var_content).map_err(Error::from)
636 } else {
637 let local_var_entity: Option<CreateExternalInstancePgDatabaseError> = crate::from_str_patched(&local_var_content).ok();
638 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
639 Err(Error::ResponseError(local_var_error))
640 }
641}
642
643pub async fn create_instance_datatable_role(configuration: &configuration::Configuration, create_instance_datatable_role_request: models::CreateInstanceDatatableRoleRequest) -> Result<models::InstanceDatatableRole, Error<CreateInstanceDatatableRoleError>> {
644 let local_var_configuration = configuration;
645
646 let local_var_client = &local_var_configuration.client;
647
648 let local_var_uri_str = format!("{}/settings/datatable_roles", local_var_configuration.base_path);
649 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
650
651 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
652 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
653 }
654 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
655 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
656 };
657 local_var_req_builder = local_var_req_builder.json(&create_instance_datatable_role_request);
658
659 let local_var_req = local_var_req_builder.build()?;
660 let local_var_resp = local_var_client.execute(local_var_req).await?;
661
662 let local_var_status = local_var_resp.status();
663 let local_var_content = local_var_resp.text().await?;
664
665 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
666 crate::from_str_patched(&local_var_content).map_err(Error::from)
667 } else {
668 let local_var_entity: Option<CreateInstanceDatatableRoleError> = crate::from_str_patched(&local_var_content).ok();
669 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
670 Err(Error::ResponseError(local_var_error))
671 }
672}
673
674pub async fn delete_instance_datatable_role(configuration: &configuration::Configuration, id: &str) -> Result<(), Error<DeleteInstanceDatatableRoleError>> {
675 let local_var_configuration = configuration;
676
677 let local_var_client = &local_var_configuration.client;
678
679 let local_var_uri_str = format!("{}/settings/datatable_roles/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(id));
680 let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
681
682 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
683 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
684 }
685 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
686 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
687 };
688
689 let local_var_req = local_var_req_builder.build()?;
690 let local_var_resp = local_var_client.execute(local_var_req).await?;
691
692 let local_var_status = local_var_resp.status();
693 let local_var_content = local_var_resp.text().await?;
694
695 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
696 Ok(())
697 } else {
698 let local_var_entity: Option<DeleteInstanceDatatableRoleError> = crate::from_str_patched(&local_var_content).ok();
699 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
700 Err(Error::ResponseError(local_var_error))
701 }
702}
703
704pub async fn drop_custom_instance_db(configuration: &configuration::Configuration, name: &str) -> Result<String, Error<DropCustomInstanceDbError>> {
705 let local_var_configuration = configuration;
706
707 let local_var_client = &local_var_configuration.client;
708
709 let local_var_uri_str = format!("{}/settings/drop_custom_instance_pg_database/{name}", local_var_configuration.base_path, name=crate::apis::urlencode(name));
710 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
711
712 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
713 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
714 }
715 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
716 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
717 };
718
719 let local_var_req = local_var_req_builder.build()?;
720 let local_var_resp = local_var_client.execute(local_var_req).await?;
721
722 let local_var_status = local_var_resp.status();
723 let local_var_content = local_var_resp.text().await?;
724
725 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
726 crate::from_str_patched(&local_var_content).map_err(Error::from)
727 } else {
728 let local_var_entity: Option<DropCustomInstanceDbError> = crate::from_str_patched(&local_var_content).ok();
729 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
730 Err(Error::ResponseError(local_var_error))
731 }
732}
733
734pub async fn drop_external_instance_pg_database(configuration: &configuration::Configuration, name: &str) -> Result<serde_json::Value, Error<DropExternalInstancePgDatabaseError>> {
735 let local_var_configuration = configuration;
736
737 let local_var_client = &local_var_configuration.client;
738
739 let local_var_uri_str = format!("{}/settings/external_instance_pg/databases/{name}", local_var_configuration.base_path, name=crate::apis::urlencode(name));
740 let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
741
742 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
743 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
744 }
745 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
746 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
747 };
748
749 let local_var_req = local_var_req_builder.build()?;
750 let local_var_resp = local_var_client.execute(local_var_req).await?;
751
752 let local_var_status = local_var_resp.status();
753 let local_var_content = local_var_resp.text().await?;
754
755 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
756 crate::from_str_patched(&local_var_content).map_err(Error::from)
757 } else {
758 let local_var_entity: Option<DropExternalInstancePgDatabaseError> = crate::from_str_patched(&local_var_content).ok();
759 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
760 Err(Error::ResponseError(local_var_error))
761 }
762}
763
764pub async fn get_audit_logs_s3_backfill_status(configuration: &configuration::Configuration, ) -> Result<models::GetAuditLogsS3BackfillStatus200Response, Error<GetAuditLogsS3BackfillStatusError>> {
765 let local_var_configuration = configuration;
766
767 let local_var_client = &local_var_configuration.client;
768
769 let local_var_uri_str = format!("{}/settings/audit_logs_s3_backfill_status", local_var_configuration.base_path);
770 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
771
772 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
773 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
774 }
775 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
776 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
777 };
778
779 let local_var_req = local_var_req_builder.build()?;
780 let local_var_resp = local_var_client.execute(local_var_req).await?;
781
782 let local_var_status = local_var_resp.status();
783 let local_var_content = local_var_resp.text().await?;
784
785 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
786 crate::from_str_patched(&local_var_content).map_err(Error::from)
787 } else {
788 let local_var_entity: Option<GetAuditLogsS3BackfillStatusError> = crate::from_str_patched(&local_var_content).ok();
789 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
790 Err(Error::ResponseError(local_var_error))
791 }
792}
793
794pub async fn get_audit_logs_s3_status(configuration: &configuration::Configuration, ) -> Result<models::GetAuditLogsS3Status200Response, Error<GetAuditLogsS3StatusError>> {
795 let local_var_configuration = configuration;
796
797 let local_var_client = &local_var_configuration.client;
798
799 let local_var_uri_str = format!("{}/settings/audit_logs_s3_status", local_var_configuration.base_path);
800 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
801
802 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
803 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
804 }
805 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
806 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
807 };
808
809 let local_var_req = local_var_req_builder.build()?;
810 let local_var_resp = local_var_client.execute(local_var_req).await?;
811
812 let local_var_status = local_var_resp.status();
813 let local_var_content = local_var_resp.text().await?;
814
815 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
816 crate::from_str_patched(&local_var_content).map_err(Error::from)
817 } else {
818 let local_var_entity: Option<GetAuditLogsS3StatusError> = crate::from_str_patched(&local_var_content).ok();
819 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
820 Err(Error::ResponseError(local_var_error))
821 }
822}
823
824pub async fn get_client_ip_diagnostics(configuration: &configuration::Configuration, ) -> Result<models::ClientIpDiagnostics, Error<GetClientIpDiagnosticsError>> {
826 let local_var_configuration = configuration;
827
828 let local_var_client = &local_var_configuration.client;
829
830 let local_var_uri_str = format!("{}/settings/client_ip_diagnostics", local_var_configuration.base_path);
831 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
832
833 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
834 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
835 }
836 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
837 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
838 };
839
840 let local_var_req = local_var_req_builder.build()?;
841 let local_var_resp = local_var_client.execute(local_var_req).await?;
842
843 let local_var_status = local_var_resp.status();
844 let local_var_content = local_var_resp.text().await?;
845
846 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
847 crate::from_str_patched(&local_var_content).map_err(Error::from)
848 } else {
849 let local_var_entity: Option<GetClientIpDiagnosticsError> = crate::from_str_patched(&local_var_content).ok();
850 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
851 Err(Error::ResponseError(local_var_error))
852 }
853}
854
855pub async fn get_client_ip_trust(configuration: &configuration::Configuration, ) -> Result<models::GetClientIpTrust200Response, Error<GetClientIpTrustError>> {
857 let local_var_configuration = configuration;
858
859 let local_var_client = &local_var_configuration.client;
860
861 let local_var_uri_str = format!("{}/settings/client_ip_trust", local_var_configuration.base_path);
862 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
863
864 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
865 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
866 }
867 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
868 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
869 };
870
871 let local_var_req = local_var_req_builder.build()?;
872 let local_var_resp = local_var_client.execute(local_var_req).await?;
873
874 let local_var_status = local_var_resp.status();
875 let local_var_content = local_var_resp.text().await?;
876
877 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
878 crate::from_str_patched(&local_var_content).map_err(Error::from)
879 } else {
880 let local_var_entity: Option<GetClientIpTrustError> = crate::from_str_patched(&local_var_content).ok();
881 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
882 Err(Error::ResponseError(local_var_error))
883 }
884}
885
886pub async fn get_critical_alerts(configuration: &configuration::Configuration, page: Option<i32>, page_size: Option<i32>, acknowledged: Option<bool>) -> Result<models::GetCriticalAlerts200Response, Error<GetCriticalAlertsError>> {
887 let local_var_configuration = configuration;
888
889 let local_var_client = &local_var_configuration.client;
890
891 let local_var_uri_str = format!("{}/settings/critical_alerts", local_var_configuration.base_path);
892 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
893
894 if let Some(ref local_var_str) = page {
895 local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
896 }
897 if let Some(ref local_var_str) = page_size {
898 local_var_req_builder = local_var_req_builder.query(&[("page_size", &local_var_str.to_string())]);
899 }
900 if let Some(ref local_var_str) = acknowledged {
901 local_var_req_builder = local_var_req_builder.query(&[("acknowledged", &local_var_str.to_string())]);
902 }
903 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
904 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
905 }
906 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
907 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
908 };
909
910 let local_var_req = local_var_req_builder.build()?;
911 let local_var_resp = local_var_client.execute(local_var_req).await?;
912
913 let local_var_status = local_var_resp.status();
914 let local_var_content = local_var_resp.text().await?;
915
916 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
917 crate::from_str_patched(&local_var_content).map_err(Error::from)
918 } else {
919 let local_var_entity: Option<GetCriticalAlertsError> = crate::from_str_patched(&local_var_content).ok();
920 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
921 Err(Error::ResponseError(local_var_error))
922 }
923}
924
925pub async fn get_external_instance_pg_status(configuration: &configuration::Configuration, ) -> Result<models::ExternalInstancePgStatus, Error<GetExternalInstancePgStatusError>> {
926 let local_var_configuration = configuration;
927
928 let local_var_client = &local_var_configuration.client;
929
930 let local_var_uri_str = format!("{}/settings/external_instance_pg/status", local_var_configuration.base_path);
931 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
932
933 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
934 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
935 }
936 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
937 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
938 };
939
940 let local_var_req = local_var_req_builder.build()?;
941 let local_var_resp = local_var_client.execute(local_var_req).await?;
942
943 let local_var_status = local_var_resp.status();
944 let local_var_content = local_var_resp.text().await?;
945
946 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
947 crate::from_str_patched(&local_var_content).map_err(Error::from)
948 } else {
949 let local_var_entity: Option<GetExternalInstancePgStatusError> = crate::from_str_patched(&local_var_content).ok();
950 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
951 Err(Error::ResponseError(local_var_error))
952 }
953}
954
955pub async fn get_global(configuration: &configuration::Configuration, key: &str, dangerously_reveal_secrets: Option<bool>) -> Result<serde_json::Value, Error<GetGlobalError>> {
956 let local_var_configuration = configuration;
957
958 let local_var_client = &local_var_configuration.client;
959
960 let local_var_uri_str = format!("{}/settings/global/{key}", local_var_configuration.base_path, key=crate::apis::urlencode(key));
961 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
962
963 if let Some(ref local_var_str) = dangerously_reveal_secrets {
964 local_var_req_builder = local_var_req_builder.query(&[("dangerously_reveal_secrets", &local_var_str.to_string())]);
965 }
966 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
967 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
968 }
969 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
970 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
971 };
972
973 let local_var_req = local_var_req_builder.build()?;
974 let local_var_resp = local_var_client.execute(local_var_req).await?;
975
976 let local_var_status = local_var_resp.status();
977 let local_var_content = local_var_resp.text().await?;
978
979 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
980 crate::from_str_patched(&local_var_content).map_err(Error::from)
981 } else {
982 let local_var_entity: Option<GetGlobalError> = crate::from_str_patched(&local_var_content).ok();
983 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
984 Err(Error::ResponseError(local_var_error))
985 }
986}
987
988pub async fn get_instance_config(configuration: &configuration::Configuration, dangerously_reveal_secrets: Option<bool>) -> Result<models::InstanceConfig, Error<GetInstanceConfigError>> {
989 let local_var_configuration = configuration;
990
991 let local_var_client = &local_var_configuration.client;
992
993 let local_var_uri_str = format!("{}/settings/instance_config", local_var_configuration.base_path);
994 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
995
996 if let Some(ref local_var_str) = dangerously_reveal_secrets {
997 local_var_req_builder = local_var_req_builder.query(&[("dangerously_reveal_secrets", &local_var_str.to_string())]);
998 }
999 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1000 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1001 }
1002 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1003 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1004 };
1005
1006 let local_var_req = local_var_req_builder.build()?;
1007 let local_var_resp = local_var_client.execute(local_var_req).await?;
1008
1009 let local_var_status = local_var_resp.status();
1010 let local_var_content = local_var_resp.text().await?;
1011
1012 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1013 crate::from_str_patched(&local_var_content).map_err(Error::from)
1014 } else {
1015 let local_var_entity: Option<GetInstanceConfigError> = crate::from_str_patched(&local_var_content).ok();
1016 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1017 Err(Error::ResponseError(local_var_error))
1018 }
1019}
1020
1021pub async fn get_instance_hash(configuration: &configuration::Configuration, ) -> Result<models::GetInstanceHash200Response, Error<GetInstanceHashError>> {
1023 let local_var_configuration = configuration;
1024
1025 let local_var_client = &local_var_configuration.client;
1026
1027 let local_var_uri_str = format!("{}/settings/instance_hash", local_var_configuration.base_path);
1028 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1029
1030 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1031 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1032 }
1033 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1034 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1035 };
1036
1037 let local_var_req = local_var_req_builder.build()?;
1038 let local_var_resp = local_var_client.execute(local_var_req).await?;
1039
1040 let local_var_status = local_var_resp.status();
1041 let local_var_content = local_var_resp.text().await?;
1042
1043 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1044 crate::from_str_patched(&local_var_content).map_err(Error::from)
1045 } else {
1046 let local_var_entity: Option<GetInstanceHashError> = crate::from_str_patched(&local_var_content).ok();
1047 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1048 Err(Error::ResponseError(local_var_error))
1049 }
1050}
1051
1052pub async fn get_instance_ui(configuration: &configuration::Configuration, ) -> Result<models::GetInstanceUi200Response, Error<GetInstanceUiError>> {
1054 let local_var_configuration = configuration;
1055
1056 let local_var_client = &local_var_configuration.client;
1057
1058 let local_var_uri_str = format!("{}/settings/instance_ui", local_var_configuration.base_path);
1059 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1060
1061 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1062 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1063 }
1064 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1065 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1066 };
1067
1068 let local_var_req = local_var_req_builder.build()?;
1069 let local_var_resp = local_var_client.execute(local_var_req).await?;
1070
1071 let local_var_status = local_var_resp.status();
1072 let local_var_content = local_var_resp.text().await?;
1073
1074 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1075 crate::from_str_patched(&local_var_content).map_err(Error::from)
1076 } else {
1077 let local_var_entity: Option<GetInstanceUiError> = crate::from_str_patched(&local_var_content).ok();
1078 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1079 Err(Error::ResponseError(local_var_error))
1080 }
1081}
1082
1083pub async fn get_jwks(configuration: &configuration::Configuration, ) -> Result<models::JwksResponse, Error<GetJwksError>> {
1084 let local_var_configuration = configuration;
1085
1086 let local_var_client = &local_var_configuration.client;
1087
1088 let local_var_uri_str = format!("{}/.well-known/jwks.json", local_var_configuration.base_path);
1089 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1090
1091 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1092 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1093 }
1094 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1095 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1096 };
1097
1098 let local_var_req = local_var_req_builder.build()?;
1099 let local_var_resp = local_var_client.execute(local_var_req).await?;
1100
1101 let local_var_status = local_var_resp.status();
1102 let local_var_content = local_var_resp.text().await?;
1103
1104 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1105 crate::from_str_patched(&local_var_content).map_err(Error::from)
1106 } else {
1107 let local_var_entity: Option<GetJwksError> = crate::from_str_patched(&local_var_content).ok();
1108 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1109 Err(Error::ResponseError(local_var_error))
1110 }
1111}
1112
1113pub async fn get_latest_key_renewal_attempt(configuration: &configuration::Configuration, ) -> Result<models::GetLatestKeyRenewalAttempt200Response, Error<GetLatestKeyRenewalAttemptError>> {
1114 let local_var_configuration = configuration;
1115
1116 let local_var_client = &local_var_configuration.client;
1117
1118 let local_var_uri_str = format!("{}/settings/latest_key_renewal_attempt", local_var_configuration.base_path);
1119 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1120
1121 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1122 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1123 }
1124 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1125 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1126 };
1127
1128 let local_var_req = local_var_req_builder.build()?;
1129 let local_var_resp = local_var_client.execute(local_var_req).await?;
1130
1131 let local_var_status = local_var_resp.status();
1132 let local_var_content = local_var_resp.text().await?;
1133
1134 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1135 crate::from_str_patched(&local_var_content).map_err(Error::from)
1136 } else {
1137 let local_var_entity: Option<GetLatestKeyRenewalAttemptError> = crate::from_str_patched(&local_var_content).ok();
1138 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1139 Err(Error::ResponseError(local_var_error))
1140 }
1141}
1142
1143pub async fn get_local(configuration: &configuration::Configuration, ) -> Result<serde_json::Value, Error<GetLocalError>> {
1144 let local_var_configuration = configuration;
1145
1146 let local_var_client = &local_var_configuration.client;
1147
1148 let local_var_uri_str = format!("{}/settings/local", local_var_configuration.base_path);
1149 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1150
1151 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1152 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1153 }
1154 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1155 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1156 };
1157
1158 let local_var_req = local_var_req_builder.build()?;
1159 let local_var_resp = local_var_client.execute(local_var_req).await?;
1160
1161 let local_var_status = local_var_resp.status();
1162 let local_var_content = local_var_resp.text().await?;
1163
1164 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1165 crate::from_str_patched(&local_var_content).map_err(Error::from)
1166 } else {
1167 let local_var_entity: Option<GetLocalError> = crate::from_str_patched(&local_var_content).ok();
1168 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1169 Err(Error::ResponseError(local_var_error))
1170 }
1171}
1172
1173pub async fn get_log_cleanup_status(configuration: &configuration::Configuration, ) -> Result<models::GetLogCleanupStatus200Response, Error<GetLogCleanupStatusError>> {
1174 let local_var_configuration = configuration;
1175
1176 let local_var_client = &local_var_configuration.client;
1177
1178 let local_var_uri_str = format!("{}/settings/log_cleanup_status", local_var_configuration.base_path);
1179 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1180
1181 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1182 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1183 }
1184 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1185 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1186 };
1187
1188 let local_var_req = local_var_req_builder.build()?;
1189 let local_var_resp = local_var_client.execute(local_var_req).await?;
1190
1191 let local_var_status = local_var_resp.status();
1192 let local_var_content = local_var_resp.text().await?;
1193
1194 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1195 crate::from_str_patched(&local_var_content).map_err(Error::from)
1196 } else {
1197 let local_var_entity: Option<GetLogCleanupStatusError> = crate::from_str_patched(&local_var_content).ok();
1198 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1199 Err(Error::ResponseError(local_var_error))
1200 }
1201}
1202
1203pub async fn get_min_keep_alive_version(configuration: &configuration::Configuration, ) -> Result<models::GetMinKeepAliveVersion200Response, Error<GetMinKeepAliveVersionError>> {
1204 let local_var_configuration = configuration;
1205
1206 let local_var_client = &local_var_configuration.client;
1207
1208 let local_var_uri_str = format!("{}/min_keep_alive_version", local_var_configuration.base_path);
1209 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1210
1211 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1212 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1213 }
1214 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1215 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1216 };
1217
1218 let local_var_req = local_var_req_builder.build()?;
1219 let local_var_resp = local_var_client.execute(local_var_req).await?;
1220
1221 let local_var_status = local_var_resp.status();
1222 let local_var_content = local_var_resp.text().await?;
1223
1224 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1225 crate::from_str_patched(&local_var_content).map_err(Error::from)
1226 } else {
1227 let local_var_entity: Option<GetMinKeepAliveVersionError> = crate::from_str_patched(&local_var_content).ok();
1228 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1229 Err(Error::ResponseError(local_var_error))
1230 }
1231}
1232
1233pub async fn get_object_storage_usage(configuration: &configuration::Configuration, ) -> Result<models::GetObjectStorageUsage200Response, Error<GetObjectStorageUsageError>> {
1234 let local_var_configuration = configuration;
1235
1236 let local_var_client = &local_var_configuration.client;
1237
1238 let local_var_uri_str = format!("{}/settings/object_storage_usage", local_var_configuration.base_path);
1239 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1240
1241 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1242 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1243 }
1244 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1245 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1246 };
1247
1248 let local_var_req = local_var_req_builder.build()?;
1249 let local_var_resp = local_var_client.execute(local_var_req).await?;
1250
1251 let local_var_status = local_var_resp.status();
1252 let local_var_content = local_var_resp.text().await?;
1253
1254 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1255 crate::from_str_patched(&local_var_content).map_err(Error::from)
1256 } else {
1257 let local_var_entity: Option<GetObjectStorageUsageError> = crate::from_str_patched(&local_var_content).ok();
1258 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1259 Err(Error::ResponseError(local_var_error))
1260 }
1261}
1262
1263pub async fn get_offline_license_status(configuration: &configuration::Configuration, ) -> Result<models::GetOfflineLicenseStatus200Response, Error<GetOfflineLicenseStatusError>> {
1265 let local_var_configuration = configuration;
1266
1267 let local_var_client = &local_var_configuration.client;
1268
1269 let local_var_uri_str = format!("{}/settings/offline_license_status", local_var_configuration.base_path);
1270 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1271
1272 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1273 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1274 }
1275 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1276 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1277 };
1278
1279 let local_var_req = local_var_req_builder.build()?;
1280 let local_var_resp = local_var_client.execute(local_var_req).await?;
1281
1282 let local_var_status = local_var_resp.status();
1283 let local_var_content = local_var_resp.text().await?;
1284
1285 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1286 crate::from_str_patched(&local_var_content).map_err(Error::from)
1287 } else {
1288 let local_var_entity: Option<GetOfflineLicenseStatusError> = crate::from_str_patched(&local_var_content).ok();
1289 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1290 Err(Error::ResponseError(local_var_error))
1291 }
1292}
1293
1294pub async fn get_ruff_config(configuration: &configuration::Configuration, ) -> Result<String, Error<GetRuffConfigError>> {
1296 let local_var_configuration = configuration;
1297
1298 let local_var_client = &local_var_configuration.client;
1299
1300 let local_var_uri_str = format!("{}/settings_u/ruff_config", local_var_configuration.base_path);
1301 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1302
1303 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1304 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1305 }
1306 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1307 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1308 };
1309
1310 let local_var_req = local_var_req_builder.build()?;
1311 let local_var_resp = local_var_client.execute(local_var_req).await?;
1312
1313 let local_var_status = local_var_resp.status();
1314 let local_var_content = local_var_resp.text().await?;
1315
1316 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1317 crate::from_str_patched(&local_var_content).map_err(Error::from)
1318 } else {
1319 let local_var_entity: Option<GetRuffConfigError> = crate::from_str_patched(&local_var_content).ok();
1320 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1321 Err(Error::ResponseError(local_var_error))
1322 }
1323}
1324
1325pub async fn get_secondary_storage_names(configuration: &configuration::Configuration, workspace: &str, include_default: Option<bool>) -> Result<Vec<String>, Error<GetSecondaryStorageNamesError>> {
1326 let local_var_configuration = configuration;
1327
1328 let local_var_client = &local_var_configuration.client;
1329
1330 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_secondary_storage_names", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1331 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1332
1333 if let Some(ref local_var_str) = include_default {
1334 local_var_req_builder = local_var_req_builder.query(&[("include_default", &local_var_str.to_string())]);
1335 }
1336 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1337 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1338 }
1339 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1340 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1341 };
1342
1343 let local_var_req = local_var_req_builder.build()?;
1344 let local_var_resp = local_var_client.execute(local_var_req).await?;
1345
1346 let local_var_status = local_var_resp.status();
1347 let local_var_content = local_var_resp.text().await?;
1348
1349 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1350 crate::from_str_patched(&local_var_content).map_err(Error::from)
1351 } else {
1352 let local_var_entity: Option<GetSecondaryStorageNamesError> = crate::from_str_patched(&local_var_content).ok();
1353 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1354 Err(Error::ResponseError(local_var_error))
1355 }
1356}
1357
1358pub async fn get_smtp_configured(configuration: &configuration::Configuration, ) -> Result<bool, Error<GetSmtpConfiguredError>> {
1360 let local_var_configuration = configuration;
1361
1362 let local_var_client = &local_var_configuration.client;
1363
1364 let local_var_uri_str = format!("{}/settings/smtp_configured", local_var_configuration.base_path);
1365 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1366
1367 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1368 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1369 }
1370 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1371 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1372 };
1373
1374 let local_var_req = local_var_req_builder.build()?;
1375 let local_var_resp = local_var_client.execute(local_var_req).await?;
1376
1377 let local_var_status = local_var_resp.status();
1378 let local_var_content = local_var_resp.text().await?;
1379
1380 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1381 crate::from_str_patched(&local_var_content).map_err(Error::from)
1382 } else {
1383 let local_var_entity: Option<GetSmtpConfiguredError> = crate::from_str_patched(&local_var_content).ok();
1384 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1385 Err(Error::ResponseError(local_var_error))
1386 }
1387}
1388
1389pub async fn get_stats(configuration: &configuration::Configuration, ) -> Result<models::GetStats200Response, Error<GetStatsError>> {
1390 let local_var_configuration = configuration;
1391
1392 let local_var_client = &local_var_configuration.client;
1393
1394 let local_var_uri_str = format!("{}/settings/get_stats", local_var_configuration.base_path);
1395 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1396
1397 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1398 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1399 }
1400 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1401 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1402 };
1403
1404 let local_var_req = local_var_req_builder.build()?;
1405 let local_var_resp = local_var_client.execute(local_var_req).await?;
1406
1407 let local_var_status = local_var_resp.status();
1408 let local_var_content = local_var_resp.text().await?;
1409
1410 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1411 crate::from_str_patched(&local_var_content).map_err(Error::from)
1412 } else {
1413 let local_var_entity: Option<GetStatsError> = crate::from_str_patched(&local_var_content).ok();
1414 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1415 Err(Error::ResponseError(local_var_error))
1416 }
1417}
1418
1419pub async fn github_app_stale_webhooks(configuration: &configuration::Configuration, ) -> Result<Vec<models::GithubAppStaleWebhooks200ResponseInner>, Error<GithubAppStaleWebhooksError>> {
1420 let local_var_configuration = configuration;
1421
1422 let local_var_client = &local_var_configuration.client;
1423
1424 let local_var_uri_str = format!("{}/settings/github_app_stale_webhooks", local_var_configuration.base_path);
1425 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1426
1427 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1428 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1429 }
1430 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1431 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1432 };
1433
1434 let local_var_req = local_var_req_builder.build()?;
1435 let local_var_resp = local_var_client.execute(local_var_req).await?;
1436
1437 let local_var_status = local_var_resp.status();
1438 let local_var_content = local_var_resp.text().await?;
1439
1440 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1441 crate::from_str_patched(&local_var_content).map_err(Error::from)
1442 } else {
1443 let local_var_entity: Option<GithubAppStaleWebhooksError> = crate::from_str_patched(&local_var_content).ok();
1444 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1445 Err(Error::ResponseError(local_var_error))
1446 }
1447}
1448
1449pub async fn list_custom_instance_dbs(configuration: &configuration::Configuration, ) -> Result<std::collections::HashMap<String, models::CustomInstanceDb>, Error<ListCustomInstanceDbsError>> {
1450 let local_var_configuration = configuration;
1451
1452 let local_var_client = &local_var_configuration.client;
1453
1454 let local_var_uri_str = format!("{}/settings/list_custom_instance_pg_databases", local_var_configuration.base_path);
1455 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1456
1457 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1458 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1459 }
1460 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1461 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1462 };
1463
1464 let local_var_req = local_var_req_builder.build()?;
1465 let local_var_resp = local_var_client.execute(local_var_req).await?;
1466
1467 let local_var_status = local_var_resp.status();
1468 let local_var_content = local_var_resp.text().await?;
1469
1470 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1471 crate::from_str_patched(&local_var_content).map_err(Error::from)
1472 } else {
1473 let local_var_entity: Option<ListCustomInstanceDbsError> = crate::from_str_patched(&local_var_content).ok();
1474 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1475 Err(Error::ResponseError(local_var_error))
1476 }
1477}
1478
1479pub async fn list_external_instance_pg_databases(configuration: &configuration::Configuration, ) -> Result<std::collections::HashMap<String, models::CustomInstanceDb>, Error<ListExternalInstancePgDatabasesError>> {
1480 let local_var_configuration = configuration;
1481
1482 let local_var_client = &local_var_configuration.client;
1483
1484 let local_var_uri_str = format!("{}/settings/external_instance_pg/databases", local_var_configuration.base_path);
1485 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1486
1487 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1488 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1489 }
1490 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1491 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1492 };
1493
1494 let local_var_req = local_var_req_builder.build()?;
1495 let local_var_resp = local_var_client.execute(local_var_req).await?;
1496
1497 let local_var_status = local_var_resp.status();
1498 let local_var_content = local_var_resp.text().await?;
1499
1500 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1501 crate::from_str_patched(&local_var_content).map_err(Error::from)
1502 } else {
1503 let local_var_entity: Option<ListExternalInstancePgDatabasesError> = crate::from_str_patched(&local_var_content).ok();
1504 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1505 Err(Error::ResponseError(local_var_error))
1506 }
1507}
1508
1509pub async fn list_global_settings(configuration: &configuration::Configuration, dangerously_reveal_secrets: Option<bool>) -> Result<Vec<models::GlobalSetting>, Error<ListGlobalSettingsError>> {
1510 let local_var_configuration = configuration;
1511
1512 let local_var_client = &local_var_configuration.client;
1513
1514 let local_var_uri_str = format!("{}/settings/list_global", local_var_configuration.base_path);
1515 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1516
1517 if let Some(ref local_var_str) = dangerously_reveal_secrets {
1518 local_var_req_builder = local_var_req_builder.query(&[("dangerously_reveal_secrets", &local_var_str.to_string())]);
1519 }
1520 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1521 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1522 }
1523 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1524 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1525 };
1526
1527 let local_var_req = local_var_req_builder.build()?;
1528 let local_var_resp = local_var_client.execute(local_var_req).await?;
1529
1530 let local_var_status = local_var_resp.status();
1531 let local_var_content = local_var_resp.text().await?;
1532
1533 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1534 crate::from_str_patched(&local_var_content).map_err(Error::from)
1535 } else {
1536 let local_var_entity: Option<ListGlobalSettingsError> = crate::from_str_patched(&local_var_content).ok();
1537 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1538 Err(Error::ResponseError(local_var_error))
1539 }
1540}
1541
1542pub async fn list_instance_datatable_roles(configuration: &configuration::Configuration, cluster: Option<models::DatatableRoleCluster>) -> Result<Vec<models::InstanceDatatableRole>, Error<ListInstanceDatatableRolesError>> {
1543 let local_var_configuration = configuration;
1544
1545 let local_var_client = &local_var_configuration.client;
1546
1547 let local_var_uri_str = format!("{}/settings/datatable_roles", local_var_configuration.base_path);
1548 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1549
1550 if let Some(ref local_var_str) = cluster {
1551 local_var_req_builder = local_var_req_builder.query(&[("cluster", &local_var_str.to_string())]);
1552 }
1553 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1554 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1555 }
1556 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1557 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1558 };
1559
1560 let local_var_req = local_var_req_builder.build()?;
1561 let local_var_resp = local_var_client.execute(local_var_req).await?;
1562
1563 let local_var_status = local_var_resp.status();
1564 let local_var_content = local_var_resp.text().await?;
1565
1566 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1567 crate::from_str_patched(&local_var_content).map_err(Error::from)
1568 } else {
1569 let local_var_entity: Option<ListInstanceDatatableRolesError> = crate::from_str_patched(&local_var_content).ok();
1570 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1571 Err(Error::ResponseError(local_var_error))
1572 }
1573}
1574
1575pub async fn migrate_secrets_from_aws_sm(configuration: &configuration::Configuration, aws_secrets_manager_settings: models::AwsSecretsManagerSettings) -> Result<models::SecretMigrationReport, Error<MigrateSecretsFromAwsSmError>> {
1576 let local_var_configuration = configuration;
1577
1578 let local_var_client = &local_var_configuration.client;
1579
1580 let local_var_uri_str = format!("{}/settings/migrate_secrets_from_aws_sm", local_var_configuration.base_path);
1581 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1582
1583 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1584 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1585 }
1586 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1587 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1588 };
1589 local_var_req_builder = local_var_req_builder.json(&aws_secrets_manager_settings);
1590
1591 let local_var_req = local_var_req_builder.build()?;
1592 let local_var_resp = local_var_client.execute(local_var_req).await?;
1593
1594 let local_var_status = local_var_resp.status();
1595 let local_var_content = local_var_resp.text().await?;
1596
1597 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1598 crate::from_str_patched(&local_var_content).map_err(Error::from)
1599 } else {
1600 let local_var_entity: Option<MigrateSecretsFromAwsSmError> = crate::from_str_patched(&local_var_content).ok();
1601 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1602 Err(Error::ResponseError(local_var_error))
1603 }
1604}
1605
1606pub async fn migrate_secrets_from_azure_kv(configuration: &configuration::Configuration, azure_key_vault_settings: models::AzureKeyVaultSettings) -> Result<models::SecretMigrationReport, Error<MigrateSecretsFromAzureKvError>> {
1607 let local_var_configuration = configuration;
1608
1609 let local_var_client = &local_var_configuration.client;
1610
1611 let local_var_uri_str = format!("{}/settings/migrate_secrets_from_azure_kv", local_var_configuration.base_path);
1612 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1613
1614 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1615 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1616 }
1617 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1618 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1619 };
1620 local_var_req_builder = local_var_req_builder.json(&azure_key_vault_settings);
1621
1622 let local_var_req = local_var_req_builder.build()?;
1623 let local_var_resp = local_var_client.execute(local_var_req).await?;
1624
1625 let local_var_status = local_var_resp.status();
1626 let local_var_content = local_var_resp.text().await?;
1627
1628 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1629 crate::from_str_patched(&local_var_content).map_err(Error::from)
1630 } else {
1631 let local_var_entity: Option<MigrateSecretsFromAzureKvError> = crate::from_str_patched(&local_var_content).ok();
1632 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1633 Err(Error::ResponseError(local_var_error))
1634 }
1635}
1636
1637pub async fn migrate_secrets_from_http_store(configuration: &configuration::Configuration, http_store_settings: models::HttpStoreSettings) -> Result<models::SecretMigrationReport, Error<MigrateSecretsFromHttpStoreError>> {
1638 let local_var_configuration = configuration;
1639
1640 let local_var_client = &local_var_configuration.client;
1641
1642 let local_var_uri_str = format!("{}/settings/migrate_secrets_from_http_store", local_var_configuration.base_path);
1643 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1644
1645 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1646 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1647 }
1648 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1649 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1650 };
1651 local_var_req_builder = local_var_req_builder.json(&http_store_settings);
1652
1653 let local_var_req = local_var_req_builder.build()?;
1654 let local_var_resp = local_var_client.execute(local_var_req).await?;
1655
1656 let local_var_status = local_var_resp.status();
1657 let local_var_content = local_var_resp.text().await?;
1658
1659 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1660 crate::from_str_patched(&local_var_content).map_err(Error::from)
1661 } else {
1662 let local_var_entity: Option<MigrateSecretsFromHttpStoreError> = crate::from_str_patched(&local_var_content).ok();
1663 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1664 Err(Error::ResponseError(local_var_error))
1665 }
1666}
1667
1668pub async fn migrate_secrets_to_aws_sm(configuration: &configuration::Configuration, aws_secrets_manager_settings: models::AwsSecretsManagerSettings) -> Result<models::SecretMigrationReport, Error<MigrateSecretsToAwsSmError>> {
1669 let local_var_configuration = configuration;
1670
1671 let local_var_client = &local_var_configuration.client;
1672
1673 let local_var_uri_str = format!("{}/settings/migrate_secrets_to_aws_sm", local_var_configuration.base_path);
1674 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1675
1676 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1677 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1678 }
1679 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1680 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1681 };
1682 local_var_req_builder = local_var_req_builder.json(&aws_secrets_manager_settings);
1683
1684 let local_var_req = local_var_req_builder.build()?;
1685 let local_var_resp = local_var_client.execute(local_var_req).await?;
1686
1687 let local_var_status = local_var_resp.status();
1688 let local_var_content = local_var_resp.text().await?;
1689
1690 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1691 crate::from_str_patched(&local_var_content).map_err(Error::from)
1692 } else {
1693 let local_var_entity: Option<MigrateSecretsToAwsSmError> = crate::from_str_patched(&local_var_content).ok();
1694 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1695 Err(Error::ResponseError(local_var_error))
1696 }
1697}
1698
1699pub async fn migrate_secrets_to_azure_kv(configuration: &configuration::Configuration, azure_key_vault_settings: models::AzureKeyVaultSettings) -> Result<models::SecretMigrationReport, Error<MigrateSecretsToAzureKvError>> {
1700 let local_var_configuration = configuration;
1701
1702 let local_var_client = &local_var_configuration.client;
1703
1704 let local_var_uri_str = format!("{}/settings/migrate_secrets_to_azure_kv", local_var_configuration.base_path);
1705 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1706
1707 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1708 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1709 }
1710 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1711 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1712 };
1713 local_var_req_builder = local_var_req_builder.json(&azure_key_vault_settings);
1714
1715 let local_var_req = local_var_req_builder.build()?;
1716 let local_var_resp = local_var_client.execute(local_var_req).await?;
1717
1718 let local_var_status = local_var_resp.status();
1719 let local_var_content = local_var_resp.text().await?;
1720
1721 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1722 crate::from_str_patched(&local_var_content).map_err(Error::from)
1723 } else {
1724 let local_var_entity: Option<MigrateSecretsToAzureKvError> = crate::from_str_patched(&local_var_content).ok();
1725 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1726 Err(Error::ResponseError(local_var_error))
1727 }
1728}
1729
1730pub async fn migrate_secrets_to_database(configuration: &configuration::Configuration, vault_settings: models::VaultSettings) -> Result<models::SecretMigrationReport, Error<MigrateSecretsToDatabaseError>> {
1731 let local_var_configuration = configuration;
1732
1733 let local_var_client = &local_var_configuration.client;
1734
1735 let local_var_uri_str = format!("{}/settings/migrate_secrets_to_database", local_var_configuration.base_path);
1736 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1737
1738 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1739 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1740 }
1741 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1742 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1743 };
1744 local_var_req_builder = local_var_req_builder.json(&vault_settings);
1745
1746 let local_var_req = local_var_req_builder.build()?;
1747 let local_var_resp = local_var_client.execute(local_var_req).await?;
1748
1749 let local_var_status = local_var_resp.status();
1750 let local_var_content = local_var_resp.text().await?;
1751
1752 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1753 crate::from_str_patched(&local_var_content).map_err(Error::from)
1754 } else {
1755 let local_var_entity: Option<MigrateSecretsToDatabaseError> = crate::from_str_patched(&local_var_content).ok();
1756 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1757 Err(Error::ResponseError(local_var_error))
1758 }
1759}
1760
1761pub async fn migrate_secrets_to_vault(configuration: &configuration::Configuration, vault_settings: models::VaultSettings) -> Result<models::SecretMigrationReport, Error<MigrateSecretsToVaultError>> {
1762 let local_var_configuration = configuration;
1763
1764 let local_var_client = &local_var_configuration.client;
1765
1766 let local_var_uri_str = format!("{}/settings/migrate_secrets_to_vault", local_var_configuration.base_path);
1767 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1768
1769 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1770 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1771 }
1772 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1773 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1774 };
1775 local_var_req_builder = local_var_req_builder.json(&vault_settings);
1776
1777 let local_var_req = local_var_req_builder.build()?;
1778 let local_var_resp = local_var_client.execute(local_var_req).await?;
1779
1780 let local_var_status = local_var_resp.status();
1781 let local_var_content = local_var_resp.text().await?;
1782
1783 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1784 crate::from_str_patched(&local_var_content).map_err(Error::from)
1785 } else {
1786 let local_var_entity: Option<MigrateSecretsToVaultError> = crate::from_str_patched(&local_var_content).ok();
1787 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1788 Err(Error::ResponseError(local_var_error))
1789 }
1790}
1791
1792pub async fn refresh_custom_instance_user_pwd(configuration: &configuration::Configuration, ) -> Result<serde_json::Value, Error<RefreshCustomInstanceUserPwdError>> {
1793 let local_var_configuration = configuration;
1794
1795 let local_var_client = &local_var_configuration.client;
1796
1797 let local_var_uri_str = format!("{}/settings/refresh_custom_instance_user_pwd", local_var_configuration.base_path);
1798 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1799
1800 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1801 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1802 }
1803 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1804 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1805 };
1806
1807 let local_var_req = local_var_req_builder.build()?;
1808 let local_var_resp = local_var_client.execute(local_var_req).await?;
1809
1810 let local_var_status = local_var_resp.status();
1811 let local_var_content = local_var_resp.text().await?;
1812
1813 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1814 crate::from_str_patched(&local_var_content).map_err(Error::from)
1815 } else {
1816 let local_var_entity: Option<RefreshCustomInstanceUserPwdError> = crate::from_str_patched(&local_var_content).ok();
1817 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1818 Err(Error::ResponseError(local_var_error))
1819 }
1820}
1821
1822pub async fn renew_license_key(configuration: &configuration::Configuration, license_key: Option<&str>) -> Result<String, Error<RenewLicenseKeyError>> {
1823 let local_var_configuration = configuration;
1824
1825 let local_var_client = &local_var_configuration.client;
1826
1827 let local_var_uri_str = format!("{}/settings/renew_license_key", local_var_configuration.base_path);
1828 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1829
1830 if let Some(ref local_var_str) = license_key {
1831 local_var_req_builder = local_var_req_builder.query(&[("license_key", &local_var_str.to_string())]);
1832 }
1833 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1834 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1835 }
1836 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1837 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1838 };
1839
1840 let local_var_req = local_var_req_builder.build()?;
1841 let local_var_resp = local_var_client.execute(local_var_req).await?;
1842
1843 let local_var_status = local_var_resp.status();
1844 let local_var_content = local_var_resp.text().await?;
1845
1846 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1847 crate::from_str_patched(&local_var_content).map_err(Error::from)
1848 } else {
1849 let local_var_entity: Option<RenewLicenseKeyError> = crate::from_str_patched(&local_var_content).ok();
1850 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1851 Err(Error::ResponseError(local_var_error))
1852 }
1853}
1854
1855pub async fn restart_worker_group(configuration: &configuration::Configuration, worker_group: &str) -> Result<String, Error<RestartWorkerGroupError>> {
1857 let local_var_configuration = configuration;
1858
1859 let local_var_client = &local_var_configuration.client;
1860
1861 let local_var_uri_str = format!("{}/settings/restart_worker_group/{worker_group}", local_var_configuration.base_path, worker_group=crate::apis::urlencode(worker_group));
1862 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1863
1864 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1865 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1866 }
1867 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1868 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1869 };
1870
1871 let local_var_req = local_var_req_builder.build()?;
1872 let local_var_resp = local_var_client.execute(local_var_req).await?;
1873
1874 let local_var_status = local_var_resp.status();
1875 let local_var_content = local_var_resp.text().await?;
1876
1877 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1878 crate::from_str_patched(&local_var_content).map_err(Error::from)
1879 } else {
1880 let local_var_entity: Option<RestartWorkerGroupError> = crate::from_str_patched(&local_var_content).ok();
1881 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1882 Err(Error::ResponseError(local_var_error))
1883 }
1884}
1885
1886pub async fn run_audit_logs_s3_backfill(configuration: &configuration::Configuration, run_audit_logs_s3_backfill_request: models::RunAuditLogsS3BackfillRequest) -> Result<(), Error<RunAuditLogsS3BackfillError>> {
1887 let local_var_configuration = configuration;
1888
1889 let local_var_client = &local_var_configuration.client;
1890
1891 let local_var_uri_str = format!("{}/settings/audit_logs_s3_backfill", local_var_configuration.base_path);
1892 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1893
1894 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1895 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1896 }
1897 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1898 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1899 };
1900 local_var_req_builder = local_var_req_builder.json(&run_audit_logs_s3_backfill_request);
1901
1902 let local_var_req = local_var_req_builder.build()?;
1903 let local_var_resp = local_var_client.execute(local_var_req).await?;
1904
1905 let local_var_status = local_var_resp.status();
1906 let local_var_content = local_var_resp.text().await?;
1907
1908 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1909 Ok(())
1910 } else {
1911 let local_var_entity: Option<RunAuditLogsS3BackfillError> = crate::from_str_patched(&local_var_content).ok();
1912 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1913 Err(Error::ResponseError(local_var_error))
1914 }
1915}
1916
1917pub async fn run_log_cleanup(configuration: &configuration::Configuration, ) -> Result<String, Error<RunLogCleanupError>> {
1918 let local_var_configuration = configuration;
1919
1920 let local_var_client = &local_var_configuration.client;
1921
1922 let local_var_uri_str = format!("{}/settings/run_log_cleanup", local_var_configuration.base_path);
1923 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1924
1925 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1926 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1927 }
1928 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1929 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1930 };
1931
1932 let local_var_req = local_var_req_builder.build()?;
1933 let local_var_resp = local_var_client.execute(local_var_req).await?;
1934
1935 let local_var_status = local_var_resp.status();
1936 let local_var_content = local_var_resp.text().await?;
1937
1938 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1939 crate::from_str_patched(&local_var_content).map_err(Error::from)
1940 } else {
1941 let local_var_entity: Option<RunLogCleanupError> = crate::from_str_patched(&local_var_content).ok();
1942 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1943 Err(Error::ResponseError(local_var_error))
1944 }
1945}
1946
1947pub async fn send_stats(configuration: &configuration::Configuration, ) -> Result<String, Error<SendStatsError>> {
1948 let local_var_configuration = configuration;
1949
1950 let local_var_client = &local_var_configuration.client;
1951
1952 let local_var_uri_str = format!("{}/settings/send_stats", local_var_configuration.base_path);
1953 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1954
1955 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1956 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1957 }
1958 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1959 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1960 };
1961
1962 let local_var_req = local_var_req_builder.build()?;
1963 let local_var_resp = local_var_client.execute(local_var_req).await?;
1964
1965 let local_var_status = local_var_resp.status();
1966 let local_var_content = local_var_resp.text().await?;
1967
1968 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1969 crate::from_str_patched(&local_var_content).map_err(Error::from)
1970 } else {
1971 let local_var_entity: Option<SendStatsError> = crate::from_str_patched(&local_var_content).ok();
1972 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1973 Err(Error::ResponseError(local_var_error))
1974 }
1975}
1976
1977pub async fn set_global(configuration: &configuration::Configuration, key: &str, set_global_request: models::SetGlobalRequest) -> Result<String, Error<SetGlobalError>> {
1978 let local_var_configuration = configuration;
1979
1980 let local_var_client = &local_var_configuration.client;
1981
1982 let local_var_uri_str = format!("{}/settings/global/{key}", local_var_configuration.base_path, key=crate::apis::urlencode(key));
1983 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1984
1985 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1986 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1987 }
1988 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1989 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1990 };
1991 local_var_req_builder = local_var_req_builder.json(&set_global_request);
1992
1993 let local_var_req = local_var_req_builder.build()?;
1994 let local_var_resp = local_var_client.execute(local_var_req).await?;
1995
1996 let local_var_status = local_var_resp.status();
1997 let local_var_content = local_var_resp.text().await?;
1998
1999 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2000 crate::from_str_patched(&local_var_content).map_err(Error::from)
2001 } else {
2002 let local_var_entity: Option<SetGlobalError> = crate::from_str_patched(&local_var_content).ok();
2003 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2004 Err(Error::ResponseError(local_var_error))
2005 }
2006}
2007
2008pub async fn set_instance_config(configuration: &configuration::Configuration, instance_config: models::InstanceConfig) -> Result<String, Error<SetInstanceConfigError>> {
2009 let local_var_configuration = configuration;
2010
2011 let local_var_client = &local_var_configuration.client;
2012
2013 let local_var_uri_str = format!("{}/settings/instance_config", local_var_configuration.base_path);
2014 let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
2015
2016 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2017 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2018 }
2019 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2020 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2021 };
2022 local_var_req_builder = local_var_req_builder.json(&instance_config);
2023
2024 let local_var_req = local_var_req_builder.build()?;
2025 let local_var_resp = local_var_client.execute(local_var_req).await?;
2026
2027 let local_var_status = local_var_resp.status();
2028 let local_var_content = local_var_resp.text().await?;
2029
2030 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2031 crate::from_str_patched(&local_var_content).map_err(Error::from)
2032 } else {
2033 let local_var_entity: Option<SetInstanceConfigError> = crate::from_str_patched(&local_var_content).ok();
2034 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2035 Err(Error::ResponseError(local_var_error))
2036 }
2037}
2038
2039pub async fn set_public_app_rate_limit(configuration: &configuration::Configuration, workspace: &str, set_public_app_rate_limit_request: models::SetPublicAppRateLimitRequest) -> Result<String, Error<SetPublicAppRateLimitError>> {
2040 let local_var_configuration = configuration;
2041
2042 let local_var_client = &local_var_configuration.client;
2043
2044 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/public_app_rate_limit", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2045 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2046
2047 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2048 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2049 }
2050 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2051 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2052 };
2053 local_var_req_builder = local_var_req_builder.json(&set_public_app_rate_limit_request);
2054
2055 let local_var_req = local_var_req_builder.build()?;
2056 let local_var_resp = local_var_client.execute(local_var_req).await?;
2057
2058 let local_var_status = local_var_resp.status();
2059 let local_var_content = local_var_resp.text().await?;
2060
2061 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2062 crate::from_str_patched(&local_var_content).map_err(Error::from)
2063 } else {
2064 let local_var_entity: Option<SetPublicAppRateLimitError> = crate::from_str_patched(&local_var_content).ok();
2065 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2066 Err(Error::ResponseError(local_var_error))
2067 }
2068}
2069
2070pub async fn setup_custom_instance_db(configuration: &configuration::Configuration, name: &str, create_external_instance_pg_database_request: models::CreateExternalInstancePgDatabaseRequest) -> Result<models::CustomInstanceDb, Error<SetupCustomInstanceDbError>> {
2071 let local_var_configuration = configuration;
2072
2073 let local_var_client = &local_var_configuration.client;
2074
2075 let local_var_uri_str = format!("{}/settings/setup_custom_instance_pg_database/{name}", local_var_configuration.base_path, name=crate::apis::urlencode(name));
2076 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2077
2078 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2079 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2080 }
2081 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2082 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2083 };
2084 local_var_req_builder = local_var_req_builder.json(&create_external_instance_pg_database_request);
2085
2086 let local_var_req = local_var_req_builder.build()?;
2087 let local_var_resp = local_var_client.execute(local_var_req).await?;
2088
2089 let local_var_status = local_var_resp.status();
2090 let local_var_content = local_var_resp.text().await?;
2091
2092 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2093 crate::from_str_patched(&local_var_content).map_err(Error::from)
2094 } else {
2095 let local_var_entity: Option<SetupCustomInstanceDbError> = crate::from_str_patched(&local_var_content).ok();
2096 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2097 Err(Error::ResponseError(local_var_error))
2098 }
2099}
2100
2101pub async fn setup_external_instance_pg(configuration: &configuration::Configuration, setup_external_instance_pg_request: models::SetupExternalInstancePgRequest) -> Result<models::ExternalInstancePgSetupReport, Error<SetupExternalInstancePgError>> {
2102 let local_var_configuration = configuration;
2103
2104 let local_var_client = &local_var_configuration.client;
2105
2106 let local_var_uri_str = format!("{}/settings/external_instance_pg/setup", local_var_configuration.base_path);
2107 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2108
2109 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2110 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2111 }
2112 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2113 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2114 };
2115 local_var_req_builder = local_var_req_builder.json(&setup_external_instance_pg_request);
2116
2117 let local_var_req = local_var_req_builder.build()?;
2118 let local_var_resp = local_var_client.execute(local_var_req).await?;
2119
2120 let local_var_status = local_var_resp.status();
2121 let local_var_content = local_var_resp.text().await?;
2122
2123 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2124 crate::from_str_patched(&local_var_content).map_err(Error::from)
2125 } else {
2126 let local_var_entity: Option<SetupExternalInstancePgError> = crate::from_str_patched(&local_var_content).ok();
2127 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2128 Err(Error::ResponseError(local_var_error))
2129 }
2130}
2131
2132pub async fn test_aws_sm_backend(configuration: &configuration::Configuration, aws_secrets_manager_settings: models::AwsSecretsManagerSettings) -> Result<String, Error<TestAwsSmBackendError>> {
2133 let local_var_configuration = configuration;
2134
2135 let local_var_client = &local_var_configuration.client;
2136
2137 let local_var_uri_str = format!("{}/settings/test_aws_sm_backend", local_var_configuration.base_path);
2138 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2139
2140 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2141 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2142 }
2143 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2144 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2145 };
2146 local_var_req_builder = local_var_req_builder.json(&aws_secrets_manager_settings);
2147
2148 let local_var_req = local_var_req_builder.build()?;
2149 let local_var_resp = local_var_client.execute(local_var_req).await?;
2150
2151 let local_var_status = local_var_resp.status();
2152 let local_var_content = local_var_resp.text().await?;
2153
2154 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2155 crate::from_str_patched(&local_var_content).map_err(Error::from)
2156 } else {
2157 let local_var_entity: Option<TestAwsSmBackendError> = crate::from_str_patched(&local_var_content).ok();
2158 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2159 Err(Error::ResponseError(local_var_error))
2160 }
2161}
2162
2163pub async fn test_azure_kv_backend(configuration: &configuration::Configuration, azure_key_vault_settings: models::AzureKeyVaultSettings) -> Result<String, Error<TestAzureKvBackendError>> {
2164 let local_var_configuration = configuration;
2165
2166 let local_var_client = &local_var_configuration.client;
2167
2168 let local_var_uri_str = format!("{}/settings/test_azure_kv_backend", local_var_configuration.base_path);
2169 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2170
2171 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2172 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2173 }
2174 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2175 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2176 };
2177 local_var_req_builder = local_var_req_builder.json(&azure_key_vault_settings);
2178
2179 let local_var_req = local_var_req_builder.build()?;
2180 let local_var_resp = local_var_client.execute(local_var_req).await?;
2181
2182 let local_var_status = local_var_resp.status();
2183 let local_var_content = local_var_resp.text().await?;
2184
2185 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2186 crate::from_str_patched(&local_var_content).map_err(Error::from)
2187 } else {
2188 let local_var_entity: Option<TestAzureKvBackendError> = crate::from_str_patched(&local_var_content).ok();
2189 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2190 Err(Error::ResponseError(local_var_error))
2191 }
2192}
2193
2194pub async fn test_critical_channels(configuration: &configuration::Configuration, test_critical_channels_request_inner: Vec<models::TestCriticalChannelsRequestInner>) -> Result<String, Error<TestCriticalChannelsError>> {
2195 let local_var_configuration = configuration;
2196
2197 let local_var_client = &local_var_configuration.client;
2198
2199 let local_var_uri_str = format!("{}/settings/test_critical_channels", local_var_configuration.base_path);
2200 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2201
2202 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2203 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2204 }
2205 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2206 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2207 };
2208 local_var_req_builder = local_var_req_builder.json(&test_critical_channels_request_inner);
2209
2210 let local_var_req = local_var_req_builder.build()?;
2211 let local_var_resp = local_var_client.execute(local_var_req).await?;
2212
2213 let local_var_status = local_var_resp.status();
2214 let local_var_content = local_var_resp.text().await?;
2215
2216 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2217 crate::from_str_patched(&local_var_content).map_err(Error::from)
2218 } else {
2219 let local_var_entity: Option<TestCriticalChannelsError> = crate::from_str_patched(&local_var_content).ok();
2220 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2221 Err(Error::ResponseError(local_var_error))
2222 }
2223}
2224
2225pub async fn test_http_store_backend(configuration: &configuration::Configuration, test_http_store_backend_request: models::TestHttpStoreBackendRequest) -> Result<String, Error<TestHttpStoreBackendError>> {
2226 let local_var_configuration = configuration;
2227
2228 let local_var_client = &local_var_configuration.client;
2229
2230 let local_var_uri_str = format!("{}/settings/test_http_store_backend", local_var_configuration.base_path);
2231 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2232
2233 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2234 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2235 }
2236 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2237 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2238 };
2239 local_var_req_builder = local_var_req_builder.json(&test_http_store_backend_request);
2240
2241 let local_var_req = local_var_req_builder.build()?;
2242 let local_var_resp = local_var_client.execute(local_var_req).await?;
2243
2244 let local_var_status = local_var_resp.status();
2245 let local_var_content = local_var_resp.text().await?;
2246
2247 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2248 crate::from_str_patched(&local_var_content).map_err(Error::from)
2249 } else {
2250 let local_var_entity: Option<TestHttpStoreBackendError> = crate::from_str_patched(&local_var_content).ok();
2251 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2252 Err(Error::ResponseError(local_var_error))
2253 }
2254}
2255
2256pub async fn test_license_key(configuration: &configuration::Configuration, test_license_key_request: models::TestLicenseKeyRequest) -> Result<String, Error<TestLicenseKeyError>> {
2257 let local_var_configuration = configuration;
2258
2259 let local_var_client = &local_var_configuration.client;
2260
2261 let local_var_uri_str = format!("{}/settings/test_license_key", local_var_configuration.base_path);
2262 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2263
2264 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2265 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2266 }
2267 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2268 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2269 };
2270 local_var_req_builder = local_var_req_builder.json(&test_license_key_request);
2271
2272 let local_var_req = local_var_req_builder.build()?;
2273 let local_var_resp = local_var_client.execute(local_var_req).await?;
2274
2275 let local_var_status = local_var_resp.status();
2276 let local_var_content = local_var_resp.text().await?;
2277
2278 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2279 crate::from_str_patched(&local_var_content).map_err(Error::from)
2280 } else {
2281 let local_var_entity: Option<TestLicenseKeyError> = crate::from_str_patched(&local_var_content).ok();
2282 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2283 Err(Error::ResponseError(local_var_error))
2284 }
2285}
2286
2287pub async fn test_metadata(configuration: &configuration::Configuration, body: &str) -> Result<String, Error<TestMetadataError>> {
2288 let local_var_configuration = configuration;
2289
2290 let local_var_client = &local_var_configuration.client;
2291
2292 let local_var_uri_str = format!("{}/saml/test_metadata", local_var_configuration.base_path);
2293 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2294
2295 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2296 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2297 }
2298 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2299 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2300 };
2301 local_var_req_builder = local_var_req_builder.json(&body);
2302
2303 let local_var_req = local_var_req_builder.build()?;
2304 let local_var_resp = local_var_client.execute(local_var_req).await?;
2305
2306 let local_var_status = local_var_resp.status();
2307 let local_var_content = local_var_resp.text().await?;
2308
2309 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2310 crate::from_str_patched(&local_var_content).map_err(Error::from)
2311 } else {
2312 let local_var_entity: Option<TestMetadataError> = crate::from_str_patched(&local_var_content).ok();
2313 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2314 Err(Error::ResponseError(local_var_error))
2315 }
2316}
2317
2318pub async fn test_object_storage_config(configuration: &configuration::Configuration, request_body: std::collections::HashMap<String, serde_json::Value>) -> Result<String, Error<TestObjectStorageConfigError>> {
2319 let local_var_configuration = configuration;
2320
2321 let local_var_client = &local_var_configuration.client;
2322
2323 let local_var_uri_str = format!("{}/settings/test_object_storage_config", local_var_configuration.base_path);
2324 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2325
2326 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2327 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2328 }
2329 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2330 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2331 };
2332 local_var_req_builder = local_var_req_builder.json(&request_body);
2333
2334 let local_var_req = local_var_req_builder.build()?;
2335 let local_var_resp = local_var_client.execute(local_var_req).await?;
2336
2337 let local_var_status = local_var_resp.status();
2338 let local_var_content = local_var_resp.text().await?;
2339
2340 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2341 crate::from_str_patched(&local_var_content).map_err(Error::from)
2342 } else {
2343 let local_var_entity: Option<TestObjectStorageConfigError> = crate::from_str_patched(&local_var_content).ok();
2344 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2345 Err(Error::ResponseError(local_var_error))
2346 }
2347}
2348
2349pub async fn test_secret_backend(configuration: &configuration::Configuration, vault_settings: models::VaultSettings) -> Result<String, Error<TestSecretBackendError>> {
2350 let local_var_configuration = configuration;
2351
2352 let local_var_client = &local_var_configuration.client;
2353
2354 let local_var_uri_str = format!("{}/settings/test_secret_backend", local_var_configuration.base_path);
2355 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2356
2357 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2358 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2359 }
2360 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2361 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2362 };
2363 local_var_req_builder = local_var_req_builder.json(&vault_settings);
2364
2365 let local_var_req = local_var_req_builder.build()?;
2366 let local_var_resp = local_var_client.execute(local_var_req).await?;
2367
2368 let local_var_status = local_var_resp.status();
2369 let local_var_content = local_var_resp.text().await?;
2370
2371 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2372 crate::from_str_patched(&local_var_content).map_err(Error::from)
2373 } else {
2374 let local_var_entity: Option<TestSecretBackendError> = crate::from_str_patched(&local_var_content).ok();
2375 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2376 Err(Error::ResponseError(local_var_error))
2377 }
2378}
2379
2380pub async fn test_smtp(configuration: &configuration::Configuration, test_smtp_request: models::TestSmtpRequest) -> Result<String, Error<TestSmtpError>> {
2381 let local_var_configuration = configuration;
2382
2383 let local_var_client = &local_var_configuration.client;
2384
2385 let local_var_uri_str = format!("{}/settings/test_smtp", local_var_configuration.base_path);
2386 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2387
2388 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2389 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2390 }
2391 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2392 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2393 };
2394 local_var_req_builder = local_var_req_builder.json(&test_smtp_request);
2395
2396 let local_var_req = local_var_req_builder.build()?;
2397 let local_var_resp = local_var_client.execute(local_var_req).await?;
2398
2399 let local_var_status = local_var_resp.status();
2400 let local_var_content = local_var_resp.text().await?;
2401
2402 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2403 crate::from_str_patched(&local_var_content).map_err(Error::from)
2404 } else {
2405 let local_var_entity: Option<TestSmtpError> = crate::from_str_patched(&local_var_content).ok();
2406 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2407 Err(Error::ResponseError(local_var_error))
2408 }
2409}
2410
2411pub async fn update_instance_datatable_role(configuration: &configuration::Configuration, id: &str, update_instance_datatable_role_request: models::UpdateInstanceDatatableRoleRequest) -> Result<models::InstanceDatatableRole, Error<UpdateInstanceDatatableRoleError>> {
2412 let local_var_configuration = configuration;
2413
2414 let local_var_client = &local_var_configuration.client;
2415
2416 let local_var_uri_str = format!("{}/settings/datatable_roles/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(id));
2417 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2418
2419 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2420 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2421 }
2422 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2423 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2424 };
2425 local_var_req_builder = local_var_req_builder.json(&update_instance_datatable_role_request);
2426
2427 let local_var_req = local_var_req_builder.build()?;
2428 let local_var_resp = local_var_client.execute(local_var_req).await?;
2429
2430 let local_var_status = local_var_resp.status();
2431 let local_var_content = local_var_resp.text().await?;
2432
2433 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2434 crate::from_str_patched(&local_var_content).map_err(Error::from)
2435 } else {
2436 let local_var_entity: Option<UpdateInstanceDatatableRoleError> = crate::from_str_patched(&local_var_content).ok();
2437 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2438 Err(Error::ResponseError(local_var_error))
2439 }
2440}
2441
2442pub async fn workspace_acknowledge_all_critical_alerts(configuration: &configuration::Configuration, workspace: &str) -> Result<String, Error<WorkspaceAcknowledgeAllCriticalAlertsError>> {
2443 let local_var_configuration = configuration;
2444
2445 let local_var_client = &local_var_configuration.client;
2446
2447 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/critical_alerts/acknowledge_all", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2448 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2449
2450 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2451 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2452 }
2453 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2454 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2455 };
2456
2457 let local_var_req = local_var_req_builder.build()?;
2458 let local_var_resp = local_var_client.execute(local_var_req).await?;
2459
2460 let local_var_status = local_var_resp.status();
2461 let local_var_content = local_var_resp.text().await?;
2462
2463 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2464 crate::from_str_patched(&local_var_content).map_err(Error::from)
2465 } else {
2466 let local_var_entity: Option<WorkspaceAcknowledgeAllCriticalAlertsError> = crate::from_str_patched(&local_var_content).ok();
2467 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2468 Err(Error::ResponseError(local_var_error))
2469 }
2470}
2471
2472pub async fn workspace_acknowledge_critical_alert(configuration: &configuration::Configuration, workspace: &str, id: i32) -> Result<String, Error<WorkspaceAcknowledgeCriticalAlertError>> {
2473 let local_var_configuration = configuration;
2474
2475 let local_var_client = &local_var_configuration.client;
2476
2477 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);
2478 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2479
2480 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2481 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2482 }
2483 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2484 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2485 };
2486
2487 let local_var_req = local_var_req_builder.build()?;
2488 let local_var_resp = local_var_client.execute(local_var_req).await?;
2489
2490 let local_var_status = local_var_resp.status();
2491 let local_var_content = local_var_resp.text().await?;
2492
2493 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2494 crate::from_str_patched(&local_var_content).map_err(Error::from)
2495 } else {
2496 let local_var_entity: Option<WorkspaceAcknowledgeCriticalAlertError> = crate::from_str_patched(&local_var_content).ok();
2497 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2498 Err(Error::ResponseError(local_var_error))
2499 }
2500}
2501
2502pub 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>> {
2503 let local_var_configuration = configuration;
2504
2505 let local_var_client = &local_var_configuration.client;
2506
2507 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/critical_alerts", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2508 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2509
2510 if let Some(ref local_var_str) = page {
2511 local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
2512 }
2513 if let Some(ref local_var_str) = page_size {
2514 local_var_req_builder = local_var_req_builder.query(&[("page_size", &local_var_str.to_string())]);
2515 }
2516 if let Some(ref local_var_str) = acknowledged {
2517 local_var_req_builder = local_var_req_builder.query(&[("acknowledged", &local_var_str.to_string())]);
2518 }
2519 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2520 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2521 }
2522 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2523 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2524 };
2525
2526 let local_var_req = local_var_req_builder.build()?;
2527 let local_var_resp = local_var_client.execute(local_var_req).await?;
2528
2529 let local_var_status = local_var_resp.status();
2530 let local_var_content = local_var_resp.text().await?;
2531
2532 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2533 crate::from_str_patched(&local_var_content).map_err(Error::from)
2534 } else {
2535 let local_var_entity: Option<WorkspaceGetCriticalAlertsError> = crate::from_str_patched(&local_var_content).ok();
2536 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2537 Err(Error::ResponseError(local_var_error))
2538 }
2539}
2540
2541pub async fn workspace_mute_critical_alerts_ui(configuration: &configuration::Configuration, workspace: &str, workspace_mute_critical_alerts_ui_request: models::WorkspaceMuteCriticalAlertsUiRequest) -> Result<String, Error<WorkspaceMuteCriticalAlertsUiError>> {
2542 let local_var_configuration = configuration;
2543
2544 let local_var_client = &local_var_configuration.client;
2545
2546 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/critical_alerts/mute", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2547 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2548
2549 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2550 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2551 }
2552 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2553 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2554 };
2555 local_var_req_builder = local_var_req_builder.json(&workspace_mute_critical_alerts_ui_request);
2556
2557 let local_var_req = local_var_req_builder.build()?;
2558 let local_var_resp = local_var_client.execute(local_var_req).await?;
2559
2560 let local_var_status = local_var_resp.status();
2561 let local_var_content = local_var_resp.text().await?;
2562
2563 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2564 crate::from_str_patched(&local_var_content).map_err(Error::from)
2565 } else {
2566 let local_var_entity: Option<WorkspaceMuteCriticalAlertsUiError> = crate::from_str_patched(&local_var_content).ok();
2567 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2568 Err(Error::ResponseError(local_var_error))
2569 }
2570}
2571