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