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