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