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