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