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