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