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