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