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