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