Skip to main content

windmill_api/apis/
setting_api.rs

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