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