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