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