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