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