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