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