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.817.0
7 * Contact: contact@windmill.dev
8 * Generated by: https://openapi-generator.tech
9 */
10
11
12use reqwest;
13use serde::{Deserialize, Serialize};
14use crate::{apis::ResponseContent, models};
15use super::{Error, configuration};
16
17
18/// struct for typed errors of method [`add_user`]
19#[derive(Debug, Clone, Serialize, Deserialize)]
20#[serde(untagged)]
21pub enum AddUserError {
22    UnknownValue(serde_json::Value),
23}
24
25/// struct for typed errors of method [`apply_datatable_acl`]
26#[derive(Debug, Clone, Serialize, Deserialize)]
27#[serde(untagged)]
28pub enum ApplyDatatableAclError {
29    UnknownValue(serde_json::Value),
30}
31
32/// struct for typed errors of method [`archive_workspace`]
33#[derive(Debug, Clone, Serialize, Deserialize)]
34#[serde(untagged)]
35pub enum ArchiveWorkspaceError {
36    UnknownValue(serde_json::Value),
37}
38
39/// struct for typed errors of method [`attach_dev_workspace`]
40#[derive(Debug, Clone, Serialize, Deserialize)]
41#[serde(untagged)]
42pub enum AttachDevWorkspaceError {
43    UnknownValue(serde_json::Value),
44}
45
46/// struct for typed errors of method [`cancel_deployment_request`]
47#[derive(Debug, Clone, Serialize, Deserialize)]
48#[serde(untagged)]
49pub enum CancelDeploymentRequestError {
50    UnknownValue(serde_json::Value),
51}
52
53/// struct for typed errors of method [`change_workspace_color`]
54#[derive(Debug, Clone, Serialize, Deserialize)]
55#[serde(untagged)]
56pub enum ChangeWorkspaceColorError {
57    UnknownValue(serde_json::Value),
58}
59
60/// struct for typed errors of method [`change_workspace_id`]
61#[derive(Debug, Clone, Serialize, Deserialize)]
62#[serde(untagged)]
63pub enum ChangeWorkspaceIdError {
64    UnknownValue(serde_json::Value),
65}
66
67/// struct for typed errors of method [`change_workspace_name`]
68#[derive(Debug, Clone, Serialize, Deserialize)]
69#[serde(untagged)]
70pub enum ChangeWorkspaceNameError {
71    UnknownValue(serde_json::Value),
72}
73
74/// struct for typed errors of method [`close_deployment_request_merged`]
75#[derive(Debug, Clone, Serialize, Deserialize)]
76#[serde(untagged)]
77pub enum CloseDeploymentRequestMergedError {
78    UnknownValue(serde_json::Value),
79}
80
81/// struct for typed errors of method [`compare_workspaces`]
82#[derive(Debug, Clone, Serialize, Deserialize)]
83#[serde(untagged)]
84pub enum CompareWorkspacesError {
85    UnknownValue(serde_json::Value),
86}
87
88/// struct for typed errors of method [`connect_remote_deploy`]
89#[derive(Debug, Clone, Serialize, Deserialize)]
90#[serde(untagged)]
91pub enum ConnectRemoteDeployError {
92    UnknownValue(serde_json::Value),
93}
94
95/// struct for typed errors of method [`connect_slack`]
96#[derive(Debug, Clone, Serialize, Deserialize)]
97#[serde(untagged)]
98pub enum ConnectSlackError {
99    UnknownValue(serde_json::Value),
100}
101
102/// struct for typed errors of method [`connect_teams`]
103#[derive(Debug, Clone, Serialize, Deserialize)]
104#[serde(untagged)]
105pub enum ConnectTeamsError {
106    UnknownValue(serde_json::Value),
107}
108
109/// struct for typed errors of method [`create_datatable_migration`]
110#[derive(Debug, Clone, Serialize, Deserialize)]
111#[serde(untagged)]
112pub enum CreateDatatableMigrationError {
113    UnknownValue(serde_json::Value),
114}
115
116/// struct for typed errors of method [`create_deployment_request`]
117#[derive(Debug, Clone, Serialize, Deserialize)]
118#[serde(untagged)]
119pub enum CreateDeploymentRequestError {
120    Status400(),
121    Status409(),
122    UnknownValue(serde_json::Value),
123}
124
125/// struct for typed errors of method [`create_deployment_request_comment`]
126#[derive(Debug, Clone, Serialize, Deserialize)]
127#[serde(untagged)]
128pub enum CreateDeploymentRequestCommentError {
129    Status400(),
130    UnknownValue(serde_json::Value),
131}
132
133/// struct for typed errors of method [`create_pg_database`]
134#[derive(Debug, Clone, Serialize, Deserialize)]
135#[serde(untagged)]
136pub enum CreatePgDatabaseError {
137    UnknownValue(serde_json::Value),
138}
139
140/// struct for typed errors of method [`create_protection_rule`]
141#[derive(Debug, Clone, Serialize, Deserialize)]
142#[serde(untagged)]
143pub enum CreateProtectionRuleError {
144    Status400(),
145    UnknownValue(serde_json::Value),
146}
147
148/// struct for typed errors of method [`create_service_account`]
149#[derive(Debug, Clone, Serialize, Deserialize)]
150#[serde(untagged)]
151pub enum CreateServiceAccountError {
152    UnknownValue(serde_json::Value),
153}
154
155/// struct for typed errors of method [`create_workspace`]
156#[derive(Debug, Clone, Serialize, Deserialize)]
157#[serde(untagged)]
158pub enum CreateWorkspaceError {
159    UnknownValue(serde_json::Value),
160}
161
162/// struct for typed errors of method [`create_workspace_fork`]
163#[derive(Debug, Clone, Serialize, Deserialize)]
164#[serde(untagged)]
165pub enum CreateWorkspaceForkError {
166    UnknownValue(serde_json::Value),
167}
168
169/// struct for typed errors of method [`create_workspace_fork_git_branch`]
170#[derive(Debug, Clone, Serialize, Deserialize)]
171#[serde(untagged)]
172pub enum CreateWorkspaceForkGitBranchError {
173    UnknownValue(serde_json::Value),
174}
175
176/// struct for typed errors of method [`delete_datatable_migration`]
177#[derive(Debug, Clone, Serialize, Deserialize)]
178#[serde(untagged)]
179pub enum DeleteDatatableMigrationError {
180    UnknownValue(serde_json::Value),
181}
182
183/// struct for typed errors of method [`delete_git_sync_repository`]
184#[derive(Debug, Clone, Serialize, Deserialize)]
185#[serde(untagged)]
186pub enum DeleteGitSyncRepositoryError {
187    UnknownValue(serde_json::Value),
188}
189
190/// struct for typed errors of method [`delete_invite`]
191#[derive(Debug, Clone, Serialize, Deserialize)]
192#[serde(untagged)]
193pub enum DeleteInviteError {
194    UnknownValue(serde_json::Value),
195}
196
197/// struct for typed errors of method [`delete_protection_rule`]
198#[derive(Debug, Clone, Serialize, Deserialize)]
199#[serde(untagged)]
200pub enum DeleteProtectionRuleError {
201    Status404(),
202    UnknownValue(serde_json::Value),
203}
204
205/// struct for typed errors of method [`delete_workspace`]
206#[derive(Debug, Clone, Serialize, Deserialize)]
207#[serde(untagged)]
208pub enum DeleteWorkspaceError {
209    UnknownValue(serde_json::Value),
210}
211
212/// struct for typed errors of method [`delete_workspace_slack_oauth_config`]
213#[derive(Debug, Clone, Serialize, Deserialize)]
214#[serde(untagged)]
215pub enum DeleteWorkspaceSlackOauthConfigError {
216    UnknownValue(serde_json::Value),
217}
218
219/// struct for typed errors of method [`detach_dev_workspace`]
220#[derive(Debug, Clone, Serialize, Deserialize)]
221#[serde(untagged)]
222pub enum DetachDevWorkspaceError {
223    UnknownValue(serde_json::Value),
224}
225
226/// struct for typed errors of method [`disable_datatable_migrations`]
227#[derive(Debug, Clone, Serialize, Deserialize)]
228#[serde(untagged)]
229pub enum DisableDatatableMigrationsError {
230    UnknownValue(serde_json::Value),
231}
232
233/// struct for typed errors of method [`disconnect_remote_deploy`]
234#[derive(Debug, Clone, Serialize, Deserialize)]
235#[serde(untagged)]
236pub enum DisconnectRemoteDeployError {
237    UnknownValue(serde_json::Value),
238}
239
240/// struct for typed errors of method [`drop_forked_datatable_databases`]
241#[derive(Debug, Clone, Serialize, Deserialize)]
242#[serde(untagged)]
243pub enum DropForkedDatatableDatabasesError {
244    UnknownValue(serde_json::Value),
245}
246
247/// struct for typed errors of method [`drop_forked_ducklake_namespaces`]
248#[derive(Debug, Clone, Serialize, Deserialize)]
249#[serde(untagged)]
250pub enum DropForkedDucklakeNamespacesError {
251    UnknownValue(serde_json::Value),
252}
253
254/// struct for typed errors of method [`edit_add_admins_and_developers_to_forks`]
255#[derive(Debug, Clone, Serialize, Deserialize)]
256#[serde(untagged)]
257pub enum EditAddAdminsAndDevelopersToForksError {
258    UnknownValue(serde_json::Value),
259}
260
261/// struct for typed errors of method [`edit_auto_invite`]
262#[derive(Debug, Clone, Serialize, Deserialize)]
263#[serde(untagged)]
264pub enum EditAutoInviteError {
265    UnknownValue(serde_json::Value),
266}
267
268/// struct for typed errors of method [`edit_copilot_config`]
269#[derive(Debug, Clone, Serialize, Deserialize)]
270#[serde(untagged)]
271pub enum EditCopilotConfigError {
272    UnknownValue(serde_json::Value),
273}
274
275/// struct for typed errors of method [`edit_data_table_config`]
276#[derive(Debug, Clone, Serialize, Deserialize)]
277#[serde(untagged)]
278pub enum EditDataTableConfigError {
279    UnknownValue(serde_json::Value),
280}
281
282/// struct for typed errors of method [`edit_dbt_warehouses`]
283#[derive(Debug, Clone, Serialize, Deserialize)]
284#[serde(untagged)]
285pub enum EditDbtWarehousesError {
286    UnknownValue(serde_json::Value),
287}
288
289/// struct for typed errors of method [`edit_default_scripts`]
290#[derive(Debug, Clone, Serialize, Deserialize)]
291#[serde(untagged)]
292pub enum EditDefaultScriptsError {
293    UnknownValue(serde_json::Value),
294}
295
296/// struct for typed errors of method [`edit_ducklake_config`]
297#[derive(Debug, Clone, Serialize, Deserialize)]
298#[serde(untagged)]
299pub enum EditDucklakeConfigError {
300    UnknownValue(serde_json::Value),
301}
302
303/// struct for typed errors of method [`edit_error_handler`]
304#[derive(Debug, Clone, Serialize, Deserialize)]
305#[serde(untagged)]
306pub enum EditErrorHandlerError {
307    UnknownValue(serde_json::Value),
308}
309
310/// struct for typed errors of method [`edit_git_sync_repository`]
311#[derive(Debug, Clone, Serialize, Deserialize)]
312#[serde(untagged)]
313pub enum EditGitSyncRepositoryError {
314    UnknownValue(serde_json::Value),
315}
316
317/// struct for typed errors of method [`edit_guest_access`]
318#[derive(Debug, Clone, Serialize, Deserialize)]
319#[serde(untagged)]
320pub enum EditGuestAccessError {
321    UnknownValue(serde_json::Value),
322}
323
324/// struct for typed errors of method [`edit_guest_jwt_key`]
325#[derive(Debug, Clone, Serialize, Deserialize)]
326#[serde(untagged)]
327pub enum EditGuestJwtKeyError {
328    UnknownValue(serde_json::Value),
329}
330
331/// struct for typed errors of method [`edit_instance_groups`]
332#[derive(Debug, Clone, Serialize, Deserialize)]
333#[serde(untagged)]
334pub enum EditInstanceGroupsError {
335    UnknownValue(serde_json::Value),
336}
337
338/// struct for typed errors of method [`edit_large_file_storage_config`]
339#[derive(Debug, Clone, Serialize, Deserialize)]
340#[serde(untagged)]
341pub enum EditLargeFileStorageConfigError {
342    UnknownValue(serde_json::Value),
343}
344
345/// struct for typed errors of method [`edit_slack_command`]
346#[derive(Debug, Clone, Serialize, Deserialize)]
347#[serde(untagged)]
348pub enum EditSlackCommandError {
349    UnknownValue(serde_json::Value),
350}
351
352/// struct for typed errors of method [`edit_success_handler`]
353#[derive(Debug, Clone, Serialize, Deserialize)]
354#[serde(untagged)]
355pub enum EditSuccessHandlerError {
356    UnknownValue(serde_json::Value),
357}
358
359/// struct for typed errors of method [`edit_teams_command`]
360#[derive(Debug, Clone, Serialize, Deserialize)]
361#[serde(untagged)]
362pub enum EditTeamsCommandError {
363    UnknownValue(serde_json::Value),
364}
365
366/// struct for typed errors of method [`edit_webhook`]
367#[derive(Debug, Clone, Serialize, Deserialize)]
368#[serde(untagged)]
369pub enum EditWebhookError {
370    UnknownValue(serde_json::Value),
371}
372
373/// struct for typed errors of method [`edit_workspace_default_app`]
374#[derive(Debug, Clone, Serialize, Deserialize)]
375#[serde(untagged)]
376pub enum EditWorkspaceDefaultAppError {
377    UnknownValue(serde_json::Value),
378}
379
380/// struct for typed errors of method [`edit_workspace_deploy_ui_settings`]
381#[derive(Debug, Clone, Serialize, Deserialize)]
382#[serde(untagged)]
383pub enum EditWorkspaceDeployUiSettingsError {
384    UnknownValue(serde_json::Value),
385}
386
387/// struct for typed errors of method [`edit_workspace_git_sync_config`]
388#[derive(Debug, Clone, Serialize, Deserialize)]
389#[serde(untagged)]
390pub enum EditWorkspaceGitSyncConfigError {
391    UnknownValue(serde_json::Value),
392}
393
394/// struct for typed errors of method [`enable_datatable_migrations`]
395#[derive(Debug, Clone, Serialize, Deserialize)]
396#[serde(untagged)]
397pub enum EnableDatatableMigrationsError {
398    UnknownValue(serde_json::Value),
399}
400
401/// struct for typed errors of method [`exists_username`]
402#[derive(Debug, Clone, Serialize, Deserialize)]
403#[serde(untagged)]
404pub enum ExistsUsernameError {
405    UnknownValue(serde_json::Value),
406}
407
408/// struct for typed errors of method [`exists_workspace`]
409#[derive(Debug, Clone, Serialize, Deserialize)]
410#[serde(untagged)]
411pub enum ExistsWorkspaceError {
412    UnknownValue(serde_json::Value),
413}
414
415/// struct for typed errors of method [`export_pg_schema`]
416#[derive(Debug, Clone, Serialize, Deserialize)]
417#[serde(untagged)]
418pub enum ExportPgSchemaError {
419    UnknownValue(serde_json::Value),
420}
421
422/// struct for typed errors of method [`generate_initial_datatable_migration`]
423#[derive(Debug, Clone, Serialize, Deserialize)]
424#[serde(untagged)]
425pub enum GenerateInitialDatatableMigrationError {
426    UnknownValue(serde_json::Value),
427}
428
429/// struct for typed errors of method [`get_billable_seats`]
430#[derive(Debug, Clone, Serialize, Deserialize)]
431#[serde(untagged)]
432pub enum GetBillableSeatsError {
433    UnknownValue(serde_json::Value),
434}
435
436/// struct for typed errors of method [`get_cloud_quotas`]
437#[derive(Debug, Clone, Serialize, Deserialize)]
438#[serde(untagged)]
439pub enum GetCloudQuotasError {
440    UnknownValue(serde_json::Value),
441}
442
443/// struct for typed errors of method [`get_copilot_info`]
444#[derive(Debug, Clone, Serialize, Deserialize)]
445#[serde(untagged)]
446pub enum GetCopilotInfoError {
447    UnknownValue(serde_json::Value),
448}
449
450/// struct for typed errors of method [`get_copilot_settings_state`]
451#[derive(Debug, Clone, Serialize, Deserialize)]
452#[serde(untagged)]
453pub enum GetCopilotSettingsStateError {
454    UnknownValue(serde_json::Value),
455}
456
457/// struct for typed errors of method [`get_data_table_table_schema`]
458#[derive(Debug, Clone, Serialize, Deserialize)]
459#[serde(untagged)]
460pub enum GetDataTableTableSchemaError {
461    UnknownValue(serde_json::Value),
462}
463
464/// struct for typed errors of method [`get_datatable_acl`]
465#[derive(Debug, Clone, Serialize, Deserialize)]
466#[serde(untagged)]
467pub enum GetDatatableAclError {
468    UnknownValue(serde_json::Value),
469}
470
471/// struct for typed errors of method [`get_datatable_full_schema`]
472#[derive(Debug, Clone, Serialize, Deserialize)]
473#[serde(untagged)]
474pub enum GetDatatableFullSchemaError {
475    UnknownValue(serde_json::Value),
476}
477
478/// struct for typed errors of method [`get_datatable_migrations_status`]
479#[derive(Debug, Clone, Serialize, Deserialize)]
480#[serde(untagged)]
481pub enum GetDatatableMigrationsStatusError {
482    UnknownValue(serde_json::Value),
483}
484
485/// struct for typed errors of method [`get_datatable_permissions`]
486#[derive(Debug, Clone, Serialize, Deserialize)]
487#[serde(untagged)]
488pub enum GetDatatablePermissionsError {
489    UnknownValue(serde_json::Value),
490}
491
492/// struct for typed errors of method [`get_default_scripts`]
493#[derive(Debug, Clone, Serialize, Deserialize)]
494#[serde(untagged)]
495pub enum GetDefaultScriptsError {
496    UnknownValue(serde_json::Value),
497}
498
499/// struct for typed errors of method [`get_dependency_map`]
500#[derive(Debug, Clone, Serialize, Deserialize)]
501#[serde(untagged)]
502pub enum GetDependencyMapError {
503    UnknownValue(serde_json::Value),
504}
505
506/// struct for typed errors of method [`get_dependents`]
507#[derive(Debug, Clone, Serialize, Deserialize)]
508#[serde(untagged)]
509pub enum GetDependentsError {
510    UnknownValue(serde_json::Value),
511}
512
513/// struct for typed errors of method [`get_dependents_amounts`]
514#[derive(Debug, Clone, Serialize, Deserialize)]
515#[serde(untagged)]
516pub enum GetDependentsAmountsError {
517    UnknownValue(serde_json::Value),
518}
519
520/// struct for typed errors of method [`get_deploy_to`]
521#[derive(Debug, Clone, Serialize, Deserialize)]
522#[serde(untagged)]
523pub enum GetDeployToError {
524    UnknownValue(serde_json::Value),
525}
526
527/// struct for typed errors of method [`get_dev_workspace`]
528#[derive(Debug, Clone, Serialize, Deserialize)]
529#[serde(untagged)]
530pub enum GetDevWorkspaceError {
531    UnknownValue(serde_json::Value),
532}
533
534/// struct for typed errors of method [`get_git_sync_deploy_mode`]
535#[derive(Debug, Clone, Serialize, Deserialize)]
536#[serde(untagged)]
537pub enum GetGitSyncDeployModeError {
538    UnknownValue(serde_json::Value),
539}
540
541/// struct for typed errors of method [`get_git_sync_enabled`]
542#[derive(Debug, Clone, Serialize, Deserialize)]
543#[serde(untagged)]
544pub enum GetGitSyncEnabledError {
545    UnknownValue(serde_json::Value),
546}
547
548/// struct for typed errors of method [`get_github_app_repo_archive`]
549#[derive(Debug, Clone, Serialize, Deserialize)]
550#[serde(untagged)]
551pub enum GetGithubAppRepoArchiveError {
552    UnknownValue(serde_json::Value),
553}
554
555/// struct for typed errors of method [`get_github_app_token`]
556#[derive(Debug, Clone, Serialize, Deserialize)]
557#[serde(untagged)]
558pub enum GetGithubAppTokenError {
559    UnknownValue(serde_json::Value),
560}
561
562/// struct for typed errors of method [`get_guest_usage`]
563#[derive(Debug, Clone, Serialize, Deserialize)]
564#[serde(untagged)]
565pub enum GetGuestUsageError {
566    UnknownValue(serde_json::Value),
567}
568
569/// struct for typed errors of method [`get_imports`]
570#[derive(Debug, Clone, Serialize, Deserialize)]
571#[serde(untagged)]
572pub enum GetImportsError {
573    UnknownValue(serde_json::Value),
574}
575
576/// struct for typed errors of method [`get_is_premium`]
577#[derive(Debug, Clone, Serialize, Deserialize)]
578#[serde(untagged)]
579pub enum GetIsPremiumError {
580    UnknownValue(serde_json::Value),
581}
582
583/// struct for typed errors of method [`get_open_deployment_request`]
584#[derive(Debug, Clone, Serialize, Deserialize)]
585#[serde(untagged)]
586pub enum GetOpenDeploymentRequestError {
587    UnknownValue(serde_json::Value),
588}
589
590/// struct for typed errors of method [`get_premium_info`]
591#[derive(Debug, Clone, Serialize, Deserialize)]
592#[serde(untagged)]
593pub enum GetPremiumInfoError {
594    UnknownValue(serde_json::Value),
595}
596
597/// struct for typed errors of method [`get_public_settings`]
598#[derive(Debug, Clone, Serialize, Deserialize)]
599#[serde(untagged)]
600pub enum GetPublicSettingsError {
601    UnknownValue(serde_json::Value),
602}
603
604/// struct for typed errors of method [`get_remote_deploy_target`]
605#[derive(Debug, Clone, Serialize, Deserialize)]
606#[serde(untagged)]
607pub enum GetRemoteDeployTargetError {
608    UnknownValue(serde_json::Value),
609}
610
611/// struct for typed errors of method [`get_session_workspace_retention`]
612#[derive(Debug, Clone, Serialize, Deserialize)]
613#[serde(untagged)]
614pub enum GetSessionWorkspaceRetentionError {
615    UnknownValue(serde_json::Value),
616}
617
618/// struct for typed errors of method [`get_session_workspace_status`]
619#[derive(Debug, Clone, Serialize, Deserialize)]
620#[serde(untagged)]
621pub enum GetSessionWorkspaceStatusError {
622    UnknownValue(serde_json::Value),
623}
624
625/// struct for typed errors of method [`get_settings`]
626#[derive(Debug, Clone, Serialize, Deserialize)]
627#[serde(untagged)]
628pub enum GetSettingsError {
629    UnknownValue(serde_json::Value),
630}
631
632/// struct for typed errors of method [`get_shared_ui`]
633#[derive(Debug, Clone, Serialize, Deserialize)]
634#[serde(untagged)]
635pub enum GetSharedUiError {
636    UnknownValue(serde_json::Value),
637}
638
639/// struct for typed errors of method [`get_shared_ui_version`]
640#[derive(Debug, Clone, Serialize, Deserialize)]
641#[serde(untagged)]
642pub enum GetSharedUiVersionError {
643    UnknownValue(serde_json::Value),
644}
645
646/// struct for typed errors of method [`get_threshold_alert`]
647#[derive(Debug, Clone, Serialize, Deserialize)]
648#[serde(untagged)]
649pub enum GetThresholdAlertError {
650    UnknownValue(serde_json::Value),
651}
652
653/// struct for typed errors of method [`get_used_triggers`]
654#[derive(Debug, Clone, Serialize, Deserialize)]
655#[serde(untagged)]
656pub enum GetUsedTriggersError {
657    UnknownValue(serde_json::Value),
658}
659
660/// struct for typed errors of method [`get_workspace_as_super_admin`]
661#[derive(Debug, Clone, Serialize, Deserialize)]
662#[serde(untagged)]
663pub enum GetWorkspaceAsSuperAdminError {
664    UnknownValue(serde_json::Value),
665}
666
667/// struct for typed errors of method [`get_workspace_default_app`]
668#[derive(Debug, Clone, Serialize, Deserialize)]
669#[serde(untagged)]
670pub enum GetWorkspaceDefaultAppError {
671    UnknownValue(serde_json::Value),
672}
673
674/// struct for typed errors of method [`get_workspace_encryption_key`]
675#[derive(Debug, Clone, Serialize, Deserialize)]
676#[serde(untagged)]
677pub enum GetWorkspaceEncryptionKeyError {
678    UnknownValue(serde_json::Value),
679}
680
681/// struct for typed errors of method [`get_workspace_name`]
682#[derive(Debug, Clone, Serialize, Deserialize)]
683#[serde(untagged)]
684pub enum GetWorkspaceNameError {
685    UnknownValue(serde_json::Value),
686}
687
688/// struct for typed errors of method [`get_workspace_slack_oauth_config`]
689#[derive(Debug, Clone, Serialize, Deserialize)]
690#[serde(untagged)]
691pub enum GetWorkspaceSlackOauthConfigError {
692    UnknownValue(serde_json::Value),
693}
694
695/// struct for typed errors of method [`get_workspace_usage`]
696#[derive(Debug, Clone, Serialize, Deserialize)]
697#[serde(untagged)]
698pub enum GetWorkspaceUsageError {
699    UnknownValue(serde_json::Value),
700}
701
702/// struct for typed errors of method [`import_pg_database`]
703#[derive(Debug, Clone, Serialize, Deserialize)]
704#[serde(untagged)]
705pub enum ImportPgDatabaseError {
706    UnknownValue(serde_json::Value),
707}
708
709/// struct for typed errors of method [`invite_user`]
710#[derive(Debug, Clone, Serialize, Deserialize)]
711#[serde(untagged)]
712pub enum InviteUserError {
713    UnknownValue(serde_json::Value),
714}
715
716/// struct for typed errors of method [`is_domain_allowed`]
717#[derive(Debug, Clone, Serialize, Deserialize)]
718#[serde(untagged)]
719pub enum IsDomainAllowedError {
720    UnknownValue(serde_json::Value),
721}
722
723/// struct for typed errors of method [`leave_workspace`]
724#[derive(Debug, Clone, Serialize, Deserialize)]
725#[serde(untagged)]
726pub enum LeaveWorkspaceError {
727    UnknownValue(serde_json::Value),
728}
729
730/// struct for typed errors of method [`list_available_teams_channels`]
731#[derive(Debug, Clone, Serialize, Deserialize)]
732#[serde(untagged)]
733pub enum ListAvailableTeamsChannelsError {
734    UnknownValue(serde_json::Value),
735}
736
737/// struct for typed errors of method [`list_available_teams_ids`]
738#[derive(Debug, Clone, Serialize, Deserialize)]
739#[serde(untagged)]
740pub enum ListAvailableTeamsIdsError {
741    UnknownValue(serde_json::Value),
742}
743
744/// struct for typed errors of method [`list_data_table_schemas`]
745#[derive(Debug, Clone, Serialize, Deserialize)]
746#[serde(untagged)]
747pub enum ListDataTableSchemasError {
748    UnknownValue(serde_json::Value),
749}
750
751/// struct for typed errors of method [`list_data_table_tables`]
752#[derive(Debug, Clone, Serialize, Deserialize)]
753#[serde(untagged)]
754pub enum ListDataTableTablesError {
755    UnknownValue(serde_json::Value),
756}
757
758/// struct for typed errors of method [`list_data_tables`]
759#[derive(Debug, Clone, Serialize, Deserialize)]
760#[serde(untagged)]
761pub enum ListDataTablesError {
762    UnknownValue(serde_json::Value),
763}
764
765/// struct for typed errors of method [`list_datatable_migrations`]
766#[derive(Debug, Clone, Serialize, Deserialize)]
767#[serde(untagged)]
768pub enum ListDatatableMigrationsError {
769    UnknownValue(serde_json::Value),
770}
771
772/// struct for typed errors of method [`list_deployment_request_eligible_deployers`]
773#[derive(Debug, Clone, Serialize, Deserialize)]
774#[serde(untagged)]
775pub enum ListDeploymentRequestEligibleDeployersError {
776    UnknownValue(serde_json::Value),
777}
778
779/// struct for typed errors of method [`list_ducklakes`]
780#[derive(Debug, Clone, Serialize, Deserialize)]
781#[serde(untagged)]
782pub enum ListDucklakesError {
783    UnknownValue(serde_json::Value),
784}
785
786/// struct for typed errors of method [`list_pending_invites`]
787#[derive(Debug, Clone, Serialize, Deserialize)]
788#[serde(untagged)]
789pub enum ListPendingInvitesError {
790    UnknownValue(serde_json::Value),
791}
792
793/// struct for typed errors of method [`list_protection_rules`]
794#[derive(Debug, Clone, Serialize, Deserialize)]
795#[serde(untagged)]
796pub enum ListProtectionRulesError {
797    UnknownValue(serde_json::Value),
798}
799
800/// struct for typed errors of method [`list_shared_ui`]
801#[derive(Debug, Clone, Serialize, Deserialize)]
802#[serde(untagged)]
803pub enum ListSharedUiError {
804    UnknownValue(serde_json::Value),
805}
806
807/// struct for typed errors of method [`list_usable_datatable_roles`]
808#[derive(Debug, Clone, Serialize, Deserialize)]
809#[serde(untagged)]
810pub enum ListUsableDatatableRolesError {
811    UnknownValue(serde_json::Value),
812}
813
814/// struct for typed errors of method [`list_user_workspaces`]
815#[derive(Debug, Clone, Serialize, Deserialize)]
816#[serde(untagged)]
817pub enum ListUserWorkspacesError {
818    UnknownValue(serde_json::Value),
819}
820
821/// struct for typed errors of method [`list_workspaces`]
822#[derive(Debug, Clone, Serialize, Deserialize)]
823#[serde(untagged)]
824pub enum ListWorkspacesError {
825    UnknownValue(serde_json::Value),
826}
827
828/// struct for typed errors of method [`list_workspaces_as_super_admin`]
829#[derive(Debug, Clone, Serialize, Deserialize)]
830#[serde(untagged)]
831pub enum ListWorkspacesAsSuperAdminError {
832    UnknownValue(serde_json::Value),
833}
834
835/// struct for typed errors of method [`list_ws_specific`]
836#[derive(Debug, Clone, Serialize, Deserialize)]
837#[serde(untagged)]
838pub enum ListWsSpecificError {
839    UnknownValue(serde_json::Value),
840}
841
842/// struct for typed errors of method [`list_ws_specific_versions`]
843#[derive(Debug, Clone, Serialize, Deserialize)]
844#[serde(untagged)]
845pub enum ListWsSpecificVersionsError {
846    UnknownValue(serde_json::Value),
847}
848
849/// struct for typed errors of method [`log_feature_usage`]
850#[derive(Debug, Clone, Serialize, Deserialize)]
851#[serde(untagged)]
852pub enum LogFeatureUsageError {
853    UnknownValue(serde_json::Value),
854}
855
856/// struct for typed errors of method [`plan_datatable_acl`]
857#[derive(Debug, Clone, Serialize, Deserialize)]
858#[serde(untagged)]
859pub enum PlanDatatableAclError {
860    UnknownValue(serde_json::Value),
861}
862
863/// struct for typed errors of method [`prune_versions`]
864#[derive(Debug, Clone, Serialize, Deserialize)]
865#[serde(untagged)]
866pub enum PruneVersionsError {
867    UnknownValue(serde_json::Value),
868}
869
870/// struct for typed errors of method [`rebuild_dependency_map`]
871#[derive(Debug, Clone, Serialize, Deserialize)]
872#[serde(untagged)]
873pub enum RebuildDependencyMapError {
874    UnknownValue(serde_json::Value),
875}
876
877/// struct for typed errors of method [`reset_diff_tally`]
878#[derive(Debug, Clone, Serialize, Deserialize)]
879#[serde(untagged)]
880pub enum ResetDiffTallyError {
881    UnknownValue(serde_json::Value),
882}
883
884/// struct for typed errors of method [`rollback_datatable_migrations`]
885#[derive(Debug, Clone, Serialize, Deserialize)]
886#[serde(untagged)]
887pub enum RollbackDatatableMigrationsError {
888    UnknownValue(serde_json::Value),
889}
890
891/// struct for typed errors of method [`run_datatable_migrations`]
892#[derive(Debug, Clone, Serialize, Deserialize)]
893#[serde(untagged)]
894pub enum RunDatatableMigrationsError {
895    UnknownValue(serde_json::Value),
896}
897
898/// struct for typed errors of method [`run_slack_message_test_job`]
899#[derive(Debug, Clone, Serialize, Deserialize)]
900#[serde(untagged)]
901pub enum RunSlackMessageTestJobError {
902    UnknownValue(serde_json::Value),
903}
904
905/// struct for typed errors of method [`run_teams_message_test_job`]
906#[derive(Debug, Clone, Serialize, Deserialize)]
907#[serde(untagged)]
908pub enum RunTeamsMessageTestJobError {
909    UnknownValue(serde_json::Value),
910}
911
912/// struct for typed errors of method [`seed_full_diff_scan`]
913#[derive(Debug, Clone, Serialize, Deserialize)]
914#[serde(untagged)]
915pub enum SeedFullDiffScanError {
916    UnknownValue(serde_json::Value),
917}
918
919/// struct for typed errors of method [`set_datatable_permissions`]
920#[derive(Debug, Clone, Serialize, Deserialize)]
921#[serde(untagged)]
922pub enum SetDatatablePermissionsError {
923    UnknownValue(serde_json::Value),
924}
925
926/// struct for typed errors of method [`set_environment_variable`]
927#[derive(Debug, Clone, Serialize, Deserialize)]
928#[serde(untagged)]
929pub enum SetEnvironmentVariableError {
930    UnknownValue(serde_json::Value),
931}
932
933/// struct for typed errors of method [`set_remote_deploy_target`]
934#[derive(Debug, Clone, Serialize, Deserialize)]
935#[serde(untagged)]
936pub enum SetRemoteDeployTargetError {
937    UnknownValue(serde_json::Value),
938}
939
940/// struct for typed errors of method [`set_threshold_alert`]
941#[derive(Debug, Clone, Serialize, Deserialize)]
942#[serde(untagged)]
943pub enum SetThresholdAlertError {
944    UnknownValue(serde_json::Value),
945}
946
947/// struct for typed errors of method [`set_workspace_encryption_key`]
948#[derive(Debug, Clone, Serialize, Deserialize)]
949#[serde(untagged)]
950pub enum SetWorkspaceEncryptionKeyError {
951    UnknownValue(serde_json::Value),
952}
953
954/// struct for typed errors of method [`set_workspace_slack_oauth_config`]
955#[derive(Debug, Clone, Serialize, Deserialize)]
956#[serde(untagged)]
957pub enum SetWorkspaceSlackOauthConfigError {
958    UnknownValue(serde_json::Value),
959}
960
961/// struct for typed errors of method [`set_ws_specific`]
962#[derive(Debug, Clone, Serialize, Deserialize)]
963#[serde(untagged)]
964pub enum SetWsSpecificError {
965    UnknownValue(serde_json::Value),
966}
967
968/// struct for typed errors of method [`test_data_table_connection`]
969#[derive(Debug, Clone, Serialize, Deserialize)]
970#[serde(untagged)]
971pub enum TestDataTableConnectionError {
972    UnknownValue(serde_json::Value),
973}
974
975/// struct for typed errors of method [`unarchive_workspace`]
976#[derive(Debug, Clone, Serialize, Deserialize)]
977#[serde(untagged)]
978pub enum UnarchiveWorkspaceError {
979    UnknownValue(serde_json::Value),
980}
981
982/// struct for typed errors of method [`update_operator_settings`]
983#[derive(Debug, Clone, Serialize, Deserialize)]
984#[serde(untagged)]
985pub enum UpdateOperatorSettingsError {
986    UnknownValue(serde_json::Value),
987}
988
989/// struct for typed errors of method [`update_protection_rule`]
990#[derive(Debug, Clone, Serialize, Deserialize)]
991#[serde(untagged)]
992pub enum UpdateProtectionRuleError {
993    Status404(),
994    UnknownValue(serde_json::Value),
995}
996
997/// struct for typed errors of method [`update_shared_ui`]
998#[derive(Debug, Clone, Serialize, Deserialize)]
999#[serde(untagged)]
1000pub enum UpdateSharedUiError {
1001    UnknownValue(serde_json::Value),
1002}
1003
1004/// struct for typed errors of method [`upsert_datatable_migration`]
1005#[derive(Debug, Clone, Serialize, Deserialize)]
1006#[serde(untagged)]
1007pub enum UpsertDatatableMigrationError {
1008    UnknownValue(serde_json::Value),
1009}
1010
1011
1012pub async fn add_user(configuration: &configuration::Configuration, workspace: &str, add_user_request: models::AddUserRequest) -> Result<String, Error<AddUserError>> {
1013    let local_var_configuration = configuration;
1014
1015    let local_var_client = &local_var_configuration.client;
1016
1017    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/add_user", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1018    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1019
1020    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1021        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1022    }
1023    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1024        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1025    };
1026    local_var_req_builder = local_var_req_builder.json(&add_user_request);
1027
1028    let local_var_req = local_var_req_builder.build()?;
1029    let local_var_resp = local_var_client.execute(local_var_req).await?;
1030
1031    let local_var_status = local_var_resp.status();
1032    let local_var_content = local_var_resp.text().await?;
1033
1034    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1035        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1036    } else {
1037        let local_var_entity: Option<AddUserError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1038        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1039        Err(Error::ResponseError(local_var_error))
1040    }
1041}
1042
1043pub async fn apply_datatable_acl(configuration: &configuration::Configuration, workspace: &str, datatable_name: &str, acl_change_request: models::AclChangeRequest) -> Result<String, Error<ApplyDatatableAclError>> {
1044    let local_var_configuration = configuration;
1045
1046    let local_var_client = &local_var_configuration.client;
1047
1048    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/datatable_acl/{datatable_name}/apply", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), datatable_name=crate::apis::urlencode(datatable_name));
1049    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1050
1051    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1052        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1053    }
1054    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1055        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1056    };
1057    local_var_req_builder = local_var_req_builder.json(&acl_change_request);
1058
1059    let local_var_req = local_var_req_builder.build()?;
1060    let local_var_resp = local_var_client.execute(local_var_req).await?;
1061
1062    let local_var_status = local_var_resp.status();
1063    let local_var_content = local_var_resp.text().await?;
1064
1065    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1066        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1067    } else {
1068        let local_var_entity: Option<ApplyDatatableAclError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1069        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1070        Err(Error::ResponseError(local_var_error))
1071    }
1072}
1073
1074pub async fn archive_workspace(configuration: &configuration::Configuration, workspace: &str) -> Result<String, Error<ArchiveWorkspaceError>> {
1075    let local_var_configuration = configuration;
1076
1077    let local_var_client = &local_var_configuration.client;
1078
1079    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/archive", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1080    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1081
1082    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1083        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1084    }
1085    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1086        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1087    };
1088
1089    let local_var_req = local_var_req_builder.build()?;
1090    let local_var_resp = local_var_client.execute(local_var_req).await?;
1091
1092    let local_var_status = local_var_resp.status();
1093    let local_var_content = local_var_resp.text().await?;
1094
1095    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1096        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1097    } else {
1098        let local_var_entity: Option<ArchiveWorkspaceError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1099        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1100        Err(Error::ResponseError(local_var_error))
1101    }
1102}
1103
1104pub async fn attach_dev_workspace(configuration: &configuration::Configuration, workspace: &str, attach_dev_workspace_request: models::AttachDevWorkspaceRequest) -> Result<String, Error<AttachDevWorkspaceError>> {
1105    let local_var_configuration = configuration;
1106
1107    let local_var_client = &local_var_configuration.client;
1108
1109    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/attach_dev_workspace", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1110    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1111
1112    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1113        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1114    }
1115    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1116        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1117    };
1118    local_var_req_builder = local_var_req_builder.json(&attach_dev_workspace_request);
1119
1120    let local_var_req = local_var_req_builder.build()?;
1121    let local_var_resp = local_var_client.execute(local_var_req).await?;
1122
1123    let local_var_status = local_var_resp.status();
1124    let local_var_content = local_var_resp.text().await?;
1125
1126    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1127        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1128    } else {
1129        let local_var_entity: Option<AttachDevWorkspaceError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1130        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1131        Err(Error::ResponseError(local_var_error))
1132    }
1133}
1134
1135pub async fn cancel_deployment_request(configuration: &configuration::Configuration, workspace: &str, id: i64) -> Result<String, Error<CancelDeploymentRequestError>> {
1136    let local_var_configuration = configuration;
1137
1138    let local_var_client = &local_var_configuration.client;
1139
1140    let local_var_uri_str = format!("{}/w/{workspace}/deployment_request/{id}/cancel", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), id=id);
1141    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1142
1143    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1144        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1145    }
1146    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1147        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1148    };
1149
1150    let local_var_req = local_var_req_builder.build()?;
1151    let local_var_resp = local_var_client.execute(local_var_req).await?;
1152
1153    let local_var_status = local_var_resp.status();
1154    let local_var_content = local_var_resp.text().await?;
1155
1156    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1157        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1158    } else {
1159        let local_var_entity: Option<CancelDeploymentRequestError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1160        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1161        Err(Error::ResponseError(local_var_error))
1162    }
1163}
1164
1165pub async fn change_workspace_color(configuration: &configuration::Configuration, workspace: &str, change_workspace_color_request: Option<models::ChangeWorkspaceColorRequest>) -> Result<String, Error<ChangeWorkspaceColorError>> {
1166    let local_var_configuration = configuration;
1167
1168    let local_var_client = &local_var_configuration.client;
1169
1170    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/change_workspace_color", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1171    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1172
1173    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1174        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1175    }
1176    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1177        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1178    };
1179    local_var_req_builder = local_var_req_builder.json(&change_workspace_color_request);
1180
1181    let local_var_req = local_var_req_builder.build()?;
1182    let local_var_resp = local_var_client.execute(local_var_req).await?;
1183
1184    let local_var_status = local_var_resp.status();
1185    let local_var_content = local_var_resp.text().await?;
1186
1187    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1188        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1189    } else {
1190        let local_var_entity: Option<ChangeWorkspaceColorError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1191        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1192        Err(Error::ResponseError(local_var_error))
1193    }
1194}
1195
1196pub async fn change_workspace_id(configuration: &configuration::Configuration, workspace: &str, change_workspace_id_request: Option<models::ChangeWorkspaceIdRequest>) -> Result<String, Error<ChangeWorkspaceIdError>> {
1197    let local_var_configuration = configuration;
1198
1199    let local_var_client = &local_var_configuration.client;
1200
1201    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/change_workspace_id", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1202    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1203
1204    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1205        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1206    }
1207    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1208        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1209    };
1210    local_var_req_builder = local_var_req_builder.json(&change_workspace_id_request);
1211
1212    let local_var_req = local_var_req_builder.build()?;
1213    let local_var_resp = local_var_client.execute(local_var_req).await?;
1214
1215    let local_var_status = local_var_resp.status();
1216    let local_var_content = local_var_resp.text().await?;
1217
1218    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1219        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1220    } else {
1221        let local_var_entity: Option<ChangeWorkspaceIdError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1222        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1223        Err(Error::ResponseError(local_var_error))
1224    }
1225}
1226
1227pub async fn change_workspace_name(configuration: &configuration::Configuration, workspace: &str, change_workspace_name_request: Option<models::ChangeWorkspaceNameRequest>) -> Result<String, Error<ChangeWorkspaceNameError>> {
1228    let local_var_configuration = configuration;
1229
1230    let local_var_client = &local_var_configuration.client;
1231
1232    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/change_workspace_name", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1233    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1234
1235    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1236        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1237    }
1238    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1239        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1240    };
1241    local_var_req_builder = local_var_req_builder.json(&change_workspace_name_request);
1242
1243    let local_var_req = local_var_req_builder.build()?;
1244    let local_var_resp = local_var_client.execute(local_var_req).await?;
1245
1246    let local_var_status = local_var_resp.status();
1247    let local_var_content = local_var_resp.text().await?;
1248
1249    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1250        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1251    } else {
1252        let local_var_entity: Option<ChangeWorkspaceNameError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1253        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1254        Err(Error::ResponseError(local_var_error))
1255    }
1256}
1257
1258/// Called by the UI after the deploy loop completes. Closes the request and marks every comment obsolete. Idempotent.
1259pub async fn close_deployment_request_merged(configuration: &configuration::Configuration, workspace: &str, id: i64) -> Result<String, Error<CloseDeploymentRequestMergedError>> {
1260    let local_var_configuration = configuration;
1261
1262    let local_var_client = &local_var_configuration.client;
1263
1264    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);
1265    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1266
1267    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1268        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1269    }
1270    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1271        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1272    };
1273
1274    let local_var_req = local_var_req_builder.build()?;
1275    let local_var_resp = local_var_client.execute(local_var_req).await?;
1276
1277    let local_var_status = local_var_resp.status();
1278    let local_var_content = local_var_resp.text().await?;
1279
1280    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1281        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1282    } else {
1283        let local_var_entity: Option<CloseDeploymentRequestMergedError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1284        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1285        Err(Error::ResponseError(local_var_error))
1286    }
1287}
1288
1289/// 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.
1290pub async fn compare_workspaces(configuration: &configuration::Configuration, workspace: &str, target_workspace_id: &str) -> Result<models::WorkspaceComparison, Error<CompareWorkspacesError>> {
1291    let local_var_configuration = configuration;
1292
1293    let local_var_client = &local_var_configuration.client;
1294
1295    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/compare/{target_workspace_id}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), target_workspace_id=crate::apis::urlencode(target_workspace_id));
1296    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1297
1298    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1299        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1300    }
1301    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1302        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1303    };
1304
1305    let local_var_req = local_var_req_builder.build()?;
1306    let local_var_resp = local_var_client.execute(local_var_req).await?;
1307
1308    let local_var_status = local_var_resp.status();
1309    let local_var_content = local_var_resp.text().await?;
1310
1311    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1312        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1313    } else {
1314        let local_var_entity: Option<CompareWorkspacesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1315        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1316        Err(Error::ResponseError(local_var_error))
1317    }
1318}
1319
1320/// The token is checked against the target's whoami before it is stored. `target` names the target the token was obtained for, and the request is refused if the workspace now points elsewhere, so a token is never sent to an instance it was not meant for. 
1321pub async fn connect_remote_deploy(configuration: &configuration::Configuration, workspace: &str, connect_remote_deploy_request: models::ConnectRemoteDeployRequest) -> Result<models::RemoteDeployConnection, Error<ConnectRemoteDeployError>> {
1322    let local_var_configuration = configuration;
1323
1324    let local_var_client = &local_var_configuration.client;
1325
1326    let local_var_uri_str = format!("{}/w/{workspace}/remote_deploy/connect", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1327    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1328
1329    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1330        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1331    }
1332    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1333        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1334    };
1335    local_var_req_builder = local_var_req_builder.json(&connect_remote_deploy_request);
1336
1337    let local_var_req = local_var_req_builder.build()?;
1338    let local_var_resp = local_var_client.execute(local_var_req).await?;
1339
1340    let local_var_status = local_var_resp.status();
1341    let local_var_content = local_var_resp.text().await?;
1342
1343    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1344        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1345    } else {
1346        let local_var_entity: Option<ConnectRemoteDeployError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1347        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1348        Err(Error::ResponseError(local_var_error))
1349    }
1350}
1351
1352pub async fn connect_slack(configuration: &configuration::Configuration, workspace: &str, connect_slack_request: models::ConnectSlackRequest) -> Result<(), Error<ConnectSlackError>> {
1353    let local_var_configuration = configuration;
1354
1355    let local_var_client = &local_var_configuration.client;
1356
1357    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/connect_slack", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1358    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1359
1360    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1361        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1362    }
1363    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1364        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1365    };
1366    local_var_req_builder = local_var_req_builder.json(&connect_slack_request);
1367
1368    let local_var_req = local_var_req_builder.build()?;
1369    let local_var_resp = local_var_client.execute(local_var_req).await?;
1370
1371    let local_var_status = local_var_resp.status();
1372    let local_var_content = local_var_resp.text().await?;
1373
1374    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1375        Ok(())
1376    } else {
1377        let local_var_entity: Option<ConnectSlackError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1378        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1379        Err(Error::ResponseError(local_var_error))
1380    }
1381}
1382
1383pub async fn connect_teams(configuration: &configuration::Configuration, workspace: &str, connect_teams_request: models::ConnectTeamsRequest) -> Result<String, Error<ConnectTeamsError>> {
1384    let local_var_configuration = configuration;
1385
1386    let local_var_client = &local_var_configuration.client;
1387
1388    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/connect_teams", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1389    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1390
1391    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1392        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1393    }
1394    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1395        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1396    };
1397    local_var_req_builder = local_var_req_builder.json(&connect_teams_request);
1398
1399    let local_var_req = local_var_req_builder.build()?;
1400    let local_var_resp = local_var_client.execute(local_var_req).await?;
1401
1402    let local_var_status = local_var_resp.status();
1403    let local_var_content = local_var_resp.text().await?;
1404
1405    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1406        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1407    } else {
1408        let local_var_entity: Option<ConnectTeamsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1409        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1410        Err(Error::ResponseError(local_var_error))
1411    }
1412}
1413
1414pub async fn create_datatable_migration(configuration: &configuration::Configuration, workspace: &str, datatable_name: &str, create_datatable_migration_request: models::CreateDatatableMigrationRequest) -> Result<models::DatatableMigration, Error<CreateDatatableMigrationError>> {
1415    let local_var_configuration = configuration;
1416
1417    let local_var_client = &local_var_configuration.client;
1418
1419    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/create_datatable_migration/{datatable_name}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), datatable_name=crate::apis::urlencode(datatable_name));
1420    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1421
1422    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1423        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1424    }
1425    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1426        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1427    };
1428    local_var_req_builder = local_var_req_builder.json(&create_datatable_migration_request);
1429
1430    let local_var_req = local_var_req_builder.build()?;
1431    let local_var_resp = local_var_client.execute(local_var_req).await?;
1432
1433    let local_var_status = local_var_resp.status();
1434    let local_var_content = local_var_resp.text().await?;
1435
1436    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1437        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1438    } else {
1439        let local_var_entity: Option<CreateDatatableMigrationError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1440        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1441        Err(Error::ResponseError(local_var_error))
1442    }
1443}
1444
1445pub async fn create_deployment_request(configuration: &configuration::Configuration, workspace: &str, create_deployment_request_request: models::CreateDeploymentRequestRequest) -> Result<models::DeploymentRequest, Error<CreateDeploymentRequestError>> {
1446    let local_var_configuration = configuration;
1447
1448    let local_var_client = &local_var_configuration.client;
1449
1450    let local_var_uri_str = format!("{}/w/{workspace}/deployment_request", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1451    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1452
1453    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1454        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1455    }
1456    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1457        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1458    };
1459    local_var_req_builder = local_var_req_builder.json(&create_deployment_request_request);
1460
1461    let local_var_req = local_var_req_builder.build()?;
1462    let local_var_resp = local_var_client.execute(local_var_req).await?;
1463
1464    let local_var_status = local_var_resp.status();
1465    let local_var_content = local_var_resp.text().await?;
1466
1467    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1468        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1469    } else {
1470        let local_var_entity: Option<CreateDeploymentRequestError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1471        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1472        Err(Error::ResponseError(local_var_error))
1473    }
1474}
1475
1476pub 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>> {
1477    let local_var_configuration = configuration;
1478
1479    let local_var_client = &local_var_configuration.client;
1480
1481    let local_var_uri_str = format!("{}/w/{workspace}/deployment_request/{id}/comment", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), id=id);
1482    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1483
1484    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1485        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1486    }
1487    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1488        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1489    };
1490    local_var_req_builder = local_var_req_builder.json(&create_deployment_request_comment_request);
1491
1492    let local_var_req = local_var_req_builder.build()?;
1493    let local_var_resp = local_var_client.execute(local_var_req).await?;
1494
1495    let local_var_status = local_var_resp.status();
1496    let local_var_content = local_var_resp.text().await?;
1497
1498    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1499        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1500    } else {
1501        let local_var_entity: Option<CreateDeploymentRequestCommentError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1502        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1503        Err(Error::ResponseError(local_var_error))
1504    }
1505}
1506
1507pub async fn create_pg_database(configuration: &configuration::Configuration, workspace: &str, create_pg_database_request: models::CreatePgDatabaseRequest) -> Result<String, Error<CreatePgDatabaseError>> {
1508    let local_var_configuration = configuration;
1509
1510    let local_var_client = &local_var_configuration.client;
1511
1512    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/create_pg_database", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1513    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1514
1515    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1516        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1517    }
1518    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1519        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1520    };
1521    local_var_req_builder = local_var_req_builder.json(&create_pg_database_request);
1522
1523    let local_var_req = local_var_req_builder.build()?;
1524    let local_var_resp = local_var_client.execute(local_var_req).await?;
1525
1526    let local_var_status = local_var_resp.status();
1527    let local_var_content = local_var_resp.text().await?;
1528
1529    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1530        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1531    } else {
1532        let local_var_entity: Option<CreatePgDatabaseError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1533        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1534        Err(Error::ResponseError(local_var_error))
1535    }
1536}
1537
1538pub async fn create_protection_rule(configuration: &configuration::Configuration, workspace: &str, create_protection_rule_request: models::CreateProtectionRuleRequest) -> Result<String, Error<CreateProtectionRuleError>> {
1539    let local_var_configuration = configuration;
1540
1541    let local_var_client = &local_var_configuration.client;
1542
1543    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/protection_rules", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1544    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1545
1546    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1547        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1548    }
1549    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1550        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1551    };
1552    local_var_req_builder = local_var_req_builder.json(&create_protection_rule_request);
1553
1554    let local_var_req = local_var_req_builder.build()?;
1555    let local_var_resp = local_var_client.execute(local_var_req).await?;
1556
1557    let local_var_status = local_var_resp.status();
1558    let local_var_content = local_var_resp.text().await?;
1559
1560    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1561        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1562    } else {
1563        let local_var_entity: Option<CreateProtectionRuleError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1564        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1565        Err(Error::ResponseError(local_var_error))
1566    }
1567}
1568
1569pub async fn create_service_account(configuration: &configuration::Configuration, workspace: &str, create_service_account_request: models::CreateServiceAccountRequest) -> Result<String, Error<CreateServiceAccountError>> {
1570    let local_var_configuration = configuration;
1571
1572    let local_var_client = &local_var_configuration.client;
1573
1574    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/create_service_account", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1575    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1576
1577    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1578        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1579    }
1580    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1581        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1582    };
1583    local_var_req_builder = local_var_req_builder.json(&create_service_account_request);
1584
1585    let local_var_req = local_var_req_builder.build()?;
1586    let local_var_resp = local_var_client.execute(local_var_req).await?;
1587
1588    let local_var_status = local_var_resp.status();
1589    let local_var_content = local_var_resp.text().await?;
1590
1591    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1592        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1593    } else {
1594        let local_var_entity: Option<CreateServiceAccountError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1595        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1596        Err(Error::ResponseError(local_var_error))
1597    }
1598}
1599
1600pub async fn create_workspace(configuration: &configuration::Configuration, create_workspace: models::CreateWorkspace) -> Result<String, Error<CreateWorkspaceError>> {
1601    let local_var_configuration = configuration;
1602
1603    let local_var_client = &local_var_configuration.client;
1604
1605    let local_var_uri_str = format!("{}/workspaces/create", local_var_configuration.base_path);
1606    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1607
1608    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1609        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1610    }
1611    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1612        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1613    };
1614    local_var_req_builder = local_var_req_builder.json(&create_workspace);
1615
1616    let local_var_req = local_var_req_builder.build()?;
1617    let local_var_resp = local_var_client.execute(local_var_req).await?;
1618
1619    let local_var_status = local_var_resp.status();
1620    let local_var_content = local_var_resp.text().await?;
1621
1622    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1623        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1624    } else {
1625        let local_var_entity: Option<CreateWorkspaceError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1626        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1627        Err(Error::ResponseError(local_var_error))
1628    }
1629}
1630
1631pub async fn create_workspace_fork(configuration: &configuration::Configuration, workspace: &str, create_workspace_fork: models::CreateWorkspaceFork) -> Result<String, Error<CreateWorkspaceForkError>> {
1632    let local_var_configuration = configuration;
1633
1634    let local_var_client = &local_var_configuration.client;
1635
1636    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/create_fork", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1637    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1638
1639    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1640        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1641    }
1642    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1643        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1644    };
1645    local_var_req_builder = local_var_req_builder.json(&create_workspace_fork);
1646
1647    let local_var_req = local_var_req_builder.build()?;
1648    let local_var_resp = local_var_client.execute(local_var_req).await?;
1649
1650    let local_var_status = local_var_resp.status();
1651    let local_var_content = local_var_resp.text().await?;
1652
1653    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1654        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1655    } else {
1656        let local_var_entity: Option<CreateWorkspaceForkError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1657        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1658        Err(Error::ResponseError(local_var_error))
1659    }
1660}
1661
1662pub async fn create_workspace_fork_git_branch(configuration: &configuration::Configuration, workspace: &str, create_workspace_fork: models::CreateWorkspaceFork) -> Result<Vec<uuid::Uuid>, Error<CreateWorkspaceForkGitBranchError>> {
1663    let local_var_configuration = configuration;
1664
1665    let local_var_client = &local_var_configuration.client;
1666
1667    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/create_workspace_fork_branch", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1668    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1669
1670    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1671        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1672    }
1673    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1674        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1675    };
1676    local_var_req_builder = local_var_req_builder.json(&create_workspace_fork);
1677
1678    let local_var_req = local_var_req_builder.build()?;
1679    let local_var_resp = local_var_client.execute(local_var_req).await?;
1680
1681    let local_var_status = local_var_resp.status();
1682    let local_var_content = local_var_resp.text().await?;
1683
1684    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1685        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1686    } else {
1687        let local_var_entity: Option<CreateWorkspaceForkGitBranchError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1688        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1689        Err(Error::ResponseError(local_var_error))
1690    }
1691}
1692
1693pub async fn delete_datatable_migration(configuration: &configuration::Configuration, workspace: &str, datatable_name: &str, timestamp: i64) -> Result<String, Error<DeleteDatatableMigrationError>> {
1694    let local_var_configuration = configuration;
1695
1696    let local_var_client = &local_var_configuration.client;
1697
1698    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/delete_datatable_migration/{datatable_name}/{timestamp}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), datatable_name=crate::apis::urlencode(datatable_name), timestamp=timestamp);
1699    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
1700
1701    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1702        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1703    }
1704    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1705        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1706    };
1707
1708    let local_var_req = local_var_req_builder.build()?;
1709    let local_var_resp = local_var_client.execute(local_var_req).await?;
1710
1711    let local_var_status = local_var_resp.status();
1712    let local_var_content = local_var_resp.text().await?;
1713
1714    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1715        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1716    } else {
1717        let local_var_entity: Option<DeleteDatatableMigrationError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1718        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1719        Err(Error::ResponseError(local_var_error))
1720    }
1721}
1722
1723pub async fn delete_git_sync_repository(configuration: &configuration::Configuration, workspace: &str, delete_git_sync_repository_request: models::DeleteGitSyncRepositoryRequest) -> Result<serde_json::Value, Error<DeleteGitSyncRepositoryError>> {
1724    let local_var_configuration = configuration;
1725
1726    let local_var_client = &local_var_configuration.client;
1727
1728    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/delete_git_sync_repository", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1729    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
1730
1731    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1732        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1733    }
1734    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1735        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1736    };
1737    local_var_req_builder = local_var_req_builder.json(&delete_git_sync_repository_request);
1738
1739    let local_var_req = local_var_req_builder.build()?;
1740    let local_var_resp = local_var_client.execute(local_var_req).await?;
1741
1742    let local_var_status = local_var_resp.status();
1743    let local_var_content = local_var_resp.text().await?;
1744
1745    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1746        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1747    } else {
1748        let local_var_entity: Option<DeleteGitSyncRepositoryError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1749        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1750        Err(Error::ResponseError(local_var_error))
1751    }
1752}
1753
1754pub async fn delete_invite(configuration: &configuration::Configuration, workspace: &str, delete_invite_request: models::DeleteInviteRequest) -> Result<String, Error<DeleteInviteError>> {
1755    let local_var_configuration = configuration;
1756
1757    let local_var_client = &local_var_configuration.client;
1758
1759    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/delete_invite", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1760    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1761
1762    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1763        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1764    }
1765    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1766        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1767    };
1768    local_var_req_builder = local_var_req_builder.json(&delete_invite_request);
1769
1770    let local_var_req = local_var_req_builder.build()?;
1771    let local_var_resp = local_var_client.execute(local_var_req).await?;
1772
1773    let local_var_status = local_var_resp.status();
1774    let local_var_content = local_var_resp.text().await?;
1775
1776    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1777        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1778    } else {
1779        let local_var_entity: Option<DeleteInviteError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1780        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1781        Err(Error::ResponseError(local_var_error))
1782    }
1783}
1784
1785pub async fn delete_protection_rule(configuration: &configuration::Configuration, workspace: &str, rule_name: &str) -> Result<String, Error<DeleteProtectionRuleError>> {
1786    let local_var_configuration = configuration;
1787
1788    let local_var_client = &local_var_configuration.client;
1789
1790    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/protection_rules/{rule_name}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), rule_name=crate::apis::urlencode(rule_name));
1791    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
1792
1793    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1794        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1795    }
1796    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1797        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1798    };
1799
1800    let local_var_req = local_var_req_builder.build()?;
1801    let local_var_resp = local_var_client.execute(local_var_req).await?;
1802
1803    let local_var_status = local_var_resp.status();
1804    let local_var_content = local_var_resp.text().await?;
1805
1806    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1807        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1808    } else {
1809        let local_var_entity: Option<DeleteProtectionRuleError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1810        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1811        Err(Error::ResponseError(local_var_error))
1812    }
1813}
1814
1815pub async fn delete_workspace(configuration: &configuration::Configuration, workspace: &str, only_delete_forks: Option<bool>) -> Result<String, Error<DeleteWorkspaceError>> {
1816    let local_var_configuration = configuration;
1817
1818    let local_var_client = &local_var_configuration.client;
1819
1820    let local_var_uri_str = format!("{}/workspaces/delete/{workspace}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1821    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
1822
1823    if let Some(ref local_var_str) = only_delete_forks {
1824        local_var_req_builder = local_var_req_builder.query(&[("only_delete_forks", &local_var_str.to_string())]);
1825    }
1826    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1827        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1828    }
1829    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1830        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1831    };
1832
1833    let local_var_req = local_var_req_builder.build()?;
1834    let local_var_resp = local_var_client.execute(local_var_req).await?;
1835
1836    let local_var_status = local_var_resp.status();
1837    let local_var_content = local_var_resp.text().await?;
1838
1839    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1840        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1841    } else {
1842        let local_var_entity: Option<DeleteWorkspaceError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1843        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1844        Err(Error::ResponseError(local_var_error))
1845    }
1846}
1847
1848pub async fn delete_workspace_slack_oauth_config(configuration: &configuration::Configuration, workspace: &str) -> Result<String, Error<DeleteWorkspaceSlackOauthConfigError>> {
1849    let local_var_configuration = configuration;
1850
1851    let local_var_client = &local_var_configuration.client;
1852
1853    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/slack_oauth_config", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1854    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
1855
1856    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1857        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1858    }
1859    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1860        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1861    };
1862
1863    let local_var_req = local_var_req_builder.build()?;
1864    let local_var_resp = local_var_client.execute(local_var_req).await?;
1865
1866    let local_var_status = local_var_resp.status();
1867    let local_var_content = local_var_resp.text().await?;
1868
1869    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1870        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1871    } else {
1872        let local_var_entity: Option<DeleteWorkspaceSlackOauthConfigError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1873        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1874        Err(Error::ResponseError(local_var_error))
1875    }
1876}
1877
1878pub async fn detach_dev_workspace(configuration: &configuration::Configuration, workspace: &str, detach_dev_workspace_request: models::DetachDevWorkspaceRequest) -> Result<String, Error<DetachDevWorkspaceError>> {
1879    let local_var_configuration = configuration;
1880
1881    let local_var_client = &local_var_configuration.client;
1882
1883    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/detach_dev_workspace", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1884    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1885
1886    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1887        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1888    }
1889    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1890        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1891    };
1892    local_var_req_builder = local_var_req_builder.json(&detach_dev_workspace_request);
1893
1894    let local_var_req = local_var_req_builder.build()?;
1895    let local_var_resp = local_var_client.execute(local_var_req).await?;
1896
1897    let local_var_status = local_var_resp.status();
1898    let local_var_content = local_var_resp.text().await?;
1899
1900    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1901        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1902    } else {
1903        let local_var_entity: Option<DetachDevWorkspaceError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1904        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1905        Err(Error::ResponseError(local_var_error))
1906    }
1907}
1908
1909pub async fn disable_datatable_migrations(configuration: &configuration::Configuration, workspace: &str, datatable_name: &str) -> Result<String, Error<DisableDatatableMigrationsError>> {
1910    let local_var_configuration = configuration;
1911
1912    let local_var_client = &local_var_configuration.client;
1913
1914    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/disable_datatable_migrations/{datatable_name}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), datatable_name=crate::apis::urlencode(datatable_name));
1915    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1916
1917    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1918        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1919    }
1920    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1921        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1922    };
1923
1924    let local_var_req = local_var_req_builder.build()?;
1925    let local_var_resp = local_var_client.execute(local_var_req).await?;
1926
1927    let local_var_status = local_var_resp.status();
1928    let local_var_content = local_var_resp.text().await?;
1929
1930    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1931        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1932    } else {
1933        let local_var_entity: Option<DisableDatatableMigrationsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1934        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1935        Err(Error::ResponseError(local_var_error))
1936    }
1937}
1938
1939pub async fn disconnect_remote_deploy(configuration: &configuration::Configuration, workspace: &str) -> Result<String, Error<DisconnectRemoteDeployError>> {
1940    let local_var_configuration = configuration;
1941
1942    let local_var_client = &local_var_configuration.client;
1943
1944    let local_var_uri_str = format!("{}/w/{workspace}/remote_deploy/disconnect", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1945    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1946
1947    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1948        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1949    }
1950    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1951        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1952    };
1953
1954    let local_var_req = local_var_req_builder.build()?;
1955    let local_var_resp = local_var_client.execute(local_var_req).await?;
1956
1957    let local_var_status = local_var_resp.status();
1958    let local_var_content = local_var_resp.text().await?;
1959
1960    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1961        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1962    } else {
1963        let local_var_entity: Option<DisconnectRemoteDeployError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1964        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1965        Err(Error::ResponseError(local_var_error))
1966    }
1967}
1968
1969pub async fn drop_forked_datatable_databases(configuration: &configuration::Configuration, workspace: &str, drop_forked_datatable_databases_request: models::DropForkedDatatableDatabasesRequest) -> Result<Vec<String>, Error<DropForkedDatatableDatabasesError>> {
1970    let local_var_configuration = configuration;
1971
1972    let local_var_client = &local_var_configuration.client;
1973
1974    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/drop_forked_datatable_databases", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1975    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1976
1977    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1978        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1979    }
1980    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1981        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1982    };
1983    local_var_req_builder = local_var_req_builder.json(&drop_forked_datatable_databases_request);
1984
1985    let local_var_req = local_var_req_builder.build()?;
1986    let local_var_resp = local_var_client.execute(local_var_req).await?;
1987
1988    let local_var_status = local_var_resp.status();
1989    let local_var_content = local_var_resp.text().await?;
1990
1991    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1992        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1993    } else {
1994        let local_var_entity: Option<DropForkedDatatableDatabasesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1995        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1996        Err(Error::ResponseError(local_var_error))
1997    }
1998}
1999
2000pub async fn drop_forked_ducklake_namespaces(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<String>, Error<DropForkedDucklakeNamespacesError>> {
2001    let local_var_configuration = configuration;
2002
2003    let local_var_client = &local_var_configuration.client;
2004
2005    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/drop_forked_ducklake_namespaces", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2006    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2007
2008    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2009        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2010    }
2011    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2012        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2013    };
2014
2015    let local_var_req = local_var_req_builder.build()?;
2016    let local_var_resp = local_var_client.execute(local_var_req).await?;
2017
2018    let local_var_status = local_var_resp.status();
2019    let local_var_content = local_var_resp.text().await?;
2020
2021    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2022        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2023    } else {
2024        let local_var_entity: Option<DropForkedDucklakeNamespacesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2025        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2026        Err(Error::ResponseError(local_var_error))
2027    }
2028}
2029
2030/// When on, every fork created from this workspace gets the workspace's admins and developers as members, with the role they hold here; operators, disabled users and service accounts are left out. The setting is copied into each fork, so forks of a fork follow it too. Off by default. Workspace-admin gated.
2031pub async fn edit_add_admins_and_developers_to_forks(configuration: &configuration::Configuration, workspace: &str, edit_add_admins_and_developers_to_forks_request: models::EditAddAdminsAndDevelopersToForksRequest) -> Result<String, Error<EditAddAdminsAndDevelopersToForksError>> {
2032    let local_var_configuration = configuration;
2033
2034    let local_var_client = &local_var_configuration.client;
2035
2036    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_add_admins_and_developers_to_forks", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2037    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2038
2039    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2040        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2041    }
2042    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2043        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2044    };
2045    local_var_req_builder = local_var_req_builder.json(&edit_add_admins_and_developers_to_forks_request);
2046
2047    let local_var_req = local_var_req_builder.build()?;
2048    let local_var_resp = local_var_client.execute(local_var_req).await?;
2049
2050    let local_var_status = local_var_resp.status();
2051    let local_var_content = local_var_resp.text().await?;
2052
2053    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2054        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2055    } else {
2056        let local_var_entity: Option<EditAddAdminsAndDevelopersToForksError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2057        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2058        Err(Error::ResponseError(local_var_error))
2059    }
2060}
2061
2062pub async fn edit_auto_invite(configuration: &configuration::Configuration, workspace: &str, edit_auto_invite_request: models::EditAutoInviteRequest) -> Result<String, Error<EditAutoInviteError>> {
2063    let local_var_configuration = configuration;
2064
2065    let local_var_client = &local_var_configuration.client;
2066
2067    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_auto_invite", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2068    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2069
2070    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2071        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2072    }
2073    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2074        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2075    };
2076    local_var_req_builder = local_var_req_builder.json(&edit_auto_invite_request);
2077
2078    let local_var_req = local_var_req_builder.build()?;
2079    let local_var_resp = local_var_client.execute(local_var_req).await?;
2080
2081    let local_var_status = local_var_resp.status();
2082    let local_var_content = local_var_resp.text().await?;
2083
2084    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2085        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2086    } else {
2087        let local_var_entity: Option<EditAutoInviteError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2088        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2089        Err(Error::ResponseError(local_var_error))
2090    }
2091}
2092
2093pub async fn edit_copilot_config(configuration: &configuration::Configuration, workspace: &str, ai_config: models::AiConfig) -> Result<models::EditCopilotConfig200Response, Error<EditCopilotConfigError>> {
2094    let local_var_configuration = configuration;
2095
2096    let local_var_client = &local_var_configuration.client;
2097
2098    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_copilot_config", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2099    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2100
2101    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2102        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2103    }
2104    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2105        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2106    };
2107    local_var_req_builder = local_var_req_builder.json(&ai_config);
2108
2109    let local_var_req = local_var_req_builder.build()?;
2110    let local_var_resp = local_var_client.execute(local_var_req).await?;
2111
2112    let local_var_status = local_var_resp.status();
2113    let local_var_content = local_var_resp.text().await?;
2114
2115    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2116        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2117    } else {
2118        let local_var_entity: Option<EditCopilotConfigError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2119        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2120        Err(Error::ResponseError(local_var_error))
2121    }
2122}
2123
2124pub async fn edit_data_table_config(configuration: &configuration::Configuration, workspace: &str, edit_data_table_config_request: models::EditDataTableConfigRequest) -> Result<models::EditDataTableConfig200Response, Error<EditDataTableConfigError>> {
2125    let local_var_configuration = configuration;
2126
2127    let local_var_client = &local_var_configuration.client;
2128
2129    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_datatable_config", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2130    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2131
2132    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2133        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2134    }
2135    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2136        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2137    };
2138    local_var_req_builder = local_var_req_builder.json(&edit_data_table_config_request);
2139
2140    let local_var_req = local_var_req_builder.build()?;
2141    let local_var_resp = local_var_client.execute(local_var_req).await?;
2142
2143    let local_var_status = local_var_resp.status();
2144    let local_var_content = local_var_resp.text().await?;
2145
2146    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2147        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2148    } else {
2149        let local_var_entity: Option<EditDataTableConfigError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2150        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2151        Err(Error::ResponseError(local_var_error))
2152    }
2153}
2154
2155pub async fn edit_dbt_warehouses(configuration: &configuration::Configuration, workspace: &str, edit_dbt_warehouses_request: models::EditDbtWarehousesRequest) -> Result<serde_json::Value, Error<EditDbtWarehousesError>> {
2156    let local_var_configuration = configuration;
2157
2158    let local_var_client = &local_var_configuration.client;
2159
2160    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_dbt_warehouses", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2161    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2162
2163    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2164        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2165    }
2166    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2167        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2168    };
2169    local_var_req_builder = local_var_req_builder.json(&edit_dbt_warehouses_request);
2170
2171    let local_var_req = local_var_req_builder.build()?;
2172    let local_var_resp = local_var_client.execute(local_var_req).await?;
2173
2174    let local_var_status = local_var_resp.status();
2175    let local_var_content = local_var_resp.text().await?;
2176
2177    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2178        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2179    } else {
2180        let local_var_entity: Option<EditDbtWarehousesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2181        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2182        Err(Error::ResponseError(local_var_error))
2183    }
2184}
2185
2186pub async fn edit_default_scripts(configuration: &configuration::Configuration, workspace: &str, workspace_default_scripts: Option<models::WorkspaceDefaultScripts>) -> Result<String, Error<EditDefaultScriptsError>> {
2187    let local_var_configuration = configuration;
2188
2189    let local_var_client = &local_var_configuration.client;
2190
2191    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/default_scripts", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2192    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2193
2194    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2195        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2196    }
2197    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2198        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2199    };
2200    local_var_req_builder = local_var_req_builder.json(&workspace_default_scripts);
2201
2202    let local_var_req = local_var_req_builder.build()?;
2203    let local_var_resp = local_var_client.execute(local_var_req).await?;
2204
2205    let local_var_status = local_var_resp.status();
2206    let local_var_content = local_var_resp.text().await?;
2207
2208    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2209        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2210    } else {
2211        let local_var_entity: Option<EditDefaultScriptsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2212        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2213        Err(Error::ResponseError(local_var_error))
2214    }
2215}
2216
2217pub async fn edit_ducklake_config(configuration: &configuration::Configuration, workspace: &str, edit_ducklake_config_request: models::EditDucklakeConfigRequest) -> Result<serde_json::Value, Error<EditDucklakeConfigError>> {
2218    let local_var_configuration = configuration;
2219
2220    let local_var_client = &local_var_configuration.client;
2221
2222    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_ducklake_config", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2223    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2224
2225    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2226        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2227    }
2228    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2229        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2230    };
2231    local_var_req_builder = local_var_req_builder.json(&edit_ducklake_config_request);
2232
2233    let local_var_req = local_var_req_builder.build()?;
2234    let local_var_resp = local_var_client.execute(local_var_req).await?;
2235
2236    let local_var_status = local_var_resp.status();
2237    let local_var_content = local_var_resp.text().await?;
2238
2239    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2240        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2241    } else {
2242        let local_var_entity: Option<EditDucklakeConfigError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2243        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2244        Err(Error::ResponseError(local_var_error))
2245    }
2246}
2247
2248pub async fn edit_error_handler(configuration: &configuration::Configuration, workspace: &str, edit_error_handler: models::EditErrorHandler) -> Result<String, Error<EditErrorHandlerError>> {
2249    let local_var_configuration = configuration;
2250
2251    let local_var_client = &local_var_configuration.client;
2252
2253    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_error_handler", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2254    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2255
2256    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2257        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2258    }
2259    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2260        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2261    };
2262    local_var_req_builder = local_var_req_builder.json(&edit_error_handler);
2263
2264    let local_var_req = local_var_req_builder.build()?;
2265    let local_var_resp = local_var_client.execute(local_var_req).await?;
2266
2267    let local_var_status = local_var_resp.status();
2268    let local_var_content = local_var_resp.text().await?;
2269
2270    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2271        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2272    } else {
2273        let local_var_entity: Option<EditErrorHandlerError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2274        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2275        Err(Error::ResponseError(local_var_error))
2276    }
2277}
2278
2279pub async fn edit_git_sync_repository(configuration: &configuration::Configuration, workspace: &str, edit_git_sync_repository_request: models::EditGitSyncRepositoryRequest) -> Result<serde_json::Value, Error<EditGitSyncRepositoryError>> {
2280    let local_var_configuration = configuration;
2281
2282    let local_var_client = &local_var_configuration.client;
2283
2284    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_git_sync_repository", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2285    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2286
2287    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2288        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2289    }
2290    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2291        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2292    };
2293    local_var_req_builder = local_var_req_builder.json(&edit_git_sync_repository_request);
2294
2295    let local_var_req = local_var_req_builder.build()?;
2296    let local_var_resp = local_var_client.execute(local_var_req).await?;
2297
2298    let local_var_status = local_var_resp.status();
2299    let local_var_content = local_var_resp.text().await?;
2300
2301    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2302        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2303    } else {
2304        let local_var_entity: Option<EditGitSyncRepositoryError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2305        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2306        Err(Error::ResponseError(local_var_error))
2307    }
2308}
2309
2310/// Guests are people the identity provider authenticates who have no Windmill account; the `guest` app execution mode admits them. Off by default. Re-read where a guest session is minted and at the auth door on every guest request, so turning it off takes effect immediately, for sessions already issued and for apps whose policy already says `guest`. Turning it *on* is refused with a 400 where guests are unavailable (the shared cloud); turning it off always works.
2311pub async fn edit_guest_access(configuration: &configuration::Configuration, workspace: &str, edit_guest_access_request: models::EditGuestAccessRequest) -> Result<String, Error<EditGuestAccessError>> {
2312    let local_var_configuration = configuration;
2313
2314    let local_var_client = &local_var_configuration.client;
2315
2316    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_guest_access", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2317    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2318
2319    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2320        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2321    }
2322    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2323        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2324    };
2325    local_var_req_builder = local_var_req_builder.json(&edit_guest_access_request);
2326
2327    let local_var_req = local_var_req_builder.build()?;
2328    let local_var_resp = local_var_client.execute(local_var_req).await?;
2329
2330    let local_var_status = local_var_resp.status();
2331    let local_var_content = local_var_resp.text().await?;
2332
2333    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2334        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2335    } else {
2336        let local_var_entity: Option<EditGuestAccessError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2337        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2338        Err(Error::ResponseError(local_var_error))
2339    }
2340}
2341
2342/// A guest JWT (`jwt_guest_`) is minted by the embedding customer's own backend and verified against this key: a PEM public key (RS/ES family, HS* refused) or a JWKS URL, at most one. Both empty clears the workspace key; off cloud, verification then falls back to the instance issuer (`JWT_EXT_JWKS_URL`) if one is set, else no guest JWT is accepted (`guest_access_enabled` is the on/off switch). Workspace-admin gated. The key is validated before it is stored. Setting a key is refused with a 400 where guests are unavailable (the shared cloud); clearing one always works.
2343pub async fn edit_guest_jwt_key(configuration: &configuration::Configuration, workspace: &str, edit_guest_jwt_key_request: models::EditGuestJwtKeyRequest) -> Result<String, Error<EditGuestJwtKeyError>> {
2344    let local_var_configuration = configuration;
2345
2346    let local_var_client = &local_var_configuration.client;
2347
2348    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_guest_jwt_key", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2349    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2350
2351    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2352        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2353    }
2354    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2355        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2356    };
2357    local_var_req_builder = local_var_req_builder.json(&edit_guest_jwt_key_request);
2358
2359    let local_var_req = local_var_req_builder.build()?;
2360    let local_var_resp = local_var_client.execute(local_var_req).await?;
2361
2362    let local_var_status = local_var_resp.status();
2363    let local_var_content = local_var_resp.text().await?;
2364
2365    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2366        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2367    } else {
2368        let local_var_entity: Option<EditGuestJwtKeyError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2369        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2370        Err(Error::ResponseError(local_var_error))
2371    }
2372}
2373
2374pub async fn edit_instance_groups(configuration: &configuration::Configuration, workspace: &str, edit_instance_groups_request: models::EditInstanceGroupsRequest) -> Result<String, Error<EditInstanceGroupsError>> {
2375    let local_var_configuration = configuration;
2376
2377    let local_var_client = &local_var_configuration.client;
2378
2379    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_instance_groups", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2380    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2381
2382    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2383        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2384    }
2385    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2386        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2387    };
2388    local_var_req_builder = local_var_req_builder.json(&edit_instance_groups_request);
2389
2390    let local_var_req = local_var_req_builder.build()?;
2391    let local_var_resp = local_var_client.execute(local_var_req).await?;
2392
2393    let local_var_status = local_var_resp.status();
2394    let local_var_content = local_var_resp.text().await?;
2395
2396    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2397        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2398    } else {
2399        let local_var_entity: Option<EditInstanceGroupsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2400        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2401        Err(Error::ResponseError(local_var_error))
2402    }
2403}
2404
2405pub 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>> {
2406    let local_var_configuration = configuration;
2407
2408    let local_var_client = &local_var_configuration.client;
2409
2410    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_large_file_storage_config", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2411    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2412
2413    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2414        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2415    }
2416    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2417        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2418    };
2419    local_var_req_builder = local_var_req_builder.json(&edit_large_file_storage_config_request);
2420
2421    let local_var_req = local_var_req_builder.build()?;
2422    let local_var_resp = local_var_client.execute(local_var_req).await?;
2423
2424    let local_var_status = local_var_resp.status();
2425    let local_var_content = local_var_resp.text().await?;
2426
2427    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2428        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2429    } else {
2430        let local_var_entity: Option<EditLargeFileStorageConfigError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2431        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2432        Err(Error::ResponseError(local_var_error))
2433    }
2434}
2435
2436pub async fn edit_slack_command(configuration: &configuration::Configuration, workspace: &str, edit_slack_command_request: models::EditSlackCommandRequest) -> Result<String, Error<EditSlackCommandError>> {
2437    let local_var_configuration = configuration;
2438
2439    let local_var_client = &local_var_configuration.client;
2440
2441    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_slack_command", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2442    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2443
2444    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2445        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2446    }
2447    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2448        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2449    };
2450    local_var_req_builder = local_var_req_builder.json(&edit_slack_command_request);
2451
2452    let local_var_req = local_var_req_builder.build()?;
2453    let local_var_resp = local_var_client.execute(local_var_req).await?;
2454
2455    let local_var_status = local_var_resp.status();
2456    let local_var_content = local_var_resp.text().await?;
2457
2458    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2459        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2460    } else {
2461        let local_var_entity: Option<EditSlackCommandError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2462        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2463        Err(Error::ResponseError(local_var_error))
2464    }
2465}
2466
2467pub async fn edit_success_handler(configuration: &configuration::Configuration, workspace: &str, edit_success_handler: models::EditSuccessHandler) -> Result<String, Error<EditSuccessHandlerError>> {
2468    let local_var_configuration = configuration;
2469
2470    let local_var_client = &local_var_configuration.client;
2471
2472    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_success_handler", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2473    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2474
2475    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2476        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2477    }
2478    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2479        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2480    };
2481    local_var_req_builder = local_var_req_builder.json(&edit_success_handler);
2482
2483    let local_var_req = local_var_req_builder.build()?;
2484    let local_var_resp = local_var_client.execute(local_var_req).await?;
2485
2486    let local_var_status = local_var_resp.status();
2487    let local_var_content = local_var_resp.text().await?;
2488
2489    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2490        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2491    } else {
2492        let local_var_entity: Option<EditSuccessHandlerError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2493        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2494        Err(Error::ResponseError(local_var_error))
2495    }
2496}
2497
2498pub async fn edit_teams_command(configuration: &configuration::Configuration, workspace: &str, edit_slack_command_request: models::EditSlackCommandRequest) -> Result<String, Error<EditTeamsCommandError>> {
2499    let local_var_configuration = configuration;
2500
2501    let local_var_client = &local_var_configuration.client;
2502
2503    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_teams_command", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2504    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2505
2506    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2507        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2508    }
2509    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2510        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2511    };
2512    local_var_req_builder = local_var_req_builder.json(&edit_slack_command_request);
2513
2514    let local_var_req = local_var_req_builder.build()?;
2515    let local_var_resp = local_var_client.execute(local_var_req).await?;
2516
2517    let local_var_status = local_var_resp.status();
2518    let local_var_content = local_var_resp.text().await?;
2519
2520    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2521        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2522    } else {
2523        let local_var_entity: Option<EditTeamsCommandError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2524        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2525        Err(Error::ResponseError(local_var_error))
2526    }
2527}
2528
2529pub async fn edit_webhook(configuration: &configuration::Configuration, workspace: &str, edit_webhook_request: models::EditWebhookRequest) -> Result<String, Error<EditWebhookError>> {
2530    let local_var_configuration = configuration;
2531
2532    let local_var_client = &local_var_configuration.client;
2533
2534    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_webhook", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2535    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2536
2537    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2538        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2539    }
2540    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2541        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2542    };
2543    local_var_req_builder = local_var_req_builder.json(&edit_webhook_request);
2544
2545    let local_var_req = local_var_req_builder.build()?;
2546    let local_var_resp = local_var_client.execute(local_var_req).await?;
2547
2548    let local_var_status = local_var_resp.status();
2549    let local_var_content = local_var_resp.text().await?;
2550
2551    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2552        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2553    } else {
2554        let local_var_entity: Option<EditWebhookError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2555        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2556        Err(Error::ResponseError(local_var_error))
2557    }
2558}
2559
2560pub async fn edit_workspace_default_app(configuration: &configuration::Configuration, workspace: &str, edit_workspace_default_app_request: models::EditWorkspaceDefaultAppRequest) -> Result<String, Error<EditWorkspaceDefaultAppError>> {
2561    let local_var_configuration = configuration;
2562
2563    let local_var_client = &local_var_configuration.client;
2564
2565    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_default_app", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2566    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2567
2568    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2569        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2570    }
2571    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2572        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2573    };
2574    local_var_req_builder = local_var_req_builder.json(&edit_workspace_default_app_request);
2575
2576    let local_var_req = local_var_req_builder.build()?;
2577    let local_var_resp = local_var_client.execute(local_var_req).await?;
2578
2579    let local_var_status = local_var_resp.status();
2580    let local_var_content = local_var_resp.text().await?;
2581
2582    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2583        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2584    } else {
2585        let local_var_entity: Option<EditWorkspaceDefaultAppError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2586        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2587        Err(Error::ResponseError(local_var_error))
2588    }
2589}
2590
2591pub 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>> {
2592    let local_var_configuration = configuration;
2593
2594    let local_var_client = &local_var_configuration.client;
2595
2596    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_deploy_ui_config", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2597    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2598
2599    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2600        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2601    }
2602    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2603        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2604    };
2605    local_var_req_builder = local_var_req_builder.json(&edit_workspace_deploy_ui_settings_request);
2606
2607    let local_var_req = local_var_req_builder.build()?;
2608    let local_var_resp = local_var_client.execute(local_var_req).await?;
2609
2610    let local_var_status = local_var_resp.status();
2611    let local_var_content = local_var_resp.text().await?;
2612
2613    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2614        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2615    } else {
2616        let local_var_entity: Option<EditWorkspaceDeployUiSettingsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2617        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2618        Err(Error::ResponseError(local_var_error))
2619    }
2620}
2621
2622pub 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>> {
2623    let local_var_configuration = configuration;
2624
2625    let local_var_client = &local_var_configuration.client;
2626
2627    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_git_sync_config", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2628    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2629
2630    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2631        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2632    }
2633    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2634        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2635    };
2636    local_var_req_builder = local_var_req_builder.json(&edit_workspace_git_sync_config_request);
2637
2638    let local_var_req = local_var_req_builder.build()?;
2639    let local_var_resp = local_var_client.execute(local_var_req).await?;
2640
2641    let local_var_status = local_var_resp.status();
2642    let local_var_content = local_var_resp.text().await?;
2643
2644    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2645        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2646    } else {
2647        let local_var_entity: Option<EditWorkspaceGitSyncConfigError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2648        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2649        Err(Error::ResponseError(local_var_error))
2650    }
2651}
2652
2653pub async fn enable_datatable_migrations(configuration: &configuration::Configuration, workspace: &str, datatable_name: &str) -> Result<String, Error<EnableDatatableMigrationsError>> {
2654    let local_var_configuration = configuration;
2655
2656    let local_var_client = &local_var_configuration.client;
2657
2658    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/enable_datatable_migrations/{datatable_name}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), datatable_name=crate::apis::urlencode(datatable_name));
2659    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2660
2661    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2662        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2663    }
2664    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2665        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2666    };
2667
2668    let local_var_req = local_var_req_builder.build()?;
2669    let local_var_resp = local_var_client.execute(local_var_req).await?;
2670
2671    let local_var_status = local_var_resp.status();
2672    let local_var_content = local_var_resp.text().await?;
2673
2674    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2675        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2676    } else {
2677        let local_var_entity: Option<EnableDatatableMigrationsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2678        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2679        Err(Error::ResponseError(local_var_error))
2680    }
2681}
2682
2683pub async fn exists_username(configuration: &configuration::Configuration, exists_username_request: models::ExistsUsernameRequest) -> Result<bool, Error<ExistsUsernameError>> {
2684    let local_var_configuration = configuration;
2685
2686    let local_var_client = &local_var_configuration.client;
2687
2688    let local_var_uri_str = format!("{}/workspaces/exists_username", local_var_configuration.base_path);
2689    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2690
2691    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2692        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2693    }
2694    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2695        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2696    };
2697    local_var_req_builder = local_var_req_builder.json(&exists_username_request);
2698
2699    let local_var_req = local_var_req_builder.build()?;
2700    let local_var_resp = local_var_client.execute(local_var_req).await?;
2701
2702    let local_var_status = local_var_resp.status();
2703    let local_var_content = local_var_resp.text().await?;
2704
2705    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2706        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2707    } else {
2708        let local_var_entity: Option<ExistsUsernameError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2709        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2710        Err(Error::ResponseError(local_var_error))
2711    }
2712}
2713
2714pub async fn exists_workspace(configuration: &configuration::Configuration, exists_workspace_request: models::ExistsWorkspaceRequest) -> Result<bool, Error<ExistsWorkspaceError>> {
2715    let local_var_configuration = configuration;
2716
2717    let local_var_client = &local_var_configuration.client;
2718
2719    let local_var_uri_str = format!("{}/workspaces/exists", local_var_configuration.base_path);
2720    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2721
2722    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2723        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2724    }
2725    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2726        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2727    };
2728    local_var_req_builder = local_var_req_builder.json(&exists_workspace_request);
2729
2730    let local_var_req = local_var_req_builder.build()?;
2731    let local_var_resp = local_var_client.execute(local_var_req).await?;
2732
2733    let local_var_status = local_var_resp.status();
2734    let local_var_content = local_var_resp.text().await?;
2735
2736    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2737        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2738    } else {
2739        let local_var_entity: Option<ExistsWorkspaceError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2740        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2741        Err(Error::ResponseError(local_var_error))
2742    }
2743}
2744
2745pub async fn export_pg_schema(configuration: &configuration::Configuration, workspace: &str, export_pg_schema_request: models::ExportPgSchemaRequest) -> Result<String, Error<ExportPgSchemaError>> {
2746    let local_var_configuration = configuration;
2747
2748    let local_var_client = &local_var_configuration.client;
2749
2750    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/export_pg_schema", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2751    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2752
2753    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2754        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2755    }
2756    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2757        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2758    };
2759    local_var_req_builder = local_var_req_builder.json(&export_pg_schema_request);
2760
2761    let local_var_req = local_var_req_builder.build()?;
2762    let local_var_resp = local_var_client.execute(local_var_req).await?;
2763
2764    let local_var_status = local_var_resp.status();
2765    let local_var_content = local_var_resp.text().await?;
2766
2767    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2768        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2769    } else {
2770        let local_var_entity: Option<ExportPgSchemaError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2771        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2772        Err(Error::ResponseError(local_var_error))
2773    }
2774}
2775
2776pub async fn generate_initial_datatable_migration(configuration: &configuration::Configuration, workspace: &str, datatable_name: &str) -> Result<models::DatatableMigration, Error<GenerateInitialDatatableMigrationError>> {
2777    let local_var_configuration = configuration;
2778
2779    let local_var_client = &local_var_configuration.client;
2780
2781    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/generate_initial_datatable_migration/{datatable_name}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), datatable_name=crate::apis::urlencode(datatable_name));
2782    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2783
2784    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2785        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2786    }
2787    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2788        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2789    };
2790
2791    let local_var_req = local_var_req_builder.build()?;
2792    let local_var_resp = local_var_client.execute(local_var_req).await?;
2793
2794    let local_var_status = local_var_resp.status();
2795    let local_var_content = local_var_resp.text().await?;
2796
2797    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2798        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2799    } else {
2800        let local_var_entity: Option<GenerateInitialDatatableMigrationError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2801        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2802        Err(Error::ResponseError(local_var_error))
2803    }
2804}
2805
2806pub async fn get_billable_seats(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetBillableSeats200Response, Error<GetBillableSeatsError>> {
2807    let local_var_configuration = configuration;
2808
2809    let local_var_client = &local_var_configuration.client;
2810
2811    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/billable_seats", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2812    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2813
2814    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2815        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2816    }
2817    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2818        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2819    };
2820
2821    let local_var_req = local_var_req_builder.build()?;
2822    let local_var_resp = local_var_client.execute(local_var_req).await?;
2823
2824    let local_var_status = local_var_resp.status();
2825    let local_var_content = local_var_resp.text().await?;
2826
2827    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2828        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2829    } else {
2830        let local_var_entity: Option<GetBillableSeatsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2831        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2832        Err(Error::ResponseError(local_var_error))
2833    }
2834}
2835
2836pub async fn get_cloud_quotas(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetCloudQuotas200Response, Error<GetCloudQuotasError>> {
2837    let local_var_configuration = configuration;
2838
2839    let local_var_client = &local_var_configuration.client;
2840
2841    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/cloud_quotas", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2842    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2843
2844    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2845        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2846    }
2847    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2848        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2849    };
2850
2851    let local_var_req = local_var_req_builder.build()?;
2852    let local_var_resp = local_var_client.execute(local_var_req).await?;
2853
2854    let local_var_status = local_var_resp.status();
2855    let local_var_content = local_var_resp.text().await?;
2856
2857    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2858        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2859    } else {
2860        let local_var_entity: Option<GetCloudQuotasError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2861        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2862        Err(Error::ResponseError(local_var_error))
2863    }
2864}
2865
2866pub async fn get_copilot_info(configuration: &configuration::Configuration, workspace: &str) -> Result<models::AiConfig, Error<GetCopilotInfoError>> {
2867    let local_var_configuration = configuration;
2868
2869    let local_var_client = &local_var_configuration.client;
2870
2871    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_copilot_info", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2872    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2873
2874    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2875        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2876    }
2877    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2878        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2879    };
2880
2881    let local_var_req = local_var_req_builder.build()?;
2882    let local_var_resp = local_var_client.execute(local_var_req).await?;
2883
2884    let local_var_status = local_var_resp.status();
2885    let local_var_content = local_var_resp.text().await?;
2886
2887    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2888        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2889    } else {
2890        let local_var_entity: Option<GetCopilotInfoError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2891        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2892        Err(Error::ResponseError(local_var_error))
2893    }
2894}
2895
2896pub async fn get_copilot_settings_state(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetCopilotSettingsState200Response, Error<GetCopilotSettingsStateError>> {
2897    let local_var_configuration = configuration;
2898
2899    let local_var_client = &local_var_configuration.client;
2900
2901    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_copilot_settings_state", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2902    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2903
2904    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2905        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2906    }
2907    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2908        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2909    };
2910
2911    let local_var_req = local_var_req_builder.build()?;
2912    let local_var_resp = local_var_client.execute(local_var_req).await?;
2913
2914    let local_var_status = local_var_resp.status();
2915    let local_var_content = local_var_resp.text().await?;
2916
2917    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2918        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2919    } else {
2920        let local_var_entity: Option<GetCopilotSettingsStateError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2921        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2922        Err(Error::ResponseError(local_var_error))
2923    }
2924}
2925
2926pub async fn get_data_table_table_schema(configuration: &configuration::Configuration, workspace: &str, datatable_name: &str, schema_name: &str, table_name: &str, role: Option<&str>) -> Result<models::DataTableTableSchema, Error<GetDataTableTableSchemaError>> {
2927    let local_var_configuration = configuration;
2928
2929    let local_var_client = &local_var_configuration.client;
2930
2931    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_datatable_table_schema", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2932    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2933
2934    local_var_req_builder = local_var_req_builder.query(&[("datatable_name", &datatable_name.to_string())]);
2935    local_var_req_builder = local_var_req_builder.query(&[("schema_name", &schema_name.to_string())]);
2936    local_var_req_builder = local_var_req_builder.query(&[("table_name", &table_name.to_string())]);
2937    if let Some(ref local_var_str) = role {
2938        local_var_req_builder = local_var_req_builder.query(&[("role", &local_var_str.to_string())]);
2939    }
2940    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2941        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2942    }
2943    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2944        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2945    };
2946
2947    let local_var_req = local_var_req_builder.build()?;
2948    let local_var_resp = local_var_client.execute(local_var_req).await?;
2949
2950    let local_var_status = local_var_resp.status();
2951    let local_var_content = local_var_resp.text().await?;
2952
2953    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2954        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2955    } else {
2956        let local_var_entity: Option<GetDataTableTableSchemaError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2957        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2958        Err(Error::ResponseError(local_var_error))
2959    }
2960}
2961
2962pub async fn get_datatable_acl(configuration: &configuration::Configuration, workspace: &str, datatable_name: &str, kind: &str, schema: Option<&str>, table: Option<&str>) -> Result<models::DatatableAclInfo, Error<GetDatatableAclError>> {
2963    let local_var_configuration = configuration;
2964
2965    let local_var_client = &local_var_configuration.client;
2966
2967    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/datatable_acl/{datatable_name}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), datatable_name=crate::apis::urlencode(datatable_name));
2968    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2969
2970    local_var_req_builder = local_var_req_builder.query(&[("kind", &kind.to_string())]);
2971    if let Some(ref local_var_str) = schema {
2972        local_var_req_builder = local_var_req_builder.query(&[("schema", &local_var_str.to_string())]);
2973    }
2974    if let Some(ref local_var_str) = table {
2975        local_var_req_builder = local_var_req_builder.query(&[("table", &local_var_str.to_string())]);
2976    }
2977    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2978        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2979    }
2980    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2981        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2982    };
2983
2984    let local_var_req = local_var_req_builder.build()?;
2985    let local_var_resp = local_var_client.execute(local_var_req).await?;
2986
2987    let local_var_status = local_var_resp.status();
2988    let local_var_content = local_var_resp.text().await?;
2989
2990    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2991        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2992    } else {
2993        let local_var_entity: Option<GetDatatableAclError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2994        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2995        Err(Error::ResponseError(local_var_error))
2996    }
2997}
2998
2999pub 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>> {
3000    let local_var_configuration = configuration;
3001
3002    let local_var_client = &local_var_configuration.client;
3003
3004    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_datatable_full_schema", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3005    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3006
3007    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3008        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3009    }
3010    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3011        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3012    };
3013    local_var_req_builder = local_var_req_builder.json(&get_datatable_full_schema_request);
3014
3015    let local_var_req = local_var_req_builder.build()?;
3016    let local_var_resp = local_var_client.execute(local_var_req).await?;
3017
3018    let local_var_status = local_var_resp.status();
3019    let local_var_content = local_var_resp.text().await?;
3020
3021    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3022        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3023    } else {
3024        let local_var_entity: Option<GetDatatableFullSchemaError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3025        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3026        Err(Error::ResponseError(local_var_error))
3027    }
3028}
3029
3030pub async fn get_datatable_migrations_status(configuration: &configuration::Configuration, workspace: &str, datatable_name: &str) -> Result<models::GetDatatableMigrationsStatus200Response, Error<GetDatatableMigrationsStatusError>> {
3031    let local_var_configuration = configuration;
3032
3033    let local_var_client = &local_var_configuration.client;
3034
3035    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/datatable_migrations_status/{datatable_name}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), datatable_name=crate::apis::urlencode(datatable_name));
3036    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3037
3038    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3039        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3040    }
3041    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3042        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3043    };
3044
3045    let local_var_req = local_var_req_builder.build()?;
3046    let local_var_resp = local_var_client.execute(local_var_req).await?;
3047
3048    let local_var_status = local_var_resp.status();
3049    let local_var_content = local_var_resp.text().await?;
3050
3051    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3052        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3053    } else {
3054        let local_var_entity: Option<GetDatatableMigrationsStatusError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3055        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3056        Err(Error::ResponseError(local_var_error))
3057    }
3058}
3059
3060pub async fn get_datatable_permissions(configuration: &configuration::Configuration, workspace: &str, datatable_name: &str) -> Result<models::DatatablePermissions, Error<GetDatatablePermissionsError>> {
3061    let local_var_configuration = configuration;
3062
3063    let local_var_client = &local_var_configuration.client;
3064
3065    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/datatable_permissions/{datatable_name}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), datatable_name=crate::apis::urlencode(datatable_name));
3066    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3067
3068    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3069        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3070    }
3071    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3072        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3073    };
3074
3075    let local_var_req = local_var_req_builder.build()?;
3076    let local_var_resp = local_var_client.execute(local_var_req).await?;
3077
3078    let local_var_status = local_var_resp.status();
3079    let local_var_content = local_var_resp.text().await?;
3080
3081    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3082        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3083    } else {
3084        let local_var_entity: Option<GetDatatablePermissionsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3085        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3086        Err(Error::ResponseError(local_var_error))
3087    }
3088}
3089
3090pub async fn get_default_scripts(configuration: &configuration::Configuration, workspace: &str) -> Result<models::WorkspaceDefaultScripts, Error<GetDefaultScriptsError>> {
3091    let local_var_configuration = configuration;
3092
3093    let local_var_client = &local_var_configuration.client;
3094
3095    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/default_scripts", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3096    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3097
3098    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3099        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3100    }
3101    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3102        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3103    };
3104
3105    let local_var_req = local_var_req_builder.build()?;
3106    let local_var_resp = local_var_client.execute(local_var_req).await?;
3107
3108    let local_var_status = local_var_resp.status();
3109    let local_var_content = local_var_resp.text().await?;
3110
3111    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3112        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3113    } else {
3114        let local_var_entity: Option<GetDefaultScriptsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3115        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3116        Err(Error::ResponseError(local_var_error))
3117    }
3118}
3119
3120pub async fn get_dependency_map(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<models::DependencyMap>, Error<GetDependencyMapError>> {
3121    let local_var_configuration = configuration;
3122
3123    let local_var_client = &local_var_configuration.client;
3124
3125    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_dependency_map", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3126    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3127
3128    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3129        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3130    }
3131    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3132        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3133    };
3134
3135    let local_var_req = local_var_req_builder.build()?;
3136    let local_var_resp = local_var_client.execute(local_var_req).await?;
3137
3138    let local_var_status = local_var_resp.status();
3139    let local_var_content = local_var_resp.text().await?;
3140
3141    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3142        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3143    } else {
3144        let local_var_entity: Option<GetDependencyMapError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3145        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3146        Err(Error::ResponseError(local_var_error))
3147    }
3148}
3149
3150pub async fn get_dependents(configuration: &configuration::Configuration, workspace: &str, imported_path: &str) -> Result<Vec<models::DependencyDependent>, Error<GetDependentsError>> {
3151    let local_var_configuration = configuration;
3152
3153    let local_var_client = &local_var_configuration.client;
3154
3155    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));
3156    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3157
3158    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3159        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3160    }
3161    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3162        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3163    };
3164
3165    let local_var_req = local_var_req_builder.build()?;
3166    let local_var_resp = local_var_client.execute(local_var_req).await?;
3167
3168    let local_var_status = local_var_resp.status();
3169    let local_var_content = local_var_resp.text().await?;
3170
3171    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3172        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3173    } else {
3174        let local_var_entity: Option<GetDependentsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3175        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3176        Err(Error::ResponseError(local_var_error))
3177    }
3178}
3179
3180pub async fn get_dependents_amounts(configuration: &configuration::Configuration, workspace: &str, request_body: Vec<String>) -> Result<Vec<models::DependentsAmount>, Error<GetDependentsAmountsError>> {
3181    let local_var_configuration = configuration;
3182
3183    let local_var_client = &local_var_configuration.client;
3184
3185    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_dependents_amounts", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3186    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3187
3188    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3189        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3190    }
3191    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3192        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3193    };
3194    local_var_req_builder = local_var_req_builder.json(&request_body);
3195
3196    let local_var_req = local_var_req_builder.build()?;
3197    let local_var_resp = local_var_client.execute(local_var_req).await?;
3198
3199    let local_var_status = local_var_resp.status();
3200    let local_var_content = local_var_resp.text().await?;
3201
3202    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3203        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3204    } else {
3205        let local_var_entity: Option<GetDependentsAmountsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3206        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3207        Err(Error::ResponseError(local_var_error))
3208    }
3209}
3210
3211pub async fn get_deploy_to(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetDeployTo200Response, Error<GetDeployToError>> {
3212    let local_var_configuration = configuration;
3213
3214    let local_var_client = &local_var_configuration.client;
3215
3216    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_deploy_to", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3217    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3218
3219    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3220        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3221    }
3222    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3223        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3224    };
3225
3226    let local_var_req = local_var_req_builder.build()?;
3227    let local_var_resp = local_var_client.execute(local_var_req).await?;
3228
3229    let local_var_status = local_var_resp.status();
3230    let local_var_content = local_var_resp.text().await?;
3231
3232    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3233        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3234    } else {
3235        let local_var_entity: Option<GetDeployToError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3236        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3237        Err(Error::ResponseError(local_var_error))
3238    }
3239}
3240
3241pub async fn get_dev_workspace(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetDevWorkspace200Response, Error<GetDevWorkspaceError>> {
3242    let local_var_configuration = configuration;
3243
3244    let local_var_client = &local_var_configuration.client;
3245
3246    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_dev_workspace", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3247    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3248
3249    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3250        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3251    }
3252    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3253        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3254    };
3255
3256    let local_var_req = local_var_req_builder.build()?;
3257    let local_var_resp = local_var_client.execute(local_var_req).await?;
3258
3259    let local_var_status = local_var_resp.status();
3260    let local_var_content = local_var_resp.text().await?;
3261
3262    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3263        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3264    } else {
3265        let local_var_entity: Option<GetDevWorkspaceError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3266        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3267        Err(Error::ResponseError(local_var_error))
3268    }
3269}
3270
3271pub async fn get_git_sync_deploy_mode(configuration: &configuration::Configuration, workspace: &str, branch: Option<&str>) -> Result<models::GetGitSyncDeployMode200Response, Error<GetGitSyncDeployModeError>> {
3272    let local_var_configuration = configuration;
3273
3274    let local_var_client = &local_var_configuration.client;
3275
3276    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/git_sync_deploy_mode", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3277    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3278
3279    if let Some(ref local_var_str) = branch {
3280        local_var_req_builder = local_var_req_builder.query(&[("branch", &local_var_str.to_string())]);
3281    }
3282    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3283        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3284    }
3285    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3286        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3287    };
3288
3289    let local_var_req = local_var_req_builder.build()?;
3290    let local_var_resp = local_var_client.execute(local_var_req).await?;
3291
3292    let local_var_status = local_var_resp.status();
3293    let local_var_content = local_var_resp.text().await?;
3294
3295    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3296        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3297    } else {
3298        let local_var_entity: Option<GetGitSyncDeployModeError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3299        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3300        Err(Error::ResponseError(local_var_error))
3301    }
3302}
3303
3304pub async fn get_git_sync_enabled(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetGitSyncEnabled200Response, Error<GetGitSyncEnabledError>> {
3305    let local_var_configuration = configuration;
3306
3307    let local_var_client = &local_var_configuration.client;
3308
3309    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/git_sync_enabled", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3310    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3311
3312    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3313        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3314    }
3315    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3316        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3317    };
3318
3319    let local_var_req = local_var_req_builder.build()?;
3320    let local_var_resp = local_var_client.execute(local_var_req).await?;
3321
3322    let local_var_status = local_var_resp.status();
3323    let local_var_content = local_var_resp.text().await?;
3324
3325    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3326        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3327    } else {
3328        let local_var_entity: Option<GetGitSyncEnabledError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3329        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3330        Err(Error::ResponseError(local_var_error))
3331    }
3332}
3333
3334pub async fn get_github_app_repo_archive(configuration: &configuration::Configuration, workspace: &str, path: &str, r#ref: Option<&str>) -> Result<std::path::PathBuf, Error<GetGithubAppRepoArchiveError>> {
3335    let local_var_configuration = configuration;
3336
3337    let local_var_client = &local_var_configuration.client;
3338
3339    let local_var_uri_str = format!("{}/w/{workspace}/github_app/repo_archive/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
3340    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3341
3342    if let Some(ref local_var_str) = r#ref {
3343        local_var_req_builder = local_var_req_builder.query(&[("ref", &local_var_str.to_string())]);
3344    }
3345    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3346        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3347    }
3348    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3349        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3350    };
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<GetGithubAppRepoArchiveError> = 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 get_github_app_token(configuration: &configuration::Configuration, workspace: &str, get_github_app_token_request: models::GetGithubAppTokenRequest) -> Result<models::GetGithubAppToken200Response, Error<GetGithubAppTokenError>> {
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}/github_app/token", 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(&get_github_app_token_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<GetGithubAppTokenError> = 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
3398/// Instance-wide, since a licence is per instance and one email is one guest however many workspaces it opens. Read by workspace admins and app publishers to see how close the cap (Community and Pro) or the meter (Enterprise) is.
3399pub async fn get_guest_usage(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GuestUsage, Error<GetGuestUsageError>> {
3400    let local_var_configuration = configuration;
3401
3402    let local_var_client = &local_var_configuration.client;
3403
3404    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/guest_usage", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3405    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3406
3407    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3408        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3409    }
3410    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3411        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3412    };
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<GetGuestUsageError> = 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 get_imports(configuration: &configuration::Configuration, workspace: &str, importer_path: &str) -> Result<Vec<String>, Error<GetImportsError>> {
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/get_imports/{importer_path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), importer_path=crate::apis::urlencode(importer_path));
3435    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, 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
3444    let local_var_req = local_var_req_builder.build()?;
3445    let local_var_resp = local_var_client.execute(local_var_req).await?;
3446
3447    let local_var_status = local_var_resp.status();
3448    let local_var_content = local_var_resp.text().await?;
3449
3450    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3451        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3452    } else {
3453        let local_var_entity: Option<GetImportsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3454        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3455        Err(Error::ResponseError(local_var_error))
3456    }
3457}
3458
3459pub async fn get_is_premium(configuration: &configuration::Configuration, workspace: &str) -> Result<bool, Error<GetIsPremiumError>> {
3460    let local_var_configuration = configuration;
3461
3462    let local_var_client = &local_var_configuration.client;
3463
3464    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/is_premium", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3465    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3466
3467    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3468        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3469    }
3470    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3471        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3472    };
3473
3474    let local_var_req = local_var_req_builder.build()?;
3475    let local_var_resp = local_var_client.execute(local_var_req).await?;
3476
3477    let local_var_status = local_var_resp.status();
3478    let local_var_content = local_var_resp.text().await?;
3479
3480    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3481        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3482    } else {
3483        let local_var_entity: Option<GetIsPremiumError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3484        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3485        Err(Error::ResponseError(local_var_error))
3486    }
3487}
3488
3489pub async fn get_open_deployment_request(configuration: &configuration::Configuration, workspace: &str) -> Result<models::DeploymentRequest, Error<GetOpenDeploymentRequestError>> {
3490    let local_var_configuration = configuration;
3491
3492    let local_var_client = &local_var_configuration.client;
3493
3494    let local_var_uri_str = format!("{}/w/{workspace}/deployment_request/open", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3495    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3496
3497    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3498        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3499    }
3500    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3501        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3502    };
3503
3504    let local_var_req = local_var_req_builder.build()?;
3505    let local_var_resp = local_var_client.execute(local_var_req).await?;
3506
3507    let local_var_status = local_var_resp.status();
3508    let local_var_content = local_var_resp.text().await?;
3509
3510    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3511        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3512    } else {
3513        let local_var_entity: Option<GetOpenDeploymentRequestError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3514        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3515        Err(Error::ResponseError(local_var_error))
3516    }
3517}
3518
3519pub async fn get_premium_info(configuration: &configuration::Configuration, workspace: &str, skip_subscription_fetch: Option<bool>) -> Result<models::GetPremiumInfo200Response, Error<GetPremiumInfoError>> {
3520    let local_var_configuration = configuration;
3521
3522    let local_var_client = &local_var_configuration.client;
3523
3524    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/premium_info", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3525    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3526
3527    if let Some(ref local_var_str) = skip_subscription_fetch {
3528        local_var_req_builder = local_var_req_builder.query(&[("skip_subscription_fetch", &local_var_str.to_string())]);
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<GetPremiumInfoError> = 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/// Returns the subset of workspace settings safe to expose to any workspace member. The full settings struct is admin-only via `getSettings`.
3553pub async fn get_public_settings(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetPublicSettings200Response, Error<GetPublicSettingsError>> {
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/get_public_settings", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3559    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, 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
3568    let local_var_req = local_var_req_builder.build()?;
3569    let local_var_resp = local_var_client.execute(local_var_req).await?;
3570
3571    let local_var_status = local_var_resp.status();
3572    let local_var_content = local_var_resp.text().await?;
3573
3574    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3575        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3576    } else {
3577        let local_var_entity: Option<GetPublicSettingsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3578        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3579        Err(Error::ResponseError(local_var_error))
3580    }
3581}
3582
3583/// Once connected, deploy calls aimed at the target go through `/w/{workspace}/remote_deploy/proxy/{proxy_key}/{route}`, which forwards any method to `{base_url}/api/w/{target workspace}/{route}` with the caller's stored token. 
3584pub async fn get_remote_deploy_target(configuration: &configuration::Configuration, workspace: &str) -> Result<models::RemoteDeployStatus, Error<GetRemoteDeployTargetError>> {
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}/remote_deploy/target", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3590    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, 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
3599    let local_var_req = local_var_req_builder.build()?;
3600    let local_var_resp = local_var_client.execute(local_var_req).await?;
3601
3602    let local_var_status = local_var_resp.status();
3603    let local_var_content = local_var_resp.text().await?;
3604
3605    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3606        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3607    } else {
3608        let local_var_entity: Option<GetRemoteDeployTargetError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3609        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3610        Err(Error::ResponseError(local_var_error))
3611    }
3612}
3613
3614pub async fn get_session_workspace_retention(configuration: &configuration::Configuration, get_session_workspace_status_request: models::GetSessionWorkspaceStatusRequest) -> Result<std::collections::HashMap<String, i32>, Error<GetSessionWorkspaceRetentionError>> {
3615    let local_var_configuration = configuration;
3616
3617    let local_var_client = &local_var_configuration.client;
3618
3619    let local_var_uri_str = format!("{}/workspaces/session_workspace_retention", local_var_configuration.base_path);
3620    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3621
3622    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3623        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3624    }
3625    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3626        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3627    };
3628    local_var_req_builder = local_var_req_builder.json(&get_session_workspace_status_request);
3629
3630    let local_var_req = local_var_req_builder.build()?;
3631    let local_var_resp = local_var_client.execute(local_var_req).await?;
3632
3633    let local_var_status = local_var_resp.status();
3634    let local_var_content = local_var_resp.text().await?;
3635
3636    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3637        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3638    } else {
3639        let local_var_entity: Option<GetSessionWorkspaceRetentionError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3640        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3641        Err(Error::ResponseError(local_var_error))
3642    }
3643}
3644
3645pub async fn get_session_workspace_status(configuration: &configuration::Configuration, get_session_workspace_status_request: models::GetSessionWorkspaceStatusRequest) -> Result<std::collections::HashMap<String, String>, Error<GetSessionWorkspaceStatusError>> {
3646    let local_var_configuration = configuration;
3647
3648    let local_var_client = &local_var_configuration.client;
3649
3650    let local_var_uri_str = format!("{}/workspaces/session_workspace_status", local_var_configuration.base_path);
3651    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3652
3653    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3654        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3655    }
3656    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3657        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3658    };
3659    local_var_req_builder = local_var_req_builder.json(&get_session_workspace_status_request);
3660
3661    let local_var_req = local_var_req_builder.build()?;
3662    let local_var_resp = local_var_client.execute(local_var_req).await?;
3663
3664    let local_var_status = local_var_resp.status();
3665    let local_var_content = local_var_resp.text().await?;
3666
3667    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3668        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3669    } else {
3670        let local_var_entity: Option<GetSessionWorkspaceStatusError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3671        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3672        Err(Error::ResponseError(local_var_error))
3673    }
3674}
3675
3676/// Returns the full workspace settings including admin-managed integration credentials. Admin-only — non-admin callers should use `getPublicSettings`.
3677pub async fn get_settings(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetSettings200Response, Error<GetSettingsError>> {
3678    let local_var_configuration = configuration;
3679
3680    let local_var_client = &local_var_configuration.client;
3681
3682    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_settings", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3683    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3684
3685    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3686        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3687    }
3688    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3689        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3690    };
3691
3692    let local_var_req = local_var_req_builder.build()?;
3693    let local_var_resp = local_var_client.execute(local_var_req).await?;
3694
3695    let local_var_status = local_var_resp.status();
3696    let local_var_content = local_var_resp.text().await?;
3697
3698    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3699        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3700    } else {
3701        let local_var_entity: Option<GetSettingsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3702        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3703        Err(Error::ResponseError(local_var_error))
3704    }
3705}
3706
3707pub async fn get_shared_ui(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetSharedUi200Response, Error<GetSharedUiError>> {
3708    let local_var_configuration = configuration;
3709
3710    let local_var_client = &local_var_configuration.client;
3711
3712    let local_var_uri_str = format!("{}/w/{workspace}/shared_ui/get", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3713    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3714
3715    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3716        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3717    }
3718    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3719        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3720    };
3721
3722    let local_var_req = local_var_req_builder.build()?;
3723    let local_var_resp = local_var_client.execute(local_var_req).await?;
3724
3725    let local_var_status = local_var_resp.status();
3726    let local_var_content = local_var_resp.text().await?;
3727
3728    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3729        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3730    } else {
3731        let local_var_entity: Option<GetSharedUiError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3732        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3733        Err(Error::ResponseError(local_var_error))
3734    }
3735}
3736
3737pub async fn get_shared_ui_version(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetSharedUiVersion200Response, Error<GetSharedUiVersionError>> {
3738    let local_var_configuration = configuration;
3739
3740    let local_var_client = &local_var_configuration.client;
3741
3742    let local_var_uri_str = format!("{}/w/{workspace}/shared_ui/version", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3743    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3744
3745    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3746        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3747    }
3748    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3749        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3750    };
3751
3752    let local_var_req = local_var_req_builder.build()?;
3753    let local_var_resp = local_var_client.execute(local_var_req).await?;
3754
3755    let local_var_status = local_var_resp.status();
3756    let local_var_content = local_var_resp.text().await?;
3757
3758    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3759        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3760    } else {
3761        let local_var_entity: Option<GetSharedUiVersionError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3762        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3763        Err(Error::ResponseError(local_var_error))
3764    }
3765}
3766
3767pub async fn get_threshold_alert(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetThresholdAlert200Response, Error<GetThresholdAlertError>> {
3768    let local_var_configuration = configuration;
3769
3770    let local_var_client = &local_var_configuration.client;
3771
3772    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/threshold_alert", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3773    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3774
3775    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3776        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3777    }
3778    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3779        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3780    };
3781
3782    let local_var_req = local_var_req_builder.build()?;
3783    let local_var_resp = local_var_client.execute(local_var_req).await?;
3784
3785    let local_var_status = local_var_resp.status();
3786    let local_var_content = local_var_resp.text().await?;
3787
3788    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3789        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3790    } else {
3791        let local_var_entity: Option<GetThresholdAlertError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3792        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3793        Err(Error::ResponseError(local_var_error))
3794    }
3795}
3796
3797pub async fn get_used_triggers(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetUsedTriggers200Response, Error<GetUsedTriggersError>> {
3798    let local_var_configuration = configuration;
3799
3800    let local_var_client = &local_var_configuration.client;
3801
3802    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/used_triggers", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3803    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3804
3805    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3806        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3807    }
3808    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3809        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3810    };
3811
3812    let local_var_req = local_var_req_builder.build()?;
3813    let local_var_resp = local_var_client.execute(local_var_req).await?;
3814
3815    let local_var_status = local_var_resp.status();
3816    let local_var_content = local_var_resp.text().await?;
3817
3818    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3819        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3820    } else {
3821        let local_var_entity: Option<GetUsedTriggersError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3822        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3823        Err(Error::ResponseError(local_var_error))
3824    }
3825}
3826
3827pub async fn get_workspace_as_super_admin(configuration: &configuration::Configuration, workspace: &str) -> Result<models::Workspace, Error<GetWorkspaceAsSuperAdminError>> {
3828    let local_var_configuration = configuration;
3829
3830    let local_var_client = &local_var_configuration.client;
3831
3832    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_as_superadmin", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3833    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3834
3835    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3836        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3837    }
3838    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3839        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3840    };
3841
3842    let local_var_req = local_var_req_builder.build()?;
3843    let local_var_resp = local_var_client.execute(local_var_req).await?;
3844
3845    let local_var_status = local_var_resp.status();
3846    let local_var_content = local_var_resp.text().await?;
3847
3848    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3849        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3850    } else {
3851        let local_var_entity: Option<GetWorkspaceAsSuperAdminError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3852        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3853        Err(Error::ResponseError(local_var_error))
3854    }
3855}
3856
3857pub async fn get_workspace_default_app(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetWorkspaceDefaultApp200Response, Error<GetWorkspaceDefaultAppError>> {
3858    let local_var_configuration = configuration;
3859
3860    let local_var_client = &local_var_configuration.client;
3861
3862    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/default_app", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3863    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3864
3865    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3866        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3867    }
3868    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3869        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3870    };
3871
3872    let local_var_req = local_var_req_builder.build()?;
3873    let local_var_resp = local_var_client.execute(local_var_req).await?;
3874
3875    let local_var_status = local_var_resp.status();
3876    let local_var_content = local_var_resp.text().await?;
3877
3878    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3879        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3880    } else {
3881        let local_var_entity: Option<GetWorkspaceDefaultAppError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3882        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3883        Err(Error::ResponseError(local_var_error))
3884    }
3885}
3886
3887pub async fn get_workspace_encryption_key(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetWorkspaceEncryptionKey200Response, Error<GetWorkspaceEncryptionKeyError>> {
3888    let local_var_configuration = configuration;
3889
3890    let local_var_client = &local_var_configuration.client;
3891
3892    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/encryption_key", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3893    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3894
3895    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3896        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3897    }
3898    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3899        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3900    };
3901
3902    let local_var_req = local_var_req_builder.build()?;
3903    let local_var_resp = local_var_client.execute(local_var_req).await?;
3904
3905    let local_var_status = local_var_resp.status();
3906    let local_var_content = local_var_resp.text().await?;
3907
3908    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3909        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3910    } else {
3911        let local_var_entity: Option<GetWorkspaceEncryptionKeyError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3912        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3913        Err(Error::ResponseError(local_var_error))
3914    }
3915}
3916
3917pub async fn get_workspace_name(configuration: &configuration::Configuration, workspace: &str) -> Result<String, Error<GetWorkspaceNameError>> {
3918    let local_var_configuration = configuration;
3919
3920    let local_var_client = &local_var_configuration.client;
3921
3922    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_workspace_name", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3923    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3924
3925    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3926        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3927    }
3928    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3929        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3930    };
3931
3932    let local_var_req = local_var_req_builder.build()?;
3933    let local_var_resp = local_var_client.execute(local_var_req).await?;
3934
3935    let local_var_status = local_var_resp.status();
3936    let local_var_content = local_var_resp.text().await?;
3937
3938    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3939        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3940    } else {
3941        let local_var_entity: Option<GetWorkspaceNameError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3942        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3943        Err(Error::ResponseError(local_var_error))
3944    }
3945}
3946
3947pub async fn get_workspace_slack_oauth_config(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetWorkspaceSlackOauthConfig200Response, Error<GetWorkspaceSlackOauthConfigError>> {
3948    let local_var_configuration = configuration;
3949
3950    let local_var_client = &local_var_configuration.client;
3951
3952    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/slack_oauth_config", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3953    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3954
3955    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3956        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3957    }
3958    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3959        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3960    };
3961
3962    let local_var_req = local_var_req_builder.build()?;
3963    let local_var_resp = local_var_client.execute(local_var_req).await?;
3964
3965    let local_var_status = local_var_resp.status();
3966    let local_var_content = local_var_resp.text().await?;
3967
3968    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3969        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3970    } else {
3971        let local_var_entity: Option<GetWorkspaceSlackOauthConfigError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3972        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3973        Err(Error::ResponseError(local_var_error))
3974    }
3975}
3976
3977pub async fn get_workspace_usage(configuration: &configuration::Configuration, workspace: &str) -> Result<f64, Error<GetWorkspaceUsageError>> {
3978    let local_var_configuration = configuration;
3979
3980    let local_var_client = &local_var_configuration.client;
3981
3982    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/usage", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3983    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3984
3985    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3986        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3987    }
3988    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3989        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3990    };
3991
3992    let local_var_req = local_var_req_builder.build()?;
3993    let local_var_resp = local_var_client.execute(local_var_req).await?;
3994
3995    let local_var_status = local_var_resp.status();
3996    let local_var_content = local_var_resp.text().await?;
3997
3998    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3999        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4000    } else {
4001        let local_var_entity: Option<GetWorkspaceUsageError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4002        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4003        Err(Error::ResponseError(local_var_error))
4004    }
4005}
4006
4007pub async fn import_pg_database(configuration: &configuration::Configuration, workspace: &str, import_pg_database_request: models::ImportPgDatabaseRequest) -> Result<String, Error<ImportPgDatabaseError>> {
4008    let local_var_configuration = configuration;
4009
4010    let local_var_client = &local_var_configuration.client;
4011
4012    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/import_pg_database", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
4013    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
4014
4015    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4016        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4017    }
4018    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4019        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4020    };
4021    local_var_req_builder = local_var_req_builder.json(&import_pg_database_request);
4022
4023    let local_var_req = local_var_req_builder.build()?;
4024    let local_var_resp = local_var_client.execute(local_var_req).await?;
4025
4026    let local_var_status = local_var_resp.status();
4027    let local_var_content = local_var_resp.text().await?;
4028
4029    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4030        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4031    } else {
4032        let local_var_entity: Option<ImportPgDatabaseError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4033        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4034        Err(Error::ResponseError(local_var_error))
4035    }
4036}
4037
4038pub async fn invite_user(configuration: &configuration::Configuration, workspace: &str, invite_user_request: models::InviteUserRequest) -> Result<String, Error<InviteUserError>> {
4039    let local_var_configuration = configuration;
4040
4041    let local_var_client = &local_var_configuration.client;
4042
4043    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/invite_user", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
4044    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
4045
4046    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4047        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4048    }
4049    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4050        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4051    };
4052    local_var_req_builder = local_var_req_builder.json(&invite_user_request);
4053
4054    let local_var_req = local_var_req_builder.build()?;
4055    let local_var_resp = local_var_client.execute(local_var_req).await?;
4056
4057    let local_var_status = local_var_resp.status();
4058    let local_var_content = local_var_resp.text().await?;
4059
4060    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4061        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4062    } else {
4063        let local_var_entity: Option<InviteUserError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4064        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4065        Err(Error::ResponseError(local_var_error))
4066    }
4067}
4068
4069pub async fn is_domain_allowed(configuration: &configuration::Configuration, ) -> Result<bool, Error<IsDomainAllowedError>> {
4070    let local_var_configuration = configuration;
4071
4072    let local_var_client = &local_var_configuration.client;
4073
4074    let local_var_uri_str = format!("{}/workspaces/allowed_domain_auto_invite", local_var_configuration.base_path);
4075    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4076
4077    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4078        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4079    }
4080    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4081        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4082    };
4083
4084    let local_var_req = local_var_req_builder.build()?;
4085    let local_var_resp = local_var_client.execute(local_var_req).await?;
4086
4087    let local_var_status = local_var_resp.status();
4088    let local_var_content = local_var_resp.text().await?;
4089
4090    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4091        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4092    } else {
4093        let local_var_entity: Option<IsDomainAllowedError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4094        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4095        Err(Error::ResponseError(local_var_error))
4096    }
4097}
4098
4099pub async fn leave_workspace(configuration: &configuration::Configuration, workspace: &str) -> Result<String, Error<LeaveWorkspaceError>> {
4100    let local_var_configuration = configuration;
4101
4102    let local_var_client = &local_var_configuration.client;
4103
4104    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/leave", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
4105    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
4106
4107    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4108        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4109    }
4110    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4111        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4112    };
4113
4114    let local_var_req = local_var_req_builder.build()?;
4115    let local_var_resp = local_var_client.execute(local_var_req).await?;
4116
4117    let local_var_status = local_var_resp.status();
4118    let local_var_content = local_var_resp.text().await?;
4119
4120    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4121        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4122    } else {
4123        let local_var_entity: Option<LeaveWorkspaceError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4124        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4125        Err(Error::ResponseError(local_var_error))
4126    }
4127}
4128
4129pub async fn list_available_teams_channels(configuration: &configuration::Configuration, workspace: &str, team_id: &str) -> Result<models::ListAvailableTeamsChannels200Response, Error<ListAvailableTeamsChannelsError>> {
4130    let local_var_configuration = configuration;
4131
4132    let local_var_client = &local_var_configuration.client;
4133
4134    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/available_teams_channels", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
4135    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4136
4137    local_var_req_builder = local_var_req_builder.query(&[("team_id", &team_id.to_string())]);
4138    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4139        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4140    }
4141    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4142        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4143    };
4144
4145    let local_var_req = local_var_req_builder.build()?;
4146    let local_var_resp = local_var_client.execute(local_var_req).await?;
4147
4148    let local_var_status = local_var_resp.status();
4149    let local_var_content = local_var_resp.text().await?;
4150
4151    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4152        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4153    } else {
4154        let local_var_entity: Option<ListAvailableTeamsChannelsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4155        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4156        Err(Error::ResponseError(local_var_error))
4157    }
4158}
4159
4160pub async fn list_available_teams_ids(configuration: &configuration::Configuration, workspace: &str, search: Option<&str>, next_link: Option<&str>) -> Result<models::ListAvailableTeamsIds200Response, Error<ListAvailableTeamsIdsError>> {
4161    let local_var_configuration = configuration;
4162
4163    let local_var_client = &local_var_configuration.client;
4164
4165    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/available_teams_ids", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
4166    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4167
4168    if let Some(ref local_var_str) = search {
4169        local_var_req_builder = local_var_req_builder.query(&[("search", &local_var_str.to_string())]);
4170    }
4171    if let Some(ref local_var_str) = next_link {
4172        local_var_req_builder = local_var_req_builder.query(&[("next_link", &local_var_str.to_string())]);
4173    }
4174    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4175        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4176    }
4177    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4178        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4179    };
4180
4181    let local_var_req = local_var_req_builder.build()?;
4182    let local_var_resp = local_var_client.execute(local_var_req).await?;
4183
4184    let local_var_status = local_var_resp.status();
4185    let local_var_content = local_var_resp.text().await?;
4186
4187    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4188        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4189    } else {
4190        let local_var_entity: Option<ListAvailableTeamsIdsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4191        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4192        Err(Error::ResponseError(local_var_error))
4193    }
4194}
4195
4196pub async fn list_data_table_schemas(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<models::DataTableSchema>, Error<ListDataTableSchemasError>> {
4197    let local_var_configuration = configuration;
4198
4199    let local_var_client = &local_var_configuration.client;
4200
4201    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/list_datatable_schemas", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
4202    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4203
4204    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4205        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4206    }
4207    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4208        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4209    };
4210
4211    let local_var_req = local_var_req_builder.build()?;
4212    let local_var_resp = local_var_client.execute(local_var_req).await?;
4213
4214    let local_var_status = local_var_resp.status();
4215    let local_var_content = local_var_resp.text().await?;
4216
4217    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4218        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4219    } else {
4220        let local_var_entity: Option<ListDataTableSchemasError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4221        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4222        Err(Error::ResponseError(local_var_error))
4223    }
4224}
4225
4226pub async fn list_data_table_tables(configuration: &configuration::Configuration, workspace: &str, datatable_name: Option<&str>, role_for: Option<&str>, role: Option<&str>) -> Result<Vec<models::DataTableTables>, Error<ListDataTableTablesError>> {
4227    let local_var_configuration = configuration;
4228
4229    let local_var_client = &local_var_configuration.client;
4230
4231    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/list_datatable_tables", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
4232    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4233
4234    if let Some(ref local_var_str) = datatable_name {
4235        local_var_req_builder = local_var_req_builder.query(&[("datatable_name", &local_var_str.to_string())]);
4236    }
4237    if let Some(ref local_var_str) = role_for {
4238        local_var_req_builder = local_var_req_builder.query(&[("role_for", &local_var_str.to_string())]);
4239    }
4240    if let Some(ref local_var_str) = role {
4241        local_var_req_builder = local_var_req_builder.query(&[("role", &local_var_str.to_string())]);
4242    }
4243    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4244        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4245    }
4246    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4247        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4248    };
4249
4250    let local_var_req = local_var_req_builder.build()?;
4251    let local_var_resp = local_var_client.execute(local_var_req).await?;
4252
4253    let local_var_status = local_var_resp.status();
4254    let local_var_content = local_var_resp.text().await?;
4255
4256    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4257        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4258    } else {
4259        let local_var_entity: Option<ListDataTableTablesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4260        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4261        Err(Error::ResponseError(local_var_error))
4262    }
4263}
4264
4265pub async fn list_data_tables(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<models::ListDataTables200ResponseInner>, Error<ListDataTablesError>> {
4266    let local_var_configuration = configuration;
4267
4268    let local_var_client = &local_var_configuration.client;
4269
4270    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/list_datatables", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
4271    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4272
4273    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4274        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4275    }
4276    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4277        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4278    };
4279
4280    let local_var_req = local_var_req_builder.build()?;
4281    let local_var_resp = local_var_client.execute(local_var_req).await?;
4282
4283    let local_var_status = local_var_resp.status();
4284    let local_var_content = local_var_resp.text().await?;
4285
4286    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4287        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4288    } else {
4289        let local_var_entity: Option<ListDataTablesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4290        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4291        Err(Error::ResponseError(local_var_error))
4292    }
4293}
4294
4295pub async fn list_datatable_migrations(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<models::DatatableMigration>, Error<ListDatatableMigrationsError>> {
4296    let local_var_configuration = configuration;
4297
4298    let local_var_client = &local_var_configuration.client;
4299
4300    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/list_datatable_migrations", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
4301    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4302
4303    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4304        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4305    }
4306    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4307        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4308    };
4309
4310    let local_var_req = local_var_req_builder.build()?;
4311    let local_var_resp = local_var_client.execute(local_var_req).await?;
4312
4313    let local_var_status = local_var_resp.status();
4314    let local_var_content = local_var_resp.text().await?;
4315
4316    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4317        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4318    } else {
4319        let local_var_entity: Option<ListDatatableMigrationsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4320        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4321        Err(Error::ResponseError(local_var_error))
4322    }
4323}
4324
4325/// Returns admins and members of wm_deployers in the parent workspace of the fork at `{workspace}`.
4326pub async fn list_deployment_request_eligible_deployers(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<models::DeploymentRequestEligibleDeployer>, Error<ListDeploymentRequestEligibleDeployersError>> {
4327    let local_var_configuration = configuration;
4328
4329    let local_var_client = &local_var_configuration.client;
4330
4331    let local_var_uri_str = format!("{}/w/{workspace}/deployment_request/eligible_deployers", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
4332    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4333
4334    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4335        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4336    }
4337    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4338        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4339    };
4340
4341    let local_var_req = local_var_req_builder.build()?;
4342    let local_var_resp = local_var_client.execute(local_var_req).await?;
4343
4344    let local_var_status = local_var_resp.status();
4345    let local_var_content = local_var_resp.text().await?;
4346
4347    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4348        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4349    } else {
4350        let local_var_entity: Option<ListDeploymentRequestEligibleDeployersError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4351        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4352        Err(Error::ResponseError(local_var_error))
4353    }
4354}
4355
4356pub async fn list_ducklakes(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<String>, Error<ListDucklakesError>> {
4357    let local_var_configuration = configuration;
4358
4359    let local_var_client = &local_var_configuration.client;
4360
4361    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/list_ducklakes", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
4362    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4363
4364    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4365        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4366    }
4367    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4368        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4369    };
4370
4371    let local_var_req = local_var_req_builder.build()?;
4372    let local_var_resp = local_var_client.execute(local_var_req).await?;
4373
4374    let local_var_status = local_var_resp.status();
4375    let local_var_content = local_var_resp.text().await?;
4376
4377    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4378        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4379    } else {
4380        let local_var_entity: Option<ListDucklakesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4381        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4382        Err(Error::ResponseError(local_var_error))
4383    }
4384}
4385
4386pub async fn list_pending_invites(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<models::WorkspaceInvite>, Error<ListPendingInvitesError>> {
4387    let local_var_configuration = configuration;
4388
4389    let local_var_client = &local_var_configuration.client;
4390
4391    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/list_pending_invites", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
4392    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4393
4394    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4395        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4396    }
4397    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4398        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4399    };
4400
4401    let local_var_req = local_var_req_builder.build()?;
4402    let local_var_resp = local_var_client.execute(local_var_req).await?;
4403
4404    let local_var_status = local_var_resp.status();
4405    let local_var_content = local_var_resp.text().await?;
4406
4407    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4408        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4409    } else {
4410        let local_var_entity: Option<ListPendingInvitesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4411        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4412        Err(Error::ResponseError(local_var_error))
4413    }
4414}
4415
4416pub async fn list_protection_rules(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<models::ProtectionRuleset>, Error<ListProtectionRulesError>> {
4417    let local_var_configuration = configuration;
4418
4419    let local_var_client = &local_var_configuration.client;
4420
4421    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/protection_rules", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
4422    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4423
4424    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4425        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4426    }
4427    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4428        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4429    };
4430
4431    let local_var_req = local_var_req_builder.build()?;
4432    let local_var_resp = local_var_client.execute(local_var_req).await?;
4433
4434    let local_var_status = local_var_resp.status();
4435    let local_var_content = local_var_resp.text().await?;
4436
4437    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4438        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4439    } else {
4440        let local_var_entity: Option<ListProtectionRulesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4441        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4442        Err(Error::ResponseError(local_var_error))
4443    }
4444}
4445
4446pub async fn list_shared_ui(configuration: &configuration::Configuration, workspace: &str) -> Result<models::ListSharedUi200Response, Error<ListSharedUiError>> {
4447    let local_var_configuration = configuration;
4448
4449    let local_var_client = &local_var_configuration.client;
4450
4451    let local_var_uri_str = format!("{}/w/{workspace}/shared_ui/list", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
4452    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4453
4454    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4455        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4456    }
4457    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4458        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4459    };
4460
4461    let local_var_req = local_var_req_builder.build()?;
4462    let local_var_resp = local_var_client.execute(local_var_req).await?;
4463
4464    let local_var_status = local_var_resp.status();
4465    let local_var_content = local_var_resp.text().await?;
4466
4467    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4468        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4469    } else {
4470        let local_var_entity: Option<ListSharedUiError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4471        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4472        Err(Error::ResponseError(local_var_error))
4473    }
4474}
4475
4476pub async fn list_usable_datatable_roles(configuration: &configuration::Configuration, workspace: &str, datatable_name: &str) -> Result<models::ListUsableDatatableRoles200Response, Error<ListUsableDatatableRolesError>> {
4477    let local_var_configuration = configuration;
4478
4479    let local_var_client = &local_var_configuration.client;
4480
4481    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/datatable_usable_roles/{datatable_name}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), datatable_name=crate::apis::urlencode(datatable_name));
4482    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4483
4484    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4485        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4486    }
4487    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4488        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4489    };
4490
4491    let local_var_req = local_var_req_builder.build()?;
4492    let local_var_resp = local_var_client.execute(local_var_req).await?;
4493
4494    let local_var_status = local_var_resp.status();
4495    let local_var_content = local_var_resp.text().await?;
4496
4497    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4498        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4499    } else {
4500        let local_var_entity: Option<ListUsableDatatableRolesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4501        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4502        Err(Error::ResponseError(local_var_error))
4503    }
4504}
4505
4506pub async fn list_user_workspaces(configuration: &configuration::Configuration, ) -> Result<models::UserWorkspaceList, Error<ListUserWorkspacesError>> {
4507    let local_var_configuration = configuration;
4508
4509    let local_var_client = &local_var_configuration.client;
4510
4511    let local_var_uri_str = format!("{}/workspaces/users", local_var_configuration.base_path);
4512    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4513
4514    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4515        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4516    }
4517    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4518        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4519    };
4520
4521    let local_var_req = local_var_req_builder.build()?;
4522    let local_var_resp = local_var_client.execute(local_var_req).await?;
4523
4524    let local_var_status = local_var_resp.status();
4525    let local_var_content = local_var_resp.text().await?;
4526
4527    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4528        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4529    } else {
4530        let local_var_entity: Option<ListUserWorkspacesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4531        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4532        Err(Error::ResponseError(local_var_error))
4533    }
4534}
4535
4536pub async fn list_workspaces(configuration: &configuration::Configuration, ) -> Result<Vec<models::Workspace>, Error<ListWorkspacesError>> {
4537    let local_var_configuration = configuration;
4538
4539    let local_var_client = &local_var_configuration.client;
4540
4541    let local_var_uri_str = format!("{}/workspaces/list", local_var_configuration.base_path);
4542    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4543
4544    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4545        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4546    }
4547    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4548        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4549    };
4550
4551    let local_var_req = local_var_req_builder.build()?;
4552    let local_var_resp = local_var_client.execute(local_var_req).await?;
4553
4554    let local_var_status = local_var_resp.status();
4555    let local_var_content = local_var_resp.text().await?;
4556
4557    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4558        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4559    } else {
4560        let local_var_entity: Option<ListWorkspacesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4561        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4562        Err(Error::ResponseError(local_var_error))
4563    }
4564}
4565
4566pub async fn list_workspaces_as_super_admin(configuration: &configuration::Configuration, page: Option<i32>, per_page: Option<i32>) -> Result<Vec<models::Workspace>, Error<ListWorkspacesAsSuperAdminError>> {
4567    let local_var_configuration = configuration;
4568
4569    let local_var_client = &local_var_configuration.client;
4570
4571    let local_var_uri_str = format!("{}/workspaces/list_as_superadmin", local_var_configuration.base_path);
4572    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4573
4574    if let Some(ref local_var_str) = page {
4575        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
4576    }
4577    if let Some(ref local_var_str) = per_page {
4578        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
4579    }
4580    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4581        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4582    }
4583    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4584        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4585    };
4586
4587    let local_var_req = local_var_req_builder.build()?;
4588    let local_var_resp = local_var_client.execute(local_var_req).await?;
4589
4590    let local_var_status = local_var_resp.status();
4591    let local_var_content = local_var_resp.text().await?;
4592
4593    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4594        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4595    } else {
4596        let local_var_entity: Option<ListWorkspacesAsSuperAdminError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4597        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4598        Err(Error::ResponseError(local_var_error))
4599    }
4600}
4601
4602pub async fn list_ws_specific(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<models::ListWsSpecific200ResponseInner>, Error<ListWsSpecificError>> {
4603    let local_var_configuration = configuration;
4604
4605    let local_var_client = &local_var_configuration.client;
4606
4607    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/list_ws_specific", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
4608    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4609
4610    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4611        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4612    }
4613    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4614        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4615    };
4616
4617    let local_var_req = local_var_req_builder.build()?;
4618    let local_var_resp = local_var_client.execute(local_var_req).await?;
4619
4620    let local_var_status = local_var_resp.status();
4621    let local_var_content = local_var_resp.text().await?;
4622
4623    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4624        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4625    } else {
4626        let local_var_entity: Option<ListWsSpecificError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4627        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4628        Err(Error::ResponseError(local_var_error))
4629    }
4630}
4631
4632pub async fn list_ws_specific_versions(configuration: &configuration::Configuration, workspace: &str, kind: &str, path: &str) -> Result<Vec<String>, Error<ListWsSpecificVersionsError>> {
4633    let local_var_configuration = configuration;
4634
4635    let local_var_client = &local_var_configuration.client;
4636
4637    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/list_ws_specific_versions", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
4638    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4639
4640    local_var_req_builder = local_var_req_builder.query(&[("kind", &kind.to_string())]);
4641    local_var_req_builder = local_var_req_builder.query(&[("path", &path.to_string())]);
4642    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4643        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4644    }
4645    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4646        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4647    };
4648
4649    let local_var_req = local_var_req_builder.build()?;
4650    let local_var_resp = local_var_client.execute(local_var_req).await?;
4651
4652    let local_var_status = local_var_resp.status();
4653    let local_var_content = local_var_resp.text().await?;
4654
4655    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4656        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4657    } else {
4658        let local_var_entity: Option<ListWsSpecificVersionsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4659        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4660        Err(Error::ResponseError(local_var_error))
4661    }
4662}
4663
4664pub async fn log_feature_usage(configuration: &configuration::Configuration, workspace: &str, log_feature_usage_request: models::LogFeatureUsageRequest) -> Result<(), Error<LogFeatureUsageError>> {
4665    let local_var_configuration = configuration;
4666
4667    let local_var_client = &local_var_configuration.client;
4668
4669    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/log_feature_usage", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
4670    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
4671
4672    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4673        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4674    }
4675    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4676        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4677    };
4678    local_var_req_builder = local_var_req_builder.json(&log_feature_usage_request);
4679
4680    let local_var_req = local_var_req_builder.build()?;
4681    let local_var_resp = local_var_client.execute(local_var_req).await?;
4682
4683    let local_var_status = local_var_resp.status();
4684    let local_var_content = local_var_resp.text().await?;
4685
4686    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4687        Ok(())
4688    } else {
4689        let local_var_entity: Option<LogFeatureUsageError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4690        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4691        Err(Error::ResponseError(local_var_error))
4692    }
4693}
4694
4695pub async fn plan_datatable_acl(configuration: &configuration::Configuration, workspace: &str, datatable_name: &str, acl_change_request: models::AclChangeRequest) -> Result<models::AclPlan, Error<PlanDatatableAclError>> {
4696    let local_var_configuration = configuration;
4697
4698    let local_var_client = &local_var_configuration.client;
4699
4700    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/datatable_acl/{datatable_name}/plan", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), datatable_name=crate::apis::urlencode(datatable_name));
4701    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
4702
4703    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4704        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4705    }
4706    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4707        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4708    };
4709    local_var_req_builder = local_var_req_builder.json(&acl_change_request);
4710
4711    let local_var_req = local_var_req_builder.build()?;
4712    let local_var_resp = local_var_client.execute(local_var_req).await?;
4713
4714    let local_var_status = local_var_resp.status();
4715    let local_var_content = local_var_resp.text().await?;
4716
4717    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4718        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4719    } else {
4720        let local_var_entity: Option<PlanDatatableAclError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4721        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4722        Err(Error::ResponseError(local_var_error))
4723    }
4724}
4725
4726pub async fn prune_versions(configuration: &configuration::Configuration, workspace: &str, prune_versions_request: models::PruneVersionsRequest) -> Result<models::PruneVersions200Response, Error<PruneVersionsError>> {
4727    let local_var_configuration = configuration;
4728
4729    let local_var_client = &local_var_configuration.client;
4730
4731    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/prune_versions", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
4732    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
4733
4734    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4735        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4736    }
4737    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4738        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4739    };
4740    local_var_req_builder = local_var_req_builder.json(&prune_versions_request);
4741
4742    let local_var_req = local_var_req_builder.build()?;
4743    let local_var_resp = local_var_client.execute(local_var_req).await?;
4744
4745    let local_var_status = local_var_resp.status();
4746    let local_var_content = local_var_resp.text().await?;
4747
4748    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4749        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4750    } else {
4751        let local_var_entity: Option<PruneVersionsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4752        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4753        Err(Error::ResponseError(local_var_error))
4754    }
4755}
4756
4757pub async fn rebuild_dependency_map(configuration: &configuration::Configuration, workspace: &str) -> Result<String, Error<RebuildDependencyMapError>> {
4758    let local_var_configuration = configuration;
4759
4760    let local_var_client = &local_var_configuration.client;
4761
4762    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/rebuild_dependency_map", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
4763    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
4764
4765    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4766        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4767    }
4768    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4769        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4770    };
4771
4772    let local_var_req = local_var_req_builder.build()?;
4773    let local_var_resp = local_var_client.execute(local_var_req).await?;
4774
4775    let local_var_status = local_var_resp.status();
4776    let local_var_content = local_var_resp.text().await?;
4777
4778    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4779        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4780    } else {
4781        let local_var_entity: Option<RebuildDependencyMapError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4782        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4783        Err(Error::ResponseError(local_var_error))
4784    }
4785}
4786
4787/// This endpoint should be called after a fork deployement
4788pub async fn reset_diff_tally(configuration: &configuration::Configuration, workspace: &str, fork_workspace_id: &str) -> Result<serde_json::Value, Error<ResetDiffTallyError>> {
4789    let local_var_configuration = configuration;
4790
4791    let local_var_client = &local_var_configuration.client;
4792
4793    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));
4794    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
4795
4796    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4797        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4798    }
4799    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4800        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4801    };
4802
4803    let local_var_req = local_var_req_builder.build()?;
4804    let local_var_resp = local_var_client.execute(local_var_req).await?;
4805
4806    let local_var_status = local_var_resp.status();
4807    let local_var_content = local_var_resp.text().await?;
4808
4809    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4810        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4811    } else {
4812        let local_var_entity: Option<ResetDiffTallyError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4813        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4814        Err(Error::ResponseError(local_var_error))
4815    }
4816}
4817
4818pub async fn rollback_datatable_migrations(configuration: &configuration::Configuration, workspace: &str, datatable_name: &str, only: Option<i64>) -> Result<models::RollbackDatatableMigrations200Response, Error<RollbackDatatableMigrationsError>> {
4819    let local_var_configuration = configuration;
4820
4821    let local_var_client = &local_var_configuration.client;
4822
4823    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/rollback_datatable_migrations/{datatable_name}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), datatable_name=crate::apis::urlencode(datatable_name));
4824    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
4825
4826    if let Some(ref local_var_str) = only {
4827        local_var_req_builder = local_var_req_builder.query(&[("only", &local_var_str.to_string())]);
4828    }
4829    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4830        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4831    }
4832    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4833        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4834    };
4835
4836    let local_var_req = local_var_req_builder.build()?;
4837    let local_var_resp = local_var_client.execute(local_var_req).await?;
4838
4839    let local_var_status = local_var_resp.status();
4840    let local_var_content = local_var_resp.text().await?;
4841
4842    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4843        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4844    } else {
4845        let local_var_entity: Option<RollbackDatatableMigrationsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4846        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4847        Err(Error::ResponseError(local_var_error))
4848    }
4849}
4850
4851pub async fn run_datatable_migrations(configuration: &configuration::Configuration, workspace: &str, datatable_name: &str, up_to: Option<i64>, only: Option<i64>) -> Result<models::RunDatatableMigrations200Response, Error<RunDatatableMigrationsError>> {
4852    let local_var_configuration = configuration;
4853
4854    let local_var_client = &local_var_configuration.client;
4855
4856    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/run_datatable_migrations/{datatable_name}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), datatable_name=crate::apis::urlencode(datatable_name));
4857    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
4858
4859    if let Some(ref local_var_str) = up_to {
4860        local_var_req_builder = local_var_req_builder.query(&[("up_to", &local_var_str.to_string())]);
4861    }
4862    if let Some(ref local_var_str) = only {
4863        local_var_req_builder = local_var_req_builder.query(&[("only", &local_var_str.to_string())]);
4864    }
4865    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4866        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4867    }
4868    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4869        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4870    };
4871
4872    let local_var_req = local_var_req_builder.build()?;
4873    let local_var_resp = local_var_client.execute(local_var_req).await?;
4874
4875    let local_var_status = local_var_resp.status();
4876    let local_var_content = local_var_resp.text().await?;
4877
4878    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4879        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4880    } else {
4881        let local_var_entity: Option<RunDatatableMigrationsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4882        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4883        Err(Error::ResponseError(local_var_error))
4884    }
4885}
4886
4887pub 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>> {
4888    let local_var_configuration = configuration;
4889
4890    let local_var_client = &local_var_configuration.client;
4891
4892    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/run_slack_message_test_job", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
4893    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
4894
4895    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4896        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4897    }
4898    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4899        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4900    };
4901    local_var_req_builder = local_var_req_builder.json(&run_slack_message_test_job_request);
4902
4903    let local_var_req = local_var_req_builder.build()?;
4904    let local_var_resp = local_var_client.execute(local_var_req).await?;
4905
4906    let local_var_status = local_var_resp.status();
4907    let local_var_content = local_var_resp.text().await?;
4908
4909    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4910        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4911    } else {
4912        let local_var_entity: Option<RunSlackMessageTestJobError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4913        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4914        Err(Error::ResponseError(local_var_error))
4915    }
4916}
4917
4918pub 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>> {
4919    let local_var_configuration = configuration;
4920
4921    let local_var_client = &local_var_configuration.client;
4922
4923    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/run_teams_message_test_job", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
4924    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
4925
4926    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4927        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4928    }
4929    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4930        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4931    };
4932    local_var_req_builder = local_var_req_builder.json(&run_slack_message_test_job_request);
4933
4934    let local_var_req = local_var_req_builder.build()?;
4935    let local_var_resp = local_var_client.execute(local_var_req).await?;
4936
4937    let local_var_status = local_var_resp.status();
4938    let local_var_content = local_var_resp.text().await?;
4939
4940    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4941        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4942    } else {
4943        let local_var_entity: Option<RunTeamsMessageTestJobError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4944        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4945        Err(Error::ResponseError(local_var_error))
4946    }
4947}
4948
4949/// Enumerates every item of both workspaces as an undecided diff candidate so `compareWorkspaces` can compare a pair the fork lineage does not track. Requires being an admin of both workspaces, and is rejected for a pair already linked by the lineage (whose diff is tallied continuously). The comparison itself is what compares the candidates, and is the expensive step.
4950pub async fn seed_full_diff_scan(configuration: &configuration::Configuration, workspace: &str, target_workspace_id: &str) -> Result<models::SeedFullDiffScan200Response, Error<SeedFullDiffScanError>> {
4951    let local_var_configuration = configuration;
4952
4953    let local_var_client = &local_var_configuration.client;
4954
4955    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/seed_full_diff/{target_workspace_id}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), target_workspace_id=crate::apis::urlencode(target_workspace_id));
4956    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
4957
4958    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4959        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4960    }
4961    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4962        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4963    };
4964
4965    let local_var_req = local_var_req_builder.build()?;
4966    let local_var_resp = local_var_client.execute(local_var_req).await?;
4967
4968    let local_var_status = local_var_resp.status();
4969    let local_var_content = local_var_resp.text().await?;
4970
4971    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4972        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4973    } else {
4974        let local_var_entity: Option<SeedFullDiffScanError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4975        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4976        Err(Error::ResponseError(local_var_error))
4977    }
4978}
4979
4980pub async fn set_datatable_permissions(configuration: &configuration::Configuration, workspace: &str, datatable_name: &str, set_datatable_permissions_request: models::SetDatatablePermissionsRequest) -> Result<String, Error<SetDatatablePermissionsError>> {
4981    let local_var_configuration = configuration;
4982
4983    let local_var_client = &local_var_configuration.client;
4984
4985    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/datatable_permissions/{datatable_name}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), datatable_name=crate::apis::urlencode(datatable_name));
4986    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
4987
4988    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4989        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4990    }
4991    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4992        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4993    };
4994    local_var_req_builder = local_var_req_builder.json(&set_datatable_permissions_request);
4995
4996    let local_var_req = local_var_req_builder.build()?;
4997    let local_var_resp = local_var_client.execute(local_var_req).await?;
4998
4999    let local_var_status = local_var_resp.status();
5000    let local_var_content = local_var_resp.text().await?;
5001
5002    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5003        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
5004    } else {
5005        let local_var_entity: Option<SetDatatablePermissionsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
5006        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5007        Err(Error::ResponseError(local_var_error))
5008    }
5009}
5010
5011pub async fn set_environment_variable(configuration: &configuration::Configuration, workspace: &str, set_environment_variable_request: models::SetEnvironmentVariableRequest) -> Result<String, Error<SetEnvironmentVariableError>> {
5012    let local_var_configuration = configuration;
5013
5014    let local_var_client = &local_var_configuration.client;
5015
5016    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/set_environment_variable", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
5017    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
5018
5019    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5020        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5021    }
5022    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
5023        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
5024    };
5025    local_var_req_builder = local_var_req_builder.json(&set_environment_variable_request);
5026
5027    let local_var_req = local_var_req_builder.build()?;
5028    let local_var_resp = local_var_client.execute(local_var_req).await?;
5029
5030    let local_var_status = local_var_resp.status();
5031    let local_var_content = local_var_resp.text().await?;
5032
5033    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5034        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
5035    } else {
5036        let local_var_entity: Option<SetEnvironmentVariableError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
5037        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5038        Err(Error::ResponseError(local_var_error))
5039    }
5040}
5041
5042/// Changing the target drops every token stored for the previous one.
5043pub async fn set_remote_deploy_target(configuration: &configuration::Configuration, workspace: &str, set_remote_deploy_target_request: models::SetRemoteDeployTargetRequest) -> Result<String, Error<SetRemoteDeployTargetError>> {
5044    let local_var_configuration = configuration;
5045
5046    let local_var_client = &local_var_configuration.client;
5047
5048    let local_var_uri_str = format!("{}/w/{workspace}/remote_deploy/target", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
5049    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
5050
5051    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5052        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5053    }
5054    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
5055        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
5056    };
5057    local_var_req_builder = local_var_req_builder.json(&set_remote_deploy_target_request);
5058
5059    let local_var_req = local_var_req_builder.build()?;
5060    let local_var_resp = local_var_client.execute(local_var_req).await?;
5061
5062    let local_var_status = local_var_resp.status();
5063    let local_var_content = local_var_resp.text().await?;
5064
5065    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5066        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
5067    } else {
5068        let local_var_entity: Option<SetRemoteDeployTargetError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
5069        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5070        Err(Error::ResponseError(local_var_error))
5071    }
5072}
5073
5074pub async fn set_threshold_alert(configuration: &configuration::Configuration, workspace: &str, set_threshold_alert_request: models::SetThresholdAlertRequest) -> Result<String, Error<SetThresholdAlertError>> {
5075    let local_var_configuration = configuration;
5076
5077    let local_var_client = &local_var_configuration.client;
5078
5079    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/threshold_alert", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
5080    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
5081
5082    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5083        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5084    }
5085    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
5086        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
5087    };
5088    local_var_req_builder = local_var_req_builder.json(&set_threshold_alert_request);
5089
5090    let local_var_req = local_var_req_builder.build()?;
5091    let local_var_resp = local_var_client.execute(local_var_req).await?;
5092
5093    let local_var_status = local_var_resp.status();
5094    let local_var_content = local_var_resp.text().await?;
5095
5096    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5097        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
5098    } else {
5099        let local_var_entity: Option<SetThresholdAlertError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
5100        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5101        Err(Error::ResponseError(local_var_error))
5102    }
5103}
5104
5105pub async fn set_workspace_encryption_key(configuration: &configuration::Configuration, workspace: &str, set_workspace_encryption_key_request: models::SetWorkspaceEncryptionKeyRequest) -> Result<String, Error<SetWorkspaceEncryptionKeyError>> {
5106    let local_var_configuration = configuration;
5107
5108    let local_var_client = &local_var_configuration.client;
5109
5110    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/encryption_key", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
5111    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
5112
5113    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5114        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5115    }
5116    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
5117        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
5118    };
5119    local_var_req_builder = local_var_req_builder.json(&set_workspace_encryption_key_request);
5120
5121    let local_var_req = local_var_req_builder.build()?;
5122    let local_var_resp = local_var_client.execute(local_var_req).await?;
5123
5124    let local_var_status = local_var_resp.status();
5125    let local_var_content = local_var_resp.text().await?;
5126
5127    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5128        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
5129    } else {
5130        let local_var_entity: Option<SetWorkspaceEncryptionKeyError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
5131        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5132        Err(Error::ResponseError(local_var_error))
5133    }
5134}
5135
5136pub async fn set_workspace_slack_oauth_config(configuration: &configuration::Configuration, workspace: &str, set_workspace_slack_oauth_config_request: models::SetWorkspaceSlackOauthConfigRequest) -> Result<String, Error<SetWorkspaceSlackOauthConfigError>> {
5137    let local_var_configuration = configuration;
5138
5139    let local_var_client = &local_var_configuration.client;
5140
5141    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/slack_oauth_config", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
5142    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
5143
5144    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5145        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5146    }
5147    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
5148        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
5149    };
5150    local_var_req_builder = local_var_req_builder.json(&set_workspace_slack_oauth_config_request);
5151
5152    let local_var_req = local_var_req_builder.build()?;
5153    let local_var_resp = local_var_client.execute(local_var_req).await?;
5154
5155    let local_var_status = local_var_resp.status();
5156    let local_var_content = local_var_resp.text().await?;
5157
5158    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5159        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
5160    } else {
5161        let local_var_entity: Option<SetWorkspaceSlackOauthConfigError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
5162        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5163        Err(Error::ResponseError(local_var_error))
5164    }
5165}
5166
5167pub async fn set_ws_specific(configuration: &configuration::Configuration, workspace: &str, set_ws_specific_request: models::SetWsSpecificRequest) -> Result<String, Error<SetWsSpecificError>> {
5168    let local_var_configuration = configuration;
5169
5170    let local_var_client = &local_var_configuration.client;
5171
5172    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/set_ws_specific", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
5173    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
5174
5175    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5176        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5177    }
5178    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
5179        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
5180    };
5181    local_var_req_builder = local_var_req_builder.json(&set_ws_specific_request);
5182
5183    let local_var_req = local_var_req_builder.build()?;
5184    let local_var_resp = local_var_client.execute(local_var_req).await?;
5185
5186    let local_var_status = local_var_resp.status();
5187    let local_var_content = local_var_resp.text().await?;
5188
5189    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5190        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
5191    } else {
5192        let local_var_entity: Option<SetWsSpecificError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
5193        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5194        Err(Error::ResponseError(local_var_error))
5195    }
5196}
5197
5198pub async fn test_data_table_connection(configuration: &configuration::Configuration, workspace: &str, datatable_name: &str) -> Result<models::TestDataTableConnection200Response, Error<TestDataTableConnectionError>> {
5199    let local_var_configuration = configuration;
5200
5201    let local_var_client = &local_var_configuration.client;
5202
5203    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/test_datatable_connection/{datatable_name}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), datatable_name=crate::apis::urlencode(datatable_name));
5204    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
5205
5206    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5207        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5208    }
5209    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
5210        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
5211    };
5212
5213    let local_var_req = local_var_req_builder.build()?;
5214    let local_var_resp = local_var_client.execute(local_var_req).await?;
5215
5216    let local_var_status = local_var_resp.status();
5217    let local_var_content = local_var_resp.text().await?;
5218
5219    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5220        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
5221    } else {
5222        let local_var_entity: Option<TestDataTableConnectionError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
5223        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5224        Err(Error::ResponseError(local_var_error))
5225    }
5226}
5227
5228pub async fn unarchive_workspace(configuration: &configuration::Configuration, workspace: &str) -> Result<String, Error<UnarchiveWorkspaceError>> {
5229    let local_var_configuration = configuration;
5230
5231    let local_var_client = &local_var_configuration.client;
5232
5233    let local_var_uri_str = format!("{}/workspaces/unarchive/{workspace}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
5234    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
5235
5236    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5237        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5238    }
5239    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
5240        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
5241    };
5242
5243    let local_var_req = local_var_req_builder.build()?;
5244    let local_var_resp = local_var_client.execute(local_var_req).await?;
5245
5246    let local_var_status = local_var_resp.status();
5247    let local_var_content = local_var_resp.text().await?;
5248
5249    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5250        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
5251    } else {
5252        let local_var_entity: Option<UnarchiveWorkspaceError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
5253        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5254        Err(Error::ResponseError(local_var_error))
5255    }
5256}
5257
5258/// Updates the operator settings for a specific workspace. Requires workspace admin privileges.
5259pub async fn update_operator_settings(configuration: &configuration::Configuration, workspace: &str, operator_settings: Option<models::OperatorSettings>) -> Result<String, Error<UpdateOperatorSettingsError>> {
5260    let local_var_configuration = configuration;
5261
5262    let local_var_client = &local_var_configuration.client;
5263
5264    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/operator_settings", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
5265    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
5266
5267    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5268        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5269    }
5270    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
5271        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
5272    };
5273    local_var_req_builder = local_var_req_builder.json(&operator_settings);
5274
5275    let local_var_req = local_var_req_builder.build()?;
5276    let local_var_resp = local_var_client.execute(local_var_req).await?;
5277
5278    let local_var_status = local_var_resp.status();
5279    let local_var_content = local_var_resp.text().await?;
5280
5281    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5282        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
5283    } else {
5284        let local_var_entity: Option<UpdateOperatorSettingsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
5285        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5286        Err(Error::ResponseError(local_var_error))
5287    }
5288}
5289
5290pub async fn update_protection_rule(configuration: &configuration::Configuration, workspace: &str, rule_name: &str, update_protection_rule_request: models::UpdateProtectionRuleRequest) -> Result<String, Error<UpdateProtectionRuleError>> {
5291    let local_var_configuration = configuration;
5292
5293    let local_var_client = &local_var_configuration.client;
5294
5295    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));
5296    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
5297
5298    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5299        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5300    }
5301    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
5302        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
5303    };
5304    local_var_req_builder = local_var_req_builder.json(&update_protection_rule_request);
5305
5306    let local_var_req = local_var_req_builder.build()?;
5307    let local_var_resp = local_var_client.execute(local_var_req).await?;
5308
5309    let local_var_status = local_var_resp.status();
5310    let local_var_content = local_var_resp.text().await?;
5311
5312    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5313        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
5314    } else {
5315        let local_var_entity: Option<UpdateProtectionRuleError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
5316        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5317        Err(Error::ResponseError(local_var_error))
5318    }
5319}
5320
5321pub async fn update_shared_ui(configuration: &configuration::Configuration, workspace: &str, update_shared_ui_request: models::UpdateSharedUiRequest) -> Result<String, Error<UpdateSharedUiError>> {
5322    let local_var_configuration = configuration;
5323
5324    let local_var_client = &local_var_configuration.client;
5325
5326    let local_var_uri_str = format!("{}/w/{workspace}/shared_ui", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
5327    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
5328
5329    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5330        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5331    }
5332    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
5333        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
5334    };
5335    local_var_req_builder = local_var_req_builder.json(&update_shared_ui_request);
5336
5337    let local_var_req = local_var_req_builder.build()?;
5338    let local_var_resp = local_var_client.execute(local_var_req).await?;
5339
5340    let local_var_status = local_var_resp.status();
5341    let local_var_content = local_var_resp.text().await?;
5342
5343    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5344        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
5345    } else {
5346        let local_var_entity: Option<UpdateSharedUiError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
5347        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5348        Err(Error::ResponseError(local_var_error))
5349    }
5350}
5351
5352pub async fn upsert_datatable_migration(configuration: &configuration::Configuration, workspace: &str, datatable_name: &str, upsert_datatable_migration_request: models::UpsertDatatableMigrationRequest) -> Result<String, Error<UpsertDatatableMigrationError>> {
5353    let local_var_configuration = configuration;
5354
5355    let local_var_client = &local_var_configuration.client;
5356
5357    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/upsert_datatable_migration/{datatable_name}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), datatable_name=crate::apis::urlencode(datatable_name));
5358    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
5359
5360    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5361        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5362    }
5363    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
5364        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
5365    };
5366    local_var_req_builder = local_var_req_builder.json(&upsert_datatable_migration_request);
5367
5368    let local_var_req = local_var_req_builder.build()?;
5369    let local_var_resp = local_var_client.execute(local_var_req).await?;
5370
5371    let local_var_status = local_var_resp.status();
5372    let local_var_content = local_var_resp.text().await?;
5373
5374    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5375        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
5376    } else {
5377        let local_var_entity: Option<UpsertDatatableMigrationError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
5378        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5379        Err(Error::ResponseError(local_var_error))
5380    }
5381}
5382