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.613.4
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_success_handler`]
194#[derive(Debug, Clone, Serialize, Deserialize)]
195#[serde(untagged)]
196pub enum EditSuccessHandlerError {
197    UnknownValue(serde_json::Value),
198}
199
200/// struct for typed errors of method [`edit_teams_command`]
201#[derive(Debug, Clone, Serialize, Deserialize)]
202#[serde(untagged)]
203pub enum EditTeamsCommandError {
204    UnknownValue(serde_json::Value),
205}
206
207/// struct for typed errors of method [`edit_webhook`]
208#[derive(Debug, Clone, Serialize, Deserialize)]
209#[serde(untagged)]
210pub enum EditWebhookError {
211    UnknownValue(serde_json::Value),
212}
213
214/// struct for typed errors of method [`edit_workspace_default_app`]
215#[derive(Debug, Clone, Serialize, Deserialize)]
216#[serde(untagged)]
217pub enum EditWorkspaceDefaultAppError {
218    UnknownValue(serde_json::Value),
219}
220
221/// struct for typed errors of method [`edit_workspace_deploy_ui_settings`]
222#[derive(Debug, Clone, Serialize, Deserialize)]
223#[serde(untagged)]
224pub enum EditWorkspaceDeployUiSettingsError {
225    UnknownValue(serde_json::Value),
226}
227
228/// struct for typed errors of method [`edit_workspace_git_sync_config`]
229#[derive(Debug, Clone, Serialize, Deserialize)]
230#[serde(untagged)]
231pub enum EditWorkspaceGitSyncConfigError {
232    UnknownValue(serde_json::Value),
233}
234
235/// struct for typed errors of method [`exists_username`]
236#[derive(Debug, Clone, Serialize, Deserialize)]
237#[serde(untagged)]
238pub enum ExistsUsernameError {
239    UnknownValue(serde_json::Value),
240}
241
242/// struct for typed errors of method [`exists_workspace`]
243#[derive(Debug, Clone, Serialize, Deserialize)]
244#[serde(untagged)]
245pub enum ExistsWorkspaceError {
246    UnknownValue(serde_json::Value),
247}
248
249/// struct for typed errors of method [`get_copilot_info`]
250#[derive(Debug, Clone, Serialize, Deserialize)]
251#[serde(untagged)]
252pub enum GetCopilotInfoError {
253    UnknownValue(serde_json::Value),
254}
255
256/// struct for typed errors of method [`get_default_scripts`]
257#[derive(Debug, Clone, Serialize, Deserialize)]
258#[serde(untagged)]
259pub enum GetDefaultScriptsError {
260    UnknownValue(serde_json::Value),
261}
262
263/// struct for typed errors of method [`get_dependency_map`]
264#[derive(Debug, Clone, Serialize, Deserialize)]
265#[serde(untagged)]
266pub enum GetDependencyMapError {
267    UnknownValue(serde_json::Value),
268}
269
270/// struct for typed errors of method [`get_dependents`]
271#[derive(Debug, Clone, Serialize, Deserialize)]
272#[serde(untagged)]
273pub enum GetDependentsError {
274    UnknownValue(serde_json::Value),
275}
276
277/// struct for typed errors of method [`get_dependents_amounts`]
278#[derive(Debug, Clone, Serialize, Deserialize)]
279#[serde(untagged)]
280pub enum GetDependentsAmountsError {
281    UnknownValue(serde_json::Value),
282}
283
284/// struct for typed errors of method [`get_deploy_to`]
285#[derive(Debug, Clone, Serialize, Deserialize)]
286#[serde(untagged)]
287pub enum GetDeployToError {
288    UnknownValue(serde_json::Value),
289}
290
291/// struct for typed errors of method [`get_github_app_token`]
292#[derive(Debug, Clone, Serialize, Deserialize)]
293#[serde(untagged)]
294pub enum GetGithubAppTokenError {
295    UnknownValue(serde_json::Value),
296}
297
298/// struct for typed errors of method [`get_is_premium`]
299#[derive(Debug, Clone, Serialize, Deserialize)]
300#[serde(untagged)]
301pub enum GetIsPremiumError {
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_success_handler(configuration: &configuration::Configuration, workspace: &str, edit_success_handler_request: models::EditSuccessHandlerRequest) -> Result<String, Error<EditSuccessHandlerError>> {
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_success_handler", 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_success_handler_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<EditSuccessHandlerError> = 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_teams_command(configuration: &configuration::Configuration, workspace: &str, edit_slack_command_request: models::EditSlackCommandRequest) -> Result<String, Error<EditTeamsCommandError>> {
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_teams_command", 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_slack_command_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<EditTeamsCommandError> = 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_webhook(configuration: &configuration::Configuration, workspace: &str, edit_webhook_request: models::EditWebhookRequest) -> Result<String, Error<EditWebhookError>> {
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_webhook", 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_webhook_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<EditWebhookError> = 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_default_app(configuration: &configuration::Configuration, workspace: &str, edit_workspace_default_app_request: models::EditWorkspaceDefaultAppRequest) -> Result<String, Error<EditWorkspaceDefaultAppError>> {
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_default_app", 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_default_app_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<EditWorkspaceDefaultAppError> = 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_deploy_ui_settings(configuration: &configuration::Configuration, workspace: &str, edit_workspace_deploy_ui_settings_request: models::EditWorkspaceDeployUiSettingsRequest) -> Result<serde_json::Value, Error<EditWorkspaceDeployUiSettingsError>> {
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_deploy_ui_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_deploy_ui_settings_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<EditWorkspaceDeployUiSettingsError> = 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 edit_workspace_git_sync_config(configuration: &configuration::Configuration, workspace: &str, edit_workspace_git_sync_config_request: models::EditWorkspaceGitSyncConfigRequest) -> Result<serde_json::Value, Error<EditWorkspaceGitSyncConfigError>> {
1461    let local_var_configuration = configuration;
1462
1463    let local_var_client = &local_var_configuration.client;
1464
1465    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_git_sync_config", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
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(&edit_workspace_git_sync_config_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<EditWorkspaceGitSyncConfigError> = 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_username(configuration: &configuration::Configuration, exists_username_request: models::ExistsUsernameRequest) -> Result<bool, Error<ExistsUsernameError>> {
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_username", 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_username_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<ExistsUsernameError> = 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 exists_workspace(configuration: &configuration::Configuration, exists_workspace_request: models::ExistsWorkspaceRequest) -> Result<bool, Error<ExistsWorkspaceError>> {
1523    let local_var_configuration = configuration;
1524
1525    let local_var_client = &local_var_configuration.client;
1526
1527    let local_var_uri_str = format!("{}/workspaces/exists", local_var_configuration.base_path);
1528    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1529
1530    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1531        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1532    }
1533    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1534        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1535    };
1536    local_var_req_builder = local_var_req_builder.json(&exists_workspace_request);
1537
1538    let local_var_req = local_var_req_builder.build()?;
1539    let local_var_resp = local_var_client.execute(local_var_req).await?;
1540
1541    let local_var_status = local_var_resp.status();
1542    let local_var_content = local_var_resp.text().await?;
1543
1544    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1545        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1546    } else {
1547        let local_var_entity: Option<ExistsWorkspaceError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1548        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1549        Err(Error::ResponseError(local_var_error))
1550    }
1551}
1552
1553pub async fn get_copilot_info(configuration: &configuration::Configuration, workspace: &str) -> Result<models::AiConfig, Error<GetCopilotInfoError>> {
1554    let local_var_configuration = configuration;
1555
1556    let local_var_client = &local_var_configuration.client;
1557
1558    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_copilot_info", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1559    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1560
1561    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1562        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1563    }
1564    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1565        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1566    };
1567
1568    let local_var_req = local_var_req_builder.build()?;
1569    let local_var_resp = local_var_client.execute(local_var_req).await?;
1570
1571    let local_var_status = local_var_resp.status();
1572    let local_var_content = local_var_resp.text().await?;
1573
1574    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1575        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1576    } else {
1577        let local_var_entity: Option<GetCopilotInfoError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1578        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1579        Err(Error::ResponseError(local_var_error))
1580    }
1581}
1582
1583pub async fn get_default_scripts(configuration: &configuration::Configuration, workspace: &str) -> Result<models::WorkspaceDefaultScripts, Error<GetDefaultScriptsError>> {
1584    let local_var_configuration = configuration;
1585
1586    let local_var_client = &local_var_configuration.client;
1587
1588    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/default_scripts", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1589    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1590
1591    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1592        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1593    }
1594    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1595        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1596    };
1597
1598    let local_var_req = local_var_req_builder.build()?;
1599    let local_var_resp = local_var_client.execute(local_var_req).await?;
1600
1601    let local_var_status = local_var_resp.status();
1602    let local_var_content = local_var_resp.text().await?;
1603
1604    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1605        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1606    } else {
1607        let local_var_entity: Option<GetDefaultScriptsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1608        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1609        Err(Error::ResponseError(local_var_error))
1610    }
1611}
1612
1613pub async fn get_dependency_map(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<models::DependencyMap>, Error<GetDependencyMapError>> {
1614    let local_var_configuration = configuration;
1615
1616    let local_var_client = &local_var_configuration.client;
1617
1618    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_dependency_map", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1619    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1620
1621    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1622        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1623    }
1624    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1625        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1626    };
1627
1628    let local_var_req = local_var_req_builder.build()?;
1629    let local_var_resp = local_var_client.execute(local_var_req).await?;
1630
1631    let local_var_status = local_var_resp.status();
1632    let local_var_content = local_var_resp.text().await?;
1633
1634    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1635        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1636    } else {
1637        let local_var_entity: Option<GetDependencyMapError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1638        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1639        Err(Error::ResponseError(local_var_error))
1640    }
1641}
1642
1643pub async fn get_dependents(configuration: &configuration::Configuration, workspace: &str, imported_path: &str) -> Result<Vec<models::DependencyDependent>, Error<GetDependentsError>> {
1644    let local_var_configuration = configuration;
1645
1646    let local_var_client = &local_var_configuration.client;
1647
1648    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));
1649    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1650
1651    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1652        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1653    }
1654    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1655        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1656    };
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<GetDependentsError> = 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_dependents_amounts(configuration: &configuration::Configuration, workspace: &str, request_body: Vec<String>) -> Result<Vec<models::DependentsAmount>, Error<GetDependentsAmountsError>> {
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_dependents_amounts", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1679    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, 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    local_var_req_builder = local_var_req_builder.json(&request_body);
1688
1689    let local_var_req = local_var_req_builder.build()?;
1690    let local_var_resp = local_var_client.execute(local_var_req).await?;
1691
1692    let local_var_status = local_var_resp.status();
1693    let local_var_content = local_var_resp.text().await?;
1694
1695    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1696        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1697    } else {
1698        let local_var_entity: Option<GetDependentsAmountsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1699        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1700        Err(Error::ResponseError(local_var_error))
1701    }
1702}
1703
1704pub async fn get_deploy_to(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetDeployTo200Response, Error<GetDeployToError>> {
1705    let local_var_configuration = configuration;
1706
1707    let local_var_client = &local_var_configuration.client;
1708
1709    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_deploy_to", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1710    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1711
1712    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1713        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1714    }
1715    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1716        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1717    };
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<GetDeployToError> = 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_github_app_token(configuration: &configuration::Configuration, workspace: &str, get_github_app_token_request: models::GetGithubAppTokenRequest) -> Result<models::GetGithubAppToken200Response, Error<GetGithubAppTokenError>> {
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}/github_app/token", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1740    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, 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    local_var_req_builder = local_var_req_builder.json(&get_github_app_token_request);
1749
1750    let local_var_req = local_var_req_builder.build()?;
1751    let local_var_resp = local_var_client.execute(local_var_req).await?;
1752
1753    let local_var_status = local_var_resp.status();
1754    let local_var_content = local_var_resp.text().await?;
1755
1756    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1757        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1758    } else {
1759        let local_var_entity: Option<GetGithubAppTokenError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1760        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1761        Err(Error::ResponseError(local_var_error))
1762    }
1763}
1764
1765pub async fn get_is_premium(configuration: &configuration::Configuration, workspace: &str) -> Result<bool, Error<GetIsPremiumError>> {
1766    let local_var_configuration = configuration;
1767
1768    let local_var_client = &local_var_configuration.client;
1769
1770    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/is_premium", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1771    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1772
1773    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1774        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1775    }
1776    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1777        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1778    };
1779
1780    let local_var_req = local_var_req_builder.build()?;
1781    let local_var_resp = local_var_client.execute(local_var_req).await?;
1782
1783    let local_var_status = local_var_resp.status();
1784    let local_var_content = local_var_resp.text().await?;
1785
1786    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1787        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1788    } else {
1789        let local_var_entity: Option<GetIsPremiumError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1790        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1791        Err(Error::ResponseError(local_var_error))
1792    }
1793}
1794
1795pub async fn get_premium_info(configuration: &configuration::Configuration, workspace: &str, skip_subscription_fetch: Option<bool>) -> Result<models::GetPremiumInfo200Response, Error<GetPremiumInfoError>> {
1796    let local_var_configuration = configuration;
1797
1798    let local_var_client = &local_var_configuration.client;
1799
1800    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/premium_info", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1801    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1802
1803    if let Some(ref local_var_str) = skip_subscription_fetch {
1804        local_var_req_builder = local_var_req_builder.query(&[("skip_subscription_fetch", &local_var_str.to_string())]);
1805    }
1806    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1807        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1808    }
1809    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1810        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1811    };
1812
1813    let local_var_req = local_var_req_builder.build()?;
1814    let local_var_resp = local_var_client.execute(local_var_req).await?;
1815
1816    let local_var_status = local_var_resp.status();
1817    let local_var_content = local_var_resp.text().await?;
1818
1819    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1820        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1821    } else {
1822        let local_var_entity: Option<GetPremiumInfoError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1823        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1824        Err(Error::ResponseError(local_var_error))
1825    }
1826}
1827
1828pub async fn get_settings(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetSettings200Response, Error<GetSettingsError>> {
1829    let local_var_configuration = configuration;
1830
1831    let local_var_client = &local_var_configuration.client;
1832
1833    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_settings", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1834    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1835
1836    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1837        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1838    }
1839    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1840        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1841    };
1842
1843    let local_var_req = local_var_req_builder.build()?;
1844    let local_var_resp = local_var_client.execute(local_var_req).await?;
1845
1846    let local_var_status = local_var_resp.status();
1847    let local_var_content = local_var_resp.text().await?;
1848
1849    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1850        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1851    } else {
1852        let local_var_entity: Option<GetSettingsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1853        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1854        Err(Error::ResponseError(local_var_error))
1855    }
1856}
1857
1858pub async fn get_threshold_alert(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetThresholdAlert200Response, Error<GetThresholdAlertError>> {
1859    let local_var_configuration = configuration;
1860
1861    let local_var_client = &local_var_configuration.client;
1862
1863    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/threshold_alert", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1864    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1865
1866    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1867        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1868    }
1869    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1870        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1871    };
1872
1873    let local_var_req = local_var_req_builder.build()?;
1874    let local_var_resp = local_var_client.execute(local_var_req).await?;
1875
1876    let local_var_status = local_var_resp.status();
1877    let local_var_content = local_var_resp.text().await?;
1878
1879    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1880        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1881    } else {
1882        let local_var_entity: Option<GetThresholdAlertError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1883        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1884        Err(Error::ResponseError(local_var_error))
1885    }
1886}
1887
1888pub async fn get_used_triggers(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetUsedTriggers200Response, Error<GetUsedTriggersError>> {
1889    let local_var_configuration = configuration;
1890
1891    let local_var_client = &local_var_configuration.client;
1892
1893    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/used_triggers", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1894    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1895
1896    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1897        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1898    }
1899    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1900        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1901    };
1902
1903    let local_var_req = local_var_req_builder.build()?;
1904    let local_var_resp = local_var_client.execute(local_var_req).await?;
1905
1906    let local_var_status = local_var_resp.status();
1907    let local_var_content = local_var_resp.text().await?;
1908
1909    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1910        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1911    } else {
1912        let local_var_entity: Option<GetUsedTriggersError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1913        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1914        Err(Error::ResponseError(local_var_error))
1915    }
1916}
1917
1918pub async fn get_workspace_as_super_admin(configuration: &configuration::Configuration, workspace: &str) -> Result<models::Workspace, Error<GetWorkspaceAsSuperAdminError>> {
1919    let local_var_configuration = configuration;
1920
1921    let local_var_client = &local_var_configuration.client;
1922
1923    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_as_superadmin", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1924    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1925
1926    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1927        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1928    }
1929    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1930        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1931    };
1932
1933    let local_var_req = local_var_req_builder.build()?;
1934    let local_var_resp = local_var_client.execute(local_var_req).await?;
1935
1936    let local_var_status = local_var_resp.status();
1937    let local_var_content = local_var_resp.text().await?;
1938
1939    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1940        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1941    } else {
1942        let local_var_entity: Option<GetWorkspaceAsSuperAdminError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1943        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1944        Err(Error::ResponseError(local_var_error))
1945    }
1946}
1947
1948pub async fn get_workspace_default_app(configuration: &configuration::Configuration, workspace: &str) -> Result<models::EditWorkspaceDefaultAppRequest, Error<GetWorkspaceDefaultAppError>> {
1949    let local_var_configuration = configuration;
1950
1951    let local_var_client = &local_var_configuration.client;
1952
1953    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/default_app", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1954    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1955
1956    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1957        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1958    }
1959    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1960        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1961    };
1962
1963    let local_var_req = local_var_req_builder.build()?;
1964    let local_var_resp = local_var_client.execute(local_var_req).await?;
1965
1966    let local_var_status = local_var_resp.status();
1967    let local_var_content = local_var_resp.text().await?;
1968
1969    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1970        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1971    } else {
1972        let local_var_entity: Option<GetWorkspaceDefaultAppError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1973        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1974        Err(Error::ResponseError(local_var_error))
1975    }
1976}
1977
1978pub async fn get_workspace_encryption_key(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetWorkspaceEncryptionKey200Response, Error<GetWorkspaceEncryptionKeyError>> {
1979    let local_var_configuration = configuration;
1980
1981    let local_var_client = &local_var_configuration.client;
1982
1983    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/encryption_key", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1984    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1985
1986    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1987        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1988    }
1989    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1990        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1991    };
1992
1993    let local_var_req = local_var_req_builder.build()?;
1994    let local_var_resp = local_var_client.execute(local_var_req).await?;
1995
1996    let local_var_status = local_var_resp.status();
1997    let local_var_content = local_var_resp.text().await?;
1998
1999    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2000        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2001    } else {
2002        let local_var_entity: Option<GetWorkspaceEncryptionKeyError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2003        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2004        Err(Error::ResponseError(local_var_error))
2005    }
2006}
2007
2008pub async fn get_workspace_name(configuration: &configuration::Configuration, workspace: &str) -> Result<String, Error<GetWorkspaceNameError>> {
2009    let local_var_configuration = configuration;
2010
2011    let local_var_client = &local_var_configuration.client;
2012
2013    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_workspace_name", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2014    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2015
2016    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2017        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2018    }
2019    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2020        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2021    };
2022
2023    let local_var_req = local_var_req_builder.build()?;
2024    let local_var_resp = local_var_client.execute(local_var_req).await?;
2025
2026    let local_var_status = local_var_resp.status();
2027    let local_var_content = local_var_resp.text().await?;
2028
2029    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2030        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2031    } else {
2032        let local_var_entity: Option<GetWorkspaceNameError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2033        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2034        Err(Error::ResponseError(local_var_error))
2035    }
2036}
2037
2038pub async fn get_workspace_slack_oauth_config(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetWorkspaceSlackOauthConfig200Response, Error<GetWorkspaceSlackOauthConfigError>> {
2039    let local_var_configuration = configuration;
2040
2041    let local_var_client = &local_var_configuration.client;
2042
2043    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/slack_oauth_config", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2044    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2045
2046    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2047        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2048    }
2049    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2050        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2051    };
2052
2053    let local_var_req = local_var_req_builder.build()?;
2054    let local_var_resp = local_var_client.execute(local_var_req).await?;
2055
2056    let local_var_status = local_var_resp.status();
2057    let local_var_content = local_var_resp.text().await?;
2058
2059    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2060        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2061    } else {
2062        let local_var_entity: Option<GetWorkspaceSlackOauthConfigError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2063        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2064        Err(Error::ResponseError(local_var_error))
2065    }
2066}
2067
2068pub async fn get_workspace_usage(configuration: &configuration::Configuration, workspace: &str) -> Result<f64, Error<GetWorkspaceUsageError>> {
2069    let local_var_configuration = configuration;
2070
2071    let local_var_client = &local_var_configuration.client;
2072
2073    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/usage", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2074    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2075
2076    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2077        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2078    }
2079    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2080        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2081    };
2082
2083    let local_var_req = local_var_req_builder.build()?;
2084    let local_var_resp = local_var_client.execute(local_var_req).await?;
2085
2086    let local_var_status = local_var_resp.status();
2087    let local_var_content = local_var_resp.text().await?;
2088
2089    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2090        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2091    } else {
2092        let local_var_entity: Option<GetWorkspaceUsageError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2093        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2094        Err(Error::ResponseError(local_var_error))
2095    }
2096}
2097
2098pub async fn invite_user(configuration: &configuration::Configuration, workspace: &str, invite_user_request: models::InviteUserRequest) -> Result<String, Error<InviteUserError>> {
2099    let local_var_configuration = configuration;
2100
2101    let local_var_client = &local_var_configuration.client;
2102
2103    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/invite_user", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2104    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2105
2106    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2107        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2108    }
2109    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2110        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2111    };
2112    local_var_req_builder = local_var_req_builder.json(&invite_user_request);
2113
2114    let local_var_req = local_var_req_builder.build()?;
2115    let local_var_resp = local_var_client.execute(local_var_req).await?;
2116
2117    let local_var_status = local_var_resp.status();
2118    let local_var_content = local_var_resp.text().await?;
2119
2120    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2121        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2122    } else {
2123        let local_var_entity: Option<InviteUserError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2124        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2125        Err(Error::ResponseError(local_var_error))
2126    }
2127}
2128
2129pub async fn is_domain_allowed(configuration: &configuration::Configuration, ) -> Result<bool, Error<IsDomainAllowedError>> {
2130    let local_var_configuration = configuration;
2131
2132    let local_var_client = &local_var_configuration.client;
2133
2134    let local_var_uri_str = format!("{}/workspaces/allowed_domain_auto_invite", local_var_configuration.base_path);
2135    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2136
2137    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2138        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2139    }
2140    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2141        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2142    };
2143
2144    let local_var_req = local_var_req_builder.build()?;
2145    let local_var_resp = local_var_client.execute(local_var_req).await?;
2146
2147    let local_var_status = local_var_resp.status();
2148    let local_var_content = local_var_resp.text().await?;
2149
2150    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2151        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2152    } else {
2153        let local_var_entity: Option<IsDomainAllowedError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2154        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2155        Err(Error::ResponseError(local_var_error))
2156    }
2157}
2158
2159pub async fn leave_workspace(configuration: &configuration::Configuration, workspace: &str) -> Result<String, Error<LeaveWorkspaceError>> {
2160    let local_var_configuration = configuration;
2161
2162    let local_var_client = &local_var_configuration.client;
2163
2164    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/leave", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2165    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2166
2167    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2168        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2169    }
2170    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2171        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2172    };
2173
2174    let local_var_req = local_var_req_builder.build()?;
2175    let local_var_resp = local_var_client.execute(local_var_req).await?;
2176
2177    let local_var_status = local_var_resp.status();
2178    let local_var_content = local_var_resp.text().await?;
2179
2180    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2181        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2182    } else {
2183        let local_var_entity: Option<LeaveWorkspaceError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2184        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2185        Err(Error::ResponseError(local_var_error))
2186    }
2187}
2188
2189pub async fn list_available_teams_channels(configuration: &configuration::Configuration, workspace: &str, team_id: &str) -> Result<models::ListAvailableTeamsChannels200Response, Error<ListAvailableTeamsChannelsError>> {
2190    let local_var_configuration = configuration;
2191
2192    let local_var_client = &local_var_configuration.client;
2193
2194    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/available_teams_channels", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2195    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2196
2197    local_var_req_builder = local_var_req_builder.query(&[("team_id", &team_id.to_string())]);
2198    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2199        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2200    }
2201    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2202        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2203    };
2204
2205    let local_var_req = local_var_req_builder.build()?;
2206    let local_var_resp = local_var_client.execute(local_var_req).await?;
2207
2208    let local_var_status = local_var_resp.status();
2209    let local_var_content = local_var_resp.text().await?;
2210
2211    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2212        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2213    } else {
2214        let local_var_entity: Option<ListAvailableTeamsChannelsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2215        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2216        Err(Error::ResponseError(local_var_error))
2217    }
2218}
2219
2220pub async fn list_available_teams_ids(configuration: &configuration::Configuration, workspace: &str, search: Option<&str>, next_link: Option<&str>) -> Result<models::ListAvailableTeamsIds200Response, Error<ListAvailableTeamsIdsError>> {
2221    let local_var_configuration = configuration;
2222
2223    let local_var_client = &local_var_configuration.client;
2224
2225    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/available_teams_ids", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2226    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2227
2228    if let Some(ref local_var_str) = search {
2229        local_var_req_builder = local_var_req_builder.query(&[("search", &local_var_str.to_string())]);
2230    }
2231    if let Some(ref local_var_str) = next_link {
2232        local_var_req_builder = local_var_req_builder.query(&[("next_link", &local_var_str.to_string())]);
2233    }
2234    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2235        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2236    }
2237    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2238        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2239    };
2240
2241    let local_var_req = local_var_req_builder.build()?;
2242    let local_var_resp = local_var_client.execute(local_var_req).await?;
2243
2244    let local_var_status = local_var_resp.status();
2245    let local_var_content = local_var_resp.text().await?;
2246
2247    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2248        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2249    } else {
2250        let local_var_entity: Option<ListAvailableTeamsIdsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2251        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2252        Err(Error::ResponseError(local_var_error))
2253    }
2254}
2255
2256pub async fn list_data_table_schemas(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<models::DataTableSchema>, Error<ListDataTableSchemasError>> {
2257    let local_var_configuration = configuration;
2258
2259    let local_var_client = &local_var_configuration.client;
2260
2261    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/list_datatable_schemas", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2262    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2263
2264    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2265        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2266    }
2267    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2268        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2269    };
2270
2271    let local_var_req = local_var_req_builder.build()?;
2272    let local_var_resp = local_var_client.execute(local_var_req).await?;
2273
2274    let local_var_status = local_var_resp.status();
2275    let local_var_content = local_var_resp.text().await?;
2276
2277    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2278        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2279    } else {
2280        let local_var_entity: Option<ListDataTableSchemasError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2281        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2282        Err(Error::ResponseError(local_var_error))
2283    }
2284}
2285
2286pub async fn list_data_tables(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<String>, Error<ListDataTablesError>> {
2287    let local_var_configuration = configuration;
2288
2289    let local_var_client = &local_var_configuration.client;
2290
2291    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/list_datatables", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2292    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2293
2294    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2295        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2296    }
2297    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2298        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2299    };
2300
2301    let local_var_req = local_var_req_builder.build()?;
2302    let local_var_resp = local_var_client.execute(local_var_req).await?;
2303
2304    let local_var_status = local_var_resp.status();
2305    let local_var_content = local_var_resp.text().await?;
2306
2307    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2308        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2309    } else {
2310        let local_var_entity: Option<ListDataTablesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2311        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2312        Err(Error::ResponseError(local_var_error))
2313    }
2314}
2315
2316pub async fn list_ducklakes(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<String>, Error<ListDucklakesError>> {
2317    let local_var_configuration = configuration;
2318
2319    let local_var_client = &local_var_configuration.client;
2320
2321    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/list_ducklakes", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2322    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2323
2324    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2325        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2326    }
2327    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2328        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2329    };
2330
2331    let local_var_req = local_var_req_builder.build()?;
2332    let local_var_resp = local_var_client.execute(local_var_req).await?;
2333
2334    let local_var_status = local_var_resp.status();
2335    let local_var_content = local_var_resp.text().await?;
2336
2337    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2338        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2339    } else {
2340        let local_var_entity: Option<ListDucklakesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2341        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2342        Err(Error::ResponseError(local_var_error))
2343    }
2344}
2345
2346pub async fn list_pending_invites(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<models::WorkspaceInvite>, Error<ListPendingInvitesError>> {
2347    let local_var_configuration = configuration;
2348
2349    let local_var_client = &local_var_configuration.client;
2350
2351    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/list_pending_invites", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2352    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2353
2354    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2355        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2356    }
2357    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2358        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2359    };
2360
2361    let local_var_req = local_var_req_builder.build()?;
2362    let local_var_resp = local_var_client.execute(local_var_req).await?;
2363
2364    let local_var_status = local_var_resp.status();
2365    let local_var_content = local_var_resp.text().await?;
2366
2367    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2368        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2369    } else {
2370        let local_var_entity: Option<ListPendingInvitesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2371        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2372        Err(Error::ResponseError(local_var_error))
2373    }
2374}
2375
2376pub async fn list_user_workspaces(configuration: &configuration::Configuration, ) -> Result<models::UserWorkspaceList, Error<ListUserWorkspacesError>> {
2377    let local_var_configuration = configuration;
2378
2379    let local_var_client = &local_var_configuration.client;
2380
2381    let local_var_uri_str = format!("{}/workspaces/users", local_var_configuration.base_path);
2382    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2383
2384    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2385        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2386    }
2387    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2388        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2389    };
2390
2391    let local_var_req = local_var_req_builder.build()?;
2392    let local_var_resp = local_var_client.execute(local_var_req).await?;
2393
2394    let local_var_status = local_var_resp.status();
2395    let local_var_content = local_var_resp.text().await?;
2396
2397    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2398        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2399    } else {
2400        let local_var_entity: Option<ListUserWorkspacesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2401        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2402        Err(Error::ResponseError(local_var_error))
2403    }
2404}
2405
2406pub async fn list_workspaces(configuration: &configuration::Configuration, ) -> Result<Vec<models::Workspace>, Error<ListWorkspacesError>> {
2407    let local_var_configuration = configuration;
2408
2409    let local_var_client = &local_var_configuration.client;
2410
2411    let local_var_uri_str = format!("{}/workspaces/list", local_var_configuration.base_path);
2412    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2413
2414    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2415        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2416    }
2417    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2418        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2419    };
2420
2421    let local_var_req = local_var_req_builder.build()?;
2422    let local_var_resp = local_var_client.execute(local_var_req).await?;
2423
2424    let local_var_status = local_var_resp.status();
2425    let local_var_content = local_var_resp.text().await?;
2426
2427    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2428        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2429    } else {
2430        let local_var_entity: Option<ListWorkspacesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2431        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2432        Err(Error::ResponseError(local_var_error))
2433    }
2434}
2435
2436pub async fn list_workspaces_as_super_admin(configuration: &configuration::Configuration, page: Option<i32>, per_page: Option<i32>) -> Result<Vec<models::Workspace>, Error<ListWorkspacesAsSuperAdminError>> {
2437    let local_var_configuration = configuration;
2438
2439    let local_var_client = &local_var_configuration.client;
2440
2441    let local_var_uri_str = format!("{}/workspaces/list_as_superadmin", local_var_configuration.base_path);
2442    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2443
2444    if let Some(ref local_var_str) = page {
2445        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
2446    }
2447    if let Some(ref local_var_str) = per_page {
2448        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
2449    }
2450    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2451        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2452    }
2453    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2454        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2455    };
2456
2457    let local_var_req = local_var_req_builder.build()?;
2458    let local_var_resp = local_var_client.execute(local_var_req).await?;
2459
2460    let local_var_status = local_var_resp.status();
2461    let local_var_content = local_var_resp.text().await?;
2462
2463    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2464        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2465    } else {
2466        let local_var_entity: Option<ListWorkspacesAsSuperAdminError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2467        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2468        Err(Error::ResponseError(local_var_error))
2469    }
2470}
2471
2472pub async fn rebuild_dependency_map(configuration: &configuration::Configuration, workspace: &str) -> Result<String, Error<RebuildDependencyMapError>> {
2473    let local_var_configuration = configuration;
2474
2475    let local_var_client = &local_var_configuration.client;
2476
2477    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/rebuild_dependency_map", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2478    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2479
2480    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2481        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2482    }
2483    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2484        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2485    };
2486
2487    let local_var_req = local_var_req_builder.build()?;
2488    let local_var_resp = local_var_client.execute(local_var_req).await?;
2489
2490    let local_var_status = local_var_resp.status();
2491    let local_var_content = local_var_resp.text().await?;
2492
2493    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2494        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2495    } else {
2496        let local_var_entity: Option<RebuildDependencyMapError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2497        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2498        Err(Error::ResponseError(local_var_error))
2499    }
2500}
2501
2502/// This endpoint should be called after a fork deployement
2503pub async fn reset_diff_tally(configuration: &configuration::Configuration, workspace: &str, fork_workspace_id: &str) -> Result<serde_json::Value, Error<ResetDiffTallyError>> {
2504    let local_var_configuration = configuration;
2505
2506    let local_var_client = &local_var_configuration.client;
2507
2508    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));
2509    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2510
2511    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2512        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2513    }
2514    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2515        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2516    };
2517
2518    let local_var_req = local_var_req_builder.build()?;
2519    let local_var_resp = local_var_client.execute(local_var_req).await?;
2520
2521    let local_var_status = local_var_resp.status();
2522    let local_var_content = local_var_resp.text().await?;
2523
2524    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2525        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2526    } else {
2527        let local_var_entity: Option<ResetDiffTallyError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2528        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2529        Err(Error::ResponseError(local_var_error))
2530    }
2531}
2532
2533pub 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>> {
2534    let local_var_configuration = configuration;
2535
2536    let local_var_client = &local_var_configuration.client;
2537
2538    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/run_slack_message_test_job", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2539    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2540
2541    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2542        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2543    }
2544    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2545        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2546    };
2547    local_var_req_builder = local_var_req_builder.json(&run_slack_message_test_job_request);
2548
2549    let local_var_req = local_var_req_builder.build()?;
2550    let local_var_resp = local_var_client.execute(local_var_req).await?;
2551
2552    let local_var_status = local_var_resp.status();
2553    let local_var_content = local_var_resp.text().await?;
2554
2555    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2556        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2557    } else {
2558        let local_var_entity: Option<RunSlackMessageTestJobError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2559        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2560        Err(Error::ResponseError(local_var_error))
2561    }
2562}
2563
2564pub 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>> {
2565    let local_var_configuration = configuration;
2566
2567    let local_var_client = &local_var_configuration.client;
2568
2569    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/run_teams_message_test_job", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2570    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2571
2572    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2573        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2574    }
2575    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2576        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2577    };
2578    local_var_req_builder = local_var_req_builder.json(&run_slack_message_test_job_request);
2579
2580    let local_var_req = local_var_req_builder.build()?;
2581    let local_var_resp = local_var_client.execute(local_var_req).await?;
2582
2583    let local_var_status = local_var_resp.status();
2584    let local_var_content = local_var_resp.text().await?;
2585
2586    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2587        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2588    } else {
2589        let local_var_entity: Option<RunTeamsMessageTestJobError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2590        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2591        Err(Error::ResponseError(local_var_error))
2592    }
2593}
2594
2595pub async fn set_environment_variable(configuration: &configuration::Configuration, workspace: &str, set_environment_variable_request: models::SetEnvironmentVariableRequest) -> Result<String, Error<SetEnvironmentVariableError>> {
2596    let local_var_configuration = configuration;
2597
2598    let local_var_client = &local_var_configuration.client;
2599
2600    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/set_environment_variable", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2601    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2602
2603    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2604        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2605    }
2606    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2607        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2608    };
2609    local_var_req_builder = local_var_req_builder.json(&set_environment_variable_request);
2610
2611    let local_var_req = local_var_req_builder.build()?;
2612    let local_var_resp = local_var_client.execute(local_var_req).await?;
2613
2614    let local_var_status = local_var_resp.status();
2615    let local_var_content = local_var_resp.text().await?;
2616
2617    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2618        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2619    } else {
2620        let local_var_entity: Option<SetEnvironmentVariableError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2621        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2622        Err(Error::ResponseError(local_var_error))
2623    }
2624}
2625
2626pub async fn set_threshold_alert(configuration: &configuration::Configuration, workspace: &str, set_threshold_alert_request: models::SetThresholdAlertRequest) -> Result<String, Error<SetThresholdAlertError>> {
2627    let local_var_configuration = configuration;
2628
2629    let local_var_client = &local_var_configuration.client;
2630
2631    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/threshold_alert", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2632    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2633
2634    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2635        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2636    }
2637    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2638        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2639    };
2640    local_var_req_builder = local_var_req_builder.json(&set_threshold_alert_request);
2641
2642    let local_var_req = local_var_req_builder.build()?;
2643    let local_var_resp = local_var_client.execute(local_var_req).await?;
2644
2645    let local_var_status = local_var_resp.status();
2646    let local_var_content = local_var_resp.text().await?;
2647
2648    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2649        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2650    } else {
2651        let local_var_entity: Option<SetThresholdAlertError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2652        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2653        Err(Error::ResponseError(local_var_error))
2654    }
2655}
2656
2657pub async fn set_workspace_encryption_key(configuration: &configuration::Configuration, workspace: &str, set_workspace_encryption_key_request: models::SetWorkspaceEncryptionKeyRequest) -> Result<String, Error<SetWorkspaceEncryptionKeyError>> {
2658    let local_var_configuration = configuration;
2659
2660    let local_var_client = &local_var_configuration.client;
2661
2662    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/encryption_key", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2663    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2664
2665    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2666        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2667    }
2668    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2669        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2670    };
2671    local_var_req_builder = local_var_req_builder.json(&set_workspace_encryption_key_request);
2672
2673    let local_var_req = local_var_req_builder.build()?;
2674    let local_var_resp = local_var_client.execute(local_var_req).await?;
2675
2676    let local_var_status = local_var_resp.status();
2677    let local_var_content = local_var_resp.text().await?;
2678
2679    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2680        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2681    } else {
2682        let local_var_entity: Option<SetWorkspaceEncryptionKeyError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2683        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2684        Err(Error::ResponseError(local_var_error))
2685    }
2686}
2687
2688pub async fn set_workspace_slack_oauth_config(configuration: &configuration::Configuration, workspace: &str, set_workspace_slack_oauth_config_request: models::SetWorkspaceSlackOauthConfigRequest) -> Result<String, Error<SetWorkspaceSlackOauthConfigError>> {
2689    let local_var_configuration = configuration;
2690
2691    let local_var_client = &local_var_configuration.client;
2692
2693    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/slack_oauth_config", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2694    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2695
2696    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2697        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2698    }
2699    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2700        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2701    };
2702    local_var_req_builder = local_var_req_builder.json(&set_workspace_slack_oauth_config_request);
2703
2704    let local_var_req = local_var_req_builder.build()?;
2705    let local_var_resp = local_var_client.execute(local_var_req).await?;
2706
2707    let local_var_status = local_var_resp.status();
2708    let local_var_content = local_var_resp.text().await?;
2709
2710    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2711        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2712    } else {
2713        let local_var_entity: Option<SetWorkspaceSlackOauthConfigError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2714        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2715        Err(Error::ResponseError(local_var_error))
2716    }
2717}
2718
2719pub async fn unarchive_workspace(configuration: &configuration::Configuration, workspace: &str) -> Result<String, Error<UnarchiveWorkspaceError>> {
2720    let local_var_configuration = configuration;
2721
2722    let local_var_client = &local_var_configuration.client;
2723
2724    let local_var_uri_str = format!("{}/workspaces/unarchive/{workspace}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2725    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2726
2727    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2728        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2729    }
2730    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2731        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2732    };
2733
2734    let local_var_req = local_var_req_builder.build()?;
2735    let local_var_resp = local_var_client.execute(local_var_req).await?;
2736
2737    let local_var_status = local_var_resp.status();
2738    let local_var_content = local_var_resp.text().await?;
2739
2740    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2741        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2742    } else {
2743        let local_var_entity: Option<UnarchiveWorkspaceError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2744        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2745        Err(Error::ResponseError(local_var_error))
2746    }
2747}
2748
2749/// Updates the operator settings for a specific workspace. Requires workspace admin privileges.
2750pub async fn update_operator_settings(configuration: &configuration::Configuration, workspace: &str, operator_settings: Option<models::OperatorSettings>) -> Result<String, Error<UpdateOperatorSettingsError>> {
2751    let local_var_configuration = configuration;
2752
2753    let local_var_client = &local_var_configuration.client;
2754
2755    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/operator_settings", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2756    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2757
2758    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2759        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2760    }
2761    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2762        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2763    };
2764    local_var_req_builder = local_var_req_builder.json(&operator_settings);
2765
2766    let local_var_req = local_var_req_builder.build()?;
2767    let local_var_resp = local_var_client.execute(local_var_req).await?;
2768
2769    let local_var_status = local_var_resp.status();
2770    let local_var_content = local_var_resp.text().await?;
2771
2772    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2773        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2774    } else {
2775        let local_var_entity: Option<UpdateOperatorSettingsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2776        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2777        Err(Error::ResponseError(local_var_error))
2778    }
2779}
2780