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