Skip to main content

orvanta_api/apis/
setting_api.rs

1/*
2 * Orvanta API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 4.1.0
7 * Contact: contact@orvanta.cloud
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 [`delete_saml_config`]
40#[derive(Debug, Clone, Serialize, Deserialize)]
41#[serde(untagged)]
42pub enum DeleteSamlConfigError {
43    UnknownValue(serde_json::Value),
44}
45
46/// struct for typed errors of method [`drop_custom_instance_db`]
47#[derive(Debug, Clone, Serialize, Deserialize)]
48#[serde(untagged)]
49pub enum DropCustomInstanceDbError {
50    UnknownValue(serde_json::Value),
51}
52
53/// struct for typed errors of method [`get_critical_alerts`]
54#[derive(Debug, Clone, Serialize, Deserialize)]
55#[serde(untagged)]
56pub enum GetCriticalAlertsError {
57    UnknownValue(serde_json::Value),
58}
59
60/// struct for typed errors of method [`get_global`]
61#[derive(Debug, Clone, Serialize, Deserialize)]
62#[serde(untagged)]
63pub enum GetGlobalError {
64    UnknownValue(serde_json::Value),
65}
66
67/// struct for typed errors of method [`get_instance_config`]
68#[derive(Debug, Clone, Serialize, Deserialize)]
69#[serde(untagged)]
70pub enum GetInstanceConfigError {
71    UnknownValue(serde_json::Value),
72}
73
74/// struct for typed errors of method [`get_jwks`]
75#[derive(Debug, Clone, Serialize, Deserialize)]
76#[serde(untagged)]
77pub enum GetJwksError {
78    UnknownValue(serde_json::Value),
79}
80
81/// struct for typed errors of method [`get_latest_key_renewal_attempt`]
82#[derive(Debug, Clone, Serialize, Deserialize)]
83#[serde(untagged)]
84pub enum GetLatestKeyRenewalAttemptError {
85    UnknownValue(serde_json::Value),
86}
87
88/// struct for typed errors of method [`get_local`]
89#[derive(Debug, Clone, Serialize, Deserialize)]
90#[serde(untagged)]
91pub enum GetLocalError {
92    UnknownValue(serde_json::Value),
93}
94
95/// struct for typed errors of method [`get_log_cleanup_status`]
96#[derive(Debug, Clone, Serialize, Deserialize)]
97#[serde(untagged)]
98pub enum GetLogCleanupStatusError {
99    UnknownValue(serde_json::Value),
100}
101
102/// struct for typed errors of method [`get_min_keep_alive_version`]
103#[derive(Debug, Clone, Serialize, Deserialize)]
104#[serde(untagged)]
105pub enum GetMinKeepAliveVersionError {
106    UnknownValue(serde_json::Value),
107}
108
109/// struct for typed errors of method [`get_object_storage_usage`]
110#[derive(Debug, Clone, Serialize, Deserialize)]
111#[serde(untagged)]
112pub enum GetObjectStorageUsageError {
113    UnknownValue(serde_json::Value),
114}
115
116/// struct for typed errors of method [`get_ruff_config`]
117#[derive(Debug, Clone, Serialize, Deserialize)]
118#[serde(untagged)]
119pub enum GetRuffConfigError {
120    UnknownValue(serde_json::Value),
121}
122
123/// struct for typed errors of method [`get_runtime_usage`]
124#[derive(Debug, Clone, Serialize, Deserialize)]
125#[serde(untagged)]
126pub enum GetRuntimeUsageError {
127    UnknownValue(serde_json::Value),
128}
129
130/// struct for typed errors of method [`get_runtime_usage_locations`]
131#[derive(Debug, Clone, Serialize, Deserialize)]
132#[serde(untagged)]
133pub enum GetRuntimeUsageLocationsError {
134    UnknownValue(serde_json::Value),
135}
136
137/// struct for typed errors of method [`get_saml_config`]
138#[derive(Debug, Clone, Serialize, Deserialize)]
139#[serde(untagged)]
140pub enum GetSamlConfigError {
141    UnknownValue(serde_json::Value),
142}
143
144/// struct for typed errors of method [`get_saml_sp_metadata`]
145#[derive(Debug, Clone, Serialize, Deserialize)]
146#[serde(untagged)]
147pub enum GetSamlSpMetadataError {
148    UnknownValue(serde_json::Value),
149}
150
151/// struct for typed errors of method [`get_secondary_storage_names`]
152#[derive(Debug, Clone, Serialize, Deserialize)]
153#[serde(untagged)]
154pub enum GetSecondaryStorageNamesError {
155    UnknownValue(serde_json::Value),
156}
157
158/// struct for typed errors of method [`get_stats`]
159#[derive(Debug, Clone, Serialize, Deserialize)]
160#[serde(untagged)]
161pub enum GetStatsError {
162    UnknownValue(serde_json::Value),
163}
164
165/// struct for typed errors of method [`initiate_saml_login`]
166#[derive(Debug, Clone, Serialize, Deserialize)]
167#[serde(untagged)]
168pub enum InitiateSamlLoginError {
169    UnknownValue(serde_json::Value),
170}
171
172/// struct for typed errors of method [`initiate_saml_login_get`]
173#[derive(Debug, Clone, Serialize, Deserialize)]
174#[serde(untagged)]
175pub enum InitiateSamlLoginGetError {
176    UnknownValue(serde_json::Value),
177}
178
179/// struct for typed errors of method [`list_custom_instance_dbs`]
180#[derive(Debug, Clone, Serialize, Deserialize)]
181#[serde(untagged)]
182pub enum ListCustomInstanceDbsError {
183    UnknownValue(serde_json::Value),
184}
185
186/// struct for typed errors of method [`list_global_settings`]
187#[derive(Debug, Clone, Serialize, Deserialize)]
188#[serde(untagged)]
189pub enum ListGlobalSettingsError {
190    UnknownValue(serde_json::Value),
191}
192
193/// struct for typed errors of method [`migrate_secrets_from_aws_sm`]
194#[derive(Debug, Clone, Serialize, Deserialize)]
195#[serde(untagged)]
196pub enum MigrateSecretsFromAwsSmError {
197    UnknownValue(serde_json::Value),
198}
199
200/// struct for typed errors of method [`migrate_secrets_from_azure_kv`]
201#[derive(Debug, Clone, Serialize, Deserialize)]
202#[serde(untagged)]
203pub enum MigrateSecretsFromAzureKvError {
204    UnknownValue(serde_json::Value),
205}
206
207/// struct for typed errors of method [`migrate_secrets_to_aws_sm`]
208#[derive(Debug, Clone, Serialize, Deserialize)]
209#[serde(untagged)]
210pub enum MigrateSecretsToAwsSmError {
211    UnknownValue(serde_json::Value),
212}
213
214/// struct for typed errors of method [`migrate_secrets_to_azure_kv`]
215#[derive(Debug, Clone, Serialize, Deserialize)]
216#[serde(untagged)]
217pub enum MigrateSecretsToAzureKvError {
218    UnknownValue(serde_json::Value),
219}
220
221/// struct for typed errors of method [`migrate_secrets_to_database`]
222#[derive(Debug, Clone, Serialize, Deserialize)]
223#[serde(untagged)]
224pub enum MigrateSecretsToDatabaseError {
225    UnknownValue(serde_json::Value),
226}
227
228/// struct for typed errors of method [`migrate_secrets_to_vault`]
229#[derive(Debug, Clone, Serialize, Deserialize)]
230#[serde(untagged)]
231pub enum MigrateSecretsToVaultError {
232    UnknownValue(serde_json::Value),
233}
234
235/// struct for typed errors of method [`refresh_custom_instance_user_pwd`]
236#[derive(Debug, Clone, Serialize, Deserialize)]
237#[serde(untagged)]
238pub enum RefreshCustomInstanceUserPwdError {
239    UnknownValue(serde_json::Value),
240}
241
242/// struct for typed errors of method [`renew_license_key`]
243#[derive(Debug, Clone, Serialize, Deserialize)]
244#[serde(untagged)]
245pub enum RenewLicenseKeyError {
246    UnknownValue(serde_json::Value),
247}
248
249/// struct for typed errors of method [`restart_worker_group`]
250#[derive(Debug, Clone, Serialize, Deserialize)]
251#[serde(untagged)]
252pub enum RestartWorkerGroupError {
253    UnknownValue(serde_json::Value),
254}
255
256/// struct for typed errors of method [`restart_worker_pool`]
257#[derive(Debug, Clone, Serialize, Deserialize)]
258#[serde(untagged)]
259pub enum RestartWorkerPoolError {
260    UnknownValue(serde_json::Value),
261}
262
263/// struct for typed errors of method [`revalidate_license`]
264#[derive(Debug, Clone, Serialize, Deserialize)]
265#[serde(untagged)]
266pub enum RevalidateLicenseError {
267    UnknownValue(serde_json::Value),
268}
269
270/// struct for typed errors of method [`run_log_cleanup`]
271#[derive(Debug, Clone, Serialize, Deserialize)]
272#[serde(untagged)]
273pub enum RunLogCleanupError {
274    UnknownValue(serde_json::Value),
275}
276
277/// struct for typed errors of method [`save_saml_config`]
278#[derive(Debug, Clone, Serialize, Deserialize)]
279#[serde(untagged)]
280pub enum SaveSamlConfigError {
281    UnknownValue(serde_json::Value),
282}
283
284/// struct for typed errors of method [`send_stats`]
285#[derive(Debug, Clone, Serialize, Deserialize)]
286#[serde(untagged)]
287pub enum SendStatsError {
288    UnknownValue(serde_json::Value),
289}
290
291/// struct for typed errors of method [`set_global`]
292#[derive(Debug, Clone, Serialize, Deserialize)]
293#[serde(untagged)]
294pub enum SetGlobalError {
295    UnknownValue(serde_json::Value),
296}
297
298/// struct for typed errors of method [`set_instance_config`]
299#[derive(Debug, Clone, Serialize, Deserialize)]
300#[serde(untagged)]
301pub enum SetInstanceConfigError {
302    UnknownValue(serde_json::Value),
303}
304
305/// struct for typed errors of method [`set_public_app_rate_limit`]
306#[derive(Debug, Clone, Serialize, Deserialize)]
307#[serde(untagged)]
308pub enum SetPublicAppRateLimitError {
309    UnknownValue(serde_json::Value),
310}
311
312/// struct for typed errors of method [`setup_custom_instance_db`]
313#[derive(Debug, Clone, Serialize, Deserialize)]
314#[serde(untagged)]
315pub enum SetupCustomInstanceDbError {
316    UnknownValue(serde_json::Value),
317}
318
319/// struct for typed errors of method [`test_aws_sm_backend`]
320#[derive(Debug, Clone, Serialize, Deserialize)]
321#[serde(untagged)]
322pub enum TestAwsSmBackendError {
323    UnknownValue(serde_json::Value),
324}
325
326/// struct for typed errors of method [`test_azure_kv_backend`]
327#[derive(Debug, Clone, Serialize, Deserialize)]
328#[serde(untagged)]
329pub enum TestAzureKvBackendError {
330    UnknownValue(serde_json::Value),
331}
332
333/// struct for typed errors of method [`test_critical_channels`]
334#[derive(Debug, Clone, Serialize, Deserialize)]
335#[serde(untagged)]
336pub enum TestCriticalChannelsError {
337    UnknownValue(serde_json::Value),
338}
339
340/// struct for typed errors of method [`test_license_key`]
341#[derive(Debug, Clone, Serialize, Deserialize)]
342#[serde(untagged)]
343pub enum TestLicenseKeyError {
344    UnknownValue(serde_json::Value),
345}
346
347/// struct for typed errors of method [`test_metadata`]
348#[derive(Debug, Clone, Serialize, Deserialize)]
349#[serde(untagged)]
350pub enum TestMetadataError {
351    UnknownValue(serde_json::Value),
352}
353
354/// struct for typed errors of method [`test_object_storage_config`]
355#[derive(Debug, Clone, Serialize, Deserialize)]
356#[serde(untagged)]
357pub enum TestObjectStorageConfigError {
358    UnknownValue(serde_json::Value),
359}
360
361/// struct for typed errors of method [`test_secret_backend`]
362#[derive(Debug, Clone, Serialize, Deserialize)]
363#[serde(untagged)]
364pub enum TestSecretBackendError {
365    UnknownValue(serde_json::Value),
366}
367
368/// struct for typed errors of method [`test_smtp`]
369#[derive(Debug, Clone, Serialize, Deserialize)]
370#[serde(untagged)]
371pub enum TestSmtpError {
372    UnknownValue(serde_json::Value),
373}
374
375/// struct for typed errors of method [`update_saml_metadata`]
376#[derive(Debug, Clone, Serialize, Deserialize)]
377#[serde(untagged)]
378pub enum UpdateSamlMetadataError {
379    UnknownValue(serde_json::Value),
380}
381
382/// struct for typed errors of method [`workspace_acknowledge_all_critical_alerts`]
383#[derive(Debug, Clone, Serialize, Deserialize)]
384#[serde(untagged)]
385pub enum WorkspaceAcknowledgeAllCriticalAlertsError {
386    UnknownValue(serde_json::Value),
387}
388
389/// struct for typed errors of method [`workspace_acknowledge_critical_alert`]
390#[derive(Debug, Clone, Serialize, Deserialize)]
391#[serde(untagged)]
392pub enum WorkspaceAcknowledgeCriticalAlertError {
393    UnknownValue(serde_json::Value),
394}
395
396/// struct for typed errors of method [`workspace_get_critical_alerts`]
397#[derive(Debug, Clone, Serialize, Deserialize)]
398#[serde(untagged)]
399pub enum WorkspaceGetCriticalAlertsError {
400    UnknownValue(serde_json::Value),
401}
402
403/// struct for typed errors of method [`workspace_mute_critical_alerts_ui`]
404#[derive(Debug, Clone, Serialize, Deserialize)]
405#[serde(untagged)]
406pub enum WorkspaceMuteCriticalAlertsUiError {
407    UnknownValue(serde_json::Value),
408}
409
410
411pub async fn acknowledge_all_critical_alerts(configuration: &configuration::Configuration, ) -> Result<String, Error<AcknowledgeAllCriticalAlertsError>> {
412    let local_var_configuration = configuration;
413
414    let local_var_client = &local_var_configuration.client;
415
416    let local_var_uri_str = format!("{}/settings/critical_alerts/acknowledge_all", local_var_configuration.base_path);
417    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
418
419    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
420        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
421    }
422    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
423        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
424    };
425
426    let local_var_req = local_var_req_builder.build()?;
427    let local_var_resp = local_var_client.execute(local_var_req).await?;
428
429    let local_var_status = local_var_resp.status();
430    let local_var_content = local_var_resp.text().await?;
431
432    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
433        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
434    } else {
435        let local_var_entity: Option<AcknowledgeAllCriticalAlertsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
436        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
437        Err(Error::ResponseError(local_var_error))
438    }
439}
440
441pub async fn acknowledge_critical_alert(configuration: &configuration::Configuration, id: i32) -> Result<String, Error<AcknowledgeCriticalAlertError>> {
442    let local_var_configuration = configuration;
443
444    let local_var_client = &local_var_configuration.client;
445
446    let local_var_uri_str = format!("{}/settings/critical_alerts/{id}/acknowledge", local_var_configuration.base_path, id=id);
447    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
448
449    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
450        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
451    }
452    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
453        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
454    };
455
456    let local_var_req = local_var_req_builder.build()?;
457    let local_var_resp = local_var_client.execute(local_var_req).await?;
458
459    let local_var_status = local_var_resp.status();
460    let local_var_content = local_var_resp.text().await?;
461
462    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
463        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
464    } else {
465        let local_var_entity: Option<AcknowledgeCriticalAlertError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
466        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
467        Err(Error::ResponseError(local_var_error))
468    }
469}
470
471pub async fn compute_object_storage_usage(configuration: &configuration::Configuration, ) -> Result<String, Error<ComputeObjectStorageUsageError>> {
472    let local_var_configuration = configuration;
473
474    let local_var_client = &local_var_configuration.client;
475
476    let local_var_uri_str = format!("{}/settings/object_storage_usage", local_var_configuration.base_path);
477    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
478
479    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
480        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
481    }
482    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
483        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
484    };
485
486    let local_var_req = local_var_req_builder.build()?;
487    let local_var_resp = local_var_client.execute(local_var_req).await?;
488
489    let local_var_status = local_var_resp.status();
490    let local_var_content = local_var_resp.text().await?;
491
492    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
493        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
494    } else {
495        let local_var_entity: Option<ComputeObjectStorageUsageError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
496        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
497        Err(Error::ResponseError(local_var_error))
498    }
499}
500
501pub async fn delete_saml_config(configuration: &configuration::Configuration, ) -> Result<String, Error<DeleteSamlConfigError>> {
502    let local_var_configuration = configuration;
503
504    let local_var_client = &local_var_configuration.client;
505
506    let local_var_uri_str = format!("{}/saml/config", local_var_configuration.base_path);
507    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
508
509    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
510        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
511    }
512    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
513        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
514    };
515
516    let local_var_req = local_var_req_builder.build()?;
517    let local_var_resp = local_var_client.execute(local_var_req).await?;
518
519    let local_var_status = local_var_resp.status();
520    let local_var_content = local_var_resp.text().await?;
521
522    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
523        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
524    } else {
525        let local_var_entity: Option<DeleteSamlConfigError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
526        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
527        Err(Error::ResponseError(local_var_error))
528    }
529}
530
531pub async fn drop_custom_instance_db(configuration: &configuration::Configuration, name: &str) -> Result<String, Error<DropCustomInstanceDbError>> {
532    let local_var_configuration = configuration;
533
534    let local_var_client = &local_var_configuration.client;
535
536    let local_var_uri_str = format!("{}/settings/drop_custom_instance_pg_database/{name}", local_var_configuration.base_path, name=crate::apis::urlencode(name));
537    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
538
539    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
540        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
541    }
542    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
543        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
544    };
545
546    let local_var_req = local_var_req_builder.build()?;
547    let local_var_resp = local_var_client.execute(local_var_req).await?;
548
549    let local_var_status = local_var_resp.status();
550    let local_var_content = local_var_resp.text().await?;
551
552    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
553        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
554    } else {
555        let local_var_entity: Option<DropCustomInstanceDbError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
556        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
557        Err(Error::ResponseError(local_var_error))
558    }
559}
560
561pub async fn get_critical_alerts(configuration: &configuration::Configuration, page: Option<i32>, page_size: Option<i32>, acknowledged: Option<bool>) -> Result<models::GetCriticalAlerts200Response, Error<GetCriticalAlertsError>> {
562    let local_var_configuration = configuration;
563
564    let local_var_client = &local_var_configuration.client;
565
566    let local_var_uri_str = format!("{}/settings/critical_alerts", local_var_configuration.base_path);
567    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
568
569    if let Some(ref local_var_str) = page {
570        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
571    }
572    if let Some(ref local_var_str) = page_size {
573        local_var_req_builder = local_var_req_builder.query(&[("page_size", &local_var_str.to_string())]);
574    }
575    if let Some(ref local_var_str) = acknowledged {
576        local_var_req_builder = local_var_req_builder.query(&[("acknowledged", &local_var_str.to_string())]);
577    }
578    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
579        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
580    }
581    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
582        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
583    };
584
585    let local_var_req = local_var_req_builder.build()?;
586    let local_var_resp = local_var_client.execute(local_var_req).await?;
587
588    let local_var_status = local_var_resp.status();
589    let local_var_content = local_var_resp.text().await?;
590
591    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
592        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
593    } else {
594        let local_var_entity: Option<GetCriticalAlertsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
595        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
596        Err(Error::ResponseError(local_var_error))
597    }
598}
599
600pub async fn get_global(configuration: &configuration::Configuration, key: &str) -> Result<serde_json::Value, Error<GetGlobalError>> {
601    let local_var_configuration = configuration;
602
603    let local_var_client = &local_var_configuration.client;
604
605    let local_var_uri_str = format!("{}/settings/global/{key}", local_var_configuration.base_path, key=crate::apis::urlencode(key));
606    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
607
608    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
609        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
610    }
611    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
612        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
613    };
614
615    let local_var_req = local_var_req_builder.build()?;
616    let local_var_resp = local_var_client.execute(local_var_req).await?;
617
618    let local_var_status = local_var_resp.status();
619    let local_var_content = local_var_resp.text().await?;
620
621    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
622        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
623    } else {
624        let local_var_entity: Option<GetGlobalError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
625        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
626        Err(Error::ResponseError(local_var_error))
627    }
628}
629
630pub async fn get_instance_config(configuration: &configuration::Configuration, ) -> Result<models::InstanceConfig, Error<GetInstanceConfigError>> {
631    let local_var_configuration = configuration;
632
633    let local_var_client = &local_var_configuration.client;
634
635    let local_var_uri_str = format!("{}/settings/instance_config", local_var_configuration.base_path);
636    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
637
638    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
639        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
640    }
641    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
642        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
643    };
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<GetInstanceConfigError> = 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 get_jwks(configuration: &configuration::Configuration, ) -> Result<models::JwksResponse, Error<GetJwksError>> {
661    let local_var_configuration = configuration;
662
663    let local_var_client = &local_var_configuration.client;
664
665    let local_var_uri_str = format!("{}/.well-known/jwks.json", local_var_configuration.base_path);
666    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, 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        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
683    } else {
684        let local_var_entity: Option<GetJwksError> = 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 get_latest_key_renewal_attempt(configuration: &configuration::Configuration, ) -> Result<models::GetLatestKeyRenewalAttempt200Response, Error<GetLatestKeyRenewalAttemptError>> {
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/latest_key_renewal_attempt", local_var_configuration.base_path);
696    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, 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<GetLatestKeyRenewalAttemptError> = 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 get_local(configuration: &configuration::Configuration, ) -> Result<serde_json::Value, Error<GetLocalError>> {
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/local", local_var_configuration.base_path);
726    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, 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<GetLocalError> = 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_log_cleanup_status(configuration: &configuration::Configuration, ) -> Result<models::GetLogCleanupStatus200Response, Error<GetLogCleanupStatusError>> {
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/log_cleanup_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<GetLogCleanupStatusError> = 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_min_keep_alive_version(configuration: &configuration::Configuration, ) -> Result<models::GetMinKeepAliveVersion200Response, Error<GetMinKeepAliveVersionError>> {
781    let local_var_configuration = configuration;
782
783    let local_var_client = &local_var_configuration.client;
784
785    let local_var_uri_str = format!("{}/min_keep_alive_version", 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<GetMinKeepAliveVersionError> = 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_object_storage_usage(configuration: &configuration::Configuration, ) -> Result<models::GetObjectStorageUsage200Response, Error<GetObjectStorageUsageError>> {
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/object_storage_usage", 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_user_agent) = local_var_configuration.user_agent {
819        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
820    }
821    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
822        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
823    };
824
825    let local_var_req = local_var_req_builder.build()?;
826    let local_var_resp = local_var_client.execute(local_var_req).await?;
827
828    let local_var_status = local_var_resp.status();
829    let local_var_content = local_var_resp.text().await?;
830
831    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
832        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
833    } else {
834        let local_var_entity: Option<GetObjectStorageUsageError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
835        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
836        Err(Error::ResponseError(local_var_error))
837    }
838}
839
840/// 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. 
841pub async fn get_ruff_config(configuration: &configuration::Configuration, ) -> Result<String, Error<GetRuffConfigError>> {
842    let local_var_configuration = configuration;
843
844    let local_var_client = &local_var_configuration.client;
845
846    let local_var_uri_str = format!("{}/settings_u/ruff_config", local_var_configuration.base_path);
847    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
848
849    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
850        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
851    }
852    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
853        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
854    };
855
856    let local_var_req = local_var_req_builder.build()?;
857    let local_var_resp = local_var_client.execute(local_var_req).await?;
858
859    let local_var_status = local_var_resp.status();
860    let local_var_content = local_var_resp.text().await?;
861
862    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
863        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
864    } else {
865        let local_var_entity: Option<GetRuffConfigError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
866        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
867        Err(Error::ResponseError(local_var_error))
868    }
869}
870
871/// Powers the Runtimes admin page (#190/#255 runtime governance) — for each language currently in use anywhere on the instance, how many scripts, flows, and apps use it. A language with no usage is simply absent from the response. 
872pub async fn get_runtime_usage(configuration: &configuration::Configuration, ) -> Result<Vec<models::RuntimeUsageCount>, Error<GetRuntimeUsageError>> {
873    let local_var_configuration = configuration;
874
875    let local_var_client = &local_var_configuration.client;
876
877    let local_var_uri_str = format!("{}/settings/runtime_usage", local_var_configuration.base_path);
878    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
879
880    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
881        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
882    }
883    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
884        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
885    };
886
887    let local_var_req = local_var_req_builder.build()?;
888    let local_var_resp = local_var_client.execute(local_var_req).await?;
889
890    let local_var_status = local_var_resp.status();
891    let local_var_content = local_var_resp.text().await?;
892
893    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
894        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
895    } else {
896        let local_var_entity: Option<GetRuntimeUsageError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
897        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
898        Err(Error::ResponseError(local_var_error))
899    }
900}
901
902/// Powers the block-on-disable instructive message (#190/#255) — where a language an admin is about to disable is still used, so they know what to migrate first. Capped per object kind on a large instance. 
903pub async fn get_runtime_usage_locations(configuration: &configuration::Configuration, language: models::ScriptLang) -> Result<Vec<models::RuntimeUsageLocation>, Error<GetRuntimeUsageLocationsError>> {
904    let local_var_configuration = configuration;
905
906    let local_var_client = &local_var_configuration.client;
907
908    let local_var_uri_str = format!("{}/settings/runtime_usage/{language}", local_var_configuration.base_path, language=language.to_string());
909    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
910
911    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
912        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
913    }
914    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
915        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
916    };
917
918    let local_var_req = local_var_req_builder.build()?;
919    let local_var_resp = local_var_client.execute(local_var_req).await?;
920
921    let local_var_status = local_var_resp.status();
922    let local_var_content = local_var_resp.text().await?;
923
924    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
925        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
926    } else {
927        let local_var_entity: Option<GetRuntimeUsageLocationsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
928        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
929        Err(Error::ResponseError(local_var_error))
930    }
931}
932
933pub async fn get_saml_config(configuration: &configuration::Configuration, ) -> Result<models::SamlConfig, Error<GetSamlConfigError>> {
934    let local_var_configuration = configuration;
935
936    let local_var_client = &local_var_configuration.client;
937
938    let local_var_uri_str = format!("{}/saml/config", local_var_configuration.base_path);
939    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
940
941    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
942        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
943    }
944    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
945        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
946    };
947
948    let local_var_req = local_var_req_builder.build()?;
949    let local_var_resp = local_var_client.execute(local_var_req).await?;
950
951    let local_var_status = local_var_resp.status();
952    let local_var_content = local_var_resp.text().await?;
953
954    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
955        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
956    } else {
957        let local_var_entity: Option<GetSamlConfigError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
958        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
959        Err(Error::ResponseError(local_var_error))
960    }
961}
962
963pub async fn get_saml_sp_metadata(configuration: &configuration::Configuration, ) -> Result<String, Error<GetSamlSpMetadataError>> {
964    let local_var_configuration = configuration;
965
966    let local_var_client = &local_var_configuration.client;
967
968    let local_var_uri_str = format!("{}/saml/metadata", local_var_configuration.base_path);
969    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
970
971    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
972        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
973    }
974    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
975        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
976    };
977
978    let local_var_req = local_var_req_builder.build()?;
979    let local_var_resp = local_var_client.execute(local_var_req).await?;
980
981    let local_var_status = local_var_resp.status();
982    let local_var_content = local_var_resp.text().await?;
983
984    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
985        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
986    } else {
987        let local_var_entity: Option<GetSamlSpMetadataError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
988        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
989        Err(Error::ResponseError(local_var_error))
990    }
991}
992
993pub async fn get_secondary_storage_names(configuration: &configuration::Configuration, workspace: &str, include_default: Option<bool>) -> Result<Vec<String>, Error<GetSecondaryStorageNamesError>> {
994    let local_var_configuration = configuration;
995
996    let local_var_client = &local_var_configuration.client;
997
998    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_secondary_storage_names", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
999    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1000
1001    if let Some(ref local_var_str) = include_default {
1002        local_var_req_builder = local_var_req_builder.query(&[("include_default", &local_var_str.to_string())]);
1003    }
1004    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1005        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1006    }
1007    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1008        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1009    };
1010
1011    let local_var_req = local_var_req_builder.build()?;
1012    let local_var_resp = local_var_client.execute(local_var_req).await?;
1013
1014    let local_var_status = local_var_resp.status();
1015    let local_var_content = local_var_resp.text().await?;
1016
1017    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1018        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1019    } else {
1020        let local_var_entity: Option<GetSecondaryStorageNamesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1021        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1022        Err(Error::ResponseError(local_var_error))
1023    }
1024}
1025
1026pub async fn get_stats(configuration: &configuration::Configuration, ) -> Result<models::GetStats200Response, Error<GetStatsError>> {
1027    let local_var_configuration = configuration;
1028
1029    let local_var_client = &local_var_configuration.client;
1030
1031    let local_var_uri_str = format!("{}/settings/get_stats", local_var_configuration.base_path);
1032    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1033
1034    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1035        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1036    }
1037    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1038        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1039    };
1040
1041    let local_var_req = local_var_req_builder.build()?;
1042    let local_var_resp = local_var_client.execute(local_var_req).await?;
1043
1044    let local_var_status = local_var_resp.status();
1045    let local_var_content = local_var_resp.text().await?;
1046
1047    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1048        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1049    } else {
1050        let local_var_entity: Option<GetStatsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1051        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1052        Err(Error::ResponseError(local_var_error))
1053    }
1054}
1055
1056/// Mints a single-use, TTL'd AuthnRequest ID, records it server-side, sets it as a browser-bound cookie, and redirects to the IdP's SingleSignOnService with a `<samlp:AuthnRequest>` on the HTTP-Redirect binding. `POST /saml/acs` then requires the assertion's `InResponseTo` to match that ID, which is what binds the login to this browser (#589). Unauthenticated — this is the login entry point. Also available on GET so the sign-in page can hand off with a plain navigation.
1057pub async fn initiate_saml_login(configuration: &configuration::Configuration, relay_state: Option<&str>) -> Result<(), Error<InitiateSamlLoginError>> {
1058    let local_var_configuration = configuration;
1059
1060    let local_var_client = &local_var_configuration.client;
1061
1062    let local_var_uri_str = format!("{}/saml/initiate", local_var_configuration.base_path);
1063    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1064
1065    if let Some(ref local_var_str) = relay_state {
1066        local_var_req_builder = local_var_req_builder.query(&[("RelayState", &local_var_str.to_string())]);
1067    }
1068    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1069        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1070    }
1071    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1072        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1073    };
1074
1075    let local_var_req = local_var_req_builder.build()?;
1076    let local_var_resp = local_var_client.execute(local_var_req).await?;
1077
1078    let local_var_status = local_var_resp.status();
1079    let local_var_content = local_var_resp.text().await?;
1080
1081    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1082        Ok(())
1083    } else {
1084        let local_var_entity: Option<InitiateSamlLoginError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1085        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1086        Err(Error::ResponseError(local_var_error))
1087    }
1088}
1089
1090pub async fn initiate_saml_login_get(configuration: &configuration::Configuration, relay_state: Option<&str>) -> Result<(), Error<InitiateSamlLoginGetError>> {
1091    let local_var_configuration = configuration;
1092
1093    let local_var_client = &local_var_configuration.client;
1094
1095    let local_var_uri_str = format!("{}/saml/initiate", local_var_configuration.base_path);
1096    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1097
1098    if let Some(ref local_var_str) = relay_state {
1099        local_var_req_builder = local_var_req_builder.query(&[("RelayState", &local_var_str.to_string())]);
1100    }
1101    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1102        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1103    }
1104    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1105        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1106    };
1107
1108    let local_var_req = local_var_req_builder.build()?;
1109    let local_var_resp = local_var_client.execute(local_var_req).await?;
1110
1111    let local_var_status = local_var_resp.status();
1112    let local_var_content = local_var_resp.text().await?;
1113
1114    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1115        Ok(())
1116    } else {
1117        let local_var_entity: Option<InitiateSamlLoginGetError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1118        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1119        Err(Error::ResponseError(local_var_error))
1120    }
1121}
1122
1123pub async fn list_custom_instance_dbs(configuration: &configuration::Configuration, ) -> Result<std::collections::HashMap<String, models::CustomInstanceDb>, Error<ListCustomInstanceDbsError>> {
1124    let local_var_configuration = configuration;
1125
1126    let local_var_client = &local_var_configuration.client;
1127
1128    let local_var_uri_str = format!("{}/settings/list_custom_instance_pg_databases", local_var_configuration.base_path);
1129    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1130
1131    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1132        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1133    }
1134    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1135        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1136    };
1137
1138    let local_var_req = local_var_req_builder.build()?;
1139    let local_var_resp = local_var_client.execute(local_var_req).await?;
1140
1141    let local_var_status = local_var_resp.status();
1142    let local_var_content = local_var_resp.text().await?;
1143
1144    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1145        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1146    } else {
1147        let local_var_entity: Option<ListCustomInstanceDbsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1148        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1149        Err(Error::ResponseError(local_var_error))
1150    }
1151}
1152
1153pub async fn list_global_settings(configuration: &configuration::Configuration, ) -> Result<Vec<models::GlobalSetting>, Error<ListGlobalSettingsError>> {
1154    let local_var_configuration = configuration;
1155
1156    let local_var_client = &local_var_configuration.client;
1157
1158    let local_var_uri_str = format!("{}/settings/list_global", local_var_configuration.base_path);
1159    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1160
1161    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1162        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1163    }
1164    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1165        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1166    };
1167
1168    let local_var_req = local_var_req_builder.build()?;
1169    let local_var_resp = local_var_client.execute(local_var_req).await?;
1170
1171    let local_var_status = local_var_resp.status();
1172    let local_var_content = local_var_resp.text().await?;
1173
1174    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1175        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1176    } else {
1177        let local_var_entity: Option<ListGlobalSettingsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1178        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1179        Err(Error::ResponseError(local_var_error))
1180    }
1181}
1182
1183pub async fn migrate_secrets_from_aws_sm(configuration: &configuration::Configuration, aws_secrets_manager_settings: models::AwsSecretsManagerSettings) -> Result<models::SecretMigrationReport, Error<MigrateSecretsFromAwsSmError>> {
1184    let local_var_configuration = configuration;
1185
1186    let local_var_client = &local_var_configuration.client;
1187
1188    let local_var_uri_str = format!("{}/settings/migrate_secrets_from_aws_sm", local_var_configuration.base_path);
1189    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1190
1191    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1192        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1193    }
1194    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1195        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1196    };
1197    local_var_req_builder = local_var_req_builder.json(&aws_secrets_manager_settings);
1198
1199    let local_var_req = local_var_req_builder.build()?;
1200    let local_var_resp = local_var_client.execute(local_var_req).await?;
1201
1202    let local_var_status = local_var_resp.status();
1203    let local_var_content = local_var_resp.text().await?;
1204
1205    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1206        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1207    } else {
1208        let local_var_entity: Option<MigrateSecretsFromAwsSmError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1209        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1210        Err(Error::ResponseError(local_var_error))
1211    }
1212}
1213
1214pub async fn migrate_secrets_from_azure_kv(configuration: &configuration::Configuration, azure_key_vault_settings: models::AzureKeyVaultSettings) -> Result<models::SecretMigrationReport, Error<MigrateSecretsFromAzureKvError>> {
1215    let local_var_configuration = configuration;
1216
1217    let local_var_client = &local_var_configuration.client;
1218
1219    let local_var_uri_str = format!("{}/settings/migrate_secrets_from_azure_kv", local_var_configuration.base_path);
1220    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1221
1222    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1223        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1224    }
1225    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1226        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1227    };
1228    local_var_req_builder = local_var_req_builder.json(&azure_key_vault_settings);
1229
1230    let local_var_req = local_var_req_builder.build()?;
1231    let local_var_resp = local_var_client.execute(local_var_req).await?;
1232
1233    let local_var_status = local_var_resp.status();
1234    let local_var_content = local_var_resp.text().await?;
1235
1236    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1237        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1238    } else {
1239        let local_var_entity: Option<MigrateSecretsFromAzureKvError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1240        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1241        Err(Error::ResponseError(local_var_error))
1242    }
1243}
1244
1245pub async fn migrate_secrets_to_aws_sm(configuration: &configuration::Configuration, aws_secrets_manager_settings: models::AwsSecretsManagerSettings) -> Result<models::SecretMigrationReport, Error<MigrateSecretsToAwsSmError>> {
1246    let local_var_configuration = configuration;
1247
1248    let local_var_client = &local_var_configuration.client;
1249
1250    let local_var_uri_str = format!("{}/settings/migrate_secrets_to_aws_sm", local_var_configuration.base_path);
1251    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1252
1253    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1254        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1255    }
1256    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1257        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1258    };
1259    local_var_req_builder = local_var_req_builder.json(&aws_secrets_manager_settings);
1260
1261    let local_var_req = local_var_req_builder.build()?;
1262    let local_var_resp = local_var_client.execute(local_var_req).await?;
1263
1264    let local_var_status = local_var_resp.status();
1265    let local_var_content = local_var_resp.text().await?;
1266
1267    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1268        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1269    } else {
1270        let local_var_entity: Option<MigrateSecretsToAwsSmError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1271        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1272        Err(Error::ResponseError(local_var_error))
1273    }
1274}
1275
1276pub async fn migrate_secrets_to_azure_kv(configuration: &configuration::Configuration, azure_key_vault_settings: models::AzureKeyVaultSettings) -> Result<models::SecretMigrationReport, Error<MigrateSecretsToAzureKvError>> {
1277    let local_var_configuration = configuration;
1278
1279    let local_var_client = &local_var_configuration.client;
1280
1281    let local_var_uri_str = format!("{}/settings/migrate_secrets_to_azure_kv", local_var_configuration.base_path);
1282    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1283
1284    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1285        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1286    }
1287    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1288        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1289    };
1290    local_var_req_builder = local_var_req_builder.json(&azure_key_vault_settings);
1291
1292    let local_var_req = local_var_req_builder.build()?;
1293    let local_var_resp = local_var_client.execute(local_var_req).await?;
1294
1295    let local_var_status = local_var_resp.status();
1296    let local_var_content = local_var_resp.text().await?;
1297
1298    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1299        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1300    } else {
1301        let local_var_entity: Option<MigrateSecretsToAzureKvError> = 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 migrate_secrets_to_database(configuration: &configuration::Configuration, vault_settings: models::VaultSettings) -> Result<models::SecretMigrationReport, Error<MigrateSecretsToDatabaseError>> {
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/migrate_secrets_to_database", local_var_configuration.base_path);
1313    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1314
1315    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1316        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1317    }
1318    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1319        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1320    };
1321    local_var_req_builder = local_var_req_builder.json(&vault_settings);
1322
1323    let local_var_req = local_var_req_builder.build()?;
1324    let local_var_resp = local_var_client.execute(local_var_req).await?;
1325
1326    let local_var_status = local_var_resp.status();
1327    let local_var_content = local_var_resp.text().await?;
1328
1329    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1330        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1331    } else {
1332        let local_var_entity: Option<MigrateSecretsToDatabaseError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1333        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1334        Err(Error::ResponseError(local_var_error))
1335    }
1336}
1337
1338pub async fn migrate_secrets_to_vault(configuration: &configuration::Configuration, vault_settings: models::VaultSettings) -> Result<models::SecretMigrationReport, Error<MigrateSecretsToVaultError>> {
1339    let local_var_configuration = configuration;
1340
1341    let local_var_client = &local_var_configuration.client;
1342
1343    let local_var_uri_str = format!("{}/settings/migrate_secrets_to_vault", local_var_configuration.base_path);
1344    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1345
1346    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1347        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1348    }
1349    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1350        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1351    };
1352    local_var_req_builder = local_var_req_builder.json(&vault_settings);
1353
1354    let local_var_req = local_var_req_builder.build()?;
1355    let local_var_resp = local_var_client.execute(local_var_req).await?;
1356
1357    let local_var_status = local_var_resp.status();
1358    let local_var_content = local_var_resp.text().await?;
1359
1360    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1361        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1362    } else {
1363        let local_var_entity: Option<MigrateSecretsToVaultError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1364        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1365        Err(Error::ResponseError(local_var_error))
1366    }
1367}
1368
1369pub async fn refresh_custom_instance_user_pwd(configuration: &configuration::Configuration, ) -> Result<serde_json::Value, Error<RefreshCustomInstanceUserPwdError>> {
1370    let local_var_configuration = configuration;
1371
1372    let local_var_client = &local_var_configuration.client;
1373
1374    let local_var_uri_str = format!("{}/settings/refresh_custom_instance_user_pwd", local_var_configuration.base_path);
1375    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1376
1377    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1378        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1379    }
1380    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1381        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1382    };
1383
1384    let local_var_req = local_var_req_builder.build()?;
1385    let local_var_resp = local_var_client.execute(local_var_req).await?;
1386
1387    let local_var_status = local_var_resp.status();
1388    let local_var_content = local_var_resp.text().await?;
1389
1390    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1391        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1392    } else {
1393        let local_var_entity: Option<RefreshCustomInstanceUserPwdError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1394        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1395        Err(Error::ResponseError(local_var_error))
1396    }
1397}
1398
1399pub async fn renew_license_key(configuration: &configuration::Configuration, license_key: Option<&str>) -> Result<String, Error<RenewLicenseKeyError>> {
1400    let local_var_configuration = configuration;
1401
1402    let local_var_client = &local_var_configuration.client;
1403
1404    let local_var_uri_str = format!("{}/settings/renew_license_key", local_var_configuration.base_path);
1405    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1406
1407    if let Some(ref local_var_str) = license_key {
1408        local_var_req_builder = local_var_req_builder.query(&[("license_key", &local_var_str.to_string())]);
1409    }
1410    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1411        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1412    }
1413    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1414        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1415    };
1416
1417    let local_var_req = local_var_req_builder.build()?;
1418    let local_var_resp = local_var_client.execute(local_var_req).await?;
1419
1420    let local_var_status = local_var_resp.status();
1421    let local_var_content = local_var_resp.text().await?;
1422
1423    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1424        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1425    } else {
1426        let local_var_entity: Option<RenewLicenseKeyError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1427        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1428        Err(Error::ResponseError(local_var_error))
1429    }
1430}
1431
1432/// 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. Deprecated (#370): use POST /settings/restart_worker_pool/{worker_pool} instead.
1433pub async fn restart_worker_group(configuration: &configuration::Configuration, worker_group: &str) -> Result<String, Error<RestartWorkerGroupError>> {
1434    let local_var_configuration = configuration;
1435
1436    let local_var_client = &local_var_configuration.client;
1437
1438    let local_var_uri_str = format!("{}/settings/restart_worker_group/{worker_group}", local_var_configuration.base_path, worker_group=crate::apis::urlencode(worker_group));
1439    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1440
1441    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1442        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1443    }
1444    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1445        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1446    };
1447
1448    let local_var_req = local_var_req_builder.build()?;
1449    let local_var_resp = local_var_client.execute(local_var_req).await?;
1450
1451    let local_var_status = local_var_resp.status();
1452    let local_var_content = local_var_resp.text().await?;
1453
1454    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1455        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1456    } else {
1457        let local_var_entity: Option<RestartWorkerGroupError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1458        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1459        Err(Error::ResponseError(local_var_error))
1460    }
1461}
1462
1463/// Send a restart signal to all workers in the specified worker pool. Workers will gracefully shut down and are expected to be restarted by their supervisor. Requires devops role.
1464pub async fn restart_worker_pool(configuration: &configuration::Configuration, worker_pool: &str) -> Result<String, Error<RestartWorkerPoolError>> {
1465    let local_var_configuration = configuration;
1466
1467    let local_var_client = &local_var_configuration.client;
1468
1469    let local_var_uri_str = format!("{}/settings/restart_worker_pool/{worker_pool}", local_var_configuration.base_path, worker_pool=crate::apis::urlencode(worker_pool));
1470    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1471
1472    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1473        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1474    }
1475    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1476        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1477    };
1478
1479    let local_var_req = local_var_req_builder.build()?;
1480    let local_var_resp = local_var_client.execute(local_var_req).await?;
1481
1482    let local_var_status = local_var_resp.status();
1483    let local_var_content = local_var_resp.text().await?;
1484
1485    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1486        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1487    } else {
1488        let local_var_entity: Option<RestartWorkerPoolError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1489        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1490        Err(Error::ResponseError(local_var_error))
1491    }
1492}
1493
1494/// Revalidates the licence now instead of waiting for the periodic poll. Superadmin only. Never errors on a failed validation — the escalation ladder owns what failure means, so the resolved state is reported instead. `recovered` is true when this call cleared an existing failure (and therefore lifted read-only).
1495pub async fn revalidate_license(configuration: &configuration::Configuration, ) -> Result<models::RevalidateLicense200Response, Error<RevalidateLicenseError>> {
1496    let local_var_configuration = configuration;
1497
1498    let local_var_client = &local_var_configuration.client;
1499
1500    let local_var_uri_str = format!("{}/settings/revalidate_license", local_var_configuration.base_path);
1501    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1502
1503    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1504        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1505    }
1506    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1507        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1508    };
1509
1510    let local_var_req = local_var_req_builder.build()?;
1511    let local_var_resp = local_var_client.execute(local_var_req).await?;
1512
1513    let local_var_status = local_var_resp.status();
1514    let local_var_content = local_var_resp.text().await?;
1515
1516    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1517        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1518    } else {
1519        let local_var_entity: Option<RevalidateLicenseError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1520        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1521        Err(Error::ResponseError(local_var_error))
1522    }
1523}
1524
1525pub async fn run_log_cleanup(configuration: &configuration::Configuration, ) -> Result<String, Error<RunLogCleanupError>> {
1526    let local_var_configuration = configuration;
1527
1528    let local_var_client = &local_var_configuration.client;
1529
1530    let local_var_uri_str = format!("{}/settings/run_log_cleanup", local_var_configuration.base_path);
1531    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1532
1533    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1534        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1535    }
1536    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1537        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1538    };
1539
1540    let local_var_req = local_var_req_builder.build()?;
1541    let local_var_resp = local_var_client.execute(local_var_req).await?;
1542
1543    let local_var_status = local_var_resp.status();
1544    let local_var_content = local_var_resp.text().await?;
1545
1546    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1547        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1548    } else {
1549        let local_var_entity: Option<RunLogCleanupError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1550        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1551        Err(Error::ResponseError(local_var_error))
1552    }
1553}
1554
1555pub async fn save_saml_config(configuration: &configuration::Configuration, saml_config_request: models::SamlConfigRequest) -> Result<models::SamlConfig, Error<SaveSamlConfigError>> {
1556    let local_var_configuration = configuration;
1557
1558    let local_var_client = &local_var_configuration.client;
1559
1560    let local_var_uri_str = format!("{}/saml/config", local_var_configuration.base_path);
1561    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1562
1563    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1564        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1565    }
1566    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1567        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1568    };
1569    local_var_req_builder = local_var_req_builder.json(&saml_config_request);
1570
1571    let local_var_req = local_var_req_builder.build()?;
1572    let local_var_resp = local_var_client.execute(local_var_req).await?;
1573
1574    let local_var_status = local_var_resp.status();
1575    let local_var_content = local_var_resp.text().await?;
1576
1577    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1578        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1579    } else {
1580        let local_var_entity: Option<SaveSamlConfigError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1581        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1582        Err(Error::ResponseError(local_var_error))
1583    }
1584}
1585
1586pub async fn send_stats(configuration: &configuration::Configuration, ) -> Result<String, Error<SendStatsError>> {
1587    let local_var_configuration = configuration;
1588
1589    let local_var_client = &local_var_configuration.client;
1590
1591    let local_var_uri_str = format!("{}/settings/send_stats", local_var_configuration.base_path);
1592    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1593
1594    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1595        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1596    }
1597    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1598        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1599    };
1600
1601    let local_var_req = local_var_req_builder.build()?;
1602    let local_var_resp = local_var_client.execute(local_var_req).await?;
1603
1604    let local_var_status = local_var_resp.status();
1605    let local_var_content = local_var_resp.text().await?;
1606
1607    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1608        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1609    } else {
1610        let local_var_entity: Option<SendStatsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1611        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1612        Err(Error::ResponseError(local_var_error))
1613    }
1614}
1615
1616pub async fn set_global(configuration: &configuration::Configuration, key: &str, set_global_request: models::SetGlobalRequest) -> Result<String, Error<SetGlobalError>> {
1617    let local_var_configuration = configuration;
1618
1619    let local_var_client = &local_var_configuration.client;
1620
1621    let local_var_uri_str = format!("{}/settings/global/{key}", local_var_configuration.base_path, key=crate::apis::urlencode(key));
1622    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1623
1624    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1625        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1626    }
1627    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1628        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1629    };
1630    local_var_req_builder = local_var_req_builder.json(&set_global_request);
1631
1632    let local_var_req = local_var_req_builder.build()?;
1633    let local_var_resp = local_var_client.execute(local_var_req).await?;
1634
1635    let local_var_status = local_var_resp.status();
1636    let local_var_content = local_var_resp.text().await?;
1637
1638    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1639        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1640    } else {
1641        let local_var_entity: Option<SetGlobalError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1642        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1643        Err(Error::ResponseError(local_var_error))
1644    }
1645}
1646
1647pub async fn set_instance_config(configuration: &configuration::Configuration, instance_config: models::InstanceConfig) -> Result<String, Error<SetInstanceConfigError>> {
1648    let local_var_configuration = configuration;
1649
1650    let local_var_client = &local_var_configuration.client;
1651
1652    let local_var_uri_str = format!("{}/settings/instance_config", local_var_configuration.base_path);
1653    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
1654
1655    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1656        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1657    }
1658    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1659        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1660    };
1661    local_var_req_builder = local_var_req_builder.json(&instance_config);
1662
1663    let local_var_req = local_var_req_builder.build()?;
1664    let local_var_resp = local_var_client.execute(local_var_req).await?;
1665
1666    let local_var_status = local_var_resp.status();
1667    let local_var_content = local_var_resp.text().await?;
1668
1669    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1670        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1671    } else {
1672        let local_var_entity: Option<SetInstanceConfigError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1673        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1674        Err(Error::ResponseError(local_var_error))
1675    }
1676}
1677
1678pub async fn set_public_app_rate_limit(configuration: &configuration::Configuration, workspace: &str, set_public_app_rate_limit_request: models::SetPublicAppRateLimitRequest) -> Result<String, Error<SetPublicAppRateLimitError>> {
1679    let local_var_configuration = configuration;
1680
1681    let local_var_client = &local_var_configuration.client;
1682
1683    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/public_app_rate_limit", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1684    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1685
1686    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1687        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1688    }
1689    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1690        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1691    };
1692    local_var_req_builder = local_var_req_builder.json(&set_public_app_rate_limit_request);
1693
1694    let local_var_req = local_var_req_builder.build()?;
1695    let local_var_resp = local_var_client.execute(local_var_req).await?;
1696
1697    let local_var_status = local_var_resp.status();
1698    let local_var_content = local_var_resp.text().await?;
1699
1700    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1701        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1702    } else {
1703        let local_var_entity: Option<SetPublicAppRateLimitError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1704        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1705        Err(Error::ResponseError(local_var_error))
1706    }
1707}
1708
1709pub async fn setup_custom_instance_db(configuration: &configuration::Configuration, name: &str, setup_custom_instance_db_request: models::SetupCustomInstanceDbRequest) -> Result<models::CustomInstanceDb, Error<SetupCustomInstanceDbError>> {
1710    let local_var_configuration = configuration;
1711
1712    let local_var_client = &local_var_configuration.client;
1713
1714    let local_var_uri_str = format!("{}/settings/setup_custom_instance_pg_database/{name}", local_var_configuration.base_path, name=crate::apis::urlencode(name));
1715    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1716
1717    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1718        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1719    }
1720    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1721        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1722    };
1723    local_var_req_builder = local_var_req_builder.json(&setup_custom_instance_db_request);
1724
1725    let local_var_req = local_var_req_builder.build()?;
1726    let local_var_resp = local_var_client.execute(local_var_req).await?;
1727
1728    let local_var_status = local_var_resp.status();
1729    let local_var_content = local_var_resp.text().await?;
1730
1731    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1732        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1733    } else {
1734        let local_var_entity: Option<SetupCustomInstanceDbError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1735        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1736        Err(Error::ResponseError(local_var_error))
1737    }
1738}
1739
1740pub async fn test_aws_sm_backend(configuration: &configuration::Configuration, aws_secrets_manager_settings: models::AwsSecretsManagerSettings) -> Result<String, Error<TestAwsSmBackendError>> {
1741    let local_var_configuration = configuration;
1742
1743    let local_var_client = &local_var_configuration.client;
1744
1745    let local_var_uri_str = format!("{}/settings/test_aws_sm_backend", local_var_configuration.base_path);
1746    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1747
1748    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1749        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1750    }
1751    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1752        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1753    };
1754    local_var_req_builder = local_var_req_builder.json(&aws_secrets_manager_settings);
1755
1756    let local_var_req = local_var_req_builder.build()?;
1757    let local_var_resp = local_var_client.execute(local_var_req).await?;
1758
1759    let local_var_status = local_var_resp.status();
1760    let local_var_content = local_var_resp.text().await?;
1761
1762    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1763        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1764    } else {
1765        let local_var_entity: Option<TestAwsSmBackendError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1766        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1767        Err(Error::ResponseError(local_var_error))
1768    }
1769}
1770
1771pub async fn test_azure_kv_backend(configuration: &configuration::Configuration, azure_key_vault_settings: models::AzureKeyVaultSettings) -> Result<String, Error<TestAzureKvBackendError>> {
1772    let local_var_configuration = configuration;
1773
1774    let local_var_client = &local_var_configuration.client;
1775
1776    let local_var_uri_str = format!("{}/settings/test_azure_kv_backend", local_var_configuration.base_path);
1777    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1778
1779    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1780        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1781    }
1782    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1783        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1784    };
1785    local_var_req_builder = local_var_req_builder.json(&azure_key_vault_settings);
1786
1787    let local_var_req = local_var_req_builder.build()?;
1788    let local_var_resp = local_var_client.execute(local_var_req).await?;
1789
1790    let local_var_status = local_var_resp.status();
1791    let local_var_content = local_var_resp.text().await?;
1792
1793    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1794        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1795    } else {
1796        let local_var_entity: Option<TestAzureKvBackendError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1797        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1798        Err(Error::ResponseError(local_var_error))
1799    }
1800}
1801
1802pub async fn test_critical_channels(configuration: &configuration::Configuration, test_critical_channels_request_inner: Vec<models::TestCriticalChannelsRequestInner>) -> Result<String, Error<TestCriticalChannelsError>> {
1803    let local_var_configuration = configuration;
1804
1805    let local_var_client = &local_var_configuration.client;
1806
1807    let local_var_uri_str = format!("{}/settings/test_critical_channels", local_var_configuration.base_path);
1808    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1809
1810    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1811        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1812    }
1813    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1814        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1815    };
1816    local_var_req_builder = local_var_req_builder.json(&test_critical_channels_request_inner);
1817
1818    let local_var_req = local_var_req_builder.build()?;
1819    let local_var_resp = local_var_client.execute(local_var_req).await?;
1820
1821    let local_var_status = local_var_resp.status();
1822    let local_var_content = local_var_resp.text().await?;
1823
1824    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1825        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1826    } else {
1827        let local_var_entity: Option<TestCriticalChannelsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1828        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1829        Err(Error::ResponseError(local_var_error))
1830    }
1831}
1832
1833pub async fn test_license_key(configuration: &configuration::Configuration, test_license_key_request: models::TestLicenseKeyRequest) -> Result<String, Error<TestLicenseKeyError>> {
1834    let local_var_configuration = configuration;
1835
1836    let local_var_client = &local_var_configuration.client;
1837
1838    let local_var_uri_str = format!("{}/settings/test_license_key", local_var_configuration.base_path);
1839    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1840
1841    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1842        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1843    }
1844    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1845        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1846    };
1847    local_var_req_builder = local_var_req_builder.json(&test_license_key_request);
1848
1849    let local_var_req = local_var_req_builder.build()?;
1850    let local_var_resp = local_var_client.execute(local_var_req).await?;
1851
1852    let local_var_status = local_var_resp.status();
1853    let local_var_content = local_var_resp.text().await?;
1854
1855    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1856        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1857    } else {
1858        let local_var_entity: Option<TestLicenseKeyError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1859        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1860        Err(Error::ResponseError(local_var_error))
1861    }
1862}
1863
1864pub async fn test_metadata(configuration: &configuration::Configuration, body: &str) -> Result<String, Error<TestMetadataError>> {
1865    let local_var_configuration = configuration;
1866
1867    let local_var_client = &local_var_configuration.client;
1868
1869    let local_var_uri_str = format!("{}/saml/test_metadata", local_var_configuration.base_path);
1870    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1871
1872    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1873        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1874    }
1875    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1876        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1877    };
1878    local_var_req_builder = local_var_req_builder.json(&body);
1879
1880    let local_var_req = local_var_req_builder.build()?;
1881    let local_var_resp = local_var_client.execute(local_var_req).await?;
1882
1883    let local_var_status = local_var_resp.status();
1884    let local_var_content = local_var_resp.text().await?;
1885
1886    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1887        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1888    } else {
1889        let local_var_entity: Option<TestMetadataError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1890        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1891        Err(Error::ResponseError(local_var_error))
1892    }
1893}
1894
1895pub async fn test_object_storage_config(configuration: &configuration::Configuration, request_body: std::collections::HashMap<String, serde_json::Value>) -> Result<String, Error<TestObjectStorageConfigError>> {
1896    let local_var_configuration = configuration;
1897
1898    let local_var_client = &local_var_configuration.client;
1899
1900    let local_var_uri_str = format!("{}/settings/test_object_storage_config", local_var_configuration.base_path);
1901    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1902
1903    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1904        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1905    }
1906    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1907        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1908    };
1909    local_var_req_builder = local_var_req_builder.json(&request_body);
1910
1911    let local_var_req = local_var_req_builder.build()?;
1912    let local_var_resp = local_var_client.execute(local_var_req).await?;
1913
1914    let local_var_status = local_var_resp.status();
1915    let local_var_content = local_var_resp.text().await?;
1916
1917    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1918        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1919    } else {
1920        let local_var_entity: Option<TestObjectStorageConfigError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1921        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1922        Err(Error::ResponseError(local_var_error))
1923    }
1924}
1925
1926pub async fn test_secret_backend(configuration: &configuration::Configuration, vault_settings: models::VaultSettings) -> Result<String, Error<TestSecretBackendError>> {
1927    let local_var_configuration = configuration;
1928
1929    let local_var_client = &local_var_configuration.client;
1930
1931    let local_var_uri_str = format!("{}/settings/test_secret_backend", local_var_configuration.base_path);
1932    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1933
1934    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1935        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1936    }
1937    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1938        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1939    };
1940    local_var_req_builder = local_var_req_builder.json(&vault_settings);
1941
1942    let local_var_req = local_var_req_builder.build()?;
1943    let local_var_resp = local_var_client.execute(local_var_req).await?;
1944
1945    let local_var_status = local_var_resp.status();
1946    let local_var_content = local_var_resp.text().await?;
1947
1948    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1949        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1950    } else {
1951        let local_var_entity: Option<TestSecretBackendError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1952        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1953        Err(Error::ResponseError(local_var_error))
1954    }
1955}
1956
1957pub async fn test_smtp(configuration: &configuration::Configuration, test_smtp_request: models::TestSmtpRequest) -> Result<String, Error<TestSmtpError>> {
1958    let local_var_configuration = configuration;
1959
1960    let local_var_client = &local_var_configuration.client;
1961
1962    let local_var_uri_str = format!("{}/settings/test_smtp", local_var_configuration.base_path);
1963    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1964
1965    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1966        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1967    }
1968    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1969        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1970    };
1971    local_var_req_builder = local_var_req_builder.json(&test_smtp_request);
1972
1973    let local_var_req = local_var_req_builder.build()?;
1974    let local_var_resp = local_var_client.execute(local_var_req).await?;
1975
1976    let local_var_status = local_var_resp.status();
1977    let local_var_content = local_var_resp.text().await?;
1978
1979    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1980        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1981    } else {
1982        let local_var_entity: Option<TestSmtpError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1983        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1984        Err(Error::ResponseError(local_var_error))
1985    }
1986}
1987
1988pub async fn update_saml_metadata(configuration: &configuration::Configuration, ) -> Result<models::SamlConfig, Error<UpdateSamlMetadataError>> {
1989    let local_var_configuration = configuration;
1990
1991    let local_var_client = &local_var_configuration.client;
1992
1993    let local_var_uri_str = format!("{}/saml/update_metadata", local_var_configuration.base_path);
1994    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1995
1996    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1997        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1998    }
1999    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2000        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2001    };
2002
2003    let local_var_req = local_var_req_builder.build()?;
2004    let local_var_resp = local_var_client.execute(local_var_req).await?;
2005
2006    let local_var_status = local_var_resp.status();
2007    let local_var_content = local_var_resp.text().await?;
2008
2009    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2010        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2011    } else {
2012        let local_var_entity: Option<UpdateSamlMetadataError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2013        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2014        Err(Error::ResponseError(local_var_error))
2015    }
2016}
2017
2018pub async fn workspace_acknowledge_all_critical_alerts(configuration: &configuration::Configuration, workspace: &str) -> Result<String, Error<WorkspaceAcknowledgeAllCriticalAlertsError>> {
2019    let local_var_configuration = configuration;
2020
2021    let local_var_client = &local_var_configuration.client;
2022
2023    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/critical_alerts/acknowledge_all", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2024    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2025
2026    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2027        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2028    }
2029    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2030        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2031    };
2032
2033    let local_var_req = local_var_req_builder.build()?;
2034    let local_var_resp = local_var_client.execute(local_var_req).await?;
2035
2036    let local_var_status = local_var_resp.status();
2037    let local_var_content = local_var_resp.text().await?;
2038
2039    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2040        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2041    } else {
2042        let local_var_entity: Option<WorkspaceAcknowledgeAllCriticalAlertsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2043        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2044        Err(Error::ResponseError(local_var_error))
2045    }
2046}
2047
2048pub async fn workspace_acknowledge_critical_alert(configuration: &configuration::Configuration, workspace: &str, id: i32) -> Result<String, Error<WorkspaceAcknowledgeCriticalAlertError>> {
2049    let local_var_configuration = configuration;
2050
2051    let local_var_client = &local_var_configuration.client;
2052
2053    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);
2054    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2055
2056    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2057        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2058    }
2059    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2060        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2061    };
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<WorkspaceAcknowledgeCriticalAlertError> = 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 workspace_get_critical_alerts(configuration: &configuration::Configuration, workspace: &str, page: Option<i32>, page_size: Option<i32>, acknowledged: Option<bool>) -> Result<models::GetCriticalAlerts200Response, Error<WorkspaceGetCriticalAlertsError>> {
2079    let local_var_configuration = configuration;
2080
2081    let local_var_client = &local_var_configuration.client;
2082
2083    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/critical_alerts", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2084    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2085
2086    if let Some(ref local_var_str) = page {
2087        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
2088    }
2089    if let Some(ref local_var_str) = page_size {
2090        local_var_req_builder = local_var_req_builder.query(&[("page_size", &local_var_str.to_string())]);
2091    }
2092    if let Some(ref local_var_str) = acknowledged {
2093        local_var_req_builder = local_var_req_builder.query(&[("acknowledged", &local_var_str.to_string())]);
2094    }
2095    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2096        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2097    }
2098    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2099        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2100    };
2101
2102    let local_var_req = local_var_req_builder.build()?;
2103    let local_var_resp = local_var_client.execute(local_var_req).await?;
2104
2105    let local_var_status = local_var_resp.status();
2106    let local_var_content = local_var_resp.text().await?;
2107
2108    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2109        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2110    } else {
2111        let local_var_entity: Option<WorkspaceGetCriticalAlertsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2112        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2113        Err(Error::ResponseError(local_var_error))
2114    }
2115}
2116
2117pub async fn workspace_mute_critical_alerts_ui(configuration: &configuration::Configuration, workspace: &str, workspace_mute_critical_alerts_ui_request: models::WorkspaceMuteCriticalAlertsUiRequest) -> Result<String, Error<WorkspaceMuteCriticalAlertsUiError>> {
2118    let local_var_configuration = configuration;
2119
2120    let local_var_client = &local_var_configuration.client;
2121
2122    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/critical_alerts/mute", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2123    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2124
2125    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2126        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2127    }
2128    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2129        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2130    };
2131    local_var_req_builder = local_var_req_builder.json(&workspace_mute_critical_alerts_ui_request);
2132
2133    let local_var_req = local_var_req_builder.build()?;
2134    let local_var_resp = local_var_client.execute(local_var_req).await?;
2135
2136    let local_var_status = local_var_resp.status();
2137    let local_var_content = local_var_resp.text().await?;
2138
2139    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2140        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2141    } else {
2142        let local_var_entity: Option<WorkspaceMuteCriticalAlertsUiError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2143        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2144        Err(Error::ResponseError(local_var_error))
2145    }
2146}
2147