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