windmill_api/apis/
workspace_api.rs

1/*
2 * Windmill API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 1.549.1
7 * Contact: contact@windmill.dev
8 * Generated by: https://openapi-generator.tech
9 */
10
11
12use reqwest;
13use serde::{Deserialize, Serialize};
14use crate::{apis::ResponseContent, models};
15use super::{Error, configuration};
16
17
18/// struct for typed errors of method [`add_user`]
19#[derive(Debug, Clone, Serialize, Deserialize)]
20#[serde(untagged)]
21pub enum AddUserError {
22    UnknownValue(serde_json::Value),
23}
24
25/// struct for typed errors of method [`archive_workspace`]
26#[derive(Debug, Clone, Serialize, Deserialize)]
27#[serde(untagged)]
28pub enum ArchiveWorkspaceError {
29    UnknownValue(serde_json::Value),
30}
31
32/// struct for typed errors of method [`change_workspace_color`]
33#[derive(Debug, Clone, Serialize, Deserialize)]
34#[serde(untagged)]
35pub enum ChangeWorkspaceColorError {
36    UnknownValue(serde_json::Value),
37}
38
39/// struct for typed errors of method [`change_workspace_id`]
40#[derive(Debug, Clone, Serialize, Deserialize)]
41#[serde(untagged)]
42pub enum ChangeWorkspaceIdError {
43    UnknownValue(serde_json::Value),
44}
45
46/// struct for typed errors of method [`change_workspace_name`]
47#[derive(Debug, Clone, Serialize, Deserialize)]
48#[serde(untagged)]
49pub enum ChangeWorkspaceNameError {
50    UnknownValue(serde_json::Value),
51}
52
53/// struct for typed errors of method [`connect_teams`]
54#[derive(Debug, Clone, Serialize, Deserialize)]
55#[serde(untagged)]
56pub enum ConnectTeamsError {
57    UnknownValue(serde_json::Value),
58}
59
60/// struct for typed errors of method [`create_workspace`]
61#[derive(Debug, Clone, Serialize, Deserialize)]
62#[serde(untagged)]
63pub enum CreateWorkspaceError {
64    UnknownValue(serde_json::Value),
65}
66
67/// struct for typed errors of method [`create_workspace_fork`]
68#[derive(Debug, Clone, Serialize, Deserialize)]
69#[serde(untagged)]
70pub enum CreateWorkspaceForkError {
71    UnknownValue(serde_json::Value),
72}
73
74/// struct for typed errors of method [`delete_git_sync_repository`]
75#[derive(Debug, Clone, Serialize, Deserialize)]
76#[serde(untagged)]
77pub enum DeleteGitSyncRepositoryError {
78    UnknownValue(serde_json::Value),
79}
80
81/// struct for typed errors of method [`delete_invite`]
82#[derive(Debug, Clone, Serialize, Deserialize)]
83#[serde(untagged)]
84pub enum DeleteInviteError {
85    UnknownValue(serde_json::Value),
86}
87
88/// struct for typed errors of method [`delete_workspace`]
89#[derive(Debug, Clone, Serialize, Deserialize)]
90#[serde(untagged)]
91pub enum DeleteWorkspaceError {
92    UnknownValue(serde_json::Value),
93}
94
95/// struct for typed errors of method [`edit_auto_invite`]
96#[derive(Debug, Clone, Serialize, Deserialize)]
97#[serde(untagged)]
98pub enum EditAutoInviteError {
99    UnknownValue(serde_json::Value),
100}
101
102/// struct for typed errors of method [`edit_copilot_config`]
103#[derive(Debug, Clone, Serialize, Deserialize)]
104#[serde(untagged)]
105pub enum EditCopilotConfigError {
106    UnknownValue(serde_json::Value),
107}
108
109/// struct for typed errors of method [`edit_default_scripts`]
110#[derive(Debug, Clone, Serialize, Deserialize)]
111#[serde(untagged)]
112pub enum EditDefaultScriptsError {
113    UnknownValue(serde_json::Value),
114}
115
116/// struct for typed errors of method [`edit_deploy_to`]
117#[derive(Debug, Clone, Serialize, Deserialize)]
118#[serde(untagged)]
119pub enum EditDeployToError {
120    UnknownValue(serde_json::Value),
121}
122
123/// struct for typed errors of method [`edit_ducklake_config`]
124#[derive(Debug, Clone, Serialize, Deserialize)]
125#[serde(untagged)]
126pub enum EditDucklakeConfigError {
127    UnknownValue(serde_json::Value),
128}
129
130/// struct for typed errors of method [`edit_error_handler`]
131#[derive(Debug, Clone, Serialize, Deserialize)]
132#[serde(untagged)]
133pub enum EditErrorHandlerError {
134    UnknownValue(serde_json::Value),
135}
136
137/// struct for typed errors of method [`edit_git_sync_repository`]
138#[derive(Debug, Clone, Serialize, Deserialize)]
139#[serde(untagged)]
140pub enum EditGitSyncRepositoryError {
141    UnknownValue(serde_json::Value),
142}
143
144/// struct for typed errors of method [`edit_instance_groups`]
145#[derive(Debug, Clone, Serialize, Deserialize)]
146#[serde(untagged)]
147pub enum EditInstanceGroupsError {
148    UnknownValue(serde_json::Value),
149}
150
151/// struct for typed errors of method [`edit_large_file_storage_config`]
152#[derive(Debug, Clone, Serialize, Deserialize)]
153#[serde(untagged)]
154pub enum EditLargeFileStorageConfigError {
155    UnknownValue(serde_json::Value),
156}
157
158/// struct for typed errors of method [`edit_slack_command`]
159#[derive(Debug, Clone, Serialize, Deserialize)]
160#[serde(untagged)]
161pub enum EditSlackCommandError {
162    UnknownValue(serde_json::Value),
163}
164
165/// struct for typed errors of method [`edit_teams_command`]
166#[derive(Debug, Clone, Serialize, Deserialize)]
167#[serde(untagged)]
168pub enum EditTeamsCommandError {
169    UnknownValue(serde_json::Value),
170}
171
172/// struct for typed errors of method [`edit_webhook`]
173#[derive(Debug, Clone, Serialize, Deserialize)]
174#[serde(untagged)]
175pub enum EditWebhookError {
176    UnknownValue(serde_json::Value),
177}
178
179/// struct for typed errors of method [`edit_workspace_default_app`]
180#[derive(Debug, Clone, Serialize, Deserialize)]
181#[serde(untagged)]
182pub enum EditWorkspaceDefaultAppError {
183    UnknownValue(serde_json::Value),
184}
185
186/// struct for typed errors of method [`edit_workspace_deploy_ui_settings`]
187#[derive(Debug, Clone, Serialize, Deserialize)]
188#[serde(untagged)]
189pub enum EditWorkspaceDeployUiSettingsError {
190    UnknownValue(serde_json::Value),
191}
192
193/// struct for typed errors of method [`edit_workspace_git_sync_config`]
194#[derive(Debug, Clone, Serialize, Deserialize)]
195#[serde(untagged)]
196pub enum EditWorkspaceGitSyncConfigError {
197    UnknownValue(serde_json::Value),
198}
199
200/// struct for typed errors of method [`exists_username`]
201#[derive(Debug, Clone, Serialize, Deserialize)]
202#[serde(untagged)]
203pub enum ExistsUsernameError {
204    UnknownValue(serde_json::Value),
205}
206
207/// struct for typed errors of method [`exists_workspace`]
208#[derive(Debug, Clone, Serialize, Deserialize)]
209#[serde(untagged)]
210pub enum ExistsWorkspaceError {
211    UnknownValue(serde_json::Value),
212}
213
214/// struct for typed errors of method [`get_copilot_info`]
215#[derive(Debug, Clone, Serialize, Deserialize)]
216#[serde(untagged)]
217pub enum GetCopilotInfoError {
218    UnknownValue(serde_json::Value),
219}
220
221/// struct for typed errors of method [`get_default_scripts`]
222#[derive(Debug, Clone, Serialize, Deserialize)]
223#[serde(untagged)]
224pub enum GetDefaultScriptsError {
225    UnknownValue(serde_json::Value),
226}
227
228/// struct for typed errors of method [`get_dependency_map`]
229#[derive(Debug, Clone, Serialize, Deserialize)]
230#[serde(untagged)]
231pub enum GetDependencyMapError {
232    UnknownValue(serde_json::Value),
233}
234
235/// struct for typed errors of method [`get_deploy_to`]
236#[derive(Debug, Clone, Serialize, Deserialize)]
237#[serde(untagged)]
238pub enum GetDeployToError {
239    UnknownValue(serde_json::Value),
240}
241
242/// struct for typed errors of method [`get_github_app_token`]
243#[derive(Debug, Clone, Serialize, Deserialize)]
244#[serde(untagged)]
245pub enum GetGithubAppTokenError {
246    UnknownValue(serde_json::Value),
247}
248
249/// struct for typed errors of method [`get_is_premium`]
250#[derive(Debug, Clone, Serialize, Deserialize)]
251#[serde(untagged)]
252pub enum GetIsPremiumError {
253    UnknownValue(serde_json::Value),
254}
255
256/// struct for typed errors of method [`get_large_file_storage_config`]
257#[derive(Debug, Clone, Serialize, Deserialize)]
258#[serde(untagged)]
259pub enum GetLargeFileStorageConfigError {
260    UnknownValue(serde_json::Value),
261}
262
263/// struct for typed errors of method [`get_premium_info`]
264#[derive(Debug, Clone, Serialize, Deserialize)]
265#[serde(untagged)]
266pub enum GetPremiumInfoError {
267    UnknownValue(serde_json::Value),
268}
269
270/// struct for typed errors of method [`get_settings`]
271#[derive(Debug, Clone, Serialize, Deserialize)]
272#[serde(untagged)]
273pub enum GetSettingsError {
274    UnknownValue(serde_json::Value),
275}
276
277/// struct for typed errors of method [`get_threshold_alert`]
278#[derive(Debug, Clone, Serialize, Deserialize)]
279#[serde(untagged)]
280pub enum GetThresholdAlertError {
281    UnknownValue(serde_json::Value),
282}
283
284/// struct for typed errors of method [`get_used_triggers`]
285#[derive(Debug, Clone, Serialize, Deserialize)]
286#[serde(untagged)]
287pub enum GetUsedTriggersError {
288    UnknownValue(serde_json::Value),
289}
290
291/// struct for typed errors of method [`get_workspace_default_app`]
292#[derive(Debug, Clone, Serialize, Deserialize)]
293#[serde(untagged)]
294pub enum GetWorkspaceDefaultAppError {
295    UnknownValue(serde_json::Value),
296}
297
298/// struct for typed errors of method [`get_workspace_encryption_key`]
299#[derive(Debug, Clone, Serialize, Deserialize)]
300#[serde(untagged)]
301pub enum GetWorkspaceEncryptionKeyError {
302    UnknownValue(serde_json::Value),
303}
304
305/// struct for typed errors of method [`get_workspace_name`]
306#[derive(Debug, Clone, Serialize, Deserialize)]
307#[serde(untagged)]
308pub enum GetWorkspaceNameError {
309    UnknownValue(serde_json::Value),
310}
311
312/// struct for typed errors of method [`get_workspace_usage`]
313#[derive(Debug, Clone, Serialize, Deserialize)]
314#[serde(untagged)]
315pub enum GetWorkspaceUsageError {
316    UnknownValue(serde_json::Value),
317}
318
319/// struct for typed errors of method [`invite_user`]
320#[derive(Debug, Clone, Serialize, Deserialize)]
321#[serde(untagged)]
322pub enum InviteUserError {
323    UnknownValue(serde_json::Value),
324}
325
326/// struct for typed errors of method [`is_domain_allowed`]
327#[derive(Debug, Clone, Serialize, Deserialize)]
328#[serde(untagged)]
329pub enum IsDomainAllowedError {
330    UnknownValue(serde_json::Value),
331}
332
333/// struct for typed errors of method [`leave_workspace`]
334#[derive(Debug, Clone, Serialize, Deserialize)]
335#[serde(untagged)]
336pub enum LeaveWorkspaceError {
337    UnknownValue(serde_json::Value),
338}
339
340/// struct for typed errors of method [`list_available_teams_channels`]
341#[derive(Debug, Clone, Serialize, Deserialize)]
342#[serde(untagged)]
343pub enum ListAvailableTeamsChannelsError {
344    UnknownValue(serde_json::Value),
345}
346
347/// struct for typed errors of method [`list_available_teams_ids`]
348#[derive(Debug, Clone, Serialize, Deserialize)]
349#[serde(untagged)]
350pub enum ListAvailableTeamsIdsError {
351    UnknownValue(serde_json::Value),
352}
353
354/// struct for typed errors of method [`list_ducklakes`]
355#[derive(Debug, Clone, Serialize, Deserialize)]
356#[serde(untagged)]
357pub enum ListDucklakesError {
358    UnknownValue(serde_json::Value),
359}
360
361/// struct for typed errors of method [`list_pending_invites`]
362#[derive(Debug, Clone, Serialize, Deserialize)]
363#[serde(untagged)]
364pub enum ListPendingInvitesError {
365    UnknownValue(serde_json::Value),
366}
367
368/// struct for typed errors of method [`list_user_workspaces`]
369#[derive(Debug, Clone, Serialize, Deserialize)]
370#[serde(untagged)]
371pub enum ListUserWorkspacesError {
372    UnknownValue(serde_json::Value),
373}
374
375/// struct for typed errors of method [`list_workspaces`]
376#[derive(Debug, Clone, Serialize, Deserialize)]
377#[serde(untagged)]
378pub enum ListWorkspacesError {
379    UnknownValue(serde_json::Value),
380}
381
382/// struct for typed errors of method [`list_workspaces_as_super_admin`]
383#[derive(Debug, Clone, Serialize, Deserialize)]
384#[serde(untagged)]
385pub enum ListWorkspacesAsSuperAdminError {
386    UnknownValue(serde_json::Value),
387}
388
389/// struct for typed errors of method [`rebuild_dependency_map`]
390#[derive(Debug, Clone, Serialize, Deserialize)]
391#[serde(untagged)]
392pub enum RebuildDependencyMapError {
393    UnknownValue(serde_json::Value),
394}
395
396/// struct for typed errors of method [`run_slack_message_test_job`]
397#[derive(Debug, Clone, Serialize, Deserialize)]
398#[serde(untagged)]
399pub enum RunSlackMessageTestJobError {
400    UnknownValue(serde_json::Value),
401}
402
403/// struct for typed errors of method [`run_teams_message_test_job`]
404#[derive(Debug, Clone, Serialize, Deserialize)]
405#[serde(untagged)]
406pub enum RunTeamsMessageTestJobError {
407    UnknownValue(serde_json::Value),
408}
409
410/// struct for typed errors of method [`set_environment_variable`]
411#[derive(Debug, Clone, Serialize, Deserialize)]
412#[serde(untagged)]
413pub enum SetEnvironmentVariableError {
414    UnknownValue(serde_json::Value),
415}
416
417/// struct for typed errors of method [`set_threshold_alert`]
418#[derive(Debug, Clone, Serialize, Deserialize)]
419#[serde(untagged)]
420pub enum SetThresholdAlertError {
421    UnknownValue(serde_json::Value),
422}
423
424/// struct for typed errors of method [`set_workspace_encryption_key`]
425#[derive(Debug, Clone, Serialize, Deserialize)]
426#[serde(untagged)]
427pub enum SetWorkspaceEncryptionKeyError {
428    UnknownValue(serde_json::Value),
429}
430
431/// struct for typed errors of method [`unarchive_workspace`]
432#[derive(Debug, Clone, Serialize, Deserialize)]
433#[serde(untagged)]
434pub enum UnarchiveWorkspaceError {
435    UnknownValue(serde_json::Value),
436}
437
438/// struct for typed errors of method [`update_operator_settings`]
439#[derive(Debug, Clone, Serialize, Deserialize)]
440#[serde(untagged)]
441pub enum UpdateOperatorSettingsError {
442    UnknownValue(serde_json::Value),
443}
444
445
446pub async fn add_user(configuration: &configuration::Configuration, workspace: &str, add_user_request: models::AddUserRequest) -> Result<String, Error<AddUserError>> {
447    let local_var_configuration = configuration;
448
449    let local_var_client = &local_var_configuration.client;
450
451    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/add_user", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
452    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
453
454    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
455        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
456    }
457    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
458        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
459    };
460    local_var_req_builder = local_var_req_builder.json(&add_user_request);
461
462    let local_var_req = local_var_req_builder.build()?;
463    let local_var_resp = local_var_client.execute(local_var_req).await?;
464
465    let local_var_status = local_var_resp.status();
466    let local_var_content = local_var_resp.text().await?;
467
468    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
469        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
470    } else {
471        let local_var_entity: Option<AddUserError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
472        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
473        Err(Error::ResponseError(local_var_error))
474    }
475}
476
477pub async fn archive_workspace(configuration: &configuration::Configuration, workspace: &str) -> Result<String, Error<ArchiveWorkspaceError>> {
478    let local_var_configuration = configuration;
479
480    let local_var_client = &local_var_configuration.client;
481
482    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/archive", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
483    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
484
485    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
486        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
487    }
488    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
489        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
490    };
491
492    let local_var_req = local_var_req_builder.build()?;
493    let local_var_resp = local_var_client.execute(local_var_req).await?;
494
495    let local_var_status = local_var_resp.status();
496    let local_var_content = local_var_resp.text().await?;
497
498    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
499        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
500    } else {
501        let local_var_entity: Option<ArchiveWorkspaceError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
502        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
503        Err(Error::ResponseError(local_var_error))
504    }
505}
506
507pub async fn change_workspace_color(configuration: &configuration::Configuration, workspace: &str, change_workspace_color_request: Option<models::ChangeWorkspaceColorRequest>) -> Result<String, Error<ChangeWorkspaceColorError>> {
508    let local_var_configuration = configuration;
509
510    let local_var_client = &local_var_configuration.client;
511
512    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/change_workspace_color", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
513    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
514
515    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
516        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
517    }
518    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
519        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
520    };
521    local_var_req_builder = local_var_req_builder.json(&change_workspace_color_request);
522
523    let local_var_req = local_var_req_builder.build()?;
524    let local_var_resp = local_var_client.execute(local_var_req).await?;
525
526    let local_var_status = local_var_resp.status();
527    let local_var_content = local_var_resp.text().await?;
528
529    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
530        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
531    } else {
532        let local_var_entity: Option<ChangeWorkspaceColorError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
533        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
534        Err(Error::ResponseError(local_var_error))
535    }
536}
537
538pub async fn change_workspace_id(configuration: &configuration::Configuration, workspace: &str, change_workspace_id_request: Option<models::ChangeWorkspaceIdRequest>) -> Result<String, Error<ChangeWorkspaceIdError>> {
539    let local_var_configuration = configuration;
540
541    let local_var_client = &local_var_configuration.client;
542
543    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/change_workspace_id", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
544    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
545
546    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
547        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
548    }
549    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
550        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
551    };
552    local_var_req_builder = local_var_req_builder.json(&change_workspace_id_request);
553
554    let local_var_req = local_var_req_builder.build()?;
555    let local_var_resp = local_var_client.execute(local_var_req).await?;
556
557    let local_var_status = local_var_resp.status();
558    let local_var_content = local_var_resp.text().await?;
559
560    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
561        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
562    } else {
563        let local_var_entity: Option<ChangeWorkspaceIdError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
564        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
565        Err(Error::ResponseError(local_var_error))
566    }
567}
568
569pub async fn change_workspace_name(configuration: &configuration::Configuration, workspace: &str, change_workspace_name_request: Option<models::ChangeWorkspaceNameRequest>) -> Result<String, Error<ChangeWorkspaceNameError>> {
570    let local_var_configuration = configuration;
571
572    let local_var_client = &local_var_configuration.client;
573
574    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/change_workspace_name", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
575    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
576
577    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
578        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
579    }
580    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
581        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
582    };
583    local_var_req_builder = local_var_req_builder.json(&change_workspace_name_request);
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<ChangeWorkspaceNameError> = 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 connect_teams(configuration: &configuration::Configuration, workspace: &str, connect_teams_request: models::ConnectTeamsRequest) -> Result<String, Error<ConnectTeamsError>> {
601    let local_var_configuration = configuration;
602
603    let local_var_client = &local_var_configuration.client;
604
605    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/connect_teams", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
606    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, 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    local_var_req_builder = local_var_req_builder.json(&connect_teams_request);
615
616    let local_var_req = local_var_req_builder.build()?;
617    let local_var_resp = local_var_client.execute(local_var_req).await?;
618
619    let local_var_status = local_var_resp.status();
620    let local_var_content = local_var_resp.text().await?;
621
622    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
623        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
624    } else {
625        let local_var_entity: Option<ConnectTeamsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
626        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
627        Err(Error::ResponseError(local_var_error))
628    }
629}
630
631pub async fn create_workspace(configuration: &configuration::Configuration, create_workspace: models::CreateWorkspace) -> Result<String, Error<CreateWorkspaceError>> {
632    let local_var_configuration = configuration;
633
634    let local_var_client = &local_var_configuration.client;
635
636    let local_var_uri_str = format!("{}/workspaces/create", local_var_configuration.base_path);
637    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
638
639    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
640        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
641    }
642    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
643        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
644    };
645    local_var_req_builder = local_var_req_builder.json(&create_workspace);
646
647    let local_var_req = local_var_req_builder.build()?;
648    let local_var_resp = local_var_client.execute(local_var_req).await?;
649
650    let local_var_status = local_var_resp.status();
651    let local_var_content = local_var_resp.text().await?;
652
653    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
654        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
655    } else {
656        let local_var_entity: Option<CreateWorkspaceError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
657        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
658        Err(Error::ResponseError(local_var_error))
659    }
660}
661
662pub async fn create_workspace_fork(configuration: &configuration::Configuration, create_workspace_fork: models::CreateWorkspaceFork) -> Result<String, Error<CreateWorkspaceForkError>> {
663    let local_var_configuration = configuration;
664
665    let local_var_client = &local_var_configuration.client;
666
667    let local_var_uri_str = format!("{}/workspaces/create_fork", local_var_configuration.base_path);
668    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
669
670    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
671        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
672    }
673    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
674        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
675    };
676    local_var_req_builder = local_var_req_builder.json(&create_workspace_fork);
677
678    let local_var_req = local_var_req_builder.build()?;
679    let local_var_resp = local_var_client.execute(local_var_req).await?;
680
681    let local_var_status = local_var_resp.status();
682    let local_var_content = local_var_resp.text().await?;
683
684    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
685        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
686    } else {
687        let local_var_entity: Option<CreateWorkspaceForkError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
688        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
689        Err(Error::ResponseError(local_var_error))
690    }
691}
692
693pub async fn delete_git_sync_repository(configuration: &configuration::Configuration, workspace: &str, delete_git_sync_repository_request: models::DeleteGitSyncRepositoryRequest) -> Result<serde_json::Value, Error<DeleteGitSyncRepositoryError>> {
694    let local_var_configuration = configuration;
695
696    let local_var_client = &local_var_configuration.client;
697
698    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/delete_git_sync_repository", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
699    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
700
701    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
702        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
703    }
704    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
705        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
706    };
707    local_var_req_builder = local_var_req_builder.json(&delete_git_sync_repository_request);
708
709    let local_var_req = local_var_req_builder.build()?;
710    let local_var_resp = local_var_client.execute(local_var_req).await?;
711
712    let local_var_status = local_var_resp.status();
713    let local_var_content = local_var_resp.text().await?;
714
715    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
716        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
717    } else {
718        let local_var_entity: Option<DeleteGitSyncRepositoryError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
719        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
720        Err(Error::ResponseError(local_var_error))
721    }
722}
723
724pub async fn delete_invite(configuration: &configuration::Configuration, workspace: &str, delete_invite_request: models::DeleteInviteRequest) -> Result<String, Error<DeleteInviteError>> {
725    let local_var_configuration = configuration;
726
727    let local_var_client = &local_var_configuration.client;
728
729    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/delete_invite", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
730    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
731
732    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
733        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
734    }
735    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
736        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
737    };
738    local_var_req_builder = local_var_req_builder.json(&delete_invite_request);
739
740    let local_var_req = local_var_req_builder.build()?;
741    let local_var_resp = local_var_client.execute(local_var_req).await?;
742
743    let local_var_status = local_var_resp.status();
744    let local_var_content = local_var_resp.text().await?;
745
746    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
747        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
748    } else {
749        let local_var_entity: Option<DeleteInviteError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
750        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
751        Err(Error::ResponseError(local_var_error))
752    }
753}
754
755pub async fn delete_workspace(configuration: &configuration::Configuration, workspace: &str) -> Result<String, Error<DeleteWorkspaceError>> {
756    let local_var_configuration = configuration;
757
758    let local_var_client = &local_var_configuration.client;
759
760    let local_var_uri_str = format!("{}/workspaces/delete/{workspace}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
761    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
762
763    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
764        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
765    }
766    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
767        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
768    };
769
770    let local_var_req = local_var_req_builder.build()?;
771    let local_var_resp = local_var_client.execute(local_var_req).await?;
772
773    let local_var_status = local_var_resp.status();
774    let local_var_content = local_var_resp.text().await?;
775
776    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
777        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
778    } else {
779        let local_var_entity: Option<DeleteWorkspaceError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
780        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
781        Err(Error::ResponseError(local_var_error))
782    }
783}
784
785pub async fn edit_auto_invite(configuration: &configuration::Configuration, workspace: &str, edit_auto_invite_request: models::EditAutoInviteRequest) -> Result<String, Error<EditAutoInviteError>> {
786    let local_var_configuration = configuration;
787
788    let local_var_client = &local_var_configuration.client;
789
790    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_auto_invite", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
791    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
792
793    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
794        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
795    }
796    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
797        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
798    };
799    local_var_req_builder = local_var_req_builder.json(&edit_auto_invite_request);
800
801    let local_var_req = local_var_req_builder.build()?;
802    let local_var_resp = local_var_client.execute(local_var_req).await?;
803
804    let local_var_status = local_var_resp.status();
805    let local_var_content = local_var_resp.text().await?;
806
807    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
808        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
809    } else {
810        let local_var_entity: Option<EditAutoInviteError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
811        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
812        Err(Error::ResponseError(local_var_error))
813    }
814}
815
816pub async fn edit_copilot_config(configuration: &configuration::Configuration, workspace: &str, ai_config: models::AiConfig) -> Result<String, Error<EditCopilotConfigError>> {
817    let local_var_configuration = configuration;
818
819    let local_var_client = &local_var_configuration.client;
820
821    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_copilot_config", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
822    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
823
824    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
825        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
826    }
827    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
828        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
829    };
830    local_var_req_builder = local_var_req_builder.json(&ai_config);
831
832    let local_var_req = local_var_req_builder.build()?;
833    let local_var_resp = local_var_client.execute(local_var_req).await?;
834
835    let local_var_status = local_var_resp.status();
836    let local_var_content = local_var_resp.text().await?;
837
838    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
839        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
840    } else {
841        let local_var_entity: Option<EditCopilotConfigError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
842        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
843        Err(Error::ResponseError(local_var_error))
844    }
845}
846
847pub async fn edit_default_scripts(configuration: &configuration::Configuration, workspace: &str, workspace_default_scripts: Option<models::WorkspaceDefaultScripts>) -> Result<String, Error<EditDefaultScriptsError>> {
848    let local_var_configuration = configuration;
849
850    let local_var_client = &local_var_configuration.client;
851
852    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/default_scripts", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
853    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
854
855    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
856        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
857    }
858    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
859        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
860    };
861    local_var_req_builder = local_var_req_builder.json(&workspace_default_scripts);
862
863    let local_var_req = local_var_req_builder.build()?;
864    let local_var_resp = local_var_client.execute(local_var_req).await?;
865
866    let local_var_status = local_var_resp.status();
867    let local_var_content = local_var_resp.text().await?;
868
869    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
870        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
871    } else {
872        let local_var_entity: Option<EditDefaultScriptsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
873        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
874        Err(Error::ResponseError(local_var_error))
875    }
876}
877
878pub async fn edit_deploy_to(configuration: &configuration::Configuration, workspace: &str, get_deploy_to200_response: models::GetDeployTo200Response) -> Result<String, Error<EditDeployToError>> {
879    let local_var_configuration = configuration;
880
881    let local_var_client = &local_var_configuration.client;
882
883    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_deploy_to", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
884    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
885
886    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
887        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
888    }
889    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
890        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
891    };
892    local_var_req_builder = local_var_req_builder.json(&get_deploy_to200_response);
893
894    let local_var_req = local_var_req_builder.build()?;
895    let local_var_resp = local_var_client.execute(local_var_req).await?;
896
897    let local_var_status = local_var_resp.status();
898    let local_var_content = local_var_resp.text().await?;
899
900    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
901        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
902    } else {
903        let local_var_entity: Option<EditDeployToError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
904        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
905        Err(Error::ResponseError(local_var_error))
906    }
907}
908
909pub async fn edit_ducklake_config(configuration: &configuration::Configuration, workspace: &str, edit_ducklake_config_request: models::EditDucklakeConfigRequest) -> Result<serde_json::Value, Error<EditDucklakeConfigError>> {
910    let local_var_configuration = configuration;
911
912    let local_var_client = &local_var_configuration.client;
913
914    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_ducklake_config", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
915    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
916
917    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
918        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
919    }
920    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
921        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
922    };
923    local_var_req_builder = local_var_req_builder.json(&edit_ducklake_config_request);
924
925    let local_var_req = local_var_req_builder.build()?;
926    let local_var_resp = local_var_client.execute(local_var_req).await?;
927
928    let local_var_status = local_var_resp.status();
929    let local_var_content = local_var_resp.text().await?;
930
931    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
932        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
933    } else {
934        let local_var_entity: Option<EditDucklakeConfigError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
935        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
936        Err(Error::ResponseError(local_var_error))
937    }
938}
939
940pub async fn edit_error_handler(configuration: &configuration::Configuration, workspace: &str, edit_error_handler_request: models::EditErrorHandlerRequest) -> Result<String, Error<EditErrorHandlerError>> {
941    let local_var_configuration = configuration;
942
943    let local_var_client = &local_var_configuration.client;
944
945    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_error_handler", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
946    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
947
948    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
949        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
950    }
951    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
952        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
953    };
954    local_var_req_builder = local_var_req_builder.json(&edit_error_handler_request);
955
956    let local_var_req = local_var_req_builder.build()?;
957    let local_var_resp = local_var_client.execute(local_var_req).await?;
958
959    let local_var_status = local_var_resp.status();
960    let local_var_content = local_var_resp.text().await?;
961
962    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
963        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
964    } else {
965        let local_var_entity: Option<EditErrorHandlerError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
966        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
967        Err(Error::ResponseError(local_var_error))
968    }
969}
970
971pub async fn edit_git_sync_repository(configuration: &configuration::Configuration, workspace: &str, edit_git_sync_repository_request: models::EditGitSyncRepositoryRequest) -> Result<serde_json::Value, Error<EditGitSyncRepositoryError>> {
972    let local_var_configuration = configuration;
973
974    let local_var_client = &local_var_configuration.client;
975
976    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_git_sync_repository", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
977    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
978
979    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
980        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
981    }
982    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
983        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
984    };
985    local_var_req_builder = local_var_req_builder.json(&edit_git_sync_repository_request);
986
987    let local_var_req = local_var_req_builder.build()?;
988    let local_var_resp = local_var_client.execute(local_var_req).await?;
989
990    let local_var_status = local_var_resp.status();
991    let local_var_content = local_var_resp.text().await?;
992
993    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
994        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
995    } else {
996        let local_var_entity: Option<EditGitSyncRepositoryError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
997        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
998        Err(Error::ResponseError(local_var_error))
999    }
1000}
1001
1002pub async fn edit_instance_groups(configuration: &configuration::Configuration, workspace: &str, edit_instance_groups_request: models::EditInstanceGroupsRequest) -> Result<String, Error<EditInstanceGroupsError>> {
1003    let local_var_configuration = configuration;
1004
1005    let local_var_client = &local_var_configuration.client;
1006
1007    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_instance_groups", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1008    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1009
1010    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1011        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1012    }
1013    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1014        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1015    };
1016    local_var_req_builder = local_var_req_builder.json(&edit_instance_groups_request);
1017
1018    let local_var_req = local_var_req_builder.build()?;
1019    let local_var_resp = local_var_client.execute(local_var_req).await?;
1020
1021    let local_var_status = local_var_resp.status();
1022    let local_var_content = local_var_resp.text().await?;
1023
1024    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1025        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1026    } else {
1027        let local_var_entity: Option<EditInstanceGroupsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1028        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1029        Err(Error::ResponseError(local_var_error))
1030    }
1031}
1032
1033pub async fn edit_large_file_storage_config(configuration: &configuration::Configuration, workspace: &str, edit_large_file_storage_config_request: models::EditLargeFileStorageConfigRequest) -> Result<serde_json::Value, Error<EditLargeFileStorageConfigError>> {
1034    let local_var_configuration = configuration;
1035
1036    let local_var_client = &local_var_configuration.client;
1037
1038    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_large_file_storage_config", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1039    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1040
1041    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1042        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1043    }
1044    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1045        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1046    };
1047    local_var_req_builder = local_var_req_builder.json(&edit_large_file_storage_config_request);
1048
1049    let local_var_req = local_var_req_builder.build()?;
1050    let local_var_resp = local_var_client.execute(local_var_req).await?;
1051
1052    let local_var_status = local_var_resp.status();
1053    let local_var_content = local_var_resp.text().await?;
1054
1055    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1056        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1057    } else {
1058        let local_var_entity: Option<EditLargeFileStorageConfigError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1059        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1060        Err(Error::ResponseError(local_var_error))
1061    }
1062}
1063
1064pub async fn edit_slack_command(configuration: &configuration::Configuration, workspace: &str, edit_slack_command_request: models::EditSlackCommandRequest) -> Result<String, Error<EditSlackCommandError>> {
1065    let local_var_configuration = configuration;
1066
1067    let local_var_client = &local_var_configuration.client;
1068
1069    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_slack_command", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1070    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1071
1072    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1073        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1074    }
1075    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1076        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1077    };
1078    local_var_req_builder = local_var_req_builder.json(&edit_slack_command_request);
1079
1080    let local_var_req = local_var_req_builder.build()?;
1081    let local_var_resp = local_var_client.execute(local_var_req).await?;
1082
1083    let local_var_status = local_var_resp.status();
1084    let local_var_content = local_var_resp.text().await?;
1085
1086    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1087        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1088    } else {
1089        let local_var_entity: Option<EditSlackCommandError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1090        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1091        Err(Error::ResponseError(local_var_error))
1092    }
1093}
1094
1095pub async fn edit_teams_command(configuration: &configuration::Configuration, workspace: &str, edit_slack_command_request: models::EditSlackCommandRequest) -> Result<String, Error<EditTeamsCommandError>> {
1096    let local_var_configuration = configuration;
1097
1098    let local_var_client = &local_var_configuration.client;
1099
1100    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_teams_command", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1101    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1102
1103    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1104        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1105    }
1106    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1107        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1108    };
1109    local_var_req_builder = local_var_req_builder.json(&edit_slack_command_request);
1110
1111    let local_var_req = local_var_req_builder.build()?;
1112    let local_var_resp = local_var_client.execute(local_var_req).await?;
1113
1114    let local_var_status = local_var_resp.status();
1115    let local_var_content = local_var_resp.text().await?;
1116
1117    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1118        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1119    } else {
1120        let local_var_entity: Option<EditTeamsCommandError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1121        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1122        Err(Error::ResponseError(local_var_error))
1123    }
1124}
1125
1126pub async fn edit_webhook(configuration: &configuration::Configuration, workspace: &str, edit_webhook_request: models::EditWebhookRequest) -> Result<String, Error<EditWebhookError>> {
1127    let local_var_configuration = configuration;
1128
1129    let local_var_client = &local_var_configuration.client;
1130
1131    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_webhook", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1132    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1133
1134    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1135        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1136    }
1137    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1138        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1139    };
1140    local_var_req_builder = local_var_req_builder.json(&edit_webhook_request);
1141
1142    let local_var_req = local_var_req_builder.build()?;
1143    let local_var_resp = local_var_client.execute(local_var_req).await?;
1144
1145    let local_var_status = local_var_resp.status();
1146    let local_var_content = local_var_resp.text().await?;
1147
1148    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1149        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1150    } else {
1151        let local_var_entity: Option<EditWebhookError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1152        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1153        Err(Error::ResponseError(local_var_error))
1154    }
1155}
1156
1157pub async fn edit_workspace_default_app(configuration: &configuration::Configuration, workspace: &str, edit_workspace_default_app_request: models::EditWorkspaceDefaultAppRequest) -> Result<String, Error<EditWorkspaceDefaultAppError>> {
1158    let local_var_configuration = configuration;
1159
1160    let local_var_client = &local_var_configuration.client;
1161
1162    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_default_app", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1163    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1164
1165    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1166        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1167    }
1168    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1169        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1170    };
1171    local_var_req_builder = local_var_req_builder.json(&edit_workspace_default_app_request);
1172
1173    let local_var_req = local_var_req_builder.build()?;
1174    let local_var_resp = local_var_client.execute(local_var_req).await?;
1175
1176    let local_var_status = local_var_resp.status();
1177    let local_var_content = local_var_resp.text().await?;
1178
1179    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1180        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1181    } else {
1182        let local_var_entity: Option<EditWorkspaceDefaultAppError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1183        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1184        Err(Error::ResponseError(local_var_error))
1185    }
1186}
1187
1188pub async fn edit_workspace_deploy_ui_settings(configuration: &configuration::Configuration, workspace: &str, edit_workspace_deploy_ui_settings_request: models::EditWorkspaceDeployUiSettingsRequest) -> Result<serde_json::Value, Error<EditWorkspaceDeployUiSettingsError>> {
1189    let local_var_configuration = configuration;
1190
1191    let local_var_client = &local_var_configuration.client;
1192
1193    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_deploy_ui_config", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1194    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1195
1196    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1197        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1198    }
1199    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1200        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1201    };
1202    local_var_req_builder = local_var_req_builder.json(&edit_workspace_deploy_ui_settings_request);
1203
1204    let local_var_req = local_var_req_builder.build()?;
1205    let local_var_resp = local_var_client.execute(local_var_req).await?;
1206
1207    let local_var_status = local_var_resp.status();
1208    let local_var_content = local_var_resp.text().await?;
1209
1210    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1211        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1212    } else {
1213        let local_var_entity: Option<EditWorkspaceDeployUiSettingsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1214        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1215        Err(Error::ResponseError(local_var_error))
1216    }
1217}
1218
1219pub async fn edit_workspace_git_sync_config(configuration: &configuration::Configuration, workspace: &str, edit_workspace_git_sync_config_request: models::EditWorkspaceGitSyncConfigRequest) -> Result<serde_json::Value, Error<EditWorkspaceGitSyncConfigError>> {
1220    let local_var_configuration = configuration;
1221
1222    let local_var_client = &local_var_configuration.client;
1223
1224    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_git_sync_config", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1225    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1226
1227    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1228        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1229    }
1230    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1231        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1232    };
1233    local_var_req_builder = local_var_req_builder.json(&edit_workspace_git_sync_config_request);
1234
1235    let local_var_req = local_var_req_builder.build()?;
1236    let local_var_resp = local_var_client.execute(local_var_req).await?;
1237
1238    let local_var_status = local_var_resp.status();
1239    let local_var_content = local_var_resp.text().await?;
1240
1241    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1242        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1243    } else {
1244        let local_var_entity: Option<EditWorkspaceGitSyncConfigError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1245        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1246        Err(Error::ResponseError(local_var_error))
1247    }
1248}
1249
1250pub async fn exists_username(configuration: &configuration::Configuration, exists_username_request: models::ExistsUsernameRequest) -> Result<bool, Error<ExistsUsernameError>> {
1251    let local_var_configuration = configuration;
1252
1253    let local_var_client = &local_var_configuration.client;
1254
1255    let local_var_uri_str = format!("{}/workspaces/exists_username", local_var_configuration.base_path);
1256    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1257
1258    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1259        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1260    }
1261    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1262        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1263    };
1264    local_var_req_builder = local_var_req_builder.json(&exists_username_request);
1265
1266    let local_var_req = local_var_req_builder.build()?;
1267    let local_var_resp = local_var_client.execute(local_var_req).await?;
1268
1269    let local_var_status = local_var_resp.status();
1270    let local_var_content = local_var_resp.text().await?;
1271
1272    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1273        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1274    } else {
1275        let local_var_entity: Option<ExistsUsernameError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1276        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1277        Err(Error::ResponseError(local_var_error))
1278    }
1279}
1280
1281pub async fn exists_workspace(configuration: &configuration::Configuration, exists_workspace_request: models::ExistsWorkspaceRequest) -> Result<bool, Error<ExistsWorkspaceError>> {
1282    let local_var_configuration = configuration;
1283
1284    let local_var_client = &local_var_configuration.client;
1285
1286    let local_var_uri_str = format!("{}/workspaces/exists", local_var_configuration.base_path);
1287    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1288
1289    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1290        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1291    }
1292    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1293        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1294    };
1295    local_var_req_builder = local_var_req_builder.json(&exists_workspace_request);
1296
1297    let local_var_req = local_var_req_builder.build()?;
1298    let local_var_resp = local_var_client.execute(local_var_req).await?;
1299
1300    let local_var_status = local_var_resp.status();
1301    let local_var_content = local_var_resp.text().await?;
1302
1303    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1304        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1305    } else {
1306        let local_var_entity: Option<ExistsWorkspaceError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1307        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1308        Err(Error::ResponseError(local_var_error))
1309    }
1310}
1311
1312pub async fn get_copilot_info(configuration: &configuration::Configuration, workspace: &str) -> Result<models::AiConfig, Error<GetCopilotInfoError>> {
1313    let local_var_configuration = configuration;
1314
1315    let local_var_client = &local_var_configuration.client;
1316
1317    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_copilot_info", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1318    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1319
1320    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1321        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1322    }
1323    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1324        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1325    };
1326
1327    let local_var_req = local_var_req_builder.build()?;
1328    let local_var_resp = local_var_client.execute(local_var_req).await?;
1329
1330    let local_var_status = local_var_resp.status();
1331    let local_var_content = local_var_resp.text().await?;
1332
1333    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1334        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1335    } else {
1336        let local_var_entity: Option<GetCopilotInfoError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1337        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1338        Err(Error::ResponseError(local_var_error))
1339    }
1340}
1341
1342pub async fn get_default_scripts(configuration: &configuration::Configuration, workspace: &str) -> Result<models::WorkspaceDefaultScripts, Error<GetDefaultScriptsError>> {
1343    let local_var_configuration = configuration;
1344
1345    let local_var_client = &local_var_configuration.client;
1346
1347    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/default_scripts", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1348    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1349
1350    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1351        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1352    }
1353    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1354        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1355    };
1356
1357    let local_var_req = local_var_req_builder.build()?;
1358    let local_var_resp = local_var_client.execute(local_var_req).await?;
1359
1360    let local_var_status = local_var_resp.status();
1361    let local_var_content = local_var_resp.text().await?;
1362
1363    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1364        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1365    } else {
1366        let local_var_entity: Option<GetDefaultScriptsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1367        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1368        Err(Error::ResponseError(local_var_error))
1369    }
1370}
1371
1372pub async fn get_dependency_map(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<models::DependencyMap>, Error<GetDependencyMapError>> {
1373    let local_var_configuration = configuration;
1374
1375    let local_var_client = &local_var_configuration.client;
1376
1377    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_dependency_map", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1378    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1379
1380    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1381        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1382    }
1383    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1384        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1385    };
1386
1387    let local_var_req = local_var_req_builder.build()?;
1388    let local_var_resp = local_var_client.execute(local_var_req).await?;
1389
1390    let local_var_status = local_var_resp.status();
1391    let local_var_content = local_var_resp.text().await?;
1392
1393    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1394        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1395    } else {
1396        let local_var_entity: Option<GetDependencyMapError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1397        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1398        Err(Error::ResponseError(local_var_error))
1399    }
1400}
1401
1402pub async fn get_deploy_to(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetDeployTo200Response, Error<GetDeployToError>> {
1403    let local_var_configuration = configuration;
1404
1405    let local_var_client = &local_var_configuration.client;
1406
1407    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_deploy_to", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1408    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1409
1410    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1411        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1412    }
1413    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1414        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1415    };
1416
1417    let local_var_req = local_var_req_builder.build()?;
1418    let local_var_resp = local_var_client.execute(local_var_req).await?;
1419
1420    let local_var_status = local_var_resp.status();
1421    let local_var_content = local_var_resp.text().await?;
1422
1423    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1424        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1425    } else {
1426        let local_var_entity: Option<GetDeployToError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1427        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1428        Err(Error::ResponseError(local_var_error))
1429    }
1430}
1431
1432pub async fn get_github_app_token(configuration: &configuration::Configuration, workspace: &str, get_github_app_token_request: models::GetGithubAppTokenRequest) -> Result<models::GetGithubAppToken200Response, Error<GetGithubAppTokenError>> {
1433    let local_var_configuration = configuration;
1434
1435    let local_var_client = &local_var_configuration.client;
1436
1437    let local_var_uri_str = format!("{}/w/{workspace}/github_app/token", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1438    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1439
1440    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1441        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1442    }
1443    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1444        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1445    };
1446    local_var_req_builder = local_var_req_builder.json(&get_github_app_token_request);
1447
1448    let local_var_req = local_var_req_builder.build()?;
1449    let local_var_resp = local_var_client.execute(local_var_req).await?;
1450
1451    let local_var_status = local_var_resp.status();
1452    let local_var_content = local_var_resp.text().await?;
1453
1454    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1455        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1456    } else {
1457        let local_var_entity: Option<GetGithubAppTokenError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1458        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1459        Err(Error::ResponseError(local_var_error))
1460    }
1461}
1462
1463pub async fn get_is_premium(configuration: &configuration::Configuration, workspace: &str) -> Result<bool, Error<GetIsPremiumError>> {
1464    let local_var_configuration = configuration;
1465
1466    let local_var_client = &local_var_configuration.client;
1467
1468    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/is_premium", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1469    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1470
1471    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1472        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1473    }
1474    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1475        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1476    };
1477
1478    let local_var_req = local_var_req_builder.build()?;
1479    let local_var_resp = local_var_client.execute(local_var_req).await?;
1480
1481    let local_var_status = local_var_resp.status();
1482    let local_var_content = local_var_resp.text().await?;
1483
1484    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1485        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1486    } else {
1487        let local_var_entity: Option<GetIsPremiumError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1488        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1489        Err(Error::ResponseError(local_var_error))
1490    }
1491}
1492
1493pub async fn get_large_file_storage_config(configuration: &configuration::Configuration, workspace: &str) -> Result<models::LargeFileStorage, Error<GetLargeFileStorageConfigError>> {
1494    let local_var_configuration = configuration;
1495
1496    let local_var_client = &local_var_configuration.client;
1497
1498    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_large_file_storage_config", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1499    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1500
1501    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1502        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1503    }
1504    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1505        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1506    };
1507
1508    let local_var_req = local_var_req_builder.build()?;
1509    let local_var_resp = local_var_client.execute(local_var_req).await?;
1510
1511    let local_var_status = local_var_resp.status();
1512    let local_var_content = local_var_resp.text().await?;
1513
1514    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1515        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1516    } else {
1517        let local_var_entity: Option<GetLargeFileStorageConfigError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1518        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1519        Err(Error::ResponseError(local_var_error))
1520    }
1521}
1522
1523pub async fn get_premium_info(configuration: &configuration::Configuration, workspace: &str, skip_subscription_fetch: Option<bool>) -> Result<models::GetPremiumInfo200Response, Error<GetPremiumInfoError>> {
1524    let local_var_configuration = configuration;
1525
1526    let local_var_client = &local_var_configuration.client;
1527
1528    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/premium_info", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1529    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1530
1531    if let Some(ref local_var_str) = skip_subscription_fetch {
1532        local_var_req_builder = local_var_req_builder.query(&[("skip_subscription_fetch", &local_var_str.to_string())]);
1533    }
1534    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1535        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1536    }
1537    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1538        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1539    };
1540
1541    let local_var_req = local_var_req_builder.build()?;
1542    let local_var_resp = local_var_client.execute(local_var_req).await?;
1543
1544    let local_var_status = local_var_resp.status();
1545    let local_var_content = local_var_resp.text().await?;
1546
1547    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1548        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1549    } else {
1550        let local_var_entity: Option<GetPremiumInfoError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1551        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1552        Err(Error::ResponseError(local_var_error))
1553    }
1554}
1555
1556pub async fn get_settings(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetSettings200Response, Error<GetSettingsError>> {
1557    let local_var_configuration = configuration;
1558
1559    let local_var_client = &local_var_configuration.client;
1560
1561    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_settings", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1562    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1563
1564    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1565        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1566    }
1567    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1568        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1569    };
1570
1571    let local_var_req = local_var_req_builder.build()?;
1572    let local_var_resp = local_var_client.execute(local_var_req).await?;
1573
1574    let local_var_status = local_var_resp.status();
1575    let local_var_content = local_var_resp.text().await?;
1576
1577    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1578        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1579    } else {
1580        let local_var_entity: Option<GetSettingsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1581        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1582        Err(Error::ResponseError(local_var_error))
1583    }
1584}
1585
1586pub async fn get_threshold_alert(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetThresholdAlert200Response, Error<GetThresholdAlertError>> {
1587    let local_var_configuration = configuration;
1588
1589    let local_var_client = &local_var_configuration.client;
1590
1591    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/threshold_alert", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1592    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1593
1594    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1595        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1596    }
1597    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1598        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1599    };
1600
1601    let local_var_req = local_var_req_builder.build()?;
1602    let local_var_resp = local_var_client.execute(local_var_req).await?;
1603
1604    let local_var_status = local_var_resp.status();
1605    let local_var_content = local_var_resp.text().await?;
1606
1607    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1608        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1609    } else {
1610        let local_var_entity: Option<GetThresholdAlertError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1611        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1612        Err(Error::ResponseError(local_var_error))
1613    }
1614}
1615
1616pub async fn get_used_triggers(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetUsedTriggers200Response, Error<GetUsedTriggersError>> {
1617    let local_var_configuration = configuration;
1618
1619    let local_var_client = &local_var_configuration.client;
1620
1621    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/used_triggers", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1622    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1623
1624    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1625        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1626    }
1627    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1628        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1629    };
1630
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<GetUsedTriggersError> = 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 get_workspace_default_app(configuration: &configuration::Configuration, workspace: &str) -> Result<models::EditWorkspaceDefaultAppRequest, Error<GetWorkspaceDefaultAppError>> {
1647    let local_var_configuration = configuration;
1648
1649    let local_var_client = &local_var_configuration.client;
1650
1651    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/default_app", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1652    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, 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
1661    let local_var_req = local_var_req_builder.build()?;
1662    let local_var_resp = local_var_client.execute(local_var_req).await?;
1663
1664    let local_var_status = local_var_resp.status();
1665    let local_var_content = local_var_resp.text().await?;
1666
1667    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1668        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1669    } else {
1670        let local_var_entity: Option<GetWorkspaceDefaultAppError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1671        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1672        Err(Error::ResponseError(local_var_error))
1673    }
1674}
1675
1676pub async fn get_workspace_encryption_key(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetWorkspaceEncryptionKey200Response, Error<GetWorkspaceEncryptionKeyError>> {
1677    let local_var_configuration = configuration;
1678
1679    let local_var_client = &local_var_configuration.client;
1680
1681    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/encryption_key", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1682    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1683
1684    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1685        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1686    }
1687    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1688        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1689    };
1690
1691    let local_var_req = local_var_req_builder.build()?;
1692    let local_var_resp = local_var_client.execute(local_var_req).await?;
1693
1694    let local_var_status = local_var_resp.status();
1695    let local_var_content = local_var_resp.text().await?;
1696
1697    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1698        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1699    } else {
1700        let local_var_entity: Option<GetWorkspaceEncryptionKeyError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1701        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1702        Err(Error::ResponseError(local_var_error))
1703    }
1704}
1705
1706pub async fn get_workspace_name(configuration: &configuration::Configuration, workspace: &str) -> Result<String, Error<GetWorkspaceNameError>> {
1707    let local_var_configuration = configuration;
1708
1709    let local_var_client = &local_var_configuration.client;
1710
1711    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_workspace_name", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1712    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1713
1714    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1715        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1716    }
1717    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1718        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1719    };
1720
1721    let local_var_req = local_var_req_builder.build()?;
1722    let local_var_resp = local_var_client.execute(local_var_req).await?;
1723
1724    let local_var_status = local_var_resp.status();
1725    let local_var_content = local_var_resp.text().await?;
1726
1727    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1728        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1729    } else {
1730        let local_var_entity: Option<GetWorkspaceNameError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1731        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1732        Err(Error::ResponseError(local_var_error))
1733    }
1734}
1735
1736pub async fn get_workspace_usage(configuration: &configuration::Configuration, workspace: &str) -> Result<f64, Error<GetWorkspaceUsageError>> {
1737    let local_var_configuration = configuration;
1738
1739    let local_var_client = &local_var_configuration.client;
1740
1741    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/usage", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1742    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1743
1744    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1745        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1746    }
1747    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1748        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1749    };
1750
1751    let local_var_req = local_var_req_builder.build()?;
1752    let local_var_resp = local_var_client.execute(local_var_req).await?;
1753
1754    let local_var_status = local_var_resp.status();
1755    let local_var_content = local_var_resp.text().await?;
1756
1757    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1758        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1759    } else {
1760        let local_var_entity: Option<GetWorkspaceUsageError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1761        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1762        Err(Error::ResponseError(local_var_error))
1763    }
1764}
1765
1766pub async fn invite_user(configuration: &configuration::Configuration, workspace: &str, invite_user_request: models::InviteUserRequest) -> Result<String, Error<InviteUserError>> {
1767    let local_var_configuration = configuration;
1768
1769    let local_var_client = &local_var_configuration.client;
1770
1771    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/invite_user", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1772    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1773
1774    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1775        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1776    }
1777    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1778        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1779    };
1780    local_var_req_builder = local_var_req_builder.json(&invite_user_request);
1781
1782    let local_var_req = local_var_req_builder.build()?;
1783    let local_var_resp = local_var_client.execute(local_var_req).await?;
1784
1785    let local_var_status = local_var_resp.status();
1786    let local_var_content = local_var_resp.text().await?;
1787
1788    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1789        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1790    } else {
1791        let local_var_entity: Option<InviteUserError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1792        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1793        Err(Error::ResponseError(local_var_error))
1794    }
1795}
1796
1797pub async fn is_domain_allowed(configuration: &configuration::Configuration, ) -> Result<bool, Error<IsDomainAllowedError>> {
1798    let local_var_configuration = configuration;
1799
1800    let local_var_client = &local_var_configuration.client;
1801
1802    let local_var_uri_str = format!("{}/workspaces/allowed_domain_auto_invite", local_var_configuration.base_path);
1803    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1804
1805    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1806        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1807    }
1808    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1809        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1810    };
1811
1812    let local_var_req = local_var_req_builder.build()?;
1813    let local_var_resp = local_var_client.execute(local_var_req).await?;
1814
1815    let local_var_status = local_var_resp.status();
1816    let local_var_content = local_var_resp.text().await?;
1817
1818    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1819        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1820    } else {
1821        let local_var_entity: Option<IsDomainAllowedError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1822        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1823        Err(Error::ResponseError(local_var_error))
1824    }
1825}
1826
1827pub async fn leave_workspace(configuration: &configuration::Configuration, workspace: &str) -> Result<String, Error<LeaveWorkspaceError>> {
1828    let local_var_configuration = configuration;
1829
1830    let local_var_client = &local_var_configuration.client;
1831
1832    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/leave", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1833    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1834
1835    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1836        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1837    }
1838    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1839        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1840    };
1841
1842    let local_var_req = local_var_req_builder.build()?;
1843    let local_var_resp = local_var_client.execute(local_var_req).await?;
1844
1845    let local_var_status = local_var_resp.status();
1846    let local_var_content = local_var_resp.text().await?;
1847
1848    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1849        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1850    } else {
1851        let local_var_entity: Option<LeaveWorkspaceError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1852        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1853        Err(Error::ResponseError(local_var_error))
1854    }
1855}
1856
1857pub async fn list_available_teams_channels(configuration: &configuration::Configuration, workspace: &str, team_id: &str, search: Option<&str>) -> Result<Vec<models::ListAvailableTeamsChannels200ResponseInner>, Error<ListAvailableTeamsChannelsError>> {
1858    let local_var_configuration = configuration;
1859
1860    let local_var_client = &local_var_configuration.client;
1861
1862    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/available_teams_channels", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1863    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1864
1865    local_var_req_builder = local_var_req_builder.query(&[("team_id", &team_id.to_string())]);
1866    if let Some(ref local_var_str) = search {
1867        local_var_req_builder = local_var_req_builder.query(&[("search", &local_var_str.to_string())]);
1868    }
1869    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1870        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1871    }
1872    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1873        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1874    };
1875
1876    let local_var_req = local_var_req_builder.build()?;
1877    let local_var_resp = local_var_client.execute(local_var_req).await?;
1878
1879    let local_var_status = local_var_resp.status();
1880    let local_var_content = local_var_resp.text().await?;
1881
1882    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1883        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1884    } else {
1885        let local_var_entity: Option<ListAvailableTeamsChannelsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1886        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1887        Err(Error::ResponseError(local_var_error))
1888    }
1889}
1890
1891pub async fn list_available_teams_ids(configuration: &configuration::Configuration, workspace: &str, search: Option<&str>) -> Result<Vec<models::ListAvailableTeamsIds200ResponseInner>, Error<ListAvailableTeamsIdsError>> {
1892    let local_var_configuration = configuration;
1893
1894    let local_var_client = &local_var_configuration.client;
1895
1896    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/available_teams_ids", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1897    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1898
1899    if let Some(ref local_var_str) = search {
1900        local_var_req_builder = local_var_req_builder.query(&[("search", &local_var_str.to_string())]);
1901    }
1902    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1903        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1904    }
1905    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1906        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1907    };
1908
1909    let local_var_req = local_var_req_builder.build()?;
1910    let local_var_resp = local_var_client.execute(local_var_req).await?;
1911
1912    let local_var_status = local_var_resp.status();
1913    let local_var_content = local_var_resp.text().await?;
1914
1915    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1916        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1917    } else {
1918        let local_var_entity: Option<ListAvailableTeamsIdsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1919        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1920        Err(Error::ResponseError(local_var_error))
1921    }
1922}
1923
1924pub async fn list_ducklakes(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<String>, Error<ListDucklakesError>> {
1925    let local_var_configuration = configuration;
1926
1927    let local_var_client = &local_var_configuration.client;
1928
1929    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/list_ducklakes", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1930    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1931
1932    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1933        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1934    }
1935    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1936        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1937    };
1938
1939    let local_var_req = local_var_req_builder.build()?;
1940    let local_var_resp = local_var_client.execute(local_var_req).await?;
1941
1942    let local_var_status = local_var_resp.status();
1943    let local_var_content = local_var_resp.text().await?;
1944
1945    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1946        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1947    } else {
1948        let local_var_entity: Option<ListDucklakesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1949        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1950        Err(Error::ResponseError(local_var_error))
1951    }
1952}
1953
1954pub async fn list_pending_invites(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<models::WorkspaceInvite>, Error<ListPendingInvitesError>> {
1955    let local_var_configuration = configuration;
1956
1957    let local_var_client = &local_var_configuration.client;
1958
1959    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/list_pending_invites", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1960    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1961
1962    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1963        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1964    }
1965    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1966        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1967    };
1968
1969    let local_var_req = local_var_req_builder.build()?;
1970    let local_var_resp = local_var_client.execute(local_var_req).await?;
1971
1972    let local_var_status = local_var_resp.status();
1973    let local_var_content = local_var_resp.text().await?;
1974
1975    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1976        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1977    } else {
1978        let local_var_entity: Option<ListPendingInvitesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1979        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1980        Err(Error::ResponseError(local_var_error))
1981    }
1982}
1983
1984pub async fn list_user_workspaces(configuration: &configuration::Configuration, ) -> Result<models::UserWorkspaceList, Error<ListUserWorkspacesError>> {
1985    let local_var_configuration = configuration;
1986
1987    let local_var_client = &local_var_configuration.client;
1988
1989    let local_var_uri_str = format!("{}/workspaces/users", local_var_configuration.base_path);
1990    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1991
1992    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1993        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1994    }
1995    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1996        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1997    };
1998
1999    let local_var_req = local_var_req_builder.build()?;
2000    let local_var_resp = local_var_client.execute(local_var_req).await?;
2001
2002    let local_var_status = local_var_resp.status();
2003    let local_var_content = local_var_resp.text().await?;
2004
2005    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2006        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2007    } else {
2008        let local_var_entity: Option<ListUserWorkspacesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2009        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2010        Err(Error::ResponseError(local_var_error))
2011    }
2012}
2013
2014pub async fn list_workspaces(configuration: &configuration::Configuration, ) -> Result<Vec<models::Workspace>, Error<ListWorkspacesError>> {
2015    let local_var_configuration = configuration;
2016
2017    let local_var_client = &local_var_configuration.client;
2018
2019    let local_var_uri_str = format!("{}/workspaces/list", local_var_configuration.base_path);
2020    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2021
2022    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2023        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2024    }
2025    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2026        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2027    };
2028
2029    let local_var_req = local_var_req_builder.build()?;
2030    let local_var_resp = local_var_client.execute(local_var_req).await?;
2031
2032    let local_var_status = local_var_resp.status();
2033    let local_var_content = local_var_resp.text().await?;
2034
2035    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2036        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2037    } else {
2038        let local_var_entity: Option<ListWorkspacesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2039        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2040        Err(Error::ResponseError(local_var_error))
2041    }
2042}
2043
2044pub async fn list_workspaces_as_super_admin(configuration: &configuration::Configuration, page: Option<i32>, per_page: Option<i32>) -> Result<Vec<models::Workspace>, Error<ListWorkspacesAsSuperAdminError>> {
2045    let local_var_configuration = configuration;
2046
2047    let local_var_client = &local_var_configuration.client;
2048
2049    let local_var_uri_str = format!("{}/workspaces/list_as_superadmin", local_var_configuration.base_path);
2050    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2051
2052    if let Some(ref local_var_str) = page {
2053        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
2054    }
2055    if let Some(ref local_var_str) = per_page {
2056        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
2057    }
2058    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2059        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2060    }
2061    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2062        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2063    };
2064
2065    let local_var_req = local_var_req_builder.build()?;
2066    let local_var_resp = local_var_client.execute(local_var_req).await?;
2067
2068    let local_var_status = local_var_resp.status();
2069    let local_var_content = local_var_resp.text().await?;
2070
2071    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2072        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2073    } else {
2074        let local_var_entity: Option<ListWorkspacesAsSuperAdminError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2075        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2076        Err(Error::ResponseError(local_var_error))
2077    }
2078}
2079
2080pub async fn rebuild_dependency_map(configuration: &configuration::Configuration, workspace: &str) -> Result<String, Error<RebuildDependencyMapError>> {
2081    let local_var_configuration = configuration;
2082
2083    let local_var_client = &local_var_configuration.client;
2084
2085    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/rebuild_dependency_map", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2086    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2087
2088    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2089        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2090    }
2091    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2092        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2093    };
2094
2095    let local_var_req = local_var_req_builder.build()?;
2096    let local_var_resp = local_var_client.execute(local_var_req).await?;
2097
2098    let local_var_status = local_var_resp.status();
2099    let local_var_content = local_var_resp.text().await?;
2100
2101    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2102        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2103    } else {
2104        let local_var_entity: Option<RebuildDependencyMapError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2105        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2106        Err(Error::ResponseError(local_var_error))
2107    }
2108}
2109
2110pub async fn run_slack_message_test_job(configuration: &configuration::Configuration, workspace: &str, run_slack_message_test_job_request: models::RunSlackMessageTestJobRequest) -> Result<models::RunSlackMessageTestJob200Response, Error<RunSlackMessageTestJobError>> {
2111    let local_var_configuration = configuration;
2112
2113    let local_var_client = &local_var_configuration.client;
2114
2115    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/run_slack_message_test_job", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2116    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2117
2118    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2119        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2120    }
2121    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2122        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2123    };
2124    local_var_req_builder = local_var_req_builder.json(&run_slack_message_test_job_request);
2125
2126    let local_var_req = local_var_req_builder.build()?;
2127    let local_var_resp = local_var_client.execute(local_var_req).await?;
2128
2129    let local_var_status = local_var_resp.status();
2130    let local_var_content = local_var_resp.text().await?;
2131
2132    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2133        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2134    } else {
2135        let local_var_entity: Option<RunSlackMessageTestJobError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2136        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2137        Err(Error::ResponseError(local_var_error))
2138    }
2139}
2140
2141pub async fn run_teams_message_test_job(configuration: &configuration::Configuration, workspace: &str, run_slack_message_test_job_request: models::RunSlackMessageTestJobRequest) -> Result<models::RunSlackMessageTestJob200Response, Error<RunTeamsMessageTestJobError>> {
2142    let local_var_configuration = configuration;
2143
2144    let local_var_client = &local_var_configuration.client;
2145
2146    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/run_teams_message_test_job", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2147    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2148
2149    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2150        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2151    }
2152    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2153        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2154    };
2155    local_var_req_builder = local_var_req_builder.json(&run_slack_message_test_job_request);
2156
2157    let local_var_req = local_var_req_builder.build()?;
2158    let local_var_resp = local_var_client.execute(local_var_req).await?;
2159
2160    let local_var_status = local_var_resp.status();
2161    let local_var_content = local_var_resp.text().await?;
2162
2163    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2164        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2165    } else {
2166        let local_var_entity: Option<RunTeamsMessageTestJobError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2167        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2168        Err(Error::ResponseError(local_var_error))
2169    }
2170}
2171
2172pub async fn set_environment_variable(configuration: &configuration::Configuration, workspace: &str, set_environment_variable_request: models::SetEnvironmentVariableRequest) -> Result<String, Error<SetEnvironmentVariableError>> {
2173    let local_var_configuration = configuration;
2174
2175    let local_var_client = &local_var_configuration.client;
2176
2177    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/set_environment_variable", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2178    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2179
2180    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2181        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2182    }
2183    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2184        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2185    };
2186    local_var_req_builder = local_var_req_builder.json(&set_environment_variable_request);
2187
2188    let local_var_req = local_var_req_builder.build()?;
2189    let local_var_resp = local_var_client.execute(local_var_req).await?;
2190
2191    let local_var_status = local_var_resp.status();
2192    let local_var_content = local_var_resp.text().await?;
2193
2194    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2195        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2196    } else {
2197        let local_var_entity: Option<SetEnvironmentVariableError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2198        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2199        Err(Error::ResponseError(local_var_error))
2200    }
2201}
2202
2203pub async fn set_threshold_alert(configuration: &configuration::Configuration, workspace: &str, set_threshold_alert_request: models::SetThresholdAlertRequest) -> Result<String, Error<SetThresholdAlertError>> {
2204    let local_var_configuration = configuration;
2205
2206    let local_var_client = &local_var_configuration.client;
2207
2208    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/threshold_alert", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2209    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2210
2211    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2212        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2213    }
2214    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2215        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2216    };
2217    local_var_req_builder = local_var_req_builder.json(&set_threshold_alert_request);
2218
2219    let local_var_req = local_var_req_builder.build()?;
2220    let local_var_resp = local_var_client.execute(local_var_req).await?;
2221
2222    let local_var_status = local_var_resp.status();
2223    let local_var_content = local_var_resp.text().await?;
2224
2225    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2226        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2227    } else {
2228        let local_var_entity: Option<SetThresholdAlertError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2229        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2230        Err(Error::ResponseError(local_var_error))
2231    }
2232}
2233
2234pub async fn set_workspace_encryption_key(configuration: &configuration::Configuration, workspace: &str, set_workspace_encryption_key_request: models::SetWorkspaceEncryptionKeyRequest) -> Result<String, Error<SetWorkspaceEncryptionKeyError>> {
2235    let local_var_configuration = configuration;
2236
2237    let local_var_client = &local_var_configuration.client;
2238
2239    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/encryption_key", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2240    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2241
2242    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2243        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2244    }
2245    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2246        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2247    };
2248    local_var_req_builder = local_var_req_builder.json(&set_workspace_encryption_key_request);
2249
2250    let local_var_req = local_var_req_builder.build()?;
2251    let local_var_resp = local_var_client.execute(local_var_req).await?;
2252
2253    let local_var_status = local_var_resp.status();
2254    let local_var_content = local_var_resp.text().await?;
2255
2256    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2257        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2258    } else {
2259        let local_var_entity: Option<SetWorkspaceEncryptionKeyError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2260        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2261        Err(Error::ResponseError(local_var_error))
2262    }
2263}
2264
2265pub async fn unarchive_workspace(configuration: &configuration::Configuration, workspace: &str) -> Result<String, Error<UnarchiveWorkspaceError>> {
2266    let local_var_configuration = configuration;
2267
2268    let local_var_client = &local_var_configuration.client;
2269
2270    let local_var_uri_str = format!("{}/workspaces/unarchive/{workspace}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2271    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2272
2273    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2274        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2275    }
2276    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2277        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2278    };
2279
2280    let local_var_req = local_var_req_builder.build()?;
2281    let local_var_resp = local_var_client.execute(local_var_req).await?;
2282
2283    let local_var_status = local_var_resp.status();
2284    let local_var_content = local_var_resp.text().await?;
2285
2286    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2287        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2288    } else {
2289        let local_var_entity: Option<UnarchiveWorkspaceError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2290        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2291        Err(Error::ResponseError(local_var_error))
2292    }
2293}
2294
2295/// Updates the operator settings for a specific workspace. Requires workspace admin privileges.
2296pub async fn update_operator_settings(configuration: &configuration::Configuration, workspace: &str, operator_settings: Option<models::OperatorSettings>) -> Result<String, Error<UpdateOperatorSettingsError>> {
2297    let local_var_configuration = configuration;
2298
2299    let local_var_client = &local_var_configuration.client;
2300
2301    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/operator_settings", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2302    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2303
2304    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2305        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2306    }
2307    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2308        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2309    };
2310    local_var_req_builder = local_var_req_builder.json(&operator_settings);
2311
2312    let local_var_req = local_var_req_builder.build()?;
2313    let local_var_resp = local_var_client.execute(local_var_req).await?;
2314
2315    let local_var_status = local_var_resp.status();
2316    let local_var_content = local_var_resp.text().await?;
2317
2318    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2319        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2320    } else {
2321        let local_var_entity: Option<UpdateOperatorSettingsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2322        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2323        Err(Error::ResponseError(local_var_error))
2324    }
2325}
2326