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