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: 1.6.0
7 * Contact: contact@orvanta.cloud
8 * Generated by: https://openapi-generator.tech
9 */
10
11
12use reqwest;
13use serde::{Deserialize, Serialize};
14use crate::{apis::ResponseContent, models};
15use super::{Error, configuration};
16
17
18/// struct for typed errors of method [`acknowledge_all_critical_alerts`]
19#[derive(Debug, Clone, Serialize, Deserialize)]
20#[serde(untagged)]
21pub enum AcknowledgeAllCriticalAlertsError {
22    UnknownValue(serde_json::Value),
23}
24
25/// struct for typed errors of method [`acknowledge_critical_alert`]
26#[derive(Debug, Clone, Serialize, Deserialize)]
27#[serde(untagged)]
28pub enum AcknowledgeCriticalAlertError {
29    UnknownValue(serde_json::Value),
30}
31
32/// struct for typed errors of method [`compute_object_storage_usage`]
33#[derive(Debug, Clone, Serialize, Deserialize)]
34#[serde(untagged)]
35pub enum ComputeObjectStorageUsageError {
36    UnknownValue(serde_json::Value),
37}
38
39/// struct for typed errors of method [`create_customer_portal_session`]
40#[derive(Debug, Clone, Serialize, Deserialize)]
41#[serde(untagged)]
42pub enum CreateCustomerPortalSessionError {
43    UnknownValue(serde_json::Value),
44}
45
46/// struct for typed errors of method [`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_secondary_storage_names`]
124#[derive(Debug, Clone, Serialize, Deserialize)]
125#[serde(untagged)]
126pub enum GetSecondaryStorageNamesError {
127    UnknownValue(serde_json::Value),
128}
129
130/// struct for typed errors of method [`get_stats`]
131#[derive(Debug, Clone, Serialize, Deserialize)]
132#[serde(untagged)]
133pub enum GetStatsError {
134    UnknownValue(serde_json::Value),
135}
136
137/// struct for typed errors of method [`list_custom_instance_dbs`]
138#[derive(Debug, Clone, Serialize, Deserialize)]
139#[serde(untagged)]
140pub enum ListCustomInstanceDbsError {
141    UnknownValue(serde_json::Value),
142}
143
144/// struct for typed errors of method [`list_global_settings`]
145#[derive(Debug, Clone, Serialize, Deserialize)]
146#[serde(untagged)]
147pub enum ListGlobalSettingsError {
148    UnknownValue(serde_json::Value),
149}
150
151/// struct for typed errors of method [`migrate_secrets_from_aws_sm`]
152#[derive(Debug, Clone, Serialize, Deserialize)]
153#[serde(untagged)]
154pub enum MigrateSecretsFromAwsSmError {
155    UnknownValue(serde_json::Value),
156}
157
158/// struct for typed errors of method [`migrate_secrets_from_azure_kv`]
159#[derive(Debug, Clone, Serialize, Deserialize)]
160#[serde(untagged)]
161pub enum MigrateSecretsFromAzureKvError {
162    UnknownValue(serde_json::Value),
163}
164
165/// struct for typed errors of method [`migrate_secrets_to_aws_sm`]
166#[derive(Debug, Clone, Serialize, Deserialize)]
167#[serde(untagged)]
168pub enum MigrateSecretsToAwsSmError {
169    UnknownValue(serde_json::Value),
170}
171
172/// struct for typed errors of method [`migrate_secrets_to_azure_kv`]
173#[derive(Debug, Clone, Serialize, Deserialize)]
174#[serde(untagged)]
175pub enum MigrateSecretsToAzureKvError {
176    UnknownValue(serde_json::Value),
177}
178
179/// struct for typed errors of method [`migrate_secrets_to_database`]
180#[derive(Debug, Clone, Serialize, Deserialize)]
181#[serde(untagged)]
182pub enum MigrateSecretsToDatabaseError {
183    UnknownValue(serde_json::Value),
184}
185
186/// struct for typed errors of method [`migrate_secrets_to_vault`]
187#[derive(Debug, Clone, Serialize, Deserialize)]
188#[serde(untagged)]
189pub enum MigrateSecretsToVaultError {
190    UnknownValue(serde_json::Value),
191}
192
193/// struct for typed errors of method [`refresh_custom_instance_user_pwd`]
194#[derive(Debug, Clone, Serialize, Deserialize)]
195#[serde(untagged)]
196pub enum RefreshCustomInstanceUserPwdError {
197    UnknownValue(serde_json::Value),
198}
199
200/// struct for typed errors of method [`renew_license_key`]
201#[derive(Debug, Clone, Serialize, Deserialize)]
202#[serde(untagged)]
203pub enum RenewLicenseKeyError {
204    UnknownValue(serde_json::Value),
205}
206
207/// struct for typed errors of method [`restart_worker_group`]
208#[derive(Debug, Clone, Serialize, Deserialize)]
209#[serde(untagged)]
210pub enum RestartWorkerGroupError {
211    UnknownValue(serde_json::Value),
212}
213
214/// struct for typed errors of method [`revalidate_license`]
215#[derive(Debug, Clone, Serialize, Deserialize)]
216#[serde(untagged)]
217pub enum RevalidateLicenseError {
218    UnknownValue(serde_json::Value),
219}
220
221/// struct for typed errors of method [`run_log_cleanup`]
222#[derive(Debug, Clone, Serialize, Deserialize)]
223#[serde(untagged)]
224pub enum RunLogCleanupError {
225    UnknownValue(serde_json::Value),
226}
227
228/// struct for typed errors of method [`send_stats`]
229#[derive(Debug, Clone, Serialize, Deserialize)]
230#[serde(untagged)]
231pub enum SendStatsError {
232    UnknownValue(serde_json::Value),
233}
234
235/// struct for typed errors of method [`set_global`]
236#[derive(Debug, Clone, Serialize, Deserialize)]
237#[serde(untagged)]
238pub enum SetGlobalError {
239    UnknownValue(serde_json::Value),
240}
241
242/// struct for typed errors of method [`set_instance_config`]
243#[derive(Debug, Clone, Serialize, Deserialize)]
244#[serde(untagged)]
245pub enum SetInstanceConfigError {
246    UnknownValue(serde_json::Value),
247}
248
249/// struct for typed errors of method [`set_public_app_rate_limit`]
250#[derive(Debug, Clone, Serialize, Deserialize)]
251#[serde(untagged)]
252pub enum SetPublicAppRateLimitError {
253    UnknownValue(serde_json::Value),
254}
255
256/// struct for typed errors of method [`setup_custom_instance_db`]
257#[derive(Debug, Clone, Serialize, Deserialize)]
258#[serde(untagged)]
259pub enum SetupCustomInstanceDbError {
260    UnknownValue(serde_json::Value),
261}
262
263/// struct for typed errors of method [`test_aws_sm_backend`]
264#[derive(Debug, Clone, Serialize, Deserialize)]
265#[serde(untagged)]
266pub enum TestAwsSmBackendError {
267    UnknownValue(serde_json::Value),
268}
269
270/// struct for typed errors of method [`test_azure_kv_backend`]
271#[derive(Debug, Clone, Serialize, Deserialize)]
272#[serde(untagged)]
273pub enum TestAzureKvBackendError {
274    UnknownValue(serde_json::Value),
275}
276
277/// struct for typed errors of method [`test_critical_channels`]
278#[derive(Debug, Clone, Serialize, Deserialize)]
279#[serde(untagged)]
280pub enum TestCriticalChannelsError {
281    UnknownValue(serde_json::Value),
282}
283
284/// struct for typed errors of method [`test_license_key`]
285#[derive(Debug, Clone, Serialize, Deserialize)]
286#[serde(untagged)]
287pub enum TestLicenseKeyError {
288    UnknownValue(serde_json::Value),
289}
290
291/// struct for typed errors of method [`test_metadata`]
292#[derive(Debug, Clone, Serialize, Deserialize)]
293#[serde(untagged)]
294pub enum TestMetadataError {
295    UnknownValue(serde_json::Value),
296}
297
298/// struct for typed errors of method [`test_object_storage_config`]
299#[derive(Debug, Clone, Serialize, Deserialize)]
300#[serde(untagged)]
301pub enum TestObjectStorageConfigError {
302    UnknownValue(serde_json::Value),
303}
304
305/// struct for typed errors of method [`test_secret_backend`]
306#[derive(Debug, Clone, Serialize, Deserialize)]
307#[serde(untagged)]
308pub enum TestSecretBackendError {
309    UnknownValue(serde_json::Value),
310}
311
312/// struct for typed errors of method [`test_smtp`]
313#[derive(Debug, Clone, Serialize, Deserialize)]
314#[serde(untagged)]
315pub enum TestSmtpError {
316    UnknownValue(serde_json::Value),
317}
318
319/// struct for typed errors of method [`workspace_acknowledge_all_critical_alerts`]
320#[derive(Debug, Clone, Serialize, Deserialize)]
321#[serde(untagged)]
322pub enum WorkspaceAcknowledgeAllCriticalAlertsError {
323    UnknownValue(serde_json::Value),
324}
325
326/// struct for typed errors of method [`workspace_acknowledge_critical_alert`]
327#[derive(Debug, Clone, Serialize, Deserialize)]
328#[serde(untagged)]
329pub enum WorkspaceAcknowledgeCriticalAlertError {
330    UnknownValue(serde_json::Value),
331}
332
333/// struct for typed errors of method [`workspace_get_critical_alerts`]
334#[derive(Debug, Clone, Serialize, Deserialize)]
335#[serde(untagged)]
336pub enum WorkspaceGetCriticalAlertsError {
337    UnknownValue(serde_json::Value),
338}
339
340/// struct for typed errors of method [`workspace_mute_critical_alerts_ui`]
341#[derive(Debug, Clone, Serialize, Deserialize)]
342#[serde(untagged)]
343pub enum WorkspaceMuteCriticalAlertsUiError {
344    UnknownValue(serde_json::Value),
345}
346
347
348pub async fn acknowledge_all_critical_alerts(configuration: &configuration::Configuration, ) -> Result<String, Error<AcknowledgeAllCriticalAlertsError>> {
349    let local_var_configuration = configuration;
350
351    let local_var_client = &local_var_configuration.client;
352
353    let local_var_uri_str = format!("{}/settings/critical_alerts/acknowledge_all", local_var_configuration.base_path);
354    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
355
356    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
357        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
358    }
359    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
360        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
361    };
362
363    let local_var_req = local_var_req_builder.build()?;
364    let local_var_resp = local_var_client.execute(local_var_req).await?;
365
366    let local_var_status = local_var_resp.status();
367    let local_var_content = local_var_resp.text().await?;
368
369    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
370        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
371    } else {
372        let local_var_entity: Option<AcknowledgeAllCriticalAlertsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
373        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
374        Err(Error::ResponseError(local_var_error))
375    }
376}
377
378pub async fn acknowledge_critical_alert(configuration: &configuration::Configuration, id: i32) -> Result<String, Error<AcknowledgeCriticalAlertError>> {
379    let local_var_configuration = configuration;
380
381    let local_var_client = &local_var_configuration.client;
382
383    let local_var_uri_str = format!("{}/settings/critical_alerts/{id}/acknowledge", local_var_configuration.base_path, id=id);
384    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
385
386    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
387        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
388    }
389    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
390        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
391    };
392
393    let local_var_req = local_var_req_builder.build()?;
394    let local_var_resp = local_var_client.execute(local_var_req).await?;
395
396    let local_var_status = local_var_resp.status();
397    let local_var_content = local_var_resp.text().await?;
398
399    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
400        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
401    } else {
402        let local_var_entity: Option<AcknowledgeCriticalAlertError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
403        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
404        Err(Error::ResponseError(local_var_error))
405    }
406}
407
408pub async fn compute_object_storage_usage(configuration: &configuration::Configuration, ) -> Result<String, Error<ComputeObjectStorageUsageError>> {
409    let local_var_configuration = configuration;
410
411    let local_var_client = &local_var_configuration.client;
412
413    let local_var_uri_str = format!("{}/settings/object_storage_usage", local_var_configuration.base_path);
414    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
415
416    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
417        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
418    }
419    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
420        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
421    };
422
423    let local_var_req = local_var_req_builder.build()?;
424    let local_var_resp = local_var_client.execute(local_var_req).await?;
425
426    let local_var_status = local_var_resp.status();
427    let local_var_content = local_var_resp.text().await?;
428
429    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
430        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
431    } else {
432        let local_var_entity: Option<ComputeObjectStorageUsageError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
433        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
434        Err(Error::ResponseError(local_var_error))
435    }
436}
437
438pub async fn create_customer_portal_session(configuration: &configuration::Configuration, license_key: Option<&str>) -> Result<String, Error<CreateCustomerPortalSessionError>> {
439    let local_var_configuration = configuration;
440
441    let local_var_client = &local_var_configuration.client;
442
443    let local_var_uri_str = format!("{}/settings/customer_portal", local_var_configuration.base_path);
444    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
445
446    if let Some(ref local_var_str) = license_key {
447        local_var_req_builder = local_var_req_builder.query(&[("license_key", &local_var_str.to_string())]);
448    }
449    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
450        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
451    }
452    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
453        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
454    };
455
456    let local_var_req = local_var_req_builder.build()?;
457    let local_var_resp = local_var_client.execute(local_var_req).await?;
458
459    let local_var_status = local_var_resp.status();
460    let local_var_content = local_var_resp.text().await?;
461
462    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
463        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
464    } else {
465        let local_var_entity: Option<CreateCustomerPortalSessionError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
466        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
467        Err(Error::ResponseError(local_var_error))
468    }
469}
470
471pub async fn drop_custom_instance_db(configuration: &configuration::Configuration, name: &str) -> Result<String, Error<DropCustomInstanceDbError>> {
472    let local_var_configuration = configuration;
473
474    let local_var_client = &local_var_configuration.client;
475
476    let local_var_uri_str = format!("{}/settings/drop_custom_instance_pg_database/{name}", local_var_configuration.base_path, name=crate::apis::urlencode(name));
477    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
478
479    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
480        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
481    }
482    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
483        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
484    };
485
486    let local_var_req = local_var_req_builder.build()?;
487    let local_var_resp = local_var_client.execute(local_var_req).await?;
488
489    let local_var_status = local_var_resp.status();
490    let local_var_content = local_var_resp.text().await?;
491
492    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
493        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
494    } else {
495        let local_var_entity: Option<DropCustomInstanceDbError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
496        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
497        Err(Error::ResponseError(local_var_error))
498    }
499}
500
501pub async fn get_critical_alerts(configuration: &configuration::Configuration, page: Option<i32>, page_size: Option<i32>, acknowledged: Option<bool>) -> Result<models::GetCriticalAlerts200Response, Error<GetCriticalAlertsError>> {
502    let local_var_configuration = configuration;
503
504    let local_var_client = &local_var_configuration.client;
505
506    let local_var_uri_str = format!("{}/settings/critical_alerts", local_var_configuration.base_path);
507    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
508
509    if let Some(ref local_var_str) = page {
510        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
511    }
512    if let Some(ref local_var_str) = page_size {
513        local_var_req_builder = local_var_req_builder.query(&[("page_size", &local_var_str.to_string())]);
514    }
515    if let Some(ref local_var_str) = acknowledged {
516        local_var_req_builder = local_var_req_builder.query(&[("acknowledged", &local_var_str.to_string())]);
517    }
518    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
519        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
520    }
521    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
522        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
523    };
524
525    let local_var_req = local_var_req_builder.build()?;
526    let local_var_resp = local_var_client.execute(local_var_req).await?;
527
528    let local_var_status = local_var_resp.status();
529    let local_var_content = local_var_resp.text().await?;
530
531    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
532        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
533    } else {
534        let local_var_entity: Option<GetCriticalAlertsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
535        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
536        Err(Error::ResponseError(local_var_error))
537    }
538}
539
540pub async fn get_global(configuration: &configuration::Configuration, key: &str) -> Result<serde_json::Value, Error<GetGlobalError>> {
541    let local_var_configuration = configuration;
542
543    let local_var_client = &local_var_configuration.client;
544
545    let local_var_uri_str = format!("{}/settings/global/{key}", local_var_configuration.base_path, key=crate::apis::urlencode(key));
546    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
547
548    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
549        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
550    }
551    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
552        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
553    };
554
555    let local_var_req = local_var_req_builder.build()?;
556    let local_var_resp = local_var_client.execute(local_var_req).await?;
557
558    let local_var_status = local_var_resp.status();
559    let local_var_content = local_var_resp.text().await?;
560
561    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
562        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
563    } else {
564        let local_var_entity: Option<GetGlobalError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
565        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
566        Err(Error::ResponseError(local_var_error))
567    }
568}
569
570pub async fn get_instance_config(configuration: &configuration::Configuration, ) -> Result<models::InstanceConfig, Error<GetInstanceConfigError>> {
571    let local_var_configuration = configuration;
572
573    let local_var_client = &local_var_configuration.client;
574
575    let local_var_uri_str = format!("{}/settings/instance_config", local_var_configuration.base_path);
576    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
577
578    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
579        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
580    }
581    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
582        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
583    };
584
585    let local_var_req = local_var_req_builder.build()?;
586    let local_var_resp = local_var_client.execute(local_var_req).await?;
587
588    let local_var_status = local_var_resp.status();
589    let local_var_content = local_var_resp.text().await?;
590
591    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
592        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
593    } else {
594        let local_var_entity: Option<GetInstanceConfigError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
595        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
596        Err(Error::ResponseError(local_var_error))
597    }
598}
599
600pub async fn get_jwks(configuration: &configuration::Configuration, ) -> Result<models::JwksResponse, Error<GetJwksError>> {
601    let local_var_configuration = configuration;
602
603    let local_var_client = &local_var_configuration.client;
604
605    let local_var_uri_str = format!("{}/.well-known/jwks.json", local_var_configuration.base_path);
606    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
607
608    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
609        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
610    }
611    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
612        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
613    };
614
615    let local_var_req = local_var_req_builder.build()?;
616    let local_var_resp = local_var_client.execute(local_var_req).await?;
617
618    let local_var_status = local_var_resp.status();
619    let local_var_content = local_var_resp.text().await?;
620
621    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
622        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
623    } else {
624        let local_var_entity: Option<GetJwksError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
625        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
626        Err(Error::ResponseError(local_var_error))
627    }
628}
629
630pub async fn get_latest_key_renewal_attempt(configuration: &configuration::Configuration, ) -> Result<models::GetLatestKeyRenewalAttempt200Response, Error<GetLatestKeyRenewalAttemptError>> {
631    let local_var_configuration = configuration;
632
633    let local_var_client = &local_var_configuration.client;
634
635    let local_var_uri_str = format!("{}/settings/latest_key_renewal_attempt", local_var_configuration.base_path);
636    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
637
638    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
639        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
640    }
641    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
642        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
643    };
644
645    let local_var_req = local_var_req_builder.build()?;
646    let local_var_resp = local_var_client.execute(local_var_req).await?;
647
648    let local_var_status = local_var_resp.status();
649    let local_var_content = local_var_resp.text().await?;
650
651    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
652        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
653    } else {
654        let local_var_entity: Option<GetLatestKeyRenewalAttemptError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
655        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
656        Err(Error::ResponseError(local_var_error))
657    }
658}
659
660pub async fn get_local(configuration: &configuration::Configuration, ) -> Result<serde_json::Value, Error<GetLocalError>> {
661    let local_var_configuration = configuration;
662
663    let local_var_client = &local_var_configuration.client;
664
665    let local_var_uri_str = format!("{}/settings/local", local_var_configuration.base_path);
666    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
667
668    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
669        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
670    }
671    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
672        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
673    };
674
675    let local_var_req = local_var_req_builder.build()?;
676    let local_var_resp = local_var_client.execute(local_var_req).await?;
677
678    let local_var_status = local_var_resp.status();
679    let local_var_content = local_var_resp.text().await?;
680
681    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
682        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
683    } else {
684        let local_var_entity: Option<GetLocalError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
685        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
686        Err(Error::ResponseError(local_var_error))
687    }
688}
689
690pub async fn get_log_cleanup_status(configuration: &configuration::Configuration, ) -> Result<models::GetLogCleanupStatus200Response, Error<GetLogCleanupStatusError>> {
691    let local_var_configuration = configuration;
692
693    let local_var_client = &local_var_configuration.client;
694
695    let local_var_uri_str = format!("{}/settings/log_cleanup_status", local_var_configuration.base_path);
696    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
697
698    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
699        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
700    }
701    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
702        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
703    };
704
705    let local_var_req = local_var_req_builder.build()?;
706    let local_var_resp = local_var_client.execute(local_var_req).await?;
707
708    let local_var_status = local_var_resp.status();
709    let local_var_content = local_var_resp.text().await?;
710
711    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
712        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
713    } else {
714        let local_var_entity: Option<GetLogCleanupStatusError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
715        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
716        Err(Error::ResponseError(local_var_error))
717    }
718}
719
720pub async fn get_min_keep_alive_version(configuration: &configuration::Configuration, ) -> Result<models::GetMinKeepAliveVersion200Response, Error<GetMinKeepAliveVersionError>> {
721    let local_var_configuration = configuration;
722
723    let local_var_client = &local_var_configuration.client;
724
725    let local_var_uri_str = format!("{}/min_keep_alive_version", local_var_configuration.base_path);
726    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
727
728    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
729        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
730    }
731    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
732        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
733    };
734
735    let local_var_req = local_var_req_builder.build()?;
736    let local_var_resp = local_var_client.execute(local_var_req).await?;
737
738    let local_var_status = local_var_resp.status();
739    let local_var_content = local_var_resp.text().await?;
740
741    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
742        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
743    } else {
744        let local_var_entity: Option<GetMinKeepAliveVersionError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
745        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
746        Err(Error::ResponseError(local_var_error))
747    }
748}
749
750pub async fn get_object_storage_usage(configuration: &configuration::Configuration, ) -> Result<models::GetObjectStorageUsage200Response, Error<GetObjectStorageUsageError>> {
751    let local_var_configuration = configuration;
752
753    let local_var_client = &local_var_configuration.client;
754
755    let local_var_uri_str = format!("{}/settings/object_storage_usage", local_var_configuration.base_path);
756    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
757
758    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
759        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
760    }
761    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
762        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
763    };
764
765    let local_var_req = local_var_req_builder.build()?;
766    let local_var_resp = local_var_client.execute(local_var_req).await?;
767
768    let local_var_status = local_var_resp.status();
769    let local_var_content = local_var_resp.text().await?;
770
771    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
772        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
773    } else {
774        let local_var_entity: Option<GetObjectStorageUsageError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
775        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
776        Err(Error::ResponseError(local_var_error))
777    }
778}
779
780/// 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. 
781pub async fn get_ruff_config(configuration: &configuration::Configuration, ) -> Result<String, Error<GetRuffConfigError>> {
782    let local_var_configuration = configuration;
783
784    let local_var_client = &local_var_configuration.client;
785
786    let local_var_uri_str = format!("{}/settings_u/ruff_config", local_var_configuration.base_path);
787    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
788
789    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
790        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
791    }
792    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
793        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
794    };
795
796    let local_var_req = local_var_req_builder.build()?;
797    let local_var_resp = local_var_client.execute(local_var_req).await?;
798
799    let local_var_status = local_var_resp.status();
800    let local_var_content = local_var_resp.text().await?;
801
802    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
803        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
804    } else {
805        let local_var_entity: Option<GetRuffConfigError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
806        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
807        Err(Error::ResponseError(local_var_error))
808    }
809}
810
811pub async fn get_secondary_storage_names(configuration: &configuration::Configuration, workspace: &str, include_default: Option<bool>) -> Result<Vec<String>, Error<GetSecondaryStorageNamesError>> {
812    let local_var_configuration = configuration;
813
814    let local_var_client = &local_var_configuration.client;
815
816    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_secondary_storage_names", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
817    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
818
819    if let Some(ref local_var_str) = include_default {
820        local_var_req_builder = local_var_req_builder.query(&[("include_default", &local_var_str.to_string())]);
821    }
822    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
823        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
824    }
825    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
826        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
827    };
828
829    let local_var_req = local_var_req_builder.build()?;
830    let local_var_resp = local_var_client.execute(local_var_req).await?;
831
832    let local_var_status = local_var_resp.status();
833    let local_var_content = local_var_resp.text().await?;
834
835    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
836        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
837    } else {
838        let local_var_entity: Option<GetSecondaryStorageNamesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
839        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
840        Err(Error::ResponseError(local_var_error))
841    }
842}
843
844pub async fn get_stats(configuration: &configuration::Configuration, ) -> Result<models::GetStats200Response, Error<GetStatsError>> {
845    let local_var_configuration = configuration;
846
847    let local_var_client = &local_var_configuration.client;
848
849    let local_var_uri_str = format!("{}/settings/get_stats", local_var_configuration.base_path);
850    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
851
852    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
853        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
854    }
855    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
856        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
857    };
858
859    let local_var_req = local_var_req_builder.build()?;
860    let local_var_resp = local_var_client.execute(local_var_req).await?;
861
862    let local_var_status = local_var_resp.status();
863    let local_var_content = local_var_resp.text().await?;
864
865    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
866        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
867    } else {
868        let local_var_entity: Option<GetStatsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
869        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
870        Err(Error::ResponseError(local_var_error))
871    }
872}
873
874pub async fn list_custom_instance_dbs(configuration: &configuration::Configuration, ) -> Result<std::collections::HashMap<String, models::CustomInstanceDb>, Error<ListCustomInstanceDbsError>> {
875    let local_var_configuration = configuration;
876
877    let local_var_client = &local_var_configuration.client;
878
879    let local_var_uri_str = format!("{}/settings/list_custom_instance_pg_databases", local_var_configuration.base_path);
880    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
881
882    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
883        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
884    }
885    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
886        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
887    };
888
889    let local_var_req = local_var_req_builder.build()?;
890    let local_var_resp = local_var_client.execute(local_var_req).await?;
891
892    let local_var_status = local_var_resp.status();
893    let local_var_content = local_var_resp.text().await?;
894
895    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
896        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
897    } else {
898        let local_var_entity: Option<ListCustomInstanceDbsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
899        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
900        Err(Error::ResponseError(local_var_error))
901    }
902}
903
904pub async fn list_global_settings(configuration: &configuration::Configuration, ) -> Result<Vec<models::GlobalSetting>, Error<ListGlobalSettingsError>> {
905    let local_var_configuration = configuration;
906
907    let local_var_client = &local_var_configuration.client;
908
909    let local_var_uri_str = format!("{}/settings/list_global", local_var_configuration.base_path);
910    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
911
912    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
913        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
914    }
915    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
916        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
917    };
918
919    let local_var_req = local_var_req_builder.build()?;
920    let local_var_resp = local_var_client.execute(local_var_req).await?;
921
922    let local_var_status = local_var_resp.status();
923    let local_var_content = local_var_resp.text().await?;
924
925    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
926        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
927    } else {
928        let local_var_entity: Option<ListGlobalSettingsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
929        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
930        Err(Error::ResponseError(local_var_error))
931    }
932}
933
934pub async fn migrate_secrets_from_aws_sm(configuration: &configuration::Configuration, aws_secrets_manager_settings: models::AwsSecretsManagerSettings) -> Result<models::SecretMigrationReport, Error<MigrateSecretsFromAwsSmError>> {
935    let local_var_configuration = configuration;
936
937    let local_var_client = &local_var_configuration.client;
938
939    let local_var_uri_str = format!("{}/settings/migrate_secrets_from_aws_sm", local_var_configuration.base_path);
940    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
941
942    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
943        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
944    }
945    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
946        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
947    };
948    local_var_req_builder = local_var_req_builder.json(&aws_secrets_manager_settings);
949
950    let local_var_req = local_var_req_builder.build()?;
951    let local_var_resp = local_var_client.execute(local_var_req).await?;
952
953    let local_var_status = local_var_resp.status();
954    let local_var_content = local_var_resp.text().await?;
955
956    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
957        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
958    } else {
959        let local_var_entity: Option<MigrateSecretsFromAwsSmError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
960        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
961        Err(Error::ResponseError(local_var_error))
962    }
963}
964
965pub async fn migrate_secrets_from_azure_kv(configuration: &configuration::Configuration, azure_key_vault_settings: models::AzureKeyVaultSettings) -> Result<models::SecretMigrationReport, Error<MigrateSecretsFromAzureKvError>> {
966    let local_var_configuration = configuration;
967
968    let local_var_client = &local_var_configuration.client;
969
970    let local_var_uri_str = format!("{}/settings/migrate_secrets_from_azure_kv", local_var_configuration.base_path);
971    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
972
973    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
974        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
975    }
976    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
977        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
978    };
979    local_var_req_builder = local_var_req_builder.json(&azure_key_vault_settings);
980
981    let local_var_req = local_var_req_builder.build()?;
982    let local_var_resp = local_var_client.execute(local_var_req).await?;
983
984    let local_var_status = local_var_resp.status();
985    let local_var_content = local_var_resp.text().await?;
986
987    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
988        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
989    } else {
990        let local_var_entity: Option<MigrateSecretsFromAzureKvError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
991        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
992        Err(Error::ResponseError(local_var_error))
993    }
994}
995
996pub async fn migrate_secrets_to_aws_sm(configuration: &configuration::Configuration, aws_secrets_manager_settings: models::AwsSecretsManagerSettings) -> Result<models::SecretMigrationReport, Error<MigrateSecretsToAwsSmError>> {
997    let local_var_configuration = configuration;
998
999    let local_var_client = &local_var_configuration.client;
1000
1001    let local_var_uri_str = format!("{}/settings/migrate_secrets_to_aws_sm", local_var_configuration.base_path);
1002    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1003
1004    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1005        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1006    }
1007    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1008        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1009    };
1010    local_var_req_builder = local_var_req_builder.json(&aws_secrets_manager_settings);
1011
1012    let local_var_req = local_var_req_builder.build()?;
1013    let local_var_resp = local_var_client.execute(local_var_req).await?;
1014
1015    let local_var_status = local_var_resp.status();
1016    let local_var_content = local_var_resp.text().await?;
1017
1018    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1019        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1020    } else {
1021        let local_var_entity: Option<MigrateSecretsToAwsSmError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1022        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1023        Err(Error::ResponseError(local_var_error))
1024    }
1025}
1026
1027pub async fn migrate_secrets_to_azure_kv(configuration: &configuration::Configuration, azure_key_vault_settings: models::AzureKeyVaultSettings) -> Result<models::SecretMigrationReport, Error<MigrateSecretsToAzureKvError>> {
1028    let local_var_configuration = configuration;
1029
1030    let local_var_client = &local_var_configuration.client;
1031
1032    let local_var_uri_str = format!("{}/settings/migrate_secrets_to_azure_kv", local_var_configuration.base_path);
1033    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1034
1035    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1036        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1037    }
1038    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1039        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1040    };
1041    local_var_req_builder = local_var_req_builder.json(&azure_key_vault_settings);
1042
1043    let local_var_req = local_var_req_builder.build()?;
1044    let local_var_resp = local_var_client.execute(local_var_req).await?;
1045
1046    let local_var_status = local_var_resp.status();
1047    let local_var_content = local_var_resp.text().await?;
1048
1049    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1050        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1051    } else {
1052        let local_var_entity: Option<MigrateSecretsToAzureKvError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1053        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1054        Err(Error::ResponseError(local_var_error))
1055    }
1056}
1057
1058pub async fn migrate_secrets_to_database(configuration: &configuration::Configuration, vault_settings: models::VaultSettings) -> Result<models::SecretMigrationReport, Error<MigrateSecretsToDatabaseError>> {
1059    let local_var_configuration = configuration;
1060
1061    let local_var_client = &local_var_configuration.client;
1062
1063    let local_var_uri_str = format!("{}/settings/migrate_secrets_to_database", local_var_configuration.base_path);
1064    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1065
1066    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1067        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1068    }
1069    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1070        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1071    };
1072    local_var_req_builder = local_var_req_builder.json(&vault_settings);
1073
1074    let local_var_req = local_var_req_builder.build()?;
1075    let local_var_resp = local_var_client.execute(local_var_req).await?;
1076
1077    let local_var_status = local_var_resp.status();
1078    let local_var_content = local_var_resp.text().await?;
1079
1080    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1081        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1082    } else {
1083        let local_var_entity: Option<MigrateSecretsToDatabaseError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1084        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1085        Err(Error::ResponseError(local_var_error))
1086    }
1087}
1088
1089pub async fn migrate_secrets_to_vault(configuration: &configuration::Configuration, vault_settings: models::VaultSettings) -> Result<models::SecretMigrationReport, Error<MigrateSecretsToVaultError>> {
1090    let local_var_configuration = configuration;
1091
1092    let local_var_client = &local_var_configuration.client;
1093
1094    let local_var_uri_str = format!("{}/settings/migrate_secrets_to_vault", local_var_configuration.base_path);
1095    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1096
1097    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1098        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1099    }
1100    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1101        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1102    };
1103    local_var_req_builder = local_var_req_builder.json(&vault_settings);
1104
1105    let local_var_req = local_var_req_builder.build()?;
1106    let local_var_resp = local_var_client.execute(local_var_req).await?;
1107
1108    let local_var_status = local_var_resp.status();
1109    let local_var_content = local_var_resp.text().await?;
1110
1111    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1112        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1113    } else {
1114        let local_var_entity: Option<MigrateSecretsToVaultError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1115        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1116        Err(Error::ResponseError(local_var_error))
1117    }
1118}
1119
1120pub async fn refresh_custom_instance_user_pwd(configuration: &configuration::Configuration, ) -> Result<serde_json::Value, Error<RefreshCustomInstanceUserPwdError>> {
1121    let local_var_configuration = configuration;
1122
1123    let local_var_client = &local_var_configuration.client;
1124
1125    let local_var_uri_str = format!("{}/settings/refresh_custom_instance_user_pwd", local_var_configuration.base_path);
1126    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1127
1128    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1129        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1130    }
1131    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1132        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1133    };
1134
1135    let local_var_req = local_var_req_builder.build()?;
1136    let local_var_resp = local_var_client.execute(local_var_req).await?;
1137
1138    let local_var_status = local_var_resp.status();
1139    let local_var_content = local_var_resp.text().await?;
1140
1141    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1142        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1143    } else {
1144        let local_var_entity: Option<RefreshCustomInstanceUserPwdError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1145        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1146        Err(Error::ResponseError(local_var_error))
1147    }
1148}
1149
1150pub async fn renew_license_key(configuration: &configuration::Configuration, license_key: Option<&str>) -> Result<String, Error<RenewLicenseKeyError>> {
1151    let local_var_configuration = configuration;
1152
1153    let local_var_client = &local_var_configuration.client;
1154
1155    let local_var_uri_str = format!("{}/settings/renew_license_key", local_var_configuration.base_path);
1156    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1157
1158    if let Some(ref local_var_str) = license_key {
1159        local_var_req_builder = local_var_req_builder.query(&[("license_key", &local_var_str.to_string())]);
1160    }
1161    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1162        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1163    }
1164    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1165        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1166    };
1167
1168    let local_var_req = local_var_req_builder.build()?;
1169    let local_var_resp = local_var_client.execute(local_var_req).await?;
1170
1171    let local_var_status = local_var_resp.status();
1172    let local_var_content = local_var_resp.text().await?;
1173
1174    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1175        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1176    } else {
1177        let local_var_entity: Option<RenewLicenseKeyError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1178        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1179        Err(Error::ResponseError(local_var_error))
1180    }
1181}
1182
1183/// 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.
1184pub async fn restart_worker_group(configuration: &configuration::Configuration, worker_group: &str) -> Result<String, Error<RestartWorkerGroupError>> {
1185    let local_var_configuration = configuration;
1186
1187    let local_var_client = &local_var_configuration.client;
1188
1189    let local_var_uri_str = format!("{}/settings/restart_worker_group/{worker_group}", local_var_configuration.base_path, worker_group=crate::apis::urlencode(worker_group));
1190    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1191
1192    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1193        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1194    }
1195    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1196        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1197    };
1198
1199    let local_var_req = local_var_req_builder.build()?;
1200    let local_var_resp = local_var_client.execute(local_var_req).await?;
1201
1202    let local_var_status = local_var_resp.status();
1203    let local_var_content = local_var_resp.text().await?;
1204
1205    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1206        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1207    } else {
1208        let local_var_entity: Option<RestartWorkerGroupError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1209        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1210        Err(Error::ResponseError(local_var_error))
1211    }
1212}
1213
1214/// 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).
1215pub async fn revalidate_license(configuration: &configuration::Configuration, ) -> Result<models::RevalidateLicense200Response, Error<RevalidateLicenseError>> {
1216    let local_var_configuration = configuration;
1217
1218    let local_var_client = &local_var_configuration.client;
1219
1220    let local_var_uri_str = format!("{}/settings/revalidate_license", local_var_configuration.base_path);
1221    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1222
1223    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1224        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1225    }
1226    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1227        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1228    };
1229
1230    let local_var_req = local_var_req_builder.build()?;
1231    let local_var_resp = local_var_client.execute(local_var_req).await?;
1232
1233    let local_var_status = local_var_resp.status();
1234    let local_var_content = local_var_resp.text().await?;
1235
1236    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1237        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1238    } else {
1239        let local_var_entity: Option<RevalidateLicenseError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1240        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1241        Err(Error::ResponseError(local_var_error))
1242    }
1243}
1244
1245pub async fn run_log_cleanup(configuration: &configuration::Configuration, ) -> Result<String, Error<RunLogCleanupError>> {
1246    let local_var_configuration = configuration;
1247
1248    let local_var_client = &local_var_configuration.client;
1249
1250    let local_var_uri_str = format!("{}/settings/run_log_cleanup", local_var_configuration.base_path);
1251    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1252
1253    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1254        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1255    }
1256    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1257        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1258    };
1259
1260    let local_var_req = local_var_req_builder.build()?;
1261    let local_var_resp = local_var_client.execute(local_var_req).await?;
1262
1263    let local_var_status = local_var_resp.status();
1264    let local_var_content = local_var_resp.text().await?;
1265
1266    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1267        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1268    } else {
1269        let local_var_entity: Option<RunLogCleanupError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1270        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1271        Err(Error::ResponseError(local_var_error))
1272    }
1273}
1274
1275pub async fn send_stats(configuration: &configuration::Configuration, ) -> Result<String, Error<SendStatsError>> {
1276    let local_var_configuration = configuration;
1277
1278    let local_var_client = &local_var_configuration.client;
1279
1280    let local_var_uri_str = format!("{}/settings/send_stats", local_var_configuration.base_path);
1281    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1282
1283    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1284        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1285    }
1286    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1287        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1288    };
1289
1290    let local_var_req = local_var_req_builder.build()?;
1291    let local_var_resp = local_var_client.execute(local_var_req).await?;
1292
1293    let local_var_status = local_var_resp.status();
1294    let local_var_content = local_var_resp.text().await?;
1295
1296    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1297        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1298    } else {
1299        let local_var_entity: Option<SendStatsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1300        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1301        Err(Error::ResponseError(local_var_error))
1302    }
1303}
1304
1305pub async fn set_global(configuration: &configuration::Configuration, key: &str, set_global_request: models::SetGlobalRequest) -> Result<String, Error<SetGlobalError>> {
1306    let local_var_configuration = configuration;
1307
1308    let local_var_client = &local_var_configuration.client;
1309
1310    let local_var_uri_str = format!("{}/settings/global/{key}", local_var_configuration.base_path, key=crate::apis::urlencode(key));
1311    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1312
1313    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1314        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1315    }
1316    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1317        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1318    };
1319    local_var_req_builder = local_var_req_builder.json(&set_global_request);
1320
1321    let local_var_req = local_var_req_builder.build()?;
1322    let local_var_resp = local_var_client.execute(local_var_req).await?;
1323
1324    let local_var_status = local_var_resp.status();
1325    let local_var_content = local_var_resp.text().await?;
1326
1327    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1328        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1329    } else {
1330        let local_var_entity: Option<SetGlobalError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1331        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1332        Err(Error::ResponseError(local_var_error))
1333    }
1334}
1335
1336pub async fn set_instance_config(configuration: &configuration::Configuration, instance_config: models::InstanceConfig) -> Result<String, Error<SetInstanceConfigError>> {
1337    let local_var_configuration = configuration;
1338
1339    let local_var_client = &local_var_configuration.client;
1340
1341    let local_var_uri_str = format!("{}/settings/instance_config", local_var_configuration.base_path);
1342    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
1343
1344    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1345        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1346    }
1347    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1348        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1349    };
1350    local_var_req_builder = local_var_req_builder.json(&instance_config);
1351
1352    let local_var_req = local_var_req_builder.build()?;
1353    let local_var_resp = local_var_client.execute(local_var_req).await?;
1354
1355    let local_var_status = local_var_resp.status();
1356    let local_var_content = local_var_resp.text().await?;
1357
1358    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1359        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1360    } else {
1361        let local_var_entity: Option<SetInstanceConfigError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1362        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1363        Err(Error::ResponseError(local_var_error))
1364    }
1365}
1366
1367pub async fn set_public_app_rate_limit(configuration: &configuration::Configuration, workspace: &str, set_public_app_rate_limit_request: models::SetPublicAppRateLimitRequest) -> Result<String, Error<SetPublicAppRateLimitError>> {
1368    let local_var_configuration = configuration;
1369
1370    let local_var_client = &local_var_configuration.client;
1371
1372    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/public_app_rate_limit", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1373    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1374
1375    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1376        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1377    }
1378    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1379        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1380    };
1381    local_var_req_builder = local_var_req_builder.json(&set_public_app_rate_limit_request);
1382
1383    let local_var_req = local_var_req_builder.build()?;
1384    let local_var_resp = local_var_client.execute(local_var_req).await?;
1385
1386    let local_var_status = local_var_resp.status();
1387    let local_var_content = local_var_resp.text().await?;
1388
1389    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1390        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1391    } else {
1392        let local_var_entity: Option<SetPublicAppRateLimitError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1393        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1394        Err(Error::ResponseError(local_var_error))
1395    }
1396}
1397
1398pub async fn setup_custom_instance_db(configuration: &configuration::Configuration, name: &str, setup_custom_instance_db_request: models::SetupCustomInstanceDbRequest) -> Result<models::CustomInstanceDb, Error<SetupCustomInstanceDbError>> {
1399    let local_var_configuration = configuration;
1400
1401    let local_var_client = &local_var_configuration.client;
1402
1403    let local_var_uri_str = format!("{}/settings/setup_custom_instance_pg_database/{name}", local_var_configuration.base_path, name=crate::apis::urlencode(name));
1404    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1405
1406    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1407        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1408    }
1409    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1410        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1411    };
1412    local_var_req_builder = local_var_req_builder.json(&setup_custom_instance_db_request);
1413
1414    let local_var_req = local_var_req_builder.build()?;
1415    let local_var_resp = local_var_client.execute(local_var_req).await?;
1416
1417    let local_var_status = local_var_resp.status();
1418    let local_var_content = local_var_resp.text().await?;
1419
1420    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1421        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1422    } else {
1423        let local_var_entity: Option<SetupCustomInstanceDbError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1424        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1425        Err(Error::ResponseError(local_var_error))
1426    }
1427}
1428
1429pub async fn test_aws_sm_backend(configuration: &configuration::Configuration, aws_secrets_manager_settings: models::AwsSecretsManagerSettings) -> Result<String, Error<TestAwsSmBackendError>> {
1430    let local_var_configuration = configuration;
1431
1432    let local_var_client = &local_var_configuration.client;
1433
1434    let local_var_uri_str = format!("{}/settings/test_aws_sm_backend", local_var_configuration.base_path);
1435    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1436
1437    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1438        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1439    }
1440    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1441        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1442    };
1443    local_var_req_builder = local_var_req_builder.json(&aws_secrets_manager_settings);
1444
1445    let local_var_req = local_var_req_builder.build()?;
1446    let local_var_resp = local_var_client.execute(local_var_req).await?;
1447
1448    let local_var_status = local_var_resp.status();
1449    let local_var_content = local_var_resp.text().await?;
1450
1451    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1452        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1453    } else {
1454        let local_var_entity: Option<TestAwsSmBackendError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1455        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1456        Err(Error::ResponseError(local_var_error))
1457    }
1458}
1459
1460pub async fn test_azure_kv_backend(configuration: &configuration::Configuration, azure_key_vault_settings: models::AzureKeyVaultSettings) -> Result<String, Error<TestAzureKvBackendError>> {
1461    let local_var_configuration = configuration;
1462
1463    let local_var_client = &local_var_configuration.client;
1464
1465    let local_var_uri_str = format!("{}/settings/test_azure_kv_backend", local_var_configuration.base_path);
1466    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1467
1468    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1469        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1470    }
1471    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1472        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1473    };
1474    local_var_req_builder = local_var_req_builder.json(&azure_key_vault_settings);
1475
1476    let local_var_req = local_var_req_builder.build()?;
1477    let local_var_resp = local_var_client.execute(local_var_req).await?;
1478
1479    let local_var_status = local_var_resp.status();
1480    let local_var_content = local_var_resp.text().await?;
1481
1482    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1483        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1484    } else {
1485        let local_var_entity: Option<TestAzureKvBackendError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1486        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1487        Err(Error::ResponseError(local_var_error))
1488    }
1489}
1490
1491pub async fn test_critical_channels(configuration: &configuration::Configuration, test_critical_channels_request_inner: Vec<models::TestCriticalChannelsRequestInner>) -> Result<String, Error<TestCriticalChannelsError>> {
1492    let local_var_configuration = configuration;
1493
1494    let local_var_client = &local_var_configuration.client;
1495
1496    let local_var_uri_str = format!("{}/settings/test_critical_channels", local_var_configuration.base_path);
1497    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1498
1499    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1500        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1501    }
1502    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1503        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1504    };
1505    local_var_req_builder = local_var_req_builder.json(&test_critical_channels_request_inner);
1506
1507    let local_var_req = local_var_req_builder.build()?;
1508    let local_var_resp = local_var_client.execute(local_var_req).await?;
1509
1510    let local_var_status = local_var_resp.status();
1511    let local_var_content = local_var_resp.text().await?;
1512
1513    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1514        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1515    } else {
1516        let local_var_entity: Option<TestCriticalChannelsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1517        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1518        Err(Error::ResponseError(local_var_error))
1519    }
1520}
1521
1522pub async fn test_license_key(configuration: &configuration::Configuration, test_license_key_request: models::TestLicenseKeyRequest) -> Result<String, Error<TestLicenseKeyError>> {
1523    let local_var_configuration = configuration;
1524
1525    let local_var_client = &local_var_configuration.client;
1526
1527    let local_var_uri_str = format!("{}/settings/test_license_key", local_var_configuration.base_path);
1528    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1529
1530    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1531        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1532    }
1533    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1534        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1535    };
1536    local_var_req_builder = local_var_req_builder.json(&test_license_key_request);
1537
1538    let local_var_req = local_var_req_builder.build()?;
1539    let local_var_resp = local_var_client.execute(local_var_req).await?;
1540
1541    let local_var_status = local_var_resp.status();
1542    let local_var_content = local_var_resp.text().await?;
1543
1544    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1545        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1546    } else {
1547        let local_var_entity: Option<TestLicenseKeyError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1548        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1549        Err(Error::ResponseError(local_var_error))
1550    }
1551}
1552
1553pub async fn test_metadata(configuration: &configuration::Configuration, body: &str) -> Result<String, Error<TestMetadataError>> {
1554    let local_var_configuration = configuration;
1555
1556    let local_var_client = &local_var_configuration.client;
1557
1558    let local_var_uri_str = format!("{}/saml/test_metadata", local_var_configuration.base_path);
1559    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1560
1561    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1562        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1563    }
1564    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1565        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1566    };
1567    local_var_req_builder = local_var_req_builder.json(&body);
1568
1569    let local_var_req = local_var_req_builder.build()?;
1570    let local_var_resp = local_var_client.execute(local_var_req).await?;
1571
1572    let local_var_status = local_var_resp.status();
1573    let local_var_content = local_var_resp.text().await?;
1574
1575    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1576        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1577    } else {
1578        let local_var_entity: Option<TestMetadataError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1579        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1580        Err(Error::ResponseError(local_var_error))
1581    }
1582}
1583
1584pub async fn test_object_storage_config(configuration: &configuration::Configuration, request_body: std::collections::HashMap<String, serde_json::Value>) -> Result<String, Error<TestObjectStorageConfigError>> {
1585    let local_var_configuration = configuration;
1586
1587    let local_var_client = &local_var_configuration.client;
1588
1589    let local_var_uri_str = format!("{}/settings/test_object_storage_config", local_var_configuration.base_path);
1590    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1591
1592    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1593        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1594    }
1595    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1596        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1597    };
1598    local_var_req_builder = local_var_req_builder.json(&request_body);
1599
1600    let local_var_req = local_var_req_builder.build()?;
1601    let local_var_resp = local_var_client.execute(local_var_req).await?;
1602
1603    let local_var_status = local_var_resp.status();
1604    let local_var_content = local_var_resp.text().await?;
1605
1606    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1607        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1608    } else {
1609        let local_var_entity: Option<TestObjectStorageConfigError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1610        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1611        Err(Error::ResponseError(local_var_error))
1612    }
1613}
1614
1615pub async fn test_secret_backend(configuration: &configuration::Configuration, vault_settings: models::VaultSettings) -> Result<String, Error<TestSecretBackendError>> {
1616    let local_var_configuration = configuration;
1617
1618    let local_var_client = &local_var_configuration.client;
1619
1620    let local_var_uri_str = format!("{}/settings/test_secret_backend", local_var_configuration.base_path);
1621    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1622
1623    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1624        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1625    }
1626    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1627        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1628    };
1629    local_var_req_builder = local_var_req_builder.json(&vault_settings);
1630
1631    let local_var_req = local_var_req_builder.build()?;
1632    let local_var_resp = local_var_client.execute(local_var_req).await?;
1633
1634    let local_var_status = local_var_resp.status();
1635    let local_var_content = local_var_resp.text().await?;
1636
1637    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1638        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1639    } else {
1640        let local_var_entity: Option<TestSecretBackendError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1641        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1642        Err(Error::ResponseError(local_var_error))
1643    }
1644}
1645
1646pub async fn test_smtp(configuration: &configuration::Configuration, test_smtp_request: models::TestSmtpRequest) -> Result<String, Error<TestSmtpError>> {
1647    let local_var_configuration = configuration;
1648
1649    let local_var_client = &local_var_configuration.client;
1650
1651    let local_var_uri_str = format!("{}/settings/test_smtp", local_var_configuration.base_path);
1652    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1653
1654    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1655        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1656    }
1657    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1658        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1659    };
1660    local_var_req_builder = local_var_req_builder.json(&test_smtp_request);
1661
1662    let local_var_req = local_var_req_builder.build()?;
1663    let local_var_resp = local_var_client.execute(local_var_req).await?;
1664
1665    let local_var_status = local_var_resp.status();
1666    let local_var_content = local_var_resp.text().await?;
1667
1668    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1669        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1670    } else {
1671        let local_var_entity: Option<TestSmtpError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1672        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1673        Err(Error::ResponseError(local_var_error))
1674    }
1675}
1676
1677pub async fn workspace_acknowledge_all_critical_alerts(configuration: &configuration::Configuration, workspace: &str) -> Result<String, Error<WorkspaceAcknowledgeAllCriticalAlertsError>> {
1678    let local_var_configuration = configuration;
1679
1680    let local_var_client = &local_var_configuration.client;
1681
1682    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/critical_alerts/acknowledge_all", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1683    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1684
1685    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1686        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1687    }
1688    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1689        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1690    };
1691
1692    let local_var_req = local_var_req_builder.build()?;
1693    let local_var_resp = local_var_client.execute(local_var_req).await?;
1694
1695    let local_var_status = local_var_resp.status();
1696    let local_var_content = local_var_resp.text().await?;
1697
1698    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1699        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1700    } else {
1701        let local_var_entity: Option<WorkspaceAcknowledgeAllCriticalAlertsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1702        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1703        Err(Error::ResponseError(local_var_error))
1704    }
1705}
1706
1707pub async fn workspace_acknowledge_critical_alert(configuration: &configuration::Configuration, workspace: &str, id: i32) -> Result<String, Error<WorkspaceAcknowledgeCriticalAlertError>> {
1708    let local_var_configuration = configuration;
1709
1710    let local_var_client = &local_var_configuration.client;
1711
1712    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);
1713    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1714
1715    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1716        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1717    }
1718    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1719        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1720    };
1721
1722    let local_var_req = local_var_req_builder.build()?;
1723    let local_var_resp = local_var_client.execute(local_var_req).await?;
1724
1725    let local_var_status = local_var_resp.status();
1726    let local_var_content = local_var_resp.text().await?;
1727
1728    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1729        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1730    } else {
1731        let local_var_entity: Option<WorkspaceAcknowledgeCriticalAlertError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1732        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1733        Err(Error::ResponseError(local_var_error))
1734    }
1735}
1736
1737pub async fn workspace_get_critical_alerts(configuration: &configuration::Configuration, workspace: &str, page: Option<i32>, page_size: Option<i32>, acknowledged: Option<bool>) -> Result<models::GetCriticalAlerts200Response, Error<WorkspaceGetCriticalAlertsError>> {
1738    let local_var_configuration = configuration;
1739
1740    let local_var_client = &local_var_configuration.client;
1741
1742    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/critical_alerts", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1743    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1744
1745    if let Some(ref local_var_str) = page {
1746        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
1747    }
1748    if let Some(ref local_var_str) = page_size {
1749        local_var_req_builder = local_var_req_builder.query(&[("page_size", &local_var_str.to_string())]);
1750    }
1751    if let Some(ref local_var_str) = acknowledged {
1752        local_var_req_builder = local_var_req_builder.query(&[("acknowledged", &local_var_str.to_string())]);
1753    }
1754    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1755        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1756    }
1757    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1758        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1759    };
1760
1761    let local_var_req = local_var_req_builder.build()?;
1762    let local_var_resp = local_var_client.execute(local_var_req).await?;
1763
1764    let local_var_status = local_var_resp.status();
1765    let local_var_content = local_var_resp.text().await?;
1766
1767    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1768        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1769    } else {
1770        let local_var_entity: Option<WorkspaceGetCriticalAlertsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1771        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1772        Err(Error::ResponseError(local_var_error))
1773    }
1774}
1775
1776pub async fn workspace_mute_critical_alerts_ui(configuration: &configuration::Configuration, workspace: &str, workspace_mute_critical_alerts_ui_request: models::WorkspaceMuteCriticalAlertsUiRequest) -> Result<String, Error<WorkspaceMuteCriticalAlertsUiError>> {
1777    let local_var_configuration = configuration;
1778
1779    let local_var_client = &local_var_configuration.client;
1780
1781    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/critical_alerts/mute", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1782    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1783
1784    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1785        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1786    }
1787    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1788        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1789    };
1790    local_var_req_builder = local_var_req_builder.json(&workspace_mute_critical_alerts_ui_request);
1791
1792    let local_var_req = local_var_req_builder.build()?;
1793    let local_var_resp = local_var_client.execute(local_var_req).await?;
1794
1795    let local_var_status = local_var_resp.status();
1796    let local_var_content = local_var_resp.text().await?;
1797
1798    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1799        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1800    } else {
1801        let local_var_entity: Option<WorkspaceMuteCriticalAlertsUiError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1802        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1803        Err(Error::ResponseError(local_var_error))
1804    }
1805}
1806