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