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