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