Skip to main content

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.631.2
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 [`compare_workspaces`]
54#[derive(Debug, Clone, Serialize, Deserialize)]
55#[serde(untagged)]
56pub enum CompareWorkspacesError {
57    UnknownValue(serde_json::Value),
58}
59
60/// struct for typed errors of method [`connect_teams`]
61#[derive(Debug, Clone, Serialize, Deserialize)]
62#[serde(untagged)]
63pub enum ConnectTeamsError {
64    UnknownValue(serde_json::Value),
65}
66
67/// struct for typed errors of method [`create_protection_rule`]
68#[derive(Debug, Clone, Serialize, Deserialize)]
69#[serde(untagged)]
70pub enum CreateProtectionRuleError {
71    Status400(),
72    UnknownValue(serde_json::Value),
73}
74
75/// struct for typed errors of method [`create_workspace`]
76#[derive(Debug, Clone, Serialize, Deserialize)]
77#[serde(untagged)]
78pub enum CreateWorkspaceError {
79    UnknownValue(serde_json::Value),
80}
81
82/// struct for typed errors of method [`create_workspace_fork`]
83#[derive(Debug, Clone, Serialize, Deserialize)]
84#[serde(untagged)]
85pub enum CreateWorkspaceForkError {
86    UnknownValue(serde_json::Value),
87}
88
89/// struct for typed errors of method [`create_workspace_fork_git_branch`]
90#[derive(Debug, Clone, Serialize, Deserialize)]
91#[serde(untagged)]
92pub enum CreateWorkspaceForkGitBranchError {
93    UnknownValue(serde_json::Value),
94}
95
96/// struct for typed errors of method [`delete_git_sync_repository`]
97#[derive(Debug, Clone, Serialize, Deserialize)]
98#[serde(untagged)]
99pub enum DeleteGitSyncRepositoryError {
100    UnknownValue(serde_json::Value),
101}
102
103/// struct for typed errors of method [`delete_invite`]
104#[derive(Debug, Clone, Serialize, Deserialize)]
105#[serde(untagged)]
106pub enum DeleteInviteError {
107    UnknownValue(serde_json::Value),
108}
109
110/// struct for typed errors of method [`delete_protection_rule`]
111#[derive(Debug, Clone, Serialize, Deserialize)]
112#[serde(untagged)]
113pub enum DeleteProtectionRuleError {
114    Status404(),
115    UnknownValue(serde_json::Value),
116}
117
118/// struct for typed errors of method [`delete_workspace`]
119#[derive(Debug, Clone, Serialize, Deserialize)]
120#[serde(untagged)]
121pub enum DeleteWorkspaceError {
122    UnknownValue(serde_json::Value),
123}
124
125/// struct for typed errors of method [`delete_workspace_slack_oauth_config`]
126#[derive(Debug, Clone, Serialize, Deserialize)]
127#[serde(untagged)]
128pub enum DeleteWorkspaceSlackOauthConfigError {
129    UnknownValue(serde_json::Value),
130}
131
132/// struct for typed errors of method [`edit_auto_invite`]
133#[derive(Debug, Clone, Serialize, Deserialize)]
134#[serde(untagged)]
135pub enum EditAutoInviteError {
136    UnknownValue(serde_json::Value),
137}
138
139/// struct for typed errors of method [`edit_copilot_config`]
140#[derive(Debug, Clone, Serialize, Deserialize)]
141#[serde(untagged)]
142pub enum EditCopilotConfigError {
143    UnknownValue(serde_json::Value),
144}
145
146/// struct for typed errors of method [`edit_data_table_config`]
147#[derive(Debug, Clone, Serialize, Deserialize)]
148#[serde(untagged)]
149pub enum EditDataTableConfigError {
150    UnknownValue(serde_json::Value),
151}
152
153/// struct for typed errors of method [`edit_default_scripts`]
154#[derive(Debug, Clone, Serialize, Deserialize)]
155#[serde(untagged)]
156pub enum EditDefaultScriptsError {
157    UnknownValue(serde_json::Value),
158}
159
160/// struct for typed errors of method [`edit_deploy_to`]
161#[derive(Debug, Clone, Serialize, Deserialize)]
162#[serde(untagged)]
163pub enum EditDeployToError {
164    UnknownValue(serde_json::Value),
165}
166
167/// struct for typed errors of method [`edit_ducklake_config`]
168#[derive(Debug, Clone, Serialize, Deserialize)]
169#[serde(untagged)]
170pub enum EditDucklakeConfigError {
171    UnknownValue(serde_json::Value),
172}
173
174/// struct for typed errors of method [`edit_error_handler`]
175#[derive(Debug, Clone, Serialize, Deserialize)]
176#[serde(untagged)]
177pub enum EditErrorHandlerError {
178    UnknownValue(serde_json::Value),
179}
180
181/// struct for typed errors of method [`edit_git_sync_repository`]
182#[derive(Debug, Clone, Serialize, Deserialize)]
183#[serde(untagged)]
184pub enum EditGitSyncRepositoryError {
185    UnknownValue(serde_json::Value),
186}
187
188/// struct for typed errors of method [`edit_instance_groups`]
189#[derive(Debug, Clone, Serialize, Deserialize)]
190#[serde(untagged)]
191pub enum EditInstanceGroupsError {
192    UnknownValue(serde_json::Value),
193}
194
195/// struct for typed errors of method [`edit_large_file_storage_config`]
196#[derive(Debug, Clone, Serialize, Deserialize)]
197#[serde(untagged)]
198pub enum EditLargeFileStorageConfigError {
199    UnknownValue(serde_json::Value),
200}
201
202/// struct for typed errors of method [`edit_slack_command`]
203#[derive(Debug, Clone, Serialize, Deserialize)]
204#[serde(untagged)]
205pub enum EditSlackCommandError {
206    UnknownValue(serde_json::Value),
207}
208
209/// struct for typed errors of method [`edit_success_handler`]
210#[derive(Debug, Clone, Serialize, Deserialize)]
211#[serde(untagged)]
212pub enum EditSuccessHandlerError {
213    UnknownValue(serde_json::Value),
214}
215
216/// struct for typed errors of method [`edit_teams_command`]
217#[derive(Debug, Clone, Serialize, Deserialize)]
218#[serde(untagged)]
219pub enum EditTeamsCommandError {
220    UnknownValue(serde_json::Value),
221}
222
223/// struct for typed errors of method [`edit_webhook`]
224#[derive(Debug, Clone, Serialize, Deserialize)]
225#[serde(untagged)]
226pub enum EditWebhookError {
227    UnknownValue(serde_json::Value),
228}
229
230/// struct for typed errors of method [`edit_workspace_default_app`]
231#[derive(Debug, Clone, Serialize, Deserialize)]
232#[serde(untagged)]
233pub enum EditWorkspaceDefaultAppError {
234    UnknownValue(serde_json::Value),
235}
236
237/// struct for typed errors of method [`edit_workspace_deploy_ui_settings`]
238#[derive(Debug, Clone, Serialize, Deserialize)]
239#[serde(untagged)]
240pub enum EditWorkspaceDeployUiSettingsError {
241    UnknownValue(serde_json::Value),
242}
243
244/// struct for typed errors of method [`edit_workspace_git_sync_config`]
245#[derive(Debug, Clone, Serialize, Deserialize)]
246#[serde(untagged)]
247pub enum EditWorkspaceGitSyncConfigError {
248    UnknownValue(serde_json::Value),
249}
250
251/// struct for typed errors of method [`exists_username`]
252#[derive(Debug, Clone, Serialize, Deserialize)]
253#[serde(untagged)]
254pub enum ExistsUsernameError {
255    UnknownValue(serde_json::Value),
256}
257
258/// struct for typed errors of method [`exists_workspace`]
259#[derive(Debug, Clone, Serialize, Deserialize)]
260#[serde(untagged)]
261pub enum ExistsWorkspaceError {
262    UnknownValue(serde_json::Value),
263}
264
265/// struct for typed errors of method [`get_copilot_info`]
266#[derive(Debug, Clone, Serialize, Deserialize)]
267#[serde(untagged)]
268pub enum GetCopilotInfoError {
269    UnknownValue(serde_json::Value),
270}
271
272/// struct for typed errors of method [`get_default_scripts`]
273#[derive(Debug, Clone, Serialize, Deserialize)]
274#[serde(untagged)]
275pub enum GetDefaultScriptsError {
276    UnknownValue(serde_json::Value),
277}
278
279/// struct for typed errors of method [`get_dependency_map`]
280#[derive(Debug, Clone, Serialize, Deserialize)]
281#[serde(untagged)]
282pub enum GetDependencyMapError {
283    UnknownValue(serde_json::Value),
284}
285
286/// struct for typed errors of method [`get_dependents`]
287#[derive(Debug, Clone, Serialize, Deserialize)]
288#[serde(untagged)]
289pub enum GetDependentsError {
290    UnknownValue(serde_json::Value),
291}
292
293/// struct for typed errors of method [`get_dependents_amounts`]
294#[derive(Debug, Clone, Serialize, Deserialize)]
295#[serde(untagged)]
296pub enum GetDependentsAmountsError {
297    UnknownValue(serde_json::Value),
298}
299
300/// struct for typed errors of method [`get_deploy_to`]
301#[derive(Debug, Clone, Serialize, Deserialize)]
302#[serde(untagged)]
303pub enum GetDeployToError {
304    UnknownValue(serde_json::Value),
305}
306
307/// struct for typed errors of method [`get_github_app_token`]
308#[derive(Debug, Clone, Serialize, Deserialize)]
309#[serde(untagged)]
310pub enum GetGithubAppTokenError {
311    UnknownValue(serde_json::Value),
312}
313
314/// struct for typed errors of method [`get_is_premium`]
315#[derive(Debug, Clone, Serialize, Deserialize)]
316#[serde(untagged)]
317pub enum GetIsPremiumError {
318    UnknownValue(serde_json::Value),
319}
320
321/// struct for typed errors of method [`get_premium_info`]
322#[derive(Debug, Clone, Serialize, Deserialize)]
323#[serde(untagged)]
324pub enum GetPremiumInfoError {
325    UnknownValue(serde_json::Value),
326}
327
328/// struct for typed errors of method [`get_settings`]
329#[derive(Debug, Clone, Serialize, Deserialize)]
330#[serde(untagged)]
331pub enum GetSettingsError {
332    UnknownValue(serde_json::Value),
333}
334
335/// struct for typed errors of method [`get_threshold_alert`]
336#[derive(Debug, Clone, Serialize, Deserialize)]
337#[serde(untagged)]
338pub enum GetThresholdAlertError {
339    UnknownValue(serde_json::Value),
340}
341
342/// struct for typed errors of method [`get_used_triggers`]
343#[derive(Debug, Clone, Serialize, Deserialize)]
344#[serde(untagged)]
345pub enum GetUsedTriggersError {
346    UnknownValue(serde_json::Value),
347}
348
349/// struct for typed errors of method [`get_workspace_as_super_admin`]
350#[derive(Debug, Clone, Serialize, Deserialize)]
351#[serde(untagged)]
352pub enum GetWorkspaceAsSuperAdminError {
353    UnknownValue(serde_json::Value),
354}
355
356/// struct for typed errors of method [`get_workspace_default_app`]
357#[derive(Debug, Clone, Serialize, Deserialize)]
358#[serde(untagged)]
359pub enum GetWorkspaceDefaultAppError {
360    UnknownValue(serde_json::Value),
361}
362
363/// struct for typed errors of method [`get_workspace_encryption_key`]
364#[derive(Debug, Clone, Serialize, Deserialize)]
365#[serde(untagged)]
366pub enum GetWorkspaceEncryptionKeyError {
367    UnknownValue(serde_json::Value),
368}
369
370/// struct for typed errors of method [`get_workspace_name`]
371#[derive(Debug, Clone, Serialize, Deserialize)]
372#[serde(untagged)]
373pub enum GetWorkspaceNameError {
374    UnknownValue(serde_json::Value),
375}
376
377/// struct for typed errors of method [`get_workspace_slack_oauth_config`]
378#[derive(Debug, Clone, Serialize, Deserialize)]
379#[serde(untagged)]
380pub enum GetWorkspaceSlackOauthConfigError {
381    UnknownValue(serde_json::Value),
382}
383
384/// struct for typed errors of method [`get_workspace_usage`]
385#[derive(Debug, Clone, Serialize, Deserialize)]
386#[serde(untagged)]
387pub enum GetWorkspaceUsageError {
388    UnknownValue(serde_json::Value),
389}
390
391/// struct for typed errors of method [`invite_user`]
392#[derive(Debug, Clone, Serialize, Deserialize)]
393#[serde(untagged)]
394pub enum InviteUserError {
395    UnknownValue(serde_json::Value),
396}
397
398/// struct for typed errors of method [`is_domain_allowed`]
399#[derive(Debug, Clone, Serialize, Deserialize)]
400#[serde(untagged)]
401pub enum IsDomainAllowedError {
402    UnknownValue(serde_json::Value),
403}
404
405/// struct for typed errors of method [`leave_workspace`]
406#[derive(Debug, Clone, Serialize, Deserialize)]
407#[serde(untagged)]
408pub enum LeaveWorkspaceError {
409    UnknownValue(serde_json::Value),
410}
411
412/// struct for typed errors of method [`list_available_teams_channels`]
413#[derive(Debug, Clone, Serialize, Deserialize)]
414#[serde(untagged)]
415pub enum ListAvailableTeamsChannelsError {
416    UnknownValue(serde_json::Value),
417}
418
419/// struct for typed errors of method [`list_available_teams_ids`]
420#[derive(Debug, Clone, Serialize, Deserialize)]
421#[serde(untagged)]
422pub enum ListAvailableTeamsIdsError {
423    UnknownValue(serde_json::Value),
424}
425
426/// struct for typed errors of method [`list_data_table_schemas`]
427#[derive(Debug, Clone, Serialize, Deserialize)]
428#[serde(untagged)]
429pub enum ListDataTableSchemasError {
430    UnknownValue(serde_json::Value),
431}
432
433/// struct for typed errors of method [`list_data_tables`]
434#[derive(Debug, Clone, Serialize, Deserialize)]
435#[serde(untagged)]
436pub enum ListDataTablesError {
437    UnknownValue(serde_json::Value),
438}
439
440/// struct for typed errors of method [`list_ducklakes`]
441#[derive(Debug, Clone, Serialize, Deserialize)]
442#[serde(untagged)]
443pub enum ListDucklakesError {
444    UnknownValue(serde_json::Value),
445}
446
447/// struct for typed errors of method [`list_pending_invites`]
448#[derive(Debug, Clone, Serialize, Deserialize)]
449#[serde(untagged)]
450pub enum ListPendingInvitesError {
451    UnknownValue(serde_json::Value),
452}
453
454/// struct for typed errors of method [`list_protection_rules`]
455#[derive(Debug, Clone, Serialize, Deserialize)]
456#[serde(untagged)]
457pub enum ListProtectionRulesError {
458    UnknownValue(serde_json::Value),
459}
460
461/// struct for typed errors of method [`list_user_workspaces`]
462#[derive(Debug, Clone, Serialize, Deserialize)]
463#[serde(untagged)]
464pub enum ListUserWorkspacesError {
465    UnknownValue(serde_json::Value),
466}
467
468/// struct for typed errors of method [`list_workspaces`]
469#[derive(Debug, Clone, Serialize, Deserialize)]
470#[serde(untagged)]
471pub enum ListWorkspacesError {
472    UnknownValue(serde_json::Value),
473}
474
475/// struct for typed errors of method [`list_workspaces_as_super_admin`]
476#[derive(Debug, Clone, Serialize, Deserialize)]
477#[serde(untagged)]
478pub enum ListWorkspacesAsSuperAdminError {
479    UnknownValue(serde_json::Value),
480}
481
482/// struct for typed errors of method [`rebuild_dependency_map`]
483#[derive(Debug, Clone, Serialize, Deserialize)]
484#[serde(untagged)]
485pub enum RebuildDependencyMapError {
486    UnknownValue(serde_json::Value),
487}
488
489/// struct for typed errors of method [`reset_diff_tally`]
490#[derive(Debug, Clone, Serialize, Deserialize)]
491#[serde(untagged)]
492pub enum ResetDiffTallyError {
493    UnknownValue(serde_json::Value),
494}
495
496/// struct for typed errors of method [`run_slack_message_test_job`]
497#[derive(Debug, Clone, Serialize, Deserialize)]
498#[serde(untagged)]
499pub enum RunSlackMessageTestJobError {
500    UnknownValue(serde_json::Value),
501}
502
503/// struct for typed errors of method [`run_teams_message_test_job`]
504#[derive(Debug, Clone, Serialize, Deserialize)]
505#[serde(untagged)]
506pub enum RunTeamsMessageTestJobError {
507    UnknownValue(serde_json::Value),
508}
509
510/// struct for typed errors of method [`set_environment_variable`]
511#[derive(Debug, Clone, Serialize, Deserialize)]
512#[serde(untagged)]
513pub enum SetEnvironmentVariableError {
514    UnknownValue(serde_json::Value),
515}
516
517/// struct for typed errors of method [`set_threshold_alert`]
518#[derive(Debug, Clone, Serialize, Deserialize)]
519#[serde(untagged)]
520pub enum SetThresholdAlertError {
521    UnknownValue(serde_json::Value),
522}
523
524/// struct for typed errors of method [`set_workspace_encryption_key`]
525#[derive(Debug, Clone, Serialize, Deserialize)]
526#[serde(untagged)]
527pub enum SetWorkspaceEncryptionKeyError {
528    UnknownValue(serde_json::Value),
529}
530
531/// struct for typed errors of method [`set_workspace_slack_oauth_config`]
532#[derive(Debug, Clone, Serialize, Deserialize)]
533#[serde(untagged)]
534pub enum SetWorkspaceSlackOauthConfigError {
535    UnknownValue(serde_json::Value),
536}
537
538/// struct for typed errors of method [`unarchive_workspace`]
539#[derive(Debug, Clone, Serialize, Deserialize)]
540#[serde(untagged)]
541pub enum UnarchiveWorkspaceError {
542    UnknownValue(serde_json::Value),
543}
544
545/// struct for typed errors of method [`update_operator_settings`]
546#[derive(Debug, Clone, Serialize, Deserialize)]
547#[serde(untagged)]
548pub enum UpdateOperatorSettingsError {
549    UnknownValue(serde_json::Value),
550}
551
552/// struct for typed errors of method [`update_protection_rule`]
553#[derive(Debug, Clone, Serialize, Deserialize)]
554#[serde(untagged)]
555pub enum UpdateProtectionRuleError {
556    Status404(),
557    UnknownValue(serde_json::Value),
558}
559
560
561pub async fn add_user(configuration: &configuration::Configuration, workspace: &str, add_user_request: models::AddUserRequest) -> Result<String, Error<AddUserError>> {
562    let local_var_configuration = configuration;
563
564    let local_var_client = &local_var_configuration.client;
565
566    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/add_user", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
567    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
568
569    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
570        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
571    }
572    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
573        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
574    };
575    local_var_req_builder = local_var_req_builder.json(&add_user_request);
576
577    let local_var_req = local_var_req_builder.build()?;
578    let local_var_resp = local_var_client.execute(local_var_req).await?;
579
580    let local_var_status = local_var_resp.status();
581    let local_var_content = local_var_resp.text().await?;
582
583    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
584        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
585    } else {
586        let local_var_entity: Option<AddUserError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
587        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
588        Err(Error::ResponseError(local_var_error))
589    }
590}
591
592pub async fn archive_workspace(configuration: &configuration::Configuration, workspace: &str) -> Result<String, Error<ArchiveWorkspaceError>> {
593    let local_var_configuration = configuration;
594
595    let local_var_client = &local_var_configuration.client;
596
597    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/archive", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
598    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
599
600    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
601        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
602    }
603    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
604        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
605    };
606
607    let local_var_req = local_var_req_builder.build()?;
608    let local_var_resp = local_var_client.execute(local_var_req).await?;
609
610    let local_var_status = local_var_resp.status();
611    let local_var_content = local_var_resp.text().await?;
612
613    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
614        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
615    } else {
616        let local_var_entity: Option<ArchiveWorkspaceError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
617        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
618        Err(Error::ResponseError(local_var_error))
619    }
620}
621
622pub async fn change_workspace_color(configuration: &configuration::Configuration, workspace: &str, change_workspace_color_request: Option<models::ChangeWorkspaceColorRequest>) -> Result<String, Error<ChangeWorkspaceColorError>> {
623    let local_var_configuration = configuration;
624
625    let local_var_client = &local_var_configuration.client;
626
627    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/change_workspace_color", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
628    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
629
630    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
631        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
632    }
633    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
634        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
635    };
636    local_var_req_builder = local_var_req_builder.json(&change_workspace_color_request);
637
638    let local_var_req = local_var_req_builder.build()?;
639    let local_var_resp = local_var_client.execute(local_var_req).await?;
640
641    let local_var_status = local_var_resp.status();
642    let local_var_content = local_var_resp.text().await?;
643
644    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
645        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
646    } else {
647        let local_var_entity: Option<ChangeWorkspaceColorError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
648        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
649        Err(Error::ResponseError(local_var_error))
650    }
651}
652
653pub async fn change_workspace_id(configuration: &configuration::Configuration, workspace: &str, change_workspace_id_request: Option<models::ChangeWorkspaceIdRequest>) -> Result<String, Error<ChangeWorkspaceIdError>> {
654    let local_var_configuration = configuration;
655
656    let local_var_client = &local_var_configuration.client;
657
658    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/change_workspace_id", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
659    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
660
661    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
662        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
663    }
664    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
665        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
666    };
667    local_var_req_builder = local_var_req_builder.json(&change_workspace_id_request);
668
669    let local_var_req = local_var_req_builder.build()?;
670    let local_var_resp = local_var_client.execute(local_var_req).await?;
671
672    let local_var_status = local_var_resp.status();
673    let local_var_content = local_var_resp.text().await?;
674
675    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
676        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
677    } else {
678        let local_var_entity: Option<ChangeWorkspaceIdError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
679        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
680        Err(Error::ResponseError(local_var_error))
681    }
682}
683
684pub async fn change_workspace_name(configuration: &configuration::Configuration, workspace: &str, change_workspace_name_request: Option<models::ChangeWorkspaceNameRequest>) -> Result<String, Error<ChangeWorkspaceNameError>> {
685    let local_var_configuration = configuration;
686
687    let local_var_client = &local_var_configuration.client;
688
689    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/change_workspace_name", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
690    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
691
692    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
693        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
694    }
695    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
696        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
697    };
698    local_var_req_builder = local_var_req_builder.json(&change_workspace_name_request);
699
700    let local_var_req = local_var_req_builder.build()?;
701    let local_var_resp = local_var_client.execute(local_var_req).await?;
702
703    let local_var_status = local_var_resp.status();
704    let local_var_content = local_var_resp.text().await?;
705
706    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
707        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
708    } else {
709        let local_var_entity: Option<ChangeWorkspaceNameError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
710        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
711        Err(Error::ResponseError(local_var_error))
712    }
713}
714
715/// Compares the current workspace with a target workspace to find differences in scripts, flows, apps, resources, and variables. Returns information about items that are ahead, behind, or in conflict.
716pub async fn compare_workspaces(configuration: &configuration::Configuration, workspace: &str, target_workspace_id: &str) -> Result<models::WorkspaceComparison, Error<CompareWorkspacesError>> {
717    let local_var_configuration = configuration;
718
719    let local_var_client = &local_var_configuration.client;
720
721    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/compare/{target_workspace_id}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), target_workspace_id=crate::apis::urlencode(target_workspace_id));
722    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
723
724    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
725        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
726    }
727    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
728        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
729    };
730
731    let local_var_req = local_var_req_builder.build()?;
732    let local_var_resp = local_var_client.execute(local_var_req).await?;
733
734    let local_var_status = local_var_resp.status();
735    let local_var_content = local_var_resp.text().await?;
736
737    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
738        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
739    } else {
740        let local_var_entity: Option<CompareWorkspacesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
741        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
742        Err(Error::ResponseError(local_var_error))
743    }
744}
745
746pub async fn connect_teams(configuration: &configuration::Configuration, workspace: &str, connect_teams_request: models::ConnectTeamsRequest) -> Result<String, Error<ConnectTeamsError>> {
747    let local_var_configuration = configuration;
748
749    let local_var_client = &local_var_configuration.client;
750
751    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/connect_teams", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
752    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
753
754    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
755        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
756    }
757    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
758        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
759    };
760    local_var_req_builder = local_var_req_builder.json(&connect_teams_request);
761
762    let local_var_req = local_var_req_builder.build()?;
763    let local_var_resp = local_var_client.execute(local_var_req).await?;
764
765    let local_var_status = local_var_resp.status();
766    let local_var_content = local_var_resp.text().await?;
767
768    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
769        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
770    } else {
771        let local_var_entity: Option<ConnectTeamsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
772        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
773        Err(Error::ResponseError(local_var_error))
774    }
775}
776
777pub async fn create_protection_rule(configuration: &configuration::Configuration, workspace: &str, create_protection_rule_request: models::CreateProtectionRuleRequest) -> Result<String, Error<CreateProtectionRuleError>> {
778    let local_var_configuration = configuration;
779
780    let local_var_client = &local_var_configuration.client;
781
782    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/protection_rules", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
783    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
784
785    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
786        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
787    }
788    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
789        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
790    };
791    local_var_req_builder = local_var_req_builder.json(&create_protection_rule_request);
792
793    let local_var_req = local_var_req_builder.build()?;
794    let local_var_resp = local_var_client.execute(local_var_req).await?;
795
796    let local_var_status = local_var_resp.status();
797    let local_var_content = local_var_resp.text().await?;
798
799    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
800        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
801    } else {
802        let local_var_entity: Option<CreateProtectionRuleError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
803        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
804        Err(Error::ResponseError(local_var_error))
805    }
806}
807
808pub async fn create_workspace(configuration: &configuration::Configuration, create_workspace: models::CreateWorkspace) -> Result<String, Error<CreateWorkspaceError>> {
809    let local_var_configuration = configuration;
810
811    let local_var_client = &local_var_configuration.client;
812
813    let local_var_uri_str = format!("{}/workspaces/create", local_var_configuration.base_path);
814    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
815
816    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
817        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
818    }
819    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
820        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
821    };
822    local_var_req_builder = local_var_req_builder.json(&create_workspace);
823
824    let local_var_req = local_var_req_builder.build()?;
825    let local_var_resp = local_var_client.execute(local_var_req).await?;
826
827    let local_var_status = local_var_resp.status();
828    let local_var_content = local_var_resp.text().await?;
829
830    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
831        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
832    } else {
833        let local_var_entity: Option<CreateWorkspaceError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
834        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
835        Err(Error::ResponseError(local_var_error))
836    }
837}
838
839pub async fn create_workspace_fork(configuration: &configuration::Configuration, workspace: &str, create_workspace_fork: models::CreateWorkspaceFork) -> Result<String, Error<CreateWorkspaceForkError>> {
840    let local_var_configuration = configuration;
841
842    let local_var_client = &local_var_configuration.client;
843
844    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/create_fork", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
845    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
846
847    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
848        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
849    }
850    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
851        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
852    };
853    local_var_req_builder = local_var_req_builder.json(&create_workspace_fork);
854
855    let local_var_req = local_var_req_builder.build()?;
856    let local_var_resp = local_var_client.execute(local_var_req).await?;
857
858    let local_var_status = local_var_resp.status();
859    let local_var_content = local_var_resp.text().await?;
860
861    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
862        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
863    } else {
864        let local_var_entity: Option<CreateWorkspaceForkError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
865        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
866        Err(Error::ResponseError(local_var_error))
867    }
868}
869
870pub async fn create_workspace_fork_git_branch(configuration: &configuration::Configuration, workspace: &str, create_workspace_fork: models::CreateWorkspaceFork) -> Result<Vec<uuid::Uuid>, Error<CreateWorkspaceForkGitBranchError>> {
871    let local_var_configuration = configuration;
872
873    let local_var_client = &local_var_configuration.client;
874
875    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/create_workspace_fork_branch", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
876    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
877
878    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
879        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
880    }
881    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
882        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
883    };
884    local_var_req_builder = local_var_req_builder.json(&create_workspace_fork);
885
886    let local_var_req = local_var_req_builder.build()?;
887    let local_var_resp = local_var_client.execute(local_var_req).await?;
888
889    let local_var_status = local_var_resp.status();
890    let local_var_content = local_var_resp.text().await?;
891
892    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
893        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
894    } else {
895        let local_var_entity: Option<CreateWorkspaceForkGitBranchError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
896        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
897        Err(Error::ResponseError(local_var_error))
898    }
899}
900
901pub async fn delete_git_sync_repository(configuration: &configuration::Configuration, workspace: &str, delete_git_sync_repository_request: models::DeleteGitSyncRepositoryRequest) -> Result<serde_json::Value, Error<DeleteGitSyncRepositoryError>> {
902    let local_var_configuration = configuration;
903
904    let local_var_client = &local_var_configuration.client;
905
906    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/delete_git_sync_repository", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
907    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
908
909    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
910        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
911    }
912    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
913        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
914    };
915    local_var_req_builder = local_var_req_builder.json(&delete_git_sync_repository_request);
916
917    let local_var_req = local_var_req_builder.build()?;
918    let local_var_resp = local_var_client.execute(local_var_req).await?;
919
920    let local_var_status = local_var_resp.status();
921    let local_var_content = local_var_resp.text().await?;
922
923    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
924        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
925    } else {
926        let local_var_entity: Option<DeleteGitSyncRepositoryError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
927        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
928        Err(Error::ResponseError(local_var_error))
929    }
930}
931
932pub async fn delete_invite(configuration: &configuration::Configuration, workspace: &str, delete_invite_request: models::DeleteInviteRequest) -> Result<String, Error<DeleteInviteError>> {
933    let local_var_configuration = configuration;
934
935    let local_var_client = &local_var_configuration.client;
936
937    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/delete_invite", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
938    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
939
940    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
941        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
942    }
943    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
944        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
945    };
946    local_var_req_builder = local_var_req_builder.json(&delete_invite_request);
947
948    let local_var_req = local_var_req_builder.build()?;
949    let local_var_resp = local_var_client.execute(local_var_req).await?;
950
951    let local_var_status = local_var_resp.status();
952    let local_var_content = local_var_resp.text().await?;
953
954    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
955        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
956    } else {
957        let local_var_entity: Option<DeleteInviteError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
958        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
959        Err(Error::ResponseError(local_var_error))
960    }
961}
962
963pub async fn delete_protection_rule(configuration: &configuration::Configuration, workspace: &str, rule_name: &str) -> Result<String, Error<DeleteProtectionRuleError>> {
964    let local_var_configuration = configuration;
965
966    let local_var_client = &local_var_configuration.client;
967
968    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/protection_rules/{rule_name}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), rule_name=crate::apis::urlencode(rule_name));
969    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
970
971    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
972        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
973    }
974    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
975        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
976    };
977
978    let local_var_req = local_var_req_builder.build()?;
979    let local_var_resp = local_var_client.execute(local_var_req).await?;
980
981    let local_var_status = local_var_resp.status();
982    let local_var_content = local_var_resp.text().await?;
983
984    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
985        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
986    } else {
987        let local_var_entity: Option<DeleteProtectionRuleError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
988        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
989        Err(Error::ResponseError(local_var_error))
990    }
991}
992
993pub async fn delete_workspace(configuration: &configuration::Configuration, workspace: &str, only_delete_forks: Option<bool>) -> Result<String, Error<DeleteWorkspaceError>> {
994    let local_var_configuration = configuration;
995
996    let local_var_client = &local_var_configuration.client;
997
998    let local_var_uri_str = format!("{}/workspaces/delete/{workspace}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
999    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
1000
1001    if let Some(ref local_var_str) = only_delete_forks {
1002        local_var_req_builder = local_var_req_builder.query(&[("only_delete_forks", &local_var_str.to_string())]);
1003    }
1004    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1005        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1006    }
1007    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1008        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1009    };
1010
1011    let local_var_req = local_var_req_builder.build()?;
1012    let local_var_resp = local_var_client.execute(local_var_req).await?;
1013
1014    let local_var_status = local_var_resp.status();
1015    let local_var_content = local_var_resp.text().await?;
1016
1017    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1018        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1019    } else {
1020        let local_var_entity: Option<DeleteWorkspaceError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1021        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1022        Err(Error::ResponseError(local_var_error))
1023    }
1024}
1025
1026pub async fn delete_workspace_slack_oauth_config(configuration: &configuration::Configuration, workspace: &str) -> Result<String, Error<DeleteWorkspaceSlackOauthConfigError>> {
1027    let local_var_configuration = configuration;
1028
1029    let local_var_client = &local_var_configuration.client;
1030
1031    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/slack_oauth_config", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1032    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
1033
1034    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1035        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1036    }
1037    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1038        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1039    };
1040
1041    let local_var_req = local_var_req_builder.build()?;
1042    let local_var_resp = local_var_client.execute(local_var_req).await?;
1043
1044    let local_var_status = local_var_resp.status();
1045    let local_var_content = local_var_resp.text().await?;
1046
1047    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1048        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1049    } else {
1050        let local_var_entity: Option<DeleteWorkspaceSlackOauthConfigError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1051        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1052        Err(Error::ResponseError(local_var_error))
1053    }
1054}
1055
1056pub async fn edit_auto_invite(configuration: &configuration::Configuration, workspace: &str, edit_auto_invite_request: models::EditAutoInviteRequest) -> Result<String, Error<EditAutoInviteError>> {
1057    let local_var_configuration = configuration;
1058
1059    let local_var_client = &local_var_configuration.client;
1060
1061    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_auto_invite", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1062    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1063
1064    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1065        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1066    }
1067    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1068        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1069    };
1070    local_var_req_builder = local_var_req_builder.json(&edit_auto_invite_request);
1071
1072    let local_var_req = local_var_req_builder.build()?;
1073    let local_var_resp = local_var_client.execute(local_var_req).await?;
1074
1075    let local_var_status = local_var_resp.status();
1076    let local_var_content = local_var_resp.text().await?;
1077
1078    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1079        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1080    } else {
1081        let local_var_entity: Option<EditAutoInviteError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1082        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1083        Err(Error::ResponseError(local_var_error))
1084    }
1085}
1086
1087pub async fn edit_copilot_config(configuration: &configuration::Configuration, workspace: &str, ai_config: models::AiConfig) -> Result<String, Error<EditCopilotConfigError>> {
1088    let local_var_configuration = configuration;
1089
1090    let local_var_client = &local_var_configuration.client;
1091
1092    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_copilot_config", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1093    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1094
1095    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1096        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1097    }
1098    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1099        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1100    };
1101    local_var_req_builder = local_var_req_builder.json(&ai_config);
1102
1103    let local_var_req = local_var_req_builder.build()?;
1104    let local_var_resp = local_var_client.execute(local_var_req).await?;
1105
1106    let local_var_status = local_var_resp.status();
1107    let local_var_content = local_var_resp.text().await?;
1108
1109    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1110        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1111    } else {
1112        let local_var_entity: Option<EditCopilotConfigError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1113        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1114        Err(Error::ResponseError(local_var_error))
1115    }
1116}
1117
1118pub async fn edit_data_table_config(configuration: &configuration::Configuration, workspace: &str, edit_data_table_config_request: models::EditDataTableConfigRequest) -> Result<serde_json::Value, Error<EditDataTableConfigError>> {
1119    let local_var_configuration = configuration;
1120
1121    let local_var_client = &local_var_configuration.client;
1122
1123    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_datatable_config", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1124    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1125
1126    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1127        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1128    }
1129    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1130        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1131    };
1132    local_var_req_builder = local_var_req_builder.json(&edit_data_table_config_request);
1133
1134    let local_var_req = local_var_req_builder.build()?;
1135    let local_var_resp = local_var_client.execute(local_var_req).await?;
1136
1137    let local_var_status = local_var_resp.status();
1138    let local_var_content = local_var_resp.text().await?;
1139
1140    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1141        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1142    } else {
1143        let local_var_entity: Option<EditDataTableConfigError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1144        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1145        Err(Error::ResponseError(local_var_error))
1146    }
1147}
1148
1149pub async fn edit_default_scripts(configuration: &configuration::Configuration, workspace: &str, workspace_default_scripts: Option<models::WorkspaceDefaultScripts>) -> Result<String, Error<EditDefaultScriptsError>> {
1150    let local_var_configuration = configuration;
1151
1152    let local_var_client = &local_var_configuration.client;
1153
1154    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/default_scripts", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1155    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1156
1157    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1158        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1159    }
1160    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1161        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1162    };
1163    local_var_req_builder = local_var_req_builder.json(&workspace_default_scripts);
1164
1165    let local_var_req = local_var_req_builder.build()?;
1166    let local_var_resp = local_var_client.execute(local_var_req).await?;
1167
1168    let local_var_status = local_var_resp.status();
1169    let local_var_content = local_var_resp.text().await?;
1170
1171    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1172        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1173    } else {
1174        let local_var_entity: Option<EditDefaultScriptsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1175        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1176        Err(Error::ResponseError(local_var_error))
1177    }
1178}
1179
1180pub async fn edit_deploy_to(configuration: &configuration::Configuration, workspace: &str, get_deploy_to200_response: models::GetDeployTo200Response) -> Result<String, Error<EditDeployToError>> {
1181    let local_var_configuration = configuration;
1182
1183    let local_var_client = &local_var_configuration.client;
1184
1185    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_deploy_to", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1186    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1187
1188    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1189        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1190    }
1191    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1192        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1193    };
1194    local_var_req_builder = local_var_req_builder.json(&get_deploy_to200_response);
1195
1196    let local_var_req = local_var_req_builder.build()?;
1197    let local_var_resp = local_var_client.execute(local_var_req).await?;
1198
1199    let local_var_status = local_var_resp.status();
1200    let local_var_content = local_var_resp.text().await?;
1201
1202    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1203        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1204    } else {
1205        let local_var_entity: Option<EditDeployToError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1206        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1207        Err(Error::ResponseError(local_var_error))
1208    }
1209}
1210
1211pub async fn edit_ducklake_config(configuration: &configuration::Configuration, workspace: &str, edit_ducklake_config_request: models::EditDucklakeConfigRequest) -> Result<serde_json::Value, Error<EditDucklakeConfigError>> {
1212    let local_var_configuration = configuration;
1213
1214    let local_var_client = &local_var_configuration.client;
1215
1216    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_ducklake_config", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1217    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1218
1219    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1220        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1221    }
1222    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1223        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1224    };
1225    local_var_req_builder = local_var_req_builder.json(&edit_ducklake_config_request);
1226
1227    let local_var_req = local_var_req_builder.build()?;
1228    let local_var_resp = local_var_client.execute(local_var_req).await?;
1229
1230    let local_var_status = local_var_resp.status();
1231    let local_var_content = local_var_resp.text().await?;
1232
1233    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1234        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1235    } else {
1236        let local_var_entity: Option<EditDucklakeConfigError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1237        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1238        Err(Error::ResponseError(local_var_error))
1239    }
1240}
1241
1242pub async fn edit_error_handler(configuration: &configuration::Configuration, workspace: &str, edit_error_handler: models::EditErrorHandler) -> Result<String, Error<EditErrorHandlerError>> {
1243    let local_var_configuration = configuration;
1244
1245    let local_var_client = &local_var_configuration.client;
1246
1247    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_error_handler", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1248    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1249
1250    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1251        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1252    }
1253    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1254        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1255    };
1256    local_var_req_builder = local_var_req_builder.json(&edit_error_handler);
1257
1258    let local_var_req = local_var_req_builder.build()?;
1259    let local_var_resp = local_var_client.execute(local_var_req).await?;
1260
1261    let local_var_status = local_var_resp.status();
1262    let local_var_content = local_var_resp.text().await?;
1263
1264    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1265        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1266    } else {
1267        let local_var_entity: Option<EditErrorHandlerError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1268        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1269        Err(Error::ResponseError(local_var_error))
1270    }
1271}
1272
1273pub async fn edit_git_sync_repository(configuration: &configuration::Configuration, workspace: &str, edit_git_sync_repository_request: models::EditGitSyncRepositoryRequest) -> Result<serde_json::Value, Error<EditGitSyncRepositoryError>> {
1274    let local_var_configuration = configuration;
1275
1276    let local_var_client = &local_var_configuration.client;
1277
1278    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_git_sync_repository", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1279    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1280
1281    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1282        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1283    }
1284    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1285        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1286    };
1287    local_var_req_builder = local_var_req_builder.json(&edit_git_sync_repository_request);
1288
1289    let local_var_req = local_var_req_builder.build()?;
1290    let local_var_resp = local_var_client.execute(local_var_req).await?;
1291
1292    let local_var_status = local_var_resp.status();
1293    let local_var_content = local_var_resp.text().await?;
1294
1295    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1296        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1297    } else {
1298        let local_var_entity: Option<EditGitSyncRepositoryError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1299        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1300        Err(Error::ResponseError(local_var_error))
1301    }
1302}
1303
1304pub async fn edit_instance_groups(configuration: &configuration::Configuration, workspace: &str, edit_instance_groups_request: models::EditInstanceGroupsRequest) -> Result<String, Error<EditInstanceGroupsError>> {
1305    let local_var_configuration = configuration;
1306
1307    let local_var_client = &local_var_configuration.client;
1308
1309    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_instance_groups", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1310    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1311
1312    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1313        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1314    }
1315    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1316        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1317    };
1318    local_var_req_builder = local_var_req_builder.json(&edit_instance_groups_request);
1319
1320    let local_var_req = local_var_req_builder.build()?;
1321    let local_var_resp = local_var_client.execute(local_var_req).await?;
1322
1323    let local_var_status = local_var_resp.status();
1324    let local_var_content = local_var_resp.text().await?;
1325
1326    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1327        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1328    } else {
1329        let local_var_entity: Option<EditInstanceGroupsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1330        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1331        Err(Error::ResponseError(local_var_error))
1332    }
1333}
1334
1335pub 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>> {
1336    let local_var_configuration = configuration;
1337
1338    let local_var_client = &local_var_configuration.client;
1339
1340    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_large_file_storage_config", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1341    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1342
1343    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1344        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1345    }
1346    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1347        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1348    };
1349    local_var_req_builder = local_var_req_builder.json(&edit_large_file_storage_config_request);
1350
1351    let local_var_req = local_var_req_builder.build()?;
1352    let local_var_resp = local_var_client.execute(local_var_req).await?;
1353
1354    let local_var_status = local_var_resp.status();
1355    let local_var_content = local_var_resp.text().await?;
1356
1357    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1358        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1359    } else {
1360        let local_var_entity: Option<EditLargeFileStorageConfigError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1361        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1362        Err(Error::ResponseError(local_var_error))
1363    }
1364}
1365
1366pub async fn edit_slack_command(configuration: &configuration::Configuration, workspace: &str, edit_slack_command_request: models::EditSlackCommandRequest) -> Result<String, Error<EditSlackCommandError>> {
1367    let local_var_configuration = configuration;
1368
1369    let local_var_client = &local_var_configuration.client;
1370
1371    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_slack_command", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1372    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1373
1374    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1375        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1376    }
1377    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1378        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1379    };
1380    local_var_req_builder = local_var_req_builder.json(&edit_slack_command_request);
1381
1382    let local_var_req = local_var_req_builder.build()?;
1383    let local_var_resp = local_var_client.execute(local_var_req).await?;
1384
1385    let local_var_status = local_var_resp.status();
1386    let local_var_content = local_var_resp.text().await?;
1387
1388    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1389        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1390    } else {
1391        let local_var_entity: Option<EditSlackCommandError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1392        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1393        Err(Error::ResponseError(local_var_error))
1394    }
1395}
1396
1397pub async fn edit_success_handler(configuration: &configuration::Configuration, workspace: &str, edit_success_handler: models::EditSuccessHandler) -> Result<String, Error<EditSuccessHandlerError>> {
1398    let local_var_configuration = configuration;
1399
1400    let local_var_client = &local_var_configuration.client;
1401
1402    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_success_handler", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1403    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1404
1405    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1406        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1407    }
1408    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1409        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1410    };
1411    local_var_req_builder = local_var_req_builder.json(&edit_success_handler);
1412
1413    let local_var_req = local_var_req_builder.build()?;
1414    let local_var_resp = local_var_client.execute(local_var_req).await?;
1415
1416    let local_var_status = local_var_resp.status();
1417    let local_var_content = local_var_resp.text().await?;
1418
1419    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1420        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1421    } else {
1422        let local_var_entity: Option<EditSuccessHandlerError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1423        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1424        Err(Error::ResponseError(local_var_error))
1425    }
1426}
1427
1428pub async fn edit_teams_command(configuration: &configuration::Configuration, workspace: &str, edit_slack_command_request: models::EditSlackCommandRequest) -> Result<String, Error<EditTeamsCommandError>> {
1429    let local_var_configuration = configuration;
1430
1431    let local_var_client = &local_var_configuration.client;
1432
1433    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_teams_command", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1434    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1435
1436    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1437        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1438    }
1439    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1440        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1441    };
1442    local_var_req_builder = local_var_req_builder.json(&edit_slack_command_request);
1443
1444    let local_var_req = local_var_req_builder.build()?;
1445    let local_var_resp = local_var_client.execute(local_var_req).await?;
1446
1447    let local_var_status = local_var_resp.status();
1448    let local_var_content = local_var_resp.text().await?;
1449
1450    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1451        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1452    } else {
1453        let local_var_entity: Option<EditTeamsCommandError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1454        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1455        Err(Error::ResponseError(local_var_error))
1456    }
1457}
1458
1459pub async fn edit_webhook(configuration: &configuration::Configuration, workspace: &str, edit_webhook_request: models::EditWebhookRequest) -> Result<String, Error<EditWebhookError>> {
1460    let local_var_configuration = configuration;
1461
1462    let local_var_client = &local_var_configuration.client;
1463
1464    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_webhook", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1465    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1466
1467    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1468        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1469    }
1470    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1471        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1472    };
1473    local_var_req_builder = local_var_req_builder.json(&edit_webhook_request);
1474
1475    let local_var_req = local_var_req_builder.build()?;
1476    let local_var_resp = local_var_client.execute(local_var_req).await?;
1477
1478    let local_var_status = local_var_resp.status();
1479    let local_var_content = local_var_resp.text().await?;
1480
1481    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1482        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1483    } else {
1484        let local_var_entity: Option<EditWebhookError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1485        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1486        Err(Error::ResponseError(local_var_error))
1487    }
1488}
1489
1490pub async fn edit_workspace_default_app(configuration: &configuration::Configuration, workspace: &str, edit_workspace_default_app_request: models::EditWorkspaceDefaultAppRequest) -> Result<String, Error<EditWorkspaceDefaultAppError>> {
1491    let local_var_configuration = configuration;
1492
1493    let local_var_client = &local_var_configuration.client;
1494
1495    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_default_app", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1496    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1497
1498    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1499        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1500    }
1501    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1502        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1503    };
1504    local_var_req_builder = local_var_req_builder.json(&edit_workspace_default_app_request);
1505
1506    let local_var_req = local_var_req_builder.build()?;
1507    let local_var_resp = local_var_client.execute(local_var_req).await?;
1508
1509    let local_var_status = local_var_resp.status();
1510    let local_var_content = local_var_resp.text().await?;
1511
1512    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1513        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1514    } else {
1515        let local_var_entity: Option<EditWorkspaceDefaultAppError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1516        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1517        Err(Error::ResponseError(local_var_error))
1518    }
1519}
1520
1521pub 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>> {
1522    let local_var_configuration = configuration;
1523
1524    let local_var_client = &local_var_configuration.client;
1525
1526    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_deploy_ui_config", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1527    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1528
1529    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1530        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1531    }
1532    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1533        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1534    };
1535    local_var_req_builder = local_var_req_builder.json(&edit_workspace_deploy_ui_settings_request);
1536
1537    let local_var_req = local_var_req_builder.build()?;
1538    let local_var_resp = local_var_client.execute(local_var_req).await?;
1539
1540    let local_var_status = local_var_resp.status();
1541    let local_var_content = local_var_resp.text().await?;
1542
1543    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1544        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1545    } else {
1546        let local_var_entity: Option<EditWorkspaceDeployUiSettingsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1547        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1548        Err(Error::ResponseError(local_var_error))
1549    }
1550}
1551
1552pub 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>> {
1553    let local_var_configuration = configuration;
1554
1555    let local_var_client = &local_var_configuration.client;
1556
1557    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_git_sync_config", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1558    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1559
1560    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1561        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1562    }
1563    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1564        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1565    };
1566    local_var_req_builder = local_var_req_builder.json(&edit_workspace_git_sync_config_request);
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<EditWorkspaceGitSyncConfigError> = 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 exists_username(configuration: &configuration::Configuration, exists_username_request: models::ExistsUsernameRequest) -> Result<bool, Error<ExistsUsernameError>> {
1584    let local_var_configuration = configuration;
1585
1586    let local_var_client = &local_var_configuration.client;
1587
1588    let local_var_uri_str = format!("{}/workspaces/exists_username", local_var_configuration.base_path);
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    local_var_req_builder = local_var_req_builder.json(&exists_username_request);
1598
1599    let local_var_req = local_var_req_builder.build()?;
1600    let local_var_resp = local_var_client.execute(local_var_req).await?;
1601
1602    let local_var_status = local_var_resp.status();
1603    let local_var_content = local_var_resp.text().await?;
1604
1605    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1606        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1607    } else {
1608        let local_var_entity: Option<ExistsUsernameError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1609        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1610        Err(Error::ResponseError(local_var_error))
1611    }
1612}
1613
1614pub async fn exists_workspace(configuration: &configuration::Configuration, exists_workspace_request: models::ExistsWorkspaceRequest) -> Result<bool, Error<ExistsWorkspaceError>> {
1615    let local_var_configuration = configuration;
1616
1617    let local_var_client = &local_var_configuration.client;
1618
1619    let local_var_uri_str = format!("{}/workspaces/exists", local_var_configuration.base_path);
1620    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1621
1622    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1623        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1624    }
1625    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1626        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1627    };
1628    local_var_req_builder = local_var_req_builder.json(&exists_workspace_request);
1629
1630    let local_var_req = local_var_req_builder.build()?;
1631    let local_var_resp = local_var_client.execute(local_var_req).await?;
1632
1633    let local_var_status = local_var_resp.status();
1634    let local_var_content = local_var_resp.text().await?;
1635
1636    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1637        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1638    } else {
1639        let local_var_entity: Option<ExistsWorkspaceError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1640        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1641        Err(Error::ResponseError(local_var_error))
1642    }
1643}
1644
1645pub async fn get_copilot_info(configuration: &configuration::Configuration, workspace: &str) -> Result<models::AiConfig, Error<GetCopilotInfoError>> {
1646    let local_var_configuration = configuration;
1647
1648    let local_var_client = &local_var_configuration.client;
1649
1650    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_copilot_info", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1651    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1652
1653    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1654        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1655    }
1656    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1657        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1658    };
1659
1660    let local_var_req = local_var_req_builder.build()?;
1661    let local_var_resp = local_var_client.execute(local_var_req).await?;
1662
1663    let local_var_status = local_var_resp.status();
1664    let local_var_content = local_var_resp.text().await?;
1665
1666    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1667        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1668    } else {
1669        let local_var_entity: Option<GetCopilotInfoError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1670        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1671        Err(Error::ResponseError(local_var_error))
1672    }
1673}
1674
1675pub async fn get_default_scripts(configuration: &configuration::Configuration, workspace: &str) -> Result<models::WorkspaceDefaultScripts, Error<GetDefaultScriptsError>> {
1676    let local_var_configuration = configuration;
1677
1678    let local_var_client = &local_var_configuration.client;
1679
1680    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/default_scripts", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1681    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1682
1683    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1684        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1685    }
1686    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1687        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1688    };
1689
1690    let local_var_req = local_var_req_builder.build()?;
1691    let local_var_resp = local_var_client.execute(local_var_req).await?;
1692
1693    let local_var_status = local_var_resp.status();
1694    let local_var_content = local_var_resp.text().await?;
1695
1696    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1697        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1698    } else {
1699        let local_var_entity: Option<GetDefaultScriptsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1700        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1701        Err(Error::ResponseError(local_var_error))
1702    }
1703}
1704
1705pub async fn get_dependency_map(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<models::DependencyMap>, Error<GetDependencyMapError>> {
1706    let local_var_configuration = configuration;
1707
1708    let local_var_client = &local_var_configuration.client;
1709
1710    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_dependency_map", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1711    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1712
1713    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1714        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1715    }
1716    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1717        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1718    };
1719
1720    let local_var_req = local_var_req_builder.build()?;
1721    let local_var_resp = local_var_client.execute(local_var_req).await?;
1722
1723    let local_var_status = local_var_resp.status();
1724    let local_var_content = local_var_resp.text().await?;
1725
1726    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1727        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1728    } else {
1729        let local_var_entity: Option<GetDependencyMapError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1730        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1731        Err(Error::ResponseError(local_var_error))
1732    }
1733}
1734
1735pub async fn get_dependents(configuration: &configuration::Configuration, workspace: &str, imported_path: &str) -> Result<Vec<models::DependencyDependent>, Error<GetDependentsError>> {
1736    let local_var_configuration = configuration;
1737
1738    let local_var_client = &local_var_configuration.client;
1739
1740    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_dependents/{imported_path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), imported_path=crate::apis::urlencode(imported_path));
1741    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1742
1743    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1744        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1745    }
1746    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1747        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1748    };
1749
1750    let local_var_req = local_var_req_builder.build()?;
1751    let local_var_resp = local_var_client.execute(local_var_req).await?;
1752
1753    let local_var_status = local_var_resp.status();
1754    let local_var_content = local_var_resp.text().await?;
1755
1756    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1757        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1758    } else {
1759        let local_var_entity: Option<GetDependentsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1760        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1761        Err(Error::ResponseError(local_var_error))
1762    }
1763}
1764
1765pub async fn get_dependents_amounts(configuration: &configuration::Configuration, workspace: &str, request_body: Vec<String>) -> Result<Vec<models::DependentsAmount>, Error<GetDependentsAmountsError>> {
1766    let local_var_configuration = configuration;
1767
1768    let local_var_client = &local_var_configuration.client;
1769
1770    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_dependents_amounts", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1771    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1772
1773    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1774        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1775    }
1776    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1777        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1778    };
1779    local_var_req_builder = local_var_req_builder.json(&request_body);
1780
1781    let local_var_req = local_var_req_builder.build()?;
1782    let local_var_resp = local_var_client.execute(local_var_req).await?;
1783
1784    let local_var_status = local_var_resp.status();
1785    let local_var_content = local_var_resp.text().await?;
1786
1787    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1788        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1789    } else {
1790        let local_var_entity: Option<GetDependentsAmountsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1791        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1792        Err(Error::ResponseError(local_var_error))
1793    }
1794}
1795
1796pub async fn get_deploy_to(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetDeployTo200Response, Error<GetDeployToError>> {
1797    let local_var_configuration = configuration;
1798
1799    let local_var_client = &local_var_configuration.client;
1800
1801    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_deploy_to", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1802    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1803
1804    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1805        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1806    }
1807    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1808        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1809    };
1810
1811    let local_var_req = local_var_req_builder.build()?;
1812    let local_var_resp = local_var_client.execute(local_var_req).await?;
1813
1814    let local_var_status = local_var_resp.status();
1815    let local_var_content = local_var_resp.text().await?;
1816
1817    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1818        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1819    } else {
1820        let local_var_entity: Option<GetDeployToError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1821        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1822        Err(Error::ResponseError(local_var_error))
1823    }
1824}
1825
1826pub async fn get_github_app_token(configuration: &configuration::Configuration, workspace: &str, get_github_app_token_request: models::GetGithubAppTokenRequest) -> Result<models::GetGithubAppToken200Response, Error<GetGithubAppTokenError>> {
1827    let local_var_configuration = configuration;
1828
1829    let local_var_client = &local_var_configuration.client;
1830
1831    let local_var_uri_str = format!("{}/w/{workspace}/github_app/token", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1832    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1833
1834    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1835        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1836    }
1837    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1838        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1839    };
1840    local_var_req_builder = local_var_req_builder.json(&get_github_app_token_request);
1841
1842    let local_var_req = local_var_req_builder.build()?;
1843    let local_var_resp = local_var_client.execute(local_var_req).await?;
1844
1845    let local_var_status = local_var_resp.status();
1846    let local_var_content = local_var_resp.text().await?;
1847
1848    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1849        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1850    } else {
1851        let local_var_entity: Option<GetGithubAppTokenError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1852        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1853        Err(Error::ResponseError(local_var_error))
1854    }
1855}
1856
1857pub async fn get_is_premium(configuration: &configuration::Configuration, workspace: &str) -> Result<bool, Error<GetIsPremiumError>> {
1858    let local_var_configuration = configuration;
1859
1860    let local_var_client = &local_var_configuration.client;
1861
1862    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/is_premium", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1863    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1864
1865    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1866        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1867    }
1868    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1869        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1870    };
1871
1872    let local_var_req = local_var_req_builder.build()?;
1873    let local_var_resp = local_var_client.execute(local_var_req).await?;
1874
1875    let local_var_status = local_var_resp.status();
1876    let local_var_content = local_var_resp.text().await?;
1877
1878    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1879        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1880    } else {
1881        let local_var_entity: Option<GetIsPremiumError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1882        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1883        Err(Error::ResponseError(local_var_error))
1884    }
1885}
1886
1887pub async fn get_premium_info(configuration: &configuration::Configuration, workspace: &str, skip_subscription_fetch: Option<bool>) -> Result<models::GetPremiumInfo200Response, Error<GetPremiumInfoError>> {
1888    let local_var_configuration = configuration;
1889
1890    let local_var_client = &local_var_configuration.client;
1891
1892    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/premium_info", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1893    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1894
1895    if let Some(ref local_var_str) = skip_subscription_fetch {
1896        local_var_req_builder = local_var_req_builder.query(&[("skip_subscription_fetch", &local_var_str.to_string())]);
1897    }
1898    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1899        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1900    }
1901    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1902        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1903    };
1904
1905    let local_var_req = local_var_req_builder.build()?;
1906    let local_var_resp = local_var_client.execute(local_var_req).await?;
1907
1908    let local_var_status = local_var_resp.status();
1909    let local_var_content = local_var_resp.text().await?;
1910
1911    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1912        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1913    } else {
1914        let local_var_entity: Option<GetPremiumInfoError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1915        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1916        Err(Error::ResponseError(local_var_error))
1917    }
1918}
1919
1920pub async fn get_settings(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetSettings200Response, Error<GetSettingsError>> {
1921    let local_var_configuration = configuration;
1922
1923    let local_var_client = &local_var_configuration.client;
1924
1925    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_settings", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1926    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1927
1928    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1929        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1930    }
1931    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1932        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1933    };
1934
1935    let local_var_req = local_var_req_builder.build()?;
1936    let local_var_resp = local_var_client.execute(local_var_req).await?;
1937
1938    let local_var_status = local_var_resp.status();
1939    let local_var_content = local_var_resp.text().await?;
1940
1941    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1942        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1943    } else {
1944        let local_var_entity: Option<GetSettingsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1945        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1946        Err(Error::ResponseError(local_var_error))
1947    }
1948}
1949
1950pub async fn get_threshold_alert(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetThresholdAlert200Response, Error<GetThresholdAlertError>> {
1951    let local_var_configuration = configuration;
1952
1953    let local_var_client = &local_var_configuration.client;
1954
1955    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/threshold_alert", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1956    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1957
1958    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1959        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1960    }
1961    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1962        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1963    };
1964
1965    let local_var_req = local_var_req_builder.build()?;
1966    let local_var_resp = local_var_client.execute(local_var_req).await?;
1967
1968    let local_var_status = local_var_resp.status();
1969    let local_var_content = local_var_resp.text().await?;
1970
1971    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1972        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1973    } else {
1974        let local_var_entity: Option<GetThresholdAlertError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1975        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1976        Err(Error::ResponseError(local_var_error))
1977    }
1978}
1979
1980pub async fn get_used_triggers(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetUsedTriggers200Response, Error<GetUsedTriggersError>> {
1981    let local_var_configuration = configuration;
1982
1983    let local_var_client = &local_var_configuration.client;
1984
1985    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/used_triggers", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1986    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1987
1988    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1989        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1990    }
1991    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1992        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1993    };
1994
1995    let local_var_req = local_var_req_builder.build()?;
1996    let local_var_resp = local_var_client.execute(local_var_req).await?;
1997
1998    let local_var_status = local_var_resp.status();
1999    let local_var_content = local_var_resp.text().await?;
2000
2001    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2002        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2003    } else {
2004        let local_var_entity: Option<GetUsedTriggersError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2005        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2006        Err(Error::ResponseError(local_var_error))
2007    }
2008}
2009
2010pub async fn get_workspace_as_super_admin(configuration: &configuration::Configuration, workspace: &str) -> Result<models::Workspace, Error<GetWorkspaceAsSuperAdminError>> {
2011    let local_var_configuration = configuration;
2012
2013    let local_var_client = &local_var_configuration.client;
2014
2015    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_as_superadmin", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2016    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2017
2018    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2019        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2020    }
2021    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2022        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2023    };
2024
2025    let local_var_req = local_var_req_builder.build()?;
2026    let local_var_resp = local_var_client.execute(local_var_req).await?;
2027
2028    let local_var_status = local_var_resp.status();
2029    let local_var_content = local_var_resp.text().await?;
2030
2031    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2032        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2033    } else {
2034        let local_var_entity: Option<GetWorkspaceAsSuperAdminError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2035        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2036        Err(Error::ResponseError(local_var_error))
2037    }
2038}
2039
2040pub async fn get_workspace_default_app(configuration: &configuration::Configuration, workspace: &str) -> Result<models::EditWorkspaceDefaultAppRequest, Error<GetWorkspaceDefaultAppError>> {
2041    let local_var_configuration = configuration;
2042
2043    let local_var_client = &local_var_configuration.client;
2044
2045    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/default_app", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2046    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2047
2048    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2049        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2050    }
2051    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2052        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2053    };
2054
2055    let local_var_req = local_var_req_builder.build()?;
2056    let local_var_resp = local_var_client.execute(local_var_req).await?;
2057
2058    let local_var_status = local_var_resp.status();
2059    let local_var_content = local_var_resp.text().await?;
2060
2061    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2062        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2063    } else {
2064        let local_var_entity: Option<GetWorkspaceDefaultAppError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2065        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2066        Err(Error::ResponseError(local_var_error))
2067    }
2068}
2069
2070pub async fn get_workspace_encryption_key(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetWorkspaceEncryptionKey200Response, Error<GetWorkspaceEncryptionKeyError>> {
2071    let local_var_configuration = configuration;
2072
2073    let local_var_client = &local_var_configuration.client;
2074
2075    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/encryption_key", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2076    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2077
2078    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2079        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2080    }
2081    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2082        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2083    };
2084
2085    let local_var_req = local_var_req_builder.build()?;
2086    let local_var_resp = local_var_client.execute(local_var_req).await?;
2087
2088    let local_var_status = local_var_resp.status();
2089    let local_var_content = local_var_resp.text().await?;
2090
2091    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2092        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2093    } else {
2094        let local_var_entity: Option<GetWorkspaceEncryptionKeyError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2095        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2096        Err(Error::ResponseError(local_var_error))
2097    }
2098}
2099
2100pub async fn get_workspace_name(configuration: &configuration::Configuration, workspace: &str) -> Result<String, Error<GetWorkspaceNameError>> {
2101    let local_var_configuration = configuration;
2102
2103    let local_var_client = &local_var_configuration.client;
2104
2105    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_workspace_name", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2106    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2107
2108    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2109        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2110    }
2111    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2112        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2113    };
2114
2115    let local_var_req = local_var_req_builder.build()?;
2116    let local_var_resp = local_var_client.execute(local_var_req).await?;
2117
2118    let local_var_status = local_var_resp.status();
2119    let local_var_content = local_var_resp.text().await?;
2120
2121    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2122        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2123    } else {
2124        let local_var_entity: Option<GetWorkspaceNameError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2125        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2126        Err(Error::ResponseError(local_var_error))
2127    }
2128}
2129
2130pub async fn get_workspace_slack_oauth_config(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetWorkspaceSlackOauthConfig200Response, Error<GetWorkspaceSlackOauthConfigError>> {
2131    let local_var_configuration = configuration;
2132
2133    let local_var_client = &local_var_configuration.client;
2134
2135    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/slack_oauth_config", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2136    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2137
2138    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2139        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2140    }
2141    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2142        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2143    };
2144
2145    let local_var_req = local_var_req_builder.build()?;
2146    let local_var_resp = local_var_client.execute(local_var_req).await?;
2147
2148    let local_var_status = local_var_resp.status();
2149    let local_var_content = local_var_resp.text().await?;
2150
2151    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2152        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2153    } else {
2154        let local_var_entity: Option<GetWorkspaceSlackOauthConfigError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2155        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2156        Err(Error::ResponseError(local_var_error))
2157    }
2158}
2159
2160pub async fn get_workspace_usage(configuration: &configuration::Configuration, workspace: &str) -> Result<f64, Error<GetWorkspaceUsageError>> {
2161    let local_var_configuration = configuration;
2162
2163    let local_var_client = &local_var_configuration.client;
2164
2165    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/usage", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2166    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2167
2168    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2169        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2170    }
2171    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2172        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2173    };
2174
2175    let local_var_req = local_var_req_builder.build()?;
2176    let local_var_resp = local_var_client.execute(local_var_req).await?;
2177
2178    let local_var_status = local_var_resp.status();
2179    let local_var_content = local_var_resp.text().await?;
2180
2181    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2182        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2183    } else {
2184        let local_var_entity: Option<GetWorkspaceUsageError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2185        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2186        Err(Error::ResponseError(local_var_error))
2187    }
2188}
2189
2190pub async fn invite_user(configuration: &configuration::Configuration, workspace: &str, invite_user_request: models::InviteUserRequest) -> Result<String, Error<InviteUserError>> {
2191    let local_var_configuration = configuration;
2192
2193    let local_var_client = &local_var_configuration.client;
2194
2195    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/invite_user", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2196    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2197
2198    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2199        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2200    }
2201    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2202        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2203    };
2204    local_var_req_builder = local_var_req_builder.json(&invite_user_request);
2205
2206    let local_var_req = local_var_req_builder.build()?;
2207    let local_var_resp = local_var_client.execute(local_var_req).await?;
2208
2209    let local_var_status = local_var_resp.status();
2210    let local_var_content = local_var_resp.text().await?;
2211
2212    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2213        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2214    } else {
2215        let local_var_entity: Option<InviteUserError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2216        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2217        Err(Error::ResponseError(local_var_error))
2218    }
2219}
2220
2221pub async fn is_domain_allowed(configuration: &configuration::Configuration, ) -> Result<bool, Error<IsDomainAllowedError>> {
2222    let local_var_configuration = configuration;
2223
2224    let local_var_client = &local_var_configuration.client;
2225
2226    let local_var_uri_str = format!("{}/workspaces/allowed_domain_auto_invite", local_var_configuration.base_path);
2227    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2228
2229    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2230        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2231    }
2232    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2233        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2234    };
2235
2236    let local_var_req = local_var_req_builder.build()?;
2237    let local_var_resp = local_var_client.execute(local_var_req).await?;
2238
2239    let local_var_status = local_var_resp.status();
2240    let local_var_content = local_var_resp.text().await?;
2241
2242    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2243        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2244    } else {
2245        let local_var_entity: Option<IsDomainAllowedError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2246        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2247        Err(Error::ResponseError(local_var_error))
2248    }
2249}
2250
2251pub async fn leave_workspace(configuration: &configuration::Configuration, workspace: &str) -> Result<String, Error<LeaveWorkspaceError>> {
2252    let local_var_configuration = configuration;
2253
2254    let local_var_client = &local_var_configuration.client;
2255
2256    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/leave", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2257    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2258
2259    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2260        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2261    }
2262    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2263        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2264    };
2265
2266    let local_var_req = local_var_req_builder.build()?;
2267    let local_var_resp = local_var_client.execute(local_var_req).await?;
2268
2269    let local_var_status = local_var_resp.status();
2270    let local_var_content = local_var_resp.text().await?;
2271
2272    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2273        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2274    } else {
2275        let local_var_entity: Option<LeaveWorkspaceError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2276        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2277        Err(Error::ResponseError(local_var_error))
2278    }
2279}
2280
2281pub async fn list_available_teams_channels(configuration: &configuration::Configuration, workspace: &str, team_id: &str) -> Result<models::ListAvailableTeamsChannels200Response, Error<ListAvailableTeamsChannelsError>> {
2282    let local_var_configuration = configuration;
2283
2284    let local_var_client = &local_var_configuration.client;
2285
2286    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/available_teams_channels", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2287    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2288
2289    local_var_req_builder = local_var_req_builder.query(&[("team_id", &team_id.to_string())]);
2290    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2291        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2292    }
2293    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2294        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2295    };
2296
2297    let local_var_req = local_var_req_builder.build()?;
2298    let local_var_resp = local_var_client.execute(local_var_req).await?;
2299
2300    let local_var_status = local_var_resp.status();
2301    let local_var_content = local_var_resp.text().await?;
2302
2303    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2304        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2305    } else {
2306        let local_var_entity: Option<ListAvailableTeamsChannelsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2307        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2308        Err(Error::ResponseError(local_var_error))
2309    }
2310}
2311
2312pub async fn list_available_teams_ids(configuration: &configuration::Configuration, workspace: &str, search: Option<&str>, next_link: Option<&str>) -> Result<models::ListAvailableTeamsIds200Response, Error<ListAvailableTeamsIdsError>> {
2313    let local_var_configuration = configuration;
2314
2315    let local_var_client = &local_var_configuration.client;
2316
2317    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/available_teams_ids", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2318    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2319
2320    if let Some(ref local_var_str) = search {
2321        local_var_req_builder = local_var_req_builder.query(&[("search", &local_var_str.to_string())]);
2322    }
2323    if let Some(ref local_var_str) = next_link {
2324        local_var_req_builder = local_var_req_builder.query(&[("next_link", &local_var_str.to_string())]);
2325    }
2326    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2327        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2328    }
2329    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2330        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2331    };
2332
2333    let local_var_req = local_var_req_builder.build()?;
2334    let local_var_resp = local_var_client.execute(local_var_req).await?;
2335
2336    let local_var_status = local_var_resp.status();
2337    let local_var_content = local_var_resp.text().await?;
2338
2339    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2340        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2341    } else {
2342        let local_var_entity: Option<ListAvailableTeamsIdsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2343        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2344        Err(Error::ResponseError(local_var_error))
2345    }
2346}
2347
2348pub async fn list_data_table_schemas(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<models::DataTableSchema>, Error<ListDataTableSchemasError>> {
2349    let local_var_configuration = configuration;
2350
2351    let local_var_client = &local_var_configuration.client;
2352
2353    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/list_datatable_schemas", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2354    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2355
2356    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2357        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2358    }
2359    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2360        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2361    };
2362
2363    let local_var_req = local_var_req_builder.build()?;
2364    let local_var_resp = local_var_client.execute(local_var_req).await?;
2365
2366    let local_var_status = local_var_resp.status();
2367    let local_var_content = local_var_resp.text().await?;
2368
2369    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2370        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2371    } else {
2372        let local_var_entity: Option<ListDataTableSchemasError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2373        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2374        Err(Error::ResponseError(local_var_error))
2375    }
2376}
2377
2378pub async fn list_data_tables(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<String>, Error<ListDataTablesError>> {
2379    let local_var_configuration = configuration;
2380
2381    let local_var_client = &local_var_configuration.client;
2382
2383    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/list_datatables", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2384    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2385
2386    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2387        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2388    }
2389    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2390        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2391    };
2392
2393    let local_var_req = local_var_req_builder.build()?;
2394    let local_var_resp = local_var_client.execute(local_var_req).await?;
2395
2396    let local_var_status = local_var_resp.status();
2397    let local_var_content = local_var_resp.text().await?;
2398
2399    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2400        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2401    } else {
2402        let local_var_entity: Option<ListDataTablesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2403        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2404        Err(Error::ResponseError(local_var_error))
2405    }
2406}
2407
2408pub async fn list_ducklakes(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<String>, Error<ListDucklakesError>> {
2409    let local_var_configuration = configuration;
2410
2411    let local_var_client = &local_var_configuration.client;
2412
2413    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/list_ducklakes", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2414    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2415
2416    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2417        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2418    }
2419    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2420        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2421    };
2422
2423    let local_var_req = local_var_req_builder.build()?;
2424    let local_var_resp = local_var_client.execute(local_var_req).await?;
2425
2426    let local_var_status = local_var_resp.status();
2427    let local_var_content = local_var_resp.text().await?;
2428
2429    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2430        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2431    } else {
2432        let local_var_entity: Option<ListDucklakesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2433        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2434        Err(Error::ResponseError(local_var_error))
2435    }
2436}
2437
2438pub async fn list_pending_invites(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<models::WorkspaceInvite>, Error<ListPendingInvitesError>> {
2439    let local_var_configuration = configuration;
2440
2441    let local_var_client = &local_var_configuration.client;
2442
2443    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/list_pending_invites", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2444    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2445
2446    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2447        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2448    }
2449    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2450        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2451    };
2452
2453    let local_var_req = local_var_req_builder.build()?;
2454    let local_var_resp = local_var_client.execute(local_var_req).await?;
2455
2456    let local_var_status = local_var_resp.status();
2457    let local_var_content = local_var_resp.text().await?;
2458
2459    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2460        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2461    } else {
2462        let local_var_entity: Option<ListPendingInvitesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2463        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2464        Err(Error::ResponseError(local_var_error))
2465    }
2466}
2467
2468pub async fn list_protection_rules(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<models::ProtectionRuleset>, Error<ListProtectionRulesError>> {
2469    let local_var_configuration = configuration;
2470
2471    let local_var_client = &local_var_configuration.client;
2472
2473    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/protection_rules", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2474    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2475
2476    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2477        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2478    }
2479    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2480        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2481    };
2482
2483    let local_var_req = local_var_req_builder.build()?;
2484    let local_var_resp = local_var_client.execute(local_var_req).await?;
2485
2486    let local_var_status = local_var_resp.status();
2487    let local_var_content = local_var_resp.text().await?;
2488
2489    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2490        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2491    } else {
2492        let local_var_entity: Option<ListProtectionRulesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2493        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2494        Err(Error::ResponseError(local_var_error))
2495    }
2496}
2497
2498pub async fn list_user_workspaces(configuration: &configuration::Configuration, ) -> Result<models::UserWorkspaceList, Error<ListUserWorkspacesError>> {
2499    let local_var_configuration = configuration;
2500
2501    let local_var_client = &local_var_configuration.client;
2502
2503    let local_var_uri_str = format!("{}/workspaces/users", local_var_configuration.base_path);
2504    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2505
2506    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2507        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2508    }
2509    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2510        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2511    };
2512
2513    let local_var_req = local_var_req_builder.build()?;
2514    let local_var_resp = local_var_client.execute(local_var_req).await?;
2515
2516    let local_var_status = local_var_resp.status();
2517    let local_var_content = local_var_resp.text().await?;
2518
2519    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2520        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2521    } else {
2522        let local_var_entity: Option<ListUserWorkspacesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2523        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2524        Err(Error::ResponseError(local_var_error))
2525    }
2526}
2527
2528pub async fn list_workspaces(configuration: &configuration::Configuration, ) -> Result<Vec<models::Workspace>, Error<ListWorkspacesError>> {
2529    let local_var_configuration = configuration;
2530
2531    let local_var_client = &local_var_configuration.client;
2532
2533    let local_var_uri_str = format!("{}/workspaces/list", local_var_configuration.base_path);
2534    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2535
2536    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2537        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2538    }
2539    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2540        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2541    };
2542
2543    let local_var_req = local_var_req_builder.build()?;
2544    let local_var_resp = local_var_client.execute(local_var_req).await?;
2545
2546    let local_var_status = local_var_resp.status();
2547    let local_var_content = local_var_resp.text().await?;
2548
2549    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2550        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2551    } else {
2552        let local_var_entity: Option<ListWorkspacesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2553        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2554        Err(Error::ResponseError(local_var_error))
2555    }
2556}
2557
2558pub async fn list_workspaces_as_super_admin(configuration: &configuration::Configuration, page: Option<i32>, per_page: Option<i32>) -> Result<Vec<models::Workspace>, Error<ListWorkspacesAsSuperAdminError>> {
2559    let local_var_configuration = configuration;
2560
2561    let local_var_client = &local_var_configuration.client;
2562
2563    let local_var_uri_str = format!("{}/workspaces/list_as_superadmin", local_var_configuration.base_path);
2564    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2565
2566    if let Some(ref local_var_str) = page {
2567        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
2568    }
2569    if let Some(ref local_var_str) = per_page {
2570        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
2571    }
2572    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2573        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2574    }
2575    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2576        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2577    };
2578
2579    let local_var_req = local_var_req_builder.build()?;
2580    let local_var_resp = local_var_client.execute(local_var_req).await?;
2581
2582    let local_var_status = local_var_resp.status();
2583    let local_var_content = local_var_resp.text().await?;
2584
2585    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2586        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2587    } else {
2588        let local_var_entity: Option<ListWorkspacesAsSuperAdminError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2589        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2590        Err(Error::ResponseError(local_var_error))
2591    }
2592}
2593
2594pub async fn rebuild_dependency_map(configuration: &configuration::Configuration, workspace: &str) -> Result<String, Error<RebuildDependencyMapError>> {
2595    let local_var_configuration = configuration;
2596
2597    let local_var_client = &local_var_configuration.client;
2598
2599    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/rebuild_dependency_map", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2600    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2601
2602    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2603        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2604    }
2605    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2606        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2607    };
2608
2609    let local_var_req = local_var_req_builder.build()?;
2610    let local_var_resp = local_var_client.execute(local_var_req).await?;
2611
2612    let local_var_status = local_var_resp.status();
2613    let local_var_content = local_var_resp.text().await?;
2614
2615    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2616        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2617    } else {
2618        let local_var_entity: Option<RebuildDependencyMapError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2619        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2620        Err(Error::ResponseError(local_var_error))
2621    }
2622}
2623
2624/// This endpoint should be called after a fork deployement
2625pub async fn reset_diff_tally(configuration: &configuration::Configuration, workspace: &str, fork_workspace_id: &str) -> Result<serde_json::Value, Error<ResetDiffTallyError>> {
2626    let local_var_configuration = configuration;
2627
2628    let local_var_client = &local_var_configuration.client;
2629
2630    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/reset_diff_tally/{fork_workspace_id}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), fork_workspace_id=crate::apis::urlencode(fork_workspace_id));
2631    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2632
2633    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2634        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2635    }
2636    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2637        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2638    };
2639
2640    let local_var_req = local_var_req_builder.build()?;
2641    let local_var_resp = local_var_client.execute(local_var_req).await?;
2642
2643    let local_var_status = local_var_resp.status();
2644    let local_var_content = local_var_resp.text().await?;
2645
2646    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2647        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2648    } else {
2649        let local_var_entity: Option<ResetDiffTallyError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2650        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2651        Err(Error::ResponseError(local_var_error))
2652    }
2653}
2654
2655pub 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>> {
2656    let local_var_configuration = configuration;
2657
2658    let local_var_client = &local_var_configuration.client;
2659
2660    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/run_slack_message_test_job", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2661    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2662
2663    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2664        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2665    }
2666    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2667        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2668    };
2669    local_var_req_builder = local_var_req_builder.json(&run_slack_message_test_job_request);
2670
2671    let local_var_req = local_var_req_builder.build()?;
2672    let local_var_resp = local_var_client.execute(local_var_req).await?;
2673
2674    let local_var_status = local_var_resp.status();
2675    let local_var_content = local_var_resp.text().await?;
2676
2677    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2678        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2679    } else {
2680        let local_var_entity: Option<RunSlackMessageTestJobError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2681        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2682        Err(Error::ResponseError(local_var_error))
2683    }
2684}
2685
2686pub 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>> {
2687    let local_var_configuration = configuration;
2688
2689    let local_var_client = &local_var_configuration.client;
2690
2691    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/run_teams_message_test_job", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2692    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2693
2694    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2695        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2696    }
2697    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2698        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2699    };
2700    local_var_req_builder = local_var_req_builder.json(&run_slack_message_test_job_request);
2701
2702    let local_var_req = local_var_req_builder.build()?;
2703    let local_var_resp = local_var_client.execute(local_var_req).await?;
2704
2705    let local_var_status = local_var_resp.status();
2706    let local_var_content = local_var_resp.text().await?;
2707
2708    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2709        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2710    } else {
2711        let local_var_entity: Option<RunTeamsMessageTestJobError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2712        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2713        Err(Error::ResponseError(local_var_error))
2714    }
2715}
2716
2717pub async fn set_environment_variable(configuration: &configuration::Configuration, workspace: &str, set_environment_variable_request: models::SetEnvironmentVariableRequest) -> Result<String, Error<SetEnvironmentVariableError>> {
2718    let local_var_configuration = configuration;
2719
2720    let local_var_client = &local_var_configuration.client;
2721
2722    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/set_environment_variable", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2723    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2724
2725    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2726        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2727    }
2728    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2729        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2730    };
2731    local_var_req_builder = local_var_req_builder.json(&set_environment_variable_request);
2732
2733    let local_var_req = local_var_req_builder.build()?;
2734    let local_var_resp = local_var_client.execute(local_var_req).await?;
2735
2736    let local_var_status = local_var_resp.status();
2737    let local_var_content = local_var_resp.text().await?;
2738
2739    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2740        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2741    } else {
2742        let local_var_entity: Option<SetEnvironmentVariableError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2743        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2744        Err(Error::ResponseError(local_var_error))
2745    }
2746}
2747
2748pub async fn set_threshold_alert(configuration: &configuration::Configuration, workspace: &str, set_threshold_alert_request: models::SetThresholdAlertRequest) -> Result<String, Error<SetThresholdAlertError>> {
2749    let local_var_configuration = configuration;
2750
2751    let local_var_client = &local_var_configuration.client;
2752
2753    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/threshold_alert", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2754    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2755
2756    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2757        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2758    }
2759    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2760        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2761    };
2762    local_var_req_builder = local_var_req_builder.json(&set_threshold_alert_request);
2763
2764    let local_var_req = local_var_req_builder.build()?;
2765    let local_var_resp = local_var_client.execute(local_var_req).await?;
2766
2767    let local_var_status = local_var_resp.status();
2768    let local_var_content = local_var_resp.text().await?;
2769
2770    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2771        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2772    } else {
2773        let local_var_entity: Option<SetThresholdAlertError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2774        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2775        Err(Error::ResponseError(local_var_error))
2776    }
2777}
2778
2779pub async fn set_workspace_encryption_key(configuration: &configuration::Configuration, workspace: &str, set_workspace_encryption_key_request: models::SetWorkspaceEncryptionKeyRequest) -> Result<String, Error<SetWorkspaceEncryptionKeyError>> {
2780    let local_var_configuration = configuration;
2781
2782    let local_var_client = &local_var_configuration.client;
2783
2784    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/encryption_key", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2785    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2786
2787    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2788        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2789    }
2790    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2791        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2792    };
2793    local_var_req_builder = local_var_req_builder.json(&set_workspace_encryption_key_request);
2794
2795    let local_var_req = local_var_req_builder.build()?;
2796    let local_var_resp = local_var_client.execute(local_var_req).await?;
2797
2798    let local_var_status = local_var_resp.status();
2799    let local_var_content = local_var_resp.text().await?;
2800
2801    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2802        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2803    } else {
2804        let local_var_entity: Option<SetWorkspaceEncryptionKeyError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2805        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2806        Err(Error::ResponseError(local_var_error))
2807    }
2808}
2809
2810pub async fn set_workspace_slack_oauth_config(configuration: &configuration::Configuration, workspace: &str, set_workspace_slack_oauth_config_request: models::SetWorkspaceSlackOauthConfigRequest) -> Result<String, Error<SetWorkspaceSlackOauthConfigError>> {
2811    let local_var_configuration = configuration;
2812
2813    let local_var_client = &local_var_configuration.client;
2814
2815    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/slack_oauth_config", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2816    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2817
2818    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2819        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2820    }
2821    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2822        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2823    };
2824    local_var_req_builder = local_var_req_builder.json(&set_workspace_slack_oauth_config_request);
2825
2826    let local_var_req = local_var_req_builder.build()?;
2827    let local_var_resp = local_var_client.execute(local_var_req).await?;
2828
2829    let local_var_status = local_var_resp.status();
2830    let local_var_content = local_var_resp.text().await?;
2831
2832    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2833        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2834    } else {
2835        let local_var_entity: Option<SetWorkspaceSlackOauthConfigError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2836        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2837        Err(Error::ResponseError(local_var_error))
2838    }
2839}
2840
2841pub async fn unarchive_workspace(configuration: &configuration::Configuration, workspace: &str) -> Result<String, Error<UnarchiveWorkspaceError>> {
2842    let local_var_configuration = configuration;
2843
2844    let local_var_client = &local_var_configuration.client;
2845
2846    let local_var_uri_str = format!("{}/workspaces/unarchive/{workspace}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2847    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2848
2849    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2850        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2851    }
2852    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2853        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2854    };
2855
2856    let local_var_req = local_var_req_builder.build()?;
2857    let local_var_resp = local_var_client.execute(local_var_req).await?;
2858
2859    let local_var_status = local_var_resp.status();
2860    let local_var_content = local_var_resp.text().await?;
2861
2862    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2863        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2864    } else {
2865        let local_var_entity: Option<UnarchiveWorkspaceError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2866        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2867        Err(Error::ResponseError(local_var_error))
2868    }
2869}
2870
2871/// Updates the operator settings for a specific workspace. Requires workspace admin privileges.
2872pub async fn update_operator_settings(configuration: &configuration::Configuration, workspace: &str, operator_settings: Option<models::OperatorSettings>) -> Result<String, Error<UpdateOperatorSettingsError>> {
2873    let local_var_configuration = configuration;
2874
2875    let local_var_client = &local_var_configuration.client;
2876
2877    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/operator_settings", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2878    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2879
2880    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2881        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2882    }
2883    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2884        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2885    };
2886    local_var_req_builder = local_var_req_builder.json(&operator_settings);
2887
2888    let local_var_req = local_var_req_builder.build()?;
2889    let local_var_resp = local_var_client.execute(local_var_req).await?;
2890
2891    let local_var_status = local_var_resp.status();
2892    let local_var_content = local_var_resp.text().await?;
2893
2894    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2895        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2896    } else {
2897        let local_var_entity: Option<UpdateOperatorSettingsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2898        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2899        Err(Error::ResponseError(local_var_error))
2900    }
2901}
2902
2903pub async fn update_protection_rule(configuration: &configuration::Configuration, workspace: &str, rule_name: &str, update_protection_rule_request: models::UpdateProtectionRuleRequest) -> Result<String, Error<UpdateProtectionRuleError>> {
2904    let local_var_configuration = configuration;
2905
2906    let local_var_client = &local_var_configuration.client;
2907
2908    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/protection_rules/{rule_name}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), rule_name=crate::apis::urlencode(rule_name));
2909    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2910
2911    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2912        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2913    }
2914    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2915        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2916    };
2917    local_var_req_builder = local_var_req_builder.json(&update_protection_rule_request);
2918
2919    let local_var_req = local_var_req_builder.build()?;
2920    let local_var_resp = local_var_client.execute(local_var_req).await?;
2921
2922    let local_var_status = local_var_resp.status();
2923    let local_var_content = local_var_resp.text().await?;
2924
2925    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2926        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2927    } else {
2928        let local_var_entity: Option<UpdateProtectionRuleError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2929        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2930        Err(Error::ResponseError(local_var_error))
2931    }
2932}
2933