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