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