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.519.1
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 [`delete_git_sync_repository`]
68#[derive(Debug, Clone, Serialize, Deserialize)]
69#[serde(untagged)]
70pub enum DeleteGitSyncRepositoryError {
71    UnknownValue(serde_json::Value),
72}
73
74/// struct for typed errors of method [`delete_invite`]
75#[derive(Debug, Clone, Serialize, Deserialize)]
76#[serde(untagged)]
77pub enum DeleteInviteError {
78    UnknownValue(serde_json::Value),
79}
80
81/// struct for typed errors of method [`delete_workspace`]
82#[derive(Debug, Clone, Serialize, Deserialize)]
83#[serde(untagged)]
84pub enum DeleteWorkspaceError {
85    UnknownValue(serde_json::Value),
86}
87
88/// struct for typed errors of method [`edit_auto_invite`]
89#[derive(Debug, Clone, Serialize, Deserialize)]
90#[serde(untagged)]
91pub enum EditAutoInviteError {
92    UnknownValue(serde_json::Value),
93}
94
95/// struct for typed errors of method [`edit_copilot_config`]
96#[derive(Debug, Clone, Serialize, Deserialize)]
97#[serde(untagged)]
98pub enum EditCopilotConfigError {
99    UnknownValue(serde_json::Value),
100}
101
102/// struct for typed errors of method [`edit_default_scripts`]
103#[derive(Debug, Clone, Serialize, Deserialize)]
104#[serde(untagged)]
105pub enum EditDefaultScriptsError {
106    UnknownValue(serde_json::Value),
107}
108
109/// struct for typed errors of method [`edit_deploy_to`]
110#[derive(Debug, Clone, Serialize, Deserialize)]
111#[serde(untagged)]
112pub enum EditDeployToError {
113    UnknownValue(serde_json::Value),
114}
115
116/// struct for typed errors of method [`edit_ducklake_config`]
117#[derive(Debug, Clone, Serialize, Deserialize)]
118#[serde(untagged)]
119pub enum EditDucklakeConfigError {
120    UnknownValue(serde_json::Value),
121}
122
123/// struct for typed errors of method [`edit_error_handler`]
124#[derive(Debug, Clone, Serialize, Deserialize)]
125#[serde(untagged)]
126pub enum EditErrorHandlerError {
127    UnknownValue(serde_json::Value),
128}
129
130/// struct for typed errors of method [`edit_git_sync_repository`]
131#[derive(Debug, Clone, Serialize, Deserialize)]
132#[serde(untagged)]
133pub enum EditGitSyncRepositoryError {
134    UnknownValue(serde_json::Value),
135}
136
137/// struct for typed errors of method [`edit_large_file_storage_config`]
138#[derive(Debug, Clone, Serialize, Deserialize)]
139#[serde(untagged)]
140pub enum EditLargeFileStorageConfigError {
141    UnknownValue(serde_json::Value),
142}
143
144/// struct for typed errors of method [`edit_slack_command`]
145#[derive(Debug, Clone, Serialize, Deserialize)]
146#[serde(untagged)]
147pub enum EditSlackCommandError {
148    UnknownValue(serde_json::Value),
149}
150
151/// struct for typed errors of method [`edit_teams_command`]
152#[derive(Debug, Clone, Serialize, Deserialize)]
153#[serde(untagged)]
154pub enum EditTeamsCommandError {
155    UnknownValue(serde_json::Value),
156}
157
158/// struct for typed errors of method [`edit_webhook`]
159#[derive(Debug, Clone, Serialize, Deserialize)]
160#[serde(untagged)]
161pub enum EditWebhookError {
162    UnknownValue(serde_json::Value),
163}
164
165/// struct for typed errors of method [`edit_workspace_default_app`]
166#[derive(Debug, Clone, Serialize, Deserialize)]
167#[serde(untagged)]
168pub enum EditWorkspaceDefaultAppError {
169    UnknownValue(serde_json::Value),
170}
171
172/// struct for typed errors of method [`edit_workspace_deploy_ui_settings`]
173#[derive(Debug, Clone, Serialize, Deserialize)]
174#[serde(untagged)]
175pub enum EditWorkspaceDeployUiSettingsError {
176    UnknownValue(serde_json::Value),
177}
178
179/// struct for typed errors of method [`edit_workspace_git_sync_config`]
180#[derive(Debug, Clone, Serialize, Deserialize)]
181#[serde(untagged)]
182pub enum EditWorkspaceGitSyncConfigError {
183    UnknownValue(serde_json::Value),
184}
185
186/// struct for typed errors of method [`exists_username`]
187#[derive(Debug, Clone, Serialize, Deserialize)]
188#[serde(untagged)]
189pub enum ExistsUsernameError {
190    UnknownValue(serde_json::Value),
191}
192
193/// struct for typed errors of method [`exists_workspace`]
194#[derive(Debug, Clone, Serialize, Deserialize)]
195#[serde(untagged)]
196pub enum ExistsWorkspaceError {
197    UnknownValue(serde_json::Value),
198}
199
200/// struct for typed errors of method [`get_copilot_info`]
201#[derive(Debug, Clone, Serialize, Deserialize)]
202#[serde(untagged)]
203pub enum GetCopilotInfoError {
204    UnknownValue(serde_json::Value),
205}
206
207/// struct for typed errors of method [`get_default_scripts`]
208#[derive(Debug, Clone, Serialize, Deserialize)]
209#[serde(untagged)]
210pub enum GetDefaultScriptsError {
211    UnknownValue(serde_json::Value),
212}
213
214/// struct for typed errors of method [`get_deploy_to`]
215#[derive(Debug, Clone, Serialize, Deserialize)]
216#[serde(untagged)]
217pub enum GetDeployToError {
218    UnknownValue(serde_json::Value),
219}
220
221/// struct for typed errors of method [`get_github_app_token`]
222#[derive(Debug, Clone, Serialize, Deserialize)]
223#[serde(untagged)]
224pub enum GetGithubAppTokenError {
225    UnknownValue(serde_json::Value),
226}
227
228/// struct for typed errors of method [`get_is_premium`]
229#[derive(Debug, Clone, Serialize, Deserialize)]
230#[serde(untagged)]
231pub enum GetIsPremiumError {
232    UnknownValue(serde_json::Value),
233}
234
235/// struct for typed errors of method [`get_large_file_storage_config`]
236#[derive(Debug, Clone, Serialize, Deserialize)]
237#[serde(untagged)]
238pub enum GetLargeFileStorageConfigError {
239    UnknownValue(serde_json::Value),
240}
241
242/// struct for typed errors of method [`get_premium_info`]
243#[derive(Debug, Clone, Serialize, Deserialize)]
244#[serde(untagged)]
245pub enum GetPremiumInfoError {
246    UnknownValue(serde_json::Value),
247}
248
249/// struct for typed errors of method [`get_settings`]
250#[derive(Debug, Clone, Serialize, Deserialize)]
251#[serde(untagged)]
252pub enum GetSettingsError {
253    UnknownValue(serde_json::Value),
254}
255
256/// struct for typed errors of method [`get_threshold_alert`]
257#[derive(Debug, Clone, Serialize, Deserialize)]
258#[serde(untagged)]
259pub enum GetThresholdAlertError {
260    UnknownValue(serde_json::Value),
261}
262
263/// struct for typed errors of method [`get_used_triggers`]
264#[derive(Debug, Clone, Serialize, Deserialize)]
265#[serde(untagged)]
266pub enum GetUsedTriggersError {
267    UnknownValue(serde_json::Value),
268}
269
270/// struct for typed errors of method [`get_workspace_default_app`]
271#[derive(Debug, Clone, Serialize, Deserialize)]
272#[serde(untagged)]
273pub enum GetWorkspaceDefaultAppError {
274    UnknownValue(serde_json::Value),
275}
276
277/// struct for typed errors of method [`get_workspace_encryption_key`]
278#[derive(Debug, Clone, Serialize, Deserialize)]
279#[serde(untagged)]
280pub enum GetWorkspaceEncryptionKeyError {
281    UnknownValue(serde_json::Value),
282}
283
284/// struct for typed errors of method [`get_workspace_name`]
285#[derive(Debug, Clone, Serialize, Deserialize)]
286#[serde(untagged)]
287pub enum GetWorkspaceNameError {
288    UnknownValue(serde_json::Value),
289}
290
291/// struct for typed errors of method [`get_workspace_usage`]
292#[derive(Debug, Clone, Serialize, Deserialize)]
293#[serde(untagged)]
294pub enum GetWorkspaceUsageError {
295    UnknownValue(serde_json::Value),
296}
297
298/// struct for typed errors of method [`invite_user`]
299#[derive(Debug, Clone, Serialize, Deserialize)]
300#[serde(untagged)]
301pub enum InviteUserError {
302    UnknownValue(serde_json::Value),
303}
304
305/// struct for typed errors of method [`is_domain_allowed`]
306#[derive(Debug, Clone, Serialize, Deserialize)]
307#[serde(untagged)]
308pub enum IsDomainAllowedError {
309    UnknownValue(serde_json::Value),
310}
311
312/// struct for typed errors of method [`leave_workspace`]
313#[derive(Debug, Clone, Serialize, Deserialize)]
314#[serde(untagged)]
315pub enum LeaveWorkspaceError {
316    UnknownValue(serde_json::Value),
317}
318
319/// struct for typed errors of method [`list_available_teams_channels`]
320#[derive(Debug, Clone, Serialize, Deserialize)]
321#[serde(untagged)]
322pub enum ListAvailableTeamsChannelsError {
323    UnknownValue(serde_json::Value),
324}
325
326/// struct for typed errors of method [`list_available_teams_ids`]
327#[derive(Debug, Clone, Serialize, Deserialize)]
328#[serde(untagged)]
329pub enum ListAvailableTeamsIdsError {
330    UnknownValue(serde_json::Value),
331}
332
333/// struct for typed errors of method [`list_ducklakes`]
334#[derive(Debug, Clone, Serialize, Deserialize)]
335#[serde(untagged)]
336pub enum ListDucklakesError {
337    UnknownValue(serde_json::Value),
338}
339
340/// struct for typed errors of method [`list_pending_invites`]
341#[derive(Debug, Clone, Serialize, Deserialize)]
342#[serde(untagged)]
343pub enum ListPendingInvitesError {
344    UnknownValue(serde_json::Value),
345}
346
347/// struct for typed errors of method [`list_user_workspaces`]
348#[derive(Debug, Clone, Serialize, Deserialize)]
349#[serde(untagged)]
350pub enum ListUserWorkspacesError {
351    UnknownValue(serde_json::Value),
352}
353
354/// struct for typed errors of method [`list_workspaces`]
355#[derive(Debug, Clone, Serialize, Deserialize)]
356#[serde(untagged)]
357pub enum ListWorkspacesError {
358    UnknownValue(serde_json::Value),
359}
360
361/// struct for typed errors of method [`list_workspaces_as_super_admin`]
362#[derive(Debug, Clone, Serialize, Deserialize)]
363#[serde(untagged)]
364pub enum ListWorkspacesAsSuperAdminError {
365    UnknownValue(serde_json::Value),
366}
367
368/// struct for typed errors of method [`run_slack_message_test_job`]
369#[derive(Debug, Clone, Serialize, Deserialize)]
370#[serde(untagged)]
371pub enum RunSlackMessageTestJobError {
372    UnknownValue(serde_json::Value),
373}
374
375/// struct for typed errors of method [`run_teams_message_test_job`]
376#[derive(Debug, Clone, Serialize, Deserialize)]
377#[serde(untagged)]
378pub enum RunTeamsMessageTestJobError {
379    UnknownValue(serde_json::Value),
380}
381
382/// struct for typed errors of method [`set_environment_variable`]
383#[derive(Debug, Clone, Serialize, Deserialize)]
384#[serde(untagged)]
385pub enum SetEnvironmentVariableError {
386    UnknownValue(serde_json::Value),
387}
388
389/// struct for typed errors of method [`set_threshold_alert`]
390#[derive(Debug, Clone, Serialize, Deserialize)]
391#[serde(untagged)]
392pub enum SetThresholdAlertError {
393    UnknownValue(serde_json::Value),
394}
395
396/// struct for typed errors of method [`set_workspace_encryption_key`]
397#[derive(Debug, Clone, Serialize, Deserialize)]
398#[serde(untagged)]
399pub enum SetWorkspaceEncryptionKeyError {
400    UnknownValue(serde_json::Value),
401}
402
403/// struct for typed errors of method [`unarchive_workspace`]
404#[derive(Debug, Clone, Serialize, Deserialize)]
405#[serde(untagged)]
406pub enum UnarchiveWorkspaceError {
407    UnknownValue(serde_json::Value),
408}
409
410/// struct for typed errors of method [`update_operator_settings`]
411#[derive(Debug, Clone, Serialize, Deserialize)]
412#[serde(untagged)]
413pub enum UpdateOperatorSettingsError {
414    UnknownValue(serde_json::Value),
415}
416
417
418pub async fn add_user(configuration: &configuration::Configuration, workspace: &str, add_user_request: models::AddUserRequest) -> Result<String, Error<AddUserError>> {
419    let local_var_configuration = configuration;
420
421    let local_var_client = &local_var_configuration.client;
422
423    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/add_user", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
424    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
425
426    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
427        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
428    }
429    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
430        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
431    };
432    local_var_req_builder = local_var_req_builder.json(&add_user_request);
433
434    let local_var_req = local_var_req_builder.build()?;
435    let local_var_resp = local_var_client.execute(local_var_req).await?;
436
437    let local_var_status = local_var_resp.status();
438    let local_var_content = local_var_resp.text().await?;
439
440    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
441        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
442    } else {
443        let local_var_entity: Option<AddUserError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
444        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
445        Err(Error::ResponseError(local_var_error))
446    }
447}
448
449pub async fn archive_workspace(configuration: &configuration::Configuration, workspace: &str) -> Result<String, Error<ArchiveWorkspaceError>> {
450    let local_var_configuration = configuration;
451
452    let local_var_client = &local_var_configuration.client;
453
454    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/archive", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
455    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
456
457    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
458        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
459    }
460    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
461        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
462    };
463
464    let local_var_req = local_var_req_builder.build()?;
465    let local_var_resp = local_var_client.execute(local_var_req).await?;
466
467    let local_var_status = local_var_resp.status();
468    let local_var_content = local_var_resp.text().await?;
469
470    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
471        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
472    } else {
473        let local_var_entity: Option<ArchiveWorkspaceError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
474        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
475        Err(Error::ResponseError(local_var_error))
476    }
477}
478
479pub async fn change_workspace_color(configuration: &configuration::Configuration, workspace: &str, change_workspace_color_request: Option<models::ChangeWorkspaceColorRequest>) -> Result<String, Error<ChangeWorkspaceColorError>> {
480    let local_var_configuration = configuration;
481
482    let local_var_client = &local_var_configuration.client;
483
484    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/change_workspace_color", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
485    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
486
487    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
488        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
489    }
490    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
491        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
492    };
493    local_var_req_builder = local_var_req_builder.json(&change_workspace_color_request);
494
495    let local_var_req = local_var_req_builder.build()?;
496    let local_var_resp = local_var_client.execute(local_var_req).await?;
497
498    let local_var_status = local_var_resp.status();
499    let local_var_content = local_var_resp.text().await?;
500
501    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
502        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
503    } else {
504        let local_var_entity: Option<ChangeWorkspaceColorError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
505        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
506        Err(Error::ResponseError(local_var_error))
507    }
508}
509
510pub async fn change_workspace_id(configuration: &configuration::Configuration, workspace: &str, change_workspace_id_request: Option<models::ChangeWorkspaceIdRequest>) -> Result<String, Error<ChangeWorkspaceIdError>> {
511    let local_var_configuration = configuration;
512
513    let local_var_client = &local_var_configuration.client;
514
515    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/change_workspace_id", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
516    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
517
518    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
519        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
520    }
521    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
522        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
523    };
524    local_var_req_builder = local_var_req_builder.json(&change_workspace_id_request);
525
526    let local_var_req = local_var_req_builder.build()?;
527    let local_var_resp = local_var_client.execute(local_var_req).await?;
528
529    let local_var_status = local_var_resp.status();
530    let local_var_content = local_var_resp.text().await?;
531
532    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
533        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
534    } else {
535        let local_var_entity: Option<ChangeWorkspaceIdError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
536        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
537        Err(Error::ResponseError(local_var_error))
538    }
539}
540
541pub async fn change_workspace_name(configuration: &configuration::Configuration, workspace: &str, change_workspace_name_request: Option<models::ChangeWorkspaceNameRequest>) -> Result<String, Error<ChangeWorkspaceNameError>> {
542    let local_var_configuration = configuration;
543
544    let local_var_client = &local_var_configuration.client;
545
546    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/change_workspace_name", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
547    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
548
549    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
550        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
551    }
552    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
553        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
554    };
555    local_var_req_builder = local_var_req_builder.json(&change_workspace_name_request);
556
557    let local_var_req = local_var_req_builder.build()?;
558    let local_var_resp = local_var_client.execute(local_var_req).await?;
559
560    let local_var_status = local_var_resp.status();
561    let local_var_content = local_var_resp.text().await?;
562
563    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
564        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
565    } else {
566        let local_var_entity: Option<ChangeWorkspaceNameError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
567        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
568        Err(Error::ResponseError(local_var_error))
569    }
570}
571
572pub async fn connect_teams(configuration: &configuration::Configuration, workspace: &str, connect_teams_request: models::ConnectTeamsRequest) -> Result<String, Error<ConnectTeamsError>> {
573    let local_var_configuration = configuration;
574
575    let local_var_client = &local_var_configuration.client;
576
577    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/connect_teams", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
578    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
579
580    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
581        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
582    }
583    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
584        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
585    };
586    local_var_req_builder = local_var_req_builder.json(&connect_teams_request);
587
588    let local_var_req = local_var_req_builder.build()?;
589    let local_var_resp = local_var_client.execute(local_var_req).await?;
590
591    let local_var_status = local_var_resp.status();
592    let local_var_content = local_var_resp.text().await?;
593
594    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
595        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
596    } else {
597        let local_var_entity: Option<ConnectTeamsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
598        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
599        Err(Error::ResponseError(local_var_error))
600    }
601}
602
603pub async fn create_workspace(configuration: &configuration::Configuration, create_workspace: models::CreateWorkspace) -> Result<String, Error<CreateWorkspaceError>> {
604    let local_var_configuration = configuration;
605
606    let local_var_client = &local_var_configuration.client;
607
608    let local_var_uri_str = format!("{}/workspaces/create", local_var_configuration.base_path);
609    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
610
611    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
612        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
613    }
614    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
615        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
616    };
617    local_var_req_builder = local_var_req_builder.json(&create_workspace);
618
619    let local_var_req = local_var_req_builder.build()?;
620    let local_var_resp = local_var_client.execute(local_var_req).await?;
621
622    let local_var_status = local_var_resp.status();
623    let local_var_content = local_var_resp.text().await?;
624
625    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
626        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
627    } else {
628        let local_var_entity: Option<CreateWorkspaceError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
629        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
630        Err(Error::ResponseError(local_var_error))
631    }
632}
633
634pub async fn delete_git_sync_repository(configuration: &configuration::Configuration, workspace: &str, delete_git_sync_repository_request: models::DeleteGitSyncRepositoryRequest) -> Result<serde_json::Value, Error<DeleteGitSyncRepositoryError>> {
635    let local_var_configuration = configuration;
636
637    let local_var_client = &local_var_configuration.client;
638
639    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/delete_git_sync_repository", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
640    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
641
642    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
643        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
644    }
645    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
646        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
647    };
648    local_var_req_builder = local_var_req_builder.json(&delete_git_sync_repository_request);
649
650    let local_var_req = local_var_req_builder.build()?;
651    let local_var_resp = local_var_client.execute(local_var_req).await?;
652
653    let local_var_status = local_var_resp.status();
654    let local_var_content = local_var_resp.text().await?;
655
656    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
657        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
658    } else {
659        let local_var_entity: Option<DeleteGitSyncRepositoryError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
660        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
661        Err(Error::ResponseError(local_var_error))
662    }
663}
664
665pub async fn delete_invite(configuration: &configuration::Configuration, workspace: &str, invite_user_request: models::InviteUserRequest) -> Result<String, Error<DeleteInviteError>> {
666    let local_var_configuration = configuration;
667
668    let local_var_client = &local_var_configuration.client;
669
670    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/delete_invite", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
671    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
672
673    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
674        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
675    }
676    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
677        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
678    };
679    local_var_req_builder = local_var_req_builder.json(&invite_user_request);
680
681    let local_var_req = local_var_req_builder.build()?;
682    let local_var_resp = local_var_client.execute(local_var_req).await?;
683
684    let local_var_status = local_var_resp.status();
685    let local_var_content = local_var_resp.text().await?;
686
687    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
688        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
689    } else {
690        let local_var_entity: Option<DeleteInviteError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
691        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
692        Err(Error::ResponseError(local_var_error))
693    }
694}
695
696pub async fn delete_workspace(configuration: &configuration::Configuration, workspace: &str) -> Result<String, Error<DeleteWorkspaceError>> {
697    let local_var_configuration = configuration;
698
699    let local_var_client = &local_var_configuration.client;
700
701    let local_var_uri_str = format!("{}/workspaces/delete/{workspace}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
702    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
703
704    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
705        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
706    }
707    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
708        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
709    };
710
711    let local_var_req = local_var_req_builder.build()?;
712    let local_var_resp = local_var_client.execute(local_var_req).await?;
713
714    let local_var_status = local_var_resp.status();
715    let local_var_content = local_var_resp.text().await?;
716
717    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
718        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
719    } else {
720        let local_var_entity: Option<DeleteWorkspaceError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
721        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
722        Err(Error::ResponseError(local_var_error))
723    }
724}
725
726pub async fn edit_auto_invite(configuration: &configuration::Configuration, workspace: &str, edit_auto_invite_request: models::EditAutoInviteRequest) -> Result<String, Error<EditAutoInviteError>> {
727    let local_var_configuration = configuration;
728
729    let local_var_client = &local_var_configuration.client;
730
731    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_auto_invite", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
732    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
733
734    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
735        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
736    }
737    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
738        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
739    };
740    local_var_req_builder = local_var_req_builder.json(&edit_auto_invite_request);
741
742    let local_var_req = local_var_req_builder.build()?;
743    let local_var_resp = local_var_client.execute(local_var_req).await?;
744
745    let local_var_status = local_var_resp.status();
746    let local_var_content = local_var_resp.text().await?;
747
748    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
749        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
750    } else {
751        let local_var_entity: Option<EditAutoInviteError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
752        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
753        Err(Error::ResponseError(local_var_error))
754    }
755}
756
757pub async fn edit_copilot_config(configuration: &configuration::Configuration, workspace: &str, ai_config: models::AiConfig) -> Result<String, Error<EditCopilotConfigError>> {
758    let local_var_configuration = configuration;
759
760    let local_var_client = &local_var_configuration.client;
761
762    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_copilot_config", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
763    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
764
765    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
766        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
767    }
768    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
769        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
770    };
771    local_var_req_builder = local_var_req_builder.json(&ai_config);
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<EditCopilotConfigError> = 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_default_scripts(configuration: &configuration::Configuration, workspace: &str, workspace_default_scripts: Option<models::WorkspaceDefaultScripts>) -> Result<String, Error<EditDefaultScriptsError>> {
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/default_scripts", 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(&workspace_default_scripts);
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<EditDefaultScriptsError> = 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_deploy_to(configuration: &configuration::Configuration, workspace: &str, get_deploy_to200_response: models::GetDeployTo200Response) -> Result<String, Error<EditDeployToError>> {
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_deploy_to", 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(&get_deploy_to200_response);
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<EditDeployToError> = 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_ducklake_config(configuration: &configuration::Configuration, workspace: &str, edit_ducklake_config_request: models::EditDucklakeConfigRequest) -> Result<serde_json::Value, Error<EditDucklakeConfigError>> {
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/edit_ducklake_config", 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(&edit_ducklake_config_request);
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<EditDucklakeConfigError> = 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_error_handler(configuration: &configuration::Configuration, workspace: &str, edit_error_handler_request: models::EditErrorHandlerRequest) -> Result<String, Error<EditErrorHandlerError>> {
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_error_handler", 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(&edit_error_handler_request);
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<EditErrorHandlerError> = 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_git_sync_repository(configuration: &configuration::Configuration, workspace: &str, edit_git_sync_repository_request: models::EditGitSyncRepositoryRequest) -> Result<serde_json::Value, Error<EditGitSyncRepositoryError>> {
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_git_sync_repository", 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_git_sync_repository_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<EditGitSyncRepositoryError> = 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_large_file_storage_config(configuration: &configuration::Configuration, workspace: &str, edit_large_file_storage_config_request: models::EditLargeFileStorageConfigRequest) -> Result<serde_json::Value, Error<EditLargeFileStorageConfigError>> {
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_large_file_storage_config", 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_large_file_storage_config_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<EditLargeFileStorageConfigError> = 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_slack_command(configuration: &configuration::Configuration, workspace: &str, edit_slack_command_request: models::EditSlackCommandRequest) -> Result<String, Error<EditSlackCommandError>> {
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_slack_command", 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_slack_command_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<EditSlackCommandError> = 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_teams_command(configuration: &configuration::Configuration, workspace: &str, edit_slack_command_request: models::EditSlackCommandRequest) -> Result<String, Error<EditTeamsCommandError>> {
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_teams_command", 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_slack_command_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<EditTeamsCommandError> = 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_webhook(configuration: &configuration::Configuration, workspace: &str, edit_webhook_request: models::EditWebhookRequest) -> Result<String, Error<EditWebhookError>> {
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_webhook", 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_webhook_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<EditWebhookError> = 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_workspace_default_app(configuration: &configuration::Configuration, workspace: &str, edit_workspace_default_app_request: models::EditWorkspaceDefaultAppRequest) -> Result<String, Error<EditWorkspaceDefaultAppError>> {
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_default_app", 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_workspace_default_app_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<EditWorkspaceDefaultAppError> = 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_workspace_deploy_ui_settings(configuration: &configuration::Configuration, workspace: &str, edit_workspace_deploy_ui_settings_request: models::EditWorkspaceDeployUiSettingsRequest) -> Result<serde_json::Value, Error<EditWorkspaceDeployUiSettingsError>> {
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_deploy_ui_config", 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_workspace_deploy_ui_settings_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<EditWorkspaceDeployUiSettingsError> = 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_workspace_git_sync_config(configuration: &configuration::Configuration, workspace: &str, edit_workspace_git_sync_config_request: models::EditWorkspaceGitSyncConfigRequest) -> Result<serde_json::Value, Error<EditWorkspaceGitSyncConfigError>> {
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_git_sync_config", 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_workspace_git_sync_config_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<EditWorkspaceGitSyncConfigError> = 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 exists_username(configuration: &configuration::Configuration, exists_username_request: models::ExistsUsernameRequest) -> Result<bool, Error<ExistsUsernameError>> {
1161    let local_var_configuration = configuration;
1162
1163    let local_var_client = &local_var_configuration.client;
1164
1165    let local_var_uri_str = format!("{}/workspaces/exists_username", local_var_configuration.base_path);
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(&exists_username_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<ExistsUsernameError> = 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 exists_workspace(configuration: &configuration::Configuration, exists_workspace_request: models::ExistsWorkspaceRequest) -> Result<bool, Error<ExistsWorkspaceError>> {
1192    let local_var_configuration = configuration;
1193
1194    let local_var_client = &local_var_configuration.client;
1195
1196    let local_var_uri_str = format!("{}/workspaces/exists", local_var_configuration.base_path);
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(&exists_workspace_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<ExistsWorkspaceError> = 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 get_copilot_info(configuration: &configuration::Configuration, workspace: &str) -> Result<models::AiConfig, Error<GetCopilotInfoError>> {
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/get_copilot_info", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1228    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, 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
1237    let local_var_req = local_var_req_builder.build()?;
1238    let local_var_resp = local_var_client.execute(local_var_req).await?;
1239
1240    let local_var_status = local_var_resp.status();
1241    let local_var_content = local_var_resp.text().await?;
1242
1243    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1244        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1245    } else {
1246        let local_var_entity: Option<GetCopilotInfoError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1247        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1248        Err(Error::ResponseError(local_var_error))
1249    }
1250}
1251
1252pub async fn get_default_scripts(configuration: &configuration::Configuration, workspace: &str) -> Result<models::WorkspaceDefaultScripts, Error<GetDefaultScriptsError>> {
1253    let local_var_configuration = configuration;
1254
1255    let local_var_client = &local_var_configuration.client;
1256
1257    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/default_scripts", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1258    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1259
1260    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1261        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1262    }
1263    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1264        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1265    };
1266
1267    let local_var_req = local_var_req_builder.build()?;
1268    let local_var_resp = local_var_client.execute(local_var_req).await?;
1269
1270    let local_var_status = local_var_resp.status();
1271    let local_var_content = local_var_resp.text().await?;
1272
1273    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1274        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1275    } else {
1276        let local_var_entity: Option<GetDefaultScriptsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1277        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1278        Err(Error::ResponseError(local_var_error))
1279    }
1280}
1281
1282pub async fn get_deploy_to(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetDeployTo200Response, Error<GetDeployToError>> {
1283    let local_var_configuration = configuration;
1284
1285    let local_var_client = &local_var_configuration.client;
1286
1287    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_deploy_to", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1288    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1289
1290    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1291        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1292    }
1293    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1294        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1295    };
1296
1297    let local_var_req = local_var_req_builder.build()?;
1298    let local_var_resp = local_var_client.execute(local_var_req).await?;
1299
1300    let local_var_status = local_var_resp.status();
1301    let local_var_content = local_var_resp.text().await?;
1302
1303    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1304        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1305    } else {
1306        let local_var_entity: Option<GetDeployToError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1307        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1308        Err(Error::ResponseError(local_var_error))
1309    }
1310}
1311
1312pub async fn get_github_app_token(configuration: &configuration::Configuration, workspace: &str, get_github_app_token_request: models::GetGithubAppTokenRequest) -> Result<models::GetGithubAppToken200Response, Error<GetGithubAppTokenError>> {
1313    let local_var_configuration = configuration;
1314
1315    let local_var_client = &local_var_configuration.client;
1316
1317    let local_var_uri_str = format!("{}/w/{workspace}/github_app/token", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1318    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1319
1320    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1321        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1322    }
1323    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1324        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1325    };
1326    local_var_req_builder = local_var_req_builder.json(&get_github_app_token_request);
1327
1328    let local_var_req = local_var_req_builder.build()?;
1329    let local_var_resp = local_var_client.execute(local_var_req).await?;
1330
1331    let local_var_status = local_var_resp.status();
1332    let local_var_content = local_var_resp.text().await?;
1333
1334    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1335        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1336    } else {
1337        let local_var_entity: Option<GetGithubAppTokenError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1338        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1339        Err(Error::ResponseError(local_var_error))
1340    }
1341}
1342
1343pub async fn get_is_premium(configuration: &configuration::Configuration, workspace: &str) -> Result<bool, Error<GetIsPremiumError>> {
1344    let local_var_configuration = configuration;
1345
1346    let local_var_client = &local_var_configuration.client;
1347
1348    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/is_premium", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1349    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1350
1351    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1352        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1353    }
1354    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1355        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1356    };
1357
1358    let local_var_req = local_var_req_builder.build()?;
1359    let local_var_resp = local_var_client.execute(local_var_req).await?;
1360
1361    let local_var_status = local_var_resp.status();
1362    let local_var_content = local_var_resp.text().await?;
1363
1364    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1365        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1366    } else {
1367        let local_var_entity: Option<GetIsPremiumError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1368        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1369        Err(Error::ResponseError(local_var_error))
1370    }
1371}
1372
1373pub async fn get_large_file_storage_config(configuration: &configuration::Configuration, workspace: &str) -> Result<models::LargeFileStorage, Error<GetLargeFileStorageConfigError>> {
1374    let local_var_configuration = configuration;
1375
1376    let local_var_client = &local_var_configuration.client;
1377
1378    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_large_file_storage_config", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1379    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1380
1381    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1382        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1383    }
1384    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1385        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1386    };
1387
1388    let local_var_req = local_var_req_builder.build()?;
1389    let local_var_resp = local_var_client.execute(local_var_req).await?;
1390
1391    let local_var_status = local_var_resp.status();
1392    let local_var_content = local_var_resp.text().await?;
1393
1394    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1395        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1396    } else {
1397        let local_var_entity: Option<GetLargeFileStorageConfigError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1398        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1399        Err(Error::ResponseError(local_var_error))
1400    }
1401}
1402
1403pub async fn get_premium_info(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetPremiumInfo200Response, Error<GetPremiumInfoError>> {
1404    let local_var_configuration = configuration;
1405
1406    let local_var_client = &local_var_configuration.client;
1407
1408    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/premium_info", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1409    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1410
1411    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1412        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1413    }
1414    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1415        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1416    };
1417
1418    let local_var_req = local_var_req_builder.build()?;
1419    let local_var_resp = local_var_client.execute(local_var_req).await?;
1420
1421    let local_var_status = local_var_resp.status();
1422    let local_var_content = local_var_resp.text().await?;
1423
1424    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1425        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1426    } else {
1427        let local_var_entity: Option<GetPremiumInfoError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1428        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1429        Err(Error::ResponseError(local_var_error))
1430    }
1431}
1432
1433pub async fn get_settings(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetSettings200Response, Error<GetSettingsError>> {
1434    let local_var_configuration = configuration;
1435
1436    let local_var_client = &local_var_configuration.client;
1437
1438    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_settings", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1439    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1440
1441    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1442        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1443    }
1444    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1445        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1446    };
1447
1448    let local_var_req = local_var_req_builder.build()?;
1449    let local_var_resp = local_var_client.execute(local_var_req).await?;
1450
1451    let local_var_status = local_var_resp.status();
1452    let local_var_content = local_var_resp.text().await?;
1453
1454    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1455        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1456    } else {
1457        let local_var_entity: Option<GetSettingsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1458        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1459        Err(Error::ResponseError(local_var_error))
1460    }
1461}
1462
1463pub async fn get_threshold_alert(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetThresholdAlert200Response, Error<GetThresholdAlertError>> {
1464    let local_var_configuration = configuration;
1465
1466    let local_var_client = &local_var_configuration.client;
1467
1468    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/threshold_alert", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1469    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1470
1471    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1472        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1473    }
1474    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1475        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1476    };
1477
1478    let local_var_req = local_var_req_builder.build()?;
1479    let local_var_resp = local_var_client.execute(local_var_req).await?;
1480
1481    let local_var_status = local_var_resp.status();
1482    let local_var_content = local_var_resp.text().await?;
1483
1484    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1485        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1486    } else {
1487        let local_var_entity: Option<GetThresholdAlertError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1488        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1489        Err(Error::ResponseError(local_var_error))
1490    }
1491}
1492
1493pub async fn get_used_triggers(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetUsedTriggers200Response, Error<GetUsedTriggersError>> {
1494    let local_var_configuration = configuration;
1495
1496    let local_var_client = &local_var_configuration.client;
1497
1498    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/used_triggers", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1499    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1500
1501    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1502        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1503    }
1504    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1505        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1506    };
1507
1508    let local_var_req = local_var_req_builder.build()?;
1509    let local_var_resp = local_var_client.execute(local_var_req).await?;
1510
1511    let local_var_status = local_var_resp.status();
1512    let local_var_content = local_var_resp.text().await?;
1513
1514    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1515        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1516    } else {
1517        let local_var_entity: Option<GetUsedTriggersError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1518        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1519        Err(Error::ResponseError(local_var_error))
1520    }
1521}
1522
1523pub async fn get_workspace_default_app(configuration: &configuration::Configuration, workspace: &str) -> Result<models::EditWorkspaceDefaultAppRequest, Error<GetWorkspaceDefaultAppError>> {
1524    let local_var_configuration = configuration;
1525
1526    let local_var_client = &local_var_configuration.client;
1527
1528    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/default_app", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1529    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1530
1531    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1532        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1533    }
1534    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1535        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1536    };
1537
1538    let local_var_req = local_var_req_builder.build()?;
1539    let local_var_resp = local_var_client.execute(local_var_req).await?;
1540
1541    let local_var_status = local_var_resp.status();
1542    let local_var_content = local_var_resp.text().await?;
1543
1544    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1545        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1546    } else {
1547        let local_var_entity: Option<GetWorkspaceDefaultAppError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1548        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1549        Err(Error::ResponseError(local_var_error))
1550    }
1551}
1552
1553pub async fn get_workspace_encryption_key(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetWorkspaceEncryptionKey200Response, Error<GetWorkspaceEncryptionKeyError>> {
1554    let local_var_configuration = configuration;
1555
1556    let local_var_client = &local_var_configuration.client;
1557
1558    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/encryption_key", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1559    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1560
1561    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1562        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1563    }
1564    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1565        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1566    };
1567
1568    let local_var_req = local_var_req_builder.build()?;
1569    let local_var_resp = local_var_client.execute(local_var_req).await?;
1570
1571    let local_var_status = local_var_resp.status();
1572    let local_var_content = local_var_resp.text().await?;
1573
1574    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1575        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1576    } else {
1577        let local_var_entity: Option<GetWorkspaceEncryptionKeyError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1578        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1579        Err(Error::ResponseError(local_var_error))
1580    }
1581}
1582
1583pub async fn get_workspace_name(configuration: &configuration::Configuration, workspace: &str) -> Result<String, Error<GetWorkspaceNameError>> {
1584    let local_var_configuration = configuration;
1585
1586    let local_var_client = &local_var_configuration.client;
1587
1588    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_workspace_name", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1589    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1590
1591    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1592        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1593    }
1594    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1595        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1596    };
1597
1598    let local_var_req = local_var_req_builder.build()?;
1599    let local_var_resp = local_var_client.execute(local_var_req).await?;
1600
1601    let local_var_status = local_var_resp.status();
1602    let local_var_content = local_var_resp.text().await?;
1603
1604    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1605        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1606    } else {
1607        let local_var_entity: Option<GetWorkspaceNameError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1608        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1609        Err(Error::ResponseError(local_var_error))
1610    }
1611}
1612
1613pub async fn get_workspace_usage(configuration: &configuration::Configuration, workspace: &str) -> Result<f64, Error<GetWorkspaceUsageError>> {
1614    let local_var_configuration = configuration;
1615
1616    let local_var_client = &local_var_configuration.client;
1617
1618    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/usage", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1619    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1620
1621    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1622        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1623    }
1624    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1625        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1626    };
1627
1628    let local_var_req = local_var_req_builder.build()?;
1629    let local_var_resp = local_var_client.execute(local_var_req).await?;
1630
1631    let local_var_status = local_var_resp.status();
1632    let local_var_content = local_var_resp.text().await?;
1633
1634    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1635        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1636    } else {
1637        let local_var_entity: Option<GetWorkspaceUsageError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1638        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1639        Err(Error::ResponseError(local_var_error))
1640    }
1641}
1642
1643pub async fn invite_user(configuration: &configuration::Configuration, workspace: &str, invite_user_request: models::InviteUserRequest) -> Result<String, Error<InviteUserError>> {
1644    let local_var_configuration = configuration;
1645
1646    let local_var_client = &local_var_configuration.client;
1647
1648    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/invite_user", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1649    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1650
1651    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1652        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1653    }
1654    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1655        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1656    };
1657    local_var_req_builder = local_var_req_builder.json(&invite_user_request);
1658
1659    let local_var_req = local_var_req_builder.build()?;
1660    let local_var_resp = local_var_client.execute(local_var_req).await?;
1661
1662    let local_var_status = local_var_resp.status();
1663    let local_var_content = local_var_resp.text().await?;
1664
1665    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1666        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1667    } else {
1668        let local_var_entity: Option<InviteUserError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1669        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1670        Err(Error::ResponseError(local_var_error))
1671    }
1672}
1673
1674pub async fn is_domain_allowed(configuration: &configuration::Configuration, ) -> Result<bool, Error<IsDomainAllowedError>> {
1675    let local_var_configuration = configuration;
1676
1677    let local_var_client = &local_var_configuration.client;
1678
1679    let local_var_uri_str = format!("{}/workspaces/allowed_domain_auto_invite", local_var_configuration.base_path);
1680    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1681
1682    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1683        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1684    }
1685    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1686        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1687    };
1688
1689    let local_var_req = local_var_req_builder.build()?;
1690    let local_var_resp = local_var_client.execute(local_var_req).await?;
1691
1692    let local_var_status = local_var_resp.status();
1693    let local_var_content = local_var_resp.text().await?;
1694
1695    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1696        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1697    } else {
1698        let local_var_entity: Option<IsDomainAllowedError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1699        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1700        Err(Error::ResponseError(local_var_error))
1701    }
1702}
1703
1704pub async fn leave_workspace(configuration: &configuration::Configuration, workspace: &str) -> Result<String, Error<LeaveWorkspaceError>> {
1705    let local_var_configuration = configuration;
1706
1707    let local_var_client = &local_var_configuration.client;
1708
1709    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/leave", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1710    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1711
1712    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1713        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1714    }
1715    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1716        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1717    };
1718
1719    let local_var_req = local_var_req_builder.build()?;
1720    let local_var_resp = local_var_client.execute(local_var_req).await?;
1721
1722    let local_var_status = local_var_resp.status();
1723    let local_var_content = local_var_resp.text().await?;
1724
1725    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1726        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1727    } else {
1728        let local_var_entity: Option<LeaveWorkspaceError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1729        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1730        Err(Error::ResponseError(local_var_error))
1731    }
1732}
1733
1734pub async fn list_available_teams_channels(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<models::ListAvailableTeamsChannels200ResponseInner>, Error<ListAvailableTeamsChannelsError>> {
1735    let local_var_configuration = configuration;
1736
1737    let local_var_client = &local_var_configuration.client;
1738
1739    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/available_teams_channels", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1740    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1741
1742    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1743        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1744    }
1745    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1746        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1747    };
1748
1749    let local_var_req = local_var_req_builder.build()?;
1750    let local_var_resp = local_var_client.execute(local_var_req).await?;
1751
1752    let local_var_status = local_var_resp.status();
1753    let local_var_content = local_var_resp.text().await?;
1754
1755    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1756        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1757    } else {
1758        let local_var_entity: Option<ListAvailableTeamsChannelsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1759        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1760        Err(Error::ResponseError(local_var_error))
1761    }
1762}
1763
1764pub async fn list_available_teams_ids(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<models::ListAvailableTeamsIds200ResponseInner>, Error<ListAvailableTeamsIdsError>> {
1765    let local_var_configuration = configuration;
1766
1767    let local_var_client = &local_var_configuration.client;
1768
1769    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/available_teams_ids", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1770    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1771
1772    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1773        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1774    }
1775    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1776        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1777    };
1778
1779    let local_var_req = local_var_req_builder.build()?;
1780    let local_var_resp = local_var_client.execute(local_var_req).await?;
1781
1782    let local_var_status = local_var_resp.status();
1783    let local_var_content = local_var_resp.text().await?;
1784
1785    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1786        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1787    } else {
1788        let local_var_entity: Option<ListAvailableTeamsIdsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1789        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1790        Err(Error::ResponseError(local_var_error))
1791    }
1792}
1793
1794pub async fn list_ducklakes(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<String>, Error<ListDucklakesError>> {
1795    let local_var_configuration = configuration;
1796
1797    let local_var_client = &local_var_configuration.client;
1798
1799    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/list_ducklakes", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1800    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1801
1802    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1803        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1804    }
1805    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1806        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1807    };
1808
1809    let local_var_req = local_var_req_builder.build()?;
1810    let local_var_resp = local_var_client.execute(local_var_req).await?;
1811
1812    let local_var_status = local_var_resp.status();
1813    let local_var_content = local_var_resp.text().await?;
1814
1815    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1816        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1817    } else {
1818        let local_var_entity: Option<ListDucklakesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1819        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1820        Err(Error::ResponseError(local_var_error))
1821    }
1822}
1823
1824pub async fn list_pending_invites(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<models::WorkspaceInvite>, Error<ListPendingInvitesError>> {
1825    let local_var_configuration = configuration;
1826
1827    let local_var_client = &local_var_configuration.client;
1828
1829    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/list_pending_invites", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1830    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1831
1832    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1833        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1834    }
1835    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1836        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1837    };
1838
1839    let local_var_req = local_var_req_builder.build()?;
1840    let local_var_resp = local_var_client.execute(local_var_req).await?;
1841
1842    let local_var_status = local_var_resp.status();
1843    let local_var_content = local_var_resp.text().await?;
1844
1845    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1846        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1847    } else {
1848        let local_var_entity: Option<ListPendingInvitesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1849        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1850        Err(Error::ResponseError(local_var_error))
1851    }
1852}
1853
1854pub async fn list_user_workspaces(configuration: &configuration::Configuration, ) -> Result<models::UserWorkspaceList, Error<ListUserWorkspacesError>> {
1855    let local_var_configuration = configuration;
1856
1857    let local_var_client = &local_var_configuration.client;
1858
1859    let local_var_uri_str = format!("{}/workspaces/users", local_var_configuration.base_path);
1860    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1861
1862    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1863        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1864    }
1865    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1866        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1867    };
1868
1869    let local_var_req = local_var_req_builder.build()?;
1870    let local_var_resp = local_var_client.execute(local_var_req).await?;
1871
1872    let local_var_status = local_var_resp.status();
1873    let local_var_content = local_var_resp.text().await?;
1874
1875    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1876        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1877    } else {
1878        let local_var_entity: Option<ListUserWorkspacesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1879        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1880        Err(Error::ResponseError(local_var_error))
1881    }
1882}
1883
1884pub async fn list_workspaces(configuration: &configuration::Configuration, ) -> Result<Vec<models::Workspace>, Error<ListWorkspacesError>> {
1885    let local_var_configuration = configuration;
1886
1887    let local_var_client = &local_var_configuration.client;
1888
1889    let local_var_uri_str = format!("{}/workspaces/list", local_var_configuration.base_path);
1890    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1891
1892    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1893        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1894    }
1895    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1896        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1897    };
1898
1899    let local_var_req = local_var_req_builder.build()?;
1900    let local_var_resp = local_var_client.execute(local_var_req).await?;
1901
1902    let local_var_status = local_var_resp.status();
1903    let local_var_content = local_var_resp.text().await?;
1904
1905    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1906        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1907    } else {
1908        let local_var_entity: Option<ListWorkspacesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1909        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1910        Err(Error::ResponseError(local_var_error))
1911    }
1912}
1913
1914pub async fn list_workspaces_as_super_admin(configuration: &configuration::Configuration, page: Option<i32>, per_page: Option<i32>) -> Result<Vec<models::Workspace>, Error<ListWorkspacesAsSuperAdminError>> {
1915    let local_var_configuration = configuration;
1916
1917    let local_var_client = &local_var_configuration.client;
1918
1919    let local_var_uri_str = format!("{}/workspaces/list_as_superadmin", local_var_configuration.base_path);
1920    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1921
1922    if let Some(ref local_var_str) = page {
1923        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
1924    }
1925    if let Some(ref local_var_str) = per_page {
1926        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
1927    }
1928    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1929        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1930    }
1931    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1932        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1933    };
1934
1935    let local_var_req = local_var_req_builder.build()?;
1936    let local_var_resp = local_var_client.execute(local_var_req).await?;
1937
1938    let local_var_status = local_var_resp.status();
1939    let local_var_content = local_var_resp.text().await?;
1940
1941    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1942        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1943    } else {
1944        let local_var_entity: Option<ListWorkspacesAsSuperAdminError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1945        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1946        Err(Error::ResponseError(local_var_error))
1947    }
1948}
1949
1950pub 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>> {
1951    let local_var_configuration = configuration;
1952
1953    let local_var_client = &local_var_configuration.client;
1954
1955    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/run_slack_message_test_job", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1956    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1957
1958    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1959        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1960    }
1961    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1962        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1963    };
1964    local_var_req_builder = local_var_req_builder.json(&run_slack_message_test_job_request);
1965
1966    let local_var_req = local_var_req_builder.build()?;
1967    let local_var_resp = local_var_client.execute(local_var_req).await?;
1968
1969    let local_var_status = local_var_resp.status();
1970    let local_var_content = local_var_resp.text().await?;
1971
1972    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1973        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1974    } else {
1975        let local_var_entity: Option<RunSlackMessageTestJobError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1976        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1977        Err(Error::ResponseError(local_var_error))
1978    }
1979}
1980
1981pub 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>> {
1982    let local_var_configuration = configuration;
1983
1984    let local_var_client = &local_var_configuration.client;
1985
1986    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/run_teams_message_test_job", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1987    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1988
1989    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1990        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1991    }
1992    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1993        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1994    };
1995    local_var_req_builder = local_var_req_builder.json(&run_slack_message_test_job_request);
1996
1997    let local_var_req = local_var_req_builder.build()?;
1998    let local_var_resp = local_var_client.execute(local_var_req).await?;
1999
2000    let local_var_status = local_var_resp.status();
2001    let local_var_content = local_var_resp.text().await?;
2002
2003    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2004        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2005    } else {
2006        let local_var_entity: Option<RunTeamsMessageTestJobError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2007        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2008        Err(Error::ResponseError(local_var_error))
2009    }
2010}
2011
2012pub async fn set_environment_variable(configuration: &configuration::Configuration, workspace: &str, set_environment_variable_request: models::SetEnvironmentVariableRequest) -> Result<String, Error<SetEnvironmentVariableError>> {
2013    let local_var_configuration = configuration;
2014
2015    let local_var_client = &local_var_configuration.client;
2016
2017    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/set_environment_variable", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2018    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2019
2020    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2021        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2022    }
2023    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2024        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2025    };
2026    local_var_req_builder = local_var_req_builder.json(&set_environment_variable_request);
2027
2028    let local_var_req = local_var_req_builder.build()?;
2029    let local_var_resp = local_var_client.execute(local_var_req).await?;
2030
2031    let local_var_status = local_var_resp.status();
2032    let local_var_content = local_var_resp.text().await?;
2033
2034    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2035        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2036    } else {
2037        let local_var_entity: Option<SetEnvironmentVariableError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2038        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2039        Err(Error::ResponseError(local_var_error))
2040    }
2041}
2042
2043pub async fn set_threshold_alert(configuration: &configuration::Configuration, workspace: &str, set_threshold_alert_request: models::SetThresholdAlertRequest) -> Result<String, Error<SetThresholdAlertError>> {
2044    let local_var_configuration = configuration;
2045
2046    let local_var_client = &local_var_configuration.client;
2047
2048    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/threshold_alert", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2049    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2050
2051    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2052        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2053    }
2054    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2055        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2056    };
2057    local_var_req_builder = local_var_req_builder.json(&set_threshold_alert_request);
2058
2059    let local_var_req = local_var_req_builder.build()?;
2060    let local_var_resp = local_var_client.execute(local_var_req).await?;
2061
2062    let local_var_status = local_var_resp.status();
2063    let local_var_content = local_var_resp.text().await?;
2064
2065    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2066        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2067    } else {
2068        let local_var_entity: Option<SetThresholdAlertError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2069        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2070        Err(Error::ResponseError(local_var_error))
2071    }
2072}
2073
2074pub async fn set_workspace_encryption_key(configuration: &configuration::Configuration, workspace: &str, set_workspace_encryption_key_request: models::SetWorkspaceEncryptionKeyRequest) -> Result<String, Error<SetWorkspaceEncryptionKeyError>> {
2075    let local_var_configuration = configuration;
2076
2077    let local_var_client = &local_var_configuration.client;
2078
2079    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/encryption_key", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2080    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2081
2082    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2083        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2084    }
2085    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2086        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2087    };
2088    local_var_req_builder = local_var_req_builder.json(&set_workspace_encryption_key_request);
2089
2090    let local_var_req = local_var_req_builder.build()?;
2091    let local_var_resp = local_var_client.execute(local_var_req).await?;
2092
2093    let local_var_status = local_var_resp.status();
2094    let local_var_content = local_var_resp.text().await?;
2095
2096    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2097        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2098    } else {
2099        let local_var_entity: Option<SetWorkspaceEncryptionKeyError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2100        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2101        Err(Error::ResponseError(local_var_error))
2102    }
2103}
2104
2105pub async fn unarchive_workspace(configuration: &configuration::Configuration, workspace: &str) -> Result<String, Error<UnarchiveWorkspaceError>> {
2106    let local_var_configuration = configuration;
2107
2108    let local_var_client = &local_var_configuration.client;
2109
2110    let local_var_uri_str = format!("{}/workspaces/unarchive/{workspace}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2111    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2112
2113    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2114        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2115    }
2116    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2117        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2118    };
2119
2120    let local_var_req = local_var_req_builder.build()?;
2121    let local_var_resp = local_var_client.execute(local_var_req).await?;
2122
2123    let local_var_status = local_var_resp.status();
2124    let local_var_content = local_var_resp.text().await?;
2125
2126    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2127        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2128    } else {
2129        let local_var_entity: Option<UnarchiveWorkspaceError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2130        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2131        Err(Error::ResponseError(local_var_error))
2132    }
2133}
2134
2135/// Updates the operator settings for a specific workspace. Requires workspace admin privileges.
2136pub async fn update_operator_settings(configuration: &configuration::Configuration, workspace: &str, operator_settings: Option<models::OperatorSettings>) -> Result<String, Error<UpdateOperatorSettingsError>> {
2137    let local_var_configuration = configuration;
2138
2139    let local_var_client = &local_var_configuration.client;
2140
2141    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/operator_settings", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2142    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2143
2144    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2145        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2146    }
2147    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2148        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2149    };
2150    local_var_req_builder = local_var_req_builder.json(&operator_settings);
2151
2152    let local_var_req = local_var_req_builder.build()?;
2153    let local_var_resp = local_var_client.execute(local_var_req).await?;
2154
2155    let local_var_status = local_var_resp.status();
2156    let local_var_content = local_var_resp.text().await?;
2157
2158    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2159        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2160    } else {
2161        let local_var_entity: Option<UpdateOperatorSettingsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2162        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2163        Err(Error::ResponseError(local_var_error))
2164    }
2165}
2166