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