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