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.538.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, skip_subscription_fetch: Option<bool>) -> 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_str) = skip_subscription_fetch {
1450        local_var_req_builder = local_var_req_builder.query(&[("skip_subscription_fetch", &local_var_str.to_string())]);
1451    }
1452    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1453        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1454    }
1455    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1456        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1457    };
1458
1459    let local_var_req = local_var_req_builder.build()?;
1460    let local_var_resp = local_var_client.execute(local_var_req).await?;
1461
1462    let local_var_status = local_var_resp.status();
1463    let local_var_content = local_var_resp.text().await?;
1464
1465    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1466        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1467    } else {
1468        let local_var_entity: Option<GetPremiumInfoError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1469        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1470        Err(Error::ResponseError(local_var_error))
1471    }
1472}
1473
1474pub async fn get_settings(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetSettings200Response, Error<GetSettingsError>> {
1475    let local_var_configuration = configuration;
1476
1477    let local_var_client = &local_var_configuration.client;
1478
1479    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_settings", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1480    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1481
1482    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1483        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1484    }
1485    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1486        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1487    };
1488
1489    let local_var_req = local_var_req_builder.build()?;
1490    let local_var_resp = local_var_client.execute(local_var_req).await?;
1491
1492    let local_var_status = local_var_resp.status();
1493    let local_var_content = local_var_resp.text().await?;
1494
1495    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1496        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1497    } else {
1498        let local_var_entity: Option<GetSettingsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1499        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1500        Err(Error::ResponseError(local_var_error))
1501    }
1502}
1503
1504pub async fn get_threshold_alert(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetThresholdAlert200Response, Error<GetThresholdAlertError>> {
1505    let local_var_configuration = configuration;
1506
1507    let local_var_client = &local_var_configuration.client;
1508
1509    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/threshold_alert", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1510    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1511
1512    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1513        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1514    }
1515    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1516        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1517    };
1518
1519    let local_var_req = local_var_req_builder.build()?;
1520    let local_var_resp = local_var_client.execute(local_var_req).await?;
1521
1522    let local_var_status = local_var_resp.status();
1523    let local_var_content = local_var_resp.text().await?;
1524
1525    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1526        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1527    } else {
1528        let local_var_entity: Option<GetThresholdAlertError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1529        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1530        Err(Error::ResponseError(local_var_error))
1531    }
1532}
1533
1534pub async fn get_used_triggers(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetUsedTriggers200Response, Error<GetUsedTriggersError>> {
1535    let local_var_configuration = configuration;
1536
1537    let local_var_client = &local_var_configuration.client;
1538
1539    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/used_triggers", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1540    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1541
1542    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1543        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1544    }
1545    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1546        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1547    };
1548
1549    let local_var_req = local_var_req_builder.build()?;
1550    let local_var_resp = local_var_client.execute(local_var_req).await?;
1551
1552    let local_var_status = local_var_resp.status();
1553    let local_var_content = local_var_resp.text().await?;
1554
1555    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1556        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1557    } else {
1558        let local_var_entity: Option<GetUsedTriggersError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1559        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1560        Err(Error::ResponseError(local_var_error))
1561    }
1562}
1563
1564pub async fn get_workspace_default_app(configuration: &configuration::Configuration, workspace: &str) -> Result<models::EditWorkspaceDefaultAppRequest, Error<GetWorkspaceDefaultAppError>> {
1565    let local_var_configuration = configuration;
1566
1567    let local_var_client = &local_var_configuration.client;
1568
1569    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/default_app", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1570    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1571
1572    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1573        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1574    }
1575    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1576        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1577    };
1578
1579    let local_var_req = local_var_req_builder.build()?;
1580    let local_var_resp = local_var_client.execute(local_var_req).await?;
1581
1582    let local_var_status = local_var_resp.status();
1583    let local_var_content = local_var_resp.text().await?;
1584
1585    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1586        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1587    } else {
1588        let local_var_entity: Option<GetWorkspaceDefaultAppError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1589        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1590        Err(Error::ResponseError(local_var_error))
1591    }
1592}
1593
1594pub async fn get_workspace_encryption_key(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetWorkspaceEncryptionKey200Response, Error<GetWorkspaceEncryptionKeyError>> {
1595    let local_var_configuration = configuration;
1596
1597    let local_var_client = &local_var_configuration.client;
1598
1599    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/encryption_key", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1600    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1601
1602    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1603        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1604    }
1605    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1606        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1607    };
1608
1609    let local_var_req = local_var_req_builder.build()?;
1610    let local_var_resp = local_var_client.execute(local_var_req).await?;
1611
1612    let local_var_status = local_var_resp.status();
1613    let local_var_content = local_var_resp.text().await?;
1614
1615    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1616        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1617    } else {
1618        let local_var_entity: Option<GetWorkspaceEncryptionKeyError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1619        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1620        Err(Error::ResponseError(local_var_error))
1621    }
1622}
1623
1624pub async fn get_workspace_name(configuration: &configuration::Configuration, workspace: &str) -> Result<String, Error<GetWorkspaceNameError>> {
1625    let local_var_configuration = configuration;
1626
1627    let local_var_client = &local_var_configuration.client;
1628
1629    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_workspace_name", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1630    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1631
1632    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1633        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1634    }
1635    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1636        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1637    };
1638
1639    let local_var_req = local_var_req_builder.build()?;
1640    let local_var_resp = local_var_client.execute(local_var_req).await?;
1641
1642    let local_var_status = local_var_resp.status();
1643    let local_var_content = local_var_resp.text().await?;
1644
1645    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1646        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1647    } else {
1648        let local_var_entity: Option<GetWorkspaceNameError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1649        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1650        Err(Error::ResponseError(local_var_error))
1651    }
1652}
1653
1654pub async fn get_workspace_usage(configuration: &configuration::Configuration, workspace: &str) -> Result<f64, Error<GetWorkspaceUsageError>> {
1655    let local_var_configuration = configuration;
1656
1657    let local_var_client = &local_var_configuration.client;
1658
1659    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/usage", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1660    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1661
1662    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1663        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1664    }
1665    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1666        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1667    };
1668
1669    let local_var_req = local_var_req_builder.build()?;
1670    let local_var_resp = local_var_client.execute(local_var_req).await?;
1671
1672    let local_var_status = local_var_resp.status();
1673    let local_var_content = local_var_resp.text().await?;
1674
1675    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1676        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1677    } else {
1678        let local_var_entity: Option<GetWorkspaceUsageError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1679        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1680        Err(Error::ResponseError(local_var_error))
1681    }
1682}
1683
1684pub async fn invite_user(configuration: &configuration::Configuration, workspace: &str, invite_user_request: models::InviteUserRequest) -> Result<String, Error<InviteUserError>> {
1685    let local_var_configuration = configuration;
1686
1687    let local_var_client = &local_var_configuration.client;
1688
1689    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/invite_user", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1690    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1691
1692    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1693        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1694    }
1695    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1696        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1697    };
1698    local_var_req_builder = local_var_req_builder.json(&invite_user_request);
1699
1700    let local_var_req = local_var_req_builder.build()?;
1701    let local_var_resp = local_var_client.execute(local_var_req).await?;
1702
1703    let local_var_status = local_var_resp.status();
1704    let local_var_content = local_var_resp.text().await?;
1705
1706    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1707        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1708    } else {
1709        let local_var_entity: Option<InviteUserError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1710        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1711        Err(Error::ResponseError(local_var_error))
1712    }
1713}
1714
1715pub async fn is_domain_allowed(configuration: &configuration::Configuration, ) -> Result<bool, Error<IsDomainAllowedError>> {
1716    let local_var_configuration = configuration;
1717
1718    let local_var_client = &local_var_configuration.client;
1719
1720    let local_var_uri_str = format!("{}/workspaces/allowed_domain_auto_invite", local_var_configuration.base_path);
1721    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1722
1723    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1724        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1725    }
1726    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1727        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1728    };
1729
1730    let local_var_req = local_var_req_builder.build()?;
1731    let local_var_resp = local_var_client.execute(local_var_req).await?;
1732
1733    let local_var_status = local_var_resp.status();
1734    let local_var_content = local_var_resp.text().await?;
1735
1736    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1737        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1738    } else {
1739        let local_var_entity: Option<IsDomainAllowedError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1740        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1741        Err(Error::ResponseError(local_var_error))
1742    }
1743}
1744
1745pub async fn leave_workspace(configuration: &configuration::Configuration, workspace: &str) -> Result<String, Error<LeaveWorkspaceError>> {
1746    let local_var_configuration = configuration;
1747
1748    let local_var_client = &local_var_configuration.client;
1749
1750    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/leave", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1751    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1752
1753    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1754        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1755    }
1756    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1757        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1758    };
1759
1760    let local_var_req = local_var_req_builder.build()?;
1761    let local_var_resp = local_var_client.execute(local_var_req).await?;
1762
1763    let local_var_status = local_var_resp.status();
1764    let local_var_content = local_var_resp.text().await?;
1765
1766    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1767        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1768    } else {
1769        let local_var_entity: Option<LeaveWorkspaceError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1770        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1771        Err(Error::ResponseError(local_var_error))
1772    }
1773}
1774
1775pub async fn list_available_teams_channels(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<models::ListAvailableTeamsChannels200ResponseInner>, Error<ListAvailableTeamsChannelsError>> {
1776    let local_var_configuration = configuration;
1777
1778    let local_var_client = &local_var_configuration.client;
1779
1780    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/available_teams_channels", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1781    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1782
1783    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1784        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1785    }
1786    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1787        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1788    };
1789
1790    let local_var_req = local_var_req_builder.build()?;
1791    let local_var_resp = local_var_client.execute(local_var_req).await?;
1792
1793    let local_var_status = local_var_resp.status();
1794    let local_var_content = local_var_resp.text().await?;
1795
1796    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1797        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1798    } else {
1799        let local_var_entity: Option<ListAvailableTeamsChannelsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1800        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1801        Err(Error::ResponseError(local_var_error))
1802    }
1803}
1804
1805pub async fn list_available_teams_ids(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<models::ListAvailableTeamsIds200ResponseInner>, Error<ListAvailableTeamsIdsError>> {
1806    let local_var_configuration = configuration;
1807
1808    let local_var_client = &local_var_configuration.client;
1809
1810    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/available_teams_ids", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1811    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1812
1813    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1814        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1815    }
1816    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1817        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1818    };
1819
1820    let local_var_req = local_var_req_builder.build()?;
1821    let local_var_resp = local_var_client.execute(local_var_req).await?;
1822
1823    let local_var_status = local_var_resp.status();
1824    let local_var_content = local_var_resp.text().await?;
1825
1826    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1827        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1828    } else {
1829        let local_var_entity: Option<ListAvailableTeamsIdsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1830        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1831        Err(Error::ResponseError(local_var_error))
1832    }
1833}
1834
1835pub async fn list_ducklakes(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<String>, Error<ListDucklakesError>> {
1836    let local_var_configuration = configuration;
1837
1838    let local_var_client = &local_var_configuration.client;
1839
1840    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/list_ducklakes", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1841    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1842
1843    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1844        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1845    }
1846    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1847        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1848    };
1849
1850    let local_var_req = local_var_req_builder.build()?;
1851    let local_var_resp = local_var_client.execute(local_var_req).await?;
1852
1853    let local_var_status = local_var_resp.status();
1854    let local_var_content = local_var_resp.text().await?;
1855
1856    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1857        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1858    } else {
1859        let local_var_entity: Option<ListDucklakesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1860        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1861        Err(Error::ResponseError(local_var_error))
1862    }
1863}
1864
1865pub async fn list_pending_invites(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<models::WorkspaceInvite>, Error<ListPendingInvitesError>> {
1866    let local_var_configuration = configuration;
1867
1868    let local_var_client = &local_var_configuration.client;
1869
1870    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/list_pending_invites", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1871    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1872
1873    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1874        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1875    }
1876    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1877        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1878    };
1879
1880    let local_var_req = local_var_req_builder.build()?;
1881    let local_var_resp = local_var_client.execute(local_var_req).await?;
1882
1883    let local_var_status = local_var_resp.status();
1884    let local_var_content = local_var_resp.text().await?;
1885
1886    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1887        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1888    } else {
1889        let local_var_entity: Option<ListPendingInvitesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1890        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1891        Err(Error::ResponseError(local_var_error))
1892    }
1893}
1894
1895pub async fn list_user_workspaces(configuration: &configuration::Configuration, ) -> Result<models::UserWorkspaceList, Error<ListUserWorkspacesError>> {
1896    let local_var_configuration = configuration;
1897
1898    let local_var_client = &local_var_configuration.client;
1899
1900    let local_var_uri_str = format!("{}/workspaces/users", local_var_configuration.base_path);
1901    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1902
1903    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1904        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1905    }
1906    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1907        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1908    };
1909
1910    let local_var_req = local_var_req_builder.build()?;
1911    let local_var_resp = local_var_client.execute(local_var_req).await?;
1912
1913    let local_var_status = local_var_resp.status();
1914    let local_var_content = local_var_resp.text().await?;
1915
1916    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1917        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1918    } else {
1919        let local_var_entity: Option<ListUserWorkspacesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1920        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1921        Err(Error::ResponseError(local_var_error))
1922    }
1923}
1924
1925pub async fn list_workspaces(configuration: &configuration::Configuration, ) -> Result<Vec<models::Workspace>, Error<ListWorkspacesError>> {
1926    let local_var_configuration = configuration;
1927
1928    let local_var_client = &local_var_configuration.client;
1929
1930    let local_var_uri_str = format!("{}/workspaces/list", local_var_configuration.base_path);
1931    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1932
1933    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1934        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1935    }
1936    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1937        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1938    };
1939
1940    let local_var_req = local_var_req_builder.build()?;
1941    let local_var_resp = local_var_client.execute(local_var_req).await?;
1942
1943    let local_var_status = local_var_resp.status();
1944    let local_var_content = local_var_resp.text().await?;
1945
1946    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1947        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1948    } else {
1949        let local_var_entity: Option<ListWorkspacesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1950        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1951        Err(Error::ResponseError(local_var_error))
1952    }
1953}
1954
1955pub async fn list_workspaces_as_super_admin(configuration: &configuration::Configuration, page: Option<i32>, per_page: Option<i32>) -> Result<Vec<models::Workspace>, Error<ListWorkspacesAsSuperAdminError>> {
1956    let local_var_configuration = configuration;
1957
1958    let local_var_client = &local_var_configuration.client;
1959
1960    let local_var_uri_str = format!("{}/workspaces/list_as_superadmin", local_var_configuration.base_path);
1961    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1962
1963    if let Some(ref local_var_str) = page {
1964        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
1965    }
1966    if let Some(ref local_var_str) = per_page {
1967        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
1968    }
1969    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1970        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1971    }
1972    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1973        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1974    };
1975
1976    let local_var_req = local_var_req_builder.build()?;
1977    let local_var_resp = local_var_client.execute(local_var_req).await?;
1978
1979    let local_var_status = local_var_resp.status();
1980    let local_var_content = local_var_resp.text().await?;
1981
1982    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1983        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1984    } else {
1985        let local_var_entity: Option<ListWorkspacesAsSuperAdminError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1986        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1987        Err(Error::ResponseError(local_var_error))
1988    }
1989}
1990
1991pub 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>> {
1992    let local_var_configuration = configuration;
1993
1994    let local_var_client = &local_var_configuration.client;
1995
1996    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/run_slack_message_test_job", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1997    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1998
1999    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2000        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2001    }
2002    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2003        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2004    };
2005    local_var_req_builder = local_var_req_builder.json(&run_slack_message_test_job_request);
2006
2007    let local_var_req = local_var_req_builder.build()?;
2008    let local_var_resp = local_var_client.execute(local_var_req).await?;
2009
2010    let local_var_status = local_var_resp.status();
2011    let local_var_content = local_var_resp.text().await?;
2012
2013    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2014        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2015    } else {
2016        let local_var_entity: Option<RunSlackMessageTestJobError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2017        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2018        Err(Error::ResponseError(local_var_error))
2019    }
2020}
2021
2022pub 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>> {
2023    let local_var_configuration = configuration;
2024
2025    let local_var_client = &local_var_configuration.client;
2026
2027    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/run_teams_message_test_job", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2028    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2029
2030    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2031        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2032    }
2033    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2034        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2035    };
2036    local_var_req_builder = local_var_req_builder.json(&run_slack_message_test_job_request);
2037
2038    let local_var_req = local_var_req_builder.build()?;
2039    let local_var_resp = local_var_client.execute(local_var_req).await?;
2040
2041    let local_var_status = local_var_resp.status();
2042    let local_var_content = local_var_resp.text().await?;
2043
2044    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2045        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2046    } else {
2047        let local_var_entity: Option<RunTeamsMessageTestJobError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2048        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2049        Err(Error::ResponseError(local_var_error))
2050    }
2051}
2052
2053pub async fn set_environment_variable(configuration: &configuration::Configuration, workspace: &str, set_environment_variable_request: models::SetEnvironmentVariableRequest) -> Result<String, Error<SetEnvironmentVariableError>> {
2054    let local_var_configuration = configuration;
2055
2056    let local_var_client = &local_var_configuration.client;
2057
2058    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/set_environment_variable", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2059    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2060
2061    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2062        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2063    }
2064    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2065        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2066    };
2067    local_var_req_builder = local_var_req_builder.json(&set_environment_variable_request);
2068
2069    let local_var_req = local_var_req_builder.build()?;
2070    let local_var_resp = local_var_client.execute(local_var_req).await?;
2071
2072    let local_var_status = local_var_resp.status();
2073    let local_var_content = local_var_resp.text().await?;
2074
2075    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2076        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2077    } else {
2078        let local_var_entity: Option<SetEnvironmentVariableError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2079        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2080        Err(Error::ResponseError(local_var_error))
2081    }
2082}
2083
2084pub async fn set_threshold_alert(configuration: &configuration::Configuration, workspace: &str, set_threshold_alert_request: models::SetThresholdAlertRequest) -> Result<String, Error<SetThresholdAlertError>> {
2085    let local_var_configuration = configuration;
2086
2087    let local_var_client = &local_var_configuration.client;
2088
2089    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/threshold_alert", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2090    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2091
2092    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2093        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2094    }
2095    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2096        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2097    };
2098    local_var_req_builder = local_var_req_builder.json(&set_threshold_alert_request);
2099
2100    let local_var_req = local_var_req_builder.build()?;
2101    let local_var_resp = local_var_client.execute(local_var_req).await?;
2102
2103    let local_var_status = local_var_resp.status();
2104    let local_var_content = local_var_resp.text().await?;
2105
2106    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2107        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2108    } else {
2109        let local_var_entity: Option<SetThresholdAlertError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2110        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2111        Err(Error::ResponseError(local_var_error))
2112    }
2113}
2114
2115pub async fn set_workspace_encryption_key(configuration: &configuration::Configuration, workspace: &str, set_workspace_encryption_key_request: models::SetWorkspaceEncryptionKeyRequest) -> Result<String, Error<SetWorkspaceEncryptionKeyError>> {
2116    let local_var_configuration = configuration;
2117
2118    let local_var_client = &local_var_configuration.client;
2119
2120    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/encryption_key", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2121    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2122
2123    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2124        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2125    }
2126    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2127        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2128    };
2129    local_var_req_builder = local_var_req_builder.json(&set_workspace_encryption_key_request);
2130
2131    let local_var_req = local_var_req_builder.build()?;
2132    let local_var_resp = local_var_client.execute(local_var_req).await?;
2133
2134    let local_var_status = local_var_resp.status();
2135    let local_var_content = local_var_resp.text().await?;
2136
2137    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2138        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2139    } else {
2140        let local_var_entity: Option<SetWorkspaceEncryptionKeyError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2141        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2142        Err(Error::ResponseError(local_var_error))
2143    }
2144}
2145
2146pub async fn unarchive_workspace(configuration: &configuration::Configuration, workspace: &str) -> Result<String, Error<UnarchiveWorkspaceError>> {
2147    let local_var_configuration = configuration;
2148
2149    let local_var_client = &local_var_configuration.client;
2150
2151    let local_var_uri_str = format!("{}/workspaces/unarchive/{workspace}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2152    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2153
2154    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2155        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2156    }
2157    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2158        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2159    };
2160
2161    let local_var_req = local_var_req_builder.build()?;
2162    let local_var_resp = local_var_client.execute(local_var_req).await?;
2163
2164    let local_var_status = local_var_resp.status();
2165    let local_var_content = local_var_resp.text().await?;
2166
2167    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2168        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2169    } else {
2170        let local_var_entity: Option<UnarchiveWorkspaceError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2171        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2172        Err(Error::ResponseError(local_var_error))
2173    }
2174}
2175
2176/// Updates the operator settings for a specific workspace. Requires workspace admin privileges.
2177pub async fn update_operator_settings(configuration: &configuration::Configuration, workspace: &str, operator_settings: Option<models::OperatorSettings>) -> Result<String, Error<UpdateOperatorSettingsError>> {
2178    let local_var_configuration = configuration;
2179
2180    let local_var_client = &local_var_configuration.client;
2181
2182    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/operator_settings", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2183    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2184
2185    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2186        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2187    }
2188    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2189        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2190    };
2191    local_var_req_builder = local_var_req_builder.json(&operator_settings);
2192
2193    let local_var_req = local_var_req_builder.build()?;
2194    let local_var_resp = local_var_client.execute(local_var_req).await?;
2195
2196    let local_var_status = local_var_resp.status();
2197    let local_var_content = local_var_resp.text().await?;
2198
2199    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2200        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2201    } else {
2202        let local_var_entity: Option<UpdateOperatorSettingsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2203        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2204        Err(Error::ResponseError(local_var_error))
2205    }
2206}
2207