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