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