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 GetMinKeepAliveVersionError {
85 UnknownValue(serde_json::Value),
86}
87
88#[derive(Debug, Clone, Serialize, Deserialize)]
90#[serde(untagged)]
91pub enum GetSecondaryStorageNamesError {
92 UnknownValue(serde_json::Value),
93}
94
95#[derive(Debug, Clone, Serialize, Deserialize)]
97#[serde(untagged)]
98pub enum GetStatsError {
99 UnknownValue(serde_json::Value),
100}
101
102#[derive(Debug, Clone, Serialize, Deserialize)]
104#[serde(untagged)]
105pub enum ListCustomInstanceDbsError {
106 UnknownValue(serde_json::Value),
107}
108
109#[derive(Debug, Clone, Serialize, Deserialize)]
111#[serde(untagged)]
112pub enum ListGlobalSettingsError {
113 UnknownValue(serde_json::Value),
114}
115
116#[derive(Debug, Clone, Serialize, Deserialize)]
118#[serde(untagged)]
119pub enum MigrateSecretsToDatabaseError {
120 UnknownValue(serde_json::Value),
121}
122
123#[derive(Debug, Clone, Serialize, Deserialize)]
125#[serde(untagged)]
126pub enum MigrateSecretsToVaultError {
127 UnknownValue(serde_json::Value),
128}
129
130#[derive(Debug, Clone, Serialize, Deserialize)]
132#[serde(untagged)]
133pub enum RefreshCustomInstanceUserPwdError {
134 UnknownValue(serde_json::Value),
135}
136
137#[derive(Debug, Clone, Serialize, Deserialize)]
139#[serde(untagged)]
140pub enum RenewLicenseKeyError {
141 UnknownValue(serde_json::Value),
142}
143
144#[derive(Debug, Clone, Serialize, Deserialize)]
146#[serde(untagged)]
147pub enum SendStatsError {
148 UnknownValue(serde_json::Value),
149}
150
151#[derive(Debug, Clone, Serialize, Deserialize)]
153#[serde(untagged)]
154pub enum SetGlobalError {
155 UnknownValue(serde_json::Value),
156}
157
158#[derive(Debug, Clone, Serialize, Deserialize)]
160#[serde(untagged)]
161pub enum SetInstanceConfigError {
162 UnknownValue(serde_json::Value),
163}
164
165#[derive(Debug, Clone, Serialize, Deserialize)]
167#[serde(untagged)]
168pub enum SetPublicAppRateLimitError {
169 UnknownValue(serde_json::Value),
170}
171
172#[derive(Debug, Clone, Serialize, Deserialize)]
174#[serde(untagged)]
175pub enum SetupCustomInstanceDbError {
176 UnknownValue(serde_json::Value),
177}
178
179#[derive(Debug, Clone, Serialize, Deserialize)]
181#[serde(untagged)]
182pub enum TestCriticalChannelsError {
183 UnknownValue(serde_json::Value),
184}
185
186#[derive(Debug, Clone, Serialize, Deserialize)]
188#[serde(untagged)]
189pub enum TestLicenseKeyError {
190 UnknownValue(serde_json::Value),
191}
192
193#[derive(Debug, Clone, Serialize, Deserialize)]
195#[serde(untagged)]
196pub enum TestMetadataError {
197 UnknownValue(serde_json::Value),
198}
199
200#[derive(Debug, Clone, Serialize, Deserialize)]
202#[serde(untagged)]
203pub enum TestObjectStorageConfigError {
204 UnknownValue(serde_json::Value),
205}
206
207#[derive(Debug, Clone, Serialize, Deserialize)]
209#[serde(untagged)]
210pub enum TestSecretBackendError {
211 UnknownValue(serde_json::Value),
212}
213
214#[derive(Debug, Clone, Serialize, Deserialize)]
216#[serde(untagged)]
217pub enum TestSmtpError {
218 UnknownValue(serde_json::Value),
219}
220
221#[derive(Debug, Clone, Serialize, Deserialize)]
223#[serde(untagged)]
224pub enum WorkspaceAcknowledgeAllCriticalAlertsError {
225 UnknownValue(serde_json::Value),
226}
227
228#[derive(Debug, Clone, Serialize, Deserialize)]
230#[serde(untagged)]
231pub enum WorkspaceAcknowledgeCriticalAlertError {
232 UnknownValue(serde_json::Value),
233}
234
235#[derive(Debug, Clone, Serialize, Deserialize)]
237#[serde(untagged)]
238pub enum WorkspaceGetCriticalAlertsError {
239 UnknownValue(serde_json::Value),
240}
241
242#[derive(Debug, Clone, Serialize, Deserialize)]
244#[serde(untagged)]
245pub enum WorkspaceMuteCriticalAlertsUiError {
246 UnknownValue(serde_json::Value),
247}
248
249
250pub async fn acknowledge_all_critical_alerts(configuration: &configuration::Configuration, ) -> Result<String, Error<AcknowledgeAllCriticalAlertsError>> {
251 let local_var_configuration = configuration;
252
253 let local_var_client = &local_var_configuration.client;
254
255 let local_var_uri_str = format!("{}/settings/critical_alerts/acknowledge_all", local_var_configuration.base_path);
256 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
257
258 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
259 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
260 }
261 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
262 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
263 };
264
265 let local_var_req = local_var_req_builder.build()?;
266 let local_var_resp = local_var_client.execute(local_var_req).await?;
267
268 let local_var_status = local_var_resp.status();
269 let local_var_content = local_var_resp.text().await?;
270
271 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
272 crate::from_str_patched(&local_var_content).map_err(Error::from)
273 } else {
274 let local_var_entity: Option<AcknowledgeAllCriticalAlertsError> = crate::from_str_patched(&local_var_content).ok();
275 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
276 Err(Error::ResponseError(local_var_error))
277 }
278}
279
280pub async fn acknowledge_critical_alert(configuration: &configuration::Configuration, id: i32) -> Result<String, Error<AcknowledgeCriticalAlertError>> {
281 let local_var_configuration = configuration;
282
283 let local_var_client = &local_var_configuration.client;
284
285 let local_var_uri_str = format!("{}/settings/critical_alerts/{id}/acknowledge", local_var_configuration.base_path, id=id);
286 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
287
288 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
289 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
290 }
291 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
292 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
293 };
294
295 let local_var_req = local_var_req_builder.build()?;
296 let local_var_resp = local_var_client.execute(local_var_req).await?;
297
298 let local_var_status = local_var_resp.status();
299 let local_var_content = local_var_resp.text().await?;
300
301 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
302 crate::from_str_patched(&local_var_content).map_err(Error::from)
303 } else {
304 let local_var_entity: Option<AcknowledgeCriticalAlertError> = crate::from_str_patched(&local_var_content).ok();
305 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
306 Err(Error::ResponseError(local_var_error))
307 }
308}
309
310pub async fn create_customer_portal_session(configuration: &configuration::Configuration, license_key: Option<&str>) -> Result<String, Error<CreateCustomerPortalSessionError>> {
311 let local_var_configuration = configuration;
312
313 let local_var_client = &local_var_configuration.client;
314
315 let local_var_uri_str = format!("{}/settings/customer_portal", local_var_configuration.base_path);
316 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
317
318 if let Some(ref local_var_str) = license_key {
319 local_var_req_builder = local_var_req_builder.query(&[("license_key", &local_var_str.to_string())]);
320 }
321 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
322 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
323 }
324 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
325 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
326 };
327
328 let local_var_req = local_var_req_builder.build()?;
329 let local_var_resp = local_var_client.execute(local_var_req).await?;
330
331 let local_var_status = local_var_resp.status();
332 let local_var_content = local_var_resp.text().await?;
333
334 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
335 crate::from_str_patched(&local_var_content).map_err(Error::from)
336 } else {
337 let local_var_entity: Option<CreateCustomerPortalSessionError> = crate::from_str_patched(&local_var_content).ok();
338 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
339 Err(Error::ResponseError(local_var_error))
340 }
341}
342
343pub async fn get_critical_alerts(configuration: &configuration::Configuration, page: Option<i32>, page_size: Option<i32>, acknowledged: Option<bool>) -> Result<models::GetCriticalAlerts200Response, Error<GetCriticalAlertsError>> {
344 let local_var_configuration = configuration;
345
346 let local_var_client = &local_var_configuration.client;
347
348 let local_var_uri_str = format!("{}/settings/critical_alerts", local_var_configuration.base_path);
349 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
350
351 if let Some(ref local_var_str) = page {
352 local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
353 }
354 if let Some(ref local_var_str) = page_size {
355 local_var_req_builder = local_var_req_builder.query(&[("page_size", &local_var_str.to_string())]);
356 }
357 if let Some(ref local_var_str) = acknowledged {
358 local_var_req_builder = local_var_req_builder.query(&[("acknowledged", &local_var_str.to_string())]);
359 }
360 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
361 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
362 }
363 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
364 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
365 };
366
367 let local_var_req = local_var_req_builder.build()?;
368 let local_var_resp = local_var_client.execute(local_var_req).await?;
369
370 let local_var_status = local_var_resp.status();
371 let local_var_content = local_var_resp.text().await?;
372
373 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
374 crate::from_str_patched(&local_var_content).map_err(Error::from)
375 } else {
376 let local_var_entity: Option<GetCriticalAlertsError> = crate::from_str_patched(&local_var_content).ok();
377 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
378 Err(Error::ResponseError(local_var_error))
379 }
380}
381
382pub async fn get_global(configuration: &configuration::Configuration, key: &str) -> Result<serde_json::Value, Error<GetGlobalError>> {
383 let local_var_configuration = configuration;
384
385 let local_var_client = &local_var_configuration.client;
386
387 let local_var_uri_str = format!("{}/settings/global/{key}", local_var_configuration.base_path, key=crate::apis::urlencode(key));
388 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
389
390 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
391 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
392 }
393 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
394 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
395 };
396
397 let local_var_req = local_var_req_builder.build()?;
398 let local_var_resp = local_var_client.execute(local_var_req).await?;
399
400 let local_var_status = local_var_resp.status();
401 let local_var_content = local_var_resp.text().await?;
402
403 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
404 crate::from_str_patched(&local_var_content).map_err(Error::from)
405 } else {
406 let local_var_entity: Option<GetGlobalError> = crate::from_str_patched(&local_var_content).ok();
407 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
408 Err(Error::ResponseError(local_var_error))
409 }
410}
411
412pub async fn get_instance_config(configuration: &configuration::Configuration, ) -> Result<models::InstanceConfig, Error<GetInstanceConfigError>> {
413 let local_var_configuration = configuration;
414
415 let local_var_client = &local_var_configuration.client;
416
417 let local_var_uri_str = format!("{}/settings/instance_config", local_var_configuration.base_path);
418 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
419
420 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
421 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
422 }
423 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
424 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
425 };
426
427 let local_var_req = local_var_req_builder.build()?;
428 let local_var_resp = local_var_client.execute(local_var_req).await?;
429
430 let local_var_status = local_var_resp.status();
431 let local_var_content = local_var_resp.text().await?;
432
433 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
434 crate::from_str_patched(&local_var_content).map_err(Error::from)
435 } else {
436 let local_var_entity: Option<GetInstanceConfigError> = crate::from_str_patched(&local_var_content).ok();
437 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
438 Err(Error::ResponseError(local_var_error))
439 }
440}
441
442pub async fn get_jwks(configuration: &configuration::Configuration, ) -> Result<models::JwksResponse, Error<GetJwksError>> {
443 let local_var_configuration = configuration;
444
445 let local_var_client = &local_var_configuration.client;
446
447 let local_var_uri_str = format!("{}/.well-known/jwks.json", local_var_configuration.base_path);
448 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
449
450 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
451 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
452 }
453 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
454 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
455 };
456
457 let local_var_req = local_var_req_builder.build()?;
458 let local_var_resp = local_var_client.execute(local_var_req).await?;
459
460 let local_var_status = local_var_resp.status();
461 let local_var_content = local_var_resp.text().await?;
462
463 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
464 crate::from_str_patched(&local_var_content).map_err(Error::from)
465 } else {
466 let local_var_entity: Option<GetJwksError> = crate::from_str_patched(&local_var_content).ok();
467 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
468 Err(Error::ResponseError(local_var_error))
469 }
470}
471
472pub async fn get_latest_key_renewal_attempt(configuration: &configuration::Configuration, ) -> Result<models::GetLatestKeyRenewalAttempt200Response, Error<GetLatestKeyRenewalAttemptError>> {
473 let local_var_configuration = configuration;
474
475 let local_var_client = &local_var_configuration.client;
476
477 let local_var_uri_str = format!("{}/settings/latest_key_renewal_attempt", local_var_configuration.base_path);
478 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
479
480 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
481 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
482 }
483 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
484 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
485 };
486
487 let local_var_req = local_var_req_builder.build()?;
488 let local_var_resp = local_var_client.execute(local_var_req).await?;
489
490 let local_var_status = local_var_resp.status();
491 let local_var_content = local_var_resp.text().await?;
492
493 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
494 crate::from_str_patched(&local_var_content).map_err(Error::from)
495 } else {
496 let local_var_entity: Option<GetLatestKeyRenewalAttemptError> = crate::from_str_patched(&local_var_content).ok();
497 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
498 Err(Error::ResponseError(local_var_error))
499 }
500}
501
502pub async fn get_local(configuration: &configuration::Configuration, ) -> Result<serde_json::Value, Error<GetLocalError>> {
503 let local_var_configuration = configuration;
504
505 let local_var_client = &local_var_configuration.client;
506
507 let local_var_uri_str = format!("{}/settings/local", local_var_configuration.base_path);
508 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
509
510 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
511 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
512 }
513 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
514 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
515 };
516
517 let local_var_req = local_var_req_builder.build()?;
518 let local_var_resp = local_var_client.execute(local_var_req).await?;
519
520 let local_var_status = local_var_resp.status();
521 let local_var_content = local_var_resp.text().await?;
522
523 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
524 crate::from_str_patched(&local_var_content).map_err(Error::from)
525 } else {
526 let local_var_entity: Option<GetLocalError> = crate::from_str_patched(&local_var_content).ok();
527 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
528 Err(Error::ResponseError(local_var_error))
529 }
530}
531
532pub async fn get_min_keep_alive_version(configuration: &configuration::Configuration, ) -> Result<models::GetMinKeepAliveVersion200Response, Error<GetMinKeepAliveVersionError>> {
533 let local_var_configuration = configuration;
534
535 let local_var_client = &local_var_configuration.client;
536
537 let local_var_uri_str = format!("{}/min_keep_alive_version", local_var_configuration.base_path);
538 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
539
540 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
541 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
542 }
543 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
544 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
545 };
546
547 let local_var_req = local_var_req_builder.build()?;
548 let local_var_resp = local_var_client.execute(local_var_req).await?;
549
550 let local_var_status = local_var_resp.status();
551 let local_var_content = local_var_resp.text().await?;
552
553 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
554 crate::from_str_patched(&local_var_content).map_err(Error::from)
555 } else {
556 let local_var_entity: Option<GetMinKeepAliveVersionError> = crate::from_str_patched(&local_var_content).ok();
557 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
558 Err(Error::ResponseError(local_var_error))
559 }
560}
561
562pub async fn get_secondary_storage_names(configuration: &configuration::Configuration, workspace: &str, include_default: Option<bool>) -> Result<Vec<String>, Error<GetSecondaryStorageNamesError>> {
563 let local_var_configuration = configuration;
564
565 let local_var_client = &local_var_configuration.client;
566
567 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_secondary_storage_names", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
568 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
569
570 if let Some(ref local_var_str) = include_default {
571 local_var_req_builder = local_var_req_builder.query(&[("include_default", &local_var_str.to_string())]);
572 }
573 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
574 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
575 }
576 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
577 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
578 };
579
580 let local_var_req = local_var_req_builder.build()?;
581 let local_var_resp = local_var_client.execute(local_var_req).await?;
582
583 let local_var_status = local_var_resp.status();
584 let local_var_content = local_var_resp.text().await?;
585
586 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
587 crate::from_str_patched(&local_var_content).map_err(Error::from)
588 } else {
589 let local_var_entity: Option<GetSecondaryStorageNamesError> = crate::from_str_patched(&local_var_content).ok();
590 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
591 Err(Error::ResponseError(local_var_error))
592 }
593}
594
595pub async fn get_stats(configuration: &configuration::Configuration, ) -> Result<String, Error<GetStatsError>> {
596 let local_var_configuration = configuration;
597
598 let local_var_client = &local_var_configuration.client;
599
600 let local_var_uri_str = format!("{}/settings/get_stats", local_var_configuration.base_path);
601 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
602
603 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
604 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
605 }
606 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
607 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
608 };
609
610 let local_var_req = local_var_req_builder.build()?;
611 let local_var_resp = local_var_client.execute(local_var_req).await?;
612
613 let local_var_status = local_var_resp.status();
614 let local_var_content = local_var_resp.text().await?;
615
616 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
617 crate::from_str_patched(&local_var_content).map_err(Error::from)
618 } else {
619 let local_var_entity: Option<GetStatsError> = crate::from_str_patched(&local_var_content).ok();
620 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
621 Err(Error::ResponseError(local_var_error))
622 }
623}
624
625pub async fn list_custom_instance_dbs(configuration: &configuration::Configuration, ) -> Result<std::collections::HashMap<String, models::CustomInstanceDb>, Error<ListCustomInstanceDbsError>> {
626 let local_var_configuration = configuration;
627
628 let local_var_client = &local_var_configuration.client;
629
630 let local_var_uri_str = format!("{}/settings/list_custom_instance_pg_databases", local_var_configuration.base_path);
631 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
632
633 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
634 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
635 }
636 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
637 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
638 };
639
640 let local_var_req = local_var_req_builder.build()?;
641 let local_var_resp = local_var_client.execute(local_var_req).await?;
642
643 let local_var_status = local_var_resp.status();
644 let local_var_content = local_var_resp.text().await?;
645
646 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
647 crate::from_str_patched(&local_var_content).map_err(Error::from)
648 } else {
649 let local_var_entity: Option<ListCustomInstanceDbsError> = crate::from_str_patched(&local_var_content).ok();
650 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
651 Err(Error::ResponseError(local_var_error))
652 }
653}
654
655pub async fn list_global_settings(configuration: &configuration::Configuration, ) -> Result<Vec<models::GlobalSetting>, Error<ListGlobalSettingsError>> {
656 let local_var_configuration = configuration;
657
658 let local_var_client = &local_var_configuration.client;
659
660 let local_var_uri_str = format!("{}/settings/list_global", local_var_configuration.base_path);
661 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
662
663 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
664 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
665 }
666 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
667 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
668 };
669
670 let local_var_req = local_var_req_builder.build()?;
671 let local_var_resp = local_var_client.execute(local_var_req).await?;
672
673 let local_var_status = local_var_resp.status();
674 let local_var_content = local_var_resp.text().await?;
675
676 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
677 crate::from_str_patched(&local_var_content).map_err(Error::from)
678 } else {
679 let local_var_entity: Option<ListGlobalSettingsError> = crate::from_str_patched(&local_var_content).ok();
680 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
681 Err(Error::ResponseError(local_var_error))
682 }
683}
684
685pub async fn migrate_secrets_to_database(configuration: &configuration::Configuration, vault_settings: models::VaultSettings) -> Result<models::SecretMigrationReport, Error<MigrateSecretsToDatabaseError>> {
686 let local_var_configuration = configuration;
687
688 let local_var_client = &local_var_configuration.client;
689
690 let local_var_uri_str = format!("{}/settings/migrate_secrets_to_database", local_var_configuration.base_path);
691 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
692
693 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
694 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
695 }
696 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
697 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
698 };
699 local_var_req_builder = local_var_req_builder.json(&vault_settings);
700
701 let local_var_req = local_var_req_builder.build()?;
702 let local_var_resp = local_var_client.execute(local_var_req).await?;
703
704 let local_var_status = local_var_resp.status();
705 let local_var_content = local_var_resp.text().await?;
706
707 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
708 crate::from_str_patched(&local_var_content).map_err(Error::from)
709 } else {
710 let local_var_entity: Option<MigrateSecretsToDatabaseError> = crate::from_str_patched(&local_var_content).ok();
711 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
712 Err(Error::ResponseError(local_var_error))
713 }
714}
715
716pub async fn migrate_secrets_to_vault(configuration: &configuration::Configuration, vault_settings: models::VaultSettings) -> Result<models::SecretMigrationReport, Error<MigrateSecretsToVaultError>> {
717 let local_var_configuration = configuration;
718
719 let local_var_client = &local_var_configuration.client;
720
721 let local_var_uri_str = format!("{}/settings/migrate_secrets_to_vault", local_var_configuration.base_path);
722 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
723
724 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
725 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
726 }
727 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
728 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
729 };
730 local_var_req_builder = local_var_req_builder.json(&vault_settings);
731
732 let local_var_req = local_var_req_builder.build()?;
733 let local_var_resp = local_var_client.execute(local_var_req).await?;
734
735 let local_var_status = local_var_resp.status();
736 let local_var_content = local_var_resp.text().await?;
737
738 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
739 crate::from_str_patched(&local_var_content).map_err(Error::from)
740 } else {
741 let local_var_entity: Option<MigrateSecretsToVaultError> = crate::from_str_patched(&local_var_content).ok();
742 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
743 Err(Error::ResponseError(local_var_error))
744 }
745}
746
747pub async fn refresh_custom_instance_user_pwd(configuration: &configuration::Configuration, ) -> Result<serde_json::Value, Error<RefreshCustomInstanceUserPwdError>> {
748 let local_var_configuration = configuration;
749
750 let local_var_client = &local_var_configuration.client;
751
752 let local_var_uri_str = format!("{}/settings/refresh_custom_instance_user_pwd", local_var_configuration.base_path);
753 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
754
755 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
756 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
757 }
758 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
759 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
760 };
761
762 let local_var_req = local_var_req_builder.build()?;
763 let local_var_resp = local_var_client.execute(local_var_req).await?;
764
765 let local_var_status = local_var_resp.status();
766 let local_var_content = local_var_resp.text().await?;
767
768 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
769 crate::from_str_patched(&local_var_content).map_err(Error::from)
770 } else {
771 let local_var_entity: Option<RefreshCustomInstanceUserPwdError> = crate::from_str_patched(&local_var_content).ok();
772 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
773 Err(Error::ResponseError(local_var_error))
774 }
775}
776
777pub async fn renew_license_key(configuration: &configuration::Configuration, license_key: Option<&str>) -> Result<String, Error<RenewLicenseKeyError>> {
778 let local_var_configuration = configuration;
779
780 let local_var_client = &local_var_configuration.client;
781
782 let local_var_uri_str = format!("{}/settings/renew_license_key", local_var_configuration.base_path);
783 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
784
785 if let Some(ref local_var_str) = license_key {
786 local_var_req_builder = local_var_req_builder.query(&[("license_key", &local_var_str.to_string())]);
787 }
788 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
789 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
790 }
791 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
792 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
793 };
794
795 let local_var_req = local_var_req_builder.build()?;
796 let local_var_resp = local_var_client.execute(local_var_req).await?;
797
798 let local_var_status = local_var_resp.status();
799 let local_var_content = local_var_resp.text().await?;
800
801 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
802 crate::from_str_patched(&local_var_content).map_err(Error::from)
803 } else {
804 let local_var_entity: Option<RenewLicenseKeyError> = crate::from_str_patched(&local_var_content).ok();
805 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
806 Err(Error::ResponseError(local_var_error))
807 }
808}
809
810pub async fn send_stats(configuration: &configuration::Configuration, ) -> Result<String, Error<SendStatsError>> {
811 let local_var_configuration = configuration;
812
813 let local_var_client = &local_var_configuration.client;
814
815 let local_var_uri_str = format!("{}/settings/send_stats", local_var_configuration.base_path);
816 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
817
818 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
819 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
820 }
821 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
822 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
823 };
824
825 let local_var_req = local_var_req_builder.build()?;
826 let local_var_resp = local_var_client.execute(local_var_req).await?;
827
828 let local_var_status = local_var_resp.status();
829 let local_var_content = local_var_resp.text().await?;
830
831 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
832 crate::from_str_patched(&local_var_content).map_err(Error::from)
833 } else {
834 let local_var_entity: Option<SendStatsError> = crate::from_str_patched(&local_var_content).ok();
835 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
836 Err(Error::ResponseError(local_var_error))
837 }
838}
839
840pub async fn set_global(configuration: &configuration::Configuration, key: &str, set_global_request: models::SetGlobalRequest) -> Result<String, Error<SetGlobalError>> {
841 let local_var_configuration = configuration;
842
843 let local_var_client = &local_var_configuration.client;
844
845 let local_var_uri_str = format!("{}/settings/global/{key}", local_var_configuration.base_path, key=crate::apis::urlencode(key));
846 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
847
848 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
849 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
850 }
851 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
852 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
853 };
854 local_var_req_builder = local_var_req_builder.json(&set_global_request);
855
856 let local_var_req = local_var_req_builder.build()?;
857 let local_var_resp = local_var_client.execute(local_var_req).await?;
858
859 let local_var_status = local_var_resp.status();
860 let local_var_content = local_var_resp.text().await?;
861
862 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
863 crate::from_str_patched(&local_var_content).map_err(Error::from)
864 } else {
865 let local_var_entity: Option<SetGlobalError> = crate::from_str_patched(&local_var_content).ok();
866 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
867 Err(Error::ResponseError(local_var_error))
868 }
869}
870
871pub async fn set_instance_config(configuration: &configuration::Configuration, instance_config: models::InstanceConfig) -> Result<String, Error<SetInstanceConfigError>> {
872 let local_var_configuration = configuration;
873
874 let local_var_client = &local_var_configuration.client;
875
876 let local_var_uri_str = format!("{}/settings/instance_config", local_var_configuration.base_path);
877 let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
878
879 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
880 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
881 }
882 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
883 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
884 };
885 local_var_req_builder = local_var_req_builder.json(&instance_config);
886
887 let local_var_req = local_var_req_builder.build()?;
888 let local_var_resp = local_var_client.execute(local_var_req).await?;
889
890 let local_var_status = local_var_resp.status();
891 let local_var_content = local_var_resp.text().await?;
892
893 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
894 crate::from_str_patched(&local_var_content).map_err(Error::from)
895 } else {
896 let local_var_entity: Option<SetInstanceConfigError> = crate::from_str_patched(&local_var_content).ok();
897 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
898 Err(Error::ResponseError(local_var_error))
899 }
900}
901
902pub async fn set_public_app_rate_limit(configuration: &configuration::Configuration, workspace: &str, set_public_app_rate_limit_request: models::SetPublicAppRateLimitRequest) -> Result<String, Error<SetPublicAppRateLimitError>> {
903 let local_var_configuration = configuration;
904
905 let local_var_client = &local_var_configuration.client;
906
907 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/public_app_rate_limit", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
908 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
909
910 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
911 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
912 }
913 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
914 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
915 };
916 local_var_req_builder = local_var_req_builder.json(&set_public_app_rate_limit_request);
917
918 let local_var_req = local_var_req_builder.build()?;
919 let local_var_resp = local_var_client.execute(local_var_req).await?;
920
921 let local_var_status = local_var_resp.status();
922 let local_var_content = local_var_resp.text().await?;
923
924 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
925 crate::from_str_patched(&local_var_content).map_err(Error::from)
926 } else {
927 let local_var_entity: Option<SetPublicAppRateLimitError> = crate::from_str_patched(&local_var_content).ok();
928 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
929 Err(Error::ResponseError(local_var_error))
930 }
931}
932
933pub async fn setup_custom_instance_db(configuration: &configuration::Configuration, name: &str, setup_custom_instance_db_request: models::SetupCustomInstanceDbRequest) -> Result<models::CustomInstanceDb, Error<SetupCustomInstanceDbError>> {
934 let local_var_configuration = configuration;
935
936 let local_var_client = &local_var_configuration.client;
937
938 let local_var_uri_str = format!("{}/settings/setup_custom_instance_pg_database/{name}", local_var_configuration.base_path, name=crate::apis::urlencode(name));
939 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
940
941 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
942 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
943 }
944 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
945 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
946 };
947 local_var_req_builder = local_var_req_builder.json(&setup_custom_instance_db_request);
948
949 let local_var_req = local_var_req_builder.build()?;
950 let local_var_resp = local_var_client.execute(local_var_req).await?;
951
952 let local_var_status = local_var_resp.status();
953 let local_var_content = local_var_resp.text().await?;
954
955 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
956 crate::from_str_patched(&local_var_content).map_err(Error::from)
957 } else {
958 let local_var_entity: Option<SetupCustomInstanceDbError> = crate::from_str_patched(&local_var_content).ok();
959 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
960 Err(Error::ResponseError(local_var_error))
961 }
962}
963
964pub async fn test_critical_channels(configuration: &configuration::Configuration, test_critical_channels_request_inner: Vec<models::TestCriticalChannelsRequestInner>) -> Result<String, Error<TestCriticalChannelsError>> {
965 let local_var_configuration = configuration;
966
967 let local_var_client = &local_var_configuration.client;
968
969 let local_var_uri_str = format!("{}/settings/test_critical_channels", local_var_configuration.base_path);
970 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
971
972 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
973 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
974 }
975 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
976 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
977 };
978 local_var_req_builder = local_var_req_builder.json(&test_critical_channels_request_inner);
979
980 let local_var_req = local_var_req_builder.build()?;
981 let local_var_resp = local_var_client.execute(local_var_req).await?;
982
983 let local_var_status = local_var_resp.status();
984 let local_var_content = local_var_resp.text().await?;
985
986 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
987 crate::from_str_patched(&local_var_content).map_err(Error::from)
988 } else {
989 let local_var_entity: Option<TestCriticalChannelsError> = crate::from_str_patched(&local_var_content).ok();
990 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
991 Err(Error::ResponseError(local_var_error))
992 }
993}
994
995pub async fn test_license_key(configuration: &configuration::Configuration, test_license_key_request: models::TestLicenseKeyRequest) -> Result<String, Error<TestLicenseKeyError>> {
996 let local_var_configuration = configuration;
997
998 let local_var_client = &local_var_configuration.client;
999
1000 let local_var_uri_str = format!("{}/settings/test_license_key", local_var_configuration.base_path);
1001 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1002
1003 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1004 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1005 }
1006 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1007 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1008 };
1009 local_var_req_builder = local_var_req_builder.json(&test_license_key_request);
1010
1011 let local_var_req = local_var_req_builder.build()?;
1012 let local_var_resp = local_var_client.execute(local_var_req).await?;
1013
1014 let local_var_status = local_var_resp.status();
1015 let local_var_content = local_var_resp.text().await?;
1016
1017 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1018 crate::from_str_patched(&local_var_content).map_err(Error::from)
1019 } else {
1020 let local_var_entity: Option<TestLicenseKeyError> = crate::from_str_patched(&local_var_content).ok();
1021 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1022 Err(Error::ResponseError(local_var_error))
1023 }
1024}
1025
1026pub async fn test_metadata(configuration: &configuration::Configuration, body: &str) -> Result<String, Error<TestMetadataError>> {
1027 let local_var_configuration = configuration;
1028
1029 let local_var_client = &local_var_configuration.client;
1030
1031 let local_var_uri_str = format!("{}/saml/test_metadata", local_var_configuration.base_path);
1032 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1033
1034 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1035 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1036 }
1037 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1038 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1039 };
1040 local_var_req_builder = local_var_req_builder.json(&body);
1041
1042 let local_var_req = local_var_req_builder.build()?;
1043 let local_var_resp = local_var_client.execute(local_var_req).await?;
1044
1045 let local_var_status = local_var_resp.status();
1046 let local_var_content = local_var_resp.text().await?;
1047
1048 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1049 crate::from_str_patched(&local_var_content).map_err(Error::from)
1050 } else {
1051 let local_var_entity: Option<TestMetadataError> = crate::from_str_patched(&local_var_content).ok();
1052 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1053 Err(Error::ResponseError(local_var_error))
1054 }
1055}
1056
1057pub async fn test_object_storage_config(configuration: &configuration::Configuration, request_body: std::collections::HashMap<String, serde_json::Value>) -> Result<String, Error<TestObjectStorageConfigError>> {
1058 let local_var_configuration = configuration;
1059
1060 let local_var_client = &local_var_configuration.client;
1061
1062 let local_var_uri_str = format!("{}/settings/test_object_storage_config", local_var_configuration.base_path);
1063 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1064
1065 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1066 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1067 }
1068 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1069 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1070 };
1071 local_var_req_builder = local_var_req_builder.json(&request_body);
1072
1073 let local_var_req = local_var_req_builder.build()?;
1074 let local_var_resp = local_var_client.execute(local_var_req).await?;
1075
1076 let local_var_status = local_var_resp.status();
1077 let local_var_content = local_var_resp.text().await?;
1078
1079 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1080 crate::from_str_patched(&local_var_content).map_err(Error::from)
1081 } else {
1082 let local_var_entity: Option<TestObjectStorageConfigError> = crate::from_str_patched(&local_var_content).ok();
1083 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1084 Err(Error::ResponseError(local_var_error))
1085 }
1086}
1087
1088pub async fn test_secret_backend(configuration: &configuration::Configuration, vault_settings: models::VaultSettings) -> Result<String, Error<TestSecretBackendError>> {
1089 let local_var_configuration = configuration;
1090
1091 let local_var_client = &local_var_configuration.client;
1092
1093 let local_var_uri_str = format!("{}/settings/test_secret_backend", local_var_configuration.base_path);
1094 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1095
1096 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1097 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1098 }
1099 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1100 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1101 };
1102 local_var_req_builder = local_var_req_builder.json(&vault_settings);
1103
1104 let local_var_req = local_var_req_builder.build()?;
1105 let local_var_resp = local_var_client.execute(local_var_req).await?;
1106
1107 let local_var_status = local_var_resp.status();
1108 let local_var_content = local_var_resp.text().await?;
1109
1110 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1111 crate::from_str_patched(&local_var_content).map_err(Error::from)
1112 } else {
1113 let local_var_entity: Option<TestSecretBackendError> = crate::from_str_patched(&local_var_content).ok();
1114 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1115 Err(Error::ResponseError(local_var_error))
1116 }
1117}
1118
1119pub async fn test_smtp(configuration: &configuration::Configuration, test_smtp_request: models::TestSmtpRequest) -> Result<String, Error<TestSmtpError>> {
1120 let local_var_configuration = configuration;
1121
1122 let local_var_client = &local_var_configuration.client;
1123
1124 let local_var_uri_str = format!("{}/settings/test_smtp", local_var_configuration.base_path);
1125 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1126
1127 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1128 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1129 }
1130 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1131 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1132 };
1133 local_var_req_builder = local_var_req_builder.json(&test_smtp_request);
1134
1135 let local_var_req = local_var_req_builder.build()?;
1136 let local_var_resp = local_var_client.execute(local_var_req).await?;
1137
1138 let local_var_status = local_var_resp.status();
1139 let local_var_content = local_var_resp.text().await?;
1140
1141 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1142 crate::from_str_patched(&local_var_content).map_err(Error::from)
1143 } else {
1144 let local_var_entity: Option<TestSmtpError> = crate::from_str_patched(&local_var_content).ok();
1145 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1146 Err(Error::ResponseError(local_var_error))
1147 }
1148}
1149
1150pub async fn workspace_acknowledge_all_critical_alerts(configuration: &configuration::Configuration, workspace: &str) -> Result<String, Error<WorkspaceAcknowledgeAllCriticalAlertsError>> {
1151 let local_var_configuration = configuration;
1152
1153 let local_var_client = &local_var_configuration.client;
1154
1155 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/critical_alerts/acknowledge_all", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1156 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1157
1158 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1159 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1160 }
1161 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1162 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1163 };
1164
1165 let local_var_req = local_var_req_builder.build()?;
1166 let local_var_resp = local_var_client.execute(local_var_req).await?;
1167
1168 let local_var_status = local_var_resp.status();
1169 let local_var_content = local_var_resp.text().await?;
1170
1171 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1172 crate::from_str_patched(&local_var_content).map_err(Error::from)
1173 } else {
1174 let local_var_entity: Option<WorkspaceAcknowledgeAllCriticalAlertsError> = crate::from_str_patched(&local_var_content).ok();
1175 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1176 Err(Error::ResponseError(local_var_error))
1177 }
1178}
1179
1180pub async fn workspace_acknowledge_critical_alert(configuration: &configuration::Configuration, workspace: &str, id: i32) -> Result<String, Error<WorkspaceAcknowledgeCriticalAlertError>> {
1181 let local_var_configuration = configuration;
1182
1183 let local_var_client = &local_var_configuration.client;
1184
1185 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);
1186 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1187
1188 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1189 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1190 }
1191 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1192 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1193 };
1194
1195 let local_var_req = local_var_req_builder.build()?;
1196 let local_var_resp = local_var_client.execute(local_var_req).await?;
1197
1198 let local_var_status = local_var_resp.status();
1199 let local_var_content = local_var_resp.text().await?;
1200
1201 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1202 crate::from_str_patched(&local_var_content).map_err(Error::from)
1203 } else {
1204 let local_var_entity: Option<WorkspaceAcknowledgeCriticalAlertError> = crate::from_str_patched(&local_var_content).ok();
1205 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1206 Err(Error::ResponseError(local_var_error))
1207 }
1208}
1209
1210pub async fn workspace_get_critical_alerts(configuration: &configuration::Configuration, workspace: &str, page: Option<i32>, page_size: Option<i32>, acknowledged: Option<bool>) -> Result<models::GetCriticalAlerts200Response, Error<WorkspaceGetCriticalAlertsError>> {
1211 let local_var_configuration = configuration;
1212
1213 let local_var_client = &local_var_configuration.client;
1214
1215 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/critical_alerts", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1216 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1217
1218 if let Some(ref local_var_str) = page {
1219 local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
1220 }
1221 if let Some(ref local_var_str) = page_size {
1222 local_var_req_builder = local_var_req_builder.query(&[("page_size", &local_var_str.to_string())]);
1223 }
1224 if let Some(ref local_var_str) = acknowledged {
1225 local_var_req_builder = local_var_req_builder.query(&[("acknowledged", &local_var_str.to_string())]);
1226 }
1227 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1228 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1229 }
1230 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1231 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1232 };
1233
1234 let local_var_req = local_var_req_builder.build()?;
1235 let local_var_resp = local_var_client.execute(local_var_req).await?;
1236
1237 let local_var_status = local_var_resp.status();
1238 let local_var_content = local_var_resp.text().await?;
1239
1240 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1241 crate::from_str_patched(&local_var_content).map_err(Error::from)
1242 } else {
1243 let local_var_entity: Option<WorkspaceGetCriticalAlertsError> = crate::from_str_patched(&local_var_content).ok();
1244 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1245 Err(Error::ResponseError(local_var_error))
1246 }
1247}
1248
1249pub async fn workspace_mute_critical_alerts_ui(configuration: &configuration::Configuration, workspace: &str, workspace_mute_critical_alerts_ui_request: models::WorkspaceMuteCriticalAlertsUiRequest) -> Result<String, Error<WorkspaceMuteCriticalAlertsUiError>> {
1250 let local_var_configuration = configuration;
1251
1252 let local_var_client = &local_var_configuration.client;
1253
1254 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/critical_alerts/mute", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1255 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1256
1257 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1258 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1259 }
1260 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1261 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1262 };
1263 local_var_req_builder = local_var_req_builder.json(&workspace_mute_critical_alerts_ui_request);
1264
1265 let local_var_req = local_var_req_builder.build()?;
1266 let local_var_resp = local_var_client.execute(local_var_req).await?;
1267
1268 let local_var_status = local_var_resp.status();
1269 let local_var_content = local_var_resp.text().await?;
1270
1271 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1272 crate::from_str_patched(&local_var_content).map_err(Error::from)
1273 } else {
1274 let local_var_entity: Option<WorkspaceMuteCriticalAlertsUiError> = crate::from_str_patched(&local_var_content).ok();
1275 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1276 Err(Error::ResponseError(local_var_error))
1277 }
1278}
1279