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