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