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