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