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